uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
07cda613-a039-40e4-be55-cbe80b6845d1
netpipe/IrrlichtDemos
Physics/IrrNewt-2.0/libs/newtonSDK/sdk/dCustomJoints/CustomPlayerController.cpp
#include "CustomJointLibraryStdAfx.h" #include "CustomPlayerController.h" #define MAX_CONTACTS 16 #define SENSOR_SHAPE_SEGMENTS 32 #define MAX_COLLISIONS_ITERATION 8 #define DEAD_RESIDUAL_HORIZONTAL_VELOC 0.1f CustomPlayerController::CustomPlayerController( const dMatrix& playerFrameInGlobalSpace, const N...
TOOL
0.909027
5.132829
bc250210-a1a6-4d8f-af27-835ae044f658
Pinaki19/LeetCode_Solutions
1520-number-of-steps-to-reduce-a-number-in-binary-representation-to-one/number-of-steps-to-reduce-a-number-in-binary-representation-to-one.cpp
class Solution { public: int numSteps(string s) { int n = s.size(); int ans = n - 1, carry = 0; for (int i = n - 1; i > 0; i--) { if (s[i] - '0' + carry == 1) { ans++; carry = 1; } } return ans + carry; } };
ALGO
0.99997
6.193361
1d158c88-89cc-40c9-ba07-4b32aaf256b3
secondo-database/secondo
Algebras/SymbolicTrajectoryBasic/SymbolicTrajectoryBasicAlgebra.cpp
#include "SymbolicTrajectoryBasicAlgebra.h" #ifdef RECODE #include <recode.h> #endif using namespace std; using namespace temporalalgebra; using namespace datetime; namespace stj { double BasicDistanceFuns::distance(const string& str1, const string& str2, const LabelFunction lf /*...
TOOL
0.980225
4.71858
1a2baedb-69b7-4ef2-9e48-4386de8af6f3
RyomenDev/DSA
DSA Striever/Graphs/6_dfs.cpp
// depth first search // https://www.geeksforgeeks.org/problems/depth-first-traversal-for-a-graph/0 #include <bits/stdc++.h> using namespace std; #define int long long #define ld long double #define endl "\n" /* 5 5 1 2 1 3 2 4 3 5 3 4 */ void dfs(int node, vector<bool> &visited, vector<vector<int>> graph) // O(n)+O...
ALGO
0.999995
5.210466
54da06b3-d0aa-498a-9b18-9264d9e95c23
JAKUAN-AHMED/DATA-STRUCTURE
MODULE-23-PRIORITY QUEUE/practise.cpp
#include<bits/stdc++.h> using namespace std; int main() { set<int>s; int n; cin>>n; for(int i=0;i<n;i++) { int num,val; cin>>num>>val; if(num==1) s.insert(val); else if(num==2) s.erase(val); else if(num==3) { // if(s.count(val)) cout<<"Yes"<<endl;...
ALGO
0.999878
4.130607
a15cb8e2-e745-4aff-8ccd-6adc31921c4c
golfrumors/advent-of-code
2022/04/main.cpp
#include <iostream> #include <fstream> #include <vector> #include <string> #include <sstream> #include <algorithm> using namespace std; int main() { ifstream input("input.txt"); string data((istreambuf_iterator<char>(input)), istreambuf_iterator<char>()); vector<string> lines; istringstream iss(data)...
ALGO
0.998802
5.154368
def8b7d4-81c5-4b6d-906b-de46cfa03ae0
shriharshpatil23/Data-Structures-and-Algorithms
Rotate a Linked List - GFG/rotate-a-linked-list.cpp
// { Driver Code Starts #include <bits/stdc++.h> using namespace std; struct Node { int data; struct Node *next; Node(int x) { data = x; next = NULL; } }; // } Driver Code Ends /* struct Node { int data; struct Node *next; Node(int x) { data = x; next = NU...
ALGO
0.999933
5.500381
aad3a1de-72e7-4dfc-b62c-1c8086b4aee8
maryram/DDNE
Library/snap/ncp.cpp
#include "stdafx.h" #include "ncp.h" ////////////////////////////////////////////////// // Local Spectral Clustering bool TLocClust::Verbose = true; int TLocClust::ApproxPageRank(const int& StartNId, const double& Eps) { for (int i = 0; i < ProbH.Len(); i++) { ProbH[i]=0.0; } for (int i = 0; i < ResH.Len(); i++)...
ALGO
0.998396
5.140972
afa55185-e68b-42de-a25b-07988c9eaad1
Safwan-Ibrahim/CPP
Phase 02/Class 4/Basic/coloring.cpp
// Created on: 2025-02-06 03:28 // Author: Safwan_Ibrahim #include <bits/stdc++.h> using namespace std; #define ll long long #define endl '\n' const int N = 105; vector<int> G[N]; // better graph bool Vs[N], ok; int C[N]; void dfs(int u) { Vs[u] = true; for (auto x : G[u]) { if (!Vs[x]) { ...
ALGO
0.999916
5.314626
35f78a7e-fb9f-489f-93cb-d4460d65f90e
JAlthea/Algorithm
Implementation/Programmers 위클리 챌린지 [4주차].cpp
#include <bits/stdc++.h> using namespace std; vector<string> split(string & s, char deli) { istringstream ss(s); vector<string> result; string nowString; while (getline(ss, nowString, deli)) result.push_back(nowString); return result; } bool cmp(pair<string, int> & a, pair<string, int> & b...
ALGO
0.999785
5.6882
1b8ac908-65c8-48ea-bbfb-a72ef11dd4b6
its-Hitesh/Codeforeces-questions
A_Timofey_and_a_tree.cpp
#include <bits/stdc++.h> #include <bits/extc++.h>// #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; using ll = long long ; #define pb push_back #define ld long double #define sz size() #define foo(i,a,b) f...
ALGO
0.999943
4.216475
a3763358-5029-4ffb-a4ee-99cb3365c2de
raul4247/URIOnlineJudge
src/1467.cpp
#include <iostream> #include <vector> using namespace std; int main() { int a, b, c; while (cin >> a >> b >> c) { if ((a == 0 && b == 1 && c == 1) || (a == 1 && b == 0 && c == 0)) cout << 'A' << endl; else if ((a == 1 && b == 0 && c == 1) || (a == 0 && b == 1 && c == 0)) ...
ALGO
0.99983
4.109528
9f038ac6-c908-4c6f-ba8c-3e2fdd6b6208
muhamadfajaralfikri/projek-al-quran
latihan/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.997834
6.76775
f9fd24ff-40b5-4fda-9095-2e715d28d3ba
MNTracker/MNT
src/rpcdump.cpp
#include "bip38.h" #include "init.h" #include "main.h" #include "rpc/server.h" #include "script/script.h" #include "script/standard.h" #include "sync.h" #include "util.h" #include "utilstrencodings.h" #include "utiltime.h" #include "wallet.h" #include <fstream> #include <secp256k1.h> #include <stdint.h> #include <boo...
WEB
0.951696
6.095901
6b3b36cf-d32b-49dd-abe0-741a7948bb80
raincross7/code-similarity
codes/train_code/problem373/problem373_106.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { ll n,k; cin>>n>>k; vector<pair<ll,ll>> sushi(n); vector<ll> replace; set<ll> toppings; for (ll i=0; i<n; i++) cin>>sushi[i].second>>sushi[i].first; sort(sushi.begin(),sushi.end()); reverse(sushi.begin(),sushi.end()); ll ans=0; ...
ALGO
0.999965
3.569618
1782fd64-3825-40d9-bd59-4e6fbd2bbaec
Hg-lab/PreparationFromBOJ
프로그래머스_정수 제곱근 판별.cpp
#include <stdio.h> #include <stdbool.h> #include <stdlib.h> #include <math.h> long long solution(long long n) { long long answer = 0; float x = sqrt(n); if(x - (int)x == 0) { answer = x; } else { answer = -1; } return answer; } int main() { int n; scanf("%d", &n); printf("%d", solution(n))...
ALGO
0.999849
3.871601
3cb73fd6-7857-41db-b26e-e28e7bf255c8
ishandutta2007/codeforces
smax/normal/1363/C.cpp
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #define DEBUG(...) debug(#__VA_ARGS__, __VA_ARGS__); #else #define DEBUG(...) #endif template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";} template<typename C, typena...
ALGO
0.999615
4.492355
9949e478-a34d-458a-8510-f01c6bc2beb1
Aryan-747/YeetCode
24-swap-nodes-in-pairs/swap-nodes-in-pairs.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* swapPairs(L...
ALGO
0.999987
5.898729
bfa68d78-0588-41ae-8d9f-15b11cd9148a
vick-254/DSAlgo_Practice
Phase 2/Recursion Striver/3_subset1.cpp
#include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { private: void solve(int ind, vector<int> &arr, vector<int> &ans, int size, int sum) { if (ind == size) { ans.push_back(sum); return; } sum = sum + arr[ind]; solv...
ALGO
0.999741
5.960477
07e96b8a-f2de-44c3-a9af-eb0f0ab3791d
f4t4nt/competitive-programming
archive/CodeForces/Gym/CERC23/humanresources.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll, ll> pll; typedef string str; #define pb push_back #define elif else if #define sz(C) (ll) C.size() #define all(C) C.begin(), C.end() #define flip(C) reverse(all(C)) #define ssort(C) sort(all(C)) #define FOR(...
ALGO
0.999182
3.956202
95f36509-91c8-43fc-acd7-d79035cbabb0
Fezaan/Leetcode
Insert Interval - GFG/insert-interval.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function Template for C++ class Solution { public: vector<vector<int>> insertNewEvent(int N, vector<vector<int>> &zoro, vector<int> &enma) { // code here vector<vector<int>> OnePiece; for(in...
ALGO
0.99987
6.110495
f1b687de-a3e5-45b2-842a-05296b9e7910
JAcevedoPoli/Ejercicios_momento_2_AlgoyProg
Ejercicio 5.cpp
#include <iostream> float h,quinta; int rebotes=0; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) { printf("Digite la altura inicial: "); scanf("%f",&h); quinta=h/5; while(h>=quinta){ rebotes++; h=h*0.9; } printf("La pelota...
ALGO
0.999689
3.318437
96e22d3d-0929-43c3-afea-0c5b3600ca3f
wohenniubi/codebattle
src/572_Subtree_of_Another_Tree/main.cpp
#include <iostream> using namespace std; /* 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, TreeNod...
ALGO
0.999935
5.250411
564a43bf-9108-4c2c-8693-f83017195f41
igknite/BOJ_cpp
BOJ_cpp/14889.cpp
#include <iostream> #include <vector> using namespace std; vector<vector<int>> performance(20, vector<int>(20, 0)); vector<bool> selected(20, false); int member = 0; int best = 10000; void team(int idx, int count); int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cin >> member; vector<int> row(member...
ALGO
0.999978
3.847795
298fe1ae-bd8d-4d07-a40b-cbc6f7019cd1
xhytom/acm
struct/StringHash.cpp
// Problem: 3/2 Square Strings // Contest: NowCoder // URL: https://ac.nowcoder.com/acm/contest/85132/G // Memory Limit: 2097152 MB // Time Limit: 8000 ms // // Powered by CP Editor (https://cpeditor.org) /* _/ _/ _/ _/ _/ _/ _/_/_/_/_/ _/_/ _/ _/ _/ _/ _/ _/ ...
ALGO
0.999918
4.13044
571d83c9-c58f-45e1-bc14-d3f93a4c58d1
ThiagoFBastos/programacao-competitiva
beecrowd/1223 - Tobogan de Bolinhas.cpp
#pragma GCC optimize("O3,unroll-loops") #pragma GCC target("sse,mmx,sse2") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; template<class T> using ordered_set = tree <T, null_type , less<T> , rb_tree_tag , tree_...
ALGO
0.999618
4.067932
d5589a2e-2275-4c5e-acdc-965ba3b59768
Evanstar/bitflip
gem5/src/systemc/tests/systemc/misc/unit/data/general/int_to_bits/datawidth.cpp
/***************************************************************************** datawidth.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /**************************************************************************...
ALGO
0.920252
5.362704
e1bb0825-8481-4e7b-8d9f-3c4b303c0b5e
huangallen2008/cppcode
code/CSacademy/max-intersection-partition/max-intersection-partition_heuristic.cpp
#include<bits/stdc++.h> using namespace std; // #pragma GCC optimize("O3,unroll-loops") // #pragma GCC target("avx2,sse4,bmi2,popcnt") #define int long long #define REP(i,n) for(int i=0;i<(n);i++) #define REP1(i,n) for(int i=1;i<=(n);i++) #define RREP(i,n) for(int i=(n)-1;i>=0;i--) #define RREP1(i,n) for(int i=(n);i>=1...
ALGO
0.99991
3.605561
c6e862cf-902a-49d4-893e-1b259f9a372a
ResonanceGroup/FEMM
csolv/prob1big.cpp
#include "StdAfx.h" #include <stdio.h> #include <math.h> #include "complex.h" #include "csolv.h" #include "csolvDlg.h" #include "mesh.h" #include "spars.h" #include "FemmeDocCore.h" //conversion to internal working units of mm double units[]={25.4,1.,10.,1000.,0.0254,0.001}; double sq(double x){ return x*x; } BOOL C...
ALGO
0.997171
3.365244
b43ad881-a10a-43af-b0a4-7376c661f308
1m188/algorithm
牛客网/剑指offer/JZ39 数组中出现次数超过一半的数字.cpp
/** * @file JZ39 数组中出现次数超过一半的数字.cpp * @date 2022-05-27 */ /* 描述 给一个长度为 n 的数组,数组中有一个数字出现的次数超过数组长度的一半,请找出这个数字。 例如输入一个长度为9的数组[1,2,3,2,2,2,5,4,2]。由于数字2在数组中出现了5次,超过数组长度的一半,因此输出2。 数据范围:n \le 50000n≤50000,数组中元素的值 0 \le val \le 100000≤val≤10000 要求:空间复杂度:O(1)O(1),时间复杂度 O(n)O(n) 输入描述: 保证数组输入非空,且保证有解 示例1 输入: [1,2,3,2,2,2,5,4...
ALGO
0.999952
5.766828
732d7339-8d73-4660-947f-abff6b79872e
ptiw-rep/LeetCodePractice
1710-maximum-units-on-a-truck/1710-maximum-units-on-a-truck.cpp
class Solution { public: static bool myfunction(vector<int>& a, vector<int>& b){ return a[1] > b[1]; } int maximumUnits(vector<vector<int>>& boxTypes, int truckSize) { //sort by second element in decreasing order sort(boxTypes.begin(),boxTypes.end(),myfunction); //greedily pick boxes ...
ALGO
0.999983
6.655581
f74b0291-ab91-450e-b486-5235bc5dd8bc
man0405/Cpp
Chapter4/ex_4_6.cpp
#include <iostream> #include <math.h> using namespace std; int main() { double a , b,c , delta, x1, x2; cout << "Enter a b c of quadratic equation: "; cin >> a >> b >> c; if (a == 0) { if ( b == 0 ){ if ( c ==0) cout <<"an infinite number of roots \n"; else cout <<"a ne...
ALGO
0.999356
3.97321
15b3c76b-549b-4f98-a949-eae04619a107
balintbalazs/B3D
source/src/B3D_cudaCompress/CPU/HuffmanCPU.cpp
#include "HuffmanCPU.h" #include <cassert> namespace cudaCompress { bool huffmanEncodeCPU(BitStream& bitStream, const std::vector<Symbol16>& symbolStream, const HuffmanEncodeTableCPU& encodeTable, std::vector<uint>& offsets, uint codingBlockSize) { uint offsetBase = bitStream.getBitPosition(); for(uint i = 0...
ALGO
0.989276
6.766486
0e0184fe-1513-4326-a38d-ab6b0c63555c
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_9874_61.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << "ABC" + n << endl; }
ALGO
0.997263
4.043868
82d7c84f-d66f-40c1-9139-f1a1847e12a1
dipayansaha2002/Gfg-solutions
Medium/Paths from root with a specified sum/paths-from-root-with-a-specified-sum.cpp
//{ Driver Code Starts //Initial Template for C++ #include<bits/stdc++.h> using namespace std; // A Tree node struct Node { int key; struct Node *left, *right; }; // Utility function to create a new node Node* newNode(int key) { Node* temp = new Node; temp->key = key; temp->left = temp->right = NULL; return (t...
ALGO
0.999783
6.52893
ac68950a-6597-4001-851e-274bef732d8c
agnjasn/JIMP2
lab1/doublebasepalindromes/DoubleBasePalindromes.cpp
// // Created by agnieszka on 06.03.17. // #include "DoubleBasePalindromes.h" using namespace std; uint64_t DoubleBasePalindromes(int max_vaule_exculsive) { uint64_t sum=0; for (int i = 0; i < max_vaule_exculsive; i++) { string max_ve, value_in_2, tmp; sprintf((char *) tmp.c_str(), "%d", i...
ALGO
0.976581
4.632723
12f8d485-818b-4ffd-96e9-0134ef99bc77
CodingRohanX/C-
14 Vectors/0.cpp
#include <iostream> #include <vector> #include <algorithm> #include <numeric> using namespace std; int main() { int n; //3 Ways to initialize a Vector. // 1. Declaration //vector<int> a; // 2. Initialization with size vector<int> a(n); // 3. Initialization with size and default value ...
ALGO
0.997108
4.299644
19e869ec-7f32-4329-b44f-f44fe87273b2
ram333n/cppcoursera
White/Week 2/Map_practice_capitalsOfCountries.cpp
#include <iostream> #include <map> #include <string> using namespace std; void psevdo_main_2() { int q; string command; map<string, string> source; cin >> q; for (int t = 0; t < q; t++) { cin >> command; if (command == "CHANGE_CAPITAL") { string country, new_capital; cin >> country >> new_capital; i...
TOOL
0.973599
5.014721
41e03359-7005-4ac6-a2aa-806a58de189d
talkad/animation3D
igl/polar_svd3x3.cpp
template<typename Mat> IGL_INLINE void igl::polar_svd3x3(const Mat& A, Mat& R) { // should be caught at compile time, but just to be 150% sure: assert(A.rows() == 3 && A.cols() == 3); Eigen::Matrix<typename Mat::Scalar, 3, 3> U, Vt; Eigen::Matrix<typename Mat::Scalar, 3, 1> S; svd3x3(A, U, S, Vt); R = U * ...
ALGO
0.982383
6.951295
f08d45c1-3101-4541-a78a-3f4605cac221
j3soon/OfflineJudgeTestTools
samples/adder.cpp
#include <iostream> int main() { int a, b; while (std::cin >> a >> b) { std::cout << (a + b) << "\n"; } return 0; }
ALGO
0.997284
5.629829
56affd68-4b30-484f-be11-ce0bcf0480a7
ayushbdkt-01/Striver-A2Z-DSA-Sheet
Sorting/selectionSort.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int a[]={1,3,4,2,5}; int n=5; for(int i=0;i<=n-2;i++){ int mini=i; for(int j=i+1;j<=n-1;j++){ if(a[j]<a[mini]){ mini=j; } } swap(a[i],a[mini]); } cout<<"Sorted array: ";...
ALGO
0.999989
4.320016
5b1349c6-6790-408e-852f-8822b8d647a0
sahil-adhav/Leetcode
0455-assign-cookies/0455-assign-cookies.cpp
class Solution { public: int findContentChildren(vector<int>& g, vector<int>& s) { sort(g.begin(), g.end()); sort(s.begin(), s.end()); int i = 0, j = 0, contentChild = 0; while(i < g.size() && j < s.size()){ if(s[j] >= g[i]){ i++; ...
ALGO
0.999848
6.101952
f9a6061d-03cc-4064-9cb6-80e93809a495
GNAQ/Algorithm-Contest-Archive
Template/数位DP.cpp
typedef long long ll; int a[20]; ll dp[20][state];//不同题目状态不同 ll dfs(int pos,/*state变量*/,bool lead/*前导零*/,bool limit/*数位上界变量*/)//不是每个题都要判断前导零 { //递归边界,既然是按位枚举,最低位是0,那么pos==-1说明这个数我枚举完了 if(pos==-1) return 1;/*这里一般返回1,表示你枚举的这个数是合法的,那么这里就需要你在枚举时必须每一位都要满足题目条件,也就是说当前枚举到pos位,一定要保证前面已经枚举的数位是合法的。不过具体题目不同或者写法不同的话不一定要返回1 ...
ALGO
0.999888
3.584577
dc40ef66-293a-41e2-adbc-82e49832cddc
oxygen-hunter/Flashboom
data/leetcode_cpp/median-of-a-row-wise-sorted-matrix.cpp
// Time: O(logr * mlogn), r = O(right-left+1) = O(10^6), O(logr) = O(20) // Space: O(1) // binary search class Solution { public: int matrixMedian(vector<vector<int>>& grid) { const auto& check = [&](int x) { return accumulate(cbegin(grid), cend(grid), 0, [&](cons...
ALGO
0.999993
6.337026
fef50e17-26ad-4ad0-976f-9dea7e1f0873
jacksangl/Projects
labs/BST-Storting/sorting.cpp
// Academic Integrity Affidavit: // I certify that this program code is my work. Others may have // assisted me with planning and concepts, but the code was written, // solely, by me. // I understand that submitting code that is totally or partially // the product of other individuals is a violation of the Academic //...
ALGO
0.999633
5.845483
772103b4-b4c1-47e9-9e44-390f135a9f0a
AdRo07/frameworks_av
media/libstagefright/codecs/amrwb/src/wb_syn_filt.cpp
/* ------------------------------------------------------------------------------ Filename: wb_syn_filt.cpp Date: 05/08/2004 ------------------------------------------------------------------------------ REVISION HISTORY Description: -------------------------------------------------------------------------...
ALGO
0.999917
4.836874
150b951f-c692-43c8-a2a3-0ecfb0cfe570
magestik/mesa
src/intel/compiler/brw_fs_dead_code_eliminate.cpp
#include "brw_fs.h" #include "brw_fs_live_variables.h" #include "brw_cfg.h" /** @file brw_fs_dead_code_eliminate.cpp * * Dataflow-aware dead code elimination. * * Walks the instruction list from the bottom, removing instructions that * have results that both aren't used in later blocks and haven't been read * ye...
ALGO
0.945663
7.89192
41dc793e-6855-4267-82b6-3c3568dc1c6b
vi5hnuu/DSA-prac
kbitSet.cpp
#include<iostream> using namespace std; bool isKthBitSet(unsigned int n,int k){ // return (n>>(k-1) & 1 ==1); return ((n & (1<<(k-1)))!=0); } int main(){ cout<<isKthBitSet(5,1)<<endl; cout<<isKthBitSet(5,2)<<endl; cout<<isKthBitSet(5,3)<<endl; }
ALGO
0.997802
5.432693
60a4ac62-6e92-47e8-908f-8521f8432812
Dushyantbha012/oops
assgn3/Q6.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; //Pyramid for(int i=0;i<n;i++){ for(int j=i;j<n;j++){ cout<<" "; } for(int j=0;j<=i-1;j++){ cout<<"*"; } for(int j=0;j<=i;j++){ cout<<"*"; } ...
ALGO
0.999929
3.602574
e62157f8-1fd3-46b3-9a27-84ca6b80f500
AChen24562/C-Plus-plus
ET580/Day 2 Class I/Practice/class_tests/rec_test.cpp
#include <iostream> using namespace std; int main(){ countDown(5); return 0; }
TOOL
0.973833
3.660269
691cd22c-1104-4f55-8a3c-d5aa6844f823
qsnake/trilinos
packages/mesquite/testSuite/analytical_grad_3D/main.cpp
// -*- Mode : c++; tab-width: 3; c-tab-always-indent: t; indent-tabs-mode: nil; c-basic-offset: 3 -*- // // SUMMARY: // USAGE: // // ORIG-DATE: 19-Feb-02 at 10:57:52 // LAST-MOD: 23-Jul-03 at 18:09:13 by Thomas Leurent // // // DESCRIPTION: // ============ /*! \file main.cpp describe main.cpp here */ // DESC...
ALGO
0.978197
4.539798
5878fa5c-e70d-47bd-bf43-99b8237a0dde
adhityairvan/SDII
Untitled1.cpp
#include<stdio.h> #include<stdlib.h> int travel(int matriks[][3],int b,int c); int main() { int array[3][3]={0}; int i,a,b,c; int counter=0; for(i=0;i<3;i++) { for(a=0;a<3;a++) { scanf("%d",&array[i][a]); } } for(i=0;i<3;i++){ for(a=0;a<3;a++){ if( (array[i][a]==1) && ((array[i][a+1]==1) || ...
ALGO
0.999897
3.576234
1af1eee1-7407-4823-bf6e-1694e7f039da
akkifcs189/A2Z-SDE
1. Basics/Step-1.5: Basic Recursion/ReverseArray.cpp
/* Time Complexity: O(n) Space Complexity: O(1) where n is the size of the input array. */ void reverseArray(int start, int end, vector<int> &nums) { if (start > end) return; swap(nums[start], nums[end]); return reverseArray(start + 1, end - 1, nums); } // Function to reverse the elemen...
ALGO
0.999907
6.453312
2a891939-1f95-4524-8c62-7eb3c1743d06
divyansingh/CPP-sample
recursion removeduplicates.cpp
#include <iostream> using namespace std; void DupAddStar(char str[], int s, char strOut[], int pos){ if (str[s]=='\0') { strOut[pos]='\0'; return; } if (s==0) strOut[pos]=str[s]; else if ( str[s]!=str[s-1]) strOut[pos]=str[s]; else { strOut[pos++]='*'; strOut[pos]=s...
ALGO
0.9997
3.653783
17614cac-0af6-4493-9ca1-33b684b1039f
AlgoZenithNITC/GFG_POTD_Solutions_AlgoZenithNITC
Array_Pair_Sum_Divisibility_Problem.cpp
class Solution { public: bool canPair(vector<int> nums, int k){ if(nums.size()%2 != 0){ return false; } unordered_map<int, int> mp; for(int i : nums){ int y = i%k; if(mp[(k - y)%k] != 0){ mp[(k - y)%k]--; } ...
ALGO
0.999948
5.265702
8d4f93e3-f0ed-4dcd-9665-6dc32acd8934
AndryRafam/Algo-Dojo
String/CountUniqueChars.cpp
/*Let's define a function countUniqueChars(s) that returns the number of unique characters on s. For example, calling countUniqueChars(s) if s = "LEETCODE" then "L", "T", "C", "O", "D" are the unique characters since they appear only once in s, therefore countUniqueChars(s) = 5. Given a string s, return the sum of co...
ALGO
0.999865
5.780357
77cc21a4-1427-4b94-8b92-2d37ac8abd95
julesroyer18/PI_MECATRO
code_arduino/controlRobotLF/derivative.cpp
namespace derivative { double getDerivative(double deltaYPrevious, double deltaYCurrent, double deltaT) { return (deltaYCurrent - deltaYPrevious)/deltaT; } double getFilteredDerivative(double xPrevious, double deltaYPrevious, double deltaYCurrent, double epsilon, double deltaT) { /*This function output...
ALGO
0.998558
5.882213
4a5b9731-70b6-4134-bc96-611f70ef3d39
tianyicaii/leetcode
raw/2024/leetcode/cpp/0118-pascals-triangle.cpp
#include <vector> std::vector<std::vector<int>> generate(int numRows) { std::vector<std::vector<int>> ans; for (int i = 0; i < numRows; ++i) { if (i == 0) ans.push_back({1}); else { std::vector<int> lev; const std::vector<int> & prev = ans.back(); for (int ...
ALGO
0.999916
5.739703
4fd44f4e-c674-4853-be38-8ec54a986a4b
HDYee/C-_2023
src/CH04/prg_408.cpp
#include <iostream> using namespace std; int main(int argc, char *argv[]) { int number; cout<<"Enter an integer and i will tell you if it\n"; cout<<"is odd or even."; cin>>number; if(number%2==0){ cout<<number<<" is even.\n"; } else{ cout<<number<<" is odd.\n"; } ret...
ALGO
0.956453
3.1813
ce5b4b8b-806c-4fdb-8b6a-34d0225aa2c2
Pavitar56/LeetCode
Find k-th smallest element in given n ranges - GFG/find-kth-smallest-element-in-given-n-ranges.cpp
//{ Driver Code Starts /* Driver program to test above function */ #include<bits/stdc++.h> using namespace std; // } Driver Code Ends //User function Template for C++ class Solution{ public: vector<int>kthSmallestNum(vector<vector<int>>&range, vector<int>queries){ //Write your code here sort...
ALGO
0.999816
5.73938
726103ac-117c-4db7-8908-0a2d71f7a8c3
Pranav-Kumar-Singh-038/Competitive_Programming
Random/1A.cpp
#include <bits/stdc++.h> using namespace std; //Formula Approach // The logic of the formula is to make the number so large so that it only less than double of itself void solve() { long long int n, m, a; cin >> n >> m >> a; long long int ans = ((m + a - 1) / a) * ((n + a - 1) / a); cout << ans; } //My...
ALGO
0.999597
4.453692
561d5ecf-fdcb-4865-8c7e-64c416ad5c93
rococojie/topcoder
531_dv2_UnsortedSequence.cpp
#include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cstdlib> #include <c...
ALGO
0.999888
4.191313
1945c3b8-b024-4883-80f9-25bd3013e049
dskym/Algorithm
LeetCode/1237/Solution.cpp
/* * // This is the custom function interface. * // You should not implement it, or speculate about its implementation * class CustomFunction { * public: * // Returns f(x, y) for any given positive integers x and y. * // Note that f(x, y) is increasing with respect to both x and y. * // i.e. f(x, y) ...
ALGO
0.999929
5.752137
2050b44f-c0a0-406e-a258-6b04afa59581
nilanjanajui/Data-Structures
Structured/STL/Queue Container.cpp
#include<iostream> #include<queue> using namespace std; int main() { priority_queue<int> qu; qu.push(21); qu.push(22); qu.push(24); qu.push(25); qu.pop(); while (!qu.empty()) { cout<<qu.top() <<" "; qu.pop(); } return 0; }
ALGO
0.998196
3.69542
4ff6841f-db65-4179-9716-ba6437b994e3
jendakeller/meshtrack
src/igl/hessian.cpp
#include "hessian.h" #include <vector> #include "grad.h" #include "igl/doublearea.h" #include "igl/repdiag.h" template <typename DerivedV, typename DerivedF, typename Scalar> IGL_INLINE void igl::hessian( const Eigen::MatrixBase<DerivedV> & V, const Eigen::Mat...
ALGO
0.995804
6.106034
0613cf07-137c-4015-a51b-25aebdb56208
MwizaTembo/Lab-Sessions
postfix.cpp
#include <iostream> using namespace std; int main(){ int x = 3; //the val of x increased after the initial val of x is assigned to y //hence the val of y is the val of x before it was increased int y = x++; cout << "x: " << x << endl; cout << "y: " << y << endl; }
TOOL
0.992235
3.15233
55bea42c-fa64-43ce-b003-850723531050
priyanshub18/CPP
RECURSION/printarray.cpp
#include<iostream> using namespace std; void display(int arr[] , int n , int idx){ if(idx == n)return; cout<<arr[idx]<<endl; display(arr, n , idx+1); } int main(){ int arr[] = {2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,12}; int n = sizeof(arr)/4; display(arr,n,0); }
ALGO
0.999173
3.647022
088c299d-3965-4429-816d-a1d3433747bd
pyrkcommunity/pyrk
src/bls/bls_ies.cpp
#include "bls_ies.h" #include "hash.h" #include "random.h" #include "streams.h" #include "crypto/aes.h" template <typename Out> static bool EncryptBlob(const void* in, size_t inSize, Out& out, const void* symKey, const void* iv) { out.resize(inSize); AES256CBCEncrypt enc((const unsigned char*)symKey, (const...
ALGO
0.977415
7.423766
1583a0a3-3a75-48cc-b598-b8e40a9c489a
Axe-Pearl/50DaysofDSA
Day30/Next_Greater_Element.cpp
// { Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: //Function to find the next greater element for each element of the array. vector<long long> nextLargerElement(vector<long long> arr, int n){ stack<long long> stk; vector<long ...
ALGO
0.999894
5.995405
1a8417e6-25a1-41ef-8c5f-7d49db224651
Suhanovdaniil/Lab_2
Task_3/task_3.cpp
#include <iostream> #include <cmath> #include <string> #include <sstream> #include <vector> using namespace std; // Функция для вычисления суммы и произведения цифр числа void calculateSumAndProduct(int n, int& sum, int& product) { sum = 0; product = 1; string number = to_string(n); // Преобразуем число в...
ALGO
0.999444
6.090014
3ca45a27-9aa2-4421-b41e-77ea411d2e1a
daa233/learning-notes
programming/programming-and-algorithms-pku/2-c-review/Week3-Recurrence/DoublyRecurrence.cpp
/** 习题课一:枚举、模拟与递归 编程题 #2 * @file: DoublyRecurrence.cpp * @description: 双递归:F(x+1) = G(x) + 1; G(x+1) = F(x) + 1 自然数奇数偶数的定义(递归的思想):0是偶数;如果x是偶数,那么x+1是奇数;如果x是奇数,那么x+1是偶数。 用双递归的思想判断一个数是否为偶数。 * 样例输入 第一组 2 第二组 5 * 样例输出 第一组 true 第二组 false * * @author: Du An...
ALGO
0.9999
4.757683
3887a903-6280-4198-a636-ba8a028b41e7
LIFECorp/frameworks
av/media/libstagefright/codecs/m4v_h263/dec/src/post_proc_semaphore.cpp
/* ------------------------------------------------------------------------------ INPUT AND OUTPUT DEFINITIONS Inputs: q_block = pointer to buffer of inverse quantized DCT coefficients of type int for intra-VOP mode or buffer of residual data of type int for inter-VOP mode Local Sto...
ALGO
0.992423
7.19238
69290fe7-788f-434a-b7b5-46630cb6bdc2
akamya997/PracticeCode
201902_practice/2019_2/snapback/hdu_2639.cpp
#include<bits/stdc++.h> using namespace std; int dp[1005][35]; int w[105],vol[105]; int main() { int T; ignore=scanf("%d",&T); while(T--) { int n,v,k; ignore=scanf("%d%d%d",&n,&v,&k); memset(dp,0,sizeof(dp)); for(int i=0;i<n;i++) ignore=scanf("%d",&w[i]); for(int i=0;i<n;i++) ignore=scanf("%d",&vol[...
ALGO
0.999982
3.540665
e1418551-7c63-4b29-bba5-f6840466ee55
debsourav33/CodeForces-Problem-Solutions
1157C2- Increasing Subsequence (hard version).cpp
#include<bits/stdc++.h> using namespace std; //{ #define si(a) scanf("%d",&a) #define sii(a,b) scanf("%d %d",&a,&b); #define siii(a,b,c) scanf("%d %d %d",&a,&b,&c); #define sl(a) scanf("%lld",&a) #define sll(a,b) scanf("%lld %lld",&a,&b); #define slll(a,b,c) scanf("%lld %lld %lld",&a,&b,&c); #define outi(a) printf("...
ALGO
0.999994
3.030219
eeb3a4ea-eff7-43f4-b88b-208ff1ad4ae5
sarvex/leetcode-scopes
solution/0500-0599/0573.Squirrel Simulation/Solution.cpp
class Solution { public: int minDistance(int height, int width, vector<int>& tree, vector<int>& squirrel, vector<vector<int>>& nuts) { int ans = INT_MAX; int s = 0; for (auto& a : nuts) { s += f(a, tree); } s *= 2; for (auto& a : nuts) { int c ...
ALGO
0.999907
5.422746
935e1cd4-5f06-48f4-8af4-6fa8c3f5fca0
eng-dabaay/dice-app
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.9988
6.76073
61c80f37-c024-4e1b-82f0-c452c86db507
Hijiongfeng/Likou
exam/4_14_4.cpp
#include<iostream> #include<vector> #include<string> #include<numeric> using namespace std; long long ans = 0; vector<long long> num; void backtracking(string &s,int startIndex){ // 回溯法 会超时 数据短的情况下可以 if(accumulate(num.begin(),num.end(),0) % 9 == 0 && num.size()!=0){ ans++; } if(num.size() >=...
ALGO
0.999941
5.930628
59b26536-84d2-45fe-b3b4-7514b19db488
jangalapalleramesh/LeetCode
0274-h-index/0274-h-index.cpp
class Solution { public: int hIndex(vector<int>& citations){ int numPapers = citations.size(); vector<int> citationCounts(numPapers + 1, 0); for (int citation : citations) { if (citation >= numPapers) { citationCounts[numPapers]++; } else { ...
ALGO
0.999881
6.479356
8de90f5f-813a-40df-96a6-bbee7499e294
Researching-Algorithms-For-Us/4.Implementation
source/cpp/상하좌우.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int startX = 1, startY = 1; int N; cin >> N; char move; while (cin >> move) { if (cin.eof()) break; switch (move) { case 'L': i...
ALGO
0.999904
3.810038
32afe19d-3dc0-4da5-9086-6c0b0af95c3e
harshitdixit9680/Basic-Coding-Question
data structure and algorithm/unordered_set.cpp
#include<iostream> #include<bits/stdc++.h> #include<unordered_set> using namespace std; int main(){ unordered_set<int> s; s.insert(45); s.insert(55); s.insert(65); s.insert(75); s.insert(55); for(int i: s){ cout<<i<<" "; }cout<<endl; cout<<"size of set : "<<s.size()<<endl; //s.clear(); //cout<<"size of set : "<<s.s...
ALGO
0.991743
3.526875
395c726f-9f3b-4b62-a3e5-d1f310f763ef
kaanatmacaa/cs_homeworks
cs204_advanced_programming/hw5/kaanatmaca_Atmaca_Kaan_hw5.cpp
#include <iostream> #include <string> #include <fstream> #include <sstream> #include <chrono> #include "sketch.hpp" #include "hasher.hpp" #define BOOK_SIZE 3506329 #define COUNT 1 #define NO_SKETCHES 9 void read_freqs(std::pair<std::string,int> freqs[]) { std::fstream fin; fin.open("top1000.txt", std::ios::in)...
ALGO
0.967085
3.699419
7463b8f6-51b4-4576-887e-e79608e50994
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_1364_1.cpp
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 10; const int SQRTN = 320; const int LOGN = 20; const int PI = acos(-1); int n, a[N], c[N]; vector<vector<int> > loops; vector<int> loop, v; int vis[N]; int main() { cin >> n; for (int i = 1; i <= n; i++) scanf("%d", c + i); for (int i = 1; i <= n;...
ALGO
0.999971
3.494828
5017a8fc-e8f2-4ba1-9b2b-300e71930aa3
Atik203/C_and_CPP
C++/C_Replacement.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; vector<int> v(n); for(int i=0;i<n;i++) { cin>>v[i]; } for(int i=0;i<n;i++) { if(v[i]<0) { replace(v.begin(),v.end(),v[i],2); } else if(v[i]>0) { replace(v.begin(),v.end(),v[i],1); } } for(in...
ALGO
0.999909
3.864406
b3f6d821-3cf3-4eb7-ab04-420ffc70bb36
lucastarche/aotd
Searching/123-FibonacciSearch.cpp
//Fibonacci Search //An algorithm similar to binary search, but that employs fibonacci numbers to partition the array. //Was more useful back in the day when division and multiplication, which are used for binary search, were more expensive. //We assume that the elements are already sorted. //Runtime: O(log n) #include...
ALGO
0.999977
5.183288
e39ef81f-5f90-439d-b85b-7a0ba1018c5e
prachisingh2304/Data-Structure
Patterns/rhombus_pattern.cpp
# include <iostream> using namespace std; int main(){ int n; cout<<"Enter value : "; cin>>n; for(int i=n;i>=1;i--){ for(int j=1;j<=i-1;j++){ cout<<" "; } for(int j=1;j<=n;j++){ cout<<" * "; } cout<<endl; } return 0; }
ALGO
0.999935
3.867786
b9f293a4-66fa-445a-b017-7696b62399d9
Min-03/Algorithm
12/2589.cpp
#include <bits/stdc++.h> #define FASTIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); using namespace std; char graph[50][50]; int dists[50][50]; int dx[] = {1, -1, 0, 0}; int dy[] = {0, 0, 1, -1}; int n, m; int bfs(int sx, int sy) { memset(dists, -1, sizeof(dists)); dists[sx][sy] = 0; queue<pair<i...
ALGO
0.999797
3.996694
0c724b2b-4f42-4b19-a300-0bc97ef0fbb0
bharatjivv/DSA-SUPREME
Week-12 Queues/Week-12 Code/lecture37c.cpp
// Queue Class 2 // InterLeaveQueue Question #include <iostream> #include <queue> #include <stack> using namespace std; void print(queue<int> q) { while (!q.empty()) { cout << q.front() << " "; q.pop(); } cout << endl; } void interLeaveQueue(queue<int> &q) { // Step A int n = q.size(); if (q.empty...
ALGO
0.999201
4.462482
2df67753-59f1-4566-9853-f1d1e2626954
MartinSantesteban/MBox
MBox/src/MBoxParser.cpp
#include "./MBoxParser.h" #include "./visitor.h" MBoxParser::MBoxParser(vector<Token> t){ this->tokens = t; this->current = 0; this->expr_pointers = vector<Expr*>(); this->token_pointers = vector<Token*>(); this->stmt_pointers = vector<Stmt*>(); } bool MBoxParser::match(tokenType tt){ return (...
ALGO
0.96737
5.000433
59859c64-c549-4076-86fc-900a785c8e40
lucifer1004/kickstart-cpp
nowcoder/Tree_Recovery/main.cpp
#include <iostream> #include <vector> #include <array> #include <string> #define CAPACITY 200001 using namespace std; class SegmentTree { int n, h; array<int, CAPACITY> d{}, t{}; void calc(int p, int k) { if (d[p] == 0) t[p] = t[p << 1] + t[p << 1 | 1]; else t[p] = d[p] * k; } void apply(int p, i...
ALGO
0.997134
5.538076
9e1bda09-2f89-4178-97ae-38d1ce3444d6
SohithPenumajji/codespace
DSA/Array_ADT/DuplicatesInUnsortedArray/main.cpp
#include <iostream> using namespace std; int main() { int Arr[10] = {8,3,6,4,6,5,6,8,2,7}; int n = 10; int i; for(i=0; i<n-1; i++) { int count_dup = 1; if(Arr[i] != -1) { for(int j=i+1;j<n-1;j++) { if(Arr[i] == Arr[j]) { ...
ALGO
0.991428
3.649033
06e69dba-0905-43a6-9153-3c87b8e419f4
jdart1/arasan-chess
src/chess.cpp
#include "chess.h" #include "board.h" #include "bitboard.h" #include <cstddef> #include <cstring> #include <iostream> #include <iomanip> const int CACHE_ALIGN Files[64] = { 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3,...
CONFIG
0.936368
6.097208
b0498ad6-c2b9-494f-a3ac-b1263a9c19e1
Koldar/compressed-path-database
src/main/cpp/cpd.cpp
#include "cpd.hpp" #include <fstream> #include <stdexcept> #include <cassert> #include <cpp-utils/log.hpp> #include <cpp-utils/operators.hpp> namespace compressed_path_database { // compile with -O3 -DNDEBUG static unsigned char find_first_allowed_out_arc(unsigned short allowed){ assert(allowed != 0); for(int i=...
ALGO
0.993705
3.828988
a74391d2-fe9f-4a63-bf4e-7e9e5203e380
ishandutta2007/codeforces
inafstream/normal/1041/B.cpp
#include <bits/stdc++.h> #define rdst(st,len) {char ss[len];scanf("%s",ss);(st)=ss;} using namespace std; long long a,b,c,d,e; int main() { cin>>a>>b>>c>>d; e=__gcd(c,d); c/=e;d/=e; cout<<min(a/c,b/d)<<endl; return 0; }
ALGO
0.99986
3.66217
76c8482f-a5bd-4e70-b310-6e754eab8609
jk1ash/LeetCode
438.找到字符串中所有字母异位词.cpp
/* * @Author: jklash * @Description: 找到字符串中所有字母异位词 * @Date: 2021-11-28 12:24:32 * @LastEditors: jklash * @LastEditTime: 2021-11-29 10:14:18 */ /* * @lc app=leetcode.cn id=438 lang=cpp * * [438] 找到字符串中所有字母异位词 */ #include <iostream> #include <vector> #include <algorithm> using namespace std; // @lc code=start ...
ALGO
0.999554
6.131014
4d601ff3-38b2-455a-a2df-d713ea70d4ba
NaderEG/competitive-programming
leetcode/cpp/targetSum.cpp
class Solution { public: int findTargetSumWays(vector<int>& nums, int target) { int sum = 0; for(int num : nums) sum += num; if(target < -sum || target > sum) return 0; map<int, vector<int>> dp; for(int i = -sum; i <= sum; ++i) { dp[i].resize(nums.size()+1, 0); ...
ALGO
0.99999
6.050714
d45b96de-4483-444f-bab9-cd78a915bbec
vipinkarthic/My-Cp-journey
START116D.cpp
#include "bits/stdc++.h" using namespace std; #define max(a, b) (a < b ? b : a) #define min(a, b) ((a > b) ? b : a) #define mod 1e9 + 7 #define FOR(a, c) for (int(a) = 0; (a) < (c); (a)++) #define FORL(a, b, c) for (int(a) = (b); (a) <= (c); (a)++) #define FORR(a, b, c) for (int(a) = (b); (a) >= (c); (a)--) #define INF...
ALGO
0.999907
3.162966
fe8e5528-cd8a-4d90-8a73-47a6d95d85f8
thegamer1907/Code_Analysis
Codes/AC/370.cpp
#include <bits/stdc++.h> using namespace std; bool good(int x){ int sum = 0; while(x){ sum += x % 10; x /= 10; } return sum == 10; } main() { ios_base::sync_with_stdio(false); int k; cin >> k; for(int i = 1; ; i++){ if(good(i)) k--; if(k =...
ALGO
0.999794
4.645043
b2062a2c-62af-4c58-af0c-e992f4edc620
mostafaessayd/codeforces-solutions
1200/Stripe/main.cpp
/** created by : cidi mohamed mostepha link : https://codeforces.com/contest/18/problem/C rating : 1200 */ #include <bits/stdc++.h> using namespace std; using ll = long long; const ll N = 1e5; void answer() { int n; cin >> n; vector<int> vec(n); int tot = 0; for(int& val : vec) { cin >> v...
ALGO
0.99975
4.802226
4d83c5ae-6c7f-4fe4-bffa-e40c945ac4ec
Monjur3175/Programming
Data Structure and Algorithm/5.Sorting.cpp
#include <iostream> #include <vector> #include <algorithm> #include <cmath> using namespace std; // ========== SORTING ALGORITHMS ========== // 1. Bubble Sort - O(n^2) void bubbleSort(vector<int>& arr) { int n = arr.size(); for (int i = 0; i < n-1; i++) { bool swapped = false; for (int j = 0; ...
ALGO
0.999961
5.698663
69f10c7e-9b38-4635-8340-cf7a4bf51a32
MetalPizzaCat/Engine_OpenGL
OpenGLEngineProto/glm/test/core/core_func_integer_bit_count.cpp
// This has the programs for computing the number of 1-bits // in a word, or byte, etc. // Max line length is 57, to fit in hacker.book. #include <cstdio> #include <cstdlib> //To define "exit", req'd by XLC. #include <ctime> unsigned rotatel(unsigned x, int n) { if (static_cast<unsigned>(n) > 63) { std::printf("r...
ALGO
0.998859
4.846448