uuid
stringlengths
36
36
repo_name
stringlengths
5
123
relative_path
stringlengths
5
4k
content
stringlengths
33
2.85M
category
stringclasses
6 values
algo_rel_score
float64
0.85
1
quality_score
float64
3
8.76
b291fd7a-eac3-4831-a0c0-e4f8cbfaecb9
Mangomm/ffmpeg-build
windows64/extra/fdk-aac/libPCMutils/src/limiter.cpp
/* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android © Copyright 1995 - 2020 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION The Fraunhofer FDK AAC Codec Lib...
ALGO
0.991255
6.372402
b7fd1313-b7d3-481e-9e8f-7ce2b28f60a8
Rinnnt/CompetitiveProgramming
Baekjoon/9465.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define nl '\n' int s[100001][2]; int dp[100001][2]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t; cin >> t; while (t--) { int n; cin >> n; for (int i = 0; i < 2; i++) { for (int j = 1; j <=...
ALGO
0.99997
4.72038
ad1978bd-8c60-4806-8d0b-6e1f36eb3a5b
gittushR/DSA
Easy/Number of paths/number-of-paths.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends long long mod=(1e9+7); long long f(int i, int j,vector<vector<long long>>&dp){ if(i==0 and j==0)return 1; if(i<0 or j<0)return 0; if(dp[i][j]!=-1)return dp[i][j]; long long up=f(i,j-1,dp); ...
ALGO
0.999987
6.201475
a7350395-a82b-4ffe-afa9-afa8b03a8a68
hinomaker/CodingTest-C
상민/0326/발판.cpp
#include <string> #include <vector> #include <limits.h> using namespace std; vector<vector<int>> dir = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}}; /* returns {t, n} if player can always win in n steps with optimal strategy returns {f, n} if player can't win, but staying for n steps in maximum */ pair<bool, int> dfsearch(v...
ALGO
0.998955
4.922064
fdd08b20-e385-45af-b2fb-b971a318be84
yunshujing/Data_structure
homework/week7/7-2 栈操作的合法性.cpp
#include<bits/stdc++.h> using namespace std; #define int long long #define double long double #define endl "\n" #define mod3 998244353 #define mod7 1000000007 const int N = 1e6 + 10; const double eps =1e-4; signed main() { int n, m; cin >> n >> m; getchar(); while(n--){ stack <char> st; ...
ALGO
0.99985
5.052772
ed8c36e6-354f-4b50-9f83-47d32eb32130
Orang123/ACMAlgorithmExercises
图论/网络流/最小费用最大流/HDU 2485 Destroying the bus stations.cpp
#include<cstdio> #include<cstring> #include<queue> #include<algorithm> #define N 110 #define M 5000 #define INF 0x3f3f3f3f using namespace std; //ac 46ms dinic floyd++С /* :1յn,һЩı,ÿߵʱΪ1, ƻмһЩ,ݻٶٸkʱ޷. :http://acm.hdu.edu.cn/showproblem.php?pid=2485 ˼·:floyd1n·,ڴ1nʱСڵk INF,ɾٵʹЩ·Ͽ,Բ,i,i+n, 佨Ϊ1ı,ôתΪԴͻҪɾٱ,ЩǡþDz, ,ɾתΪɾ,תΪС,...
ALGO
0.999994
3.855182
72966834-4731-428d-871a-172aae7ca68b
hafeedck/profile
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.99887
6.783439
84521f88-0fd7-4d1e-8791-f64c18bdb665
GabrielSantaRosa/ITP
ITP/QuestoesURI/1165.cpp
#include <iostream> using namespace std; bool ehprimo(int x) { int divisor = 0; for(int i = 1; x >= i; i++) { if(x % i == 0) { divisor++; } if(divisor > 2) return false; } return true; } int main() { int x; cin >> x; for(int i = 0; x > i; i++) ...
ALGO
0.999725
4.86077
7fd2c2e0-b29b-4bbe-9391-0a555ed24a2f
libornovax/eoa_image_compression
src/algorithms/SteadyStateEA.cpp
#include "SteadyStateEA.h" #include <random> #include <algorithm> #include <opencv2/highgui/highgui.hpp> #include "entities/Mutator.h" #include "components/Config.h" #include "components/utils.h" #include "shapes/Circle.h" #include "components/fitness/Fitness.h" namespace eic { SteadyStateEA::SteadyStateEA(const std...
ALGO
0.99935
6.729026
7530c290-bb98-4fbf-b4cc-020b9c7f905e
Adelina-1/practic
zadanie_11.cpp
#include <iostream> #include <fstream> #include <vector> #include <algorithm> using namespace std; struct Goat { int id; int strength; }; bool compareGoats(const Goat& a, const Goat& b) { return a.strength > b.strength; } vector<Goat> processTournament(const vector<vector<int>>& matrix) { int n = mat...
ALGO
0.999723
5.625303
39a4546a-58ef-4f17-9e88-39d58dfc7d62
zenith82114/boj-solve
src/19654.cpp
/* * Q19654 - min cost flow, priority queue * Date: 2025.1.29 */ #include<bits/stdc++.h> using namespace std; array<int, 200000> a, b; bitset<200000> ina, inb; int main() { cin.tie(0)->sync_with_stdio(0); int tc; cin >> tc; while (tc--) { int n, K, L; cin >> n >> K >> L; priority_queue...
ALGO
0.999838
3.897041
df3e53ed-7c13-4b30-9d3c-61f0d601bcd6
nicolashei1201/VLSILAB_SLAM
ICPORB_VO/Thirdparty/Eigen/eigen3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_rowwise.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; int main() { Eigen::MatrixXf mat(2,4); mat << 1, 2, 6, 9, 3, 1, 7, 2; std::cout << "Row's maximum: " << std::endl << mat.rowwise().maxCoeff() << std::endl; }
ALGO
0.999579
3.881483
d69c5327-bcf1-4655-80ab-62cd73f4d7f2
vishnuvarthann/vdartpoc_developement
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998693
6.797273
0af8cf12-ca1d-4f33-9a96-371b5dc214c8
iCoder0020/Competitive-Coding
Codeforces/Codeforces Round #539 (Div. 2)/B. Sasha and Magnetic Machines.cpp
/* ID: iCoder0020 PROG: Sasha and Magnetic Machines LANG: C++ */ #include <bits/stdc++.h> typedef long long int li; using namespace std; int main() { int N; cin>>N; int A[N]; int sum = 0; int min_sum; for(int n = 0; n<N; n++) { cin>>A[n]; sum += A[n]; } sort(A, A+N); min_sum = sum; ...
ALGO
0.99998
3.916377
0b7d668b-e175-41a2-bd0b-3d3114340edc
MkGodh/StringCheckForRepeat
StringCheckForRepeat/StringCheckForRepeat.cpp
#include <iostream> #include <string> #include <cstring> #include <cmath> #include <iomanip> #include <math.h> #include <vector> using namespace std; int main() { std::string str; std::cin >> str; int pos = 0; std::string repeatWord; for (int i = 1; i < str.length(); ++i) { if (str[pos] =...
ALGO
0.999996
4.03105
ca5c32e2-82d9-43fc-866a-f618a623ac76
jovid18/problem_solving
프로그래머스/2/42842. 카펫/카펫.cpp
#include <string> #include <vector> using namespace std; vector<int> solution(int brown, int yellow) { for (int i = 1; i <= yellow; ++i) { if (yellow % i == 0) { int a = i; int b = yellow / i; if ((a + 2) * (b + 2) == brown + yellow) { vector<int> answer...
ALGO
0.998406
5.356245
71a31400-b4ef-4e31-aee9-17721c614af1
kevingerges/Linked-Lists
split.cpp
// /* // CSCI 104: Homework 1 Problem 1 // Write a recursive function to split a sorted singly-linked // list into two sorted linked lists, where one has the even // numbers and the other contains the odd numbers. Students // will receive no credit for non-recursive solutions. // To test your program write a separa...
ALGO
0.999557
4.770212
f9db8415-cd7f-45eb-86da-edf13e4186b3
AbhinavChauhan549/CPP
Practice/BinarySearchTree/BSTfromPreorder.cpp
// coding ninjas /* BinaryTreeNode<int>* solve(vector<int> &preorder,int mini, int maxi,int &i){ if(i>=preorder.size()){ return NULL; } if(preorder[i]<mini || preorder[i]>maxi){ return NULL; } BinaryTreeNode<int>* root= new BinaryTreeNode<int>(preorder[i++]); root->left=solve(preorder,mini,root->data,i);...
ALGO
0.99998
5.978338
3f6b771c-2d1f-4478-86ce-dc1c90583e1a
metehkaya/Algo-Archive
Problems/LeetCode/Solutions/0923.3Sum_With_Multiplicity.cpp
class Solution { public: const int MAXV = 101; const int MOD = (int) 1e9 + 7; int threeSumMulti(vector<int>& ar, int target) { int n = ar.size() , ans = 0; vector<int> cnt(MAXV,0); for( int i = 0 ; i < n ; i++ ) { int sum = target - ar[i]; for( int j = 0 ; 2*j...
ALGO
0.999786
5.640419
612f7039-d092-4439-b2d8-191993630525
rickyHong/baidu_paddle
paddle/gserver/layers/CosSimVecMatLayer.cpp
#include "paddle/utils/Logging.h" #include "Layer.h" #include "paddle/math/Matrix.h" #include "paddle/utils/Stat.h" namespace paddle { /** * @brief A layer for computing cosine similarity between a vector * and each row of a matrix * out[i] = cos_scale * cos(in1, in2(i,:)); * @note used in NEURAL TURING MACHINE ...
DATA
0.981901
6.146846
73055906-97cd-4f94-870c-397853781e50
artclarke/humble-video
humble-video-captive/src/main/gnu/libopencore-amr/csrc/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_s.cpp
/* Filename: norm_s.cpp ------------------------------------------------------------------------------ INPUT AND OUTPUT DEFINITIONS Inputs: var1 = 16 bit signed integer of type Word16, whose value falls in the range: 0x8000 <= var1 <= 0x7fff Local Stores/Buffers/Pointers Needed: None Global...
ALGO
0.977754
6.010775
3491b265-092a-4940-b17b-96c4f5b3ba91
raincross7/code-similarity
codes/train_code/problem342/problem342_222.cpp
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; bool flag=false; int a,b; if(s.size()==2){ if(s.at(0)==s.at(1)){ flag=true; a=1;b=2; } } else{ for(int i=0;i<s.size()-2;i++){ if(s.at(i)==s.at(i+1)||s.at(i)==s.at(i+2)||s.at(i+1)==s.at(i+2)){ ...
ALGO
0.999782
3.712626
f7f78060-5ffa-4d07-8b20-2d57b1b5cd0c
jdearly/easy-challenges
string_replace.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> int main() { std::string tweet; getline(std::cin, tweet); std::string word; std::vector<std::string> words; for(char s : tweet){ if(s == ' '){ words.push_back(word); word = ""; } else { ...
ALGO
0.999889
3.770083
339ca3db-7cc7-4a06-a6a2-f91bcfe6373d
mzgsxs/cpp-primer
chapter03/section3/e320.cpp
#include <iostream> #include <string> using std::string; #include <vector> using std::vector; using std::cin; using std::cout; using std::endl; int main() { vector<int> vi; int i; while (cin >> i) vi.push_back(i); vector<int> const cvi = vi; auto size = cvi.size(); for ( decltype(size) idx(0); ...
ALGO
0.999094
3.48472
53a46435-68ec-4586-8264-2dbcab80a1bd
yorklephone/android_framework_base
media/libstagefright/codecs/amrnb/common/src/int_lpc.cpp
/* Pathname: ./audio/gsm-amr/c/src/int_lpc.c Functions: ------------------------------------------------------------------------------ REVISION HISTORY Description: Updated template used to PV coding template. Changed to accept the pOverflow flag for EPOC compatibility. Description: Per review comments, replac...
ALGO
0.994999
6.3164
cc9a0ba2-b5d8-4edf-ab3e-b1fdff7de20a
moondemon68/cp
Xtreme/Xtreme2020/arm.cpp
#include <bits/stdc++.h> #define fi first #define se second #define pb push_back #define mp make_pair #define MOD 1000000007 #define INF 1234567890 #define pii pair<int,int> #define LL long long using namespace std; int main () { //clock_t start = clock(); ios_base::sync_with_stdio(false); cin.tie(NULL); ...
ALGO
0.999826
4.37004
55411b6d-866b-4bb1-87dc-98b255250cc3
otavioon/COLA-2022-Tools
datasets/src/optz/codenet/4/p02888_s450567460.cpp
#define _GLIBCXX_DEBUG #include<algorithm> #include<cmath> #include<cstring> #include<cstdio> #include<iostream> #include<vector> #include<queue> #include<deque> #include<stack> #include<set> #include<map> #include<string> #include <bits/stdc++.h> #define rep(i, n) for(int i = 0; i < (int)n; i++) #define rep2(i,s,n) fo...
ALGO
0.999875
4.157029
c9b0770d-46ce-4d0a-b5e8-292c513257e2
postech-dblab-iitp/turbograph-v3
third_party/velox/velox/functions/sparksql/ConcatWs.cpp
#include "velox/functions/sparksql/ConcatWs.h" #include "velox/expression/ConstantExpr.h" #include "velox/expression/VectorFunction.h" namespace facebook::velox::functions::sparksql { namespace { class ConcatWs : public exec::VectorFunction { public: explicit ConcatWs(const std::optional<StringView>& separator) ...
DATA
0.913597
7.415659
0738eb16-15d9-4aa8-981e-7272504afb05
AmeyaVS/SystemC_DEPRECATED
systemc-regressions/tests/systemc/misc/v1.0/dash4/pulse.cpp
/***************************************************************************** pulse.cpp -- Implementation of the pulse generator. Original Author: Ali Dasdan, Synopsys, Inc. *****************************************************************************/ /*****************************************************...
TOOL
0.933231
6.377377
05ee4801-2e89-48b5-9656-724cce835cc9
JaewanKim/snut-cg-lab
Pencil/01.PencilTest/200525_Paper.cpp
//// PencilPaperTest.cpp : Ͽ 'main' Լ Ե˴ϴ. ű⼭ α׷ ۵ǰ ˴ϴ. //// 0701 : ̹ ߴ ſ ؼ ʴ ɷ // //#define _CRT_SECURE_NO_WARNINGS // //#include "dwLIC2.h" //#include "PencilPaperTest.h" //#include <random> //#include <vector> //#include <algorithm> //#include <iostream> // //using namespace cv; //using namespace std; // //rando...
TEST
0.963848
4.716832
37a6d7dc-71d0-427c-8d61-51e12461bff3
Mohula-Prasath/DSA
LAB-7/queuell.cpp
//This program is used to implement queue ADT using linked list #include <cstdio> #include <cstdlib> class queue{ private: int value; struct node{ int data; struct node *next; }*head,*tail; public: queue(){ head=NULL; tail=NULL; ...
ALGO
0.999078
4.065879
712c550d-a35f-4200-b0d0-440b92236525
Jevincander/Termux-app
termux-shared/src/main/cpp/local-socket.cpp
#include <cstdio> #include <ctime> #include <cerrno> #include <jni.h> #include <sstream> #include <string> #include <unistd.h> #include <android/log.h> #include <sys/ioctl.h> #include <sys/socket.h> #include <sys/types.h> #include <sys/un.h> #define LOG_TAG "local-socket" #define JNI_EXCEPTION "jni-exception" using...
TOOL
0.958092
6.169609
fa48a46c-8bbd-4549-b30b-8923e2904204
sakriwassim/flutter-rive-example-
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.99887
6.783439
c69d76b4-263e-4b67-8942-98cbf035dd84
shumin215/problem-solv
baekjoon/10000/14000/14621/src/main.cpp
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> using namespace std; struct Edge { int src, dst, dist; bool operator < (const Edge &rhs) const { if (dist != rhs.dist) return dist < rhs.dist; else if (src != rhs.src) return src < rhs.src; ...
ALGO
0.999924
4.607636
c4f98baf-e23a-4139-a526-e9f0845ec769
Hinski2/CP
drzewoPrzedzialowe/dynamicRangeMinQueries/cpp321.cpp
#include <bits/stdc++.h> using namespace std; const int base = 1 << 18; int n, q; int tree[base << 1]; void wczytaj(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n >> q; for(int i = 1; i <= n; i++) cin >> tree[base + i]; for(int i = base - 1; i > 0; i--) tree[i] = min(tree[i * 2], tree[i...
ALGO
0.999809
4.609286
236ee32d-a7a8-483b-9ffc-2b9942d498a8
nysanier/cf
lg/basic/n6/lg_A.cpp
#include <bits/stdc++.h> // #include <bits/extc++.h> #ifndef ONLINE_JUDGE # include "dump.h" #else # define DUMP(args...) # define LINE(e) #endif // abbr #define forn(i, x, n) for (long i = x; i < n+x; ++i) #define fornr(i, x, n) for (long i = n-1+x; i >= x; --i) // must be signed, or 0->~0 #define for0(i, n) forn(i,...
ALGO
0.999987
4.184173
6dca46c2-910e-4726-9d9d-0871d381f350
jalanzarini/ComputerNetworks
udp_project/crc32.cpp
#include "crc32.h" #include <algorithm> #define POLY_MAX_POW 32 const int poly32[] = {0, 1, 2, 4, 5, 7, 8, 10, 11, 12, 16, 22, 23, 26, 32}; const int poly3[] = {0, 1, 3}; std::string crc32_remainder(std::string str){ std::string binarystr; for(int i = 0; i < str.length(); i++) binarystr += ctob(str[i]); int ones...
ALGO
0.999433
6.030407
908fee3b-0cd2-43bb-a083-be0be61e3fcf
r0nd0ud0u/aoc2020
aoc2020/day4.cpp
#include "day4.h" #include <sstream> #include "utils.h" using namespace std; day4::day4() { } day4::~day4() { } void day4::JigglyPuffHyperVoice() { ifstream file("puzzles/puzzle_day04.txt", ios::in); vector<map<string,string>> allPassports; int validPassports = 0; if (file.is_open()) { ...
ALGO
0.920245
5.383062
3970c561-19cc-471c-86b5-3cd7843364c4
wqrxssq/yandex_training_7.0
tasks/contest_3/J/main.cpp
#include <iostream> #include <algorithm> #include <array> #include <bitset> #include <climits> #include <vector> #include <math.h> #include <set> #include <unordered_set> #include <map> #include <unordered_map> #include <deque> #include <queue> #include <string> #include <stack> #include <cassert> #include <iomanip> #i...
ALGO
0.999421
4.074092
e12826ce-cafa-4a60-9edb-cc8ceab31cfd
Aidoshq/pp_1
quiz1/6.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int x1, y1, x2, y2, x3, y3; cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3; bool checker1 = y3 <= y1 & y3 >= y2; bool checker2 = x3 >= x1 & x3 <= x2; if (checker1 & checker2){ cout << "yes"; } else{ cout << "no"; } ...
ALGO
0.99982
3.972761
9e2a2345-ce9f-46e3-9130-13197752b24d
truongdcba/Algorithms-Samsung-and-PTIT
Ngăn xếp - Hàng đợi/Số nhị phân từ 1 đến n.cpp
// Cho số tự nhiên n. Hãy in ra tất cả các số nhị phân từ 1 đến n. // Input: // Dòng đầu tiên ghi lại số lượng test T (T≤100). // Mỗi test là một số tự nhiên n được ghi trên một dòng (n≤10000). // Output: // Đưa ra kết quả mỗi test trên một dòng. #include <bits/stdc++.h> using namespace std; vector<string> v; void s...
ALGO
0.999533
5.133491
8c8ffc80-0b35-489a-bc80-cc18e878dd17
adityanjr/code-DS-ALGO
225-Days Coding Problem/Day-101.cpp
#include <bits/stdc++.h> using namespace std; class Solution{ vector<bool>isPrime; void sieve(int n){ isPrime.assign(n+2 , true); isPrime[0] = isPrime[1] = false; for(int i=2;i<=n/2;++i){ if(isPrime[i]){ for(int j=i*i;j<=n;j+=i){ isPrime[j]...
ALGO
0.99907
4.773343
12571f0f-a8f3-4fea-ab9f-431497a130c2
thegamer1907/Code_Analysis
Graphs/663.cpp
#include <bits/stdc++.h> #define ll long long #define sd(x) scanf("%d", &x) #define slld(x) scanf("%lld", &x) #define pd(x) printf("%d", x) #define plld(x) printf("%lld", x) #define pds(x) printf("%d ", x) #define pllds(x) printf("%lld ", x) #define pdn(x) printf("%d\n", x) #define plldn(x) printf("%lld\n", x)...
ALGO
0.99989
3.724544
bf1ccf6a-a5f5-4161-bda8-9fb7fa09de17
ishandutta2007/codeforces
davoth/normal/1404/D.cpp
#include <bits/stdc++.h> /*#pragma GCC optimize("Ofast,unroll-loops") #pragma comment(linker, "/stack:200000000") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma,tune=native")*/ /*#pragma GCC optimize("O2") #pragma GCC optimize("unroll-loops") #pragma GCC target("avx,avx2,sse,sse2,fma")*/ using...
ALGO
0.999993
3.786574
a74c6779-d316-46c2-8ab6-661c1bc2468b
BielMandelli/maratona-unioeste
duel/nikolas3.cpp
#include <bits/stdc++.h> using namespace std; #define fastio cin.tie(0)->sync_with_stdio(0) #define int long long const int MOD = 1e9+7; signed main(){ fastio; int a,b; cin >> a >> b; int ans = a; while (a >= b) { ans += a/b; if(a%b) { int aux = a%b; a /...
ALGO
0.99977
3.830497
7be4e70c-7813-481e-88d5-2b5c5c0d130d
codeurfou93/BACHELOR
CetC++/cpp03/exo8.cpp
#include <iostream> #include <vector> using namespace std; void afficherPlaces(const vector<int>& places) { cout << "État des places : "; for (int i = 0; i < places.size(); i++) { cout << (places[i] == 1 ? "Disponible" : "Occupée") << " "; } cout << endl; } void reserverPlace(vector<int>& plac...
TOOL
0.882775
5.856624
6b0f8fee-a1ba-45e5-bb0f-4f7559a38a8e
prakriti06/Leetcode-Questions
2131-longest-palindrome-by-concatenating-two-letter-words/2131-longest-palindrome-by-concatenating-two-letter-words.cpp
class Solution { public: int longestPalindrome(vector<string>& words) { int count[26][26] = {}; int ans =0; for(auto w : words){ int a = w[0] - 'a'; int b = w[1] - 'a'; if(count[b][a]){ ans+= 4; count[b][a]--; } else count[a][b]++; ...
ALGO
0.999987
5.896198
a638076e-3a80-4de3-a637-f0f698af1c81
sinian666/code_86_8
cpp_副本4/chapter_stack_and_queue/linkedlist_deque.cpp
/** * File: linkedlist_deque.cpp * Created Time: 2023-03-02 * Author: Krahets (<EMAIL>) */ #include "../utils/common.hpp" /* 双向链表节点 */ struct DoublyListNode { int val; // 节点值 DoublyListNode *next; // 后继节点指针 DoublyListNode *prev; // 前驱节点指针 DoublyListNode(int val) : val(val), prev(nullp...
ALGO
0.998977
5.936366
732d43e1-c2d8-4d0b-a616-803b5da77680
Snehalatha-Chevula/Leetcode-DSA
2649-count-total-number-of-colored-cells/count-total-number-of-colored-cells.cpp
class Solution { public: long long coloredCells(int n) { if(n == 0) return 1; return (n-1)*4 + coloredCells(n-1); } };
ALGO
0.999975
5.149648
f632acda-70a6-4236-a0ec-41468a84c202
yzcmf/Interview
LeetCode-Solutions/C++/maximum-depth-of-binary-tree.cpp
// Time: O(n) // Space: O(h) /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: int maxDepth(TreeNode* root) { if (!root) { ...
ALGO
0.999891
6.849616
9f81ca40-40bf-4667-b16c-cb4138852e01
euclio/llvm-gbz80
lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
#include "llvm/CodeGen/SchedulerRegistry.h" #include "ScheduleDAGSDNodes.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/Statistic.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/ScheduleHazardRecognizer.h" #include "llvm/CodeGen/SelectionDAGISel.h" #include ...
ALGO
0.981053
6.107393
4acd559b-c72a-42ee-a05c-25a05c9e11cd
giangnamG/AutoSubCodeSAMSUNG
code/HEXGAME.cpp
#include <bits/stdc++.h> using namespace std; struct Node { string config; int high; Node(string config, int high) { this->config = config; this->high = high; } }; string S = "", T = "1238004765", le = "0012345678", ri = "0012345678"; map<string, int> xuoi, nguoc; bool stop = 0; /* Qu...
ALGO
0.999801
4.542022
dc4fe010-8ac8-4701-87f5-408b133ffbff
TbcekRagher/Leetcode
LeetCode/2_Add_Two_Numbers.cpp
/*Runtime: 32 ms, faster than 63.74% of C++ online submissions for Add Two Numbers. *Memory Usage: 71.2 MB, less than 67.58% of C++ online submissions for Add Two Numbers. */ /*Input: l1 = [2,4,3], l2 = [5,6,4] *Output: [7,0,8] *Explanation: 342 + 465 = 807. *Input: l1 = [9,9,9,9,9,9,9], l2 = [9,9,9,9] *Output: [8,9...
ALGO
0.999948
5.692754
28a5d78e-1b90-4276-b5ff-2146c48bf59c
shreyam06/DAA
Lab/Q1week8.cpp
#include <iostream> #include <vector> #include <queue> #include <climits> using namespace std; struct Edge { int destination; int weight; }; class Graph { int numVertices; vector<vector<Edge>> adjacencyList; public: Graph(int numVertices) : numVertices(numVertices), adjacencyList(numVertices)...
ALGO
0.999946
5.791446
9756b946-78a7-47da-bb6f-9ed7a0cf7665
hassa129/whalecoin
src/key.cpp
#include <map> #include <openssl/ecdsa.h> #include <openssl/obj_mac.h> #include "key.h" // Generate a private key from just the secret parameter int EC_KEY_regenerate_key(EC_KEY *eckey, BIGNUM *priv_key) { int ok = 0; BN_CTX *ctx = NULL; EC_POINT *pub_key = NULL; if (!eckey) return 0; const EC_...
TOOL
0.964427
7.220924
7b1d9b5f-a33e-479d-8de3-576e94c8ed20
kunal2812/CP
codeforces/1614/A.cpp
#pragma GCC optimize("Ofast") #pragma GCC optimize("O3") #pragma GCC target("popcnt") #include <bits/stdc++.h> using namespace std; #define ull unsigned long long #define ll long long #define mp make_pair #define pb push_back #define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define yes cout << "YE...
ALGO
0.999435
3.2154
709aee65-16dc-4284-a2ec-aa045ff9a329
himanshushukla12/gfg_solutions
Easy/Find first set bit/find-first-set-bit.cpp
//{ Driver Code Starts //Initial Template for C++ #include<bits/stdc++.h> using namespace std; // } Driver Code Ends //User function Template for C++ class Solution { public: //Function to find position of first set bit in the given number. unsigned int getFirstSetBit(int n) { // Your code he...
ALGO
0.999844
6.051747
3658b71e-21f3-49b3-9dca-d79508acf72d
josepedro/palabos_acoustic
examples/tutorial/tutorial_2/tutorial_2_2.cpp
/* Code 2.2 in the Palabos tutorial */ #include "palabos2D.h" #include "palabos2D.hh" #include <vector> #include <iostream> #include <iomanip> using namespace plb; using namespace std; typedef double T; #define DESCRIPTOR plb::descriptors::D2Q9Descriptor /// Describe the geometry of the half-circular channel, used...
ALGO
0.999856
6.530882
2ed4b1bf-af7d-422e-819e-72daa81eb7d0
SyntaxErrorFixer99/silofo
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998733
6.76775
1d622a64-0e63-4246-9d46-e511a4355e6f
DavidBShan/Competitive-Programming2022-2024
OlympiadLevelThree/Sept 24/DMOPC13P4.cpp
#include <bits/stdc++.h> using namespace std; int main() { int xT, yT, x, y, times; int possible[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}}; char inp; pair<int, int> start; pair<int, int> endC; int visited[55][55]; bool over60 = false; queue<pair<int, int>> q; cin >> times; for (...
ALGO
0.999731
4.095539
f19a252f-39d9-4d63-abd5-b12420b50c8c
zarif98sjs/Competitive-Programming
CodeForces/Contest/Round 663/A.cpp
/** Which of the favors of your Lord will you deny ? **/ #include<bits/stdc++.h> using namespace std; #define LL long long #define PII pair<int,int> #define PLL pair<LL,LL> #define F first #define S second #define ALL(x) (x).begin(), (x).end() #define READ freopen("alu.txt", "r", stdin) #define WRITE ...
ALGO
0.997866
4.032965
61d6627b-1bc6-40e8-80ba-5f136e76e5e3
406345/leetcode
64_minPathSum/main.cpp
#include "stdio.h" #include "vector" #include "unordered_map" #include "set" #include "map" #include "algorithm" using namespace std; class Solution { public: void print(long long **matrix, int n, int m) { for (size_t i = 1; i <= n; i++) { for (size_t j = 1; j <= m; j++) ...
ALGO
0.999843
4.407987
3a5c8f76-5104-4736-bcdd-5ac604407c05
ratankumar19/Competitive-Programming
StringAlgo/string-search.cpp
// S and T - input strings // You need to check if string T is present in S or not #include<bits/stdc++.h> using namespace std; int findString(char S[], char T[]) { int n=strlen(S); int m=strlen(T); for(int i=0;i<=(n-m);i++){ int j; // flag=true; for(j=0;j<m;j++){ if(...
ALGO
0.999978
5.257865
4a7d7cbf-0a6c-4892-aa08-6e9d75bd04f1
TheJuliana/labs
!ADDITIONALS/lab4_add/main.cpp
/* Ограничение по времени 2 сек. Ограничение по памяти 256 мб. Посчитайте количество всех возможных счастливых трамвайных билетиков. Номер билета содержит 6 цифр. */ #include <iostream> using std::cin; using std::endl; using std::cout; int main() { int x = 0; int ticket[6]; for (ticket[5] = 0; ticket[5] ...
ALGO
0.999067
5.088254
2b66e9cb-3172-48ed-8610-59dd5cd00e72
midnight774/Problem_Solving
BOJ/BOJ_9576.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; /* BOJ 9576번 책 나눠주기 풀이 방법 : 그리디, 정렬 */ bool Cmp(const pair<int, int>& Src, const pair<int, int> Dest) { return Src.second < Dest.second; } int main() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); int T; cin ...
ALGO
0.999948
4.547492
c15adf4c-2a69-421d-b543-d901267e66c7
mailmezorro/PlaygroundCpp
hackerrank/cppExceptionhandling/cppExceptionhandling.cpp
// cppExceptionhandling.cpp : Diese Datei enthält die Funktion "main". Hier beginnt und endet die Ausführung des Programms. // #include <iostream> #include <stdexcept> using namespace std; int largest_proper_divisor(int n) { if (n == 0) { throw invalid_argument("largest proper divisor is not defined for ...
ALGO
0.94805
7.154617
7f4ace86-669c-4816-b89e-59160e93388d
raincross7/code-similarity
codes/train_code/problem259/problem259_445.cpp
#include <bits/stdc++.h> using namespace std; #define fastio() ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define ll long long #define mk make_pair #define pb push_back #define fi first #define se second #define all(x) x.begin(), x.end() #define sz(x) (int) (x).size() #define print_vec(vec) for(int i=0;i<s...
ALGO
0.990032
3.822614
54afbf8e-5ead-4d2e-a97d-ae75e307895f
zRafaF/SFML_Asteroids
src/vertexOperations.cpp
#include "../include/vertexOperations.h" sf::Vector2f rotatePointArrounPoint(sf::Vector2f myPoint, sf::Vector2f centerPoint, float rotationAngle) { // Convertendo de graus para radianos e invertendo o sentido de rotao rotationAngle = (-rotationAngle) * (PI / 180); float s = sin(rotationAngle); float c = cos(rotat...
ALGO
0.984217
5.272888
bb21cbbe-3197-4810-aeb6-2172178749c2
KrishnakantTiwari11/Leetcode_All_topics_problem
780-max-chunks-to-make-sorted/max-chunks-to-make-sorted.cpp
class Solution { public: int maxChunksToSorted(vector<int>& arr) { int n = arr.size(); int maxVal = 0; int res = 0; for (int i = 0; i < n; ++i) { maxVal = max(maxVal, arr[i]); if (maxVal == i) { res++; } } return r...
ALGO
0.999976
5.825689
a0d7067e-0736-4dd2-8bf5-291f57add4d8
Reddragoon244/Quake-4-Source-Code
idlib/geometry/Winding2D.cpp
#include "../precompiled.h" #pragma hdrstop #include "Winding2D.h" /* ============ GetAxialBevel ============ */ bool GetAxialBevel( const idVec3 &plane1, const idVec3 &plane2, const idVec2 &point, idVec3 &bevel ) { if ( FLOATSIGNBITSET( plane1.x ) ^ FLOATSIGNBITSET( plane2.x ) ) { if ( idMath::Fabs( plane1.x ) >...
ALGO
0.999161
4.760716
0f34c272-7603-4e50-91d7-dbb20bd14b45
raincross7/code-similarity
codes/train_code/problem371/problem371_266.cpp
#include<iostream> #include<vector> #include<string> #include<algorithm> #include<iomanip> using namespace std; int main(){ string s; cin>>s; bool flag=true; int n=s.size(); for(int i=0;2*i<n-1;i++){ if(s[i]!=s[n-1-i])flag=false; } for(int i=0;2*i<(n-1)/2-1;i++){ if(s[i]!=s[...
ALGO
0.999982
3.181109
0e723b7d-62f2-4584-8384-1074ece72141
ishandutta2007/codeforces
ugly2333/normal/1381/C.cpp
//CF1381C #include<iostream> #include<cstdio> #include<fstream> #include<algorithm> #include<vector> #include<map> #include<set> #include<queue> #include<bitset> #include<cmath> #include<cstring> #include<cstdlib> using namespace std; typedef long long LL; typedef double DB; const int N = 111111; int n,x,y,a[N],b[N],s[...
ALGO
0.999996
3.228043
257a4e59-a1da-4c6c-8284-3b24ddb820ce
EFUB/efub4-basic-algorithm-study
week8/[BJO] 24460.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; int solution(int seatNum, int startI, int startJ,int(*seat) [1025]){ // 1명이 남았다면 그 한 명을 반환 if(seatNum*seatNum == 1){ return seat[startI][startJ]; } else{ // 4 구역으로 나눔. seatNum = seatNu...
ALGO
0.999794
4.553997
131ef9c8-aebe-49ed-b7bd-2a0840b4f925
shubhamhgnis91/leetcode
optimal-partition-of-string/optimal-partition-of-string.cpp
class Solution { public: int partitionString(string s) { unordered_set<char> st; int count=0; for(int i=0;i<s.size();i++) { if(st.find(s[i])!=st.end()) { st.clear(); st.insert(s[i]); count++; } ...
ALGO
0.999989
5.730675
4f192c36-f490-4f42-9ed5-58a79ef72a0b
steevglez/Embedded_Solvers_MPC
FiOrdOS-FIXED-ITER-N4/source/MPCTestbenchSW.cpp
#include <iostream> #include <fstream> #include "specs.h" #include <math.h> #include "mpcSW.h" #include "tictoc.h" #include <iomanip> using namespace std; //#define DISPLAY int main(int argc, char *argv[]){ int OUTPUT = atoi(argv[2]); int TIME = atoi(argv[3]); int NUM_ITER = stoi(argv[5]); cout ...
ALGO
0.986855
4.238798
ef96cab9-187e-4e24-a11b-24847552c54f
GyosunShin/ProblemSolving
백준 유형별 문제풀이/DP/2193이친수.cpp
#include <stdio.h> #include <string.h> int N; //1<= N <=90 long cache[91]; long solve(int n){ if(n == 0) return 0; if(n == 1) return 1; long& ret = cache[n]; if(ret != -1) return ret; ret = solve(n-1) + solve(n-2); return ret; } int main(){ memset(cache, -1, sizeof(cache)); cache[0] = 0; cache[1] = 1; s...
ALGO
0.999996
4.061347
aeb28d57-5563-47c1-8224-d556aa5fd280
omarsalem33/problems-of-Leetcode
98-validate-binary-search-tree/98-validate-binary-search-tree.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.999828
6.210775
c8d2b89a-9f2e-436a-b3f2-431d171fffc9
rbs11/Fall13
adv-comp-arch/cache-simulator/cachesim_driver.cpp
#include <assert.h> #include <cstdio> #include <cstdlib> #include <time.h> #include <cstring> #include <unistd.h> #include <math.h> #include "cachesim.hpp" #define physical_address_size 1024*1024*1024*4 #define page_size 4096 #define page_table_size 1048576 #define inverted_pt_size 1048576 #define mask 0x00000000FFFFF...
TOOL
0.970685
3.153141
32e96653-2812-4fdf-91c0-8ccbad72ad8e
BeeUnknown/Cpp-Codes
Divisible_by_K.cpp
#include "bits/stdc++.h" using namespace std; #define int long long #define endl "\n" int32_t main(){ int t;cin >> t; while(t--){ int n,k; cin >> n >> k; int a[n]; for(int i = 0; i < n; ++i){ cin >> a[i]; } int rem = 1; for(int i = 0; i < n; ...
ALGO
0.999812
4.379908
62f011ea-e55e-4314-b6be-bcd2980c375a
BoHauHuang/PCCA-exercise
2020 Summer Training/2017 ACM Arabella Collegiate Programming Contest/M.cpp
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int t, c, n; double v; char s[100000]; scanf("%d", &t); while(t--){ scanf("%d%d", &c, &n); double total = 0; unordered_map<string, double> price; price["JD"] = 1.00; for(int i = 0 ; i < c ; i++){ ...
ALGO
0.986655
3.609624
1bed877a-089b-4a25-9845-e8d358522d5a
ZmcGit900312/MUL
Core/VirtualGrid.cpp
#include "stdafx.h" #include "VirtualGrid.h" Core::VirtualGrid::VirtualGrid( const ImpConfiguration & configuration, IImpService * impedance, const IEConfiguration& ieConfig): IMatrixFiller(configuration,impedance,ieConfig), _imp(static_cast<ImpAIM*>(impedance)) { size_t layer[3] = {2*configuration.xNumber-2,2 ...
ALGO
0.999689
4.742451
115ed782-de57-4e83-adfa-d086cbf743ed
gulshan4688/25_assignment_question
basics/ques34.cpp
#include <iostream> #include <cmath> using namespace std; int main() { double s; cout << "Input the length of a side of the hexagon: "; cin >> s; double area = (6 * s * s) / (4 * tan(M_PI / 6)); cout << "The area of the hexagon is: " << area << endl; return 0; }
ALGO
0.933885
4.833104
a1f35ae4-df12-4ca7-b048-3ef95e00e247
datawhalechina/smoothly-vslam
code/ch10/loop_closure.cpp
#include "DBoW3/DBoW3.h" #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/features2d/features2d.hpp> #include <iostream> #include <vector> #include <string> using namespace cv; using namespace std; /*************************************************** * 本节演示了如何根据前面训练的字典计算相似性评分...
TEST
0.991831
5.325214
148e279f-f856-4afa-a34b-adeec3e41832
joaocc/torcs-git
src/modules/track/track3.cpp
#include <stdlib.h> #include <math.h> #include <stdio.h> #include <tgf.h> #include <robottools.h> #include <track.h> #include <portability.h> #include "trackinc.h" static tdble xmin, xmax, ymin, ymax, zmin, zmax; #define TSTX(x) \ if (xmin > (x)) xmin = (x); \ if (xmax < (x)) xmax = (x); #define TSTY(y) ...
TOOL
0.926974
3.99442
9d6211e7-6a7f-480e-9edb-2f86af7ffed7
pingchungchang/CP
ABC235A.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<ll,ll> #define pii pair<int,int> #define fs first #define sc second #define tlll tuple<ll,ll,ll> int main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); string s; cin>>s; int sum = s[0]-'0'+s[1]-'0'+s[2]-'0'; cout<<sum*111; }...
ALGO
0.999618
3.301803
e6a6a967-e400-410f-80e2-a602603d9eff
0Hooni/Lecture
Problem Solving/Week 3/W3_B.cpp
#include <iostream> #include <string.h> #include <queue> #include <stack> using namespace std; void init(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } #define MAX_INDEX 2001 vector<pair<int, int>> house[MAX_INDEX]; bool visit[MAX_INDEX]; int _max[MAX_INDEX]; void bfs(int start){ ...
ALGO
0.999884
4.038017
5b5e4516-cc8e-4664-8111-5b8e12f61851
hannibal-durian/Automatic-Image-Analysis
AIAexercise3/handout/src/main.cpp
#include <opencv2/opencv.hpp> #include "app.cpp" using namespace std; using namespace cv; int main(int argc, char** argv) { // check if image paths were defined if ( argc != 3 ) { cerr << "Usage: app <path to template image> <path to query image>" << endl; return -1; } // load templ...
ALGO
0.905989
5.751563
f41452c8-7080-4fdc-8f2b-fa42a0c89031
raincross7/code-similarity
codes/train_code/problem435/problem435_143.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(int)n;i++) using Graph = vector<vector<int> >; using GraphC = vector<vector<char> >; const int INF = 1000000000; typedef pair<int, int> P; const int MAX_N = 1000000000; typedef int64_t ll; template<class T> inline bool chmax(T & a, T b) { if ...
ALGO
0.999953
3.406878
197e5983-72b1-4080-a862-ace71799c8e4
achsvg/MiroirFusion
src/tracking_module.cpp
#include "tracking_module.h" #include "gpu_manager.h" #include "miroir_manager.h" #include "util.h" #include <pcl/io/openni_grabber.h> TrackingModule::TrackingModule() { cl_float4 c1; cl_float4 c2; cl_float4 c3; cl_float4 c4; c1.s[0] = c2.s[1] = c3.s[2] = c4.s[3] = 1.0f; c1.s[1] = c1.s[2] = c1.s[3] = c2.s[0] =...
ALGO
0.993813
4.523087
5c112ec5-4c50-4186-a511-b595be460eed
jocsoncp/cpj_info450_spring_2020
week2/practice3.cpp
#include <iostream> #include <cmath> using namespace std; int main () { int a; while (true) { cout << "Enter a year. Enter -1 to stop execution: "; cin >> a; if (a == -1) { cout << "Stopping execution."; break; } if (a%4 == 0) ...
ALGO
0.995569
3.499323
7bab4a36-4100-4ec6-8aa3-79e9889e1c7f
oneapi-src/SYCLomatic
llvm/lib/CodeGen/LiveIntervalCalc.cpp
#include "llvm/CodeGen/LiveIntervalCalc.h" #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/LiveInterval.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/SlotIndexes.h" #include "llvm/CodeGen/TargetRegisterInf...
TOOL
0.994495
7.93093
cd314529-919e-431b-9acb-8c80563f1151
valerii-kostynskyi/repo_list
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998859
6.785645
5949e290-1e0d-41d8-9966-6899a0b95cbc
Prabhat2002/Data_Structure_and_Algorithm
All Elements in Two Binary Search Trees.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.999974
5.56792
0b57c054-18cc-433f-a5c8-bbc1bd6039a5
shivamh71/ObjectDetection
ObjectDetecting.cpp
#include "cv.h" #include "highgui.h" #include "stdlib.h" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #define DIFF 100 using namespace cv; using namespace std; const int MAX_NO_OBJECT = 50; const int MIN_OBJECT_AREA = 100; const int MAX_OBJECT_AREA = 40000; Mat src; Mat src_gray; Mat ma...
ALGO
0.969834
4.378302
24f90636-0e55-43d8-a651-92553c46d6bd
oigomezz/Retos
Hackerearth/Algorithms/Dynamic-Programming/State-Space-Reduction/Aeroplanes-Scheduling/solution.cpp
#include <bits/stdc++.h> using namespace std; int dp[5001][5011], mn[5001], N; vector<int> A; int solve(int i, int mx) { if (i == N) return 0; if (dp[i][mx] >= 0) return dp[i][mx]; int mi = mn[i], ret = 0; if (A[i] > A[mx]) ret = max(ret, solve(i + 1, mx)); else if (A[i] > A[mi]) { ret = ma...
ALGO
0.999958
4.538734
df609256-fb7b-4e17-a3cb-edcbd5025052
blackberry/OpenCV
modules/imgproc/src/geometry.cpp
#include "precomp.hpp" CV_IMPL CvRect cvMaxRect( const CvRect* rect1, const CvRect* rect2 ) { if( rect1 && rect2 ) { CvRect max_rect; int a, b; max_rect.x = a = rect1->x; b = rect2->x; if( max_rect.x > b ) max_rect.x = b; max_rect.width = a += rect1...
ALGO
0.999763
5.149768
21aee110-ddd1-4d93-8d1b-779b902044f8
woodart8/Learning-Algorithm-CPP
1036.cpp
#pragma GCC optimize ("Ofast") #define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> using namespace std; int histogram[51][36]; //[자릿수][해당digit] 개수 (0~35) //36(digit) -> dec constexpr int trans_digit(char n) { if (n>='0' && n<='9') return n-'0'; return n - 'A' + 10; } //dec(digit) -> 36 constexpr char rtran...
ALGO
0.999767
5.169293
c51a4285-61d8-45b8-a91e-015f3ec09cc5
worldforge/smartbody
libs/vhcl/src/vhcl_string.cpp
#include "vhcl.h" #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <wchar.h> #if defined(WIN_BUILD) #include <windows.h> #include <conio.h> #endif #if defined(MAC_BUILD) || defined(IPHONE_BUILD) || defined(ANDROID_BUILD) || defined(EMSCRIPTEN_BUILD) #include <sys/select.h> #end...
TOOL
0.941374
3.679156
185a0101-1b96-4cd8-9530-b0e004196bdf
bankptrk/leetcode_exercise
0202-happy-number/0202-happy-number.cpp
class Solution { public: int helperisHappy(int n){ int ans = 0; while(n){ int temp = n%10; ans += (temp*temp); n /= 10; } return ans; } bool isHappy(int n) { int slow = n, fast = helperisHappy(n); while(slow != fast){ ...
ALGO
0.999985
6.32435
0c33f48a-4f1a-4f3d-a605-6f5fea2d5320
abdallamaher/competitive_programming
Dynamic_Programming/Subset_take_leave/010110/A. Boredom.cpp
#define _CRT_SECURE_NO_WvNINGS #include <bits/stdc++.h> using namespace std; #define ll long long const int N = 1e5 + 5; int n, mx; vector<int> v; int cnt[N]; ll dp[N]; ll solve(int i = 0) { if (i >= n) return 0; if (~dp[i]) return dp[i]; ll& a = dp[i]; a = solve(i + 1); if (v[i] == ...
ALGO
0.999985
4.269861