uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
749174ab-6c4a-47f8-9112-5684da7d5457
WillYan0224/OpenCV
main.cpp
#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/imgproc.hpp" #include <iostream> using namespace cv; using namespace std; int main(int argc, char** argv) { CommandLineParser parser(argc, argv, "{@input | lena.jpg | input image}"); Mat src = imread("C:/Users/lc472/Documents/cpp...
ALGO
0.944541
4.616544
b8a5a32b-5d11-4b8e-9499-4ea5e06ba5b4
SourovCodes/c-programming
contest/Algorithm Lab - Graph/e.cpp
#include <bits/stdc++.h> using namespace std; #define int long long const int N = 105; vector<string> grid; int marked[N][N]; bool isGood(int i, int j) { return i >= 0 && i < grid.size() && j >= 0 && j < grid[i].size(); } int mark(int i, int j) { if (!isGood(i, j)) return 0; if (grid[i][j] != 'W') ...
ALGO
0.998634
4.466908
ff87b6e4-f34e-4c3a-ac3f-8f00d2ee3bec
MRRazvi/competitive-programming
codeforces/A/P129A.cpp
// A. Cookies // https://codeforces.com/problemset/problem/129/A // 5 mint avg // array, implementation #include <iostream> #include <vector> #include <algorithm> typedef int64_t ll; using namespace std; int main() { freopen("output.txt", "w", stdout); int n; cin >> n; vector<int> a(n); for (aut...
ALGO
0.999958
4.855564
7e30be16-8137-43e0-a127-32c3cab7b1a6
TeczaTech/TAssist
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
04ea18e3-93bc-491c-b070-a1bddb3079f2
tomo1010blue/AtCoder
ABC/ABC270/C.cpp
#include <bits/stdc++.h> #include <atcoder/all> #define fi first #define se second #define repl(i, l, r) for (int i = l; i < r; ++i) #define rep(i, r) repl(i, 0, r) #define pb push_back #define eb emplace_back #define all(v) (v).begin(),(v).end() #define rall(v) (v).rbegin(),(v).rend() #define sz(x) ((int) (x).size()) ...
ALGO
0.999996
4.17798
a7472d54-a877-4710-8902-45fd1aa48e32
anxiety135790/CodeLearning
Introduction_To_Computer_And_Cpp_BASE/cpp/S5/JJ_ATD_MEEING.CPP
#include <iostream> using namespace std; int main(){ int a; cin >> a; if(a == 1 or a == 3 or a == 5){ cout << "NO" << endl; } else{ cout << "YES" << endl; } return 0; }
ALGO
0.999596
3.325206
1fdaba87-4b3a-466b-8686-976ec2667f2e
Kowsar14238/URI_Problem_Solution
URI_Soluation_1059.cpp
/// Print all even numbers between 1 and 100, including them, one by row. #include<bits/stdc++.h> using namespace std; int main(){ int i; for(i=1; i<=100; i++){ if(i%2 == 0){ cout<< i<< endl; } } return 0; }
ALGO
0.971445
4.153776
e2181275-8a91-4a9e-9763-65314977e9dd
ProbablyButter/aoc
2020/day24/part1.re.cpp
/*!re2c re2c:flags:utf-8 = 1;*/ /*!max:re2c*/ /*!re2c re2c:define:YYCTYPE = char; re2c:yyfill:enable = 0; re2c:flags:tags = 1; re2c:yyfill:check = 1; */ #include "aoc.hpp" #include "hash.hpp" #include <algorithm> #include <cmath> #include <fstream> #include <iostream> #include <list> #include <map> #include <regex> #...
ALGO
0.973993
5.774776
1b34a48a-fc03-4af4-9bd8-cf624a84c502
protarie125/BOJ_14782
main.cpp
#include <iostream> using namespace std; int main() { ios::sync_with_stdio(false); std::cin.tie(nullptr); int x; cin >> x; auto ans = int{ 0 }; for (auto i = 1; i <= x; ++i) { if (0 == x % i) { ans += i; } } cout << ans; return 0; }
ALGO
0.999933
4.98627
cb7184c6-0004-4403-a50e-b38d37f8a829
Abunyawa/contests
686/b.cpp
// chrono::system_clock::now().time_since_epoch().count() #include <bits/stdc++.h> #define pb push_back #define eb emplace_back #define mp make_pair #define fi first #define se second #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) (int)(x).size() #define rep(i, a, b) for (...
ALGO
0.999746
4.728167
6c845748-bf88-473c-978b-e7a378909e07
bpru/faceoff
boost_1_62_0/libs/compute/example/simple_kernel.cpp
#include <iostream> #include <boost/compute/core.hpp> namespace compute = boost::compute; // this example demonstrates how to use the Boost.Compute classes to // setup and run a simple vector addition kernel on the GPU int main() { // get the default device compute::device device = compute::system::default_d...
ALGO
0.982688
5.305225
faa1f75e-9cf2-41e3-97b9-aeb31052b598
Praveenkumar02023/LeetCode-DSA
0543-diameter-of-binary-tree/0543-diameter-of-binary-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.999904
6.621881
0273cfe8-2ae4-4b3f-a186-8909ec4029b1
BinomialSheep/Competitive
AtcoderContest/ABC320/A.cpp
#pragma region header #include <bits/stdc++.h> // デバッグ用マクロ:https://naskya.net/post/0002/ #ifdef LOCAL #include <debug_print.hpp> #define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__) #else #define debug(...) (static_cast<void>(0)) #endif using namespace std; using ll = long long; using vi = vector<int>...
ALGO
0.999688
5.044279
f81c4264-7cb6-4510-ba07-6eb99e427003
SaiTp/LeetCode-Codes
1550-three-consecutive-odds/1550-three-consecutive-odds.cpp
class Solution { public: bool threeConsecutiveOdds(vector<int>& arr) { int i,c=0,f=0; for(i=0;i<arr.size();i++) { if(arr[i]%2) c++; else c=0; if(c==3) { f=1; break; ...
ALGO
0.999819
5.466886
fbe0e0d8-f702-4add-a500-52e36ca428cc
shuangde/ACM-ICPC-Record
hdu/hdu-4790.cpp
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <cstdlib> // 0~x-1 #define random(x) (rand()%x) using namespace std; const int N = 1e9; typedef long long int64; int64 a, b, c, d, p, m; int64 one, two, three, four; int64 gcd(long long a,long long b){ while(b^=a^=b^=a%=b...
ALGO
0.999776
5.002982
5b8e8719-3a97-4768-9d39-f7186ec0d091
Pranav2092/Priority-Queues-in-finding-Shortest-Path
leftist heap implementation.cpp
#include <bits/stdc++.h> #include <chrono> #include <utility> using namespace std; using namespace std::chrono; #define limit 1000 template <typename T> struct Node { T key; int node_rank; // Renamed from rank to avoid conflict with std::rank Node* left; Node* right; Node(T key) : key(key), node_r...
ALGO
0.999874
6.037407
b81104fc-83ee-494c-bb77-39871db18bd1
isha141/Striver-Challenge-
day 4/79. Word Search.cpp
class Solution { int n,m; bool solve(int i,int j,string &word,int k,vector<vector<char>>&board){ if(k>=word.size()) return 1; if(i<0 || j<0 || i>=n || j>=m || board[i][j]=='.' || board[i][j]!=word[k]) return 0; char ch=board[i][j]; board[i][j]='....
ALGO
0.999943
5.857772
a25af0c4-91ac-46c5-bf01-1accfa7ef9d4
ishandutta2007/codeforces
andreasyan/normal/1437/G.cpp
#include <bits/stdc++.h> using namespace std; #define m_p make_pair #define all(x) (x).begin(),(x).end() #define sz(x) ((int)(x).size()) #define fi first #define se second typedef long long ll; mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); mt19937 rnf(2106); const int N = 300005; const pair<int, ...
ALGO
0.999781
4.188627
a55db0a5-db50-4978-8f92-961fd2dcf0b1
alno/hse-cpp
hash-through.cpp
#include <iostream> #include <cstring> int hash(const char * str) { return str[0]; } class Hashtable { private: struct Entry { const char * key; const char * value; bool deleted; Entry() : key(0), value(0), deleted(false) {} }; int len; Entry * arr; public: Hashtable() : len(7){ arr = new Entry[len]...
ALGO
0.993877
5.258271
617885d3-da38-452d-8a07-32fb8698cf62
Iftekhar-Ahamed/Code
D_-_C.cpp
/*** ** Bismillahir Rahmanir Rahim ** ALLAHU AKBAR ** ** Author: Iftekhar Ahamed Siddiquee ** Bangladesh University of Business and Technology, ** Dept. of CSE. ***/ #include <bits/stdc++.h> using namespace std; #define FIO cin.tie(NULL), ios_base::sync_with_stdio(false) #define read freo...
ALGO
0.999772
3.238912
46129ecd-d967-4b01-8c94-ccb7612ccf6b
Curry-ZHR/C-_course
7-2.cpp
/*Location + - ʵƽλõƶ*/ #include<iostream> using namespace std; class Location{ private: int x,y; // public: Location(int x=0,int y=0) { this->x=x; this->y=y; } void display() { cout<<"("<<x<<","<<y<<")"<<end...
ALGO
0.99654
4.605042
710cfc5f-3190-42bd-add6-6301c9ce8e96
MaxC-CG/P2M_Colab
Manifold/3rd/igl/lscm.cpp
#include "vector_area_matrix.h" #include "cotmatrix.h" #include "repdiag.h" #include "min_quad_with_fixed.h" #include <iostream> IGL_INLINE bool igl::lscm( const Eigen::MatrixXd& V, const Eigen::MatrixXi& F, const Eigen::VectorXi& b, const Eigen::MatrixXd& bc, Eigen::MatrixXd & V_uv) { using namespace Eige...
ALGO
0.988305
5.778954
1ddf3f32-b90d-4068-8f12-c058ec7febe5
gajendra0180/LeetCode
path-sum-iii/path-sum-iii.cpp
class Solution { public: int res=0; int pathSum(TreeNode* root, int targetSum) { if(root==NULL) return 0; dfs(root,targetSum); pathSum(root->left,targetSum); pathSum(root->right,targetSum); return res; } void dfs(TreeNode* root,int s...
ALGO
0.999967
6.239444
31932575-2c99-422e-8ecc-db9ef63a1ec4
SuperiorExtended/android_packages_inputmethods_LatinIME
native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp
#define LOG_TAG "LatinIME: jni: BinaryDictionary" #include "com_android_inputmethod_latin_BinaryDictionary.h" #include <cstring> // for memset() #include <vector> #include "defines.h" #include "dictionary/property/unigram_property.h" #include "dictionary/property/ngram_context.h" #include "dictionary/property/word_p...
TOOL
0.885759
4.944007
5c79af5e-74de-48ec-ae23-dd30226b79a1
abcivashritt/codechef
Different Consecutive Characters.cpp
#include <iostream> using namespace std; int main() { int t; cin>>t; while(t--) { int n,ans=0; string s; cin>>n>>s; for(int i=1;i<n;i++) { if(s[i] == s[i-1]) ans++; } cout<<ans<<"\n"; } return 0; }
ALGO
0.999868
4.055271
32affe65-01b7-4c89-8527-193fdc92be4c
Juhi2023/DSA-Practice
Linked List/Merge_K_Sorted_list.cpp
//merge k sorted list //1. brute force // * Traverse all the linked lists and collect the values of the nodes into an array. // * Sort and iterate over this array to get the proper value of nodes. // * Create a new sorted linked list and extend it with the new nodes. // Time complexity: O(NlogN) where N is the total nu...
ALGO
0.999885
5.731903
9e05e83c-53c4-4968-ba04-1eecab580dac
awenits/placements
majorityElement.cpp
#include<bits/stdc++.h> using namespace std; int majorityElement(vector<int> v, int n){ int majorElement=0, majorCnt=0; for(int num: v){ if(majorCnt == 0){ majorElement = num; majorCnt += 1; } else{ if(majorElement == num){ majorCnt ...
ALGO
0.999819
4.99923
3ef7eab5-a84c-4709-9bb3-3687582b7407
TeamFlex/frameworks_av
media/libstagefright/codecs/m4v_h263/dec/src/zigzag_tab.cpp
#include "mp4dec_api.h" #include "mp4def.h" #include "zigzag.h" /*---------------------------------------------------------------------------- ; MACROS ; Define module specific macros here ----------------------------------------------------------------------------*/ /*----------------------------------------...
ALGO
0.99566
3.532503
f0defc88-0a59-411d-973f-3efec22fb10c
TDDY27/CPP-CODES
SPROUT JUDGE/OK/ALGO22/高棕櫚觀光農場.cpp
#include <bits/stdc++.h> #define TDDY ::ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define int long long using namespace std; int t,n; int G[500][500]; int dp[20][100000]; signed main(){ cin>>t; while(t>0){ memset(G,0,sizeof G); cin>>n; for(int i=0;i<n;i++){ ...
ALGO
0.999707
3.936721
6fe53fc0-03c3-4061-a888-4f4c934070ae
nguyenign/micmac4wasm
BenchElise/bench/b_0_19_1.cpp
#include "StdAfx.h" #include "bench.h" void bench_flag_vois_KD(Pt2di p1,Pt2di p2,Pt2di sz,Pt2di P0,Pt2di P1) { Im2D_INT4 r1(sz.x,sz.y); Im2D_INT4 r2(sz.x,sz.y); Im2D_INT4 t1(sz.x,sz.y); Im2D_INT4 t2(sz.x,sz.y); Im2D_U_INT1 I1(sz.x,sz.y); Im2D_U_INT1 I2(sz.x,sz.y); ELISE...
ALGO
0.993512
4.739773
f7c7e625-74fc-4aa9-bff0-297689f3c333
jessicayung/self-driving-car-nd
term-2/p5-model-predictive-control/src/Eigen-3.3/blas/double.cpp
#define SCALAR double #define SCALAR_SUFFIX d #define SCALAR_SUFFIX_UP "D" #define ISCOMPLEX 0 #include "level1_impl.h" #include "level1_real_impl.h" #include "level2_impl.h" #include "level2_real_impl.h" #include "level3_impl.h" double BLASFUNC(dsdot)(int* n, float* x, int* incx, float* y, int* incy) { ...
ALGO
0.992565
5.138801
8cf20987-085c-4971-b10f-ede1e5f01aa2
schwadri/granular
information/physics engines/bullet/bullet-2.80-rev2531/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp
#include "btOverlappingPairCache.h" #include "btDispatcher.h" #include "btCollisionAlgorithm.h" #include "LinearMath/btAabbUtil2.h" #include <stdio.h> int gOverlappingPairs = 0; int gRemovePairs =0; int gAddedPairs =0; int gFindPairs =0; btHashedOverlappingPairCache::btHashedOverlappingPairCache(): m_overlapFilte...
TOOL
0.963974
5.282104
d5ac9c43-9cfc-48d4-b49b-9a7ef17c821b
raincross7/code-similarity
codes/train_code/problem085/problem085_99.cpp
#include<bits/stdc++.h> using namespace std; using LL = long long; using ULL = unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) int main() { int N; cin >> N; vector<int> P; for (int i = 2; i <= N; i++) { bool ok = true; for (int p : P) if (i % p == 0) ok = false; if (ok...
ALGO
0.999868
3.85351
d0d8f301-7946-435f-afd6-f300e96de0aa
vorsv/code
leet/75sortcolor.cpp
#include<iostream> #include<vector> using namespace std; class Solution { vector<int> f = {2,0,2,1,1,0}; public: Solution(){ sortColors(f); } void sortColors(vector<int>& nums) { int n=nums.size(),key=0,i=0,j=0; pront(nums); for (i = 1; i ...
ALGO
0.999983
4.608165
49adc7e7-21a6-4b27-ae62-550a3c47ffd7
mahmud006/Leetcode
258-add-digits/258-add-digits.cpp
class Solution { public: int add(int n){ if(n<10) return n; int sum = 0, chk; while(n>0){ chk = n%10; n = n/10; sum += chk; } return add(sum); } int addDigits(int num) { return add(num); } };
ALGO
0.999943
6.44383
e827c5bc-264c-49a0-864b-171444e7dc73
north-h/Match_code
2024/Codeforces_-_Educational_Codeforces_Round_170_(Rated_for_Div_2)/A_Two_Screens.cpp
/* * ================================================================================== * Author: north_h * Time: 2024-10-14 22:37:56 * * Problem: A. Two Screens * Contest: Codeforces - Educational Codeforces Round 170 (Rated for Div. 2) * URL: https://codeforces.com/contest/2025/problem/0 * MemoryL: 51...
ALGO
0.999886
4.601384
e28c427e-c484-4b29-a304-beb4bdafbb1c
sanjeevWeb/latest_gfg
Difficulty: Easy/Rotate Array/rotate-array.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution{ public: //Function to rotate an array by d elements in counter-clockwise direction. void rotateArr(int arr[], int d, int n){ // code here d=d%n; // Storing rotated version of ...
ALGO
0.999967
6.204874
75767aa8-8429-461f-9afa-b637cf820aca
dhruvabhat24/GFG-2024
April/Day 3: Kth common ancestor in BST.cpp
//User function Template for C++ /*// A Tree node struct Node { int data; struct Node *left, *right; };*/ class Solution { public: int kthCommonAncestor(Node *root, int k, int x, int y) { // Calculating LCA(Lowest Common Ancestor) // Time: O(Height of the BST); Space: O(1) Node* LCA = ro...
ALGO
0.999997
5.38272
0b0eab7a-ab0f-4e95-99ab-aa14742955c3
Mohammad-Ashikul-Islam/Competitive_Programming
UVA/UVa_11455_Behold_my.cpp
#include<bits/stdc++.h> using namespace std; int main() { long long t; cin >> t; while(t--){ vector<long long> v; long long x,k=0,i=4; while(i--){ cin >> x; v.push_back(x); if(x==0) k=1; } if(k==1){cout << "banana\n"; continue;} ...
ALGO
0.999494
4.494591
1eaad509-407b-4f73-9a1b-c7fb79874f67
thivya-amazon/Coding
151-reverse-words-in-a-string/151-reverse-words-in-a-string.cpp
class Solution { public: void revword(string& s, int start, int end) { while(start < end) { swap(s[start++], s[end--]); } } string reverseWords(string s) { reverse(s.begin(), s.end()); int startIdx = 0; int endIdx = s.size() - 1; ...
ALGO
0.999956
6.348375
3558d635-ef73-42f5-848d-9ecef7fa8a2e
Aman911kumar/DSA
decimal_To_binary.cpp
#include <iostream> using namespace std; int main() { int dcml = 0, bnry = 0, temp = 0,pow = 1; cout << "Enter a number: "; cin >> dcml; temp = dcml; for (int i = 0; temp > 0; i++) { int rmndr = temp % 2; temp /= 2; bnry += rmndr*pow; pow *= 10; } cout <...
ALGO
0.999642
4.686122
eba4352e-e435-47b3-9905-922b8297863b
Shell-Wataru/AtCoder
Codeforces/708/B.cpp
#include <iostream> #include <algorithm> #include <vector> #include <deque> #include <queue> #include <set> #include <iomanip> #include <cmath> #include <map> #include <bitset> #include <numeric> using namespace std; using ll = long long; const ll BASE_NUM = 1000000007; int solve() { ll n,m; scanf("%lld",&n); s...
ALGO
0.999795
4.699433
1ab2a00d-3c99-4f74-a7a3-12e61ca14d1c
pranavjawale01/DSA
Tree/BinaryTree/binaryTree.cpp
#include <iostream> #include <queue> using namespace std; class Node { public: int data; Node* left; Node* right; Node(int value) : data(value), left(nullptr), right(nullptr) {} }; class BinaryTree { private: Node* root; public: BinaryTree() : root(nullptr) {} Node* InsertNode(Node* nod...
ALGO
0.999922
6.009678
9992bf0f-ea06-47b2-9168-92baebfc02da
Ahmad09308/NewsApp
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
c6e50278-0c0c-42ba-9257-dbcf1c9acc2b
PaukIsUha/optimizing_formating_code
predictions/submissions-aizu-coop-gpt4/Codenet/p00998/104734515/response_4.cpp
#include <bits/stdc++.h> using namespace std; const int INF = 1 << 30; struct Treap { struct node { int value; node *left, *right; int priority; int cnt; int small; node(int v) : value(v), priority(rand() ^ (rand() << 16)), cnt(1), small(v) { left = right = NULL; } }; node *root;...
ALGO
0.99993
4.757812
3ff60d7f-b0a8-42fd-b701-df5c0748700d
DuarteCruz31/TacaUA_IHC
tacaua/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.998998
6.785645
fb23c65b-b8be-4baa-9950-a65d6042b812
ArcadeCookie/hello_cpp_libs
libs/boost/source/boost_1_79_0/libs/compute/perf/perf_stable_partition.cpp
#include <algorithm> #include <iostream> #include <numeric> #include <vector> #include <boost/compute/system.hpp> #include <boost/compute/algorithm/stable_partition.hpp> #include <boost/compute/container/vector.hpp> #include "perf.hpp" int rand_int() { return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);...
ALGO
0.994379
6.12738
5a14f07f-7925-4757-afea-2be61e17f6cb
GauravKumain2111/Cpp-DSA
Learn LinkedList [Single LL, Double LL, Medium, Hard Problems]/Palindrome Linked List.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* reversell(L...
ALGO
0.999819
5.932374
a3b1af3b-2924-4e4e-a341-d15670f602d5
cait7/myLeetCode
301_400/389.cpp
class Solution { public: char findTheDifference(string s, string t) { vector<int> table(26, 0); for (char c: s) { table[c-'a'] += 1; } for (char c: t) { if (table[c-'a'] <= 0) return c; table[c-'a'] -= 1; } return ' '; } };
ALGO
0.999923
5.837087
fa8d2ff8-6bd1-42ca-bc3a-9c976fc0985b
LumenVestige/EnchenSolutions
atcoder/abc-419/[D].cpp
// // Created by sanenchen on 25-8-16. // #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, m; cin >> n >> m; string s, t; cin >> s >> t; vector<int> diff(n + 2, 0); while (m--) { int l, r; cin >> l >> r...
ALGO
0.999998
3.977957
2892a565-818f-413c-804f-213a7d859211
XWHQSJ/SwordtoOffer
SpiralOrder.cpp
// // Created by Wanhui on 3/10/20. // #include "SpiralOrder.h" std::vector<int> Solution29::spiralOrder(std::vector<std::vector<int>> &matrix) { std::vector<int> ans; if (matrix.empty()) { return ans; } // 初始化上下边界,上下边界表示行数 int up = 0, down = matrix.size() - 1; // 初始化左右边界,左右边界表示列数 ...
ALGO
0.99998
6.658627
f765d914-8e12-4553-91ae-31fddb86ba85
jack-rutherford/Aspires
mobile/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.998151
6.76775
ffbb6295-d738-4e4f-807e-92af87f2de58
mhilmyh/algo-data-struct
leetcode/first-bad-version.cpp
// The API isBadVersion is defined for you. // bool isBadVersion(int version); bool isBadVersion(int version) { return true; } class Solution { public: int firstBadVersion(int n) { int l = 1; int r = n; int m = 0; int ans = 1; bool bad; while(l <= r) { ...
ALGO
0.999849
6.602247
71439339-3d94-4ae5-a4f0-bb4bb842c88a
GuacheSuede/MSSubmission1234567890
submission/ema/boost_1_69_0/doc/html/boost_asio/example/cpp11/executors/fork_join.cpp
#include <boost/asio/dispatch.hpp> #include <boost/asio/execution_context.hpp> #include <boost/asio/thread_pool.hpp> #include <condition_variable> #include <memory> #include <mutex> #include <queue> #include <thread> #include <numeric> using boost::asio::dispatch; using boost::asio::execution_context; using boost::asi...
ALGO
0.998746
7.606494
8a13d394-5c6a-444b-ade9-7a587b6f09ee
yumclearall/c_primer_plus
14.3.cpp
#include <stdio.h> int main(){ const float MIN = 0.0f; const float MAX = 100.0f; float score; float total = 0.0f; float min = MIN; float max = MAX; int n = 0; printf("enter a score:"); while (scanf("%f",&score) == 1){ if (score < MIN || score > MAX){ printf("wrong!\n"); continue; } prin...
TOOL
0.916874
3.557807
28fdf2c0-d758-4017-a1e6-16300c724fbe
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_12672_6.cpp
#include <bits/stdc++.h> using namespace std; const int inf = 0x3f3f3f3f; const long long mod = 1e9 + 7; const int maxn = 1e6 + 5; int a[maxn]; char s[maxn]; int gcd(int x, int y) { return y == 0 ? x : gcd(y, x % y); } int main() { int l, r, x, y; while (cin >> l >> r >> x >> y) { if (x == y) { if (x >= l...
ALGO
0.999816
3.498519
7d8b6383-9702-443d-afb1-b51f7deba35f
Sefayet-Alam/New-CP-submissions_vol_3
W_Character_Blocking.cpp
#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; // VVI #define fast \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define ll long long #define SZ(a)...
ALGO
0.999813
4.536883
4fba8e26-735f-488d-b279-0e1050d9533e
tyabus/xray-1.0
3rd_party/boost/libs/regex/example/snippets/regex_search_example.cpp
/* * LOCATION: see http://www.boost.org for most recent version. * FILE regex_search_example.cpp * VERSION see <boost/version.hpp> * DESCRIPTION: regex_search example: searches a cpp file for class definitions. */ #include <string> #include <map> #include <boost/regex.hpp> // purpo...
TOOL
0.886069
5.984878
cda72a41-072e-43c4-96b9-7eb2d512348e
ujjwal-45/codeforces
E_Building_an_Aquarium.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { int t; cin>>t; while(t--){ ll n, x; cin >> n >> x; vector<ll> columns(n + 1); for (int i = 0; i < n;i++){ cin >> columns[i]; } ll low = 0, high = 2000000007; ...
ALGO
0.999973
4.34626
efa32d73-5b50-4e47-8d6b-847687727aa6
argalad/Fundamentos-de-Algoritmia
2. Recursivos/36 - Examen Septiembre 2020/36.cpp
// Nombre y Apellidos: Alberto Rodríguez - Rabadán Manzanares // Número de juez: 77 #include <iostream> #include <fstream> using namespace std; bool esInteresante(int num, int sumaDer, int sumaIz) { if (num == 0) return true; else if (num / ) } // Resuelve un caso de prueba, leyendo de la entrada la // conf...
ALGO
0.999476
4.442737
5d477834-3b9b-4584-8b43-d9e37bdcd3d9
raincross7/code-similarity
codes/train_code/problem065/problem065_157.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; i++) void rec(int d, ll val, vector<ll> &all) { all.push_back(val); if (d == 10) return; for (int i = -1; i <= 1; i++) { int add = (val % 10) + i; if (add >= 0 && add <= ...
ALGO
0.999557
4.208292
ccfc25ed-a8b3-48c6-8b88-3dd55a9cadcf
leo950413/Codeforces
CSES/Sorting and Searching/2183.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main(){ int n; cin >> n; vector<int>v(n); for(int i=0; i<n; i++)cin >> v[i]; sort(v.begin(), v.end()); long long s = 0; for(int i=0; i<v.size(); i++){ if(s < v[i] && v[i] != s + 1){ cout << ...
ALGO
0.999978
3.778569
f2d6390a-2a8a-4c78-bb45-70f736a7f720
Abhibhab/31-CP_SHeet
1000/8.cpp
//HELLGOD// //Aham Brahmasmi// #include <bits/stdc++.h> using namespace std; #define ll long long int #define F first #define S second #define pb push_back #define si set <int> #define vi vector <int> #define pii pair <int, int> #define...
ALGO
0.99988
4.853505
8a5fbea8-5e1f-499d-b1e8-a273714c394c
DGtal-team/DGtal
examples/geometry/meshes/obj-curvature-measures-icnc-3d.cpp
/** * @file geometry/meshes/obj-curvature-measures-icnc-3d.cpp * @ingroup Examples * @author Jacques-Olivier Lachaud (\c <EMAIL> ) * Laboratory of Mathematics (CNRS, UMR 5127), University of Savoie, France * * @date 2021/10/25 * * An example file named obj-curvature-measures-icnc-3d. * * This file is part of ...
ALGO
0.853804
7.615607
6212d3a9-3fd5-4573-b1c0-fb2e84db6309
pineapple880066/c--_base_code
vector容器.cpp
#include<iostream> #include<vector> using namespace std; int main(){ vector<int> v; // v.vector(); // 创建一个vector容器 int n = 4; // explicit vector(const size_t n);创建vector容器,元素个数为n // 加了explicit关键字,不能当转换函数来用 // 例如: vector<int> v2 = (n); vector<int> v2(n); cout << "v.size :" << v.size() <<...
ALGO
0.892329
3.761952
231912eb-5e3d-4d2f-9afb-28778febe894
Fxrdeen/CP_DSA_CPP
LinkedList/reversell.cpp
// Code To reverse a Linked List in C++; #include <iostream> using namespace std; class node{ public: int data; node* next; node(int val){ data = val; next = NULL; } }; node* reverse(node* &head){ node* prev = NULL; node* curr=head; node* next; while(curr!=NULL){ next = curr->next; c...
ALGO
0.999824
5.024992
78532e7e-0a1f-4a6a-988c-236bc2578ab0
Mahatabe/Algorithms
SecantMethodNew.cpp
#include<stdio.h> #include<math.h> double fx(double x) { double f; f=(x*x)-4*x-10; return f; } int main() { double x1,x2,x3; double f1,f2,f3; double er=0.0001; printf("Enter the initial guess : "); scanf("%lf%lf",&x1,&x2); f1=fx(x1); f2=fx(x2); x3=(f2*x1-f1*x2)/(f2-f1); ...
ALGO
0.999896
3.524234
f9c83afe-6b3b-4de3-99a4-f60093cec72a
kevinzhang334455/Scout
boost_1_56_0/libs/graph/example/bfs-example2.cpp
#include <iostream> using namespace boost; template < typename TimeMap > class bfs_time_visitor:public default_bfs_visitor { typedef typename property_traits < TimeMap >::value_type T; public: bfs_time_visitor(TimeMap tmap, T & t):m_timemap(tmap), m_time(t) { } template < typename Vertex, typename Graph > void...
ALGO
0.999862
6.128194
c02aa517-1bce-4cc9-977d-f48020b692ba
KiraLSN/aulaOpenCV
testeocv/OpenCV/3rdparty/carotene/src/div.cpp
#include "common.hpp" #include "vtransform.hpp" #include <cstring> #include <cfloat> #include <cmath> #include <limits> namespace CAROTENE_NS { namespace { #ifdef CAROTENE_NEON inline float32x4_t vroundq(const float32x4_t& v) { const int32x4_t signMask = vdupq_n_s32(1 << 31), half = vreinterpretq_s32_f32(vdupq...
ALGO
0.991617
5.729653
d5e82ba1-40f6-4386-96a7-2aa3d8be1557
zou-song/leetcode
src/lc18/lc18.cpp
#include "lc.h" class Solution { public: vector<vector<int>> fourSum(vector<int>& nums, int target) { sort(nums.begin(), nums.end()); vector<vector<int>> result; int len = nums.size(); for (int i = 0; i < len - 3; ++i) { for (int j = i + 1; j < len - 2; ++j)...
ALGO
0.999721
5.526295
e50f7b31-183d-43f0-9f2f-e1308e794920
sonalibante/ORE
QuantLib/ql/discretizedasset.cpp
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include <ql/discretizedasset.hpp> namespace QuantLib { void DiscretizedOption::postAdjustValuesImpl() { /* In the real world, with time flowing forward, first any payment is settled and only after options can be ...
ALGO
0.997366
7.396772
0417356d-f353-4022-a557-95ac2dd7fe53
hkhetawat/SCOREP_Applications
lammps/src/GPU/pair_lj_class2_gpu.cpp
/* ---------------------------------------------------------------------- Contributing author: Mike Brown (SNL) ------------------------------------------------------------------------- */ #include "pair_lj_class2_gpu.h" #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include "atom.h" #inc...
ALGO
0.998563
7.474552
27f6308c-7101-483c-b40b-dcbbde541c56
rsgysel/ChordAlg
ChordAlgSrc/lb_triang.cpp
#include "ChordAlgSrc/lb_triang.h" #include "ChordAlgSrc/elimination_order.h" #include "ChordAlgSrc/fill_edges.h" #include "ChordAlgSrc/graph.h" #include "ChordAlgSrc/separator.h" #include "ChordAlgSrc/triangulation.h" namespace chordalg { namespace LBTriang { Triangulation* Run(const Graph& G) { EliminationOrd...
ALGO
0.997404
6.392875
6c9ae57f-a325-4082-86f5-9f80406862e3
miyatis/atcoder
arihonn/3_1/test4.cpp
//#include <bits/stdc++.h> #include <stdlib.h> #include <stdio.h> #include <iostream> #include <cmath> #include "atcoder/all" #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <string> #include <algorithm> #include <cstdlib> using namespace std; using namespace atcoder; using min...
ALGO
0.99995
3.873936
1cad3c66-d111-487e-a733-e04c432bf22f
tirozhangbak/emeralddb
boost/libs/math/src/tr1/comp_ellint_3f.cpp
extern "C" float BOOST_MATH_TR1_DECL boost_comp_ellint_3f BOOST_PREVENT_MACRO_SUBSTITUTION(float k, float nu) BOOST_MATH_C99_THROW_SPEC { return c_policies::ellint_3 BOOST_PREVENT_MACRO_SUBSTITUTION(k, nu); }
TOOL
0.877216
3.181791
6e80af18-f618-47d4-a38a-0cf9c591b02f
ys-dirard/cpp
kyopro_educational_90-main/sol/088.cpp
#include <iostream> #include <vector> using namespace std; // Input int N, A[10007]; int Q, X[10007], Y[10007]; // Other Variables int c[10007]; vector<int> G[10007]; vector<int> vec; vector<vector<int>> Answer[10007]; bool flag = false; void dfs(int pos, int dep) { if (flag == true) return; if (pos == N + 1) { ...
ALGO
0.999559
4.253026
7095e3af-443d-4728-9419-63efb11e168d
Arkaenaz/GDPARCM
Shared/OpenCV/sources/samples/hal/slow_hal/impl.cpp
#include "impl.hpp" int slow_and8u(const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height) { for(; height--; src1 = src1 + step1, src2 = src2 + step2, dst = dst + step) for(int x = 0 ; x < width; x++ ) dst[x] = src1[x] & src2[x]; ret...
ALGO
0.892085
5.761007
14e2f363-b7ee-4b78-8dd9-69fcf843a202
lebowski36/Voxel-Castle
engine/src/rendering/mesh_builder.cpp
#include "rendering/mesh_builder.h" #include "rendering/meshing/two_phase_greedy_meshing_algorithm.h" #include "rendering/debug_render_mode.h" #include "world/voxel_types.h" #include "world/chunk_segment.h" #include "rendering/texture_atlas.h" #include "world/voxel_face_patterns.h" #include "utils/debug_logger_stub.h" ...
ALGO
0.979653
7.536856
bc8a5486-9b8d-4c35-b9d0-3d658099f2fc
h50039135/llvm_again_somehow
libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp_cont.pass.cpp
// <queue> // template <class InputIterator> // priority_queue(InputIterator first, InputIterator last, // const Compare& comp, const container_type& c); #include <queue> #include <cassert> #include "test_macros.h" int main(int, char**) { int a[] = {3, 5, 2, 0, 6, 8, 1}; const int n = siz...
TEST
0.968993
4.833145
693d5d97-d14e-481a-ac9f-9b009240536b
Jikky1618/AtCoder
kyopro90/029.cpp
#include <bits/stdc++.h> #include <atcoder/lazysegtree> using namespace std; using ll = long long; #ifdef LOCAL #include <debug_print.hpp> #define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__) #else #define debug(...) (static_cast<void>(0)) #endif int op(int a, int b){ return max(a, b); } int e()...
ALGO
0.999712
4.147429
4f1cf05f-4f4f-4b0f-aa9c-fbd954387e9b
bluster980/Leetcode-Solutions
0048-rotate-image/0048-rotate-image.cpp
class Solution { public: void rotate(vector<vector<int>>& matrix) { vector<vector<int>> t = matrix; int k = matrix[0].size()-1; for(int i=0; i<t.size(); i++){ for(int j=0; j<t[i].size(); j++){ matrix[i][j] = t[k-j][i]; } } } };
ALGO
0.999949
6.491074
3588c9ea-d65e-4262-91b7-417ccc90a2ba
wwwllm/C--
大一下/15届蓝桥杯国赛a组/F.cpp
#include <bits/stdc++.h> #define int long long using namespace std; const int mod = 998244353; int exp(int a, int b) { int ans = 1; while (b) { if (b & 1) ans = (ans * a) % mod; b >>= 1; a = (a * a) % mod; } return ans; } void solve() { int x, y, n; cin >...
ALGO
0.999939
5.96008
ae8fe5e4-227a-43f7-8cbd-45e5073fe5c5
Shishank93774/LeetCode-Solutions
0226-invert-binary-tree/0226-invert-binary-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.999983
6.175498
713de004-191c-4984-ab4e-b9be47eaedf1
MrAyushBajpai/PractiseQues
C++/Basic Examples/Operators/Arithmetic/Multiplication.cpp
#include <iostream> using namespace std; int main() { // Multiplication Operator (*) cout << "Multiplication Operator (*):" << endl; // Integer multiplication int x = 7, y = 3; cout << "x * y = " << x * y << endl; // Example of integer multiplication // Floating point multiplication ...
ALGO
0.965521
3.931842
d1878cdf-f82d-4348-a77f-b2347e190d82
raincross7/code-similarity
codes/train_code/problem167/problem167_231.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repr(i, a, b) for(int i = a; i < b; i++) #define all(x) (x).begin(),(x).end() // 昇順ソート #define rall(v) (v).rbegin(), (v).rend() // 降順ソート #define FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0) ty...
ALGO
0.999979
4.057259
d67ab997-8898-4e77-b5fe-094fff77b37c
Slama305/problem_solving_cpp
LEVEL_0/‫‫‫week_5/V - Palindrome Array.cpp
// by Slama #include <bits/stdc++.h> using namespace std; void slama(){ // #ifndef ONLINE_JUDGE ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0); // freopen("input.txt","r",stdin), // freopen("output.txt","w",stdout); // #endif } void fun(int n){ int arr[n]; for(int i=0;i<n;i++){ cin>>arr[i]; } int fla...
ALGO
0.999835
3.802103
6d0747b9-0f28-48b6-95ae-b66a63c12985
sarvex/leetcode-pascal
solution/0000-0099/0020.Valid Parentheses/Solution.cpp
class Solution { public: bool isValid(string s) { string stk; for (char c : s) { if (c == '(' || c == '{' || c == '[') stk.push_back(c); else if (stk.empty() || !match(stk.back(), c)) return false; else stk.pop_back(...
ALGO
0.999583
6.606872
4de37f00-80d6-4fdb-8bfe-4a6ef842cb8f
cxx221016/CPP
CS2308/2.4.1.cpp
#include<iostream> #include<cstring> #include<cstdio> #include<vector> #include<stack> #include<map> #include<algorithm> using namespace std; long long int dfs(long long int now,vector<long long int>& dp,vector<vector<int>>& g,vector<int>& in,int id) { if(dp[now]) return dp[now]; dp[now]=0; for(int i=0;i<i...
ALGO
0.999918
4.044429
0353741a-084b-457d-b118-3cd9f1ee6ff8
priyalbhatewara123/Winter-Industrial-Training-GirlScript
Arrays/Merge Sort.cpp
void merge(int a[] , int s , int e) { int mid = (s + e) / 2; int temp[100]; int i = s; //traverse first subarray int j = mid + 1; //traverse second subarray int k = s; //track of temp array while (i <= mid and j <= e) { if (a[i] < a[j]) { temp[k] = a[i]; k++; i++; } else { temp[k] = a[j]; k...
ALGO
0.999214
4.728674
dcd993fe-b09c-4ea1-91c6-c9b052cdcda6
alessiocali/AdventOfCode
calendar/2021/9_SmokeBasin/SmokeBasinSolver.cpp
#include <SmokeBasinSolver.h> #include <cassert> #include <fstream> #include <numeric> #include <ranges> #include <string> #include <range/v3/all.hpp> namespace aoc2021::SmokeBasin { void FloorHeightMap::Init(std::istream& inputStream) { auto charToInteger = [](const char c) { return c - '0'; }; ...
ALGO
0.970818
6.29256
cb2d50dd-cb37-4129-b9cb-8f60cdff18d4
Koyingtw/CP
NTHU-CP/HW/1-7.cpp
#include <bits/stdc++.h> #define Weakoying ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); #define int long long #define ll long long #define pii pair<int, int> #define vi vector<int> #define vii vector<pair<int, int>> #define pqueue priority_queue #define pb push_back #define F first #define S second #define max(a, ...
ALGO
0.999987
4.093861
1f77ef04-eb92-412a-993a-4ff1791b327c
HridoyHazard/SPOJ-Solutions-
prime.cpp
#include <iostream> typedef long long int ll; using namespace std; int isPrimeNumber(int); int main() { bool isPrime; ll t; cin>>t; while(t--) { ll n,m; cin>>n>>m; for(ll i=n;i<=m;i++) { isPrime = isPrimeNumber(i); if(isPrime == true) ...
ALGO
0.999875
3.858387
a49b26f5-fd79-4598-a8cd-be24728e6c0c
AdityaKarn/cp-cpp
codechef/april 20/FCTRE.cpp
#include<iostream> #include<vector> #include<algorithm> #define REP(i,n) for (int i = 1; i <= n; i++) #define mod 1000000007 #define pb push_back #define ff first #define ss second #define ii pair<int,int> #define vi vector<int> #define vii vector<ii> #define lli long long int #define INF 1000000000 using namespace ...
ALGO
0.999645
3.721726
5d7dee10-5ca5-4358-b3ea-01c29b03ea07
keepscoin/keepscoin
src/merkleblock.cpp
#include "merkleblock.h" #include "hash.h" #include "primitives/block.h" // for MAX_BLOCK_SIZE #include "utilstrencodings.h" using namespace std; CMerkleBlock::CMerkleBlock(const CBlock& block, CBloomFilter& filter) { header = block.GetBlockHeader(); vector<bool> vMatch; vector<uint256> vHashes; vM...
ALGO
0.998941
5.955848
dcdcacdc-7e7d-4def-b812-b16f8da055b8
MihHiu2829/exerice_Cpp
Bai_tap_tren_lop/baitap_buoi_5/Doan_Minh_Hieu_2180602248.cpp
#include<bits/stdc++.h> using namespace std ; //================================================= Cau a void nhapMang(int A[], int n,int i = 0){ if(i == n) return ; printf("Nhap phan tu thu A[%d] = ", i); scanf("%d", &A[i]); nhapMang(A,n,i+1); } // ======================================...
ALGO
0.99816
3.210126
668bbdcd-f041-4fa6-a884-620f28e10629
embededdrive/Algorithm
C++/Mincoding/starter_06._13.cpp
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; for (int i = 0; i < c; i++) { for (int j = a; j <= b; j++) { cout << j << ' '; } cout << endl; } return 0; }
ALGO
0.99942
3.345293
fc2703b2-2a6a-4887-97f6-546720dfde9c
abrade/spoj
bitmap/bitmap2.cpp
#include <cstdio> #include <cstdlib> #include <string> #include <deque> #include <queue> #define MAXVALUE 182 #define INVALID 1000 struct Position { Position(int r, int c) { row = r; col = c; } int row; int col; bool operator<(const Position& rhs) { return row < rhs.row && col < rhs.col; ...
ALGO
0.999642
4.098081
36bb8232-3376-432d-abbd-cc913b226c16
EugeneSel/Project_land_ants
project/ant_simu.cpp
#include <vector> #include <iostream> #include <random> #include "fractal_land.hpp" #include "ant.hpp" #include "pheromone.hpp" # include "gui/context.hpp" # include "gui/colors.hpp" # include "gui/point.hpp" # include "gui/segment.hpp" # include "gui/triangle.hpp" # include "gui/quad.hpp" # include "gui/event_manager....
ALGO
0.998927
3.930794
1e6364cb-5332-47f9-9d2c-3136be0c4eaf
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_3196_2.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; string s; cin >> n >> s; if (s.size() == 1 && s[0] == '0') { cout << "No" << endl; return 0; } if ((s[0] == '0' && s[1] == '0') || (s[s.size() - 1] == '0' && s[s.size() - 2] == '0'))...
ALGO
0.999982
4.531491
4e981c24-dc4e-4bfa-b530-fadb8a85932d
shreshtsharma/Leetcode_Questions
1046-last-stone-weight/1046-last-stone-weight.cpp
class Solution { public: int lastStoneWeight(vector<int>& stones) { int i=0; int j=1; int diff; while(stones.size()>1) { sort(stones.begin(),stones.end(),greater<int>()); if((stones[i]-stones[j])>0) { diff=abs(st...
ALGO
0.99993
5.035211