uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
921de3d8-7a54-4757-988c-a7e09dbdf5fe
Lucky4604/DataStructers_CPP
stack/longestValidParanthesis.cpp
#include<bits/stdc++.h> using namespace std; int validParanthesis(string &s){ stack<int>st; int maxLen=0; st.push(-1); for(int i=0;i<s.length();i++){ if(s[i]=='('){ st.push(i); }else{ st.pop(); //check whether stack is empty or not if(st.e...
ALGO
0.998169
4.507215
32ee481b-4237-4e6d-aff7-dc6b1da9a766
CobaltXII/boiler
experimental/n_body_image.cpp
// Emptyness? Awesome. #define STB_IMAGE_WRITE_IMPLEMENTATION #include "../boiler/stb/stb_image_write.hpp" #include <vector> #include <utility> #include <sstream> #include <iostream> typedef float real; inline real degrad(real x) { return 2.0f * M_PI * (x / 360.0f); } struct body { real x; real y; real vx; ...
ALGO
0.991832
5.157331
393d8b19-9cbb-4512-8f14-502d84ff122b
Shahraaz/CP_P_S5
Atcoder/Beginner160/d.cpp
// Optimise #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; // #define MULTI_TEST #ifdef LOCAL #include "/home/shahraaz/bin/debug.h" #else #define db(...) #define pc(...) #endif #define f first #define s second #de...
ALGO
0.999899
4.264109
106e637b-e786-409d-a5d6-ae0c57717b5c
NishuSharma18/ImportantQuestions
SQRT_Decomposition.cpp
#include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll long long #define iv(v) for(auto & v1:v) cin>>v1 #define all(v) v.begin(),v.end() #define allr(v) v.rbegin(),v.rend() #define removeDuplicate(v) v.erase(unique(all(v)),v.end()) #define yes cout<<"YES\n"; #def...
ALGO
0.998833
3.703438
ccb32174-bd54-4c2b-8d47-fed090fa5b6c
mariokonrad/maze
Create_GrowingTree_Oldest.cpp
#include "Create_GrowingTree_Oldest.hpp" PositionVec::iterator Create_GrowingTree_Oldest::choose(PositionVec & pos) { return pos.begin(); }
ALGO
0.991882
3.022254
b30cbe2d-b2ac-4f0c-8b47-f3335ce2d62e
LargerPanda/LoomIO
src/boost/libs/spirit/example/x3/calc/calc4b.cpp
/////////////////////////////////////////////////////////////////////////////// // // A Calculator example demonstrating generation of AST. The AST, // once created, is traversed, 1) To print its contents and // 2) To evaluate the result. // // [ JDG April 28, 2008 ] For BoostCon 2008 // [ JDG February 18, 20...
TOOL
0.938591
7.845002
d2d93839-312a-49cb-8e1b-31afb129c7c3
cse-child/Study_Coding_Test
Study_Coding_Test/Programmers/Level2/이진_변환_반복하기.cpp
#include <string> #include <vector> #include <iostream> using namespace std; string ChangeBinaryNum(int num) { string result = ""; while (num >= 1) { result = to_string(num % 2) + result; num /= 2; } return result; } vector<int> solution(string s) { vector<int> answer(2); ...
ALGO
0.999506
4.716549
85a2f9b4-4861-4ec9-bcbb-e5bb06020ff5
rpujan/algo
leetcode/one/cpp/0787-cheapest-flights-within-k-stops.cpp
/* Given cities connected by flights [from,to,price], also given src, dst, & k: Return cheapest price from src to dst with at most k stops Dijkstra's but modified, normal won't work b/c will discard heap nodes w/o finishing Modify: need to re-consider a node if dist from source is shorter than what we ...
ALGO
0.999896
6.325782
71dcbe5e-6f2b-424f-9c57-8d857fa62916
npkhang99/Competitive-Programming
School/Index.cpp
#include <iostream> #include <stdio.h> #include <bitset> using namespace std; const int N=31250009; int n, m; bitset<32> a[N]; //--------------------------------------------------------- void xuly(){ int i=0, d=0; while (d<m){ if(!a[i >> 5].test(i & 31)){ cout<< i<< " "; d++; } ...
ALGO
0.999852
3.081913
ef4990cd-980e-48a7-aa42-260d47da67e3
whitehatty/Programming-Principles-and-Practice-Using-Cpp
Programming-code/Chapter05/chapter.5.7-better.cpp
// // This is example code from Chapter 5.7 "Logic Errors" of // "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup // #include "std_lib_facilities.h" //------------------------------------------------------------------------------ int main() { double temp = 0; double sum = 0; doubl...
ALGO
0.995937
6.619898
5d547ca0-a603-4f77-925d-a44d78648f65
Vaishnavi1193/day-3
array.cpp
#include<iostream> using namespace std; int main(){ int n;int i; int max=0; cout<<"Enter number of values:"; cin>>n; cout<<"Enter values in array:\n"; int arr[n]; for(i=0;i<n;i++) { cin>>arr[i]; } for(int u=0;u<=n;u++){ if (arr[u]>max) max=arr[u]; } int *pointer= &max; cout<<"Lar...
ALGO
0.999326
3.72923
a8b1ec05-1182-43da-a6b9-faba98289cd8
chickshuang/homework1-0105
homework02/main.cpp
#include <QDebug> #include <QTextStream> #include <QFile> #include<QList> #include <QCoreApplication> #define N 7 namespace SK { enum SortKind{ col01 = 0x00000001<<0, //!< 第1列 col02 = 0x00000001<<1, //!< 第2列 col03 = 0x00000001<<2, //!< 第3列 col04 = 0x00000001<<...
ALGO
0.984868
4.097051
22cc7e14-61b2-4257-9b6a-c19d6e363198
liyirui-git/LeetCode
my_solution/17/solution.cpp
// // Created by 11029 on 2020/6/12. // class Solution { public: vector<string> letterCombinations(string digits) { vector<string> result; // 存储0-9对应的字母,当然0跟1是没有用的 string table [10] = {"", "", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"}; // 还没想好这里怎么处理 for(int i...
ALGO
0.999937
6.615391
c9b53ec4-dedc-410a-839f-a2f3316f4b0f
H-Shen/MyCodeCollection
Leetcode/2716/2716.cpp
class Solution { public: int minimizedStringLength(string s) { constexpr int MAXN = 26; bitset<MAXN> bs; int cnt = 0; for (const auto&i : s) { if (!bs[i - 'a']) { bs[i - 'a'] = true; ++cnt; } } return cnt; } ...
ALGO
0.999864
6.056732
09c3cf18-470f-4bca-ad06-fafd4cc6f5a9
devargha/Strivers-SDE-Sheet-Challenge
Array 2/merge_intervals.cpp
class Solution { public: vector<vector<int>> merge(vector<vector<int>>& m) { vector<vector<int>> ans; sort(m.begin(),m.end()); for(int i=0;i<m.size()-1;i++){ for(int j=0;j<m[0].size()-1;j++){ if(m[i][j+1]>=m[i+1][j]){ if(m[i+1][j+1]<=m[i][j+1])...
ALGO
0.999995
5.522279
af370d4f-e8c0-4766-9d34-3aff039ee899
noko206/AtCoder
abc/151-200/159/e.cpp
#include <bits/stdc++.h> using namespace std; #define _overload3(_1,_2,_3,name,...) name #define _REP(i,n) REPI(i,0,n) #define REPI(i,a,b) for(int i=int(a);i<int(b);++i) #define REP(...) _overload3(__VA_ARGS__,REPI,_REP,)(__VA_ARGS__) #define ALL(a) (a).begin(),(a).end() #define ALLR(a) (a).rbegin(),(a).rend() typedef...
ALGO
0.999675
4.083183
1bc763b3-b0ac-43ce-848b-8d10139bf5d4
ishandutta2007/codeforces
xellos/normal/930/D.cpp
#include <bits/stdc++.h> // iostream is too mainstream #include <cstdio> // bitch please #include <iostream> #include <algorithm> #include <cstdlib> #include <vector> #include <set> #include <map> #include <queue> #include <stack> #include <list> #include <cmath> #include <iomanip> #include <time.h> #define dibs reserv...
ALGO
0.99979
3.85321
194504cb-60e7-4a10-b7db-d87a4c0b8fd2
JonnyOu/NYOJ
519.cpp
#include<stdio.h> #include<string.h> #define maxn 105 int main() { int T; scanf("%d", &T); while (T--) { char s[maxn]; scanf("%s", s); int len = strlen(s), a[6], note; memset(a, 0, sizeof(a)); for (int i = 0; i < 6; i++) { note = i; for (;;) { if (note >= len) break; a[i] += s[note]; note...
ALGO
0.999479
4.158429
c9c8401a-efea-4ee4-b6f6-083713336470
Ankush-Ladani/DSA-SUPREME-BATCH
Searching and Sorting/Find_Missing.cpp
#include <iostream> using namespace std; int missingNumber(int arr[], int n) { int left = 0; int right = n - 1; int mid; while (left <= right) { mid = left + (right - left) / 2; if (arr[mid] != mid + 1 && arr[mid - 1] == mid) { return mid + 1; } i...
ALGO
0.999369
4.865741
b14e72cb-6f49-45e0-85cd-001d9d4792f0
carlosh93/SC-SSC
Toolbox/spams-matlab-v2.6/prox/mex/mexFistaGraph.cpp
#include <mex.h> #include <mexutils.h> #include <fista.h> // alpha = mexFistaGraph(X,D,alpha0,graph,param) using namespace FISTA; template <typename T> inline void callFunction(mxArray* plhs[], const mxArray*prhs[], const int nlhs) { if (!mexCheckType<T>(prhs[0])) mexErrMsgTxt("type of argument 1 is ...
ALGO
0.998366
6.312537
0b470bc4-b63e-4f98-9746-8c0782aca77e
twoachin/twoachin.io
zh-hant/codes/cpp/chapter_hashing/hash_map_open_addressing.cpp
/** * File: hash_map_open_addressing.cpp * Created Time: 2023-06-13 * Author: krahets (<EMAIL>) */ #include "./array_hash_map.cpp" /* 開放定址雜湊表 */ class HashMapOpenAddressing { private: int size; // 鍵值對數量 int capacity = 4; // 雜湊表容量 const double loadThres...
ALGO
0.996399
6.210911
2e1384b2-ba45-4325-9e8b-3537951a5a80
thanhit95/multi-threading
cpp/cpp-boost/exer02b03-producer-consumer.cpp
/* THE PRODUCER-CONSUMER PROBLEM SOLUTION TYPE B: USING SEMAPHORES Version B03: 2 fast producers, 1 slow consumer */ #include <iostream> #include <queue> #include <boost/chrono.hpp> #include <boost/thread.hpp> #include "mylib-semaphore.hpp" using namespace std; void producer( mylib::Semaphore* semFill, m...
ALGO
0.99687
4.985012
2281b4f6-cfa9-47dc-ae29-ecf7930c0d22
anusar01/-CrackYourInternship
442-find-all-duplicates-in-an-array/find-all-duplicates-in-an-array.cpp
class Solution { public: vector<int> findDuplicates(vector<int>& nums) { vector<int> result; for(int i=0;i<nums.size();i++){ int index=abs(nums[i])-1; if(nums[index]<0){ result.push_back(abs(nums[i])); }else{ nums[index]=-nums[index...
ALGO
0.999979
5.72827
5e4dcc0d-d45e-4da4-92fd-755c17426f7b
celestialxevermore/BaekjoonOnlineJudge
Baekjoon/Baekjoon/게리맨더링.cpp
//#include<iostream> //#include<vector> //#define MAX 10000 //#include<queue> //#include<algorithm> //#include<math.h> // //using namespace std; // // //vector<int>N[MAX]; //bool visited[MAX]; //int p[MAX]; // //int mini = 100000; //int res = 0; //int total = 0; // //int n; //int R; // //int flag = 0; //void DFS2(int s...
ALGO
0.999666
3.100093
6d15d185-d0e2-48d8-9b7d-c2dc0cd0198c
someoneAlready/Summer-Code
ZZU/team4/4274.cpp
#include <iostream> #include <algorithm> #include <vector> #include <map> #include <stack> #include <queue> #include <cstdio> #include <cstdlib> #include <cstring> #include <climits> #include <cmath> #include <ctime> #include <cctype> using namespace std; template <class T> T checkmax(T &a, T b){ if (a==-1 || b>a) a=...
ALGO
0.999865
3.251285
528c1ffd-fa86-48a0-b0ec-5dd0597cdca5
Loganrobinso/Datastructures-algorithms
LeetCode/878.nth-magical-number.cpp
int countMultiples(long long x, long long a, long long b) { // get # of multiples of a or b in range [1, x] long long lcm = a * b / __gcd(a, b); return x/a + x/b - x/lcm; } class Solution { public: int nthMagicalNumber(int n, int a, int b) { // a = 2, b = 3 in our example long long lo =...
ALGO
0.999961
5.867321
faab3582-9b9c-47dd-9581-c60d7f6625e9
ishandutta2007/codeforces
zx2003/normal/949/C.cpp
#include<bits/stdc++.h> using namespace std; const int N=100005; int low[N],dfn[N],st[N],w,xb,sz[N],sccno[N],cnt,ans,id; int n,m,H,u[N],i,x,y,h[N]; struct edge{int to,next;}e[N<<1]; inline void addedge(int x,int y){ e[++xb]=(edge){y,h[x]};h[x]=xb; } void dfs(int x){ low[x]=dfn[st[++w]=x]=++xb; for(int i=h[x];i;i=e[i...
ALGO
0.999995
3.740389
dff9f28b-920e-4fcc-936e-92d9c10f8738
Pavan-B-N/DSA-with-C_plus_plus
Heap/MergeKSortedArray.cpp
/* Given K sorted arrays arranged in the form of a matrix of size K*K. The task is to merge them into one sorted array. Input: K = 3 arr[][] = {{1,2,3},{4,5,6},{7,8,9}} Output: 1 2 3 4 5 6 7 8 9 Input: K = 3, N = 4, arr = { {1, 3, 5, 7}, {2, 4, 6, 8}, {0, 9, 10, 11}} Output: 0 1 2 3 4 5 6 7 8 9 10 11 */ #include <i...
ALGO
0.999996
6.289987
4c5009ed-f1a6-4551-9467-aa2d04b112e1
prathampithalia/CP
LeetCode/2221.cpp
class Solution { public: int triangularSum(vector<int>& nums) { while (nums.size() != 1) { vector<int> v{}; for (int i = 1; i < nums.size(); i++) { v.push_back((nums[i] + nums[i - 1]) % 10); } nums = v; } return nums[0]; } };
ALGO
0.999904
6.567268
3611bb4b-0a4b-458f-b6a1-4d1da0aaed6d
Hackeries/CP
Questions/A/lab.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int cs = 0; int ms = 0; int arr[n]; for(int i=0;i<n;i++){ cin >> arr[i]; } for(int i=0;i<n;i++){ cs+=arr[i]; if(cs < 0){ cs = 0; } else if(ms > cs){ ...
ALGO
0.99998
3.963264
d7b0fcc3-853f-4804-b549-931b55160404
bbackspace/codechef
JUNE15/ANCOIMP/brute.cpp
#include<cstdio> #include<ctime> #include<cstdlib> #include<cstring> #include<climits> #include<cctype> #include<cassert> #include<algorithm> #include<vector> #include<deque> #include<map> typedef long long ll; using namespace std; #define si(x) scanf("%d", &(x)) #define sll(x) scanf("%lld", &(x)) #define ss(x) scanf("...
ALGO
0.99866
3.99797
e0935063-4dc8-4d21-a75c-69f0de4b3e71
marioyc/Online-Judge-Solutions
TJU/1943 - Gleaming the Cubes.cpp
#include <cstdio> using namespace std; #define min(x,y) (x)<(y)? (x):(y) #define max(x,y) (x)>(y)? (x):(y) int main(){ int n,x[1000],y[1000],z[1000],d[1000]; int xl,xh,yl,yh,zl,zh,ans; while(true){ scanf("%d",&n); if(n==0) break; for(int i=0;i<n;++i) scanf("%d %d %d ...
ALGO
0.999179
3.129996
87e6abf7-135d-4939-a458-9fcb841514b9
alexandraback/datacollection
solutions_5756407898963968_0/C++/piob/sol.cpp
#include <bits/stdc++.h> #define FWD(a,b,c) for(int a=(b); a<(c); ++a) using namespace std; int T[23]; int main(){ int zz; scanf("%d", &zz); FWD(z,1,zz+1){ FWD(i,1,17) T[i] = 0; int a; scanf("%d", &a); FWD(i,0,4) FWD(j,0,4){ int x; scanf("%d", &x); if(a-1 == i) ++T[x]; } scanf("%d"...
ALGO
0.997467
3.588361
f607482a-4e96-4fb9-acfe-1662229866cf
showkat2203/UVa
tried_list/tried_list/1585.cpp
#include<cstdio> #include<cstring> #include<cstdlib> #include<cmath> using namespace std; int main() { long long tst, i,j,k,l,n,m,sum; scanf("%lld\n",&tst); char A[1000]; while(tst--) { scanf("%s",A); int sum = 0; n = 0; for(i=0; i<strlen(A); i++) { ...
ALGO
0.99967
3.998031
17ade5c5-6e86-4af5-9d88-24eae7b74ade
Skywt2003/codes
LUOGU/P3951/xiaokai.cpp
#include<bits/stdc++.h> #define int long long using namespace std; int a,b; signed main(){ scanf("%lld%lld",&a,&b); printf("%lld\n",a*b-a-b); return 0; }
ALGO
0.999844
3.390193
756b0eca-b12f-4e16-a940-a4fc45208c76
Eeman1113/Leetcode
Problems/481.cpp
class Solution { public: string licenseKeyFormatting(string s, int k) { string ans; int length = 0; for (int i = s.length() - 1; i >= 0; --i) { if (s[i] == '-') continue; if (length > 0 && length % k == 0) ans += "-"; ans += toupper(s[i]); ++length; } ret...
ALGO
0.994902
6.298258
fc14cdc5-b3ca-4cdb-8975-33a6bbdc5b71
louhc-oi/code
ac.nowcoder.com/acm/contest/1046/B/code.cpp
#include<bits/stdc++.h> using namespace std; #define i64 long long #define fp( i, b, e ) for ( int i(b), I(e); i <= I; ++i ) #define fd( i, b, e ) for ( int i(b), I(e); i >= I; --i ) #define go( i, b ) for ( int i(b), v(to[i]); i; v = to[i = nxt[i]] ) template<typename T> inline void cmax( T &x, T y ){ x < y ? x = y : ...
ALGO
0.999406
3.620579
ca14a74a-40da-47eb-be5b-8dc0d57ba49e
HarshitSingh1534/Assignment
Q1_Product_Of_Digits_of_a_Number.cpp
#include <iostream> #include <cstdlib> int calculateDigitProduct(int number) { long long int product = 1; while (number!=0){ product *= (number % 10); number /=10; } return product; } int main() { long long int number; std::cout << "Please Enter an Integer "; std::cin >...
ALGO
0.999871
5.797416
2d09ccc6-5772-41d7-b126-0bc1d9b6bd06
lijiaxin-dut/leetcode
leetcode_train/Solution_713.cpp
#include<vector> #include<unordered_map> #include<algorithm> using namespace std; class UF { public: vector<int>root; int count; UF(int n) { count = n; root.resize(n); for (int i = 0; i<n; i++) root[i] = i; } int find(int p) { int p_root = p; while (p_root != root[p_root]) p_root = root[p_root]; ...
ALGO
0.999967
5.771684
aa83d970-1305-4881-8372-1a45de492420
xidianlina/cpp
eight_cubes.cpp
//#include <iostream> // //double cube(double a); //double recube(double &a); // //int main() //{ // using namespace std; // // double x = 3.0; // // cout << cube(x); // cout << " = cube of " << x << endl; // cout << recube(x); // cout << " = cube of " << x << endl; // // return 0; //} // //double cube(double a) //{ //...
TOOL
0.920303
5.057942
0bb5a142-799e-4749-b665-b50fcd1b5ab4
luyuan2002/leetcodes
leetcodes/src/cn/xiaoyes/leetcode-main/lcof/面试题14- II. 剪绳子 II/Solution.cpp
class Solution { public: int cuttingRope(int n) { const int mod = 1000000007; if (n < 4) return n - 1; long long ans = 1; while (n > 4) { ans = ans * 3 % mod; n -= 3; } if (n == 4) return ans * 4 % mod; return ans * n % mod;...
ALGO
0.999996
5.710369
b25ccdef-ad75-4d74-b4a8-6731c23ab0d4
Chirag-creator17/450-dsa-questions
stack,heap/k-closest-no.cpp
#include<bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n,k,x; cin>>n>>k>>x; int a[n]; for(int i=0;i<n;i++){ cin>>a[i]; } priority_queue<pair<int, int>> maxh; for(int i=0;i<n;i++) { maxh.push({a[i]-x,a[i]}); ...
ALGO
0.999979
3.22907
4f6246ed-a214-4556-a04d-5f5b56e888a9
ishandutta2007/codeforces
forza_ferrari/normal/1646/E.cpp
#include<iostream> #include<cstdio> #include<map> using namespace std; #define int long long int n,m,val[21],ans; bool vis[1000001*20]; signed main() { cin>>n>>m; for(int i=1;i<=20;++i) { val[i]=val[i-1]; for(int j=1;j<=m;++j) if(!vis[i*j]) { ++val[i];...
ALGO
0.999935
3.359134
6a466bae-58b2-4fed-8bc3-5ee62c33b96c
Dendup1234/favorite_word_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.998733
6.76775
4adc57ff-f974-4682-8901-6717af433f47
GauravN0910/codeforces-cpc
GardenerAndTree.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; while(t--){ int n, k; cin>>n>>k; map<int, set<int>> graph; vector<int> degree(n+1); for(int i=1;i<n;i++){ int u, v; cin>>u>>v; degree[u]++; degree[...
ALGO
0.999915
4.849788
643c0ecb-8015-410e-93a5-498c2a9d2241
LionArt/cpp-SPOJ-easy
RODZ_TRO - Rodzaje trójkątów/RODZ_TRO - Rodzaje trójkątów.cpp
/* Andrulewicz Artur RODZ_TRO - Rodzaje trjktw 2018-06-28 */ #include <iostream> #include <cmath> using namespace std; bool istnieje(int a,int b,int c) { if(a>=(b+c)) return false; if(b>=(a+c)) return false; if(c>=(a+b)) return false; return true; } bool prostokatny(int a,int b,int c) { ...
ALGO
0.999017
4.086552
61151436-cfb7-42c8-8f95-6f2048702fca
sammochen/cp-submissions
codeforces/1295B.cpp
/* Original problem: Author: sammochen */ #define _CRT_SECURE_NO_WARNINGS #include "bits/stdc++.h" using namespace std; #define REP(x,l,u) for(ll x = l;x<u;x++) #define RREP(x,l,u) for(ll x = l;x>=u;x--) #define PII pair<int,int> #define PLL pair<ll,ll> #define MP make_pair string to_string(string s) {return s;} s...
ALGO
0.99987
4.000406
cb8c2661-92b3-45ed-bf1b-fc822841d0bb
deepak2k03/DSA
07_Recursion/01_print1ton.cpp
/* ██████╗ ███████╗███████╗██████╗ █████╗ ██╗ ██╗██████╗ ██╗ ██╗ ██████╗ ██████╗ ██╔══██╗██╔════╝██╔════╝██╔══██╗██╔══██╗██║ ██╔╝╚════██╗██║ ██╔╝██╔═══██╗╚════██╗ ██║ ██║█████╗ █████╗ ██████╔╝███████║█████╔╝ █████╔╝█████╔╝ ██║ ...
ALGO
0.999968
4.883012
e8df44d8-7b6a-4599-a90c-2f1c597134a6
wada811/AOJ
vol100/AOJ10015.cpp
// AIZU ONLINE JUDGE http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=10015 //* #include <stdio.h> #include <stdbool.h> int main(){ int i, j, n; char mark; char marks[4]={'S', 'H', 'C', 'D'}; int num; bool cards[4][13]={false}; scanf("%d ", &n); for(i=0;i<n;i++){ scanf("%c ...
ALGO
0.989737
3.072292
3ed2c6cc-25c9-4f96-82c5-ae0ae82b0b8a
Shivampandoh/cpp
internship/pointer2.cpp
#include <iostream> using namespace std; int main(){ // Declare and initialize pointer int* p_number {}; // Will initialize with nullptr double* p_fractional_number{}; // Explicitly initialize with nullptr int* p_number1{nullptr}; double* p_fractional_number1{nullptr}; // Pointers to different variables a...
TOOL
0.959674
3.210441
a9d89072-8ce8-4359-9bcd-014038ce1797
thepluck/CP-Training
Onlinejudges/Codeforce/1453A.cpp
// Problem: A. Cancel the Trains // Contest: Codeforces - Codeforces Round #688 (Div. 2) // URL: https://codeforces.com/contest/1453/problem/A // Memory Limit: 512 MB // Time Limit: 1000 ms // // Powered by CP Editor (https://cpeditor.org) #include <bits/stdc++.h> using namespace std; int mark[105], timer; int mai...
ALGO
0.999814
4.974552
2721c1b8-60e8-41c4-8d42-50305bae004d
PixelOS-Fourteen/android_external_libcxx
test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
// <numeric> // UNSUPPORTED: c++98, c++03, c++11, c++14 // template<class InputIterator, class OutputIterator, class T, // class BinaryOperation, class UnaryOperation> // OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last, // OutputItera...
TEST
0.991595
7.152948
c287e05b-44b3-434c-aea9-05f778fda39c
Vishnu-3101/LeetCode150
BinarySearchTree/ValidateBST/ValidateBST.cpp
#include<bits/stdc++.h> using namespace std; class Solution1 { public: bool validate(TreeNode* root, TreeNode* min, TreeNode* max){ if(!root) return true; if((max && root->val>=max->val) || (min && root->val<=min->val)) return false; return validate(root->left, min, root) && validate(root->...
ALGO
0.999993
5.899869
184cb7b0-a7bd-4aca-b5d6-5c443069aa54
NYN31/CompetitiveProgramming
CP/Codeforces/div2.671/A.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back void solve() { int n ; cin >> n; string str ; cin >> str ; if(n % 2 == 1) { bool flag = false ; for(int i=0; i<n; i++) { if(i%2 == 0 && (str[i]-'0')%2 == 1) { flag = true ; break ; } } if(flag) cout << 1 ...
ALGO
0.9999
4.190066
e30dc3da-3051-4d93-928b-f4bee159db18
daman94/Coding-Problems
Linked-List/A6 - Selection Sort.cpp
#include <iostream> #include <stdio.h> using namespace std; //Functions void printList(struct node*); int length(struct node* head); void push(struct node** headRef, int data); struct node* findMinAndRemove(struct node** start); void selectionSort(struct node** headRef); struct node { int data; struct node* n...
ALGO
0.99989
4.753692
3e106f26-b6ec-40c4-a928-5b46fb7d8d29
denis-gubar/Leetcode
Greedy/1167. Minimum Cost to Connect Sticks.cpp
class Solution { public: int connectSticks(vector<int>& sticks) { int result = 0; multiset<int> S; for (int s : sticks) S.insert(s); while (S.size() > 1) { auto it1 = S.begin(); int sum = *it1; S.erase(it1); it1 = S.begin(); sum += *it1; S.erase(it1); result +=...
ALGO
0.999912
5.491902
f911358e-ff0c-4a3f-b452-945f7d5d6739
risk510/TeamXOS-neXgen2
Engine/utils.cpp
#include "utils.h" #include "Menu.h" #include "MapPath.h" extern MenuList Menu[9]; // Number of Menu Items char* GamePathFromFindFilesC (char* gamepath) { char * path = strrchr (gamepath,';'); if (path) { return path+1; } return gamepath; } char* RemanderpathFromFindFilesC(char* gamepath) { char * path = str...
TOOL
0.978212
3.399501
f4469ecf-6fc2-4b9d-9f38-161d3e3e88f2
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_9081_12.cpp
#include <bits/stdc++.h> using namespace std; int fastio() { ios_base::sync_with_stdio(false); cout << fixed << setprecision(10); cin.tie(nullptr); return 0; } int __fastio = fastio(); template <typename A, typename B> ostream &operator<<(ostream &os, const pair<A, B> &p); template <typename A> ostream &operato...
ALGO
0.999988
3.418142
e76b075c-1d30-4260-b549-d10a64af00f2
zealiumcoin/Zealium
src/masternode.cpp
#include "masternode.h" #include "addrman.h" #include "masternodeman.h" #include "obfuscation.h" #include "sync.h" #include "util.h" #include <boost/lexical_cast.hpp> // keep track of the scanning errors I've seen map<uint256, int> mapSeenMasternodeScanningErrors; // cache block hashes as we calculate them std::map<in...
TOOL
0.988463
4.867498
3ec8a853-92ff-4a1e-948f-4500eb848b0a
AdrianShe/crisp-mesh
src/output_grid_csv.cpp
#include "output_grid_csv.h" #include <igl/copyleft/marching_cubes.h> #include <igl/copyleft/marching_cubes_root_finding.h> #include "grid.h" #include <igl/point_mesh_squared_distance.h> #include <igl/signed_distance.h> #include <iostream> #include <random> #include <igl/flood_fill.h> void output_grid_csv( const ...
ALGO
0.982122
6.824692
0eebd6b4-c1d8-4541-9924-4b67c9a4074b
Sujeto47/ClasificadorImgPy
opencv-master/opencv-master/modules/calib3d/src/ptsetreg.cpp
#include "precomp.hpp" #include <algorithm> #include <iterator> #include <limits> #include "usac.hpp" namespace cv { int RANSACUpdateNumIters( double p, double ep, int modelPoints, int maxIters ) { if( modelPoints <= 0 ) CV_Error( Error::StsOutOfRange, "the number of model points should be positive" ); ...
ALGO
0.999574
6.006679
d02fab06-2d30-4bdc-aae7-951e640b71a5
SkyLoaderr/xray-engine-repo
Editors/Tools/Postprocess/spline.cpp
//--------------------------------------------------------------------------- #include <vcl.h> #include <math.h> #pragma hdrstop #include "spline.h" //--------------------------------------------------------------------------- #pragma package(smart_init) //------------------------------------------------------------...
ALGO
0.990173
4.23623
ffd76a83-e80b-4915-9c90-f8e4fe77637b
cyberkillor/SJTU-OnlineJudge
1566/main.cpp
#include <iostream> using namespace std; template <class TypeOfVer,class TypeOfEdge> class adjListGraph{ public: adjListGraph(int vSize,TypeOfVer d[]){ Vers = vSize;Edges = 0; verList = new verNode[vSize]; for(int i=0;i<Vers;++i) verList[i].ver = d[i]; } void insert(TypeOfVer x,Typ...
ALGO
0.999879
3.616286
bf4e6653-98d3-4538-99a1-38b96d9d77e4
phrock/acm
topcoder/sources/TriCount.cpp
#include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <bitset> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstr...
ALGO
0.98974
4.30062
ac83e77a-abfa-4beb-835e-ccb03969d91c
ananta-shinde/June-2023
DSA/DS/Lqueue.cpp
#include<iostream> using namespace std; class Node{ public: int data; Node* next = NULL; }; class LQueue{ Node* front = NULL; Node* rear = NULL; public: void insert(int data){ Node* new_node = new Node(); new_node->data = data; // if queue is empty if(fro...
ALGO
0.997055
3.996299
6222ee7b-7a32-4e09-81b1-7d0a864ef301
trygas/example
lintcode/catch_card/catch_card.cpp
#include <iostream> #include <vector> using namespace std; int solve(int number) { vector<int> answer(number + 1, 0); answer[1] = 1; answer[2] = 2; for (int i = 3; i < answer.size(); ++i) { answer[i] = answer[i - 1] + answer[i - 2]; } return answer[number]; } int main() { i...
ALGO
0.999988
5.448384
6a7069bc-4f29-4318-af72-cddea3c14226
nawngs/CompetitiveProgramming
atcoder/abc245_a.cpp
#pragma GCC optimize ("O2") #include <bits/stdc++.h> #define ll long long #define ld long double #define fi first #define se second #define pll pair < ll, ll > #define pii pair < int, int > #define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); using namespace std; const string NAME = ""; const string NAME2 =...
ALGO
0.999671
3.763927
454aea98-f47d-4803-bd43-250bff19b83b
tpisto/rmongo
src/mongo-cxx-driver/boost/libs/bimap/example/mighty_bimap.cpp
// VC++ 8.0 warns on usage of certain Standard Library and API functions that // can be cause buffer overruns or other possible security issues if misused. // See http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCandC/default.aspx // But the wording of the warning is misleading and unsettling, there are no // po...
TOOL
0.940525
6.128827
6a90fecd-ce66-4416-afa8-f876182ddf4b
Geetansh01/dsa-lb-codes
W12/L173/MakeTreeGivenTraversals.cpp
#include<iostream> #include<queue> #include<map> using namespace std; class Node{ public: int data; Node* left; Node* right; Node(int val){ this->data = val; this->left = NULL; this->right = NULL; } }; //Returns root node of created tre...
ALGO
0.999961
5.15051
ed3aa280-ca97-4bb3-8446-4d9bbb83f9b9
raincross7/code-similarity
codes/train_code/problem362/problem362_476.cpp
#include <bits/stdc++.h> using namespace std; int main() { vector<int> A(3); for(int i=0; i<3; i++){ cin >>A.at(i); } sort(A.begin(), A.end()); cout << abs(A.at(0)-A.at(1))+abs(A.at(1)-A.at(2)) << endl; return 0; }
ALGO
0.999959
4.132397
02665e03-cc43-4982-a388-a021c6b9bcf6
kal990574/Algorithm
BOJ/BOJ-10952.cpp
#include <iostream> #include <algorithm> using namespace std; int main(){ int a,b; vector<int> v; while(1){ cin >> a >> b; if(a == 0 && b == 0) break; v.push_back(a+b); } for(int i=0; i<v.size(); i++){ cout << v[i] << "\n"; } }
ALGO
0.999555
3.553501
c903c616-a2ef-4f64-9e6c-34159682ed22
ishandutta2007/codeforces
ngochai94/normal/655/D.cpp
#include <bits/stdc++.h> using namespace std; #define For(i,a,b) for(int i=a;i<b;i++) #define pb push_back #define mod 1000000007 #define reset(s,val) memset(s,val,sizeof(s)) #define eps 1e-9 #define pi acos(-1) #define sqr(x) (x)*(x) #define two(x) (1<<(x)) int n,m,fin[100005],cnt[100005],cur,err,u,v,after[100005]; v...
ALGO
0.999967
3.819471
c3abd5fb-5ae2-4355-8f93-9055a53aaad6
marufbytes/CPP_Basic
Queue/Queue_class.cpp
#include <bits/stdc++.h> using namespace std; class Queue { private: int front; int rear; int Max; int *queue_arr; public: Queue() { front = 0; rear = 0; queue_arr = new int[Max]; } int isFull() { return rear == Max ? true : false; } int is...
ALGO
0.982037
4.620125
b70066d1-4ef3-44bb-aaca-6d86cb6450c2
devanshdalal/CompetitiveProgrammingAlgos
dddlll/codechef/RRJOKE/RRJOKE-5627413.cpp
#include <bits/stdc++.h> #define mp make_pair #define pb push_back #define VI vector <int> #define VVI vector < vi > #define PII pair <int,int> #define VPII vector < pii > #define MI map < int, int > #define SI set< int > #define clr(x) x.clear() #define sz(x) ((int) x.size()) #define F first #define S second #define ...
ALGO
0.999937
3.64607
2e9c4a84-e010-403e-a754-2d63dc200801
matiego1/sio2
preOI (24-25)/bia.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> para; const int MAX = 200 * 1000; int wej[MAX + 1]; int grupa[MAX + 1]; int n; const bool DEBUG = false; bool sprawdz(int drugi) { // 1) Ciag monotoniczny for (int i = 1; i <= n; i++) grupa[i] = 0; ...
ALGO
0.999962
4.228442
c15127ab-80eb-460c-8307-ef2421e8a3df
eliot-exdev/boost-morphos
libs/math/example/neumann_zeros_example_1.cpp
#ifdef _MSC_VER # pragma warning (disable : 4512) // assignment operator could not be generated. # pragma warning (disable : 4996) // assignment operator could not be generated. #endif #include <iostream> #include <limits> #include <vector> #include <algorithm> #include <iomanip> #include <iterator> //[neumann_zero...
ALGO
0.999056
6.289248
9a64a4c1-fa8f-4d9c-b0e9-0cb6b0ebc8d4
ISTE-SS-24-DSA/SakshiS_230962006
WEEK1/Assignment6.cpp
// DSA Assignment Question- Week 1- Q(6) #include <iostream> using namespace std; int largest(int arr[],int n) { int larg= arr[0],i; for (i=1;i<n;i++) { if (arr[i]>larg) larg=arr[i]; } return larg; } int main() { int n,i; cout << "Enter the number of elements: "; c...
ALGO
0.999472
4.174276
be54a1e2-d100-4212-8ab5-cdfca968fecf
syadav481/leetcode
901.cpp
#include <vector> using namespace std; class StockSpanner { private: vector<int> vals; vector<int> spans; public: StockSpanner() {} int next(int price) { if (vals.empty() || vals.back() > price) { vals.push_back(price); spans.push_back(1); return 1; } int span = 1; int i = ...
ALGO
0.999504
6.494902
f566bf11-5b0b-435f-b6d1-9425e0beba70
zzccppp/RayTracing_1
core/AABB.cpp
// // Created by ZZDirty on 2020/3/28. // #include "AABB.h" #include "../core/CommonFunc.h" AABB surrounding_box(AABB box0, AABB box1) { glm::vec3 small(ffmin(box0.min().x, box1.min().x), ffmin(box0.min().y, box1.min().y), ffmin(box0.min().z, box1.min().z)); glm::vec3 b...
ALGO
0.982824
6.701208
6f547632-22ad-4109-b1e3-05d215886431
NipenPaul/Program-Catagory-Document
Data Structure/Map/Codeforces/1915E.cpp
#include <bits/stdc++.h> #define int int64_t #define endl '\n' #define Faster ios::sync_with_stdio(false);cin.tie(nullptr); #define CHECK(x) cout << (#x) << " is " << (x) << endl; using namespace std; const int N = (int)1e5+5; void solution(int tc){ int n; cin >> n; vector<int> v(n); for(int i = 0; i < n; i++){ ...
ALGO
0.999771
4.834999
33ee08f9-fd6f-4326-9f29-d410ad24d1b7
reverg/PS
leetcode/2354.cpp
class Solution { public: int countBits(int num) { int cnt = 0; while (num > 0) { cnt += num & 1; num >>= 1; } return cnt; } long long countExcellentPairs(vector<int> &nums, int k) { unordered_set<int> unique_nums(nums.begin(), ...
ALGO
0.999981
5.633754
35290913-f7d3-48b8-bcaa-a4c7a4cdb5a3
shivangraina/IEEE_NCC_19
ncc/queDescrip/1_BON_APETITIE/solution.cpp
#include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { int n; cin>>n; int arr[n]; for(int i=0;i<n;i++) cin>>arr[i]; cout<<n+1<<"\n"; } return 0; }
ALGO
0.997038
3.22844
86c61cb2-92f6-464b-94ad-93e427323752
faizan346/Ds-Algo-Cplusplus
graphs/16bellmonFord.cpp
#include<bits/stdc++.h> using namespace std; class Edge { public: int src; int nbr; int wt; Edge(int src, int des, int wt) { this->src = src; this->nbr = des; this->wt = wt; } }; void shortestPathBellmonFord(vector<Edge>& graph, vector<int>& path) { // the path to i...
ALGO
0.999998
5.132102
f014360b-28ae-4c4a-94e8-0138cafc0a38
iamshafin121/Competitive_Programming
Codeforces/Practice_Problems/1873A.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define pb push_back #define vc vector #define vi vc<int> #define vll vc<ll> #define endl '\n' #define yes cout << "YES" << '\n'; #define no cout << "NO" << '\n'; #define srt(x) sort(x.begin(),x.end()) #define rsrt(x) sort(x.rb...
ALGO
0.999732
3.95607
cb9f1e6f-44f3-48c5-ac9c-5d088796bf39
HBUACM/2020-Training-camp
[week0]c++stl/day1/第0周C++ STL-得分代码-20200716075413/1283239623966527488_A+B/ink1023_1262384293222899712_1283239623966527488.cpp
#include <iostream> using namespace std; int main() { int a,b; cin >> a >> b; cout << a+b; return 0; }
ALGO
0.982528
3.051545
f0af6dbf-2a58-4244-b807-e17baa7b4780
bigfatgoalieX/UAV
Experiment3/Arduino框架代码/forward.cpp
static int n = 1; static int weights_shape[] = {1, 2}; static const char *act_funcs[] = {"line"}; static float __weights_1d[] = {0.500000, 0.500000}; static float __bias_1d[] = {0.000000}; static float *__w0[1] = {&__weights_1d[0]}; static float **weights[1] = {__w0}; static float *bias[1] = {&__bias_1d[0]}; static flo...
ALGO
0.999604
3.10271
fc6ad2e7-c9ed-4ceb-bf7f-1466e472e711
aashish-07/Data-Structures
Recursion & Backtracking/keypad.cpp
#include <iostream> using namespace std; char keypad[][10] = {"", " ", "ABC", "DEF", "GHI", "JKL", "MNO", "PQRs", "TUV", "XYZ"}; void generate_names(char *input, char *out, int i, int j) { // base case if (input[i] == '\0') { out[j] == '\0'; cout << out << endl; return; } /...
ALGO
0.997963
4.574216
2cd9ace2-e5bb-4391-95b1-a36483bcb622
Devkumar2021024/C-plus-plus-codes
Arrays/reverse.cpp
#include <iostream> using namespace std; void reverse(int arr[], int size, int start, int end) { // doing row printing in half iterations start = 0, end = size-1; while (start <= end) { // pre defined functio in c++ libraray6 swap(arr[start], arr[end]); start++; end--; ...
ALGO
0.997213
4.797292
c43a0891-37fb-4b60-a3d8-7b6cf0cc9d50
sagpant/vigra
src/matlab/test-routines/vigraTestConstrScalar.cpp
/************************************************************************/ /* */ /* */ /* This file is part of the VIGRA computer vision library. */ /* The VIGRA Web...
ALGO
0.950116
5.87761
3cdf8f8e-2578-4d46-9894-c6ce527293d7
Nikhilsharmaiiita/LeetcodeCracker
number-of-1-bits/number-of-1-bits.cpp
class Solution { public: int hammingWeight(uint32_t n) { int count=0; int x=1; for(int i=0;i<32;i++) { int mask=1<<i; if(mask&n)count++; } return count; } };
ALGO
0.999807
6.026398
7d2a8c40-3b6d-4e19-bf98-7406c92a6ea0
RajibTheKing/ACMProgramming
TJU/Contest time/6545.cpp
#include<iostream> #include<string> #include<vector> using namespace std; main() { string a[200]; string b; int n; char c; cin>>n; { for(int i=0;i<n;i++) { cin>>b; a[i]=""; a[i]+=b; } for(int i=0;i<n;i++) { ...
ALGO
0.999808
3.724419
2ffbd657-e5a9-48bf-b10c-f8daf6748283
kaixih/layer_norm
eigen-3.4.0/doc/examples/class_Block.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; using namespace std; template<typename Derived> Eigen::Block<Derived> topLeftCorner(MatrixBase<Derived>& m, int rows, int cols) { return Eigen::Block<Derived>(m.derived(), 0, 0, rows, cols); } template<typename Derived> const Eigen::Block<const Derive...
TOOL
0.932273
5.93207
cd946ea8-0788-4227-b83b-68cce6497c08
abhinavaggarwal018/C--
GSS3.cpp
#include<iostream> #include<cstdio> #include<cassert> using namespace std; struct node { int sum,ans,suffix,prefix; }; int arr[50010],n,m,c,x,y; struct node tree[150000]; struct node combine(struct node c1, struct node c2) { struct node node1; node1.ans=max(c1.ans,max(c2.ans,c1.suffix+c2.prefix)); node1.sum=c...
ALGO
0.999977
4.219679
aa96f96d-0aee-42da-ad62-c0d980fb8ba2
guanhe0/mongo
src/mongo/db/index/2d_access_method.cpp
#include "mongo/db/index/2d_access_method.h" #include <string> #include <vector> #include "mongo/db/index_names.h" #include "mongo/db/index/2d_common.h" #include "mongo/db/index/expression_keys_private.h" #include "mongo/db/index/expression_params.h" #include "mongo/db/jsobj.h" namespace mongo { TwoDAccessMethod::T...
ALGO
0.853715
6.884209
3abb7e9f-3eb7-4e72-bfa5-457f1af3846c
rsln-s/aggregative-coarsening-for-multilevel-hypergraph-partitioning
packages/epetra/test/Bugs_LL/Bug_5988_FECrs_buildNonlocalGraph_LL/cxx_main.cpp
#include <Epetra_FECrsGraph.h> #include <Epetra_FECrsMatrix.h> #include <Epetra_MpiComm.h> int main(int argc, char**argv) { MPI_Init(&argc,&argv); int rank; // My process ID MPI_Comm_rank(MPI_COMM_WORLD, &rank); Epetra_MpiComm Comm( MPI_COMM_WORLD ); int NumMyEquations = 2; Epetra_Map Map(-1LL, NumMyEqua...
ALGO
0.996823
4.074449
f9f4d837-136a-4be2-ab30-b6de98219040
ossimlabs/ossim
src/base/ossimLeastSquaresBilin.cpp
using namespace std; #include <ossim/base/ossimLeastSquaresBilin.h> #include <ossim/base/ossimNotifyContext.h> ossimLeastSquaresBilin::ossimLeastSquaresBilin() : bl_a(0.0) , bl_b(0.0) , bl_c(0.0) , bl_d(0.0) , AtA(NULL) , Atb(NULL) { // allocate normal system accumulation matrices AtA = n...
ALGO
0.998578
5.964724
90120a05-e2be-451e-89bb-07d58cf03d67
vini-ribeiro/INE5408-ESTRUTURA_DADOS
trabalhos/projeto2/main.cpp
#include <cstddef> #include <fstream> #include <iostream> #include <string> #include "LeitorDIC.h" #include "trie.h" int main() { std::string filename; std::cin >> filename; // entrada structures::Trie trie; LeitorDIC leitor; // cria objeto para ler o arquivo .dic leitor.abrir_ar...
ALGO
0.859816
4.735707
0624ad0b-1026-4e33-8aa7-aa6aa3e473dd
Linux4/ddnsdpp
src/config.cpp
#include "config.h" #include <fstream> std::string read_config(const std::string& config_path, const std::string& config_key) { std::fstream config; config.open(config_path, std::ios::in); std::string config_value; std::string real_config_key = config_key + " = "; if (config.is_open()) { ...
CONFIG
0.912991
5.999697
01bbd1fb-982f-44de-99b2-2aa5ade95a74
aanik111/bmr_calculator
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.998756
6.772262
7d02532e-c162-4b2f-86a1-27a6955b8e22
A-lioth/Cpp_Program
LeetCode/二分查找/T154_Find-Minimum-in-Rotated-Sorted-Array-ii.cpp
#include <iostream> #include <vector> using namespace std; int findMin(vector<int> &nums) { int left = 0, right = nums.size() - 1; while (left < right) { int mid = left + (right - left) / 2; if (nums[mid] > nums[right]) left = mid + 1; else if (nums[mid] < nums[right]) ...
ALGO
0.999931
5.04265