uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
cb8ec4dc-2666-48c5-abf1-057696ced7c2
dev-jb-007/dev-cp
a.cpp
#include<bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> //#define pbds tree<ll, null_type, less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update> //using namespace __gnu_pbds; using namespace std; typedef long long ll; typedef double db; typedef long double lld...
ALGO
0.999806
3.476239
d7aa842e-4d40-49fd-b8dc-8b23facc4bf0
Moyu0730/CP-Question-Record
CSES/1753. String Matching.cpp
/* Question : CSES 1753. String Matching */ #include<bits/stdc++.h> using namespace std; #define opt ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define pirq(type) priority_queue<type, vector<type>, greater<type>> #define mem(x, value) memset(x, value, sizeof(x)); #define pii pair<int, int> #define pdd...
ALGO
0.999977
4.364184
a0d39eb4-d0bc-443e-8c29-846fee74b502
sarvex/leetcode-harbour
solution/0700-0799/0736.Parse Lisp Expression/Solution.cpp
class Solution { public: int i = 0; string expr; unordered_map<string, vector<int>> scope; int evaluate(string expression) { expr = expression; return eval(); } int eval() { if (expr[i] != '(') return islower(expr[i]) ? scope[parseVar()].back() : parseInt(); int...
ALGO
0.999618
5.505544
5a7294eb-8fca-4967-b160-e196327fb8bc
PhuocVinhLee/system_exam_quiz_programming
online_exam_system_backend/temp/3y10yy19.cpp
#include <stdio.h> int main() { int number1, number2, sum; // printf("Enter two integers: "); scanf("%d %d", &number1, &number2); // calculate the sum sum = number1 + number1; printf("%d", sum); return 0; }
TOOL
0.983691
3.579273
b0037a55-82cc-4c17-89e6-d49fbab86535
acorovic1/Dardaneli
libraries/include/unsupported/doc/examples/MatrixPower.cpp
#include <unsupported/Eigen/MatrixFunctions> #include <iostream> using namespace Eigen; int main() { const double pi = std::acos(-1.0); Matrix3d A; A << cos(1), -sin(1), 0, sin(1), cos(1), 0, 0 , 0 , 1; std::cout << "The matrix A is:\n" << A << "\n\n" "The matrix power A^(pi/4) is:\n"...
ALGO
0.999915
3.790203
a3f4ecdf-7f33-429c-a287-7fb7b0ca4b1f
stone725/AOJ-SourceCode
Volume 11/1124.cpp
#include <bits/stdc++.h> using namespace std; #define FOR(i, s, n) for(int i = s; i < (int)n; i++) #define per(i, n) for(int i = n; i >= 0; i--) #define ROF(i, s, n) for(int i = s; i >= (int)n; i--) #define FORIT(i, A) for (auto i : A) #define PRINT(x) cout << (x) << "\n" #define ALL(a) (a).begin(),(a).end() #define RA...
ALGO
0.999918
4.113122
2d2cafd6-3e30-48b3-8691-2c9b437f55e9
moonbuck/EssentiaSwift
CommonSource/C++/algorithms/spectral/flux.cpp
#include "flux.h" #include "essentiamath.h" using namespace std; using namespace essentia; using namespace standard; const char* Flux::name = "Flux"; const char* Flux::category = "Spectral"; const char* Flux::description = DOC("This algorithm computes the spectral flux of a spectrum. Flux is defined as the L2-norm [1...
TOOL
0.988352
6.104292
3cc21ceb-2ace-44b8-b481-ef13ecf0ec7e
ShammiAnand/cp-problemset
CF-493B.cpp
//This code is written by Shammi Anand #include<bits/stdc++.h> using namespace std; #define ll long long #define Max(a,b,c) max(a,max(b,c)) #define Min(a,b,c) min(a,min(b,c)) #define pb push_back #define mp make_pair #define f first #define s ...
ALGO
0.999998
4.122012
b85b6e69-cd88-4cd9-be04-34c570ffbc56
namhn89/algorithm
spoj/VOJ_crawler/namnguyen123/DHLOCO[18157329][RESULT_100][TIME_0.00][MEM_3472][2016-11-11_13-11-52].cpp
using namespace std; #include<bits/stdc++.h> #define st first #define nd second #define FOR(i,a,b) for(int i=(a),b_=(b);i<b_;++i) #define FORD(i,a,b) for(int i=(a),b_=(b);i>=b_;--i) #define FORE(i,a,b) for(int i=(a),b_=(b);i<=b_;++i) #define TR(c, it) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); it++) #defi...
ALGO
0.999979
3.866338
c12e32ff-a1d3-4c92-a320-68a177c6bbba
gtkn/atcoder
ABC_224_C_3.cpp
//title #include <bits/stdc++.h> using namespace std; //#include <atcoder/all> //using namespace atcoder; #define rep(i,n) for (ll i = 0; i < (n); ++i) #define rep1(i,n) for (ll i = 1; i <= (n); ++i) #define repr(i,n) for (ll i = (n)-1; i >= 0; --i) #define rep1r(i,n) for (ll i = (n); i > 0; --i) #define bit(n,k) ((n>>...
ALGO
0.999929
4.754867
203f8a1d-c7ec-4514-870e-6c1f0c310d68
schen2315/q-learning-tetris
algo_hashed_test.cpp
#include "algo_hashed.hpp" #include <string> #include <iostream> #include <cmath> #include <set> #include <time.h> #include <fstream> using namespace std; Model::Model(int bbits, int pbits) { this->bbits = bbits; this->pbits = pbits; this->gamma = 0.8; this->ep = 100; }; Model::Model(string file) { this->bbits =...
ALGO
0.999351
5.409738
c18aeb99-360a-4a7c-80da-7ed071424897
ishandutta2007/codeforces
zemen/normal/587/A.cpp
#include <bits/stdc++.h> using namespace std; #define sz(x) ((int) (x).size()) #define forn(i,n) for (int i = 0; i < int(n); ++i) #define forab(i,a,b) for (int i = int(a); i < int(b); ++i) typedef long long ll; typedef long double ld; const int INF = 1000001000; const ll INFL = 2000000000000001000; int solve(); in...
ALGO
0.999835
3.976737
f5c86a06-66bf-4d56-a91b-af0f6656d16e
anmolranjan1/6Companies30days
Atlassian/455_Assign_Cookies.cpp
class Solution { public: int findContentChildren(vector<int>& g, vector<int>& s) { ranges::sort(g); ranges::sort(s); int i = 0; for (int j = 0; j < s.size() && i < g.size(); ++j) if (g[i] <= s[j]) ++i; return i; } };
ALGO
0.999551
6.220062
743d3bd1-1059-48c0-a60e-73c92e2717cf
ash1247/CodeBlocksLinux
UVA/Solved/UVA12468.cpp
#include <bits/stdc++.h> int main(void) { int a, b, sol1, sol2; while(scanf("%d %d", &a, &b)) { if(a==-1 & b==-1) break; if(a > b) { sol1 = a-b; sol2 = b-a+100; } else { sol1 = b-a; sol2 = a-b+100; ...
ALGO
0.99943
3.304428
062e4d01-8c08-4771-9e7d-717aafd61506
ahsan-abdul/my-1st-rep
task 4.cpp
#include <iostream> using namespace std; int main() { int n = 20; cout << " even numebrs between 1 and 20" << endl; for (int i= 2; i <=n ; i=i+2) { cout << i << " "; } cout << endl; cout << "all odd numbres between 1 and 20" << endl; for (int i = 1; i<=n; i=i+2) { cout << i << " "; } return 0; }
ALGO
0.916385
3.737332
ed5c4428-0d96-43a6-95f5-7027c28c6d2b
linkeLi0421/llvm-project15-IRDumperPass
llvm/lib/XRay/Profile.cpp
#include "llvm/Support/DataExtractor.h" #include "llvm/Support/Error.h" #include "llvm/Support/FileSystem.h" #include "llvm/XRay/Trace.h" #include <deque> #include <memory> namespace llvm { namespace xray { Profile::Profile(const Profile &O) { // We need to re-create all the tries from the original (O), into the cu...
TOOL
0.920963
6.773438
58d74e64-e816-4f16-b8a6-fef1fad74d03
rajyan/AtCoder
study/blue/ARC050-B.cpp
//#ifdef _DEBUG //#include "../../../library/src/debug_template.hpp" //#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__) //#else //#define DMP(...) ((void)0) //#endif // //#include <cassert> //#include <cstdio> //#include <cmath> //#include <iostream> //#include <iomanip> //#include <vector> //#include <set> //#include ...
ALGO
0.998903
3.870666
b6d1dcdc-2f12-4fba-8324-4453434e48e9
sergioxnieto/8Puzzle
main.cpp
#include "problem.hpp" #include "solver.hpp" #include "node.hpp" #include <cctype> #include <stack> int main() { Problem puzzle; puzzle.Init(); Solver solve; if (!solve.IsSolvable(puzzle)) { std::cout << "\nThis puzzle cannot be solved." << std::endl; return -1; } std::cout <<...
ALGO
0.999545
5.423367
23fc32c6-3b28-4856-9464-afacc1259878
alexandraback/datacollection
solutions_5658571765186560_1/C++/gulshan1994/a.cpp
#include <vector> #include <string> #include<fstream> #include<stdio.h> #include<stdlib.h> #include<string.h> #include<set> #include<string> #include<iostream> #include<algorithm> #include<queue> #include<cmath> using namespace std; int pancake(vector<int>& arr) { //multiset<int>::iterator it; int i; sort(...
ALGO
0.999891
3.887721
ecf600d5-28d2-4d00-8c2a-16f1bb1f7561
ElenoMome/atcoder
grand/28/A.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <stack> #include <queue> #include <cmath> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define SZ(x) ((int)(x).size()) //unsignedのサイズをint型に変換 #define dump(x) cerr << #x << " = " << (...
ALGO
0.999983
3.623202
8a66a193-ccfb-400a-b79c-942d45eed02c
emilyzfliu/usaco_cpp
lonesome2.cpp
#include <algorithm> #include <fstream> #include <iostream> #include <string> #include <climits> #include <unordered_set> #include <unordered_map> #include <map> #include <set> #include <vector> #include <utility> #include <cmath> #include <iomanip> #include <queue> #include <chrono> #include <bitset> #include <stack> ...
ALGO
0.999943
4.681806
d301c8c3-2771-4a30-bf69-ac03bab53bc5
KasarLooper/tsols
2_prefsums_2pointers/a.cpp
#include <iostream> using namespace std; int main() { int n, q; cin >> n; long long* a = new long long[n]; for (int i = 0; i < n; i++) cin >> a[i]; long long* pref = new long long[n+1]; pref[0] = 0; for (int i = 0; i < n; i++) pref[i+1] = pref[i] + a[i]; cin >> q; ...
ALGO
0.99987
4.52085
0b59b4ea-f01a-4f89-9e97-286c61face74
bipinyct/Striver_DSA_Sheet
0200-number-of-islands/0200-number-of-islands.cpp
class Solution { public: void bfs(int row, int col, vector<vector<char>>& grid, vector<vector<int>>& vis) { int n = grid.size(); int m = grid[0].size(); vis[row][col] = 1; // starting point queue<pair<int, int>> q; q.push({row, col}); while (!q.empty()) {...
ALGO
0.99998
6.658961
01743f3f-0b75-453d-b2fb-2d4379052341
satse13/SplayTree
SplayTree/Generador.cpp
#include "SplayTree.h" #include <time.h> #include <iomanip> #include <fstream> #include <vector> #include <set> using namespace std; void generar(); void opInsert(); void opFind(); void opErase(); void InsertaElems(int valor); void InsertaElem(int valor); void BuscaElem(int valor); void BorraElems(int valor); void Bor...
ALGO
0.993559
3.32955
416f146c-ed02-4c9e-bd19-a3216b37bea7
raincross7/code-similarity
codes/train_code/problem368/problem368_262.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define fi first #define se second #define pb push_back int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll a, b, k; cin >> a >> b >> k; if (k <= a) { cout << a - k << " " << b; } else { k -= a; a = 0; b -...
ALGO
0.999935
4.047299
a32485ff-f5d5-4001-b1b5-10f206ff1279
RGugelmeier/GAME258_Engine
GAME258_Engine/Engine/Core/OctSpatialPartition.cpp
#include "OctSpatialPartition.h" //Redeclare and define childNum. int OctNode::childNum = 0; //Initialise values. OctNode::OctNode(vec3 position_, float size_, OctNode* parent_) : octBounds(nullptr), parent(nullptr), children(), objectList(vector<GameObject*>()) { //Change this if there will be more objects in a sce...
ALGO
0.973468
6.405757
85a9d20a-3866-4107-be3b-99fd0e590ac7
sriramsanthosh/LeetCode
Reverse a linked list - GFG/reverse-a-linked-list.cpp
//{ Driver Code Starts //Initial Template for C++// C program to find n'th Node in linked list #include <stdio.h> #include <stdlib.h> #include<iostream> using namespace std; /* Link list Node */ struct Node { int data; struct Node *next; Node(int x) { data = x; next = NULL; } }; //...
ALGO
0.999844
5.93537
0ecbc018-8277-4fea-966f-c920e2819ced
solareenlo/atcoder
05_AtCoder-Beginner-Contest/abc130/C/main.cpp
#include <bits/stdc++.h> using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); double w, h; cin >> w >> h; double x, y; cin >> x >> y; double ans = w * h / 2; if (x == w / 2 && y == h / 2) printf("%.10f 1\n", ans); else printf("%.10f 0\n", ans); return 0; }...
ALGO
0.999509
3.611957
28eb28d4-b3ab-4235-a03a-649ae466db5f
MichaelSedrak/Interactive-ARAP
ARAP/libs/libigl-2.2.0/tutorial/710_SCAF/main.cpp
#include <igl/scaf.h> #include <igl/arap.h> #include <igl/boundary_loop.h> #include <igl/harmonic.h> #include <igl/map_vertices_to_circle.h> #include <igl/readOBJ.h> #include <igl/Timer.h> #include <igl/opengl/glfw/Viewer.h> #include <igl/MappingEnergyType.h> #include <igl/doublearea.h> #include <igl/PI.h> #include <ig...
ALGO
0.952744
5.712649
8e8537c2-3945-4805-be2c-a1debe67b1b8
CollegePR/OpenCV_BodyDetecting
BodySizeMeasurement/BodySizeMeasurement/opencv/sources/modules/imgproc/src/moments.cpp
#include "precomp.hpp" #include "opencl_kernels_imgproc.hpp" namespace cv { // The function calculates center of gravity and the central second order moments static void completeMomentState( Moments* moments ) { double cx = 0, cy = 0; double mu20, mu11, mu02; double inv_m00 = 0.0; assert( moments != 0...
ALGO
0.998865
5.473548
8b2d17f2-d9d0-4feb-8946-074752f923eb
samyak2405/MY-LeetCoding
2074-reverse-nodes-in-even-length-groups/2074-reverse-nodes-in-even-length-groups.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* reverseEven...
ALGO
0.999952
5.815703
0b59f50b-f221-40c4-b0f9-56bb8823e38d
singhtaran1005/c-programs---Hacktoberfest2021
spoj/tdprimes.cpp
// * AUTHOR :: TARANPREET {SINGH} CHABBRA *// //* {CODE : CODEFORCES} *// #include <algorithm> #include <bits/stdc++.h> #include <cctype> #include <string> #define SIZE 100008 #define mod (ll)(1e9 + 7) #define vi vector<int> #define INF 0x3f3f3f3f #define max(a, b) (a > b ? a : b) #define min(a, b) (a < b ? a : b) #d...
ALGO
0.998209
4.058102
90863021-8673-4bdd-ade6-f2069bc95ba4
Dfkuaid/My_Files
cpp/Practice/Codeforces/CF1283F/main.cpp
#define LOCAL #include <bits/stdc++.h> #define ll long long using namespace std; const int N = 200010; const int INF = 0x3f3f3f3f; template <typename T> inline void read(T &x) { x = 0; int f = 1; char c = getchar(); for (; !isdigit(c); c = getchar()) if (c == '-') f = -f; for (; isdigit(c); c = getchar())...
ALGO
0.999957
3.250539
4cf02ab4-441b-46e2-81bb-c86f6205dc9d
sidmaitra/dsa
arr1.cpp
#include<iostream> using namespace std; class Solution{ public: int search(int arr[], int N, int X) { for(int i=0;i<N;i++){ if(arr[i] == X){ return i; } } return -1; } }; int main() { Solution ob; int a[5]= {1,2,3,4,...
ALGO
0.999863
4.895935
7d936dce-5ac9-4d2f-ad59-375d30836ddd
JeremyARussell/box2d
Box2D/Box2D/Rope/b2Rope.cpp
#include <Box2D/Rope/b2Rope.h> #include <Box2D/Common/b2Draw.h> b2Rope::b2Rope() { m_count = 0; m_ps = NULL; m_p0s = NULL; m_vs = NULL; m_ims = NULL; m_Ls = NULL; m_as = NULL; m_gravity.SetZero(); m_k2 = 1.0f; m_k3 = 0.1f; } b2Rope::~b2Rope() { b2Free(m_ps); b2Free(m_p0s); b2Free(m_vs); b2Free(m_ims); ...
ALGO
0.996582
6.29539
5bde634c-3ce3-41ce-9155-0ccca325eb86
youssef7ussien/problemsolving-space
problems/CSES/Sorting and Searching/1644 - Maximum Subarray Sum II/CSES_1644.cpp
/** * Title: "Maximum Subarray Sum II", CSES problem. * Date: Wednesday, 23 March 2022 * */ #include <bits/stdc++.h> using namespace std; #define ALL(v) ((v).begin()), ((v).end()) #define R_ALL(v) ((v).rbegin()), ((v).rend()) #define SIZE(v) ((int)((v)...
ALGO
0.999008
4.227494
20c2d7f0-a346-48b6-aaa3-88c7eb3cc484
RalinaSafina/Cpp
Barbershop_problem/Barbershop_problem/Barbershopproblem.cpp
#include "stdafx.h" #include <windows.h> #include <stdio.h> #include <iostream> #include <queue> using namespace std; HANDLE chairs, ready, leave; DWORD WINAPI Visitor(LPVOID); DWORD WINAPI Barber(LPVOID); queue <int> table1, table2; HANDLE /* visitor, */ *haircut_end; HANDLE mutex1, mutex2; //mutex for 1st table and...
ALGO
0.985642
3.634638
99e7b7bc-6d80-4350-aa26-d171ce72772a
ergenekonyigit/Numerical-Analysis-Examples
C++/forward_difference/forward_difference.cpp
//forward difference #include <iostream> using namespace std; int main() { int i, j, n; // Input Section cout << "Enter number of data points: "; cin >> n; // Allocate the arrays float *x = new float[n]; float *y = new float[n * n]; // Get the first x cout << "Enter the lowest value of x i.e. x[0...
ALGO
0.999958
4.386926
d443f860-0558-4158-88e5-5d0875c66341
dvbuiilds/dsa-prep
DP/Longest Palindromic Subsequence.cpp
/** * @file Longest Palindromic Subsequence * @author @dvbuiilds * @brief * @version 0.1 * @date 2022-05-18 * @link https://practice.geeksforgeeks.org/problems/longest-palindromic-subsequence-1612327878/1/# @endlink * @copyright Copyright (c) 2022 * */ /* Given a String, find the longest palindromic subseque...
ALGO
0.99999
6.583451
49e1c277-105e-40f9-8bca-11083f8575d3
prehans/LeetCode-Solution
623-add-one-row-to-tree/623-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.999995
6.318738
117554b9-0bf1-42fc-9e65-4ac7b65d503b
Productivity236/Portfolio-
C++/Patterns/Pattern 4.cpp
#include <iostream> using namespace std; int main() { int n; cin>>n; for(int a=1;a<=n;a++) { for(int b=1;b<=a;b++) { cout<<(a); } cout<<(endl); } return 0; }
ALGO
0.999815
3.654898
1fe05b37-37ef-47ef-b80b-df88a0853c60
shimanshu16/LeetCode-Solved-Questions
0037-sudoku-solver/0037-sudoku-solver.cpp
class Solution { private: bool isThisPlacementValidAtThisIndex(vector<vector<char>>& board, int row, int col, char placement) { for(int i = 0; i < 9; i++) { if(board[i][col] == placement) { return false; } if(board[row][i] == placement) { ...
ALGO
0.999657
6.882199
e532862a-e034-46f0-8850-a6860c8fb1fc
Wherysson-Eduardo-Santana/Projetos-C
inverString.cpp
#include <iostream> #include <string> using namespace std; int main() { setlocale(LC_ALL, ""); string str; cout << "Digite uma string: "; getline(cin, str); int n = str.length(); for (int i = 0; i < n / 2; i++) { char temp = str[i]; str[i] = str[n - 1 - i]; str[n - 1 - i...
ALGO
0.998711
5.522357
ff2b7044-03b0-4825-817d-c58a58df07c8
Ranshu26/DE_Flutter
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998859
6.785645
8f208c9a-3cb2-4d04-9ff6-cac8839e8535
inf0craw1/algorithm
archives/2115/20240221_034023_main.cpp
#include <bits/stdc++.h> #define debug if constexpr (local) std::cout #define endl '\n' #define inf 0x3f3f3f3f #define linf 0x3f3f3f3f3f3f3f3f #define fi first #define se second #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() using namespace std; #ifdef LOCAL constexpr bool local = true; #else ...
ALGO
0.999933
4.220822
8639f1c1-0401-4f76-80f8-96809f9672f9
misbahulhoque/UVA-Code
11727(CostCutting).cpp
#include<stdio.h> #include<algorithm> using namespace std; int main() { long int num[3],i,j,test; scanf("%ld",&test); for(i=1;i<=test;i++) { for(j=0;j<3;j++) scanf("%ld",&num[j]); sort(num,num+3); printf("Case %ld: %ld\n",i,num[1]); } return 0; }
ALGO
0.999453
3.180443
96e84b3f-dee5-4345-a295-39196a23ec80
ashikapl/DSA
Recursion(week-7)/Assignments/printSubary.cpp
// print all subarray using RE #include <iostream> #include <vector> using namespace std; void printSubarray_util(vector<int> &num, int start, int end) { // base case if (end == num.size()) { return; } for (int i = start; i <= end; i++) { cout << num[i] << " "; } cout <...
ALGO
0.994341
5.205932
24bd4ec2-dcbf-4e7c-90d5-9a08d04c4ba9
taybartemes/trivia
C++/GameRunner.cpp
#include <stdlib.h> #include "Game.h" static bool notAWinner; int main() { Game aGame; aGame.add("Chet"); aGame.add("Pat"); aGame.add("Sue"); do { aGame.roll(rand() % 5 + 1); if (rand() % 9 == 7) { notAWinner = aGame.wrongAnswer(); } else { notAWinner = aGame.wasCorrectlyAnswered(); } }...
TOOL
0.963239
3.203031
da64a96b-6006-46e9-92c6-b9c1b935a605
yash-1104github/DSA-Leetcode
2425. Bitwise XOR of All Pairings.cpp
class Solution { public: int xorAllNums(vector<int>& nums1, vector<int>& nums2) { int ans1 = 0; int n = nums1.size(); int m = nums2.size(); if(n%2 == 0 && m%2 == 0 )return 0 ; for(int i = 0; i < nums1.size(); i++) { ans1 = ans1 ^ nums1[i]; } ...
ALGO
0.999991
5.585536
d0860648-0187-40b1-ba4a-addfb44dd3a3
huntterrr/eolymp
00219.cpp
#include<iostream> #include<iomanip> #include<cmath> using namespace std; int main() { long long a, b, c, d; cin >> a>> b>> c>>d; long long v = a * b * c; cout<<setprecision(20) << ceil((long double)v / d); }
ALGO
0.999117
3.135597
54f51a11-e570-47af-8fb4-d20a3e0836fe
LeonelAGonzalez/Appsmoviles
Continental/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.998787
6.76073
5a6f8416-9e90-4fad-9e66-7b2fe7ac6c86
kkyehit/AlgoPratics
Fence.cpp
#include<stdio.h> #include<iostream> #include<vector> using namespace std; void test (vector<int> &a, int begin, int size){ for(int i = begin; i < size; i++) cout<< a[i]<<" "; cout<<endl; } int max(int a, int b){ if(a>b) return a; return b; } int min(int a, int b){ if(a<b) return a; return b; } int search...
ALGO
0.999734
4.083617
23ac21d5-5530-4b4f-aff5-b8de04e72d49
NitrogenEmulator/Nitrogen
desmume/src/android/7z/CPP/7zip/Compress/Rar3Decoder.cpp
#include "StdAfx.h" #include "../Common/StreamUtils.h" #include "Rar3Decoder.h" namespace NCompress { namespace NRar3 { static const UInt32 kNumAlignReps = 15; static const UInt32 kSymbolReadTable = 256; static const UInt32 kSymbolRep = 259; static const UInt32 kSymbolLen2 = kSymbolRep + kNumReps; static const By...
TOOL
0.915582
4.292282
aa99c192-4d6d-4506-ae3d-533f2d5250d8
NitaiBanik/LeetCode
2116-check-if-a-parentheses-string-can-be-valid/2116-check-if-a-parentheses-string-can-be-valid.cpp
class Solution { public: bool canBeValid(string s, string locked) { cout<<s.size()<<endl; if(s.size() % 2) return false; stack<char>st; int cn = 0; for(int i = 0 ; i < s.size(); i++){ if(locked[i] == '1'){ if(s[i] == '(') st.push(s[i]); ...
ALGO
0.999473
5.211596
81968791-45ea-4197-bf66-ca1eff4b2604
adityapadwal/Data-Structures-And-Algorithms
DSA_Sheet/Binary Trees/175_check_if_tree_is_balanced_or_not.cpp
//{ Driver Code Starts //Initial Template for C++ #include <bits/stdc++.h> using namespace std; // 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; temp->left = NULL; ...
ALGO
0.999777
6.892112
088b0729-0576-490e-b48f-9293dbed277f
Oscar-Cabr/CompetitiveProgramming
Codeforces/800-900/1850C - Word on the Paper.cpp
/* The following is an original solution to the problem: 1850-C "Word on the Paper" of Codeforces. Rated difficulty: 800. Language: C++20 (GCC 13-64). This solution isn't secured as "the most efficient one", but it is secured as an Accepted one under the given constraints. Techniques / Topics involved: ...
ALGO
0.994828
4.815391
bbdd0910-3a3e-4415-bc2e-58321a6f5df3
adabingw/leekcode
two_pointer/809_expressive_words.cpp
class Solution { public: int expressiveWords(string s, vector<string>& words) { int res = 0; for (auto word : words) { if (stretch(word, s)) res++; } return res; } bool stretch(const string& word, const string& target) { int i = 0, j = 0; while...
ALGO
0.999841
6.22694
3e9385bd-8bee-4e66-a267-887b48487412
wsldwo/CPlusPlus
Others/sort.cpp
#include <iostream> #include <cstdlib> #include <ctime> using namespace std; /* default_random_engine re(time(0)); uniform_int_distribution <unsigned> dis(0,10);// for(int i = 0;i < 10;i++) cout << dis(re) << " "; */ void quick_sort_recursive(int arr[],int l,int r)//· { if(l < r) { swap(arr[l],arr[l + rand() % (r ...
ALGO
0.999467
3.885466
45fb0cdf-f21b-4604-ba65-a4f0679acc27
JangKeon/BOJ
BOJ_Class3/ATM.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(void) { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int N, num; vector <int> vec; cin >> N; for (int i = 0; i < N; i++) { cin >> num; vec.push_back(num); } sort(vec.begin(), vec.end()); int result = 0; for...
ALGO
0.9998
4.116666
e9c77dda-2860-4296-b808-607b80771564
RajaKunalPandit1/Leetcode_Questions
Remove duplicate element from sorted Linked List - GFG/remove-duplicate-element-from-sorted-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; } }; void print(Node *root) { Node *temp = root; while(temp!=NULL) { cout<<temp->data<<" "; temp=temp->next; } } Node* removeDupl...
ALGO
0.999602
5.884667
25ecb44c-db16-404b-9765-5e29a3618fda
JanLouisP/done_intern
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998859
6.785645
db180a7d-2c1a-4faf-8fda-9510ad0346e2
shafeenyousafzaii/Operating-System-Theory
Assignments/second.cpp
#include <iostream> #include <pthread.h> using namespace std; // Structure to hold arguments for the operations struct OperationArgs { int a; int b; }; // Function to perform addition void* add(void* arg) { OperationArgs* args = static_cast<OperationArgs*>(arg); int result = args->a + args->b; co...
ALGO
0.928674
6.197969
d683666d-6cae-4078-ba5b-9e4c560031f5
electron224/DS_ALGO
Recursion/DavisStaircase.cpp
int stepPerms(int n) { if(n<0) return 0; if(memo[n]) return memo[n]; if(n==0) return 1; int left = stepPerms(n-1); int right = stepPerms(n-2); int middle = stepPerms(n-3); memo[n] = left + right + middle; return memo[n] % si; }
ALGO
0.999986
3.90785
9e2972e4-4ef5-4c63-8eec-71a3b250a3c7
ChakrabortyRajarshi2005/Codeforces
A. The New Year: Meeting Friends.cpp
A. The New Year: Meeting Friends time limit per test1 second memory limit per test256 megabytes There are three friend living on the straight line Ox in Lineland. The first friend lives at the point x1, the second friend lives at the point x2, and the third friend lives at the point x3. They plan to celebrate the New Y...
ALGO
0.999979
4.739631
3ff432ff-85db-43f5-85c9-69b275363134
BodhiDog/OJCode
Luogu/P1332.cpp
#include <bits/stdc++.h> using namespace std; const int R = 510, M = 1e5 + 10, xx[4] = {0, 1, 0, -1}, yy[4] = {1, 0, -1, 0}; struct Pos { int x, y; }; int mp[R][R], b[M][2]; queue<Pos> q; #define inmap(x, y) (x >= 1 && x <= n && y >= 1 && y <= m) int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ...
ALGO
0.999794
4.617152
279fc941-2ff6-4454-ad04-6bfd39c54797
joy-mollick/Segment-Tree-And-Divide-And-Conquer
Uva-12086 - Potentiometers(BIT).cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; // Time Complexity O(nlogn) const int MAXN = 200002; int BIT[MAXN], A[MAXN],B[MAXN]; int below_still(int idx){ int sum = 0; while (idx > 0){ sum += BIT[idx]; idx -= (idx & -idx); } return sum; } void update(int idx ,int val){ while (idx <...
ALGO
0.999777
4.164554
fc50a6d0-40df-4ee0-a9b0-e35e429d0771
shakti2000/Leetcode-and-GFG-Solutions
1328-break-a-palindrome/1328-break-a-palindrome.cpp
class Solution { public: string breakPalindrome(string s) { if(s.length()==1)return ""; for(int i=0;i<s.length()/2;i++){ //if(i==(s.length()-i))conitnue; if(s[i]!='a'){s[i]='a';return s;} } for(int i=s.length()-1;i>=s.length()/2;i--){ //if(i==(s.lengt...
ALGO
0.995071
4.233754
210c8f29-2a94-4bd8-b553-49c96b032ddb
MOHIT-IITP/Leetcode
27_1done.cpp
// by void function the answer is correct #include<bits/stdc++.h> #include<iostream> using namespace std; // the main problem is that in leetcode this function is in int void removeElement(vector<int>& nums, int val) { for(int i=0;i<nums.size();i++) { if(nums[i]==val) { nums.erase(nums.begin()+i); ...
ALGO
0.999876
5.58106
496e0cf0-ba9a-4796-86d1-b288e1e41e72
HumanHyeon/Algorithm_Book
archive/SeHyeon/21.02.07 Coding Practice No.40(isstream, bound).cpp
#include <string> #include <vector> #include <algorithm> #include <map> #include <sstream> using namespace std; map<string, vector<int>> table; vector<int> solution(vector<string> paraInfo, vector<string> paraQuery) { vector<int> answer; for(auto info : paraInfo) { string infoList[4][2] = { { "-", },...
ALGO
0.999723
4.623742
d023befc-e9c4-4f9b-8e8f-1c82e2a5eeff
Anakinliu/Projects
Stack/Stack/kuoHao.cpp
//#include <stdio.h> //#include <stdlib.h> //#define STACK_INIT_SIZE 100 //#define STACK_INCREMENT 10 //typedef struct aStack { // char *base; // char *top; // int size; //}SqStack, *LinkStack; //int InitStack(LinkStack S) { // S->base = (char *)malloc(STACK_INIT_SIZE * sizeof(char)); // if (!S->base) { // exit(-1);//...
ALGO
0.998768
3.408532
ff5b2608-db41-4939-8228-9ad69a92f092
luispozas/SolveAlgorithms
algorithm_problems/my_solutions/c24/c24.cpp
//LUIS POZAS PALOMO - EDA - BACKTRACKING(C24). #include <iostream> #include <algorithm> using namespace std; //POR QUE SOLO SALe CON NUMEROS IMPARES???????? const int MAX = 100; void printSol(int sol[], const int W){ for(int i = 0; i < W; i++) cout << sol[i] << " "; cout << endl; } void domino(int sol[], int k,...
ALGO
0.999819
4.418141
c123cdfb-d6fa-4ad9-8292-a1448e723d1d
MShverdiakov/all-labs-3-sem
Lab16_3sem/Lab16_3sem/Lab16_3sem.cpp
#include <iostream> #include "Header.h" #include "Complex.h" int main() { setlocale(LC_ALL, "Russian"); int n, m; Complex** arr = load_data<Complex>(n, m); cout << "Введите кратность" << endl; Complex mult; cin >> mult; bool flag; for (int i = 0; i < n; i++) { flag = isMultiple<C...
ALGO
0.998129
3.389869
31554ab6-75bd-4486-b814-9c0bc4513e12
AniketR10/DSA
Heaps/KthSmallestEle.cpp
//multiple methods hai but here heaps se karenge //m1 : builtin sort // m2 : selection sort // m3 :quick select algo(one of best) //m4: heap tc O(nlogk) #include<iostream> #include<queue> using namespace std; int main(){ int arr[]={10,20,-4,5,18,24,1,-7,56}; int n=sizeof(arr)/sizeof(arr[0]); int k=4; pr...
ALGO
0.999873
3.582923
19f08b60-4f2f-4898-b523-8ddb54094950
chumaachike/CPP_Challenge
challenge10.cpp
#include <iostream> #include <string> using namespace std; int main(){ string alphabet {"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"}; string key {"XZNLWEBGJHQDYVTKFUOMPCIASRxznlwebgjhqdyvtkfuompciasr"}; string s {}; string encrypted {}; string decrypted {}; cout<<"Please input a string to be enc...
ALGO
0.999857
4.293577
b7ccd8df-7675-4551-8f4a-fd2f5c6d3fcb
KeithRyden/gdal_test
gdal/frmts/hfa/hfacompress.cpp
#include "cpl_port.h" #include "hfa_p.h" #include <cstddef> #include "cpl_conv.h" #include "cpl_error.h" #include "cpl_vsi.h" #include "hfa.h" CPL_CVSID("$Id$") HFACompress::HFACompress( void *pData, GUInt32 nBlockSize, EPTType eDataType ) : m_pData(pData), m_nBlockSize(nBlockSize), m_nBlockCount((nBloc...
TOOL
0.893953
6.802649
d8b3831e-35f1-4897-9eb5-a43acd2cac68
rabelhmd/LeetCode
0463-island-perimeter/0463-island-perimeter.cpp
class Solution { public: int dir[5] = {0, 1, 0, -1, 0}; int islandPerimeter(vector<vector<int>>& grid) { int row = grid.size(), col = grid[0].size(), perimeter = 0; for(int r = 0; r < row; r++) { for(int c = 0; c < col; c++) { if(!grid[r][c]) continue; ...
ALGO
0.999877
6.277238
6dd72b23-2916-495c-b645-4bc5ee09929f
mfrancisc/hackerrank
algorithms/QuickSort2-Sorting.cpp
#include <map> #include <set> #include <list> #include <cmath> #include <ctime> #include <deque> #include <queue> #include <stack> #include <bitset> #include <cstdio> #include <vector> #include <cstdlib> #include <numeric> #include <sstream> #include <iostream> #include <algorithm> using namespace std; vector <int> Pa...
ALGO
0.999993
4.601213
513f2a1e-8224-4ce9-a356-5d5b09c12d7d
mannuds007/Data-Structures-Algoritms
Maths/bits/XOR_length.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int c; cin >> c; int bit_ct = (int)log2(c)+1; int a=0; int b=0; vector<int> set_bits; for (int i = 0; i < bit_ct; i++) { if(c & (1<<i)){ set_bits.push_back(i); } else{ a |=(1<<i...
ALGO
0.999975
4.713242
c776f1e2-9c1c-4b76-8a58-5f3f519d25c4
QbitQuantum/Basics
Исходники/CameraBehaviorVehicleSpline.cpp
void CameraBehaviorVehicleSpline::createSpline(const CameraManager::CameraContext &ctx) { splineClosed = false; splineLength = 1.0f; spline->clear(); splineNodes.clear(); for (int i = 0; i < ctx.mCurrTruck->free_camerarail; i++) { splineNodes.push_back(&ctx.mCurrTruck->nodes[ctx.mCurrTruck->cameraRail[i]]); ...
ALGO
0.903821
3.885572
79246d2c-87f8-4f21-9cbd-20da9c724f93
noman088/All-CPP-problems-with-Solution
24_Functions/05_TermInFibonacciSeries.cpp
// 5. Define a function to check whether a given number is a term in a Fibonacci series or // not. #include <iostream> using namespace std; void fibCheck(int number) { int a = -1, b = 1, c = 0; while (c < number + 1) { c = a + b; if (c == number) { cout <<number<< " is ...
ALGO
0.999586
3.901277
fe3e05fc-8c2e-4e93-bcd9-ebbb5bc90b78
Dup4/competitive-programming
codeforces/contest/1155/dd.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define N 300010 #define varName(x) #x #define DEBUG(...) \ { \ printf("# "); \ printf(__VA_ARGS__); \ puts(""); \ } int n, x; ll a[N], f[N][3]; int main() { while (...
ALGO
0.999721
3.671679
fb9387f6-7185-45a9-8e63-00dbc4b94435
marbl/MetaCarvel
OGDF/src/ogdf/planarity/ClusterPlanRep.cpp
#include <ogdf/cluster/ClusterPlanRep.h> #include <ogdf/orthogonal/OrthoRep.h> #include <ogdf/basic/simple_graph_alg.h> #include <ogdf/basic/extended_graph_alg.h> #include <ogdf/basic/Layout.h> #include <ogdf/basic/GridLayoutMapped.h> #include <ogdf/basic/tuples.h> #include <iomanip> enum edgeDir {undef, in, out}; n...
ALGO
0.93706
7.044977
2e155488-3c8b-4821-9238-8e97934a5282
manishdhungana111/practicee-c-
ascending11.cpp
#include<iostream> using namespace std; template <typename t> void ascending(t num) { t a[20]; t temp=0; int i=0,j=0; for(i=0;i<num;i++) { cin>>a[i]; } for(i=0;i<=num;i++) { for(j=i+1;j<=num;j++) { if(a[i]>a[j]) { temp=a[i]; a[i]=a[j]; a[j]=temp; } } } cout<<"Ascending order of ...
ALGO
0.999269
3.977004
3e5aabaf-7139-4678-8c99-504d18f35566
Kawser-nerd/CLCDSA
Source Codes/AtCoder/abc057/D/2864527.cpp
#include <iostream> #include <fstream> #include <string> #include <cstring> #include <cmath> #include <cstdlib> #include <ctime> #include <vector> #include <algorithm> #include <numeric> #include <map> #include <set> #include <stack> #include <queue> #include <deque> #include <functional> #include <cctype> #include <li...
ALGO
0.999912
3.995258
1d7738cb-a08f-424d-ab76-e0ecb4c64da7
los-kenzo/android_frameworks_base
tests/Camera2Tests/SmartCamera/SimpleCamera/jni/stats_scorer.cpp
// Stats (mean and stdev) scoring in the native. #include "stats_scorer.h" #include <jni.h> #include <math.h> void Java_androidx_media_filterpacks_numeric_StatsFilter_score( JNIEnv* env, jobject thiz, jobject imageBuffer, jfloatArray statsArray) { unsigned char* pImg = static_cast<unsigned char*>(env->GetDir...
ALGO
0.92085
7.096336
049be4e7-28b3-400a-8b21-714b126a558b
ahmeducf/problem-solving
CodeForces/1200/47B - Coins.cpp
/* * Directed by: Ahmed Salah * */ #include <bits/stdc++.h> #define kill return 0 #define space " " #define endl '\n' #define PI 3.14159265358979323846 #define IO ios::sync_with_stdio(false); cin.tie(0); cout.tie(0) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef bitset<100000001...
ALGO
0.999969
3.931997
b90cc309-d292-4c74-8483-f5caa3ea0e28
Anubhav2907/DSA
searching/subarrayWithSum.cpp
#include <bits/stdc++.h> using namespace std; bool subarrayWithSum(int arr[], int n, int s){ int low = 0; int high = 0; int sum = arr[0]; while(low<n && high<n){ if(sum==s){ return true; } else if(sum>s){ sum-=arr[low]; low++; }else{ ...
ALGO
0.999889
5.152604
de12a677-a479-4076-b652-76e760a857a2
Timokrut/UniversityLabs
YA_TEST_BOP/11/2.cpp
// Дан std::list, нужно найти самое часто появляющееся число с помощью std::map #include <iostream> #include <map> #include <list> int func(std::list<int> list) { std::map<int, int> map; for (auto el : list) { map[el]++; } int max_int = 0; int max_freq = 0; for (auto pair : map) ...
ALGO
0.999845
5.73912
9aa36793-72f0-424e-ba09-df83ba190424
nitishhsinghhh/Tips-and-Tricks-for-Programming-using-Cpp
Misc/Lexicographic Order/sortingsearchinggeneratingpermutations.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> /** * @brief Entry point of the program. * * This program demonstrates: * - Lexicographical comparison of strings * - Sorting of a vector of strings * - Generating all permutations of a vector of integers using std::next_permutation...
ALGO
0.999075
6.087118
ba07b008-4deb-4e52-a931-2b7bca9e7e0e
LJH204-GIT/BookExample
ch03/fig03_03.cpp
// fig03_03.cpp // Analysis of examination results using nested control statements. #include <iostream> using namespace std; int main() { // initializing variables in declarations int passes{0}; int failures{0}; int studentCounter{1}; // process 10 students using counter-controlled loop while (stu...
TOOL
0.988541
6.963914
b3896176-154d-40b6-b46d-82fbb0c6a322
namsick96/algoritm_prac
cpp/binary_search/finding_number/solution.cpp
#include <iostream> #include <vector> #include <algorithm> #include <stack> #include <queue> #include <list> using namespace std; void check(int temp1, vector<int> &temp2) { if (temp1 == 10) { temp2.push_back(temp1); } if (temp1 == 1) { temp2.push_back(temp1); } if (temp1 !=...
ALGO
0.999908
3.338933
9a285765-b178-46e6-8a9f-43f5b478129d
shubham-navik/Code-forces
ladder2/benches.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; long long int x= (pow(n, 2)) * (pow(n - 1, 2) ) * (pow(n - 2, 2) ) * (pow(n - 3, 2) ) * (pow(n - 4, 2) )/120; cout << x; }
ALGO
0.999612
3.976835
73140065-b60e-4fb7-9014-04830857867d
Bhavik0902/LeetCode-by-Bhavik
N meetings in one room - GFG/n-meetings-in-one-room.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: //Function to find the maximum number of meetings that can //be performed in a meeting room. struct Meeting { int start; int end; int pos; }; boo...
ALGO
0.999942
5.897223
19d25e53-eab6-4fc2-9376-d0aa56057a66
nazmusweb-coding/Phitron
Semester 1/ICPC Assiut University Community Problem Set/Sheet 2 Loops/J_Primes_from_1_to_n.cpp
#include <iostream> using namespace std; bool isPrime(int k) { if (k > 1 && k <= 3) { return true; } if (k % 2 == 0 || k % 3 == 0) { return false; } for (int i = 5; i*i <= k; i+=6) { if (k % i == 0 || k % (i + 2) == 0) { return false; ...
ALGO
0.999747
4.88159
9901d8b7-0888-4a52-bc26-c4f3450f7615
ishandutta2007/codeforces
kdvinit/normal/1467/B.cpp
/* K.D. Vinit |,,| Hello */ #include<bits/stdc++.h> using namespace std; #define int long long void solve() { int n; cin>>n; int a[n+1]; for(int i=1;i<=n;i++) cin>>a[i]; int val[n+1]={0},ans=0; for(int i=2;i<n;i++) { if(a[i]>a[i-1] && a[i]>a[i+1]) { val[i]=1; ans++; } if...
ALGO
0.999677
4.787552
c306a6f0-e17e-48f5-8780-8507c72572ed
AdnanSalazzar/Solution-Code-Force
1440B - Sum of Medians.cpp
#include<bits/stdc++.h> #include<list> #include<iterator> #include<algorithm> #include<cmath> #include<string.h> #include<vector> #define longpro int64_t ; #define AMAI ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define ll long long using namespace std ; int main() { AMAI; int T ; ci...
ALGO
0.999825
3.182765
f6b3f099-2fee-4ed7-af25-d77cfff89633
Chirag-code1/LeetCode
#1009. Complement of Base 10 Integer.cpp
class Solution { public: int bitwiseComplement(int n) { if (n == 0) return 1; int answer = 0; int power = 1; while (n) { answer += ((1 - (n % 2)) * power); n /= 2; power *= 2; } return answer; } }; //revised.
ALGO
0.999998
6.083127
a11cc309-98c6-4ad6-9af7-ec7aa163f5ab
NLTD2010/cpp-knowledge
23hsg9hnoi2.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define int long long ll MAX=2e18, MIN=-2e18, MOD=1e9 + 7; ll n, c = 0; string s; set<ll> sthlmaohere; signed main(){ getline(cin, s); for(int i = 0; i < s.size(); i ++){ if('0' <= s[i] && s[i] <= '9'){ string x = ""; ...
ALGO
0.99951
4.842944
8dbe62ef-1aea-4f57-951b-608ecdcfdb2d
Dr-XX/pandore-bug-injected
src/operatorsP0/segmentation/pcontrastquadtree.cpp
/** * @author Laurent Quesnel - 2002-06-10 */ #include <pandore.h> using namespace pandore; /** * @file pcontrastquadtree.cpp * On regarde si un bloc a un contraste inferieur un certain threshold. * Si cette condition est non verifie alors on divise le bloc * en quatre autres blocs d'egales dimensions */ /**...
ALGO
0.998271
4.884714
1a0acf95-ccab-4c36-836b-9da20f1eb4f7
harshbhar0629/CrackYourInternship
Dynamic_programming/29_count_diff_palindromic_subsequences.cpp
#include <bits/stdc++.h> using namespace std; // https://leetcode.com/problems/count-different-palindromic-subsequences/ #define ll long long int class Solution { const ll mod = 1e9 + 7; int dp[1005][1005]; string s; ll f(int i, int j) { if (i > j) { return 0; }...
ALGO
0.999991
5.944464