uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
e15bc5af-f023-4ef0-aef1-f4cef4a8818e
Thisayang/Codeforces
1822B_Karina_and_Array.cpp
#include <bits/stdc++.h> using namespace std; int comp(const void* pa, const void* pb) { return *(int*)pa - *(int*)pb; } void Solve(int n) { long long a[n]; for (int i = 0; i < n; ++i) { scanf("%lld", &a[i]); } qsort(a, n, sizeof(long long), comp); if (a[0] * a[1] > a[n - 1] * a[n - 2]) { cout << a[0] * a[...
ALGO
0.99983
4.23529
d92e775b-035f-4205-9d92-b43e868f3014
Twinparadox/AlgorithmProblem
Before_2023/Baekjoon/11383.cpp
#include <iostream> #include <string> #include <vector> using namespace std; int main(void) { int N, M; cin >> N >> M; vector<string> source(N); vector<string> dest(N); for (int i = 0; i < N; i++) cin >> source[i]; for (int i = 0; i < N; i++) cin >> dest[i]; for (int i = 0; i < N; i++) { bool isEyfa = tr...
ALGO
0.999986
4.034211
bf34624f-8f2d-4fe0-a5ef-c8d93c49184b
hajeongyeon/Algorithm
Implementation&Simulation/pg_skilltree.cpp
// 2020.05.09 // α׷ӽ ųƮ #include <iostream> #include <string> #include <vector> using namespace std; int solution(string skill, vector<string> skill_trees) { int answer = 0; int alpha[26] = { 0, }; for (int i = 0; i < 26; ++i) alpha[i] = -1; for (int i = 0; i < skill.size(); ++i) alpha[skill...
ALGO
0.999363
4.400317
447d7885-36dc-4d3b-8c21-02899b0a9ec5
jukhang/realsense-tracker
track_pkg/src/kcftracker.cpp
#include <iostream> #ifndef _KCFTRACKER_HEADERS #include "kcftracker.hpp" #include "ffttools.hpp" #include "recttools.hpp" #include "fhog.hpp" #include "labdata.hpp" #endif // Constructor KCFTracker::KCFTracker(bool hog, bool fixed_window, bool multiscale, bool lab) { // Parameters equal in all cases lambda =...
ALGO
0.992952
6.124908
9537688f-b878-41be-aff1-2535efd8eca7
adamjford/30kAPM
UAlbertaBot/Source/MicroSearchManager.cpp
/*#include "Common.h" #include "SparCraftManager.h" SparCraftManager::SparCraftManager() : TT(new SparCraft::TranspositionTable()) , gameOver(false) { Search::StarcraftData::init(); initialTotalSqrt[0] = 0; initialTotalSqrt[1] = 0; } void SparCraftManager::onStart() { SparCraft::GameState s...
TOOL
0.948557
3.859807
6d26dfef-6764-459f-8907-e7df932f8c22
ishandutta2007/codeforces
yarik_mutltiacc/normal/1334/A.cpp
#pragma GCC optimize("O2") #pragma GCC optimize("unroll-loops") #pragma GCC target("avx,avx2,sse,sse2,ssse3,tune=native") #include<bits/stdc++.h> #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define pb push_back using namespace std; using ll = long long; //using arr = array; using pi = pair<in...
ALGO
0.999959
4.407442
a9db0fb3-bb7d-4516-9756-23b147d63461
ry-Rahul/DSA
Heap/findKpairSmallestSum.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: typedef pair<int, pair<int, int>> p; vector<vector<int>> kSmallestPairs(vector<int> &nums1, vector<int> &nums2, int k) { priority_queue<p, vector<p>> pq; int m = nums1.size(); ...
ALGO
0.999997
5.134798
054976b9-dbfa-43a6-aa54-f37e4359cdc0
atikislam/Codeforces
B_Taisia_and_Dice.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" #define INF 100000000 #define abc "abcdefghijklmnopqrstuvwxyz" #define ABC "ABCDEFGHIJKLMNOPQRSTUVWXYZ" #define PI 3.1415926535897932384626433832795 //define sort function #define asort(a) sort(a.begin(),a.end()) #define gsort(a) sort(...
ALGO
0.999812
3.021241
73e5791f-c4e4-4836-8b66-1e1bd0478ed1
Cambridge-AdvancedOS/l41-freebsd
contrib/llvm-project/llvm/lib/Support/Process.cpp
#include "llvm/Support/Process.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Config/config.h" #include "llvm/Config/llvm-config.h" #include "llvm/Support/CrashRecoveryContext.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" #include "llvm/Support/Program.h" ...
TOOL
0.95382
7.749969
d14853c6-a3b8-4ee0-a983-aea5c11cd7e9
pranavsindura/CompetitiveProgramming
codeforces/E/1016e.cpp
#include<bits/stdc++.h> #define ll long long int #define ld long double #define pi pair<int,int> #define all(x) x.begin(), x.end() #define allr(x) x.rbegin(), x.rend() #define sz(x) ((int)x.size()) #define ln(x) ((int)x.length()) #define mp make_pair #define pb push_back #define ff first #define ss second #define endl ...
ALGO
0.999755
4.33228
8ca458b1-2c46-4560-82ff-746c70bf684a
529106896/FishTouchingXMUer
大二上/数据结构与算法/课后题答案/Dev-C++/ExerciseBook/03.22/03.22.cpp
#include <stdio.h> #include <ctype.h> // ṩisdigitԭ #include "Status.h" //**01 **// #include "SqStack.h" //**03 ջͶ**// /* * 沨ʽֵҪΪλ * *ע * ʽıΪĸֻ'+''-''*''/' */ Status Algo_3_22(char c[], SElemType* Value); /* a oper b ֵ */ char Operate(char a, char oper, char b); int main(int argc, char* argv[]) { char...
ALGO
0.999901
3.439461
850b0911-8ec7-4220-a77b-c46bc50cdb73
NikkiMandal/EECE7205-FCE
Project_2/Code/Source.cpp
#include<iostream> #include<vector> #include<limits.h> #include"Matrix.h" #include<ctime> using namespace std; using namespace Numeric_lib; struct Task { int taskNumber; // task number bool isCloudTask; // indicates whether the task is a cloud task double priority; // priority of the task int finishTimeLocal; ...
ALGO
0.999904
3.183334
8ebdbff7-e221-47e7-a747-e2b1cc5e2760
u-wyh/luogu-code
CF1204E.cpp
#include<bits/stdc++.h> using namespace std; const int MOD = 998244853; const int MAXN = 4005; int n,m; long long fac[MAXN]; long long inv[MAXN]; long long fun[MAXN]; long long power(long long val,long long p){ long long ans=1; while(p){ if(p&1){ ans=(ans*val)%MOD; } p>>=1...
ALGO
0.999989
4.326776
30c32b6c-25ae-4560-a9a4-332195f69b43
albertollamas-GII/ED
PRACTICAS/PRACTICA 5/arboles/avl/AVL-versioninicial/usoavl.cpp
#include "avl.h" #include <string> #include <sstream> #include <cstdlib> #include <vector> using namespace std; void ListarAVL(AVL<int> &ab_bus){ AVL<int>::nodo n; cout<<endl<<" Elementos ordenados con sus alturas: "; for (n=ab_bus.begin();n!=ab_bus.end();++n){ cout<<*n<<" ("<<n.altura()<< ") "; } } int mai...
ALGO
0.999215
4.264818
026d5d60-4698-4163-98e5-6b8615016723
enpvivek/gfg-dsa
11. Linked List/deleteHeadCLL.cpp
#include <bits/stdc++.h> #define endl "\n" using namespace std; struct Node { int data; Node *next; Node(int d) { data = d; next = NULL; } }; void printCLL(Node *head) { if (head == NULL) { return; } cout << head->data << "->"; for (Node *p = head->next;...
ALGO
0.999847
4.682638
89f47c70-9e12-404a-b1c4-c1055e1e62f7
anmolkohli13/DSA-practice
gfg solutions/dfs_of_a_graph.cpp
class Solution { public: // Function to return a list containing the DFS traversal of the graph. void DFSUtil(vector<int>adj[],int curr,vector<bool>&visited,vector<int>&ans) { ans.push_back(curr); visited[curr] = true; for(auto x : adj[curr]) { if(visited[x...
ALGO
0.999981
5.924417
42c74ee9-1803-49fc-9493-d71566e23768
parasguglani1/competitive_coding
Codeforces/135 div2/B_Best_Permutation.cpp
#include <bits/stdc++.h> using namespace std; using namespace chrono; #define ff first #define ss second #define int long long using ll = long long; #define setbits(x) __builtin_popcountll(x) #define zrobits(x) __builtin_ctzll(x) #define mod 1000000007 #define inf 1e18 #define PI 3.1415926535897932384626 #define ps(x,...
ALGO
0.999586
3.707207
70da7bea-f5a9-4459-bbbd-015d77be0bff
saa27/Data-Structures
Bit-Manipulation/BIT_Decode-XORed-array.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: vector<int> decode(vector<int>& encoded, int cur) { vector<int> res; res.push_back(cur); for(auto i:encoded){ res.push_back(cur ^= i); } return res; } }; /* Explanation cur means the curre...
ALGO
0.999992
5.22793
af40c372-40a8-46c1-8ab5-c78280726089
UditVarsh/DSA
arrays/easy/missing elements/missing_element_optimal.cpp
#include<iostream> #include<vector> using namespace std; void print_arr(vector<int>&arr); int missing_elements(vector<int>&arr); int main(){ vector<int> arr= {0,1,2,3,4,5,6,8,9,10,11,12}; int miss = missing_elements(arr); cout<<miss; } int missing_elements(vector<int>&arr){ int n = arr.size(); i...
ALGO
0.99472
4.080269
fc41b44b-40aa-4022-aeed-3622469f2437
jigyansunanda/Leetcode-Practice
1638-count-substrings-that-differ-by-one-character/1638-count-substrings-that-differ-by-one-character.cpp
class Solution { public: int countSubstrings(string s, string t, int ans = 0) { int m = s.size(), n = t.size(); int dp1[m + 1][n + 1]; memset(dp1, 0, sizeof(dp1)); int dp2[m + 1][n + 1]; memset(dp2, 0, sizeof(dp2)); for (int i = 1; i <= m; ++i) { for (int j = 1; j <= n; +...
ALGO
0.999963
6.299685
d8cc86cf-cc94-4022-bad5-d94e82de8d8c
chinmoyacharjee/CplusplusCodes
F - Easily Readable.cpp
#include<bits/stdc++.h> using namespace std; void file(){ freopen("input.txt","r",stdin); //freopen("output.txt","w",stdout); } int main(){ int t; file(); scanf("%d",&t); for(int i=1;i<=t;i++){ long long int m; scanf("%lld",&m); string s; map<string,long long ...
ALGO
0.99943
3.596997
1852c236-5cdc-44ba-86bb-82f067dce58c
sukhbir-singh/competitive-programming
spoj/SHPATH/other1/shpath3 (another copy).cpp
#include <bits/stdc++.h> using namespace std; #define inf 99999999 class edge{ public: int src; int dest; int wt; }; typedef pair<int, edge> pii; vector<edge> vertices[10000+2]; struct compare { bool operator()(const pii& l, const pii& r){ return l.first > r.first; } }; int dijkstra(int from, int to, i...
ALGO
0.999734
4.528643
9ba879a5-e13c-4536-aec1-31da3014c435
djplatt/code
goldbach_hh/musum/3prprog_clean/ch4/4.3 Sums of mu/checkm.cpp
/* Compile with g++ checkm.cpp -ocheckm -O2 -frounding-math -fomit-frame-pointer -finline-functions -mfpmath=387 -I$CRDIR -L$CRDIR -lcrlibm assuming that crlibm is installed (in directory $CRDIR), that the underlying processor is Intel, and that int_double14.2.h is in the same directory as this file */ /* Run with ...
ALGO
0.99982
6.291072
ac5b78b6-3861-48e5-905b-ee974cf36a72
seventeenw17/Algorithm-board
第5章——动态规划/11.数位统计DP.cpp
//λͳDP #include <bits/stdc++.h> using namespace std; int a, b; vector<int> nums; int get(int l, int r) { int res = 0; for (int i = l; i >= r; i -- ) res = res * 10 + nums[i]; return res; } int power10(int x) { int res = 1; while (x--) res *= 10; return res; } int count(int n...
ALGO
0.999723
4.527246
2821b415-98ee-4cd4-8cf9-4fcd1384d67a
gtoo8888/Cplusplustest
1-Algorithm_test/leetcode/2-算法/4-dfs和bfs/非网格/997-找到小镇的法官.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; void printVector(vector<int> str) { for(auto it = str.begin();it != str.end();it++) cout << *it << " "; cout << endl; } class Solution { public: int findJudge(int n, vector<vector<int>>& trust) { vector<int> rudu(n+1,0); vec...
ALGO
0.99991
5.08685
22228db1-da55-45cf-ad06-0e2e55dda54f
MohammadSajjadHossain9648/algorithm-code
dijkstra.cpp
#include <bits/stdc++.h> using namespace std; #define infinity 1<<30 //2^30 struct node{ int u; int cost; node(int _u, int _cost){ u = _u; cost = _cost; } bool operator < ( const node& p ) const { return p.cost < cost; } //Operator overloading }; void dijstkra(int n, vecto...
ALGO
0.999963
4.122347
03d105a0-d576-409c-b753-fba14a439bfa
ishandutta2007/codeforces
jiangly/normal/1610/G.cpp
#include <bits/stdc++.h> int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::string s; std::cin >> s; int n = s.length(); std::vector<int> sum{0}, pre{-1}; std::vector<int> lst(2 * n + 1, -1); lst[n] = 0; auto pop = [&]() { int x = ...
ALGO
0.999951
4.924939
0cbe2e7e-af50-4e02-9ec3-62f2dec0ec27
ntanthedev/Cpp
mrs.Minh/Buoi 5, 6/PK0028C.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long const long long R = 1e9+7; const long long N = 1e6+9; struct sx { ll x, y, vt; } sx a[N]; bool cmp(sx c, sx d){ return c.x < d.x; } int main() { cin.tie(NULL); cout.tie(NULL); ios_base::sync_with_stdio(fal...
ALGO
0.999944
3.741472
c5b2fc9f-caaa-4f90-9cdb-d34d0db5fa93
PashaKlybik/prog-053504
ialexofficial/lab4_1_6.cpp
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int strlen(char* str) { int res = 0; while (str[res] != '\0' && str[res] != '\n') res++; return res; } void concate(char* str1, char* str2) { int pos = strlen(str1); for (int i = 0; i < strlen(str2); i++) str1[pos++] = str2[i]; str1[pos++] = ' '; str1[pos] ...
ALGO
0.999954
3.152995
92d515b2-11f8-4ffb-b220-8e459067f388
caglayan45/projeler
C++_ AVL ağacı ve stack yapısı/Node.cpp
/** * Node.cpp * Asıl fonksiyonların bulunduğu, düğüm işlemlerinin yapıldığı dosyadır. * Yaz okulu * Final ödevi * 23/08/2020 * Yavuz KAYA */ #include "Node.hpp" #include "Yigin.hpp" #include <math.h> Node::Node(){} int Node::Yukseklik(node *dugum){ return (dugum == NULL)? 0 : dugum->yukseklik; } int Node::Yuksekli...
ALGO
0.998855
3.611124
53f49b74-5ae3-4ee8-83b2-a54b5e72d0df
yiqingfann/my-leetcode-solutions
1029-面试机票钱.cpp
// https://leetcode.com/problems/two-city-scheduling/ // soln 2 class Solution { public: int twoCitySchedCost(vector<vector<int>> &costs) { sort(costs.begin(), costs.end(), [](vector<int> &a, vector<int> &b) { return a[0] - a[1] < b[0] - b[1]; }); int m = costs.size(), n = m...
ALGO
0.999991
6.244739
40baa60d-ee15-4853-bd91-d5d0ca39255f
MamDouH919/starkids_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
9d7a8d86-8ba8-46c4-9bc8-1f93b5db45d2
EnesFYavuz/word-reader
TwoOrMoreDigits.cpp
#include "TwoOrMoreDigits.h" bool TwoOrMoreDigits::filter(string word){ bool foundDigit = false; for(string::iterator it = word.begin(); it!=word.end(); ++it){ if (isdigit(*it)) { if (foundDigit) { return true; } else if (!foundDigit) { foundD...
ALGO
0.89845
4.540125
ed0bd1a2-7f02-4e30-8c7d-a8378ffcdf7e
kk-laoguo/ollvm-13
llvm-project-13/libc/src/math/generic/llrintf.cpp
#include "src/math/llrintf.h" #include "src/__support/common.h" #include "utils/FPUtil/NearestIntegerOperations.h" namespace __llvm_libc { LLVM_LIBC_FUNCTION(long long, llrintf, (float x)) { return fputil::roundToSignedIntegerUsingCurrentRoundingMode<float, long long>( x); } } // namespace __llvm_libc
ALGO
0.998234
6.292931
ad9d0eae-facb-49b4-917a-9726e31b3153
alexandraback/datacollection
solutions_6377668744314880_0/C++/Rebryk/main.cpp
#include <iostream> #include <stdio.h> #include <math.h> #include <vector> #include <string.h> #include <string> #include <set> #include <map> #include <queue> #include <algorithm> using namespace std; int T, n; struct point { long long x, y; }; long long f(point a, point b, point c) { return (long long)a.x...
ALGO
0.999901
5.000081
45974cfc-5cbd-42ce-8a25-aa4ab1724007
senith2001/codeforces
A_Wrong_Subtraction.cpp
#include <bits/stdc++.h> int main(){ int n,k; std::cin>>n>>k; while(k--){ if(n%10==0){ n/=10; }else{ n--; } } std::cout<<n <<"\n"; return 0; }
ALGO
0.999827
3.787426
0429f7b2-7af1-46af-865b-f6fde7632c91
hellogirish07/OOPs-in-CPP
Inheritance/hybrid_inheritance.cpp
#include <iostream> using namespace std; // Base class class Shape { public: void displayShape() { cout << "This is a shape." << endl; } }; // Derived class 1 class Triangle : public virtual Shape { public: double base, height; void setTriangle(double b, double h) { base = b; ...
TOOL
0.959565
7.037243
669d5ac2-0198-410c-9f66-2d70c11878b7
achyuth-k-t/Strivers-SDE-sheet-Daily
04_Binary Search/Achyuth/BS on Answers/14_KthEleIn2SortedArr.cpp
#include <bits/stdc++.h> int kthElement(vector<int> &a, vector<int> &b, int n1, int n2, int k) { if(n1>n2)return kthElement(b,a,n2,n1,k); int low=max(0,k-n2); int high=min(n1,k); int left=k; int n=n1+n2; while(low<=high){ int mid1=(low+high)/2; int mid2=left-mid1; int l1=INT_MIN; ...
ALGO
0.99999
4.064167
46f561ac-124f-43df-8e3b-85efb42c75bb
hideinsubtropicalforest/CHESS-Parallel
CHESS/cn/update_N_stratum_daily.cpp
//=============================================================================================================================== // update_N_stratum_daily // // // NAME // update_N_stratum_daily - // // updates daily C stores to // account for psn and respiration // SYN...
ALGO
0.903744
3.464731
af8fcda9-3d21-4dac-a103-4d695ad98698
kelviakolln3/estruturaDeDadosAvancados
Aula 2 dia 22.02.2022/Exemplo 1.cpp
//Sequencia de fibonacci //Procedural #include <stdlib.h> #include <stdio.h> using namespace std; int main(){ double val1 = 0, val2 = 1, result = 0; printf("\n %.f \n %.f", val1, val2); for(int i = 2; i< 100; i++){//Vai repetir 98 vezes ja que os elementos 0 e 1 ja existem result = val1 + val2; val1 = val2; ...
ALGO
0.999816
3.89082
f77b4d94-6097-4063-b513-5e2637b56e7d
Codetesing/Massive_Parallel_Computing
Week12/EX12-1_sum-host.cpp
#include "./common.cpp" // input parameters const unsigned MAX_NUM = 16 * 1024 * 1024; unsigned NUM = MAX_NUM; // num data int main(const int argc, const char* argv[]) { // argv processing switch (argc) { case 1: break; case 2: NUM = procArg(argv[0], argv[1], 1); break; default: printf("usage: %s [num] [...
ALGO
0.974633
4.860537
1fb06725-8e40-4535-910e-c31b24e42dbf
iCoder0020/Competitive-Coding
CF-old/617/A.cpp
#include <bits/stdc++.h> using namespace std; #define int long long int32_t main() { int T; cin>>T; while(T--) { int N; cin>>N; int A[N]; int even = 0; int odd = 0; for(int n = 0; n<N; n++) { cin>>A[n]; if(A[n]&1) odd++; else even++; } if(even == N || (odd == N && (N%2 == 0))) ...
ALGO
0.999739
4.899122
92ebb5c0-b311-4de0-a022-7974d294c032
angjunkang/chessplusplus
src/Bishop.cpp
#include "Bishop.h" #include <iostream> Bishop::Bishop(Team team, std::pair<int, int> pos, Renderer* handler) : Piece(team, pos, handler, BISHOP) { std::string filename; if (team == BLACK) { filename = "../res/chess_bb.png"; } else { filename = "../res/chess_wb.png"; } ...
ALGO
0.865349
5.119974
8888ec93-a71d-4e75-9d9e-019b0f3cdf5d
sanjay10985/100-days-of-dsa
1833-find-the-highest-altitude/1833-find-the-highest-altitude.cpp
class Solution { public: int largestAltitude(vector<int>& gain) { int maxAltitude = gain[0]; for(int i = 1;i<gain.size();i++){ gain[i] = gain[i-1] + gain[i]; if(gain[i] > maxAltitude){ maxAltitude = gain[i]; } } return maxAltitude <...
ALGO
0.999951
5.631641
6bc2fbb4-efab-4d40-93f6-75dc02826ce4
akamya997/PracticeCode
201902_practice/2019_2/cf_global_1/e.cpp
#include<bits/stdc++.h> using namespace std; const int maxn=1e5+7; long long arr[maxn]; long long brr[maxn]; long long a[maxn],b[maxn]; map<long long,int> cnta; map<long long,int> cntb; int main() { int n; scanf("%d",&n); for(int i=0;i<n;i++) scanf("%lld",&arr[i]); for(int i=0;i<n;i++) scanf("%lld",&brr[i]); i...
ALGO
0.999995
3.357554
84091405-ad7b-42b4-80fb-5b306dce0393
sohamghs02/DSA_100days_ApnaCollege
findmissingandrepeatedvalues-leetcode2965.cpp
class Solution { public: vector<int> findMissingAndRepeatedValues(vector<vector<int>>& grid) { vector<int>ans; unordered_set<int>s; int n = grid.size(); int a,b; int expSum = 0, actualSum = 0; for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ ...
ALGO
0.999636
4.986431
14aafdbc-510d-4ebe-b798-86ae185a8c88
bentoper/Competitive
Contests/CF654/d.cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define fst first #define snd second #define fr(i,n) for(int i=0;i<n;i++) #define frr(i,n) for(int i=1;i<=n;i++) #define pv(x, n) fr(iii, n) printf("%d%c", x[iii], " \n"[iii==n-1]) #define pvv(x, n) frr(iii, n) printf("%d%c...
ALGO
0.999836
3.07434
41059bc0-3a52-4d3d-b610-6b13b62cb60b
SuperCl4sh/Competitive-Programming
DMOJ/monkeybread.cpp
//https://dmoj.ca/problem/monkeybread #include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //using namespace __gnu_pbds; using namespace std; /* #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") */ //^speed //typedefs typedef long long ll; typedef string str; typedef pair<int,int> pii; typ...
ALGO
0.999965
3.144654
6cf0b2f3-4417-4fd1-acc6-aa8cddd97119
Shangke7788/SGU
131.cpp
#include <bits/stdc++.h> using namespace std; typedef long long lint; const int MAX_N = 9; int a[1 << MAX_N][1 << MAX_N], n, m; lint b[10][1 << MAX_N]; void dfs(int x, int y, int now, bool l = false) { if (now == n) { a[x][y]++; return; } if (l) { if (x & (1 << now)) { dfs(x, y, now + 1); } else { if...
ALGO
0.999961
4.342792
8403e407-05f2-4df8-898f-6b3ea5484729
shashankfzb/leetcode_Problems
min_max.cpp
#include<iostream> #include<vector> using namespace std; int main(){ int arr[5]={1,3,5,7,9}; vector<int> mainsum; for(int i=0;i<5;i++){ int sum=0; if(i==0){ for(int j=1;j<5;j++){ sum=sum+arr[j]; } } else{ for(int ...
ALGO
0.999843
3.232138
098f10b6-af93-4a4c-ab24-d16080db142b
AakashPawanGPS/CPP-Programming
Swap1to3.cpp
<<<<<<< HEAD #include <iostream> using namespace std; void reverse_array(int *b, int n) { int temp; for (int i = 0, j = n - 1; i < j; i++, j--) { temp = *(b + i); *(b + i) = *(b + j); *(b + j) = temp; } } int main(){ int a[] = {1,2,3,4,5,6,7,8,9,10,11}; int k = 3, size ...
ALGO
0.99918
3.853722
35e00542-cdfc-436c-adee-fe58e5699485
95Shade2/Majora-s-Mask-Randomizer
src/utils.cpp
#include "rando/utils.hpp" #include <algorithm> #include <cmath> #include <ios> #include <sstream> #include <stdexcept> #include <iomanip> #include <iostream> #include <list> #include <iterator> #include <map> #include <string> string hex_to_binary(const string& hex) { std::stringstream binary; for (int i = ...
TOOL
0.991769
5.422252
6919ddb9-4ec7-4186-aaab-eb53ab6073b2
wang-nima/algorithm_practice
evernote_interview/evernote2.cpp
#include <iostream> #include <string> #include <vector> #include <map> #include <algorithm> using namespace std; struct sort_pred { bool operator() (const pair<string,int> &left, const pair<string,int> &right) { if(left.second != right.second) return left.second > right.second; else { return left...
ALGO
0.999747
3.865935
2792fabe-73cf-4c8a-8723-596657ed772b
whale2002/datastructure-and-algorithm
bjfu_oj/DataStructure/04-graph/280.cpp
#include <iostream> using namespace std; #define MAX 100 typedef struct GNode{ int data; bool exist; struct GNode* next; } GNode, *GList; typedef struct { int vexnum; int arcnum; GList node[MAX]; } ALGraph; void createADL(ALGraph &gra, int m, int n) { gra.vexnum = m; gra.arcnum = n; int l, r; for (int i...
ALGO
0.999839
3.971551
c75efe01-8722-41c9-b424-bf680700f380
SurgicalSteel/Competitive-Programming
Kattis-Solutions/A Real Challenge.cpp
#include <bits/stdc++.h> #include <algorithm> using namespace std; int main() { long long inp; scanf("%lld",&inp); printf("%.16f",sqrt(inp)*4); return 0; }
ALGO
0.999163
3.141661
24bd9cbd-6ef0-4243-b0e5-d04078e8c3e1
MtSaka/library
test/aoj/GRL/GRL_1_C.test.cpp
// competitive-verifier: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_C #include "../../../graph/shortest-path/warshall-floyd.hpp" #include "../../../template/template.hpp" int main() { INT(v, e); Graph<ll> g(v); g.read(e, 0, true, true); auto d = warshall_floyd(g); rep(i,...
ALGO
0.999502
4.833753
2e55d00d-3ead-40b7-a780-741630a56de1
wxxhub/fall_recognition
src/state_judge.cpp
#include <stdio.h> #include "fall_recognition/state_judge.h" using namespace fall_recognition; // default fps 10 StateJudge::StateJudge() : state_(NORMAL), judge_size_(20), judge_times_(0), n_average_x_(210), x_data_(665), slope_radio_(1), fall_frame_num_(0), warn_frame_...
ALGO
0.995887
4.630756
28bb0057-beb7-4376-963d-73319808d059
Thomas180105/likou
solver/HUAWEI_202501_prepare/mianshiti_08_09.cpp
//用时: 05:53 class Solution { private: void dfs(int n, int l_in, int r_in, vector<string> &res, string str) { if (l_in == n && r_in == n) {res.push_back(str); return;} if (l_in < n) dfs(n, l_in + 1, r_in, res, str + '(');//放入( if (l_in > r_in) dfs(n, l_in, r_in + 1, res, str + ')'); ...
ALGO
0.999936
6.067214
2d87b56d-2ec7-48ef-98cd-270266d9749c
yunjaena/multiplication_multicore_programming
Multiplication/Multiplication/Game.cpp
#include "Game.h" #include <stdlib.h> #include <Windows.h> #include <stack> void Game::insert_algorithm(string name, Algorithm* algorithm, bool is_serial) { algorithm->set_serial(is_serial); algorithm_vector.push_back(pair<string, Algorithm*>(name, algorithm)); } void Game::show_insert_menu() { int algorithm = -1;...
ALGO
0.997999
3.062731
9c2e1c89-115a-4377-9327-255c3ae9574f
namansharma05/clean_arch_bloc_chat_app
frontend/clean_arch_bloc_chat_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.99798
6.76775
dcc052f9-3490-483f-8120-24d8fb4a5ef4
gim-largerepo/including-investment-59GB
web/report.cpp
After half low only. Major movie including agent probably. Nothing than bill true account former. Finish power with in. Your front meeting government. Sound state want when. Again area charge. Operation mind history. Tax dark baby station final how. Save agree want report. Entire Congress prove tax understand maybe. Ri...
WEB
0.866254
7.531303
d2145087-e7c5-4e3a-92ac-d4e62709ef31
yuika-sama/code-ptit-solutions
C++/cpp0353.cpp
#include <bits/stdc++.h> #define faster() {ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);} #define endl '\n' #define precision(x) setprecision(x) << fixed using namespace std; bool palin(string s){ for (int i=0; i<s.size()/2; i++){ if (s[i]!=s[s.size() - i - 1]){ return false; } } return tru...
ALGO
0.999895
4.81928
b67b65d0-1e74-4901-8df4-898bf1c7d770
ahmeddarafat/problem-solving
lib/C++/A_Team_Olympiad_Codeforces.cpp
// Problem Name : A - Team Olympiad // Problem Link : https://codeforces.com/contest/490/my #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> math, prog, eu; for (int i = 1; i <= n; i++) { int x; cin >> x; if (x == 1) prog.p...
ALGO
0.999788
3.815565
8ddcafe4-8a6a-422f-a49c-ff1839300c09
yashparmar15/Cpp-Codes
Maximum_Score_From_Performing_Multiplication_Operation.cpp
/*You are given two integer arrays nums and multipliers of size n and m respectively, where n >= m. The arrays are 1-indexed. You begin with a score of 0. You want to perform exactly m operations. On the ith operation (1-indexed), you will: Choose one integer x from either the start or the end of the array nums. Add ...
ALGO
0.999993
6.154563
ead25f4b-487e-469f-8bef-6f1a0df6a072
plab0n/OJ_solutions
No_strings_attached.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); int t; cin>>t; long long dp[100009][29]; while(t--) { string str; cin>>str; int len = str.length(); for(int i=0; i<=26; i++) { dp[0][i] = 0; }...
ALGO
0.999973
4.223277
65513847-9346-43c9-8055-9296b117ffc9
ishandutta2007/codeforces
cnnfls_csy/normal/475/D.cpp
#include <iostream> #include <algorithm> #include<cmath> #include<cstring> #include<cstdio> #include<cstdlib> #include<vector> #include<iomanip> #include<map> #define sqr(x) (x)*(x) using namespace std; int n,m,i,j,x; map<int,long long> lst,ans,now; int gcd(int x,int y) { if (y) return gcd(y,x%y); return x; } int mai...
ALGO
0.999886
3.073189
88f9e099-172c-417f-9e09-006be22f71ad
eric7237cire/CodeJam
uva/10502 - geom/p2.cpp
/* 4961146 2006-09-21 06:32:23 Accepted 6.658 404 Wong Chi Fung C++ 10502 - Counting Rectangles */ #include <stdio.h> #include <string.h> #include <stdlib.h> const int MAX = 120; char map[MAX][MAX]; char str[MAX]; int row, col; int i, j; int width, height, top, left, bottom, right, leftend, topend; int count, rect...
ALGO
0.999011
4.053425
f1f45ab7-8917-4ed6-adab-1108180429d3
Vermadeepakd1/Questions-Solved
Difficulty: Medium/Top View of Binary Tree/top-view-of-binary-tree.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.999514
7.085757
065cef69-5e95-43c6-9b10-d3749e2e30da
shashankanand13monu/Leetcode
239-sliding-window-maximum/239-sliding-window-maximum.cpp
class Solution { public: vector<int> maxSlidingWindow(vector<int>& nums, int k) { deque<int>dq; vector<int>a; for(int i=0;i<nums.size();i++) { if(!dq.empty() and dq.front()==i-k) { dq.pop_front(); } wh...
ALGO
0.999987
6.211493
f68dc4c4-c680-4c9e-9dd5-02a375862b3a
Kawser-nerd/CLCDSA
Source Codes/AtCoder/arc071/D/1211785.cpp
#include <iostream> #include <cstdio> #include <vector> #include <cmath> #include <cstring> #include <numeric> #include <algorithm> #include <functional> #include <array> #include <map> #include <queue> #include <limits.h> #include <set> #include <stack> #include <random> #include <complex> #include <unordered_map> #in...
ALGO
0.999983
3.908317
b4d4f10e-10be-4389-85aa-feeaced782ea
sarvex/leetcode-bash
solution/2500-2599/2538.Difference Between Maximum and Minimum Price Sum/Solution.cpp
class Solution { public: long long maxOutput(int n, vector<vector<int>>& edges, vector<int>& price) { vector<vector<int>> g(n); for (auto& e : edges) { int a = e[0], b = e[1]; g[a].push_back(b); g[b].push_back(a); } using ll = long long; us...
ALGO
0.999951
5.594357
e1350910-016b-4a53-a0a5-ba2b6cdcc3f2
priyajit27/Leetcode
0069-sqrtx/0069-sqrtx.cpp
class Solution { public: int mySqrt(int x) { long long start=0; long long end=x; int ans=1; long long mid; while(start<=end){ mid=(start+end)/2; if(mid*mid==x) return mid; else if(mid*mid>x) end=mid-1; else...
ALGO
0.999983
5.121203
7bb15840-c84e-49fd-bb2e-bc146888de28
nn-fiha/Competitive-Programming-
UVA/uva 11709 - Trust groups.cpp
#include<bits/stdc++.h> using namespace std; #define NODES 10020 vector<int>g[NODES],rg[NODES]; vector<string>vs,v; map<string,int>mp; int clr[NODES],t=1,n,m; stack<int>stk; void dfs(int u) { clr[u]=1; for(int i=0; i<g[u].size(); i++) { if(clr[g[u][i]]==0) { dfs(g[u][i]); ...
ALGO
0.99971
4.306493
935406e4-caf1-4a8f-b562-304e76dc9d39
wincle626/LibrePilot
ground/gcs/src/libs/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp
#include <Eigen/Dense> #include <iostream> using namespace std; using namespace Eigen; int main() { ArrayXXf a(2,2); a << 1,2, 3,4; cout << "(a > 0).all() = " << (a > 0).all() << endl; cout << "(a > 0).any() = " << (a > 0).any() << endl; cout << "(a > 0).count() = " << (a > 0).count() << endl...
ALGO
0.951685
3.835741
d7128d13-424d-4ad6-a231-3b808a73e305
hoanpvpv/DSAPTIT
DSA05030 - DI CHUYỂN VỀ GỐC TỌA ĐỘ.cpp
#include <bits/stdc++.h> #define ll long long using namespace std; ll dp[30][30]; int main() { int t, a, b; for (int i = 1; i <= 25; i++) dp[i][0] = dp[0][i] = 1; for (int i = 1; i <= 25; i++) for (int j = 1; j <= 25; j++) dp[i][j] += dp[i - 1][j] + dp[i][j - 1]; cin >> t; ...
ALGO
0.999385
4.830174
e41d8905-e7f6-4b5f-b319-2d7baf2df7d4
DVNSHX/algorithms
maxsubarraysum.cpp
// A Divide and Conquer based program for maximum subarray sum problem #include <iostream> #include <limits.h> using namespace std; // A utility funtion to find maximum of two integers int max(int a, int b) { return (a > b)? a : b; } // A utility funtion to find maximum of three integers int max(int a, int b, int c) ...
ALGO
0.999955
4.83152
87e7f5c9-9408-42de-8e4a-3cc45d1e7ab8
Sylvia0831/2021_HUST_CSE_Operating_system_experiment
exp2/exp2_8_deadlock/exp2_8_deadlock/exp2_8_deadlock.cpp
//哲学家问题-有死锁 #include <windows.h> #include <cstdio> #include <ctime> #include <cstdlib> using namespace std; const unsigned PhiCnt = 5; //哲学家数量 const unsigned sleepTime = 3000; bool exxitflag = true; //用于退出的标志 int phiS[PhiCnt]; //每个哲学家的筷子(0:思考,1:一只筷子,2:进餐) int diningCnt = 0; CRITICAL_SECTION cse;//临界区 HANDLE s[PhiCn...
ALGO
0.999594
3.484589
26e4e687-7eff-4f29-a247-12e9a644e867
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_test_72_2.cpp
#include <bits/stdc++.h> using namespace std; template <typename Tp> void read(Tp &num) { num = 0; auto f = 1; char c = getchar(); while (!isdigit(c)) c == '-' ? f = -1 : 1, c = getchar(); while (isdigit(c)) num = num * 10 + (c ^ 48), c = getchar(); num *= f; } template <typename Tp, typename... etc> void r...
ALGO
0.999575
3.217119
20b190d3-8033-4f3b-aa9c-d031d33e14b8
NUS-HcRL/cloth_opt
deps/libigl/include/igl/copyleft/progressive_hulls.cpp
IGL_INLINE bool igl::copyleft::progressive_hulls( const Eigen::MatrixXd & V, const Eigen::MatrixXi & F, const size_t max_m, Eigen::MatrixXd & U, Eigen::MatrixXi & G, Eigen::VectorXi & J) { int m = F.rows(); Eigen::VectorXi I; return decimate( V, F, progressive_hulls_cost_and_placement, ...
ALGO
0.998531
6.009455
c6009181-269c-4aa9-b7b8-585b50d1f5f2
aprankhunger/DSA-CPP
1-two-sum/two-sum.cpp
class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { unordered_map<int, int> _map; for (int i = 0; i < nums.size(); ++i) { int num = nums[i]; int complement = target - num; auto it = _map.find(complement); if (it != _map.end()) { // found return {it->second, i...
ALGO
0.999505
6.435152
ee2ced53-66b9-4beb-8fbb-431fedde13c4
mvanshbu0681/DSA
CharcterArray/String/String_streams.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <sstream> using namespace std; int main() { string str; // Read input string from standard input getline(cin, str); stringstream ss(str); char ch; int num; // Read integers separate...
ALGO
0.974186
4.984694
1b790bae-3441-4642-93f4-9e441c3684aa
pratyush2331/DSA_Love-Babbar
10. Tree/1. Binary Tree/X_10_CountCompleteTreeNodes.cpp
// 222. Count Complete Tree Nodes // LeetCode : https://leetcode.com/problems/count-complete-tree-nodes #include<bits/stdc++.h> using namespace std; // using property of CBT /* TC : O( (logn)^2 ) SC : O(logn) */ class Solution { public: Solution() { ios_base::sync_with_stdio(false); cin.tie(NULL)...
ALGO
0.999755
6.145081
c4ea46ec-5507-45fb-a775-673f79a19bd8
HASAN-49/Competitive-Programming
LightOJ/Math/Trailing_Zeroes_i.cpp
// Problem Link --> https://lightoj.com/problem/trailing-zeroes-i // بسم الله الرحمن الرحيم #include<bits/stdc++.h> using namespace std; #define test int t; for(cin >> t; t; t--) #define ll long long #define ull unsigned long long #define ld long double #define all(a) a.begin(), a.end() #define allr(a) a.rbegin(), ...
ALGO
0.999935
5.709748
99077d67-64b0-4ea9-a1d9-9298d4ed7f06
Hk0509/Leetcode-Solutions
Climbing Stairs.cpp
// 18 Feb class Solution { public: int dp[50]; int solve(int n){ if(n < 0) return 0; if(n <= 0) return 1; if(dp[n] != -1) return dp[n]; return dp[n] = solve(n-1) + solve(n-2); } int climbStairs(int n){ memset(dp, -1, sizeof(dp)); return solve(n); } };...
ALGO
0.999985
5.927784
4d79302a-319d-4169-a3d0-069428101bfa
ACM-Obsidian/Obsidian
2013-08-06/1001.cpp
#include <cstdio> #include <cctype> #include <cassert> #include <algorithm> #include <cmath> #include <vector> using namespace std; const double eps = 1e-6, inf = 1000000000; inline int ScanInt(void) { int r = 0, c, d; while (!isdigit(c = getchar()) && c != '-'); if (c != '-') r = c - '0'; d = c; while ( isdigit...
ALGO
0.999988
4.377839
11a468a1-bd94-4e31-b539-da9e39a4df4c
yiperzhou/OCR-based-helper-Android-app
tesseract-3.03-rc1/tesseract-3.03/ccstruct/quadlsq.cpp
#include <stdio.h> #include <math.h> #include "quadlsq.h" #include "tprintf.h" // Minimum variance in least squares before backing off to a lower degree. const double kMinVariance = 1.0 / 1024; /********************************************************************** * QLSQ::clear * * Function to initialize a QLSQ. ...
ALGO
0.989737
6.26833
0d3bda98-4e5a-42ae-a1a2-c1472a656aeb
giangnamG/PTIT-Source-Code
CodePTIT- C/code/CTest039-SapXepChuSo.cpp
#include <stdio.h> #include <string.h> void xoa(char s[], int index) { int n = strlen(s); for (int i = index; i < n; i++) s[i] = s[i+1]; s[n-1] = '\0'; } void process() { char s[20]; scanf("%s", &s); int n = strlen(s); for (int i = 0; i < n; i++) for (int j = i+1; j < n; j++...
ALGO
0.999852
3.845077
22a6f282-5105-4845-b6b9-629573d58ffa
Anshul758/DSA-Codes
Queue/queue_using_Stack.cpp
// Method 1 of implementing Queue using two stacks #include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> using namespace std; // using namespace __gnu_pbds; // Policy based data structure // template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; #de...
ALGO
0.998638
4.197261
afce6c8c-97b2-44e1-a574-eaf68bda2979
Creep-9527/leetcodSolutions
513.找树左下角的值.cpp
/* * @lc app=leetcode.cn id=513 lang=cpp * * [513] 找树左下角的值 */ #include<algorithm> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode() : val(0), left(nullptr), right(nullptr) {} TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} TreeNode(int x, ...
ALGO
0.999992
6.791758
20624f28-0de7-4d62-9701-7953eb4a7a2e
ShisuiMadara/450DSA
maximumSubMatrixwithSum0.cpp
// { Driver Code Starts //Initial Template for C++ #include<bits/stdc++.h> using namespace std; // } Driver Code Ends //User function Template for C++ class Solution{ public: pair<int,int> isThere(vector<vector<int>>a, vector<int>temp) { int m = temp.size(); int n = a.size(); int m...
ALGO
0.998739
5.657826
75cc4bc5-36d9-4383-9d55-c5b0b0f54aca
ipc-sim/ipc-toolkit
tests/src/tests/distance/test_edge_edge_mollifier.cpp
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_approx.hpp> #include <catch2/generators/catch_generators.hpp> #include <ipc/distance/edge_edge_mollifier.hpp> #include <finitediff.hpp> using namespace ipc; std::array<Eigen::Vector3d, 4> get_edges() { Eigen::Vector3d ea0, ea1, eb0, eb1; SECTION...
TEST
0.979482
7.205466
8d2cd894-9f83-4552-92a8-70e9c66384b3
soapingtime/farcry1.34
SourceCode/CrySystem/ZipDirFindRW.cpp
#include "stdafx.h" #include "MTSafeAllocator.h" #include "smartptr.h" #include "ZipFileFormat.h" #include "ZipDirStructures.h" #include "ZipDirTree.h" #include "ZipDirCacheRW.h" #include "ZipDirFindRW.h" #include "StringUtils.h" bool ZipDir::FindFileRW::FindFirst (const char* szWildcard) { if (!PreFind (szWildcard))...
TOOL
0.900023
5.549551
8f9c44d2-5fbd-4193-bc80-91ccff8d3993
prof-rice/cse1325-prof-202001
P10/bonus/polynomial.cpp
#include "polynomial.h" #include <cmath> Polynomial::Polynomial() { } Polynomial::Polynomial(std::istream& ist) { int tsize; ist >> tsize; while(tsize--) _terms.push_back(Term{ist}); } void Polynomial::save(std::ostream& ost) { ost << _terms.size() << '\n'; for(auto t : _terms) t.save(ost); } void Pol...
ALGO
0.998462
5.064429
2eee2fea-8a4e-441f-a586-535cac09564d
ishandutta2007/codeforces
gyz_gyz/normal/628/D.cpp
#include<bits/stdc++.h> #define rep(i,x,y) for(int i=(x);i<=(y);++i) #define dep(i,x,y) for(int i=(x);i>=(y);--i) #define add(x,y) if((x+=(y))>=mo)x-=mo #define mo 1000000007 using namespace std; typedef long long ll; int n,m;ll a[2][2010]; ll cal(string s){ int l=s.length()-1,tt=0;bool t=0,fl=1; rep(i,0,n-1)a[0][i]=...
ALGO
0.999967
4.293598
92c4c2c4-82da-489e-bf4c-2b90f2448f3a
ShrutiPundir17/LeetCode
0094-binary-tree-inorder-traversal/0094-binary-tree-inorder-traversal.cpp
class Solution { public: vector<int> inorderTraversal(TreeNode* root) { vector<int> ans; stack<TreeNode*> st; TreeNode* curr = root; while (curr || !st.empty()) { while (curr) { st.push(curr); curr = curr->left; } ...
ALGO
0.999997
6.781607
2acbce60-63ce-4b07-a830-1bf5d9e0d812
Yasirraiyan/Leet-Code-SolvIing-Problem
Leetcode 2220 Minimum Bit Flips to Convert a Number/Question.cpp
A bit flip of a number x is choosing a bit in the binary representation of x and flipping it from either 0 to 1 or 1 to 0. For example, for x = 7, the binary representation is 111 and we may choose any bit (including any leading zeros not shown) and flip it. We can flip the first bit from the right to get 110, flip th...
ALGO
0.999866
5.698963
8f5e57f0-2ca8-4b42-93b7-25bb523a4d2b
shourygupta28/6-Companies-30-days
Amazon/Q12.Column_name_from_column_number.cpp
class Solution { public: string colName(long long int n) { // your code here string ans = ""; while (n) { char ch = (n - 1) % 26 + 65; ans = ch + ans; n = (n - 1) / 26; } return ans; } };
ALGO
0.999979
5.591412
073499dd-7025-4c00-add0-3d0044f93dc6
AadityaVaishwar/DSAPractice
Pattern Questions/pattern16_repeated_alphabet.cpp
<<<<<<< HEAD /* Q16. print the pattern: A B B C C C D D D D E E E E E F F F F F F */ #include <iostream> using namespace std; void pattern16(int n) { if (n <= 0) { return; } if (n>26) { cout<<"Please enter a number between 1 and 26 inclusive."; return; } for (...
ALGO
0.987576
4.481767
1bd4f5ed-61f9-4ee8-af41-fe2af0c38fc5
ShashwatDev-IIITBBSR/CrackYourPlacementChallenge
Array/Maximum Index.cpp
class Solution{ public: // A[]: input array // N: size of array // Function to find the maximum index difference. int maxIndexDiff(int A[], int N) { int maxi=0; for(int i=0;i<N;i++) { for(int j=N-1;j>i;j--) { if(A[j]>=A[i...
ALGO
0.999888
5.304976
b687ab96-ddaa-463c-853c-883151ced08f
StreamBuns/C-code
AcquianticeC++/C++DS/C++DS/main.cpp
#include <iostream> #include <cassert> #include <cstdlib> #include <ctime> using namespace std; typedef int T; const int defaultSize = 100; class SeqList { private: T* data;//指向动态内存分配数组的指针 int maxSize;//动态内存分配数组的大小 int last;//标识顺序表中最后一个元素的位置 void Resize(int newSize) { maxSize = newSize; ...
ALGO
0.999874
3.304281