uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
e2950318-e388-4820-bae4-e013d113509e
David-5-5/tutorial
cplus/leetcode/202507/algo0129.cpp
#include <bits/stdc++.h> using namespace std; 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), left(left), right...
ALGO
0.999987
5.862598
bf583440-80b2-4154-9933-79ac32b5d96d
jash13desai/codeforces
800/236A - Boy or Girl.cpp
/* Problem Name: Boy or Girl Problem Type: A - 800 Problem Link: https://codeforces.com/problemset/problem/236/A Author: Jash Desai (jash13desai) */ // ---------- HEADER ---------- #include<bits/stdc++.h> using namespace std; // ---------- TEMPLATES ---------- template<typename... T> void see(T&... args) { ((cin >> arg...
ALGO
0.99981
4.209448
b06a06bc-cc3f-42be-a9f4-277c341d3d61
Tudat/tudat
src/simulation/propagation_setup/propagationLowThrustProblem.cpp
#include "tudat/simulation/propagation_setup/propagationLowThrustProblem.h" #include "tudat/simulation/propagation_setup/dynamicsSimulator.h" namespace tudat { namespace simulation_setup { void computeLowThrustLegSemiAnalyticalAndFullPropagation( const std::shared_ptr< low_thrust_trajectories::LowThrustLeg >...
ALGO
0.998313
7.609532
3ebba139-555a-441d-a09c-6d79317aebf9
m-pai/Advent-of-Code-2023
cpp_Ray/day_1_part_2.cpp
#include <bits/stdc++.h> using namespace std; //---------------------------------------------------------------------------------------------------------- // read n lines // each line contain a string with alpha-num characters // create an int using the first and last numerical digit u find in the string // string can...
ALGO
0.999611
4.727201
763e2f42-31d8-4647-8331-9b1d82fce16c
vikalpshakya/DSA
C++/Stacks and Queues/Insert An Element At Its Bottom In A Given Stack.cpp
#include <bits/stdc++.h> void helper(stack<int>& st, int x){ if(st.empty()) { st.push(x); return ; } int top = st.top(); st.pop(); // recursive call helper(st,x); st.push(top); } stack<int> pushAtBottom(stack<int>& myStack, int x) { helper(myStack,x); return mySta...
ALGO
0.999751
5.150374
2f3e8335-6b5b-4cae-ad08-d50843b65e06
ShazidMashrafi/CSES
Codes/2165 - Tower of Hanoi/2165.cpp
#include <bits/stdc++.h> using namespace std; #ifdef ONLINE_JUDGE #define dbg(...) #else #include <debug.h> #endif #define ll long long #define endl '\n' #define ff first #define ss second #define pb push_back #define sz(x) (int)(x).size() #define all(x) x.begin(), x.end() #define Dpos(n) fixed << setpre...
ALGO
0.999936
4.300954
fd3e96ff-0cdb-49de-930a-eb5ac3e0d6fc
nicholsonjohnc/laso-old
LASO/HS071.cpp
#include "HS071.h" bool LASO::HS071::objFun(double *x, double *fObj) { fObj[0] = x[0] * x[3] * (x[0] + x[1] + x[2]) + x[2]; return true; } bool LASO::HS071::objGrad(double *x, double *gObj) { gObj[0] = 2.0*x[0] * x[3] + x[1] * x[3] + x[2] * x[3]; gObj[1] = x[0] * x[3]; gObj[2] = x[0] * x[3] + 1.0; gObj[3] =...
ALGO
0.991499
4.501055
71a8437c-928f-4844-b2d6-63190004bb7c
codewithdivu/LeetCode-SolvedByMe
Class & Objects/303._Range_Sum_Query_-_Immutable.cpp
class NumArray { private: vector<int> arr; public: NumArray(vector<int> &nums) { for (int i = 0; i < nums.size(); i++) { arr.push_back(nums[i]); } } int sumRange(int left, int right) { int sum = 0; for (int i = left; i <= right; i++) ...
ALGO
0.999704
6.502621
ca3ad061-c916-4398-8231-d0f57658d48b
deska123/Exercise
array/archeryTournament.cpp
#include <iostream> /** * This single .exe program functionates to create a simple archery tournaments * and find its winner based on its score * * @author Dennis Pratama Kamah * @version 2017.06.24 **/ main() { std::cout << "Archery Tournament with 5 players" << "\n"; std::cout << "=========================...
ALGO
0.999773
4.180554
10d67401-0a84-4ef7-9d14-2588e3371dd9
excess-project/starpu-ex-1.2.0rc5
starpu-top/qwt/qwt_clipper.cpp
#include "qwt_clipper.h" #include "qwt_math.h" #include <qrect.h> #if QT_VERSION < 0x040601 #define qAtan(x) ::atan(x) #endif static inline QRectF boundingRect( const QPolygonF &polygon ) { return polygon.boundingRect(); } enum Edge { Left, Top, Right, Bottom, NEdges }; class QwtPolygonClipp...
TOOL
0.996098
6.416378
423c438d-85fe-4e04-9369-72f561179920
umar24nov/Decode-DSA-in-CPP
Arrays/Practice/mergeSortedArrays.cpp
#include <bits/stdc++.h> using namespace std; int main (){ vector<int> arr1 = {1,4,5,8}; vector<int> arr2 = {2,3,6,7,10,12}; vector<int> res(arr1.size() + arr2.size()); int n = arr1.size(); int m = arr2.size(); int i = 0, j = 0, k = 0; while(i < n and j < m){ if(arr1[i] <= arr2[j])...
ALGO
0.999983
4.737309
481f2cf7-d5b5-4636-95f8-eacfc2b6b4b7
intervalrain/Cpp
blind75/dp/house_robberII.cpp
#include <iostream> #include <vector> using namespace std; class Solution{ public: int rob(vector<int>& nums){ vector<vector<int>> dp(2, vector<int>(nums.size()+1)); if (nums.size() == 1) return nums[0]; int res = max(nums[0],nums[1]); if (nums.size() == 2) return res; if...
ALGO
0.999947
4.941272
4f39850b-10b8-498c-be25-2d00f14e6374
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_4451_17.cpp
#include <bits/stdc++.h> using namespace std; inline int getidx(const vector<int>& ar, int x) { lower_bound(ar.begin(), ar.end(), x) - ar.begin(); } inline long long GCD(long long a, long long b) { long long n; if (a < b) swap(a, b); while (b != 0) { n = a % b; a = b; b = n; } return a; } inline...
ALGO
0.999979
3.64654
513f1623-28cb-444f-ac52-71aec56215c1
duttaANI/AL_Lab
Leetcode/169_MajorityElement.cpp
class Solution { public: int majorityElement(vector<int>& nums) { sort(nums.begin(),nums.end()); return nums[nums.size()/2]; } };
ALGO
0.999909
5.812265
f39f3095-8ad3-4426-9682-1d5a29bf7aa8
Gyanthakur/GFG_POTD
september_2023/potd_12_09_2023.cpp
#include<bits/stdc++.h> using namespace std; #define int long long long long t, a[100005]; class Solution { public: int isPerfectNumber(long long N) { if(N==1) return 0; long long sum=1; for(int i=2;i<=sqrt(N);i++) { if(N%i==0) {...
ALGO
0.999736
4.543979
d6a13584-3348-4b98-9c6f-ad4c09eda41b
AmeenUrRehman/Cpp-Basics
Linked List/SortList0s1sWithoutReplacement.cpp
#include<iostream> using namespace std; class Node{ public: int data; Node* next; Node(int data){ this -> data = data; this -> next = NULL; } }; Node* sortList(Node* &head){ Node* zeroHead = new Node(-1); Node* zeroTail = zeroHead; Node* OneHead = new Node(-1); ...
ALGO
0.999993
4.87113
fe33fb37-f9af-4f63-9b10-336065b1877d
yaylinda/compression
dictionary.cpp
#include "./dictionary.h" #include <strings.h> #include <stdlib.h> #include <stdio.h> #include <math.h> #include <assert.h> ///////////////////////////// // private defines #define MAX_REPRESENTATION_LENGTH 2048 // the max number of bits an encoded symbol can be #define NEWICK_RECURSE_LEFT 97 #define NEWICK_RECURSE...
ALGO
0.976536
5.091356
995ca4a9-9aed-40ad-a060-490c3f5d346c
gmprinceyt/Data-Structure-Algorithm
Array/Day18.cpp
#include <iostream> using namespace std; void lacturePractic() { // insertion Sort int arr[1000]; int n; cout << "Enter Array length: "; cin >> n; cout << "Enter Your value: "; for (int i = 0; i < n; i++) cin >> arr[i]; for (int i = 1; i < n; i++) { for (int j = i; ...
ALGO
0.999629
4.087803
29944957-3ec6-4764-8c96-4557c49125f1
Raunak1001/Competitive-Coding
CodeForces/Div2/386/D.cpp
#include<bits/stdc++.h> using namespace std; #define vi vector<long long int> #define vc vector<char> #define vvi vector<vector<long long int> > #define vvc vector<vector<char> > #define ll long long int #define pr pair<long long int,long long int> #define mp make_pair int main(){ ll n,k,g,b; cin >>n>>k>>g>>b; ...
ALGO
0.99968
3.571029
32354be7-03b2-4e6b-b82a-5c791562cefb
dEsquilas/aoc2020
boost_1_74_0/libs/yap/perf/code_gen_samples.cpp
template<typename T> using term = boost::yap::terminal<boost::yap::expression, T>; namespace yap = boost::yap; namespace bh = boost::hana; namespace user { struct number { double value; friend number operator+(number lhs, number rhs) { return number{lhs.value + rhs.value}...
TOOL
0.913406
7.291253
6c31bf90-d857-4c83-b5f1-1fbc5415c0e6
jgh05168/AlgorithmStudy
프로그래머스/3/68646. 풍선 터트리기/풍선 터트리기.cpp
/* 1. 인접한 두 풍선을 고른 뒤, 두 풍선 중 하나를 터트림 2. 풍선들 사이 빈 공간이 있다면, 중앙으로 밀착시킨다. - 번호가 더 작은 풍선은 한 번만 터트릴 수 있음 -> 나머지는 번호가 더 큰 풍선을 터트려야한다. 최후까지 남기는 것이 가능한 풍선들의 개수를 return a의 길이 <= 1000000 풀이 : 정렬 불가능 먼저 풍선이 큰 녀석들만 모두 터트린다. 가운데 풍선을 남기기 위해서는 1. a < b, b < c 2. a > b, b < c 3. a > b, b > c --> b가 작은 순간이 있기만 하면 answer가 가능하다. */ ...
ALGO
0.999946
4.760324
6ae57770-7b5d-4477-b4a3-b384c5c129ce
sarvex/leetcode-javascript
solution/0300-0399/0307.Range Sum Query - Mutable/Solution.cpp
class BinaryIndexedTree { public: int n; vector<int> c; BinaryIndexedTree(int _n) : n(_n) , c(_n + 1) {} void update(int x, int delta) { while (x <= n) { c[x] += delta; x += lowbit(x); } } int query(int x) { int s = 0; wh...
ALGO
0.999961
6.802256
369eacb4-66ef-41ef-9139-8a3f01eaa713
danilolucasmd/programming-solutions
uri/UOJ_1038 - (1024818) Accepted.cpp
#include <iostream> #include <iomanip> using namespace std; int main(){ int a, b; cin >> a >> b; if(a==1){ cout << "Total: R$ " << fixed << setprecision(2) << 4.00*b << endl; } if(a==2){ cout << "Total: R$ " << fixed << setprecision(2) << 4.50*b << endl; } if(a==3){ cout << "Total: R$ " << fixed << setpre...
ALGO
0.993567
4.264715
6cd34ddf-7670-4d6a-a6fe-237a5a47d324
ra2003/Plagiarism
dataset/test/modification/1499_rename/2/transformation_1.cpp
#include <iostream> using namespace std; int main() { int o_but; cin >> o_but; while(o_but--){ int auo_dy, g, h; cin >> auo_dy >> g >> h; int gaz_qdk, fl; cin >> gaz_qdk >> fl; int pnu_al = (g + h) / 2; int xo = (auo_dy * 2 - (g + h)) / 2; if (gaz_qdk <= pnu_al && fl <= xo) cout << "YES" << "\n"; else co...
ALGO
0.998197
3.230203
b01b2ac4-3bac-40d9-86ca-a13168a09675
tahsina-azam/My_codes
Codeforces/580A.cpp
#include<bits/stdc++.h> using namespace std; long long arr[100009]; int main(){ long long n,p; int i=0; int cnt=1,ans=0; cin>>n; while(n--){ cin>>arr[i]; if(i>0 && arr[i]>=arr[i-1]){ cnt++; //cout<<cnt<<endl; } else{ ans=ans>cnt?an...
ALGO
0.999922
3.493944
624b4769-1b79-4764-99d0-6ba2641c69c5
rupav/cp
competitive_coding/contests/665/D.cpp
#include<bits/stdc++.h> using namespace std; #define watch(x) cout << (#x) << " is " << (x) << endl #define fr(i,n) for(int i=0; i<n; i++) #define rep(i, st, en) for(int i=st; i<=en; i++) #define repn(i, st, en) for(int i=st; i>=en; i--) #define sq(a) (a) * (a) typedef long long ll; typedef pair<int, int> pii; typedef...
ALGO
0.999951
4.366983
7d50533d-92ce-4112-af30-df797caf5d49
IvoryRubble/led_strip_plasma
src/main.cpp
#include <Arduino.h> #include <Adafruit_NeoPixel.h> #include "mapf.h" #include"mathFuncs.h" #define LED_PIN 4 #define LED_COUNT 19 const uint32_t period0 = 5000 * 3; const uint32_t period1 = 7000 * 3; const uint32_t period2 = 10000 * 3; const uint32_t period3 = 3000 * 3; const int brightness0 = 255; const int brightn...
TOOL
0.856429
4.154091
2b8cc8e5-8e67-43d8-88fe-1078b23c24c8
ishu1983/9.-loop
n_to_1.cpp
#include<iostream> using namespace std; int main(){ int n = 5; for(int i=n; i>=1; i--){ cout<<" "<<i; } return 0; }
ALGO
0.997596
3.161456
94c1d517-16c3-4a82-b165-883af4b6ed88
MrAryan8728/LeetCode
Medium/Implementing Dijkstra Algorithm/implementing-dijkstra-algorithm.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: //Function to find the shortest distance of all the vertices //from the source vertex S. vector <int> dijkstra(int V, vector<vector<int>> adj[], int S) { // Code here vector<...
ALGO
0.999955
5.197882
8b979b7d-ffd9-4965-a9e1-3f6f7919192b
prashant2979/cppdsa
ARRAY/ARRAYPROBLEM/uniquenumber.cpp
#include<iostream> using namespace std; void printarray(int arr[] ,int n ){ for(int i=0;i<n;i++){ cout<<arr[i]; } } int uniquearray(int arr[],int n){ int ans=0; for(int i=0;i<n;i++){ ans=ans^arr[i]; // cout<<arr[i]; // cout<<ans<<endl; } return ans; } int main(...
ALGO
0.999881
4.193915
5d1159a9-673f-4a5a-9605-efe5b77293ca
PARTHKUMAR80/C-codes-for-Graph-Data-Structure
mother_vertex.cpp
#include <bits/stdc++.h> using namespace std; class graph{ int V; list <int> *adj; public: graph(int k){ this->V=k; this->adj=new list<int> [V]; } void add_edge(int v,int w){ adj[v].push_back(w); } int find_mother(); void df...
ALGO
0.999449
4.578063
18453fa5-77ba-4835-8aaf-9fa8f7450fdc
ernesto-jimenez/charguess
ext/libcharguess/cpp/charDistribution.cpp
#include "charDistribution.h" #include "JISFreq.tab" #include "Big5Freq.tab" #include "EUCKRFreq.tab" #include "EUCTWFreq.tab" #include "GB2312Freq.tab" #define SURE_YES 0.99f #define SURE_NO 0.01f //return confidence base on received data float CharDistributionAnalysis::GetConfidence() { //if we didn't receive ...
ALGO
0.978129
4.92648
da4dc77d-e29d-4b0a-9f3b-6da5cda2b3db
dan-lara/Uri-problems-Beecrowd
6 - 1237 - Comparação de Substring.cpp
#include <iostream> using namespace std; int main() { string str1, str2; getline(cin, str1); while (getline(cin, str2)) { int len = 0, len2 = 0; for (int i = 0; i < str1.length(); i++) for (int j = 0; j < str2.length(); j++) if (str2[j] == str1[i]) { ...
ALGO
0.999622
3.587083
b9389b09-559b-4809-8a6f-cb3122f83b60
ayushkr1999/Competitive-Programming
CodeForces/1348A.cpp
#include<bits/stdc++.h> using namespace std; #define fastIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define N 1000005 #define ll long long #define ld long double #define lli long long int #define pb push_back #define INF 10000000000 #define mod 1000000007 #define MOD 1000000007 #define mp make_pair #...
ALGO
0.999814
4.065614
781cb4ef-d13e-44c7-b23c-3f46a81560dc
tokend/core
src/transactions/dex/OfferExchange.cpp
#include "OfferExchange.h" #include "database/Database.h" #include "ledger/LedgerDelta.h" #include "ledger/LedgerManager.h" #include "ledger/OfferHelper.h" #include "util/Logging.h" #include "xdrpp/printer.h" #include "ledger/BalanceHelper.h" namespace stellar { OfferExchange::OfferExchange(LedgerDelta& delta, LedgerM...
ALGO
0.874761
7.93737
291f08c2-0e8d-43f6-a4d2-68b803d81d0a
rdunning0823/tophat
src/Engine/GlideSolvers/MacCready.cpp
#include "MacCready.hpp" #include "GlideSettings.hpp" #include "GlideState.hpp" #include "GlidePolar.hpp" #include "GlideResult.hpp" #include "Math/ZeroFinder.hpp" #include "Util/Tolerances.hpp" #include <algorithm> #include <assert.h> #ifdef INSTRUMENT_TASK // global, used for test harness long count_mc = 0; #endif ...
ALGO
0.99955
6.578933
400df1ef-e47c-41ea-9a1f-90127c68cf1a
dwfrank1/BoostSearch
Boost_Searcher/boost_1_83_0/libs/yap/example/pipable_algorithms.cpp
#include <algorithm> #include <vector> //[ pipable_algorithms_and_simple_range // An enum to represent all the standard algorithms we want to adapt. In this // example, we only care about std::sort() and std::unique(). enum class algorithm_t { sort, unique }; // Just about the simplest range template you could const...
ALGO
0.999608
7.657449
11067109-d91e-4a33-8c69-54962f8ee22f
NipenPaul/Program-Catagory-Document
Online Judge/UVA/10260.cpp
#include <cstdio> #include <algorithm> #include <cstring> #include <string> #include <cctype> #include <stack> #include <queue> #include <vector> #include <map> #include <sstream> #include <set> #include <math.h> #include<iostream> using namespace std; int main() { char c[20]; int a,i,counts,E; while(scanf(...
ALGO
0.995773
3.266531
0b99e720-ac65-451f-813a-79d8ca786d08
Darkfalcon2804/Cplusplus
returntype.cpp
//////Return type?? #include<iostream> using namespace std; int min(int x,int y){ if(x<y) return x; else return y; } int main(){ int a; cout<<"Enter first number: "; cin>>a; int b; cout<<"Enter second number: "; cin>>b; int m=min(a,b); cout<<"Minimum between first number and second number is...
ALGO
0.999313
3.570748
bb933273-e7f4-4dcb-8c03-cc16aaea3df3
kallagoutham/My_Solutions
Leetcode/518. Coin Change II.cpp
class Solution { public: int change(int amount, vector<int>& coins) { int n=coins.size(); vector<vector<uint64_t>> dp(n+1,vector<uint64_t>(amount+1,0)); for(int i=0;i<=n;i++){ dp[i][0]=1; } for(int i=1;i<=n;i++){ for(int j=1;j<=amount;j++){ ...
ALGO
0.999976
6.04688
e8f6388e-26f2-4563-a0c5-b0b3ccd189ec
FirstCoderOfSangihe/Codeforces-TLX
750A.cpp
//Codeforces : New year and Hurry #include <iostream> using namespace std; int main() { int n,k , cnt = 0; cin >> n >> k; k = 240 - k; for( int i = 1; i <= n; i++) { if( k<= 0) { break; } else { int y = i*5; if( k >= y) { k-= y; cnt++; } else { break; } } } cou...
ALGO
0.999225
3.56189
e8d54402-2f3f-4701-84fa-a81db8d54bbc
robinrst/Div2C
tableDecoration_#478.cpp
#include "bits/stdc++.h" using namespace std; #define f first #define lgn 25 #define endl '\n' #define sc second #define N (int)2e5+5 #define sz(x) x.size() #define int long long int #define ld long double #define vi vector<int> #define vs vector<string> #define vc vector<char> #define mii map<int,int> #d...
ALGO
0.998334
4.451913
419ee41c-68f7-49d3-b674-615a0f564d2c
LIFECorp/packages
inputmethods/LatinIME/native/jni/src/suggest/policyimpl/dictionary/bigram/dynamic_bigram_list_policy.cpp
#include "suggest/policyimpl/dictionary/bigram/dynamic_bigram_list_policy.h" #include "suggest/core/policy/dictionary_shortcuts_structure_policy.h" #include "suggest/policyimpl/dictionary/dynamic_patricia_trie_node_reader.h" #include "suggest/policyimpl/dictionary/dynamic_patricia_trie_writing_helper.h" #include "sugg...
ALGO
0.869335
7.540181
d8885947-c1c0-43f0-8ed0-f2dd050b0869
ishandutta2007/codeforces
nathanajah/normal/375/B.cpp
//nathanajah's template //28-11-2012 #include <stdio.h> #include <iostream> #include <stdlib.h> #include <math.h> #include <string> #include <string.h> #include <vector> #include <algorithm> #include <stack> #include <queue> #include <set> #include <deque> #include <map> #include <ctime> #define ii pair<int,int> #defin...
ALGO
0.9999
3.350813
f0ba44f8-709a-4c5f-8fe9-29a3cf8f849d
BuzzCoin/Master
BuzzCoin1/src/pbkdf2.cpp
#include <string.h> #include "pbkdf2.h" static inline uint32_t be32dec(const void *pp) { const uint8_t *p = (uint8_t const *)pp; return ((uint32_t)(p[3]) + ((uint32_t)(p[2]) << 8) + ((uint32_t)(p[1]) << 16) + ((uint32_t)(p[0]) << 24)); } static inline void be32enc(void *pp, uint32_t x) { uint8_...
ALGO
0.993935
6.905365
4762bd71-a0f6-4b06-a174-41a910eb7ae4
tplee923/uva
755.cpp
// uva 755 #include<algorithm> #include<cstdio> #include<iostream> #include<cstring> #include<string> #include<vector> using namespace std; const char *mm[] = { "0", "1", "2ABC", "3DEF", "4GHI", "5JKL", "6MNO", "7PRS", "8TUV", "9WXY" }; char map[128],line[1048576]; vector<string> phones; int main() { int N; memse...
ALGO
0.999631
3.74219
27621a56-34cc-4e71-b51a-654ebaabb3de
ZhangShuaiH/demos
algorithm/sort/计数排序与基数排序.cpp
#include <iostream> #include <vector> using namespace std; void printArray(int a[], int size){ for(int i=0; i<size; i++) cout<<a[i]<<","; cout<<""<<endl; } // 计数排序 void countSort(int a[], int size){// 计数排序是特殊的基数排序 int min=a[0], max=a[0]; for(int i=0; i<size; i++){ if(a[i]<min) ...
ALGO
0.999817
4.256619
9d609fe1-5e03-4322-97b9-f178b8c8a983
bee64/cs410
a4/Camera.cpp
#include "Camera.h" #include "Linear.h" #include "Model.h" #include "Face.h" #include "Point.h" using std::ifstream; using std::cout; using std::endl; #include <string> using std::string; using std::stod; #include <cstring> #include <vector> using std::vector; // #include <algorithm> #include <math.h> //using std::max...
ALGO
0.986944
4.405624
619ebfa5-12c0-4ccc-aec6-84e0bfed4245
justgameartik/Code_run
357.cpp
#include <iostream> #include <string> #include <unordered_map> #include <vector> #include <unordered_set> int main() { int T; std::cin >> T; std::string word; std::unordered_map<std::string, int> e; std::unordered_set<std::string> v; for (int i = 0; i < T; i++) { std::cin >> word; ...
ALGO
0.996433
4.264729
d3b67e31-6c79-4d3d-91e4-2e083bcaeeb8
nirajbawa/dsa
36-lec/quick_sort.cpp
#include <iostream> using namespace std; int partition(int arr[], int s, int e) { int pivot = arr[s]; int cnt = 0; for (int i = s+1; i <= e; i++) { if(arr[i]<=pivot) { cnt++; } } int pivotIndex = s+cnt; swap(arr[pivotIndex], arr[s]); int i = s, ...
ALGO
0.999983
5.360551
9e934e92-b646-4d2f-ad34-26cd46ec97ed
Yashgabani845/hirebackend
Backend/temp/gn4t1kv.cpp
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; int sum = a + b; cout << sum << endl; return 0; }
ALGO
0.975671
4.449809
503200cd-a157-4ca3-bba9-78af97d7e542
Joonking/Study_CodingTest
Study_CodingTest/BaekJoon/알고리즘분류/기하학/1002_터렛.cpp
#include <iostream> #include <math.h> using namespace std; int main() { int T, sum, sub, result; int x1, y1, r1, x2, y2, r2; cin >> T; double distance; for (int i = 0; i < T; i++) { cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2; //distance^2=(x2-x1)^2+(y2-y1)^2 distance = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2)); ...
ALGO
0.999862
4.013087
e6f48464-46ff-43bc-bf0a-38c1771d7edc
jingjingluyu/Graduation-project
sift部分/sift.cpp
#include <iostream> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <stdio.h>//标准输入输出头文件,编写C语言中,常用到printf()和scanf()函数. #include <string.h>//是C版本的头文件,包含比如strcpy、strcat之类的字符串处理函数。 #define TRUE 1//define 用于简单的字符替换 extern "C"{ #include <vl/generic.h>...
TOOL
0.958238
3.53276
5b7c7a15-b1de-4576-9a01-11e7a47d759c
filipeherculano/UVA_trash
10919.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int k, m, c, r; while(cin >> k && k){ bool OK = true; cin >> m; scanf("%*c"); string fred[k], aux; for(int i = 0; i < k; i++) cin >> fred[i]; for(int i = 0; i < m; i++){ int count = 0; cin >> c >> r; for(int j = 0; j < c; j++){ ci...
ALGO
0.999465
3.696869
71820516-bae2-4e2d-9744-66241bd188a0
Squeletito08/competitive-programming
Clubs/CPCFI/6G/Contest/Contest_08-10-24/B_Forming_Triangles.cpp
#include <bits/stdc++.h> using namespace std; #define owo \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define pb push_back #define mp make_pair #define fi first #define se second ...
ALGO
0.999892
5.365224
2c9ecbcd-649a-4090-9702-51ca56f52b83
titaniumsyrup/competetive-programming-problems
E_Binary_Deque.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <climits> #include <cmath> #include <iomanip> #include <map> #include <deque> #include <queue> #include <utility> using namespace std; typedef long long ll; void solve() { ll n,s,ans=0; cin >> n>>s; ll arr[n]; ll sum=...
ALGO
0.999735
4.02206
06587be1-8025-420d-9fbd-fd76246d71a0
IsfarNayen/CodeforcesSoln
C. Sum on Subarrays.cpp
//Problem Link : //char *p; p=strstr(x , "any_string to find"); //*max_element(vect.begin() , vect.end()) #include<bits/stdc++.h> using namespace std; #define ISFAR() ios_base:: sync_with_stdio(0); cin.tie(0); cout.tie(0); #define ll long long #define pb push_back #define mp make_pair bool is_prime(ll n){for(ll i=2 ...
ALGO
0.999839
4.011389
397e1e48-3e07-45c9-9548-c26d6e66f333
Nandan1436/CSE-301
Kruskal.cpp
#include <bits/stdc++.h> using namespace std; vector<pair<int,pair<string,string>>>graph; vector<pair<int,pair<string,string>>>tree; map<string,string>parent; map<string,int>ranks; int totalWeight; void readInput() { string a,b; int w; while(cin>>a){ cin>>b; cin>>w; pair<string,string>t...
ALGO
0.999961
4.309184
95d3a9c1-6b05-4f50-ac17-0a9baaafa24a
Ekuuri/ivs-proj2
src/profiling.cpp
/****************************************************************** * Project name: IVS 2 project * Date: 1.4.2025 * Last change: 27.4.2025 * Team: audentes Fortuna iuvat * Author: Marek Furiš * Brief: Profiling implementation *****************************************************************/ /** * @file profil...
ALGO
0.98968
3.881902
4addb307-378c-4af9-8c0f-e67c3ab08e90
Arpitpandey992/cpp-vscode
Contests and Practice/CodeChef/Practice/is it a vowel or consonant.cpp
#include <iostream> using namespace std; #include <cmath> int main() { char c; cin>>c; switch(c) { case 'A': case 'E': case 'I': case 'O': case 'U':cout<<"Vowel\n"; break; default : cout<<"Consonant\n"; } }
ALGO
0.999614
3.58001
5608f459-bf2a-48bb-825a-0d4b0cc2ba14
uchihadark/CloneForces-My-Submissions
1837/A.cpp
#include <bits/stdc++.h> const long long mod = 1e9 + 7; #define int long long #define pi pair<int,int> #define vi vector<int> #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() #define pb push_back #define mp make_pair #define FAST_IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define TIME cerr <...
ALGO
0.996644
4.594354
216b4082-8bed-4942-8032-b32a6eaf9730
ArifaEaterian/TudeDude_Assignments
32.cpp
/* */ #include <iostream> #include <limits.h> using namespace std; int main() { string ne,hay; int j=0,count=0,n,i,counter; while(cin>>n>>ne>>hay){ if(ne.length()>hay.length()){ cout<<endl; } if(ne.length()==hay.length()){ if(hay==ne){ cout<<0<<endl; } } if(ne.length()<hay.length()){ ...
ALGO
0.999847
3.112694
fee04f92-5555-4f11-880b-44a21a30c288
sarvex/leetcode-basic
solution/2200-2299/2267.Check if There Is a Valid Parentheses String Path/Solution.cpp
bool vis[100][100][200]; int dirs[3] = {1, 0, 1}; class Solution { public: bool hasValidPath(vector<vector<char>>& grid) { memset(vis, 0, sizeof(vis)); return dfs(0, 0, 0, grid); } bool dfs(int i, int j, int t, vector<vector<char>>& grid) { if (vis[i][j][t]) return false; v...
ALGO
0.999942
5.446515
b1cbb82e-7bcd-4352-8a13-b52176b8d346
huuphuc2301/SemiACO
rand.cpp
/** * @author: Rafał Skinderowicz (<EMAIL>) */ #include <omp.h> #include "rand.h" /** * This is used to get a default (pseudo-)random number generator (RNG). * Every OpenMP thread has its own private instance that is * initialized by calling init_random_number_generators(). * All threads generators share the sa...
TOOL
0.916937
5.313348
105d8aa7-0e3d-4c94-9ff9-4a1574ad344a
as3545/C-plus-plus
Anagram or Not.cpp
//Code #include<bits/stdc++.h> using namespace std; int anagram(const char *str1, const char *str2){ int count[256]={0}; if(strlen(str1) != strlen(str2)){ return 0; } for(int i=0;str1[i] != '\0'; i++){ count[str1[i]]++; } for(int i=0;str2[i] !='\0'; i++){ count[str2[i]]-...
ALGO
0.999989
4.539092
35c023cf-4f67-4d1c-a4d3-b528163f5fa8
RoseDuke/EC526_Solver
multigrid/omp/mg_omp.cpp
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <complex.h> #include <chrono> #include <omp.h> typedef struct { int N; int Lmax; int size[20]; double a[20]; double m2; // store m^2 directly double scale[20]; } param_t; void relax(double *phi, double *res, int lev, int niter, ...
ALGO
0.999975
3.101267
e9ff46e9-d7b8-49d2-bdff-3aeb8944ead0
vankrav/tetris
tetris.cpp
/*! \file \brief логика игры */ #include "tetris.h" /*! \brief */ Tetris::Tetris() { srand(unsigned(time(NULL))); ///Инициализирует генератор случайных чисел. score = 0; best = 0; speed = 300; blockIsBomb = true; ///Заполняет поле нулями. for(int i = 0; i < MAXX; i++) { for(in...
ALGO
0.966781
5.055287
320635ac-42bf-4286-998f-60134d58f5ab
0point1Zishan/CP
Random_Practice/C_Vasilije_in_Cacak.cpp
#include<bits/stdc++.h> #define int long long int #define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); using namespace std; void solve(){ int n, k, x; cin >> n >> k >> x; int sum = (n * (n + 1) / 2 ) - ((n - k) * (n - k + 1) / 2); int mn = (k * (k + 1) / 2); if(sum >= ...
ALGO
0.999948
4.39488
6d75c405-4417-4bc2-9ffb-f35759315959
WayneYann/OpenFOAMTrainingCombustionTest
Libraries/eigen-3.3.3/test/sparse_permutations.cpp
static long int nb_transposed_copies; #define EIGEN_SPARSE_TRANSPOSED_COPY_PLUGIN {nb_transposed_copies++;} #define VERIFY_TRANSPOSITION_COUNT(XPR,N) {\ nb_transposed_copies = 0; \ XPR; \ if(nb_transposed_copies!=N) std::cerr << "nb_transposed_copies == " << nb_transposed_copies << "\n"; \ VERIFY( (#XPR...
TEST
0.958066
6.2616
2f58a696-f8c5-429c-901c-94e0e58856cc
Uralauah/CodingTest
프로그래머스/2/258711. 도넛과 막대 그래프/도넛과 막대 그래프.cpp
#include <string> #include <vector> using namespace std; int arr[1000001][2]; int edge=0,a=0,b=0,c=0,big=0; void find(){ for(int i=0;i<=big;i++){ if(arr[i][0]==0){ if(arr[i][1]>=1) a++; } else if(arr[i][0]>=2){ if(arr[i][1]==0) edge=i...
ALGO
0.998161
4.54171
ad2efcdd-39f1-4f9f-9407-cb28fadfd574
sKAR04/CP-Practice
Codeforces/259/259A.cpp
//Strike me down and I shall become stronger, than you can possibly imagine #include <bits/stdc++.h> using namespace std; //save time #define endl '\n' typedef long long ll; //for sorting #define all(a) a.begin(),a.end() //Constants #define PI 3.141592653593 #define MOD 1000000007LL #define EPS 0.000000001 //...
ALGO
0.999919
3.652978
5493e643-9761-469a-82a9-4001e81ea0b6
ou3slati/competitive-programming
Implementations/MyChecklist/APIO/16/Gap.cpp
//Never stop trying /*#pragma GCC target ("avx2") #pragma GCC optimize ("Ofast") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops")*/ #include "bits/stdc++.h" #ifndef LOCAL #include "gap.h" #endif using namespace std; #define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0) typede...
ALGO
0.999883
4.434381
ab621076-f339-4ca2-83d4-a05a1ecef056
AndHager/SysCallStubber
llvm-project/clang-tools-extra/clangd/ParsedAST.cpp
#include "ParsedAST.h" #include "../clang-tidy/ClangTidyCheck.h" #include "../clang-tidy/ClangTidyDiagnosticConsumer.h" #include "../clang-tidy/ClangTidyModuleRegistry.h" #include "AST.h" #include "Compiler.h" #include "Config.h" #include "Diagnostics.h" #include "Headers.h" #include "IncludeFixer.h" #include "Preamble...
TOOL
0.921968
6.419013
f24b6460-b0b5-4cf1-b5ca-b74e58e2a6f0
satvikchauhan22/LBM
Flow_Parallel_Plates.cpp
#include <iostream> #include <cmath> #include <fstream> #include <vector> #include<bits/stdc++.h> using namespace std; template <typename T> class LatticeBoltzmann { private: int n; int m; T*** f; T*** feq; T** u; T** v; T** rho; T*** source; T* w; T* ex; T* ey; T nu; ...
ALGO
0.998532
3.6772
89cc5ea3-578a-48df-b315-efd07962feee
TCRF/Dorke-and-Ymp
mednafen/mednafen/snes/src/sdsp/brr.cpp
#ifdef SDSP_CPP alwaysinline void sDSP::brr_decode(voice_t &v) { //state.t_brr_byte = ram[v.brr_addr + v.brr_offset] cached from previous clock cycle int nybbles = (state.t_brr_byte << 8) + memory::apuram[(uint16)(v.brr_addr + v.brr_offset + 1)]; const int filter = (state.t_brr_header >> 2) & 3; const int sca...
ALGO
0.868337
5.832803
166bf0e7-3b8b-444a-98b0-205dd079b009
lip6/painless
solvers/cadical/src/lucky.cpp
#include "internal.hpp" namespace CaDiCaL { // It turns out that even in the competition there are formulas which are // easy to satisfy by either setting all variables to the same truth value // or by assigning variables to the same value and propagating it. In the // latter situation this can be done either in the...
ALGO
0.99992
5.180802
30df7636-ed19-4254-862e-ccc689e8640e
SOSP-OS/android_frameworks_av
media/module/codecs/amrnb/dec/src/post_pro.cpp
/*---------------------------------------------------------------------------- ; INCLUDES ----------------------------------------------------------------------------*/ #include "post_pro.h" #include "typedef.h" #include "basic_op.h" /*---------------------------------------------------------------------------- ; MACR...
ALGO
0.987683
5.760083
8db78a93-4c51-4b43-b74f-8a4e625848c7
SC23-apdx298/Mixed-BLAS-Evaluation
dense/magma-2.7.1/src/zheevdx.cpp
/* -- MAGMA (version 2.7.1) -- Univ. of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver @date February 2023 @author Stan Tomov @author Raffaele Solca @author Azzam Haidar @precisions normal z -> c */ #include "magma_internal.h" ...
ALGO
0.995091
5.880465
16a08c48-f85c-484a-a702-4f16c2bd7cbe
raincross7/code-similarity
codes/train_code/problem195/problem195_354.cpp
#include<bits/stdc++.h> #define Rushia_mywife ios::sync_with_stdio(0);cin.tie(0); #define rep(i,head,n) for(int i=(head);i<n;i++) #define F first #define S second #define FF first.first #define FS first.second #define SF second.first #define SS second.second #define pb push_back #define pob pop_back #define pf push_fr...
ALGO
0.999967
4.242948
1bac5e59-2234-44dd-9e86-c8dc4287a834
nwilk01/School-Projects
EECE-491-Linked-List/linked_list.cpp
#include "linked_list.h" Linked_List::Linked_List() { head = nullptr; } Linked_List::~Linked_List() {} void Linked_List::ClearList() { } bool Linked_List::Search(int key, float *reVal) { ListItem *nextnode = new ListItem; ListItem *previousnode = new ListItem; nextnode = head; while (nextnode != nullptr && next...
TOOL
0.982881
3.238315
3c2b0a37-25d5-44a2-9268-5223f178ae9d
GustavoWMSilva/Voronoi
Ponto.cpp
#include "Ponto.h" Ponto::Ponto () { x=y=z=0; } Ponto::Ponto(float x, float y, float z) { this->x = x; this->y = y; this->z = z; } void Ponto::set(float x, float y, float z) { this->x = x; this->y = y; this->z = z; } void Ponto::imprime() { cout << "(" << x << ", " << y << ", " << z <<")...
TOOL
0.862928
4.431981
19f99b64-6079-4e59-b100-91ae629b0b6a
kraxis/barcoin
src/sync.cpp
#include "sync.h" #include "util.h" #include <boost/foreach.hpp> #ifdef DEBUG_LOCKCONTENTION void PrintLockContention(const char* pszName, const char* pszFile, int nLine) { printf("LOCKCONTENTION: %s\n", pszName); printf("Locker: %s:%d\n", pszFile, nLine); } #endif /* DEBUG_LOCKCONTENTION */ #ifdef DEBUG_LOC...
TOOL
0.973272
5.722557
384e4a01-be98-4ea7-9681-6732bfa57a2c
raincross7/code-similarity
codes/train_code/problem296/problem296_15.cpp
#include <bits/stdc++.h> using namespace std; template <class T> T input() {T t; cin>>t; return t;} #define FOR(i,a,b) for (ll i = a; i < b; i++) #define REP(i,b) FOR(i,0,b) #define RFOR(i,a,b) for (ll i = a-1; i >= b; i--) #define RREP(i,a) RFOR(i,a,0) #define REPALL(i,x) for (ll i = 0; i < x.size(); i++) #define RREP...
ALGO
0.999716
3.727058
2ade7251-7151-414b-a594-b5a99c06ccf0
yubinbai/leetcode
src/valid_anagram/main.cpp
#include <iostream> #include <map> #include <vector> #include <string> #include <cstdlib> using namespace std; class Solution { public: bool isAnagram(string s, string t) { vector<char> sv(s.begin(), s.end()); vector<char> tv(t.begin(), t.end()); sort(sv.begin(), sv.end()); sort(tv.begin(), tv.end...
ALGO
0.999347
5.994452
0f727606-9faf-451b-bcc1-8b7a78c22752
akapoor30/daily-questions
0623-add-one-row-to-tree/0623-add-one-row-to-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.999996
6.274438
9ac3eae6-c458-44fc-a533-389cfec90d01
shadowfax11/pbrt
pbrt-v3-dvs/src/cameras/orthographic.cpp
// cameras/orthographic.cpp* #include "cameras/orthographic.h" #include "paramset.h" #include "sampler.h" #include "sampling.h" #include "stats.h" namespace pbrt { // OrthographicCamera Definitions Float OrthographicCamera::GenerateRay(const CameraSample &sample, Ray *ray) const ...
ALGO
0.979278
7.689439
33be1ca5-08c9-4abb-aed8-1bfe217ec0fb
cbkpar/BOJ
boj_30957.cpp
#include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int iN; cin >> iN; string strWord; cin >> strWord; int iB = 0; int iS = 0; int iA = 0; for (char ch : strWord) { if (ch == '...
ALGO
0.99971
4.104375
dd080d3f-3983-42a9-a441-25589d89ad94
Dharnesh67/decode-cpp
FUNCTIONS/int_sum.cpp
#include <iostream> #include<cmath> using namespace std; int sum(int n, int x) { // FUNCTION BANANA return n+x; // int wale functiion me always return dena jaruri h } int main() { cout << sum(20, 45); // function ko call lagana return 0; }
TOOL
0.975695
4.290239
fc453365-fd13-450c-b217-292e8934537d
Piggyback/calimucho-MVP
zxing-read-only/cpp/core/src/zxing/datamatrix/detector/Detector.cpp
// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- #include <zxing/ResultPoint.h> #include <zxing/common/GridSampler.h> #include <zxing/datamatrix/detector/Detector.h> #include <cmath> #include <sstream> #include <cstdlib> namespace zxing { namespace datamatrix { using namespace std; ResultPoi...
ALGO
0.998971
6.429276
e263d796-64e6-476a-9616-7612152469c5
ly232/DistributedLevelDB
server/clusterserver.cpp
//clusterserver.cpp #include "include/clusterserver.h" #include "include/client.h" #include "include/syncobj.h" #include <jsoncpp/json.h> #include <algorithm> clusterserver* cshdl; //handle for static clusterserver methods /* error handler for master cs sending heartbeat to cluster servers. will remove the failed clu...
WEB
0.953753
4.62694
c22afc4c-57c3-46c1-9b9d-7fb846577732
oybek/competitive-programming
timus/1644.cpp
#include <cmath> #include <cstdio> #include <cctype> #include <string> #include <vector> #include <cstdlib> #include <iostream> #include <algorithm> #define repeat(a) for (int i_ = 0; i_ < (a); ++i_) int main() { using namespace std; #ifndef ONLINE_JUDGE freopen("input.txt", "rt", stdin); freopen("output.txt", "...
ALGO
0.989355
3.862725
c52bdabb-c7f7-48a0-baf6-d0151a245731
bkianmajd/image_recognition
source/external_libraries/opencv-3.4.1/modules/core/src/matrix_operations.cpp
#include "opencv2/core/mat.hpp" #include "opencv2/core/types_c.h" #include "opencl_kernels_core.hpp" #include "precomp.hpp" /*************************************************************************************************\ Matrix Operations \************************************...
ALGO
0.990863
6.08519
7a5775d0-cd81-4ff8-bf62-effc57d2bc5d
dwip-nandi/CodeForces
A_Plus_or_Minus.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; while(t--){ int a,b,c; cin>>a>>b>>c; if(a+b==c)cout<<"+"<<endl; else cout<<"-"<<endl; } }
ALGO
0.999956
4.616032
3113ae05-d35b-498e-bc40-1b18ecd7cd57
imnotwannafire/Data-Structure-and-Algorithm
thuat_toan_sinh/sinh_tap_con/sinh_tap_con_k.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; int n, k; int a[100]; int final = 0; void khoi_tao() { for(int i = 1; i<=k;i++) { a[i] = i; } } void sinh() { int i = k; while(i>=1 && a[i]==n-k+i) { --i; } if(i==0) { final =1; } else...
ALGO
0.999945
3.368055
580dd093-83df-4daf-a59d-7ae634406f38
arpitamittal/Data-Structure-and-Algorithms
Strings/palindrome.cpp
#include <iostream> using namespace std; int main() { string str, str1, str2; getline(cin, str); str1 = str; int n = str.length(); for (int i = 0; i < n / 2; i++) { swap(str[i], str[n - i - 1]); } str2 = str; if (str1 == str2) { cout << "Palindrome"; } e...
ALGO
0.999931
4.760988
559fe21e-6f66-4c0a-acfd-c59ca56101b6
richefeu/fickle
FluctExamination.cpp
#include "FluctExamination.hpp" void concatFluctuations(int begin, int end, int step, std::vector<double>& xflucts, std::vector<double>& yflucts) { PBC confFrom; PBC confTo; char fnameFrom[128]; char fnameTo[128]; xflucts.clear(); yflucts.clear(); for (int ifile = begin; ifile <= end - step; ifile++) { ...
ALGO
0.969059
4.087409
68cc840e-1798-48b1-81f6-57120af26ea9
Rajatj17/dsa-pseudo-code
Section/Section 03 - string problems/digitalClock.cpp
#include<string> using namespace std; string convert_to_digital_time(int mins){ int hours = mins/60; int minutes = mins%60; string hrs_s = to_string(hours); string min_s = minutes < 10 ? "0" + to_string(minutes) : to_string(minutes); return hrs_s + ":" + min_s; }
ALGO
0.902648
5.540098
16236040-373d-49bc-8019-d22cbb317016
Navu4/datastrutures-pepcoding
Pepcoding Classes/Foundation/Searching and Sorting/TargetSum.cpp
#include<iostream> #include<vector> #include<algorithm> // sort function using namespace std; void targetSum(vector<int>& arr, int data, int si, int ei){ sort(arr.begin(), arr.end()); while(si < ei){ int sum = arr[si] + arr[ei]; if(sum > data){ ei--; } else if ...
ALGO
0.999983
4.848166
dcdaa387-dbf4-4c11-bc42-029835320081
DavSar06/chess
source/Queen.cpp
#include "Queen.hpp" #include "Game.hpp" #include "Rook.hpp" #include "Bishop.hpp" #include <bits/stdc++.h> using namespace std; void Queen::calculateAllMoves(pair<int,int> a) { validMoves.clear(); auto r = new Rook(this->getColor()); auto b = new Bishop(this->getColor()); r->calculateAllMoves(a); ...
ALGO
0.986808
3.820081
775342b6-d74a-47ec-9799-04246dc44cad
siddharth03-del/cpp_leetcode_problems
MergeStrignsAlternatively.cpp
#include <iostream> #include <string> using namespace std; class Solution{ public: string mergeAlternatively(string word1, string word2){ int i = 0; int j = 0; bool flag1 = true; string res = ""; while(i < word1.size() && j < word2.size()){ if(flag1){ ...
ALGO
0.999824
4.55131