uuid stringlengths 36 36 | repo_name stringlengths 5 133 | relative_path stringlengths 3 3.76k | content stringlengths 282 4.03M | category stringclasses 6
values | algo_rel_score float32 0.9 1 | quality_score float32 3 8.13 | source_meta dict |
|---|---|---|---|---|---|---|---|
86583cd6-62be-4d6d-b4a7-4a1b1882a91b | acg7878/PAT_code | CODE/81-90/82(不会)/my.cpp | #include <iostream>
#include <string>
#include <unordered_map>
#include <vector>
std::unordered_map<int, std::string> units = {
{2, "Shi"}, {3, "Bai"}, {4, "Qian"}, {5, "Wan"},
{6, "Shi"}, {7, "Bai"}, {8, "Qian"}, {9, "Yi"},
{10, "Shi"}, {11, "Bai"}, {12, "Qian"}};
std::unordered_map<char, std:... | ALGO | 0.999823 | 4.323889 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2024-07-20T16:39:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81c85641712... |
99e2565d-c31b-45de-9a5d-e9c5b5a58fda | yjdong9697/Baekjoon-practice_cpp | baekjoon_1327.cpp | #include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
using namespace std;
int main(void){
fastio;
set<string> s;
int n, k;
cin >> n >> k;
string ans = "";
for(int i = 1; i <= n; i++){
ans += to_string(i);
}
queue<string> q;
strin... | ALGO | 0.999915 | 3.332347 | {
"github_metadata": {
"branch": "master",
"commit_count": 565,
"repo_created_at": "2020-07-23T15:44:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd058535... |
fbdabda7-4418-4560-8025-b2005f8b87dd | Monal-Patel/amrsolver | exm/IBM/Channel/prob.h | #ifndef CNS_PROB_H_
#define CNS_PROB_H_
#include <AMReX_Geometry.H>
#include <AMReX_FArrayBox.H>
#include <AMReX_ParmParse.H>
#include <Closures.h>
using namespace amrex;
namespace PROB {
////////////////////////////////EQUATIONS///////////////////////////////////////
// Select the variables to solve/store and wri... | ALGO | 0.996343 | 5.88556 | {
"github_metadata": {
"branch": "main",
"commit_count": 221,
"repo_created_at": "2023-02-22T11:24:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1befed329a... |
8c2e082e-da3b-481f-b282-def636c89bc3 | omteja04/LeetCode | 1073-number-of-enclaves/1073-number-of-enclaves.cpp | class Solution {
public:
void dfs(int i, int j, vector<vector<int>>& grid,
vector<vector<bool>>& vis) {
if (i < 0 || i >= grid.size() || j < 0 || j >= grid[i].size() ||
vis[i][j] || grid[i][j] == 0) {
return;
}
vector<pair<int, int>> dir = {{-1, 0}, {0, ... | ALGO | 0.999973 | 6.440003 | {
"github_metadata": {
"branch": "main",
"commit_count": 1088,
"repo_created_at": "2024-08-17T06:11:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be6a7a955... |
161ea2de-22f7-42d0-b0cf-53fe7bbfcaa3 | MathProgrammer/AtCoder | Contests/AtCoder Beginner Contest 165/Programs/LIS On Tree.cpp | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
const int MAX_N = 2e5 + 5;
vector <stack <int> > minimum_ending_of_length(MAX_N);
vector <int> A(MAX_N);
vector <vector <int> > tree(MAX_N);
vector <int> LIS_here(MAX_N);
int find_first_greater(int n)
{
int left = 0, right = MAX_N - 1;
... | ALGO | 0.999843 | 4.536451 | {
"github_metadata": {
"branch": "master",
"commit_count": 443,
"repo_created_at": "2017-07-15T13:50:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 35,
"forks": 20,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "71dba1... |
783853a5-8a74-445e-bc95-e58dc78462e1 | ashok757/comp116 | lab5.cpp | #include<iostream>
#include<math.h>
using namespace std;
class point {
public:
double x,y;
void setpoint (double ,double);
double getx()
{return x;}
double gety()
{return y;}
double distance (point &);
};
class polygon : public point
{
public:
point a[4],z;
int ver_no;
... | ALGO | 0.998738 | 3.723406 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2020-11-15T10:22:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fed061723e9c... |
466f930d-3b60-4550-9922-e8d4d028c839 | Mulab11/cntt2016-hw1 | TC-SRM-579-div1-250/mhy.cpp | #include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <typeinfo>
#include <fstream>
using namespace std;
class UndoHistory {
public:
int minPresses(vector<string> lines) {
//s... | TEST | 0.999319 | 4.607053 | {
"github_metadata": {
"branch": "master",
"commit_count": 4450,
"repo_created_at": "2016-09-28T13:04:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 31,
"forks": 28,
"issues": 0,
"pull_requests": 8
},
"file_meta": {
"content_id": "e32d0... |
14ceb85c-3567-4703-bb0e-f9f6aba77f81 | alexandraback/datacollection | solutions_5751500831719424_0/C++/andrei14vl/A.cpp | #include <cstdio>
#include <cstring>
char ch[109][109];
int freq[109][109];
int main()
{
int T;
freopen("date.in", "r", stdin);
freopen("date.out", "w", stdout);
scanf("%d", &T);
for (int tt = 1; tt <= T; ++tt)
{
memset(freq, 0, sizeof(freq));
int N, sol = 0;
scanf("%d\n", &N);
for (int i = 1; i <= N;... | ALGO | 0.999861 | 3.325845 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "094b904e4... |
7cab8602-9107-47c9-a2c9-60729e3fd8f7 | katybucsa/coursera | Data Structures and Algorithms Specialization/Algorithmic Toolbox/CourseraDataStructuresAndAlgorithms/Week 4/sorting.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
using std::vector;
using std::swap;
int partition2(vector<int>& a, int l, int r) {
int x = a[l];
int j = l;
for (int i = l + 1; i <= r; i++) {
if (a[i] <= x) {
j++;
swap(a[i], a[j]);
}
}
swap(a[l], a[j]);
return j;
}
std::pair<int, int> partit... | ALGO | 0.999959 | 5.237279 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2021-01-09T21:06:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8fe7bd2bb5... |
d0a229b9-461d-4eff-9041-07d983a568a2 | SMiles02/cp-submissions | codeforces/1994/A..cpp | #include <bits/stdc++.h>
#define ll long long
#define sz(x) (int)(x).size()
using namespace std;
// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// uniform_int_distribution<int>(1000,10000)(rng)
string to_upper(string a) {
for (int i=0;i<(int)a.size();++i) if (a[i]>='a' && a[i]<='z') a[i]-=... | ALGO | 0.999434 | 3.631757 | {
"github_metadata": {
"branch": "master",
"commit_count": 1368,
"repo_created_at": "2024-07-10T12:27:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "99df87c... |
f000faeb-5354-45a9-8fd0-0d87d54e39ac | HnpawsPham/CP-PROBLEMS | IT_Squad_Journey/THPT/Cày_đề/CDTQG_V2_DAK_LAK_23_24/KHOBAU.CPP | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define el "\n"
int n;
int main(){
freopen("KHOBAU.INP", "r", stdin);
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin>>n;
ll l[n + 1], w[n + 1];
for(int i = 1; i <= n; i++) cin>>l[i]>>w[i];
ll max_l[n + 1][n + ... | ALGO | 0.999959 | 3.690045 | {
"github_metadata": {
"branch": "main",
"commit_count": 128,
"repo_created_at": "2024-07-14T14:00:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a34853247... |
9b247230-1989-4b42-b0de-1f354a2e2039 | Brydzia96/Projects | Programming_projects/Snake/src/snake.cpp | #include <snake.h>
#include <QDebug>
Snake::Snake(glm::vec2 _origin, glm::vec2 _direction)
{
m_segments.append(_direction);
m_origin = _origin;
m_piecesCount = glm::length(_direction);
}
void Snake::move(glm::vec2 _move)
{
m_currentDirection = glm::normalize(m_segments.last());
if(_move != glm::vec2(0.... | TOOL | 0.909567 | 5.2086 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2021-10-01T09:21:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc0c1573e9a... |
4550b96b-34dc-43ca-9d93-b4d624c27edc | Dfupa/last | src/GappedXdropAligner2qual.cc | // Copyright 2011, 2012, 2013 <NAME>
#include "GappedXdropAligner.hh"
#include "GappedXdropAlignerInl.hh"
#include "TwoQualityScoreMatrix.hh"
namespace cbrc {
static bool isDelimiter2qual(uchar c) {
return c == 4; // a bit ugly (hard-wired delimiter value)
}
int GappedXdropAligner::align2qual(const uchar *seq1,
... | ALGO | 0.994945 | 6.91458 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-11-30T10:12:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1328a2e60c1e... |
669d20c6-8a92-480f-8e16-6608efe43ba9 | yuchaozh/Cracking-The-Coding-Interview | Chapter 2/2.5/2.5.cpp | /*Question:
*Given a circular linked list, implement an algorithm which
*returns node at the beginning of the loop.
*Circular linked list: A (corrupt) linked list in which a
*node's next pointer points to an earlier node, so as to make
*a loop in the linked list.
*EXAMPLE
*Input:A->B->C->D->E->F->C (the same C... | ALGO | 0.999956 | 5.175964 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2013-12-01T07:24:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03e4c8709... |
3d12985f-5f42-4d4a-89e2-ff78d359f3fd | snl-dakota/dakota-packages | acro/packages/interfaces/src/libs/MOMHLib.cpp | /* _________________________________________________________________________
*
* Acro: A Common Repository for Optimizers
* Copyright (c) 2008 Sandia Corporation.
* This software is distributed under the BSD License.
* Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
* the U.S. Governm... | ALGO | 0.983932 | 5.273254 | {
"github_metadata": {
"branch": "devel",
"commit_count": 279,
"repo_created_at": "2021-08-17T16:15:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 6,
"issues": 5,
"pull_requests": 1
},
"file_meta": {
"content_id": "1c6eb37225... |
64a989b2-4839-4b1d-be81-0f05d6d3c65d | Pankajesc/Leetcode | 0112-path-sum/0112-path-sum.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999979 | 5.772091 | {
"github_metadata": {
"branch": "main",
"commit_count": 796,
"repo_created_at": "2023-05-29T10:33:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "502a5851fb... |
14e05304-0ec9-45c5-b789-dc5a64338cf9 | dragan224/hackerrank | Moody's Analytics Fall University CodeSprint/Modified Subsequence Sum.cpp | #include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <unordered_map>
#include <vector>
using name... | ALGO | 0.999927 | 3.954837 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2016-12-24T15:05:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75a9c71f22... |
dfad84d2-641d-4e84-b1da-3dc00d22167d | actium/codeforces | 1400/40/1440b.cpp | #include <iostream>
#include <vector>
template <typename T>
std::istream& operator >>(std::istream& input, std::vector<T>& v)
{
for (T& a : v)
input >> a;
return input;
}
void answer(unsigned long long v)
{
std::cout << v << '\n';
}
void solve(size_t n, size_t k, const std::vector<unsigned>& a)
... | ALGO | 0.999936 | 4.969613 | {
"github_metadata": {
"branch": "master",
"commit_count": 4876,
"repo_created_at": "2020-06-17T16:27:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cda1474... |
a11f552b-224c-4fd4-bb7d-e4005bc3a764 | alherit/kd-switch-cpp | example.cpp | using namespace std;
#include <cstddef>
#include <cstdlib>
#include <random>
#include <vector>
#include <list>
#include <iostream>
#include <sstream>
#include <fstream>
#include "kds/LogWeightProb.hpp"
#include <chrono>
#include <math.h>
#include "kds/kds.hpp"
int main()
{
auto start = std::chrono::high_resolu... | ALGO | 0.998055 | 5.459602 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2019-12-04T15:29:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f8abf02e... |
8778581d-68ba-489f-9d12-799b9901a833 | sachinsharma995/DSA_WITH_C- | array/linear.cpp | // #include <iostream>
// using namespace std;
// int main()
// {
// int arr[] = {10, 20, 30, 40, 50};
// int size = 5;
// int key;
// cout << "Enter the number: ";
// cin >> key;
// bool flag = 0;
// // flag =0 means absent
// // flag =1 means present
// for (int i = 0; i < size; i... | ALGO | 0.999532 | 4.253858 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-03-12T14:06:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0dd979dfcca... |
1b57016a-4878-4986-b3dd-17c2e93849bb | ibudiselic/contest-problem-solutions | tc 160+/SquareFreeSets.cpp | #include <algorithm>
#include <cassert>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cstring>
#include <map>
using namespace std;
bool is_prime(int x) {
for (int d=2; d*d<=x; ++d) {
if (x%d == 0) {
return false;
}
}
retu... | ALGO | 0.999921 | 4.827644 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2011-08-14T11:43:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b4cc20fc2... |
0b5bd38e-473b-4b2d-84e2-a58225cb746b | Iris6373/Competitve-Programming | Codeforces Round #702 (Div. 3)/F.cpp | // Problem : https://codeforces.com/contest/1490/problem/F
// Iris_6373
#include <bits/stdc++.h>
using namespace std;
typedef int ll;
typedef vector<ll> vt;
typedef pair<ll, ll> pr;
typedef vector<pr> vp;
typedef map<ll, ll> mp;
#define F first
#define S second
#define mp make_pair
#define l(x) (int)(x).length()
#def... | ALGO | 0.999965 | 4.081965 | {
"github_metadata": {
"branch": "main",
"commit_count": 192,
"repo_created_at": "2021-06-28T06:35:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4de0688b8f... |
591a59d7-5b11-4df0-864e-de93187c4771 | aaryan6789/cppSpace | Graphs/_graph.cpp | #include "_graph.h"
// BFS Traversal
// Source Node = s
void Graph::BFS(int s){
// Mark all the nodes as Visited
vector<bool> visited(num_v, false);
// Create a Queue for BFS
list<int> queue;
// Mark the current node as visited
visited[s] = true;
queue.push_back(s);
list<int>::iterat... | ALGO | 0.998596 | 3.283337 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2019-10-22T05:39:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3bf95e10... |
1561de10-ef62-4c95-a932-b638de41dafd | TheNinza/dsa-visualizer | public/codes/bfs/bfs.cpp | // CPP program to implement BFS
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
// Declaring the vectors to store color, distance
// and predecessor
vector<string> colour;
vector<int> d;
vector<int> p;
/* This function adds an edge to the graph using a linked list representation.
It is an ... | ALGO | 0.99999 | 6.238871 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2021-06-08T05:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 11,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f9dd8e130... |
a55e8030-2320-4bb4-9a75-590ad252e064 | phuocnguyn/Data-structures-and-algorithms | sort/InsertionSort.cpp | #include <iostream>
using namespace std;
void InsertionSort(int A[], int size)
{
for (int i = 1; i < size; i++)
{
int key = A[i]; // lưu giá trị của A[i] hiện tại
int j = i - 1;
while (A[j] > key && j >= 0) // tìm vị trí j cần chèn ( nhỏ hơn key)
{
A[j+1] = A[j]; // ... | ALGO | 0.999941 | 4.956307 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-11-14T03:50:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "84664b8cab0... |
b73874ba-cf69-43e7-9c35-45758ad7cc96 | bernard30653/leetcode | Hashing/2225_find_players_with_zeros.cpp | #include <iostream>
#include <vector>
using namespace std;
/*
2225. Find Players With Zero or One Losses
You are given an integer array matches where matches[i]
= [winneri, loseri] indicates that the player winneri defeated player loseri in a match.
Return a list answer of size 2 where:
answer[0] is a list of all pla... | ALGO | 0.999488 | 5.137233 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-02-10T07:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52e490ae594f... |
113b365f-5f14-4580-9b67-4e22a8825162 | ParkhiyaParth/CPP-Programming | CodeForces/Problems/Codeforces Round 981 (Div. 3)/B_Sakurako_and_Water.cpp | #include <iostream>
#include <bits/stdc++.h>
#define ll long long
using namespace std;
void solve()
{
int n;
cin >> n;
vector<vector<ll>> a(n, vector<ll>(n));
for (ll i = 0; i < n; i++)
{
for (ll j = 0; j < n; j++)
{
cin >> a[i][j];
}
}
ll op = 0;
for ... | ALGO | 0.999879 | 4.409758 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-12-27T06:44:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83d957310ab... |
8c6d5e5a-a6c0-4ccf-ba62-60bb12cf1ee6 | huibosa/programming | algorithm/algorithms-4ed/ch2/sec1/exercise/12.cpp | /* 2.1.12 Instrument shellsort to print the number of compares divided by the array size */
/* for each increment. Write a test client that tests the hypothesis that this number is a */
/* small constant, by sorting arrays of random Double values, using array sizes that are */
#include <iostream>
#include <vector>... | ALGO | 0.999106 | 5.484708 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2022-03-20T09:18:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dcb2db8b42f... |
1f9d7601-01cd-499f-9d72-12ea62b541da | risal-shefin/Competitive-Programming | CodeForces/Solutions/123A.cpp | // #pragma GCC optimize("Ofast,unroll-loops")
// #pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define dd double
#define ld long double
#define sl(n) scanf("%lld", &n)
#define si(n) scanf("%d", &n)
#define sd(n) scanf("%lf", &n)
#d... | ALGO | 0.999999 | 3.573706 | {
"github_metadata": {
"branch": "master",
"commit_count": 139,
"repo_created_at": "2019-06-28T19:28:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "91985db... |
35a56abb-326a-4eb4-acc6-cb6ab2302efa | dov/giv | src/WordBoundaries.h | //======================================================================
// WordBoundaries.h - Non copy parsing of line based syntaxes.
//
// <NAME> <<EMAIL>>
// Fri Apr 6 09:23:51 2018
//----------------------------------------------------------------------
#ifndef WORDBOUNDARIES_H
#define WORDBOUNDARIES_H
#inclu... | TOOL | 0.926025 | 6.223056 | {
"github_metadata": {
"branch": "master",
"commit_count": 267,
"repo_created_at": "2011-04-06T11:44:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 5,
"issues": 38,
"pull_requests": 1
},
"file_meta": {
"content_id": "19bd79... |
1eb1fbc9-f9f6-413e-907d-305000fe1d68 | Wild-Donkey/Code | Luogu/P7000-P7999/P7519_PrSl2021_Roll_Table.cpp | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
#define Wild_Donkey 0
using namespace std;
inline unsigned RD()... | ALGO | 0.999848 | 3.217364 | {
"github_metadata": {
"branch": "main",
"commit_count": 182,
"repo_created_at": "2021-02-23T08:38:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d6adeb1b8... |
5e943243-7bc5-4695-877a-ec939bd18834 | Primo18/project02-Mapas | src/MapHash.cpp | #include "MapHash.h"
MapHash::MapHash(int N)
{
mapSize = 0;
capacity = N;
primes = {
11,
23,
43,
101,
503,
1009,
2053,
3001,
4111,
5003,
6007,
7001,
8231,
9203,
10007,
12037,
... | ALGO | 0.97439 | 4.015096 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-07-14T09:04:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d179466bcc9... |
9a829f5d-6e70-45fb-bf25-ba1777a90231 | realAYAYA/UnrealEngine-ToonLit | UnrealEngine/Engine/Plugins/Runtime/GeometryProcessing/Source/DynamicMesh/Private/Operations/PlanarFlipsOptimization.cpp | // Copyright Epic Games, Inc. All Rights Reserved.
#include "Operations/PlanarFlipsOptimization.h"
#include "DynamicMesh/DynamicMesh3.h"
#include "MathUtil.h"
#include "VectorTypes.h"
using namespace UE::Geometry;
namespace UE {
namespace PlanarFlipsOptimizationLocals{
/** @return triangle aspect ratio transformed... | ALGO | 0.997334 | 7.19902 | {
"github_metadata": {
"branch": "5.4",
"commit_count": 164,
"repo_created_at": "2023-03-14T06:10:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 66,
"forks": 9,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe38bb7de2... |
cec28c87-3534-4aa3-b96d-92bc5a2866dc | gavinleroy/puzzles | HackerEarth/shortest_paths_revisited.cpp | #include <cmath>
#include <string>
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned long ul;
typedef double lf;
typedef long double llf;
typedef bool bl;
#define I __attribute__((always_inline))inline
template<typename T> I T max(T a,T b){return a>b?a:b;}
template<typena... | ALGO | 0.999989 | 3.231336 | {
"github_metadata": {
"branch": "master",
"commit_count": 494,
"repo_created_at": "2019-05-14T02:13:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9914cc0... |
74c0e0df-1c63-4ee1-8c74-e4c3326caf68 | shushrutsharma/18CSC304J-CD | 4-Left Recursion and Left Factoring/leftRec.cpp | #include<iostream>
#include<string>
using namespace std;
int main()
{ string ip,op1,op2,temp;
int sizes[10] = {};
char c;
int n,j,l;
cout<<"Enter the Parent Non-Terminal : ";
cin>>c;
ip.push_back(c);
op1 += ip + "\'->";
ip += "->";
op2+=ip;
cout<<"Enter the number of productions... | ALGO | 0.999713 | 3.508589 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2021-01-22T04:47:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 92,
"forks": 72,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "7393804... |
2d0078c6-7e33-4ec4-b70a-52428e42b041 | deepak-ky/cpp-codes | cpp-codes/hostel_visit.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define varname(name) #name
#define mod 1000000007
#define wer(x) cout<<"\n"<<varname(x)<<" here : "<<x
#define test int t;... | ALGO | 0.999868 | 3.838093 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-12-30T08:47:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "69f263186978... |
b9271095-902e-4b90-a40a-60d7af840817 | encrypted-def/BOJ | 13509.cpp | #include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
typedef long long ll;
map<int, int> compCoor;
int dist[200003];
vector<int > seg;
vector<tuple<int, int, int> > V;
int N;
void init() {
for (int i = N - 1; i > 0; i--)
seg[i] = max(seg[i << 1], seg[i << 1 ^ 1]);
}
void update(int i, int v... | ALGO | 0.999985 | 4.741483 | {
"github_metadata": {
"branch": "master",
"commit_count": 624,
"repo_created_at": "2017-12-21T06:12:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 28,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "673c06... |
4f5920ba-8e30-44a6-aa30-e9d8466607d7 | dukkar2017/codeninja | binarytrees/lca.cpp | #include "utils.h"
bool foundA = false;
bool foundB = false;
node *lca = NULL;
size_t visited = 0;
void
findLCA(node *e,
const string &a,
const string &b)
{
if (e == NULL)
{
return;
}
++visited;
cout << "Visiting " << e->val << endl;
if (foundA && foundB)
{
... | ALGO | 0.999934 | 4.672168 | {
"github_metadata": {
"branch": "master",
"commit_count": 97,
"repo_created_at": "2018-04-14T23:30:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b23f021ab... |
c65079a6-f886-47bd-b128-451b67a9c8fa | Leodicap99/leetcode | HEAP/692. Top K Frequent Words.cpp | /*
We will be using minheap as it is more space optimized.
The idea is to store the top k frequent words in a minheap that means the most frequent word will be at the end of the minheap(leaf of the tree).
we have to build a heap such a way that it stores the frequency of the string as well as the string itself.
*/
... | ALGO | 0.999998 | 6.215774 | {
"github_metadata": {
"branch": "master",
"commit_count": 286,
"repo_created_at": "2020-04-23T14:33:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5d5b1d... |
0adc32ac-88db-4b46-839a-0867ddc51e6f | jeff665547/Cloud-Storage | CPP/OpenCV/ch5_intro_to_core_module/pixel.cpp | /* 影像在記憶體中的儲存方式 */
// 矩陣的大小取決於所用的色彩模型(所用的通道數),如果是灰階影像,矩陣就會如下方所示:
// col 0, col 1, col 2, col 3, ..., col m,
// row 0 0,0 0,1 0,2 0,3 0,m
// row 1 1,0 1,1 1,2 1,3 1,m
// row 2 2,0 2,1 2,2 2,3 2,m
// ... ...,0 ... | ALGO | 0.982174 | 3.656982 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-12-12T06:47:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d903097c3... |
5ca0f1fa-ac23-43ea-b785-b9e9094aa14d | satyamsen7/DSA | 14_06_2025_sparse_arrays.cpp | #include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
using namespace std;
vector<int> matchingStrings(vector<string> strings, vector<string> queries) {
unordered_map<string, int> stringCount;
for (const string& str : strings) {
stringCount[str]++;
}
vector<int> res... | ALGO | 0.999807 | 5.130389 | {
"github_metadata": {
"branch": "main",
"commit_count": 176,
"repo_created_at": "2025-06-13T20:27:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd8d9c228b... |
8e7bb3fb-e332-4c5b-9ee1-a1ac62158003 | dddddhow/VTI_FD | 1_ORDER_PML/程序备份/20190821/src/Parameter_func.cpp | #include"../lib/Parameter_func.h"
double parameter(PARAMETER* param)
{
//**模型参数
param -> NX=50;//x方向样点数
param -> NZ=50;//z方向样点数
param -> PML=20;//PML边界厚度
param -> Nt=1000;//模拟时间样点数
param -> dx=10.0;//x方向取样
param -> dz=10.0;//z方向取样
param -> dt=0.0005;//时间取样
//**各向异性参数**Thomson表征形式
... | TOOL | 0.932457 | 3.364129 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-12-08T06:42:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "709b215b58... |
304e0073-f29b-4f07-9564-8768e1d89372 | Orion545/OI-Record | Grade 10-12/2018 autumn/xsy.gdgzez.com.cn/9.5 contest/t1/std.cpp | #include <cstdio>
#include <algorithm>
#include <iostream>
using namespace std;
namespace IO{
const int S=10000005;
char buf[S];
int pos;
void load(){
fread(buf,1,S,stdin);
pos=0;
}
char getChar(){
return buf[pos++];
}
int getInt(){
int x=0,f=1;
ch... | ALGO | 0.999946 | 3.447514 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-05-26T05:47:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "124f6bccd1... |
1fd6d616-0231-4c13-884b-d5f1e69d625c | Ace-Monster/ACM-ICPC | 2018Contest200/Heap/i.cpp | #include<iostream>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<cmath>
#include<string>
#include<string.h>
#include<queue>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define sz(a) (int)a.s... | ALGO | 0.999047 | 3.495284 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2018-07-16T08:55:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "163b6313a... |
deacc26e-213d-4238-bef0-db66eb3582b8 | JHeroGR/CS-2-Work | hwAC1/autocompleter.cpp | //
// Created by tpc345 on 8/3/2018.
//
#include "autocompleter.h"
#include <iostream>
using namespace std;
// Creates a new, empty autocompleter.
Autocompleter::Autocompleter() {
count = 0;
capacity = 1;
A = new string[capacity];
for (int i = 0; i < capacity; i++) {
A[i] = "";
}
}
// Adds... | ALGO | 0.942969 | 3.651141 | {
"github_metadata": {
"branch": "master",
"commit_count": 153,
"repo_created_at": "2018-10-21T08:30:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb049982... |
c99a825b-14da-4ac2-a471-91d9cf8da365 | SigurdHuse/CodeForces | B/B. Dreamoon and WiFi.cpp | #include <bits/stdc++.h>
#define REP(i,n) for(int i = 0; i< (n);i++)
#define all(x) (x).begin(), (x).end()
#define f first
#define s second
#define SZ(a) (int)a.size()
#define bit(x,i)(((x)>>(i))&1)
typedef long long ll;
using namespace std;
void solve(){
string s1, s2; cin >> s1 >> s2;
int n = SZ(s1);
int off =... | ALGO | 0.999965 | 3.647523 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2022-01-29T11:49:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fed69d7dfe1... |
8c533594-6a45-4d2a-a3d7-6416d5c1bc5c | Atrix256/WebGL | CompSuper/KeyGenerator/Source.cpp | #include <stdio.h>
#include <algorithm>
#include <array>
#include <vector>
#include <boost/multiprecision/cpp_int.hpp>
#include "Shared/Shared.h"
#define USEPRIMES 0 // if 1, will use primes from file. else will calcuate co-primes
#define PRIMENUMBERSTARTINDEX 26 // this is the first 3 digit prime number: 101
#define... | ALGO | 0.99984 | 4.744542 | {
"github_metadata": {
"branch": "master",
"commit_count": 221,
"repo_created_at": "2015-04-27T19:55:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fadd4802... |
cfec374c-d949-4f45-aab2-f9d726c67fec | hasanur-rahman/XTIMATE | Baselines/a-ICDE22/run/src/predictRatio.cpp | // #include <iostream>
// #include <fstream>
// #include <string.h>
// #include <unistd.h>
// #include <sys/stat.h>
// #include <dirent.h>
// #include <ctime>
// #include <cstdlib>
// #include <random>
// #include <math.h>
// #include <iostream>
// #include <set>
// #include <map>
// #include <string>
// #include <algo... | DATA | 0.979913 | 4.319704 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-07-01T23:55:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "64df55a581e8... |
af7f3296-15fd-459b-9980-798d42c38f6d | RosettaCommons/rosetta | source/src/core/pack/rotamers/SingleBasicRotamerLibrary.cc | // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// (c) Copyright Rosetta Commons Member Institutions.
// (c) This file is part of the Rosetta software suite and is made available under license.
// (c) The Rosetta software is developed by the co... | ALGO | 0.962328 | 7.077854 | {
"github_metadata": {
"branch": "main",
"commit_count": 11737,
"repo_created_at": "2023-11-17T16:42:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 296,
"forks": 100,
"issues": 27,
"pull_requests": 9
},
"file_meta": {
"content_id": "fc73... |
97c7fadb-b1b9-4d6d-8734-ecdffd6ecba8 | matheusataidee/algos | contests/codeforces/741/b.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxx = 1e3 + 5;
bitset<maxx> is_prime;
vector<int> not_primes;
void init() {
is_prime.flip();
is_prime[1] = 0;
for (int i = 2; i * i < maxx; i++) {
if (is_prime[i]) {
int x = i * i;
while (x < maxx) {
is_prime[x] = 0;
x... | ALGO | 0.999871 | 3.726012 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2019-05-17T23:54:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58f97b2ee... |
8efa399d-bede-4d18-8903-81b4e071c217 | opencv/opencv | hal/riscv-rvv/src/core/lu.cpp | // This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
// Copyright (C) 2025, Institute of Software, Chinese Academy of Sciences.
#include "rvv_hal.hpp"
#include <cfloat>
#include... | ALGO | 0.998683 | 6.708983 | {
"github_metadata": {
"branch": "4.x",
"commit_count": 35401,
"repo_created_at": "2012-07-19T09:40:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 83079,
"forks": 56217,
"issues": 2595,
"pull_requests": 138
},
"file_meta": {
"content_id"... |
56f16026-9497-43f6-9308-f207bbd94ee8 | sreejitadass/DSA-Cpp | Arrays/spiralMatrix.cpp | #include <bits/stdc++.h>
using namespace std;
// right-->bottom-->left-->top
vector<int> findSpiralTraversal(vector<vector<int>> &mat, int n, int m)
{
vector<int> ans;
n = mat.size(); // rows
m = mat[0].size(); // cols
int top = 0, bottom = n - 1, left = 0, right = m - 1;
while (top <= bottom ... | ALGO | 0.999984 | 5.129796 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2024-07-15T09:46:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c34d8ef9... |
76459bff-03c1-47a0-80fe-aa113729052f | crackzar/V-PETDUINO | v_pet/antirebote.ino | /* si requiere mas informacion de esta funcion busque en la wiki de arduino ahi viene detallado como es que funciona */
/*esta es la funcion que se encarga de quitar el rebote de nuestros pulsadores ,
de igual forma podria haberse hecho con un anti rebote por harware con un capacitor electrolitico de 10Uf
en paralel... | ALGO | 0.924444 | 4.004522 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-03-21T06:49:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7337975d7c... |
3018c5ad-37d8-434f-bc49-ee3f33dfcd79 | panhomyoung/phyLS | src/commands/exact/exact_klut.hpp | /* phyLS: powerful heightened yielded Logic Synthesis
* Copyright (C) 2023 */
/**
* @file exact_klut.hpp
*
* @brief STP based exact synthesis for k-feasible LUT
*
* @author Homyoung
* @since 2023/12/19
*/
#ifndef EXACT_KLUT_HPP
#define EXACT_KLUT_HPP
#include <alice/alice.hpp>
#include <mockturtle/mockturtl... | ALGO | 0.975152 | 6.171817 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2022-12-14T00:51:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 30,
"forks": 7,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "fdfc27bf... |
b2a2eeb7-5baf-494c-8b37-97dfbbcbbc98 | Haller17/8-Queens-1D-While | Andrew_Haller 8Queens 1Dwhile.cpp | #include <iostream>
#include <cmath>
using namespace std;
bool ok(int arr[], int b){
for (int i=0; i<b; i++){
if (arr[i] == arr[b] || ((b-i) == (abs(arr[i] - arr[b]))))
return false;
}
return true;
}
void print (int arr[]){
static int S = 0;
cout<<"Solution: "<<++S<<endl;
for (int i=0; i<8... | ALGO | 0.999828 | 3.434067 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-11-22T07:00:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b67d3908db3e... |
6cca8103-3eaa-46e1-a9f6-019faddc2491 | RobertRoden/C-Programming | Lab7Debug.cpp | #include <iostream>
#include <string>
#include <iomanip>
using namespace std;
/* This program computes the score for a dive based on the degree of difficulty
* and five judges scores. The high and low scores are dropped.
//By <NAME>
/* Function prototypes */
void inputScores(double scores[]);
double addAllScores(d... | ALGO | 0.991408 | 4.766603 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-01-22T03:17:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8ba06c0d88... |
36c06aa5-16e3-487f-b556-6fa48afd12f8 | johnhhuber/TravelingSalesman | include/Graph.hpp |
/** \file Graph.hpp
* Travelling Salesman Project
* ACMS 60212
* Graph.hpp
* class will act as data structure to hold all points that travelling salesman will hit
* all cities are held in an unordered_set to try for most efficient lookups
* READER NEEDS TO BE CALLED FIRST SO THAT GRAPH SIZE IS KNOWN
*/
#ifnde... | ALGO | 0.951705 | 4.081679 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2017-03-09T20:50:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "56f288a5... |
a7656d0c-4d5d-4ef7-8069-bac8bd33fbeb | NgTienHungg/PTIT-Source | TRR 2/Kiểm tra/5_XayDungCayBaoTrumPrim.cpp | #include <bits/stdc++.h>
using namespace std;
int n, u, a[1005][1005], b[1005], f[1005];
vector<pair<int, int>> v;
int main() {
cin >> n >> u;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++)
cin >> a[i][j];
}
int s = 0, m = 0, dem = 0;
b[++m] = u;
f[u] = 1;
... | ALGO | 0.999949 | 3.749105 | {
"github_metadata": {
"branch": "main",
"commit_count": 106,
"repo_created_at": "2021-07-04T02:14:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 130,
"forks": 36,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df30730... |
27bff3c3-99f5-43f9-ad49-91777f258899 | nisan24/DSA-Mastery | Algorithms/Assignment_02/Building.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
const ll N = 1e5 + 10;
ll parent[N];
ll group_size[N];
void dsu_initialize(ll n)
{
for (int i = 1; i <= n; i++)
{
parent[i] = -1;
group_size[i] = 1;
}
}
ll dsu_find(ll node)
{
if (parent[node] == -1)
{
... | ALGO | 0.999917 | 4.786499 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-02-26T12:03:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d6679085f45... |
ca623c54-de41-4f5e-9026-101f08986347 | Kitware/VTK | Common/Core/vtkArraySort.h | // SPDX-FileCopyrightText: Copyright (c) <NAME>, <NAME>, <NAME>
// SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
/**
* @class vtkArraySort
* @brief Controls sorting of sparse array coordinates.
*
*
* vtkArraySort stores an ordered se... | TOOL | 0.989689 | 6.565909 | {
"github_metadata": {
"branch": "master",
"commit_count": 94968,
"repo_created_at": "2010-04-27T15:12:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2910,
"forks": 1246,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0... |
0fed510d-498b-4304-be3c-c27de2d25f26 | v-spath/diamond-blastn | src/data/enum_seeds.h | #pragma once
#include <thread>
#include "block/block.h"
#include "../search/seed_complexity.h"
#include "../util/ptr_vector.h"
#include "../basic/seed_iterator.h"
#include "../basic/shape_config.h"
#include "../masking/masking.h"
#include "flags.h"
template<typename F, typename Filter>
Search::SeedStats enum_seeds(Seq... | ALGO | 0.969124 | 6.151543 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-03-03T21:32:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef24b1b1a973... |
6b489c7c-8996-4fe0-ba9d-2796aabcedbf | SuperStarKang/Be_The_Monster | 3190.cpp | #include <iostream>
#include <vector>
#include <deque>
using namespace std;
int N,K,L;
int map[101][101];
vector<pair<int, char>> directions;
deque<pair<int, int>> snake;
int main(void) {
cin >> N >> K;
int r,c;
for (int i=0; i<K; i++) {
cin >> r >> c;
map[r-1][c-1] = 2;
}
cin >> L;
int x;
char directio... | ALGO | 0.999801 | 3.671903 | {
"github_metadata": {
"branch": "main",
"commit_count": 183,
"repo_created_at": "2023-07-04T13:36:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b72125a20... |
51d5a9d8-5eac-4f4b-99ba-cc81999eb074 | ngthanhtrung23/CompetitiveProgramming | codeforces/100721/I.cpp |
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define REP(i,a) for(int i=0,_a=(a); i<_a; i++)
#define EACH(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)
#define DEBUG(x) { cout << #x << " = "; cout << (x) << en... | ALGO | 0.99973 | 3.418377 | {
"github_metadata": {
"branch": "master",
"commit_count": 4554,
"repo_created_at": "2019-04-04T14:21:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 90,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2aabc... |
97670d77-c189-479a-a561-4a5a837ecb21 | ethikka/advent_of_code | 2024/day16.cpp | #include <sstream>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <utility>
#include "../common/grid2d.h"
#include "../common/vector2.h"
#include "../common/lib.h"
struct work {
vector2<int> pos;
direction facing;
int64_t score;
std::vector<vector2<int>> history;
bool op... | ALGO | 0.9999 | 4.908336 | {
"github_metadata": {
"branch": "master",
"commit_count": 293,
"repo_created_at": "2023-11-27T10:47:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97258f60... |
16d42407-3827-4ec8-ae7c-d7419d9e5c64 | cchaeyoon/algo | 백준/Silver/10866. 덱/덱.cc | #include <iostream>
#include <deque>
#include <string>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, x;
cin >> n;
deque<int>d;
string command;
for (int i = 0; i < n; i++) {
cin >> command;
if (command == "push_front") {
cin >> x;
d.push_front(x);
}
else if (com... | ALGO | 0.999681 | 4.602198 | {
"github_metadata": {
"branch": "main",
"commit_count": 137,
"repo_created_at": "2024-09-30T13:29:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11bc81dd9d... |
c7c143d3-12a2-4e51-b4d0-1b5e458d26d1 | khanhvu207/competitiveprogramming | old_files/Codeforces/1288/e.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define ll long long
using namespace std;
const int N = 1e6;
int n, m, prevv[N], ft[N], low[N], high[N];
void upd(int x, int v) {
for (; x < N; x += x & (-x))
ft[x] += v;
}
int get(int x) {
int sum = 0;
for (; x >= 1; x -= x & (-x))
... | ALGO | 0.99998 | 4.005523 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2018-11-20T08:25:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "55fec51... |
ac87ad6c-1848-4a75-b5fc-2316ece75b45 | ddkunda/MyStanPkg | src/stanExports_my_stan_model2.h | // Generated by rstantools. Do not edit by hand.
/*
MyStanPkg is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MyStanPk... | DATA | 0.92863 | 6.112606 | {
"github_metadata": {
"branch": "main",
"commit_count": 80,
"repo_created_at": "2025-02-06T14:47:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98d056483e7... |
6cfe7e23-fdd5-4b10-a9c7-1891d69aa8f6 | TheAncientOwl/leetcode-problems | problems/1026.maximum-difference-between-node-and-ancestor.cpp | #include "TreeNode.hpp"
#include <limits>
#include <numeric>
/**
* Given the root of a binary tree, find the maximum value v for which there exist different nodes a and b where v = |a.val - b.val| and a is an ancestor of b.
* A node a is an ancestor of b if either: any child of a is equal to b or any child of a is a... | ALGO | 0.997674 | 6.563713 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2021-12-21T11:28:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f247102a57e... |
9d62630b-5841-4137-9e96-c9997edd7d75 | llnbn/Interviews | Interview Training/Coding_11/coding_11.cpp | /**
* URLify: Write a method to replace all spaces in a string with '%20'. You may
* assume that the string has sufficient space at the end to hold the additional
* characters, and that you are given the "true" length of the string. (Note: If
* implementing in Java, please use a character array so that you can perf... | ALGO | 0.997089 | 4.302574 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2021-01-20T22:13:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a39a61be6b... |
fd88172a-7237-41db-b71a-fc0d608ebabb | echo1nfin/programs | Queue.cpp | #include <iostream>
using namespace std;
struct Node
{
char data;
Node* next = nullptr;
Node* previous = nullptr;
};
struct Queue
{
Node* head = nullptr;
Node* tail = nullptr;
int size = 0;
};
void add(Queue*& queue, char data)
{
Node* newNode = new Node;
newNode->data = data;
i... | ALGO | 0.997998 | 3.50029 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2023-10-12T20:24:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "048bc04f927... |
9976414e-8cf3-45a3-8c1a-4e3dafe251fc | acastellanos95/Concurrent-Matrix-Sort | Matrix_Merge_Sort_Memory/Utils.h | //
// Created by andre on 10/20/21.
//
#ifndef MATRIX_MERGE_SORT_MEMORY_UTILS_H
#define MATRIX_MERGE_SORT_MEMORY_UTILS_H
#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <ios>
#include <fstream>
#include <sstream>
#include <thread>
#include <atomic>
#include <mutex>
#include <fi... | ALGO | 0.996507 | 5.459866 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-10-22T17:05:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fdb701b71804... |
08d586a5-6392-49d4-a818-248b2fcbc078 | gky360/contests | atcoder/agc033/b/Main.cpp | /*
[agc033] B - LRUD Game
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
const int MAX_H = 2e5;
const int MAX_W = 2e5;
const int MAX_N = 2e5;
const string ds = "LRUD";
const int dh[4] = {0, 0, -1, 1};
const i... | ALGO | 0.999955 | 4.173431 | {
"github_metadata": {
"branch": "master",
"commit_count": 1196,
"repo_created_at": "2017-12-10T10:00:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "325b80c... |
4eafa34a-92ab-477d-8567-84bb6c0f3301 | colinz2/playing | leetcode/dynamic_programming/0343_Integer_Break/main.cpp | //
// Created by colin on 2018-12-10.
//
//给定一个正整数 n,将其拆分为至少两个正整数的和,并使这些整数的乘积最大化。
// 返回你可以获得的最大乘积。
//
//示例 1:
//
//输入: 2
//输出: 1
//解释: 2 = 1 + 1, 1 × 1 = 1。
//示例 2:
//
//输入: 10
//输出: 36
//解释: 10 = 3 + 3 + 4, 3 × 3 × 4 = 36。
//说明: 你可以假设 n 不小于 2 且不大于 58。
#include "leetcode.h"
class Solution {
private:
vector<int> ... | ALGO | 0.999869 | 5.70058 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-03-23T11:41:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c6a2a1387d... |
829946a4-6a4d-42f6-b895-bdb2f97a83ec | uwf-fang/cop4534-examples | m05-brute-force/permutation.cpp | #include <iostream>
#include <vector>
using namespace std;
// Function prototypes
void allPermutations(vector<int> &arr);
void allPermutationsHelper(vector<int> &arr, int start, int n);
void allPermutations1(vector<int> &arr);
void swap(vector<int> &arr, int i, int j);
// Function to swap two integers in a vector
vo... | ALGO | 0.99975 | 6.095385 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-08-20T22:38:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40589a43431... |
d35c6ac4-33da-45e6-ab9e-264ba3e2207a | green-fox-academy/nmarton818 | week-08/day-02/ex-04-merge/main.cpp | #include <iostream>
int main() {
// please allocate a 10 long array and fill it with even numbers
// please allocate a 10 long array and fill it with odd numbers
// select an array, and push the elements into the another array
// print the array in descending order
// delete the arrays after you d... | ALGO | 0.982863 | 3.997863 | {
"github_metadata": {
"branch": "master",
"commit_count": 123,
"repo_created_at": "2018-10-25T10:51:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12dd74697... |
a583f542-9d86-49cd-bf62-2b97c0420fb3 | LukaMod/cpp-primer | chapter12/ex12_28.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <set>
using namespace std;
int main()
{
ifstream ifs("input.txt");
vector<string> input;
map<string, set<decltype(input.size())>> dictionary;
string text;
while (getline(ifs, text... | TOOL | 0.975795 | 3.648432 | {
"github_metadata": {
"branch": "master",
"commit_count": 374,
"repo_created_at": "2017-02-13T13:22:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ccf99d20... |
7321ea06-b9ba-45c2-9849-d767b3f5be8d | golborneville/BOJAlgorithm | BOJAlgorithm/2630색종이.cpp | #include<iostream>
#include<queue>
using namespace std;
int N;
int arr[130][130];
bool chk[130][130];
int side[7] = { 2,4,8,16,32,64,128 };
int cnt[2]; // 0 -> white, 1-> blue
bool chkarea(int x, int y, int color, int ss) {
for (int i = 0; i < ss; i++) {
for (int j = 0; j < ss; j++) {
if (arr[x + i][y + j] != c... | ALGO | 0.999831 | 4.253379 | {
"github_metadata": {
"branch": "master",
"commit_count": 160,
"repo_created_at": "2020-03-19T13:43:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "314a8980... |
90cc6674-5aae-46a6-9006-4ce9be0557da | protarie125/BOJ_15947 | main.cpp | #include <algorithm>
#include <bit>
#include <chrono>
#include <cmath>
#include <cstdint>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <ranges>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#... | ALGO | 0.99967 | 4.375707 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2025-01-25T05:35:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f12d7192f3... |
4cdbff3f-4758-4568-a46a-f2c4bd0b64ff | Kireck211/competitive | uva/624.cpp | #include <iostream>
using namespace std;
bool p[21];
bool visited[21];
int disks[21];
bool found = false;
void f(int j, long long maximum, long long *sum, int d) {
for(int i = 0; i < d; i++)
cout<<p[i]<<" ";
cout<<endl;
for(int i = 0; i < d; i++)
cout<<disks[i]<<" ";
cout<<endl;
if (found || j == d) {
retu... | ALGO | 0.999694 | 3.182565 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2017-09-29T23:04:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a8c3af58... |
c94a342a-7fd7-4166-a0ae-6c669b1109c4 | ORLab-repo/VRPRDL | SeqData.h | #pragma once
#include "Param.h"
/*
* Based on paper "A unified solution framework for multi-attribute vehicle routing problems"
*/
class SeqData
{
public:
//attributes:
int firstnode;//index location
int afterFiNode;// index after first node
int lastnode;//index location
int beforeLaNode;// index before last no... | ALGO | 0.998755 | 4.369768 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2022-12-18T14:17:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "49fa4caade... |
98f33fb0-7d90-4e3e-80be-361c8129bb92 | ggslc/bisicles-uob | code/src/ISMIP6OceanForcing.cpp | #ifdef CH_LANG_CC
/*
* _______ __
* / ___/ / ___ __ _ / / ___
* / /__/ _ \/ _ \/ V \/ _ \/ _ \
* \___/_//_/\___/_/_/_/_.__/\___/
* Please refer to Copyright.txt, in Chombo's root directory.
*/
#endif
// concrete class encapsulating surface fluxes determined
// by ISMIP6 ocean forc... | ALGO | 0.925407 | 4.553326 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2023-08-14T11:59:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 5,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "246fd55e... |
502b2057-8bbb-4ba9-83fb-c37c454c8645 | ych051/csp_code | 2-1-1/rotate_integer.cc | #include <iostream>
using namespace std;
void rotateLeft(int* pa, int* pb, int* pc)
{
int nul = *pa;
int* nll=&nul;
*pa=*pb;
*pb=*pc;
*pc=*nll;
}
void rotateRight(int* pa, int* pb, int* pc)
{
int nul = *pc;
int* nll=&nul;
*pc=*pb;
*pb=*pa;
*pa=*nll;
}
int main(void)
{
ch... | ALGO | 0.999693 | 3.654196 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-10-14T04:41:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "20170deccd8... |
f2bb9d37-04d3-460a-8bcc-16305a5ce3d1 | ishandutta2007/codeforces-g | golovanov399/normal/1615/D.cpp | #include <bits/stdc++.h>
#define itn int
#define all(x) (x).begin(), (x).end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
using namespace std;
inline int nxt() {
int x;
// scanf("%d", &x);
cin >> x;
return x;
}
const int N = 202'202;
vector<pair<int, int>> a[N];
vector<pai... | ALGO | 0.99973 | 4.9068 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:55:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c3bc5edde8b... |
d252529d-4242-4c05-8106-9a197f2068fd | keywet06/code | CF/CF641D.cpp | #ifdef ONLINE_JUDGE
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#endif
#include <bits/stdc++.h>
#define debug std::cerr << "Debug(" << __LINE__ << "): "
#define pub push_back
#define pob pop_back
#define pup push
#defin... | ALGO | 0.999981 | 3.478183 | {
"github_metadata": {
"branch": "master",
"commit_count": 702,
"repo_created_at": "2019-04-21T10:13:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "278fcbc3... |
ac812342-43e8-47c9-ab7e-1bcdf58b2541 | hlr7999/Leetcode | src/72.cpp | #include <string>
#include <algorithm>
using namespace std;
class Solution {
public:
// Dynamic Programming
// dp[i][j] means the minimum steps that
// covert word1[0,..,i) to word[0,...,j)
// if word1[i-1] = word2[j-1] then dp[i][j] = dp[i-1][j-1]
// else there are three conditions
// 1. repl... | ALGO | 0.999982 | 5.465126 | {
"github_metadata": {
"branch": "master",
"commit_count": 201,
"repo_created_at": "2019-09-11T12:26:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8072adf1... |
d4e3f1f0-6f7b-4354-bc17-caad911bfbb2 | chase0213/CNImplementation | NetworkExpression.cpp | /*
* NetworkExpression.cpp
* CNImplementation
*
* Created by 長谷川 知里 on 11/09/29.
* Copyright 2011 __MyCompanyName__. All rights reserved.
*
*/
#include "NetworkExpression.h"
#include "Namelist.h"
using namespace std;
// コンストラクタ
Network::Network(string file){
ifstream ifs;
ifs.open(file.c_str());
... | ALGO | 0.994194 | 3.293923 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-04-19T17:37:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e808e1900... |
a7fd7080-92bc-4d66-9c42-52ad15095b30 | Mahmoud-Abd-Elrazek/Non-Linear-Data-Structres-Course | Code/BFS Algorithm/BFS.cpp | // لَنْ تَنَالُوا الْبِرَّ حَتَّى تُنْفِقُوا مِمَّا تُحِبُّونَ وَمَا تُنْفِقُوا مِنْ شَيْءٍ فَإِنَّ اللَّهَ بِهِ عَلِيمٌ [آل عمران:92].
// © M_Abrazeg
#include <iostream>
#include <queue>
using namespace std;
struct TreeNode {
int val;
TreeNode* left;
TreeNode* right;
TreeNode(int data) : val(data) , le... | ALGO | 0.999733 | 3.876378 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-11-29T20:45:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "445a29ea73e... |
b5b3f9ce-79fa-4d0d-90e5-5fe389283fa2 | SrinidhiSreenath/et_exploration_robot | src/map.cpp | /*******************************************************************************
* BSD 3-Clause License
* Copyright (c) 2018, <NAME>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * R... | ALGO | 0.998672 | 5.772256 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2018-11-26T01:49:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c3bc2f3... |
a9ebd12b-be57-4244-8cd5-092e7693af95 | Indigochi1d/Problem-Solving | 백준/Silver/1189. 컴백홈/컴백홈.cc | #include <bits/stdc++.h>
using namespace std;
int r, c, k;
char _map[6][6];
bool visited[6][6];
int cnt;
int dest_x, dest_y;
int start_x, start_y;
const int dx[4] = {1, -1, 0, 0};
const int dy[4] = {0, 0, 1, -1};
bool check(int y, int x)
{
if (x < 0 || x >= c || y < 0 || y >= r)
return false;
if (vis... | ALGO | 0.999848 | 4.51964 | {
"github_metadata": {
"branch": "main",
"commit_count": 141,
"repo_created_at": "2024-10-14T05:32:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f5df12dfa... |
e1ab3b6e-9e2c-4158-9f31-d50c32b0b1fe | skrewbar/PS | Baekjoon/diamond/17410.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> bukkits[317];
vector<int> arr;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
int size = (int)sqrt(n);
arr.reserve(n);
for (int i = 0 ; i < n ; i++) {
int a;
cin >> a;
arr.... | ALGO | 0.999886 | 4.878033 | {
"github_metadata": {
"branch": "main",
"commit_count": 278,
"repo_created_at": "2024-10-03T05:34:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08fe70a7e9... |
047f1c79-92a1-49b4-a58a-fa696f85a781 | deepin-community/libktorrent | src/mse/functions.cpp | /***************************************************************************
* Copyright (C) 2005 by <NAME> *
* <EMAIL> *
* *
* This program is free software;... | ALGO | 0.900848 | 5.159685 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2022-10-11T02:58:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "da7d290aef1... |
41f83b14-b19e-4830-8bf7-1b26f40dcd38 | aok-buran/ImGui-SFML | src/main.cpp | #include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/System/Clock.hpp>
#include <SFML/Window/Event.hpp>
#include <imgui-SFML.h>
#include <imgui.h>
#include <fstream>
// первое множество
static const int SET_1 = 0;
// второе множество
static const int SET_2 = 1;
// пересечение множеств
static const int SET_CROSSED... | TOOL | 0.967794 | 4.088452 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2023-03-24T06:02:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "29034afe6... |
e92e5233-79a7-40ab-bb0f-513f90d0918d | bconfiden2/daily-ps | boj/2020/03.March~06.June/17626.cpp | #include <iostream>
using namespace std;
// 입력 받은 자연수까지의 모든 최솟값들을 구해놓을 배열
int ans[50001] = {0, 1, 2, 3, 1, 2};
// 제곱근들에 대한 배열
int sqr[225] = {0};
// i 번쨰에 대한 최솟값을 구하는 함수
int cntMin(int idx)
{
int min = 4;
for(int i = 1 ; i * i <= idx ; i++)
{
// 각 제곱값들 별로 완전 탐색, 제곱값을 뺀 값에 대한 최솟값은 이미 dp 배열에 존재
int n = an... | ALGO | 0.999948 | 4.408452 | {
"github_metadata": {
"branch": "master",
"commit_count": 659,
"repo_created_at": "2020-04-01T12:38:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bdfe27aa... |
4a32e2eb-0112-4633-8e38-bf270ea024b5 | Simba256/Competitive-Programming | Codeforces/1712/1712E1.cpp | using namespace std;
#include<bits/stdc++.h>
#define nl cout<<"\n"
#define ve vector
#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define vc vector<char>
#define ll long long
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define tcs int tttt;cin>>tttt;for(int ... | ALGO | 0.999811 | 4.024646 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2024-01-15T14:05:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c0c7d3bd9b... |
65a651b8-28be-4cb3-88ee-23c43993edae | voorhs/C-Language-Workshop | Prac 2. another methodical staff/matrix.h | #pragma once
#include <cassert>
#include <iostream>
#include "vector.h"
class Matrix: Vector {
Vector* content;
int m, n;
public:
Matrix();
Matrix(int m, int n, double value = 0.0);
Matrix(const Matrix& a);
~Matrix();
void reshape(const int a, const int b);
Matrix transpose() const... | TOOL | 0.944343 | 4.398401 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2021-09-26T09:51:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "86f51c8ea65... |
d53b0c61-e49f-45e0-9acb-7639cf3cd1f5 | williamliusea/CarND-Extended-Kalman-Filter-Project | src/tools.cpp | #include "tools.h"
#include <iostream>
using Eigen::VectorXd;
using Eigen::MatrixXd;
using std::vector;
Tools::Tools() {}
Tools::~Tools() {}
VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations,
const vector<VectorXd> &ground_truth) {
VectorXd rmse(4);
rmse << 0,0,0,0;... | ALGO | 0.983727 | 6.000958 | {
"github_metadata": {
"branch": "master",
"commit_count": 110,
"repo_created_at": "2019-04-19T04:25:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b30a88e... |
2f3d4399-28c1-4457-aedd-f3049ebc7b48 | timi-liuliang/echo | thirdparty/mlpack/thirdparty/armadillo/include/armadillo_bits/fn_approx_equal.hpp | // Copyright 2008-2016 <NAME> (http://conradsanderson.id.au)
// Copyright 2008-2016 National ICT Australia (NICTA)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.or... | TOOL | 0.98609 | 7.111304 | {
"github_metadata": {
"branch": "master",
"commit_count": 3016,
"repo_created_at": "2018-03-10T04:07:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 971,
"forks": 116,
"issues": 254,
"pull_requests": 0
},
"file_meta": {
"content_id": "1... |
c6afb212-da16-4177-8721-1f56988d6771 | DILET1/usacoarchive | Alphastar/CC41A/Djkistra Lesson/goblox.cpp | #include <bits/stdc++.h>
using namespace std;
vector<pair<int,int>> adj[101];
vector<pair<long long,int>> dist(101);
const long long INF = 9223372036854775807;
int main(){
int n, m;
cin >> n >> m;
int a, b, w;
for(int i = 0; i < m; i++){
cin >> a >> b >> w;
adj[a].push_back({b,w});
adj[b].push_back({a,w});
}... | ALGO | 0.999986 | 3.379567 | {
"github_metadata": {
"branch": "main",
"commit_count": 250,
"repo_created_at": "2022-01-28T18:13:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc0bdfb6e2... |
c8928d6c-5f4b-41d2-9787-0b93394261c6 | htakeuchi0/sort | HeapSort.cpp | #include "HeapSort.h"
#include <iostream>
// コンストラクタ
// サイズを指定して乱数配列を生成する
HeapSort::HeapSort(size_t size) :
Sort(size)
{
SlideArray();
}
// コンストラクタ
// 配列サイズとタイプを指定して配列を生成する
HeapSort::HeapSort(size_t size, ArrayType type):
Sort(size, type)
{
SlideArray();
}
// コンストラクタ
// 指定された配列をコピーして配列を生成する
HeapSort::HeapSort(in... | ALGO | 0.993126 | 5.010032 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2017-11-16T15:32:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2bf6b890a... |
7f6c935c-402f-4efd-bda7-aabde2d9e722 | ravipandya15/DSA_Algo_JAVA | Heap_Love_Bubber/CN_Smallest_Range_From_K_Sorted_List.cpp | #include<iostream>
#include<queue>
#include<vector>
#include<limits.h>
using namespace std;
int main()
{
return 0;
}
class Node
{
public:
int data;
int row;
int col;
Node(int data, int row, int col)
{
this->data = data;
this->row = row;
this->col = col;
}
};
c... | ALGO | 0.999897 | 4.443961 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2022-01-14T18:21:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a10f353d2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.