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
eae78f27-9fcb-4f9e-9512-7390b76e7d5e
tuancaraballo/Summer2016CodingFun
uniqueCharactersInString.cpp
#include <iostream> #include <string> #include "stdbool.h" #include <set> using namespace std; /* Question: Implement an algorithm to determine if a string has all unique characters. What if you cannnot use additinal data structures? Approach: I used a set data structure. I iterate through each...
ALGO
0.99738
4.382234
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2016-07-15T03:49:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2051f8e8a...
8adfac6d-be2e-4dd8-b818-601d6e393152
averyli290/usaco-cf-solutions
_codeforces/binary_matrix/binary_matrix.cpp
/* <NAME> 3/15/2025 Problem link: https://codeforces.com/contest/2082/problem/A */ #include <iostream> #include <vector> #include <algorithm> #include<numeric> //#include <bits/stdc++.h> typedef long long ll; /* find which column need to have bit changed find which rows need to have bit changed match them up when po...
ALGO
0.999975
5.659134
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2024-08-28T02:17: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": "e134f7cec96...
0b11bb77-5594-41c2-8ef0-41f2c257d92f
farazalam2017/C-Language
C in Depth assignment/3.Function/evenOdd.cpp
/* Program to find whether number is odd or even */ #include <bits/stdc++.h> using namespace std; void checkEvenOdd(int num2){ if( num2% 2== 0){ cout << "\n even "; }else{ cout << "\n odd "; } } int main(){ int num1; cout << "\n Enter the number:- "; cin >> num1; cout << " \n...
ALGO
0.998854
3.887414
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2022-12-28T15:45: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": "8f57af1dd54...
af585f84-ba12-4980-a8fd-5e017431e53c
nstroustrup/lifespan
external_compile_libraries/InsightToolkit-4.10.0/Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/tests/test_sparse_lm.cxx
#include <iostream> #include <testlib/testlib_test.h> #include <vnl/vnl_sparse_lst_sqr_function.h> #include <vnl/algo/vnl_sparse_lm.h> #include <vcl_compiler.h> #include <vcl_cassert.h> #include <vnl/vnl_random.h> #include <vnl/vnl_math.h> // translate, scale, and rotate all cameras and points into a // canonical coo...
TEST
0.992961
6.018919
{ "github_metadata": { "branch": "flow", "commit_count": 1446, "repo_created_at": "2012-10-31T22:29:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 23, "forks": 16, "issues": 1, "pull_requests": 1 }, "file_meta": { "content_id": "d591a91...
f78db890-5f8f-497a-a0d8-f68dc129ef03
jaindivij21/Comprehensive-DSA-Questions
Strings/Difference Between strings and arrays in context of pointers/main.cpp
#include <iostream> #include <cstring> using namespace std; // Program to show the difference bw arrays and strings wrt to pointers int main(){ char str[] = "Hello I am Divij"; // since a string is an array of type char int arr[] = {1,2,3}; cout<< arr<< " "<< str<<endl; // both are arrays but arr gi...
TOOL
0.901937
3.756516
{ "github_metadata": { "branch": "main", "commit_count": 272, "repo_created_at": "2021-05-28T12:57:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4a2f8513df...
e6a5fd4d-6442-4196-aca2-6456eb7dce4a
ishandutta2007/codeforces-a
arturgo/normal/846/F.cpp
#include <iostream> #include <vector> #include <iomanip> using namespace std; int nbNombres; int nombres[2000 * 1000 + 1]; vector<int> paliers[2000 * 1000 + 1]; int main() { ios_base::sync_with_stdio(false); cin >> nbNombres; for(int iNombre = 0;iNombre < nbNombres;iNombre++) { cin >> nombres[iNombre]; pali...
ALGO
0.998189
3.562811
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-11T00:51:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "16ac2c5703cd...
0b755a77-8b29-438a-b6a9-503ffc6b9d0c
C-mmon/CupHead
LinkedList/REVISE_PARTITION_LIST.CPP
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* partition(L...
ALGO
0.999993
5.558014
{ "github_metadata": { "branch": "main", "commit_count": 326, "repo_created_at": "2025-04-02T10:12:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5f1f8f67e2...
05217d83-bb58-4002-aea7-fcc9c6364a78
AndorGunczer/CPP_OOP_Deep_Dive
cpp09/ex01/main.cpp
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* main.cpp :+: :+: :+: ...
ALGO
0.991458
5.048861
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2022-03-11T15:06:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 22, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "53ef588b...
b428f2cd-cc0b-4af8-9453-0ff218c1ae0e
satellitex/acpc2017
sate/sate/sate.cpp
#include<bits/stdc++.h> using namespace std; typedef complex<double> P; double S,N,W,R,L,X,Y,V; double getCod(double rad){ return rad * 180.0 / M_PI; } bool check(double t){ // 最も近づく点を三分三択? } int main(){ cin >> S >> N >> W >> L >> R; cin >> X >> Y >> V; S += L; L += L; P v = P(X,Y); double at = arg...
ALGO
0.999674
3.469431
{ "github_metadata": { "branch": "master", "commit_count": 563, "repo_created_at": "2017-07-19T11:18:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5c80aa96...
5f5eb135-f2b1-4e3c-8978-d49e2b1844b8
arangodb/arangodb
3rdParty/boost/1.78.0/libs/math/example/root_finding_example.cpp
// root_finding_example.cpp // Copyright <NAME> 2010, 2015 // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) // Example of finding roots using Newton-Raphson, Halley. // Note ...
ALGO
0.999939
6.476934
{ "github_metadata": { "branch": "devel", "commit_count": 51986, "repo_created_at": "2011-10-26T06:42:00.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 13878, "forks": 857, "issues": 743, "pull_requests": 38 }, "file_meta": { "content_id": ...
5cbb0e7b-a308-4332-9aec-f5cee6a054aa
kss418/BOJ
백준/Gold/27617. Road To Savings/Road To Savings.cc
#include <bits/stdc++.h> #include <ext/rope> #define fastio cin.tie(0), cout.tie(0), ios::sync_with_stdio(0); #define all(x) (x).begin(), (x).end() #define x first #define y second using namespace std; using ll = long long; using ld = long double; using pld = pair<ld, ld>; using i128 = __int128_t; using f128 = __float...
ALGO
0.999923
4.859975
{ "github_metadata": { "branch": "main", "commit_count": 1502, "repo_created_at": "2022-09-09T06:57:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "af74d51fc...
8590102c-fe86-4a79-942d-b41997c6f842
jairedc/KMeans
kmeans.cpp
#ifndef KMEANS_CPP #define KMEANS_CPP #include "kmeans.h" template <class T> kmeans<T>::kmeans(int k, quint32 maxIterations) { initialized_ = false; maxIterations_ = maxIterations; currIteration_ = 0; k_ = k; centroids_.resize(k_); initType_ = InitializeType::Sample; energy_ = 0.0; randomCentroidsInit...
ALGO
0.999452
5.820529
{ "github_metadata": { "branch": "master", "commit_count": 39, "repo_created_at": "2021-05-05T21:01: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": "9494fd5f6...
e2ec731c-c87a-4e44-ba12-7f8f9ce01fa5
izenecloud/sf1r-lite
source/core/ranking-manager/PlmLanguageRanker.h
#ifndef _PLM_LANGUAGE_RANKER_H_ #define _PLM_LANGUAGE_RANKER_H_ /** * @file PlmLanguageRanker.h * @author <NAME> * @date Created <2009-09-24 10:28:14> * @date Updated <2010-03-24 14:57:43> * @brief Extracted from LanguageRanker */ #include "RankingDefaultParameters.h" #include "TermProximityMeasure.h" #include "...
ALGO
0.963614
6.995371
{ "github_metadata": { "branch": "master", "commit_count": 6022, "repo_created_at": "2014-09-12T07:56:19.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 168, "forks": 60, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "acb3d...
a3d2f105-7317-4de9-9f04-868f20929104
PranjalAgni/LeetcodeEffectively
LinkedList/rotate-linked-list-1.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* rotateRi...
ALGO
0.999975
6.089103
{ "github_metadata": { "branch": "master", "commit_count": 568, "repo_created_at": "2021-05-14T07:37:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c8b5282b...
b0ce0414-b104-43f0-81ad-d49603205450
yz1019117968/FSE-24-UniTrans
cleaned_data/transcoder_evaluation_gfg/cpp/PAPER_CUT_MINIMUM_NUMBER_SQUARES.cpp
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // #include <iostream> #include <cstdlib> #include <string> #include <vector> #include <fstream> #include <iomanip> #include...
ALGO
0.999446
5.464781
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-04-06T11:00:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 20, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3988dbbc0de...
f802ee00-a892-4375-9be7-29f5e4301694
ErnestCG/CS-Submissions
CC1/radixConverter.cpp
#include <iostream> #include <string> //used for std::string and std::stoi() #include <vector> //used for making vectors #include <cctype> //used for std::tolower #include <map> //used for std::map #include <cmath> //used for pow() #include <algorithm> //used for reverse() int toDecimal(int base, std::string number) {...
ALGO
0.996286
5.872716
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2024-09-17T15:31:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ef3a7d99e49...
aae58ed6-9eed-4c69-a4f8-5019d7262772
cvc5/cvc5
src/theory/quantifiers/query_generator_sample_sat.h
/****************************************************************************** * Top contributors (to current version): * <NAME>, <NAME>, <NAME> * * This file is part of the cvc5 project. * * Copyright (c) 2009-2025 by the authors listed in the file AUTHORS * in the top-level source directory and their instit...
ALGO
0.994041
7.495288
{ "github_metadata": { "branch": "main", "commit_count": 13437, "repo_created_at": "2012-12-06T18:45:04.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1150, "forks": 259, "issues": 116, "pull_requests": 56 }, "file_meta": { "content_id": "b...
c2ebe826-0c88-4342-b99c-94c65ec4f0f3
ualiurrahat/complete-data-structure-and-algorithms-using-cpp
06_Strings/01 Basic Problems/02_reverseAString.cpp
/* Problem Statement: You are given a string. You have to reverse it. Example: Input: "Rahat" Output: "tahaR" */ #include <iostream> // for cin and cout using namespace std; // brute force approach to reverse a string void reverseBrute(string &str) { string ans = ""; // To store reversed string int n = s...
ALGO
0.999948
5.90802
{ "github_metadata": { "branch": "main", "commit_count": 245, "repo_created_at": "2023-03-03T14:30:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ae7bf29c90...
4be08485-f286-4d85-95d1-acb7459a33ef
asad14053/My-Online-Judge-Solution
All code of my PC/floydwarshall.cpp
#include<bits/stdc++.h> using namespace std; int main() { int adj_mat[21][21]; int i , j , x , y ,k ; int a ,b , kase = 0; int N , Q ; cin>>N; for ( k = 0 ; k < N; k++) { int a,b,c; cin>>a>>b>>c; adj_mat[a][b]=c; adj_mat[b][a]=INFINITY; } // FLOYD WA...
ALGO
0.999914
3.881553
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2015-08-03T09:07:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2f94e080a...
ce82cdda-2d1b-4c0b-9196-a06cbe9627f9
DanielHintermann/BezierRaytracing
source_code/raytracing/nurbs_raytracing.cpp
#include "nurbs_raytracing.h" std::tuple<std::vector<int>, unsigned int, unsigned int> raytrace_scene_with_facetted_surface_multithreaded(facetted_surface_scene_descriptor& scene, int threadcount) { auto trace_ray_with_facetted_surface = [](std::vector<int>::iterator pixel, v3 ray, facetted_surface_scene_descripto...
ALGO
0.985159
6.259663
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2023-07-31T20:08:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "59e8cf09b115...
8ca81036-0b7d-4cce-9c03-160189c464e1
MingshanJia/DataFlowAnalysis
CloneBen/google_code/20/1/Hodduc_1_0.cpp
#include<stdio.h> #include<string.h> #include<memory.h> int T, L, N; char s[300], op; char a[300], b[300], c[300]; int A, B, C; int d[300][2], path[300][2]; bool exists() { int i, j, k, aa, bb, cc, aa_to, bb_to, cc_to, aa_fr, bb_fr, cc_fr; memset(d, 0, sizeof(d)); d[0][0] = 1; for(i = 0; i < N; i++){ aa_fr = (i !...
ALGO
0.999677
3.28041
{ "github_metadata": { "branch": "master", "commit_count": 802, "repo_created_at": "2019-10-14T10:49:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "204c7c72...
ee8d4ccf-ef9f-4de8-8664-2ad802da353b
MereyPolatkhan/Algorithms_and_Data_Structures
ADS_2021/w2_Linked_list/lab2/basic/E.cpp
#include <iostream> #include <map> #include <vector> using namespace std; int main() { char c; int x; map <int, int> m; freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); while(cin >> c >> x){ if (c == '+'){ m[x]++; } else if(c == '...
ALGO
0.999947
3.945895
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2022-08-07T17:40: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": "79456af7a...
2b9da131-e17a-40eb-a49e-04deb56def04
liuq901/code
LOJ/l_1183.cpp
#include <cstdio> #include <algorithm> using namespace std; struct tree { int l,r,sum,num; }; tree a[270000]; void build(int x,int l,int r) { a[x].l=l,a[x].r=r,a[x].sum=0,a[x].num=-1; if (l==r) return; int ls=x<<1,rs=ls+1,mid=a[x].l+a[x].r>>1; build(ls,l,mid); build(rs,mid+1,r); } void u...
ALGO
0.999754
3.660067
{ "github_metadata": { "branch": "master", "commit_count": 108, "repo_created_at": "2013-09-18T08:58:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d0d15740...
97b136d9-cfa0-4e96-a95d-dbfcc6e5b5c5
ishandutta2007/codeforces-f
function348/normal/512/C.cpp
#include<cstdio> #include<iostream> #include<queue> using namespace std; const int N=210; struct Edge {int y,z,ne;}; int n,num,S,T,cnt; int h[N]; Edge e[N*N*2];int last[N]; queue <int> Q; int b[N][N]; int a[N],v[N*N*2]; void add(int x,int y,int z) { e[++num]=(Edge){y,z,last[x]};last[x]=num; e[++num]=(Edge){x,0,last...
ALGO
0.999721
3.043981
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:43:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ee927e81ea51...
ceda7a6d-1980-46b8-b607-ddc75061a131
Nepenthes-1123/atcoder-solution
ABC/abc379/c/main.cpp
#include <bits/stdc++.h> using namespace std; int count(int x, int dif) { return (x + (x - dif + 1)) * dif / 2; } int main() { int n, m; cin >> n >> m; vector<int> X(m); vector<int64_t> A(m); vector<pair<int, int64_t>> XA(m); for (int i = 0; i < m; ++i) { cin >> XA.at(i).first; }...
ALGO
0.999928
3.692198
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2025-02-08T14:16:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "52fd51514e3...
d891c050-eac8-46b6-8f19-1b9adf13de58
julfikar-23/OS-LAB
Task-3CPU_Scheduling_Algorithm/SJF/non_preemptive_with_different_arrival_time.cpp
#include <bits/stdc++.h> using namespace std; struct Process { int id, at, bt, wt = 0, tat = 0; bool done = false; }; int main() { int n; cout << "Enter number of processes: "; cin >> n; vector<Process> p(n); for (int i = 0; i < n; i++) { p[i].id = i + 1; cout << "Process-...
ALGO
0.999711
4.89013
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-05-20T10:12: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": "ea5e1c982701...
29388717-6d82-4072-8a20-ed43c25a3a5a
kkishi/atcoder
contests/abc272/abc272_d/main.cc
#include <bits/stdc++.h> #include "atcoder.h" void Main() { ints(n, m); vector dp(n, vector(n, big)); dp[0][0] = 0; queue<pair<int, int>> que; que.push({0, 0}); V<int> sqrt(n * n + 1, -1); rep(i, n + 1) sqrt[i * i] = i; while (!que.empty()) { auto [r, c] = que.front(); que.pop(); rep(dr, -...
ALGO
0.999774
3.641354
{ "github_metadata": { "branch": "master", "commit_count": 924, "repo_created_at": "2020-05-17T21:30:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "21f643b1...
e7d689a5-9b1f-493a-bdc1-ab3f84b67224
25u62010/curve_fitting
include/curve_fitting.h
#include <iostream> #include <g2o/core/base_vertex.h> #include <g2o/core/base_unary_edge.h> #include <g2o/core/block_solver.h> #include <g2o/core/optimization_algorithm_levenberg.h> #include <g2o/core/optimization_algorithm_gauss_newton.h> #include <g2o/core/optimization_algorithm_dogleg.h> #include <g2o/solvers/dense/...
ALGO
0.999048
4.625753
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2020-07-19T12:36:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "780cc9035b...
77c8306b-f02f-4c94-9f43-33de061c11f0
LYoGA/LeetCode
liyuanjie/160_IntersectionofTwoLinkedLists.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) { if (headA == NULL || headB == NULL) return NU...
ALGO
0.999843
5.249701
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2014-12-26T12:56:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fd25541d68...
275965a5-6416-423b-b821-88b77d306047
kumarshivam27december/c
lec063_cp_basic/find_unique.cpp
#include <bits/stdc++.h> using namespace std; //calculate the total number of element i.e counting it one even if it present more than once int find_unique(vector<int>&v) { int cnt = 1; for (int i = 0; i < v.size() - 1; i++) { if (v[i] != v[i + 1]) { cnt++; } } return cnt; } //couting that element only whic...
ALGO
0.999305
3.680336
{ "github_metadata": { "branch": "main", "commit_count": 266, "repo_created_at": "2024-02-28T12:43:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "81be697f61...
5a406540-0ffa-4ca5-ba80-1ab19511b35b
EmanuelInfante/Busqueda-Binaria-
main.cpp
//Programa de Busqueda Binaria capaz de indicar al usuario cuando los arreglos estan desordenados y ordenados, ademas de indicalse si los valores buscados se encuentran en el arreglo y en dicha posicion o si no se encuentran en el arreglo #include <iostream> #include "Numeros.h" using namespace std; int main() { ...
ALGO
0.999828
3.972062
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-10-14T20:47: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": "3dd3b2edc5...
aa165a1c-d101-4a37-89a6-5234fa0fa42f
salim002/Cpp-Codes
52_Codeforces/18_C2 Ladder 1300/34.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<ld> vd; #define fi first #define se second #define pb push_back #define all(x) x.begin(), x.end() #define fast_io ios_base::sync_wit...
ALGO
0.999843
4.136819
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2023-12-11T13:47: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": "098359014f...
f5f527a7-5364-4119-b405-cf40fd2c1a7e
raincross7/code-similarity
codes/train_code/problem488/problem488_256.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ll> vll; typedef vector<vll> vvll; typedef vector<string> vs; typedef pair<int, int> P; #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define all(x) (x).begin(),(x).end() #define ra...
ALGO
0.999928
4.456612
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-03-06T05:07: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": "796f13ec7e70...
40733a17-0402-4bc4-b0c9-d02d7df89dfd
moostrik/ofxFlowTools
src/core/opticalflow/ftOpticalFlowShader.h
#pragma once #include "ofMain.h" #include "ftShader.h" namespace flowTools { class ftOpticalFlowShader : public ftShader { public: ftOpticalFlowShader() { bInitialized = 1; if (ofIsGLProgrammableRenderer()) { glFour(); } else { glTwo(); } string shaderName = "ftOpticalFlowShader"; if (bInitialized)...
ALGO
0.948772
6.000429
{ "github_metadata": { "branch": "master", "commit_count": 444, "repo_created_at": "2014-04-18T11:14:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 339, "forks": 78, "issues": 3, "pull_requests": 1 }, "file_meta": { "content_id": "bc47b...
ce6626f2-64ad-48c7-9dca-9e0103c3a361
pomelyu/LearnOpenCV
LearnOpenCV/src/L04/L04_1_Contour_Basic.h
// // L04_1_Contour_Basic.h // LearnOpenCV // // Created by <NAME> on 2018/8/5. // Copyright © 2018 <NAME>. All rights reserved. // #ifndef L04_1_Contour_Basic_h #define L04_1_Contour_Basic_h #include <stdio.h> #include <opencv2/opencv.hpp> #include "utils.hpp" #include "contour.hpp" using namespace std; using ...
TOOL
0.905437
4.019551
{ "github_metadata": { "branch": "master", "commit_count": 48, "repo_created_at": "2018-07-29T14:17:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3787a3bac...
8555b165-25c0-45e7-b807-586952d4dbd0
peter9378/algorithm_study
210112boj/1081.cpp
/** * BOJ * No.1081 Че * @author peter9378 * @date 2021.01.12 */ #include <iostream> #include <algorithm> #include <string> #include <vector> #include <set> #include <cmath> #include <map> #include <queue> #include <stack> #include <unordered_set> #include <unordered_map> #include <cstring> #include <iterator> #includ...
ALGO
0.999273
4.75782
{ "github_metadata": { "branch": "master", "commit_count": 953, "repo_created_at": "2018-03-13T17:06:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3f3ee9a9...
f6b85de2-906a-4576-a251-29be7e19434d
kusafukakota/Competitive-Programming-Library
ICPC/lib/DisjointSparseTable.hpp
#pragma once template<typename T, auto op, auto e> struct DisjointSparseTable { vector<vector<T>> t; vector<T> v; DisjointSparseTable() {} DisjointSparseTable(ll N): v(N, e()) {} DisjointSparseTable(const vector<T> &v): v(v) { build(); } void set(ll i, T x) { v[i] = x; } void build() { const int N = ...
ALGO
0.998747
6.701145
{ "github_metadata": { "branch": "main", "commit_count": 411, "repo_created_at": "2023-07-22T03:20:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9c401f4a57...
e1d04b63-13f4-45ae-97a3-a9ff8c00ae44
triplemzim/competitive_programming
Codeforces/251/ternary_d.cpp
/* * ===================================================================================== * * Filename: ternary_d.cpp * * Description: cf 251 d * * Version: 1.0 * Created: শনিবার 07 জুন 2014 02:39:42 BDT * Revision: none * Compiler: gcc * * Author: Shadow_...
ALGO
0.999981
3.087896
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-03-20T21:53:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0132338499...
1f52715e-d368-4960-8bae-1b031edd3d95
aj4941/Algorithm
백준/Silver/4921. 나무 블록/나무 블록.cc
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pll; typedef pair<int, int> pii; typedef tuple<ll, ll, ll> tll; const int N = 10; vector<vector<int>> v; int main(void) { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); v.push_back({}); v.push_back({ 4, 5 }...
ALGO
0.998262
3.670102
{ "github_metadata": { "branch": "main", "commit_count": 998, "repo_created_at": "2023-02-24T03:10:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "40e6a3a0a9...
92c23d91-eb84-4ccf-9b99-02458208f50c
Anthoulis/Interview-Preparation-Coding-Challenges
Week 1 ( C++)/Plus Minus/Plus Minus/plusminus.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> // For find_if (used to remove spaces) #include <cctype> // For isspace (used to check spaces) #include <cstdio> // For printf using namespace std; // Before: We used #include <bits/stdc++.h>, but this is GCC-specific and not support...
ALGO
0.98786
5.204156
{ "github_metadata": { "branch": "main", "commit_count": 50, "repo_created_at": "2024-10-16T11:57:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c4d681e7af7...
8d627f5e-1046-400f-a34d-de5b479cd536
HeZephyr/Awesome-Algorithm-Resources
CCPC/2020CCPC长春站/FF.cpp
#include<bits/stdc++.h> #define ll long long using namespace std; const int maxn = 1e5 + 7; const int maxm = 2e6 + 10; struct e_node{ int next; int to; }e[maxn << 1]; int head[maxn], a[maxn]; int tot; void add_e(int u, int v){ e[++tot].to = v; e[tot].next = head[u]; head[u] = tot; } int son[maxn], ...
ALGO
0.999644
3.920314
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-02-10T04:59:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a948d4a52c78...
6c37ca32-3d1a-4473-bfee-6fe55bcc60bd
harmanxgill/Epidemic-Dynamics
src/mpi/sph.cpp
#include "sph.h" #include <math.h> #include <stdio.h> #include <mpi.h> #include <stddef.h> #include "particle.h" /* Global Variables */ Particle *sph_particles = NULL; int sph_num_particles = 0; MPI_Datatype MPI_PARTICLES; /** * Initialize the SPH system with random distribution of humans, zombies, and immune parti...
ALGO
0.9997
4.625665
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2024-11-29T06:36:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fc8a976e07e...
29403aae-3712-48a1-af5d-a0bb65579e6b
zenghao/cocos2dx_zh
Cyclops/Classes/ToolFunc.cpp
#include "ToolFunc.h" ToolFunc::ToolFunc(void) { } ToolFunc::~ToolFunc(void) { } int ToolFunc::split(string str, const char* sep, vector<string>& ret){ if(str.empty()) return 0; while (str.find(sep) != string::npos) { unsigned index = str.find(sep); ret .push_back(str.substr(0,index)); str = str.substr(...
TOOL
0.922415
4.299832
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2013-06-08T17:44: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": "a5f7c9a088...
45584dbe-5470-4d13-9792-965cdce6f5cf
qoofyk/mem-aware-lbm
src/finiteDifference/fdWrapper2D.h
/* This file is part of the Palabos library. * * Copyright (C) 2011-2017 FlowKit Sarl * Route d'Oron 2 * 1010 Lausanne, Switzerland * E-mail contact: <EMAIL> * * The most recent release of Palabos can be downloaded at * <http://www.palabos.org/> * * The library Palabos is free software: you can redistribute ...
ALGO
0.999308
6.743762
{ "github_metadata": { "branch": "master", "commit_count": 148, "repo_created_at": "2019-09-04T16:43:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "cabe3f6d...
8cd24fae-7fea-4960-a632-9172f7b962f5
takaxyz/atcoder
ABC353/C.cpp
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; #define FOR(i,a,b) for(int i=(a);i<(int)(b);++i) #define REP(i,n) FOR(i,0,n) #define ALL(a) (a).begin(),(a).end() #define RALL(a) (a).rbegin(),(a).rend() #define PRINT(a) cout << (a) << endl #define pb push_back ...
ALGO
0.999945
4.341908
{ "github_metadata": { "branch": "master", "commit_count": 80, "repo_created_at": "2018-10-28T03:22:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c9b1b2f5a...
d76397a4-bb36-4c2e-8cab-386fd6b926c9
seunghoonlee89/StackBlock_sampling_determinants
nonAbelianGroup.h
/* Developed by <NAME> and <NAME>, 2012 Copyright (c) 2012, <NAME> This program is integrated in Molpro w...
ALGO
0.986903
3.278686
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-06-29T23:45:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9d7da1bb7c6b...
2db12c12-842d-4781-82ce-a24fb5cf7010
NFaggi/Competitive-Programming-Problems
OIAJ/Nacionales/2012/Nivel 2/arbol.cpp
//Score: 100/100 //Link: https://juez.oia.unsam.edu.ar/task/10 #include <bits/stdc++.h> using namespace std; vector<vector<long long>>grafo; vector<bool>visitados; long long vis=0; void DFS(int nodo) { if(visitados[nodo]==false) vis++; visitados[nodo] = true; for(int i=0; i<grafo[nodo].size(); i++)...
ALGO
0.999903
3.506236
{ "github_metadata": { "branch": "main", "commit_count": 588, "repo_created_at": "2024-02-25T00:51:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8d0a7d82e5...
be6c6693-c5af-47aa-a8cd-0e9d5e217fd1
sanketsdeore/dsalsppu
heap.cpp
#include <iostream> using namespace std; void minHeap (int arr[], int i) { int parent = (i - 1) / 2; int curr = i; while (parent >= 0 && arr [parent] > arr [curr]) { swap (arr [parent], arr [curr]); curr = parent; parent = (curr - 1) / 2; } } void maxHeap (int arr[], int i) { ...
ALGO
0.999678
3.929311
{ "github_metadata": { "branch": "main", "commit_count": 32, "repo_created_at": "2024-04-23T14:08:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b5c2e4d0e32...
5a3ff3b9-af2a-42aa-9834-8194c0c0c138
swirleyythrone/Trees
Boundary_Traversal.cpp
#include <bits/stdc++.h> using namespace std; struct Node{ int val; Node*left; Node*right; Node(int val){ this->val=val; this->left=NULL; this->right=NULL; } }; class Solution { private: bool isLeaf(Node*root){ return (!root->right && !root->left); } ...
ALGO
0.999991
5.382956
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2025-01-26T14:31: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": "f3107b6ad7...
edceebaa-b030-41cc-8789-3abcfee7af9a
dreyus95/AVSP_SourceQualityPrediction
CodeJamCrawler/dataset/10_14407_43.cpp
#include <iostream> #include <string.h> using namespace std; int g[2000]; int d[1000005][2]; unsigned long long re[2000][2]; unsigned long long sum; int tmp,t,r,k,n,ren; bool visit[2000]; int main() { int si,i,j; freopen("C-small-attempt0.in","r",stdin); freopen("answer.txt","w",stdout); cin >> t; for ( si = 1;...
ALGO
0.999878
3.089463
{ "github_metadata": { "branch": "master", "commit_count": 70, "repo_created_at": "2017-06-08T21:00: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": "78087ab51...
8d3c0bbb-5d51-4ffb-9034-1d4a1c0b5aee
alexandraback/datacollection
solutions_1595491_0/C++/aropan/solve.cpp
#include <cstdio> #include <cmath> #include <ctime> #include <cstring> #include <algorithm> using namespace std; int n, s, p, m, t, k; int main() { #ifndef ONLINE_JUDGE freopen(".in", "r", stdin); freopen(".out", "w", stdout); #endif int t; scanf("%d\n", &t); for (int test = 1; t...
ALGO
0.999862
3.1833
{ "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": "cc8d73c4b...
da66eb43-a865-4dc3-9023-370e4712107b
sihan-chen-yes/CG
src/medium/vol_path_mats.cpp
/* This file is part of Nori, a simple educational ray tracer Copyright (c) 2024 by <NAME> Nori is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation. Nori is distributed in the hope ...
ALGO
0.984414
6.328739
{ "github_metadata": { "branch": "main", "commit_count": 168, "repo_created_at": "2025-02-05T15:23: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": "5438a6b2c6...
cf4890a9-ba34-43a2-ba0e-af64225d3040
studiomobile/webcore
WebCore/platform/audio/DynamicsCompressor.cpp
/* * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of condit...
ALGO
0.907912
6.989865
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2011-07-25T16:05:37.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "60d5945cba...
47b242a8-eb40-4ad1-8b4e-40fe950709f6
ishandutta2007/codeforces-m
majk/normal/650/C.cpp
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author majk */ #ifndef MAJK_LIB #define MAJK_LIB #include <vector> #include <stack> #include <iostream> #include <unordered_map> #include <unordered_set> #include <map> #include <iomanip> #include <set> #include <functional>...
ALGO
0.999948
3.291204
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-06-06T01:03: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": "a8382c3b4f7b...
8cf6885b-a30a-490a-86a8-83f0480f7332
tgoMota/Competitive-programming
URI Solutions/1468.cpp
//https://www.beecrowd.com.br/judge/pt/problems/view/1468 //URI 1468 - Balao #include <bits/stdc++.h> using namespace std; #define oo 0x3f3f3f3f #define ooLL 0x3f3f3f3f3f3f3f3f #define fastio() ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0) #define all(x) (x).begin(),(x).end() #define LOCAL #ifdef LOCAL #def...
ALGO
0.999919
3.898644
{ "github_metadata": { "branch": "main", "commit_count": 187, "repo_created_at": "2019-08-30T00:01: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": "bc1d0a48bd...
a146aca7-39eb-454a-aea8-3ee17e548af0
ERROR-41/ERROR-41-CS_Course
module_20_assignment/Print_Outer_Tree.cpp
#include <bits/stdc++.h> using namespace std; class Node { public: int val; Node *left; Node *right; Node(int val) { this->val = val; this->left = NULL; this->right = NULL; } }; Node *input_tree() { int val; cin >> val; Node *root; if (val == -1) { ...
ALGO
0.999878
4.298595
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-07-12T14:35:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "049df1d4a00f...
5514d42f-6707-41e0-ab6d-d8a654fc5db8
ANCuber/Competitive_Programming
sprout/Exam_1/pA.cpp
#include <bits/stdc++.h> using namespace std; #define endl '\n' vector <vector<int> > tree; vector <int> c; int fd = 0; void search(int last, int now, vector <int> &arr) { //cout<<"pass"; for (int i = 0; i < tree[now].size(); ++i) { if (tree[now][i] == last) continue; arr.push_back(c[tree[now...
ALGO
0.99997
4.172927
{ "github_metadata": { "branch": "main", "commit_count": 542, "repo_created_at": "2022-03-27T14:48: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": "f741edd9af...
caa5cb5e-0184-498b-958a-7a86365cb6e2
nicehash/nheqminer
cpu_xenoncat/xenoncat.cpp
#include <iostream> #include <functional> #include <vector> #include <stdint.h> #ifdef WIN32 #include <Windows.h> #else #include <string.h> #include <stdlib.h> #endif #include "cpu_xenoncat.hpp" #define CONTEXT_SIZE 178033152 //#define USE_XENON_DLL #ifdef __cplusplus extern "C" #endif { #ifndef USE_XENON_DLL //...
ALGO
0.910383
3.804429
{ "github_metadata": { "branch": "master", "commit_count": 154, "repo_created_at": "2016-10-19T10:42:43.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 769, "forks": 579, "issues": 188, "pull_requests": 14 }, "file_meta": { "content_id": "da...
ec8dabdd-485d-4dbc-bf99-e90b5b61275b
schallerala/mcs-applied-optimization
aopt-exercise5/GridSearch/main.cc
#include <iostream> #include <Utils/StopWatch.hh> #include <Algorithms/GridSearch.hh> int main(int _argc, const char* _argv[]) { if (_argc < 5) { std::cout << "Usage: input should be 'function index(0: non-convex, 1: 2d quadratic, 2: nd quadratic), lower bound X, upper bound X, number of gr...
ALGO
0.999959
6.033586
{ "github_metadata": { "branch": "master", "commit_count": 184, "repo_created_at": "2021-09-26T10:14:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6b41eef3...
7c25653a-442e-4dac-a64e-ca8b384286bc
keppnisforritun/keppnir
rupc/2019/grouplockers/submissions/accepted/bjarki_binary_search.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for (auto i=(a); i<(b); ++i) #define iter(it,c) for (auto it = (c).begin(); it != (c).end(); ++it) typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ii> vii; typedef vector<vi> vvi; typedef long long ll; const int INF = 2147483647; int ar...
ALGO
0.99999
3.280046
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-12-11T13:56:51.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e28231dd97fe5...
a2a4660d-b718-44f7-ada6-2a2f5105bb3d
Terrasil/opengl-engine
Lab4/Zadanie1/main.cpp
#define _USE_MATH_DEFINES #include <stdio.h> #include <vector> #include <ctime> #include <iostream> #include <functional> #include <string> #include <cmath> #include <glew.h> #include <freeglut.h> #include <glm.hpp> #include <array> #include <gtc/matrix_transform.hpp> #include <gtc/type_ptr.hpp> #include "shader_stu...
TOOL
0.954871
4.7212
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2024-02-17T12:56:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f0d32da4bba7...
d464c32d-ec0d-4945-97e4-124921440fce
telmich/algolab
planks.cpp
#include <iostream> #include <vector> #include <list> #include <map> #include <algorithm> using namespace std; bool f1 (int i , int target, vector<int> &elements ) { if( target == 0) return true ; if (( i == 0 && target > 0) || target < 0) return false ; return f1 (i-1 , target -elements[i], elements) || ...
ALGO
0.999913
3.475434
{ "github_metadata": { "branch": "master", "commit_count": 118, "repo_created_at": "2017-12-31T17:36:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c46fa7d3...
51d5b5ba-f1fe-42fd-ab5f-8509a8d24323
Yawn-Sean/Daily_CF_Problems
daily_problems/2024/03/0312/personal_submission/cf1098a_tsreaper.cpp
#include <bits/stdc++.h> #define MAXN ((int) 1e5) using namespace std; int n, A[MAXN + 10]; long long ans; vector<int> e[MAXN + 10]; void dfs(int sn, int d) { int mn = 1e9; for (int fn : e[sn]) { dfs(fn, d + 1); mn = min(mn, A[fn]); } if (A[sn] == -1 && e[sn].size() > 0) A[sn] = mn; }...
ALGO
0.999843
3.358662
{ "github_metadata": { "branch": "main", "commit_count": 20410, "repo_created_at": "2024-02-26T01:04:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 478, "forks": 302, "issues": 0, "pull_requests": 7 }, "file_meta": { "content_id": "262f...
62fa810b-fd6e-4fac-9724-40f8f79d8006
Jelegummy/Algorithm_Lab
assignment2_2/kor2_1.cpp
#include <iostream> using namespace std; int interpolation(int a[] , int n , int k){ int l = 0; int r = n - 1; while(l <= r && k >= a[l] && k <= a[r]){ int inter = l + ((k - a[l]) * (r - l) / (a[r] - a[l])); cout << inter << " "; if(a[inter] == k) { return inter;...
ALGO
0.999964
5.228787
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2024-12-16T16:07:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b105dc1d133...
4edee55a-e1fb-4ad7-822b-a909ca7aeae5
KermiteO/CS1D
Assignment 3/OutputInstructions.cpp
/********************************************************************** * AUTHOR : Kermite * Assignment #3: Multi-Dimensional Arrays * CLASS : CS1B * SECTION : MW 8:00a - 11:50a * DUE DATE : 2/23/15 *********************************************************************/ #include "HeaderFile.h" /*************...
TOOL
0.966949
3.921681
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2020-02-09T04:45:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "da77418d3...
dd710810-c36f-4ecd-bf4d-5b72df5d57f9
paulzcy/USACO
2.3_zerosum/zerosum.cpp
/* ID: paulzcy3 TASK: zerosum LANG: C++ */ #include <algorithm> #include <cassert> #include <fstream> #include <iostream> #include <string> using namespace std; int n; char ops[9]; void Dfs(int sum, int num, int last, char op, ostream& fout) { int d = last + 1; int num1 = num * 10 + d; if (d == n) { switc...
ALGO
0.999526
3.936397
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2024-12-21T01:08:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d72e5ebac0...
e323b1f0-d31f-40de-8833-ba8f19fb0ad2
ishandutta2007/codeforces-k
keshi/normal/1354/B.cpp
//In the name of GOD #include <bits/stdc++.h> using namespace std; typedef long long ll; const ll maxn = 2e5 + 100; const ll mod = 1e9 + 7; const ll inf = 1e18; #define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define file_io freopen("input.txt" , "r+" , stdin) ; freopen("output.txt" , "w+" , stdo...
ALGO
0.999882
3.897689
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:06: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": "d2e82567f20e...
0720c683-d246-4e0f-99a5-cf8110ac00cf
Quancoder260503/Programming-Contest-Solution
ASIA PACIFIC/VIETNAM/CENTRAL/2021/E.cpp
#include "bits/stdc++.h" using namespace std; #define N 1500000 #define x first #define y second typedef pair<long long, long long> Vec; typedef long double ldb; const int mod = 1e9 + 7; long long finv[N]; long long fac[N]; long long inv[N]; int n, k; Vec operator-(Vec AB, Vec AC) { return Vec(AB.x - AC.x, AB.y - A...
ALGO
0.999833
4.665373
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-06-26T07:27: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": "7cad1e32bdbc...
f73a3264-b39d-46b3-be41-1dfbc0cb32d5
HPC-Fortran2CPP/Fortran2Cpp
data/StarCoder2/readable_format_HPEC/cpp/file096.cpp
#include <iostream> #include <omp.h> // Assuming DRB076 module contains the definition of f1, we declare it here. // You need to define this function based on what f1 does in your Fortran code. void f1(int& i) { // Example implementation, modify according to your actual function i = 1; } int main() { int ...
ALGO
0.943472
4.300072
{ "github_metadata": { "branch": "main", "commit_count": 95, "repo_created_at": "2024-04-05T20:02:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 13, "forks": 5, "issues": 55, "pull_requests": 0 }, "file_meta": { "content_id": "529d74d0fa...
3968209f-a9f2-4fb6-9299-a7812d93bf68
miguelAlessandro/CompetitiveProgramming
atcoder/AtCoder011-AGC-D.cpp
/** * @name Atcoder 011 AGC D * @author <NAME> * @tags greedy, simulation * @idea: * - let f(S) the decimal number associate to set {A=0, B=1} note than * - if S = 0X then operation(S) = 1X * - if S = 1X then operation(S) = floor((~X)/2) * - note than S is ABABAB... or BABABA... in at almost 2*n iterations *...
ALGO
0.99999
4.029794
{ "github_metadata": { "branch": "master", "commit_count": 514, "repo_created_at": "2016-02-16T22:01:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a343f101...
a92fcb16-753c-4422-a61a-069f032d0dff
will-s-h/algos-data
graphs/dijkstra.cpp
// Dijkstra's Algorithm, O(N + M log N) implementation // Algorithm to determine shortest path from one node to all other nodes // don't use this for dense graphs where M (number of edges) ~ N^2 (number of nodes) // WARNING: no negative edges allowed // verification: https://open.kattis.com/problems/shortestpath1 #inc...
ALGO
0.999858
4.253881
{ "github_metadata": { "branch": "main", "commit_count": 39, "repo_created_at": "2022-08-16T23:50:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "eea87a33960...
9c21b925-3be2-4675-8157-d8003c4d2c02
TalhaSohail-CS/COSC-3320-FALL-2023
Cyclic Dependency Removal/main.cpp
#include <iostream> #include <vector> #include <list> using namespace std; class Graph { int V; // Number of vertices list<int> *adj; // Adjacency lists // DFS utility function to detect cycle in a graph bool isCyclicUtil(int v, bool visited[], bool *recStack, bool *inCycle) { if (!visited[v]) { ...
ALGO
0.999961
5.714402
{ "github_metadata": { "branch": "main", "commit_count": 800, "repo_created_at": "2023-08-29T17:35:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c4b18ef6f5...
a8c6ba41-350b-41f9-a2fe-f9767997865b
DQSSSSS/Algorithm-Competition-Code
CF/961D.cpp
#include<bits/stdc++.h> using namespace std; typedef long long LL; const int SZ = 100010; const LL INF = 1e17 + 10; LL read() { LL n = 0; char a = getchar(); bool flag = 0; while(a > '9' || a < '0') { if(a == '-') flag = 1; a = getchar(); } while(a <= '9' && a >= '0') n = n * 10 + a - '0',a = getchar(); if(flag...
ALGO
0.999969
3.796186
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2020-11-02T16:48:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6e736b9084...
da898b8b-a7b7-492e-afe6-0a3dbd420594
michaelotty/AdventOfCode
2021/src/15.cpp
/** * @file 15.cpp * @author <NAME> (<EMAIL>) * @brief Advent of Code 2021 day 15 * @version 1.0.0 * @date 2021-12-15 * * @copyright Copyright (c) 2021 * */ #include <algorithm> #include <array> #include <iostream> #include <map> #include <queue> #include <string> #include <utility> #include <vector> #includ...
ALGO
0.999831
5.736973
{ "github_metadata": { "branch": "main", "commit_count": 533, "repo_created_at": "2021-11-04T11:14:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f056fe1eea...
bf770f1e-4784-4344-8572-eede6314d9b4
sgumhold/cgv
cgv/math/functions.h
#pragma once #include <cmath> #include <cassert> #include <limits> #include <vector> #include "lib_begin.h" namespace cgv{ namespace math { /// returns the abs(a)*sign(b) template<typename T> T sign(const T& a, const T& b) { return (b < 0) ? -std::abs(a) : std::abs(a); } /// returns 0 for b < a and 1 other...
ALGO
0.99312
5.0022
{ "github_metadata": { "branch": "master", "commit_count": 3412, "repo_created_at": "2017-06-26T10:49:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 16, "forks": 21, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7225d...
96fb54aa-a7bd-4eae-9f50-2f96c17ebc8a
chinmayshah99/datastruct
exam/m1/m1.cpp
/* Data Structures m1 The program was the question given in M1 to E2 batch, class of 2020 C++ program to implement the maze user should also be able to backtrack MIT LICENSE The program was my implementation in the given stipulated amount of time There may be a better solution */ ...
ALGO
0.999635
3.658569
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2017-07-30T11:59: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": "dc731d9ab...
08681a5b-678c-471b-9bc8-a94376469e58
Ash1912/Coding-Lab
DAA (C & C++)/LAB 5/LINKED LIST PRACTICE/Q5.cpp
// Given a linked list and a value x, partition it such that all nodes less than x come before nodes // greater than or equal to x. #include<bits/stdc++.h> #define PI 3.141 using namespace std; struct Node { int data; struct Node* next; }; Node* newNode(int data) { struct Node* new_node = new Node; new_node->data...
ALGO
0.999977
4.755421
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-01-03T05: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": "a5d8158080f4...
23e2287a-962f-4f65-b936-3f3423adc3bd
rushioda/PIXELVALID_athena
athena/Trigger/TrigTools/TrigVertexFitter/src/TrigL2VertexFitter.cxx
/* Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ //////////////////////////////////////////////////////////////////////////////// // TrigL2VertexFitter tool // ------------------------------- // ATLAS Collaboration // // 04.07.2006 Package created // // a new version of LVL2 vertex fitte...
ALGO
0.985394
5.791164
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2020-01-19T03:53:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "67608bd570...
98d690ef-ae5b-4014-9e91-bc43d030926c
ishandutta2007/codeforces-a
arraiter/normal/1654/C.cpp
#include<bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i=(a),i##end=(b);i<=i##end;++i) #define per(i,a,b) for(int i=(a),i##end=(b);i>=i##end;--i) mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count()); template<typename T>void chkmax(T&x,T y){if(x<y)x=y;} template<typename T>void...
ALGO
0.998847
3.939061
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-11T00:51:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e24af8f610ae...
0ef5cc92-0098-4b99-9b31-bda6a960c808
ZYCSwing/CodeForces
Round #418 (Div. 2)/A.cpp
#include <iostream> #include <vector> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <stack> #include <queue> #include <algorithm> #include <list> #include <cstdio> #include <cstdlib> #include <climits> #include <numeric> #include <cmath> #include <memory.h> using namespace std...
ALGO
0.999989
3.400789
{ "github_metadata": { "branch": "master", "commit_count": 72, "repo_created_at": "2017-06-08T10:00:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "23bec2c0f...
9c2e9071-5842-4ef1-ae66-55c76a416e49
bruce1408/Alogrithm_Datastruct
Array/448_Find_All_Numbers_Disappeared_in_an_Array.cpp
#include <iostream> #include <vector> using namespace std; /** * 448 求一个数组里面缺失的数字 * Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), * some elements appear twice and others appear once. * Find all the elements of [1, n] inclusive that do not appear in this array. * Could you do it without extra...
ALGO
0.99967
3.542466
{ "github_metadata": { "branch": "master", "commit_count": 1617, "repo_created_at": "2018-04-04T09:28:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bfc1822...
dd10e847-7b52-44cd-8eea-3b673a6302fd
PeterWaIIace/Dojo_CXX
google_interview/q5_product_of_array_except_self/main.cpp
#include <algorithm> #include <iostream> #include <vector> #include <array> // result = [everythign except 1, everything except 2] //Input: nums = [1,2,3,4] // 1 -> aside to some variable leftover = 1 // 2 -> aside to some variable leftover *= 2 /* L R [1,1,1,_] [_,1,1,1] [1,1,1,_] [_,1,1,4] [1,2,1,_] [_,1,12...
ALGO
0.9998
5.5465
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2024-03-11T20:41: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": "7da9cb53315...
daf6f667-ed29-4eb2-8ab3-63263af206d1
SDmodding/PseudoSource
nightlyjobs/09-12-thu-05/source/common/base/math/swepttransform/hkswepttransformfutil.cpp
// File Line: 17 // RVA: 0x12FD000 void __fastcall hkSweptTransformUtil::lerp2( hkSweptTransformf *sweptTrans, hkSimdFloat32 *t, hkTransformf *transformOut) { hkQuaternionf v5; // xmm7 __m128 v6; // xmm8 __m128 v7; // xmm6 __m128 v8; // xmm5 __m128 v9; // xmm0 __m128 v10; // xmm1 _...
ALGO
0.99541
3.365583
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2023-11-20T00:21:17.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7c3f67c85511d...
6b6808f7-9bce-47ad-bd66-34552b0072c4
ishandutta2007/codeforces-n
nikgaevoy/normal/1375/D.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; mt19937 mt(736); void solve_test(istream &cin = std::cin, ostream &cout = std::cout) { int n; cin >> n; vector<int> arr(n); for (auto &it : arr) cin >> it; vector<set<int>> wh(n + 1); for (int i = 0; i < arr.size(); i++) if (arr[...
ALGO
0.999959
4.541265
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:35: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": "69bcd6978606...
5ef80f7f-914b-4397-8dd8-3fa4b289fc3a
inneustroeva/PythonAndC-
Lab4/ЛБ4, задание1, Гаус.cpp
#include <iomanip> #include <iostream> #include <vector> using namespace std; // Функция для вывода матрицы void printMatrix(const vector<vector<double>>& matrix) { for (const auto& row : matrix) { for (double val : row) { cout << setw(10) << val << " "; } cout << endl; } }...
ALGO
0.999946
4.265383
{ "github_metadata": { "branch": "main", "commit_count": 96, "repo_created_at": "2024-02-11T14:12: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": "db17af1f13a...
d6221c18-d8e1-47fc-bd95-b31064a04d60
Ryanhangralim/MatDiskrit
RekonstruksiKode.cpp
#include<bits/stdc++.h> using namespace std; int main() { int jumlahkode; //meminta input user cout<<"Masukkan Jumlah Kode: "; cin>>jumlahkode; //deklarasi variabel int kode[jumlahkode]; int jumlahvertex = jumlahkode+2; int vertex[jumlahvertex]; int edge[jumlahvertex-1][2]; ...
ALGO
0.999906
3.546776
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2023-04-19T16:04: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": "db4e9c2df99...
6cd515c9-5532-4356-b894-d1fe7905fc47
youngguncho/odometry-calibration
src/odometry-calibrator/transform.h
#ifndef TRANSFORM_H #define TRANSFORM_H #include <cmath> #include <eigen3/Eigen/Core> namespace odo_calib { enum class SE2_DOF {x = 0, y, h}; template <typename T> void head2tail_2d_elem (const T& x_ij, const T& y_ij, const T& t_ij, const T& x_jk, const T& y_jk, const T& t_jk,...
ALGO
0.967042
6.819976
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2017-03-09T05:35:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 3, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "e8a452da90...
042c6ac7-f731-4cd9-bfea-91327782e1f6
buaaCyberSecurity/fileEncryptionAndDecryption
GUI/User2-receive/receiver/rsa.cpp
#include "rsa.h" uc encode[maxn * 4]; int n, phi_n, encodelen; int d, e, cnt, vis[maxn], pri[maxn]; void getPrime(int n) { for (int i = 2; i <= n; ++i) { if (!vis[i]) pri[++cnt] = i; for (int j = 1; j <= cnt && i * pri[j] <= n; ++j) { vis[i * pri[j]] = 1; if (i % pri[j] == 0) break; } } } int phi(int n)...
ALGO
0.998756
3.442616
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2020-05-12T11:24:03.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "202507145d...
73fb5edf-e7cb-4cab-9115-e33822e7e524
gauravgupta8949/account-management-system
CubicProbing.cpp
#include "CubicProbing.h" void CubicProbing::createAccount(std::string id, int count) { int g=hash(id); if(bankStorage1d.size() == 0){ bankStorage1d.resize(1000000,{"null",0}); } int x=1; while (bankStorage1d[g].id != "null" ){ g = (g+(x*x*x))%99983; x++; } ba...
TOOL
0.962031
3.895569
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-02-10T07:54: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": "a46b39a6d7da...
cfedc312-60f4-4b5b-b3ac-d3a86799f84e
haruyasu/improve_c_plus
easy_c_plus/list0709.cpp
#include <iostream> using namespace std; // void reverse(int *a, int n) { void reverse(int a[], int n) { for (int i = 0; i < n / 2; i++) { int t = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = t; } } int main(int argc, char const *argv[]) { const int n = 5; int c[n]; for (int i...
ALGO
0.998405
4.47053
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2018-05-31T04:34: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": "fdb168ce5...
3a75cf7d-e54e-41dc-b314-1711817bc2c3
ishandutta2007/codeforces-c
cinnamoroll/normal/1082/A.cpp
// warm heart, wagging tail,and a smile just for you! // // // // // // // // // // // // // // // // // // // // // // ...
ALGO
0.999566
3.36705
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:17:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "443800286d85...
7e316da2-7c00-4881-9d69-99b4dc6f1863
MAZHARMIK/Interview_DS_Algo
strings/Find the Index of the First Occurrence in a String.cpp
/* MY YOUTUBE VIDEO ON THIS Qn - https://www.youtube.com/watch?v=7UBEku3y2Ig Company Tags - Google, Amazon, Microsoft, Facebook, Qualcomm Leetcode Link - https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string/ */ //Using Brute Force naive Approach clas...
ALGO
0.999875
5.803178
{ "github_metadata": { "branch": "master", "commit_count": 5946, "repo_created_at": "2020-07-12T13:13:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2586, "forks": 1357, "issues": 7, "pull_requests": 37 }, "file_meta": { "content_id": "...
a7cae665-ad72-4db3-96d1-ef81eb0236c0
pkkj/ACM-ICPC-OJ-Code
ICPC.Regional/2007.Tokyo/la3886.cpp
// 2007 Tokyo: Geometric Map // ACM-ICPC Live Archive 3886 // POJ 3521 #include <cstdio> #include <cstring> #include <algorithm> #include <set> #include <cmath> using namespace std; #define N 205 #define INF 1e20 struct POINT { int x, y; void get() { scanf("%d%d", &x, &y); } void print() { printf("%d %d\n", x, ...
ALGO
0.99988
3.210428
{ "github_metadata": { "branch": "master", "commit_count": 210, "repo_created_at": "2014-11-26T08:24:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 35, "forks": 7, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "495d72e...
06d0f0b9-32ba-4e3c-aeca-b4fb164431d5
hijkl2e/problem_solving
codeforces/cf/cf866_1b.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ii = pair<ll, ll>; ii solve(vector<ii> &A) { int n = A.size(); ll sum{}; for (int i = 0; i < n; ++i) { sum += A[i].first * A[i].second; } ll r{}; for (int i = 0; i < n; ++i) { r = max(r, A[i].first); } if (sum % r) { return {-1, ...
ALGO
0.999976
4.425528
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-12-04T14:16:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "14c0a751e4c1...
53e26267-04d5-4e84-9753-405d2cc02d69
Shikhar-S/Analysis-of-Competitive-Codebase
Data/Contest1244/Standings4/28893547_62469066.cpp
#include <bits/stdc++.h> #define ll long long #define pb push_back #define pii pair<int,int> #define pll pair<ll,ll> #define ff first #define ss second using namespace std; const double pi = acos(-1); const int N = 1e6 + 6, mod = 998244353, M = 1e7 + 7; const ll MAX = 5e18; int T, a, b, c, d, k, x, y; int main() {...
ALGO
0.999306
4.041526
{ "github_metadata": { "branch": "master", "commit_count": 74, "repo_created_at": "2019-11-22T14:40: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": "202b3135d...
1db38c96-8c67-4cb2-ac7c-a3293dfa188d
vaandres/Projectboids
boids.hpp
#ifndef BOIDS_HPP #define BOIDS_HPP #include <array> #include <cassert> #include <vector> namespace bds { // alcune costanti globali inline constexpr unsigned int framerate{30}; inline constexpr double conv_fac{ 0.0264583333}; // fattore di conversione da pixel a cm // Struct for position struct Position { dou...
ALGO
0.99677
6.317914
{ "github_metadata": { "branch": "main", "commit_count": 210, "repo_created_at": "2024-05-07T09:14: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": "1839359d60...
65ebc051-b412-4370-b833-8c8b999d0255
michael7198/tachep2024finalproject
project.cpp
#include <stdlib.h> #include <iostream> #include <time.h> #define DSIZE 512 #define RADIUS 2 float dotprod(int* A, int* B, int size){ float sum = 0; for (int i=0; i<size; i++){ sum += (A[i])*(B[i]); } return sum; } void matmult(int* A, int* B, int* result, int nrows, int ncols){ for (int...
ALGO
0.999154
5.156528
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-12-03T01:23:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "74fd6b78137c...
e85050bd-c8e8-4613-a96a-9ac47151bc4d
andrelorenzo/Vision2D_navigation
CodigosPC/src/helper.cpp
#include "helper.hpp" bool recvAll(int sock, uint8_t* buffer, size_t length) { size_t total = 0; while (total < length) { ssize_t bytes = recv(sock, buffer + total, length - total, 0); if (bytes <= 0) return false; total += bytes; } return true; } cv::Mat get_frame_from_tcp(int...
ALGO
0.977726
5.301779
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2025-05-25T19:49: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": "ecf5c6325b4...
a03e7ef2-0d2a-493f-8a6f-fcd9925b3836
its-mayankanand/Practiceee
LinkedList/LL2.cpp
#include<iostream> using namespace std; //creating a linked list and printing it also. class Node { public: int data; Node *next; Node(int val) { data = val; next = NULL; } }; class Solution { public: //function to display the elements of a linked list void display(Node *head...
ALGO
0.998133
3.818839
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2024-06-23T07:04: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": "9ad9985d9c8c...
ebcd3a6d-aaec-40af-8bf4-d003d0adf9c4
chris4540/algorithm_exercise
leetcode/impl-strstr/strstr.cpp
#include <string> #include <iostream> #include <cassert> using namespace std; class Solution { public: int strStr(string haystack, string needle) { if (needle.size() == 0) return 0; if (needle.size() > haystack.size()) return -1; // do linear search for (int i = 0; i < haystack.si...
ALGO
0.999091
4.444387
{ "github_metadata": { "branch": "master", "commit_count": 100, "repo_created_at": "2020-04-05T08:23: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": "d9c3bad3...