uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
ebf5c3cb-19e7-4bd6-a147-798263058bf9
little-rookie-at-UJS/c
vp/hlj/g.cpp
// // Created by DELLPC on 24-5-19. // #include "bits/stdc++.h" using namespace std; using i64 = long long; using i32 = unsigned int; #define endl '\n' #define ll long long ll qpow(ll base, ll b, ll mod){ ll ans = 1; while(b){ if(b & 1)ans *= base, ans %= mod; base *= base, base %= mod, b >>...
ALGO
0.999909
4.987819
7cf7ebc0-c542-4c11-a738-8dc1af0291ba
pprajap/boost
libs/mpi/example/string_cat.cpp
// An example using Boost.MPI's reduce() to concatenate strings. #include <boost/mpi.hpp> #include <iostream> #include <string> #include <boost/serialization/string.hpp> // Important for sending strings! namespace mpi = boost::mpi; /* Defining STRING_CONCAT_COMMUTATIVE lies to Boost.MPI by forcing it * to assume that...
ALGO
0.993536
6.371629
a2820432-4d86-427a-ae5a-38b078b0059d
pingchungchang/CP
yc2379.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 int main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); ll n; cin>>n; vector<pll> v; bool flag = true; while(flag){ flag = false; for(ll i = 2;i*i<=n;i+...
ALGO
0.999992
4.277864
8c00fbc2-5fc2-4ab1-870b-957bfbf5e50a
ishandutta2007/codeforces
tempura0224/normal/1148/B.cpp
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<iomanip> #include<math.h> #include<complex> #include<queue> #include<deque> #include<stack> #include<map> #include<set> #include<bitset> #include<functional> #include<assert.h> #include<numeric> using namespace std; #define REP(i,m,n) for...
ALGO
0.999984
3.524535
19ca9ca2-c761-4f28-97d6-8d1f1de85705
CopterTec/Marlin-Sovol_SV01
Marlin/src/libs/crc16.cpp
#include "crc16.h" void crc16(uint16_t *crc, const void * const data, uint16_t cnt) { uint8_t *ptr = (uint8_t *)data; while (cnt--) { *crc = (uint16_t)(*crc ^ (uint16_t)(((uint16_t)*ptr++) << 8)); for (uint8_t i = 0; i < 8; i++) *crc = (uint16_t)((*crc & 0x8000) ? ((uint16_t)(*crc << 1) ^ 0x1021) : (...
ALGO
0.997264
4.764662
681c3d13-9dce-4b92-901a-ad829e6c47b5
AnupeshVerma/LeetCode_DSA
0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-darkreader-inline-bgcolor-rgba0-8-26-005-data-darkreader-inline-bgcolordivfacebook-divdiv-classcompanytagscontainer-tagoccurenc...
/* // Definition for a Node. class Node { public: int val; Node* next; Node* random; Node(int _val) { val = _val; next = NULL; random = NULL; } }; */ class Solution { public: Node* copyRandomList(Node* head) { unordered_map<Node*, Node*> copiedNodes; ...
ALGO
0.990456
5.634769
3ca708ee-1f08-409f-9de1-3221ea47cb4a
vanshika0111/cpp
Basic/prime.cpp
// program ro check if a number is prime or not #include<iostream> #include<stdlib.h> using namespace std; int main() { int num, i; cout << "Enter number: "; cin >> num; cout << endl; for(i=2; i<=num/2; ++i) { if(num%i == 0) { cout << "Not a prime number." << endl;...
ALGO
0.99679
3.102316
eea0f309-5594-4924-8509-700f42516767
breaker250611/GFG-LEET-codes
328-odd-even-linked-list/328-odd-even-linked-list.cpp
class Solution { public: ListNode* oddEvenList(ListNode* head) { if(head == nullptr) { return head; } ListNode* odd = head; ListNode* even = head->next; ListNode* evenHead = even; while(even !=nullptr && even->next!=nullptr) ...
ALGO
0.999877
5.829624
af0cf6ea-f16a-4c1e-8ecc-5a146eb73940
13750634/2025aaia
week12/week12-6.cpp
//week12-6.cpp //leetcode 1920. Build Array from Permutation //for jA}Cansans[i]=nums[nums[i]] class Solution { public: vector<int> buildArray(vector<int>& nums) { int N=nums.size();//}Cjp vector<int> ans(N);//ansjpAONp߬OAC++ for (int i=0;i<N;i++){ ans[i]=nums[nums[i]];//DحnAo ...
ALGO
0.999967
5.583682
8845768b-d6cc-4813-a931-31fc363517c3
wisdom-weaver/c_cpp_mini
cpp_course(apna_college)/l_016.3.3._recursion._challanges_tower_of_hanoi.cpp
#include <iostream> #include <string> #include <algorithm> using namespace std; void tower_of_hanoi(int n, char src, char dest, char helper) { if (n == 0) return; tower_of_hanoi(n - 1, src, helper, dest); cout << "move from " << src << " to " << dest << endl; tower_of_hanoi(n - 1, helper, dest, src); } in...
ALGO
0.999585
5.710276
05ec7c1a-4182-496f-8780-95ad10862b5d
rwt-2001/Leetcode-solutions
0055-jump-game/0055-jump-game.cpp
class Solution { public: bool canJump(vector<int>& nums) { int indexAchievable = 0; int sz = nums.size(); for(int i = 0;i<sz;i++){ if(indexAchievable<i) return false; indexAchievable = max(indexAchievable,i+nums[i]); } return true; } ...
ALGO
0.99999
6.095288
be8f8aab-f3d0-4961-bb1e-89024e172085
PaukIsUha/optimizing_formating_code
predictions/submissions-aizu-gpt4/Codenet/p00739/482779983/original.cpp
#include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <set> #include <vector> using namespace std; #define REP(i, a, n) for (i = a; i < n; i++) #define rep(i, n) REP(i, 0, n) #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define foreach(it, x) ...
ALGO
0.999757
4.046343
c9e1ac27-c551-4100-94a5-8a922655977a
nit-codes/GFG-POTD
Find element occuring once when all other are present thrice.cpp
class Solution { static int singleElement(int[] arr , int N) { // code here int res=0; for (int i=0;i<32;i++){ int setbit=0; for(int j=0;j<N;j++){ if((arr[j]&(1<<i))!=0)setbit++; } if (setbit%3==1)res=res | (1<<i); } ...
ALGO
0.999711
3.600412
fd6f8563-b4b4-4e1d-a8ac-4046f06ab2d9
piorkowskiprzemyslaw/mapUsers
OptionMask.cpp
#include "OptionMask.h" /** * \brief Konstruktor tworzacy na podstawie dwoch bitow cala option mask * \brief w jednej zmiennej */ OptionMask::OptionMask(unsigned char firstByte,unsigned char secondByte) { this->firstByte = this->BitReverseTable256[firstByte & 0xff]; this->secondByte = this->BitReverseTa...
TOOL
0.87879
5.226994
e15d2049-5abd-4e53-b96c-9d4403f0b81a
abufarhad/Codeforces-Problems-Solution
483B Friends and Presents.cpp
//! Bismillahi-Rahamanirahim. /** ========================================** ** @Author: Md. Abu Farhad ( RUET, CSE'15) ** @Category: /** ========================================**/ #include<bits/stdc++.h> #include<stdio.h> using namespace std; #define ll long long #define scl(n) scanf...
ALGO
0.999829
3.005623
88500fcc-64f0-4088-aa94-1e8c2d59496d
roca12/gpccodes
Resueltos/Edwin Villarraga/RPD_codechef.cpp
#include <bits/stdc++.h> #include <cstdlib> using namespace std; typedef long long int ll; int main(int argc, char** argv) { ll n,total=0; vector<ll>vec; scanf("%lld",&n); for(int i=0;i<n;++i){ ll k; scanf("%lld",&k); ll arr[k]; for(int j=0;j<k;++j){ cin>>arr[j]; } for(int j=0;j<k;j++){ for(int q=...
ALGO
0.999947
3.496483
c8b000d7-1b0b-467b-89d9-492ff2562bb8
priyankjairaj100/Codeforces-Solutions
contest/1324/c/73117847.cpp
#include <bits/stdc++.h> #include <string> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> //using namespace __gnu_pbds; using namespace std; //#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> //#define ordered_multiset tree<int, null_ty...
ALGO
0.999169
4.668797
43251303-4ea7-418b-9a27-4b73335add33
MasterYI1234/CS140
Lab5and6/solution.cpp
// Lab 5/6: Sudoku //COSC140 //SiCheng Yi #include <iostream> #include <stdlib.h> #include<vector> #include <cstdio> #include <stack> using namespace std; // My thoughts on solving Sudoku problems: 1: Input the Sudoku form //2: Guess one by one, until the whole solution is guesse...
ALGO
0.999773
5.356965
95a6e529-5f1b-46b4-b62c-36096a308349
PolarisDane/2023_STLite_ACM
priority_queue/data/five/code.cpp
#include <iostream> #include <cstdio> #include <algorithm> #include <queue> #include <ctime> #include <cstdlib> #include "priority_queue.hpp" int rand() { static int reed = 1727417277; return (reed += (reed << 5) + 172741827); } bool testmerge() { sjtu::priority_queue<int> pq1, pq2; static int buffer[900000]; i...
TEST
0.995199
4.410231
99439ae4-c44e-40b2-a367-e1d6bb90faf7
tynnp/CP-Practice
UPCODER/NGOAC1.cpp
#include <iostream> using namespace std; int main() { string s; cin >> s; int dem_mo = 0, dem_dong = 0; for (int i = 0; i < s.size(); i++) (s[i] == '(') ? dem_mo++ : dem_dong++; if (s[0] == ')' || s[s.size() - 1] == '(') cout << "FALSE"; else cout << (dem_mo == dem...
ALGO
0.998522
4.277497
54beb0de-381b-464a-ba4d-265b8a20d483
20171193/Algorithm
CodingTestCPP/카카오_자물쇠와 열쇠.cpp
#include <string> #include <vector> #include <iostream> using namespace std; vector<vector<int>> Rotate(int size, const vector<vector<int>>& src) { vector<vector<int>> result(size, vector<int>(size)); for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { result[i][j] = src[size - j - 1][i]; } ...
ALGO
0.999925
5.250675
ebc9b12e-34bd-4730-a893-24b33b1e1b97
Aty-0/S2DE
Libs/boost_1_76_0/libs/graph/example/interior_property_map.cpp
#include <boost/config.hpp> #include <iostream> #include <algorithm> #include <boost/graph/adjacency_list.hpp> #include <boost/property_map/property_map.hpp> #include <string> using namespace std; using namespace boost; /* Interior Property Map Basics An interior property map is a way of associating properties ...
ALGO
0.999381
5.002253
089b8a84-9347-4bcf-8ff3-00eeef76c7d2
biswajitmaharana2016/CppCode
Rainer_Grimm/source/overUnderflow.cpp
// overUnderflow.cpp #include <cstddef> #include <iostream> int main(){ int a[0]; int n{}; while (true){ if (!(n % 100)){ std::cout << "a[" << n << "] = " << a[n] << ", a[" << -n << "] = " << a[-n] << "\n"; } a[n] = n; a[-n] = -n; ...
ALGO
0.928843
4.135517
cfd77399-859c-4544-93f1-ead2ca2ebb06
axel-simon/tvpi
tests/testInequalityIsEntailed4.cpp
/* Test program for the planar entailment. */ #include <iostream> #include "planar.hh" #include "interval.hh" using namespace std; using namespace Tvpi; int main() { // From the convex hull example. Inequality eq1 = Inequality(-1, 1, 10); Inequality et = Inequality(-4, 11, 68); Interval<false> xBound; Int...
ALGO
0.958181
6.60831
3f2d2182-9091-47db-982f-29461bef8069
clairelindstrom92/project
operand.cpp
// CMSC 330 Advanced Programming Languages // Project 2 Skeleton // UMGC CITE // Spring 2023 // Claire Lindstrom // This file contains the body of the function parseName contained in the Operand class. That function // parses the next token. When the next non-whitespace character is a digit, it assumes a literal is ne...
TOOL
0.894177
7.032693
5b5e7d8a-d1b5-4a60-aba6-e2702903106e
GeekOnly/CPPLearning
18_ReverseNumber.cpp
#include <iostream> using namespace std; int main() { int n,reversedNumber = 0,remainder; cout << "Enter an integer: "; cin >> n; while(n != 0) { remainder = n%10; reversedNumber = reversedNumber*10 + remainder; n /= 10; } cout << "Reversed Number = " << reversedN...
ALGO
0.998512
4.690086
16f1959d-739f-4437-bfd1-5c313a83e42a
laiba756/DataStructuresAndAlgorithmProjects
2021se37 dsa lab 10 BST.cpp
#include<iostream> using namespace std; class Node { private: Node* parent; Node* left; Node* right; int val; public: Node() { val = -1; parent = NULL; left = NULL; right = NULL; } Node(int v) { val = v; parent = NULL; left = NULL; ...
ALGO
0.999906
4.40205
9cd8a3ba-d0ec-4a88-9779-9d39bbcc0f8a
nickgaur/leetcode
206-reverse-linked-list/206-reverse-linked-list.cpp
class Solution { public: ListNode* reverseList(ListNode* head) { ListNode*curr=head,*temp=NULL; while(head!=NULL) { curr=curr->next; head->next=temp; temp=head; head=curr; } return temp; } };
ALGO
0.999758
5.243645
94e1019a-fd89-4636-ae0d-eb708d8cc45e
GiacomoPauletti/graph-color-number
src/common.cpp
#include "common.hpp" void GetNeighbours(const Edges& edges, const unsigned int vertex_index, VertexSet& neighbours) { neighbours.clear(); neighbours.reserve(edges.size()); // it would be better density * num_vertices int counter = 0; for ( unsigned int i=0; i<edges.size(); i++ ) { if ( ed...
ALGO
0.976579
5.485664
28b3bc25-6318-4a9e-9e3d-c4754ca1ab67
sridharmahadevan/PVF
Open-TSTOOLS/nn_prepare.cpp
// This mex-function just does the preprocessing for a nearest neighbor searcher // The data structure that is computed during the preprocessing phase can then // be used to do several calls to the mex-function nn_search without doing the // time-consuming preprocessing again (of course only when the input data set //...
ALGO
0.99539
7.081962
3128e4a6-29d9-4eeb-b62a-282dc66740d1
vinayak-thakur/CPP2024
Searching_Sorting/SearchingSorting2.cpp
// // finding square root of a number using binary search // #include<iostream> // using namespace std; // int findSqrt(int n){ // int s=0; // int target=n; // int end = n; // int mid= (s+end)/2; // int flash; // while ((s<=end)) // { // /* code */ // if(mid*mid==target){ /...
ALGO
0.999004
3.79245
6ce3a2da-4a61-4616-b655-148c92051470
Es-Kiani/Hot-Singles
University/Pro Programming/HomeWork/App_10_2.cpp
#include <iostream> #include <cmath> using namespace std; class Point { public: void setter(); void neg(); double norm(); void print(); private: int _x, _y, _z; int _neg_x, _neg_y, _neg_z; }; int main() { unsigned short int n; cin >> n; cout << fixed; cout.precision(3); ...
ALGO
0.986218
3.925876
b5ac9c5b-d695-4c6b-8abc-dd366a0d04e6
SirLex/UP
Sem.05/Pract.05/Yo/Task5.cpp
#include <iostream> #include "input.h" bool isSymmetrical(int* arr, int arrSize) { int midPoint = arrSize / 2; for (int i = midPoint; i < arrSize; ++i) { if (arr[i] != arr[arrSize - i - 1]) return false; } return true; } int main() { int arrSize; int* arr = inputArray(arrSize); std::cout << isSymmetrical(arr...
ALGO
0.996929
5.260185
eb9a8e37-a8ef-4425-841a-559b6dab4720
PresiTK/Chess_Joel_Sergi
Chess_Joel_Sergi/Main.cpp
#include <iostream> #include "Variables.h" #include "Inputs.h" #include "Movement.h" #include "MovementRules.h" #include "ColorTheory.h" #include "CheckPath.h" #include "TableLogic.h" void main() { char table[tableBorder][tableBorder]; short input[maxInputs]; short output[maxInputs]; char piece; char color[maxIn...
ALGO
0.911546
4.053521
55a3e897-acc0-441a-8800-a5d64c9cbc18
Guhan000/Leetcode-Problems
2114-maximum-number-of-words-found-in-sentences/2114-maximum-number-of-words-found-in-sentences.cpp
class Solution { public: int mostWordsFound(vector<string>& sentences) { int res=0; for(auto const &s : sentences){ int n = count(s.begin(),s.end(), ' '); res = max(res, n+1); } return res; } };
ALGO
0.999948
5.826207
5f7be905-8279-4770-b887-bc468358f37b
weessantos/IALG
Registros/Onde está o carro.cpp
#include <iostream> using namespace std; typedef struct{ float p1; float p2; } Posicao; typedef struct{ float v1; float v2; } Velocidade; typedef struct{ Posicao posicao; Velocidade velocidade; } Carro; int main(){ Carro carro; float t; cin >> carro.posicao.p1 >> carro.posicao.p2 >> carro.ve...
ALGO
0.999246
3.972777
aba901b1-9ab1-425a-8189-d6073c1660db
QWERx29/My-Codes-and-Docs_OLD
Study/Summer2022/07/03.cpp
#include<bits/stdc++.h> using namespace std; const int N=1145141*2; const int M=1e6; int L,R,ans; bool p[N]; int main() { cin>>L>>R; memset(p,1,sizeof(p)); for(int i=2;i<=sqrt(R);i++) { for(int j=max(2,L/i);j<=(R/i);j++) p[i*j-L+M]=false; } for(int i=0;i<=R-L;i++) if(p[i+M]) ans++; if(L==1) ans--; cou...
ALGO
0.999816
3.503573
709c2bc5-604a-40e9-851e-dd5d1c9949f7
notJAYanand/Leetcode
1791-find-center-of-star-graph/1791-find-center-of-star-graph.cpp
class Solution { public: unordered_map<int,vector<int>> convert(vector<vector<int>> &edges) { unordered_map<int,vector<int>>graph; for(auto edge : edges) { vector<int> e= {edge[0],edge[1]}; if(!(graph.find(e[0])!=graph.end())) { graph[e[0]]={}; } if(!(graph.find(e[1])!=graph.end())) { graph[e[1]]={}...
ALGO
0.999923
5.4265
a6482492-0812-4ca2-b7c6-ee918e7734d8
pblackman/Marlin-Ender-3
Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp
#if defined(__arm__) || defined(__thumb__) #define MODULE_NAME "UNWARM_ARM" #include <stdio.h> #include "unwarm.h" /** Check if some instruction is a data-processing instruction. * Decodes the passed instruction, checks if it is a data-processing and * verifies that the parameters and operation really indicate a d...
TOOL
0.865092
4.103226
02a7fd4d-a841-4a6a-a82f-602bde5ec67c
czhang2718/cp-templates
wavelet_kth.cpp
#include "bits/stdc++.h" using namespace std; const int N=8e5; // 4n int n, q; vector<int> A[N]; vector<int> cnt_left[N]; vector<int> ind_left[N], ind_right[N]; int mn[N], mx[N]; int ch[N][2]; int c; // sparse wavelet // you don't need sparse most of the times, coord compress void build(int x){ int n=A[x].size(); ...
ALGO
0.999987
4.829057
9122d75b-7982-4535-8152-04196ba42c3c
ishandutta2007/codeforces
nyaan/normal/1630/F.cpp
/** * date : 2022-01-28 20:44:44 */ #define NDEBUG using namespace std; // intrinstic #include <immintrin.h> #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <cfenv> #include <cfloat> #include <chrono> #include <cinttypes> #include <climits> #include <cmath> #i...
ALGO
0.998361
3.369122
7ac61ef6-9d1e-4529-a1cb-250a2a65f982
topiks/belajar-dasar-coding
bismillah classing robot/src/pergerakan.cpp
#include "pergerakan.h" #include "stdio.h" pergerakan::pergerakan() { x = 450; y = 600; s = 180; } void pergerakan::perubahansudut ( int vs, int sudut ){ if ( vs > 0){ if ( s < sudut ){ while ( s <= sudut ){ if ( s + vs > sudut ) ...
TOOL
0.878732
3.479793
40efeda2-81b8-416a-89b6-9679ad7073ec
svanegas/programming_solutions
Codeforces/13A - Numbers/13A.cpp
#include <algorithm> #include <iostream> #include <iterator> #include <numeric> #include <sstream> #include <fstream> #include <cassert> #include <climits> #include <cstdlib> #include <cstring> #include <string> #include <cstdio> #include <vector> #include <cmath> #include <queue> #include <deque> #include <stack> #inc...
ALGO
0.999803
4.170755
12103df2-4bf1-44de-80f5-59154c9b9a5b
antiauto/llvm-project
llvm/lib/CodeGen/MachineVerifier.cpp
#include "llvm/ADT/BitVector.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/PostOrderIterator.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SetOperations.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include ...
TOOL
0.883725
7.899238
9872f713-4946-415b-b164-16b176fdd660
AmanJaiSingh/C-_basic
power.cpp
#include<bits/stdc++.h> using namespace std; int power(int a, int b){ int result = 1; for(int i = 0; i< b;i++){ result = result* a; } return result; } int main(){ cout << power(8,8); return 0; }
ALGO
0.998785
4.052149
277f5081-6f45-4df1-bf7f-e0f5749b2882
cechallenge/2025
llvm/llvm/lib/Support/DeltaAlgorithm.cpp
#include "llvm/ADT/DeltaAlgorithm.h" #include <algorithm> #include <iterator> #include <set> using namespace llvm; DeltaAlgorithm::~DeltaAlgorithm() = default; bool DeltaAlgorithm::GetTestResult(const changeset_ty &Changes) { if (FailedTestsCache.count(Changes)) return false; bool Result = ExecuteOneTest(Cha...
TEST
0.911882
7.119194
15c5510d-dd65-44ce-bee7-9596a911b3ef
TerrorBlood47/Data-Structure-and-Algorithm-Analysis
S0-Sorting/3_quick_sort.cpp
#include<bits/stdc++.h> using namespace std; void swap_array(int *a , int *b){ int temp=*a; *a = *b; *b = temp; return; } //Haore's Partition int partition(int arr[], int low ,int high){ // Link - GeeksForGeeks int i=low-1,j=high+1; //check int pivot = arr[low]; while(true)...
ALGO
0.999928
5.31936
852ebe6b-3de7-4618-b805-bf1583e8544b
Seon-dongun/2024CppCodingTestPractice
프로그래머스/2/87377. 교점에 별 만들기/교점에 별 만들기.cpp
#include <string> #include <vector> #include <set> #include <climits> using namespace std; vector<string> solution(vector<vector<int>> line) { set<pair<long,long>> loc; long A,B,E,C,D,F; double x,y,xt,xd,yt,yd; long maxX=LONG_MIN,minX=LONG_MAX,maxY=LONG_MIN,minY=LONG_MAX; for(long i=0;i<line....
ALGO
0.999849
4.9778
ed961403-a24f-40be-91d9-e6de1ee4f605
ZhuangPeng97/BuildFaceFlowDataCode
tools/BuildGraph_face/include/igl/is_planar.cpp
IGL_INLINE bool igl::is_planar(const Eigen::MatrixXd & V) { if(V.size() == 0) return false; if(V.cols() == 2) return true; for(int i = 0;i<V.rows();i++) { if(V(i,2) != 0) return false; } return true; }
ALGO
0.980959
6.141372
517ffcf0-43af-45f7-9648-bb48e3e56bdd
ssahoo11742/CompetetiveProgramming
CODEFORCES/1500/1737C.cpp
#include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0);cout.tie(0); int t; cin>>t; while(t--) { int n; cin>>n; int a,b,c,d,e,f,x,y; cin>>a>>b>>c>>d>>e>>f>>x>>y; if(c==e) a=c; if(d==f) b=d; if((a==1||a==n)&&(b==1||b==n)) cout<<((a==x||b==y) ? "YES" : "NO"...
ALGO
0.999116
3.504239
340ed7fe-d25b-4f99-892e-9768b92a274e
khan-yin/leetcode
src/leetcode周赛/蓝湖周赛/找出所有子集的异或总和再求和/二进制枚举.cpp
#include<vector> #include<iostream> using namespace std; class Solution { public: int subsetXORSum(vector<int>& nums) { int n = nums.size(); int res = 0; //二进制枚举 for(int i=0;i < 1 << n;i++) { int s=0; for(int j=0;j<n;j++) { ...
ALGO
0.99999
5.198843
9ced30a4-4218-4525-a2a5-b0d6494bfd82
varunmehra1661/CN-cpp-practice-2
Hashmaps/pairSumTo0.cpp
/* Coding Problem Problem Statement: Pair sum to 0 Problem Level: MEDIUM Problem Description: Given a random integer array A of size N. Find and print the count of pair of elements in the array which sum up to 0. Note: Array A can contain duplicate elements as well. Input format: The first line of input contains an int...
ALGO
0.999689
5.133412
deeefeca-6068-4295-8dd0-89f9ce49ff43
vmmc2/Competitive-Programming
UVA 11192 - Group Reverse.cpp
#include <bits/stdc++.h> #include <string.h> #include <math.h> using namespace std; int main(){ int numgroups; char frase[110]; int inicio; int fim; int tamanho; int tamfrase; int meio; int tamaux; char aux; int flag; while(1){ scanf("%d", &numgroups); if(nu...
ALGO
0.999908
3.982017
9f71a388-a722-4896-8ea8-7c124408870e
rsmanthy/csci-2270-rsmanthy-linkedLists
code_1/generateSeries.cpp
#include "generateSeries.hpp" #include<iostream> using namespace std; void generateSeries(int* &arr, int &n, int &m, int &arraySize) { //filling first spot arr[0] = n; //For loop to do the series for(int i = 1; i < arraySize; i++) { arr[i] = arr[i-1] * m; } }
ALGO
0.999448
3.352821
928912ef-0480-4183-9b42-6095f87dce89
iamshm/myCppPractice
450qstns/03string/58.cpp
// split string into substring having equlal 0 n 1 #include <bits/stdc++.h> using namespace std; #define endl '\n' #define inf 1e18 #define ll long long #define vi vector<ll> const int MOD = 1e9 + 7; #define loop(i,a,b) for(int i =(a);i<=(b);i++) #define looprev(i,a,b) for(int i = (a);i>=b;i--) void solve() { string...
ALGO
0.999903
4.287667
5dc4348c-979f-4923-822e-42245128569e
ishandutta2007/codeforces
abdude824/normal/1417/A.cpp
// // // // // // // // // // // // // (`v) // `..Coding /* ********* * * * * * * * * ***************** * * * * * * * * ********* */ #include<bits/stdc++.h> using namespace std; #define int long long int #define ll long long int ...
ALGO
0.999929
3.785264
a84b9583-e313-4c1f-b8b5-d8b83c7d8876
vighnesh-shinde-18/Data-structures-and-algorithms-in-cpp
SORTING/bubble_sort.cpp
// sorting - ordering of element in increasing or decreasing order // unsorted array :- [2,0,1,4,6] , sorted in increasing order array :- [0,1,2,4,6] // bubble sort :- Repeatedly Swap tow adjacent elements of if in wrong order ( until one array is sorted) #include <iostream> #include <vector> using namespace std; vo...
ALGO
0.999961
5.285243
11bba7e3-7d7d-426a-94e3-943ab62ba963
Daahae/algo
rkddlsgur983/backjoon/1463.cpp
// BOJ #1463 1로 만들기 - DP #include <iostream> #include <algorithm> using namespace std; int main() { int n; int arr[1000001]; cin >> n; arr[1] = 0; for (int i = 2; i <= n; i++) { arr[i] = arr[i - 1] + 1; if (i % 2 == 0) { arr[i] = min(arr[i], arr[i / 2] + 1); ...
ALGO
0.999975
4.459939
437f9aa4-3860-4bcb-82a7-e1784622250a
coin-or/SHOT
src/MIPSolver/MIPSolverCplex.cpp
/** The Supporting Hyperplane Optimization Toolkit (SHOT). @author Andreas Lundell, Åbo Akademi University @section LICENSE This software is licensed under the Eclipse Public License 2.0. Please see the README and LICENSE files for more information. */ #include "MIPSolverCplex.h" #include "../DualSol...
ALGO
0.997486
7.20613
43250fd1-fea4-4d33-ac41-9b505145df00
shirosf/twostkbd
twskbino/fifo_queue.cpp
/* * one directional link liss * ---------------------------- * ^ ^ ^ * headp readp btmp * * push kd at 'btmp' * 'readp' is a read point, 'increadp' moves 'readp' one point to * 'btmp' direction. * Data between 'headp' and 'readp' is hold until removed by 'delkn'. */ #include <string.h...
ALGO
0.988106
4.926276
5cb78b62-7407-4088-a9ed-53db2c1f0c47
raincross7/code-similarity
codes/train_code/problem472/problem472_245.cpp
#include<iostream> #include<string> #include<vector> using namespace std; short ss[90061]; short ee[90061]; int ans[10000]; int c = 0; int ch2int(char c){ return (int)c - (int)'0'; } int st2int(string s){ return (ch2int(s[0]) * 10 + ch2int(s[1])) * 3600 + (ch2int(s[3]) * 10 + ch2int(s[4])) * 60 + ch2int(s[6]...
ALGO
0.999656
3.732062
79603229-6db8-4387-9bdf-19f72a64878f
i-am-himanshukansal/DATA_STRUCTURES_AND_ALGORITHMS
Linked_list/gfg_leetcode/19_swap_maximize.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: long long maxSum(vector<int>& arr) { sort(arr.begin(), arr.end()); long long sum = 0; int n = arr.size(); for (int i = 0; i < n / 2; ++i) { sum += abs(arr[i] - arr[n - i - 1]) * 2; ...
ALGO
0.998231
5.298622
e78e87bd-9fcd-4b44-8c5c-64f5abecfefd
catnote0/CodeTree
250527/금 채굴하기/gold-mining.cpp
#include <iostream> #include <cstdlib> using namespace std; int n, m; int grid[20][20]; int result; bool isValid(int x, int y) { if(x < 0 || x >= n || y < 0 || y >= n) return false; return true; } int main() { cin >> n >> m; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { ...
ALGO
0.999935
3.937509
43eff9ac-44e4-43c7-a734-c9aff7fc2f42
anshi0/Operating_System
multivlevel queue.cpp
#include <iostream> using namespace std; class MPQ { public: int process; // Process Name int queue_priority; // Queue Priority int bt; // Burst Time int wt; // Waiting Time int tat; // Turn Around Time }; int main() { cout << "Enter Number of Process :"; int n; cin >> n; MPQ *p = new MPQ[n]; // Taki...
ALGO
0.999954
4.035061
13025b6d-28ea-40b8-baaf-99d72f09d1db
hoanxuanbach/Competitive-Programming
OI/JOISC/2016/Memory2.cpp
#include "Memory2_lib.h" #include<bits/stdc++.h> using namespace std; void Solve(int T, int N){ vector<int> p(2*N,-1),cnt(N,0); vector<vector<int>> res(2*N,vector<int>(2*N,-1)); auto query = [&](int i,int j){ if(res[i][j]!=-1) return res[i][j]; return res[i][j]=res[j][i]=Flip(i,j); }; ...
ALGO
0.999685
3.860449
99c3f497-f4a2-412f-98b0-11c6268ed065
ADITYAPRASADSAHOOS1200/dsa_aalgorithm
recursion/sumofdigits.cpp
#include<bits/stdc++.h> using namespace std; int sumofdigits(int n){ if(n == 0) return 0; return (n%10)+(n/10); } int main() { int n=123; cout<<sumofdigits(n); return 0; }
ALGO
0.999851
4.300267
cfaba1a5-4b3d-4448-8562-2dedc3fffb29
UniiiX/year-2
semester 1/Algorithms and complexity/task 3/main.cpp
#include <iostream> #include <vector> #include <ctime> #include <cstdlib> using namespace std; class Heap { private: const int dimension = 5; int heapSize; vector<int> heapVector; void maxHeapify(int parent); int getMax(int parent); void swap(int* a, int* b) { int c = *a; *a = *b; *b = c; } publi...
ALGO
0.999707
4.233418
0f4072fd-5f7b-4bd1-9889-c89d352ed829
Samius-Sazin/CODE
Programming/Pattern_Problems/Pattern 3.2 .cpp
#include<iostream> using namespace std; int main() { int n,r,c; cin>>n; for(r=1; r<=n; r++) { for(c=1; c<=r; c++) { cout<<"*"; } cout<<endl; } for(r=n-1; r>=1; r--) { for(c=1; c<=r; c++) { cout<<"*"; } c...
ALGO
0.999823
3.489819
3f293ad0-3883-4e08-88fc-d9e017779866
guptaSidhi/Binary-Trees-Striver-A2Z-Sheet
Iterative_Postorder_Traversal.cpp
class Solution { public: vector<int> postorderTraversal(TreeNode* root) { if(root == NULL) return {}; stack <TreeNode*> s; vector <int> ans; s.push(root); while(!s.empty()) { TreeNode* temp = s.top(); ans.push_back(temp -> val); s.p...
ALGO
0.99998
5.949869
3d725584-66e1-4560-b76e-aae7bbd02da1
jodavis42/ZeroPhysicsTestbed
Extensions/SpirV/SpirVFiles/tools/stats/stats.cpp
#include <cassert> #include <cstring> #include <fstream> #include <iostream> #include <unordered_map> #include <vector> #include "spirv-tools/libspirv.h" #include "tools/io.h" #include "tools/stats/spirv_stats.h" #include "tools/stats/stats_analyzer.h" namespace { void PrintUsage(char* argv0) { printf( R"(%s...
TOOL
0.893057
7.562739
2cd4a7c0-4386-47f5-b603-9e1b0e9f1799
PayamEmami/OpenMS
src/openms/source/ANALYSIS/OPENSWATH/MRMFeatureFinderScoring.cpp
#include <OpenMS/ANALYSIS/OPENSWATH/MRMFeatureFinderScoring.h> // data access #include <OpenMS/ANALYSIS/OPENSWATH/DATAACCESS/DataAccessHelper.h> #include <OpenMS/ANALYSIS/OPENSWATH/DATAACCESS/SimpleOpenMSSpectraAccessFactory.h> #include <OpenMS/ANALYSIS/OPENSWATH/DATAACCESS/MRMFeatureAccessOpenMS.h> #include <OpenMS/A...
ALGO
0.981517
3.224959
65757e9b-bf73-4a83-9095-c5eb14bb1e81
lubabahasan/Online-Judge-Problems
Codeforces/1001-2000/1722A.cpp
//Lubaba Hasan UAP #define nl '\n' #include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--){ int n; cin>>n; string a = "Timru", s; cin>>s; sort(s.begin(), s.end()); if(s==a) cout<<"YES\n"; else cout<<"NO\n"; }...
ALGO
0.999745
4.188344
7c3be4aa-5ffb-4aa6-8463-e795a3dadbff
beelisais2793/FX
include/DaisySP/Synthesis/zoscillator.cpp
#include "dsp.h" #include "zoscillator.h" #include <math.h> using namespace daisysp; void ZOscillator::Init(float sample_rate) { sample_rate_ = sample_rate; carrier_phase_ = 0.0f; discontinuity_phase_ = 0.0f; formant_phase_ = 0.0f; next_sample_ = 0.0f; SetFreq(220.f); ...
ALGO
0.976262
5.757269
0f6b5a56-c626-4878-9748-f5169c328c16
Kavin1421/Leetcode-Solution
2100-2199/2162.Minimum Cost to Set Cooking Time/Solution.cpp
class Solution { public: int minCostSetTime(int startAt, int moveCost, int pushCost, int targetSeconds) { int m = targetSeconds / 60, s = targetSeconds % 60; return min(f(m, s, startAt, moveCost, pushCost), f(m - 1, s + 60, startAt, moveCost, pushCost)); } int f(int m, int s, int prev, int ...
ALGO
0.999252
5.849838
10905f8f-8f08-46ca-824c-d2cc09730933
stedolan/llvm
lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
#include "llvm/CodeGen/SelectionDAG.h" #include "llvm/Target/TargetLowering.h" using namespace llvm; namespace { class VectorLegalizer { SelectionDAG& DAG; const TargetLowering &TLI; bool Changed; // Keep track of whether anything changed /// LegalizedNodes - For nodes that are of legal width, and that have m...
ALGO
0.942743
7.701766
4db5422d-6034-4ef7-ad48-d8b019203b34
amehmedic/ASP-2022-23
Zadaće/Z5/main.cpp
#include <iostream> #include <vector> #include <queue> #include <stdexcept> using namespace std; template <typename TipOznake> class Grana; template <typename TipOznake> class Cvor; template <typename TipOznake> class GranaIterator; template<typename TipKljuca,typename TipVrijednosti> struct CvorN { TipKljuca klj...
ALGO
0.958421
4.075265
4152fcdf-28a8-476f-969d-869173e157c3
andreox/projecteuler
problem29.cpp
#include <iostream> #include <list> #include <cmath> using namespace std ; int main ( int argc , char** argv ) { list<double> numbers ; for ( double a = 2 ; a <= 100 ; a++ ) { for ( double b = 2 ; b <= 100 ; b++ ) { numbers.push_back(pow(a,b)) ; } } numbers.sort() ; numbers.unique() ; cout << nu...
ALGO
0.951889
4.551035
de64d96c-6048-4903-ad54-edcce5021dcb
jamcag/aoc22
08/scenic_score.cpp
#include <fstream> #include <iostream> #include <limits> #include <string> #include <vector> int main() { std::ifstream ifs{"input"}; std::vector<std::vector<int>> heights; std::string s; while (std::getline(ifs, s)) { heights.emplace_back(); std::vector<int>& row = heights[heights.siz...
ALGO
0.999795
6.260854
a9bc1d4b-2612-4a97-93cd-1ff81e30cf6d
tucaza555/hacker-rank-solutions
C++/Functions/Functions.cpp
#include <iostream> #include <cstdio> using namespace std; /* Add `int max_of_four(int a, int b, int c, int d)` here. */ int max_of_four(int a, int b, int c, int d) { int num[] = {a, b, c, d}; int max; for (int i = 1; i < 4; i++) { if(num[0] < num[i]) num[0] = num[i]; } ...
ALGO
0.999762
4.180443
bdcb4682-48e3-43c8-ad99-1840ea44aebe
ishandutta2007/codeforces
tsukiko_tsutsukakushi/normal/1553/D.cpp
/** * author: otera * created: 28.09.2021 07:49:26 **/ #include<bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using uint = unsigned; #define repa(i, n) for(int i = 0; i < n; ++ i) #define repb(i, a, b) for(int i = a; i < b; ++ i) #define rep...
ALGO
0.999975
4.687279
16462ea9-4bea-484e-b7b0-7e1fc0faed06
OpenXRay/xray-soc-history
net.ssa/Editors/ECore/Engine/Envelope.cpp
#include "stdafx.h" #pragma hdrstop #include "envelope.h" CEnvelope::~CEnvelope() { Clear(); } CEnvelope::CEnvelope(CEnvelope* source) { *this = *source; for (u32 i=0; i<source->keys.size(); i++) keys[i] = xr_new<st_Key> (*source->keys[i]); } void CEnvelope::Clear() { for (KeyIt k_it=keys.begin(); k_it!=...
ALGO
0.932837
4.845137
982fcee0-bcb7-4a3e-8012-30b7da02b672
devgraphy/Algorithm
baekjoon/구현/2693-N번째큰수.cpp
/* ----------<접근법>---------- 정렬 후 뒤에서 3번 째 큰 수 출력 */ #include <iostream> #include <algorithm> using namespace std; int main(){ int t; int a[10]; cin >> t; for(int i = 0; i < t; i++){ for(int j = 0; j < 10 ; j++){ cin >> a[j]; } sort(a, a+10); cout << a[7] << ...
ALGO
0.999075
3.689398
d3477328-2cc4-483b-9b49-3242fa3a5104
matanc1/edusat
src/heuristics/val.cpp
// // Created by matan on 23/01/2021. // #include <src/utils/utils.h> #include "val.h" #include "src/solver/solver.h" Lit LitScore::choose(Var v) { int litp = v2l(v), litn = v2l(-v); int pScore = lit_score[litp], nScore = lit_score[litn]; return pScore > nScore ? litp : litn; } void LitScore::after_initi...
ALGO
0.999595
5.750041
35091578-7522-43ec-9fdb-dce7786fdd7a
SLIIT-FacultyOfComputing/tutorial-02b-IT21227486
tute03.cpp
#include <iostream> using namespace std ; int main () { int no ; long fac ; cout << "Enter a number : " ; cin >> no ; fac = 1 ; for (int r=no ; r >= 1 ; r--) { fac = fac * r ; } cout << "Factorial of " << no << " is " << fac ; return 0 ; } /*Exercise 3 - Repeatition Convert the C prog...
ALGO
0.999535
3.742868
6b41e14f-6302-4d45-a31e-68b9f17c1494
Seyamalam/Codeforces
801-1000/935c-fifaandfafa.cpp
#include <cstdio> #include <cmath> double getDist(double x1, double y1, double x2, double y2){ return sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); } int main(){ double R, x1, y1, x2, y2; scanf("%lf %lf %lf %lf %lf", &R, &x1, &y1, &x2, &y2); double d1 = getDist(x1, y1, x2, y2); double r = 0.5 ...
ALGO
0.99976
3.033317
9133604f-14f4-47eb-ade3-b242c376b700
Mokuroh54/Comp_Prog
Codeforces/1501-2000/1901-2000/1901-1910/1903_D_1_Maximum_And_Queries_easy_version.cpp
/* ___ (o,o) < . > --"-"--- Rowlet is orz _ _ _ >(.)__ >(.)__ >(.)__ (___/ (___/ (___/ I am dum duck */ #include <bits/stdc++.h> using namespace std; #define FF first #define SS second #define pb push_back #define ll long long #define ld long double #define ull unsigned ll #define endl "\n" #define...
ALGO
0.999376
4.244698
78cc308a-90d7-4656-8aa9-7a7d7af2d43f
nandu-sam/DSA-COURSE
practice.cpp
#include<bits/stdc++.h> #include<iostream> using namespace std; bool checkPalindrome(char a[],int n){ int s=0; int e=n-1; while(s<=e){ if(a[s] !=a[e]){ return 0; } else{ s++; e--; } } return 1; } int getLength(char name[]){//get length function is used to find the length of the array int count=0;//we...
ALGO
0.999084
4.139882
a920b184-f2fe-45d3-bd55-d082a55974b4
CILab-USC/p4c
backends/p4tools/modules/testgen/core/small_step/small_step.cpp
#include "backends/p4tools/modules/testgen/core/small_step/small_step.h" #include <functional> #include <iosfwd> #include <optional> #include <utility> #include <variant> #include <vector> #include "backends/p4tools/common/compiler/reachability.h" #include "backends/p4tools/common/lib/symbolic_env.h" #include "backen...
ALGO
0.970317
7.731468
20586556-e9a1-4ef4-a1ec-35e8249662b5
coeing/cframework
framework/ext/boost/libs/numeric/ublas/doc/samples/banded_adaptor.cpp
#include <boost/numeric/ublas/banded.hpp> #include <boost/numeric/ublas/io.hpp> int main () { using namespace boost::numeric::ublas; matrix<double> m (3, 3); banded_adaptor<matrix<double> > ba (m, 1, 1); for (signed i = 0; i < signed (ba.size1 ()); ++ i) for (signed j = (std::max) (i - 1, 0); j...
ALGO
0.957244
3.642051
b1420839-c308-4921-a72f-6f18a1331b8c
Ghanmohan/Questions_practice
Recursion/string_to_int.cpp
#include<bits/stdc++.h> using namespace std; int stringtolength(char *a, int n) { //base case if (n == 0) { return 0; } //recursive case //important step // a[n-1]-'0' is done to subtract the ASCII value and get the digit int digit = a[n - 1] - '0'; //last digit int small_ans = stringtolength(a, n - 1); r...
ALGO
0.99881
3.339621
b3e11982-e383-41e4-ba27-c02fd83c9c4d
wwwkkkp/Algorithm
Leetcode/83. 删除排序链表中的重复元素_链表.cpp
//83. 删除排序链表中的重复元素 给定一个排序链表,删除所有重复的元素,使得每个元素只出现一次。 示例 1: 输入: 1->1->2 输出: 1->2 示例 2: 输入: 1->1->2->3->3 输出: 1->2->3 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* de...
ALGO
0.999987
5.177231
26975feb-7bb6-4a8f-b1c8-f1064929a014
headshot2017/supertux-ps2
ports/sdlmixer/src/smpeg/audio/filter_2.cpp
/* MPEG/WAVE Sound library (C) 1997 by Jung woo-jae */ // Filter.cc // Subbandsynthesis routines from maplay 1.2 for Linux // I've modified some macros for reducing source code. #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "MPEGaudio.h" void MPEGaudio::computebuffer_2(REAL *fraction,REAL buffer[2][C...
ALGO
0.991407
3.806454
40178e71-4ffb-49ad-8919-1e80e1e29117
mdruhulamin5347/basic-data-structures-in-cpp
Linked List/singly linked list/singly linked list operation_2/delete_at_any_position.cpp
// delete at any position without head #include <bits/stdc++.h> using namespace std; class Node{ public: int val; Node* next; Node(int val) { this->val = val; this->next = NULL; } }; void insert_at_tail(Node* &head, Node* &tail,int val) { Node* newNode = new Node(val); ...
ALGO
0.999746
4.429389
4ba5e78d-7fc5-4283-a058-65252549a4e3
omkumarjha/LeetCode-Problems
Postorder Traversal (Iterative) - GFG/postorder-traversal-iterative.cpp
//{ Driver Code Starts //Initial Template for C++ #include <bits/stdc++.h> using namespace std; #define MAX_HEIGHT 100000 // Tree Node struct Node { int data; Node* left; Node* right; }; // Utility function to create a new Tree Node Node* newNode(int val) { Node* temp = new Node; temp->data = val...
ALGO
0.999938
6.678547
badd1a31-3137-4826-a983-5eb12422bb58
ishandutta2007/codeforces
wsyhb/normal/1701/D.cpp
#include<bits/stdc++.h> using namespace std; const int max_n=5e5+5; struct Interval { int l,r,id; }I[max_n]; inline bool operator < (const Interval &a,const Interval &b) { return a.l<b.l; } int a[max_n]; int main() { int t; scanf("%d",&t); while(t--) { int n; scanf("%d",&n); for(int i=1;i<=n;++i) { int...
ALGO
0.999908
3.484083
4975be2f-795a-4fb2-810c-fcecd6f9f281
kicpark/goorm_study
Algo/0908/yeji/boj1240.cpp
#include <iostream> #include <vector> #include <queue> using namespace std; int n,m; vector<pair<int,int> > arr[1001]; bool visited[1001]={false,}; vector<int> answer; void reset(){ for(int i=0;i<1001;i++){ visited[i]=false; } } void bfs(int start,int end){ queue<pair<int,int> > q; int cost = 0; q.pus...
ALGO
0.999953
4.370547
987ecf5c-e287-4c79-80ac-f79ba4f13d5b
KMsojib/LeetCode
Math/415. Add Strings.cpp
/* leetCode: 415. Add Strings Time Complexity: O(n) */ class Solution { public: string addStrings(string num1, string num2) { string s = ""; int n = num1.size(), m = num2.size(); int i = n - 1, j = m - 1, carry = 0; while (i >= 0 || j >= 0 || carry) { int sum = ...
ALGO
0.999927
7.18876
029a8d3a-bfb9-44f5-b872-361f304e2a45
mohammad-majoony/codeForces-submits
A. The Rank/main.cpp
#include<bits/stdc++.h> typedef long long ll ; using namespace std ; int main(){ int length , num , count = 1 ; cin >> length ; int arr[length] = {0} ; for(int index = 0 ; index < 4 ; index++){ cin >> num ; arr[0] += num ; } for(int index = 1 ; index < length ; index++){ ...
ALGO
0.99981
3.190303
4fcf3654-d941-4daf-a56c-2ab0c94433d2
abhinavkumaryadav1/cpp-codes
Dynamic_Memory_Allocation.cpp
/*<VERY IMPORTANT> when you make array of n size and at run time you assign a value for n and hence size of the array it can crash it is a bad practice . the stack do not have a big memory if it if one assigns it on run time this is where we use "new " keyword and use dynamic memory alocation. */ #include<iostream>...
ALGO
0.99563
4.798232
acd9d239-6a56-41f0-bfd3-091410c90a1f
tydkdev/dotnet-api
snippets/cpp/VS_Snippets_CLR_System/system.Security.Cryptography.XML.SignedXml-AddObject-AddReference/CPP/example.cpp
// <Snippet1> // This example signs an XML file using an // envelope signature. It then verifies the // signed XML. #using <System.Security.dll> #using <System.Xml.dll> using namespace System; using namespace System::Security::Cryptography; using namespace System::Security::Cryptography::Xml; using namespace System...
TOOL
0.910878
6.101032