uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
20693109-ee87-48c8-b441-4c00c43653d1
Noor48/Code2
4th year/test15.cpp
#include<iostream> #include<cmath> #include<cstdlib> #include<fstream> #include<ctime> using namespace std; int main() { ofstream fout("test15.dat"); srand(time(NULL)); int N=100000, n=1000, a[N], c[2*n],x, y; double p[2*n], r,s; for(int i=0; i<=N; i++) { x=0; r = (rand()%n)+1; for(int j=0; j<=r; j++) ...
ALGO
0.998088
3.233707
c7d26ea0-0ee0-43af-8b17-e58afcd880ff
lohiyakeshav/magic_8_ball
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998859
6.785645
1fdf77c9-37d2-4216-8097-fb6f6c385f5a
PinkArmor/C-PTIT
toiec.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int t; cin >> t; while (t--){ int n; cin >> n; if(n>=450 && n<=520){ cout << "7" << endl; } else if (n>=525 && n<=595){ cout << "8\n"; } else if(n>=600 && n<= 725){ cout << "9\n"; } else if(n>=730 && n<=990){ cout << "10\n"; } e...
ALGO
0.999218
3.547111
6971ba9a-3051-469e-b780-2fcd7e0be231
gxyau/leetcode
challenge/may2020/day5.cpp
class SolutionDay5 { public: int firstUniqChar(string s) { // Store occurence of each character in a map map<char, int> dict; for (char& c : s) { if (dict.count(c)) { ++dict[c]; } else { dict[c] = 1; } } ...
ALGO
0.999742
5.906888
6b849cd8-f63a-4a49-9179-4f36a4051bce
dginhac/esirem-itc313
samples/2020-2021/lesson06/dangling-pointer3.cpp
#include <iostream> int* my_fct1() { int x = 5; std::cout << "In my_fct1, &x=" << &x << " - x=" << x << std::endl; return &x; } int* my_fct2() { int *x = new int(5); std::cout << "In my_fct2, &x=" << x << " - x=" << *x << std::endl; return x; } int main() { int* px1; int* px2; px1...
TOOL
0.851256
4.373981
f1102608-5de2-4c96-8379-0ec3eb126ae6
Ynjxsjmh/PracticeMakesPerfect
LeetCode/p0053/I/53-maximum-subarray.cpp
#include <algorithm> #include <iostream> using namespace std; int maxSubArray1(vector<int>& nums) { // O(n^2) 超时 int result = nums[0]; for (int i = 0; i < nums.size(); ++i) { for (int j = i; j < nums.size(); ++j) { int sum = 0; int temp = i; while (temp < j) { ...
ALGO
0.999907
5.696516
4b300f4e-2ffb-452d-8c82-36f100ac22c3
JawadSher/DSA-LeetCode-GFG-Problems-Repository
19 - Heap Data Structure Problems/06 - Merge Two Binary Max Heaps/main.cpp
class Solution{ public: void maxHeapify(vector<int> &v, int n, int i){ int largest = i; int leftIndex = 2 * i + 1; int rightIndex = 2 * i + 2; if(leftIndex < n && v[largest] < v[leftIndex]) largest = leftIndex; if(rightIndex < n && v[largest] < v[rightIndex]) lar...
ALGO
0.999976
4.723577
afc4f229-d240-4cec-a478-dea829459150
sane-aalam/DSAOne
Lecture57 - Height of Binary Tree/104. Maximum Depth of Binary Tree.cpp
#include <bits/stdc++.h> using namespace std; // Definition for a binary tree node. struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode() : val(0), left(nullptr), right(nullptr) {} TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} TreeNode(int x, TreeNode *left, Tree...
ALGO
0.99949
6.215959
1337dc32-9942-4689-b80e-0938a41f928f
anmolkohli13/DSA-practice
gfg solutions/Roman Number to Integer.cpp
int romanToDecimal(string &str) { unordered_map<char, int> mp; mp['I'] = 1; mp['V'] = 5; mp['X'] = 10; mp['L'] = 50; mp['C'] = 100; mp['D'] = 500; mp['M'] = 1000; int res = 0; for(int i = 0; i < str.size(); i++) { if(i+1 < str.size() && mp[str[i]] < mp[str[...
ALGO
0.999832
5.601907
021ba457-b2df-4320-a1fa-fc28c84716cc
AllenHuangGit/ompl-1.6.0
demos/HypercubeBenchmark.cpp
/* Author: Bryant Gipson, Mark Moll */ #include <ompl/base/spaces/RealVectorStateSpace.h> #include <ompl/geometric/planners/rrt/RRT.h> #include <ompl/geometric/planners/kpiece/KPIECE1.h> #include <ompl/geometric/planners/est/EST.h> #include <ompl/geometric/planners/prm/PRM.h> #include <ompl/geometric/planners/stride/S...
ALGO
0.998379
7.24616
afe97bbb-4b30-4ba1-8eb4-691c7a6e0f40
X3n0nP0w3r3d/InputOutput
problemsets/B_Fix_You.cpp
#include <bits/stdc++.h> using namespace std; template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; } template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::va...
ALGO
0.999716
5.122172
62646275-6fa5-43b3-9560-56e68970484b
j-vieira/maratona
semana1/BuscaSTR.cpp
//Algoritmos de Busca em String: Knuth-Morris-Pratt, Boyer-Moore, Rabin-Karp //KMP acertado em 05/03/2024 #include <bits/stdc++.h> using namespace std; char P[1000001], T[1000001]; int n, m, F[1000001], R[256]; void KMP(){ int i,j,k; //Preprocessamento F[0] = 0; F[1] = 0; j = -1; i = 0; while (i...
ALGO
0.99991
5.114564
54cf548f-50bc-4271-9a5d-82fa09059f3c
matisandacz/Anlisis-de-Sentimientos
eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; int main() { Eigen::MatrixXf mat(2,4); Eigen::VectorXf v(2); mat << 1, 2, 6, 9, 3, 1, 7, 2; v << 0, 1; //add v to each column of m mat.colwise() += v; std::cout << "Broadcasting result: " << std::endl;...
ALGO
0.998518
4.136906
8b7226c9-8463-4160-bbe8-b5d85eaca559
Hou-Xiaoxuan/AlgorithmCompetition
algorithm_contest_2021/Atcoder/02_19_AtCoder Beginner Contest 192/E.cpp
#ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES #endif #include<bits/stdc++.h> #define IOS ios::sync_with_stdio(false); cin.tie(0);cout.tie(0); #define m_p make_pair #define x first #define y second using namespace std; using LL=long long; using ULL=unsigned long long; using LD=long double; using P=pair<int,int>;...
ALGO
0.9999
3.841674
a53dd42f-679e-4854-bca2-9cee9afa33c0
vipinrawatim/DSA-with-c--
Leetcode practice/#day1.cpp
#include<iostream> #include<vector> class Solution { public: vector<int>twoSum(vector<int> &nums, int target) { for (int i = 0; i < nums.size(); i++) { for (int j = i+1; j < nums.size(); j++) { if (nums[i] + nums[j + 1] == target) { ...
ALGO
0.999869
5.066114
330817ca-9cb9-4e08-8ada-2108f62c062c
pronad1/Problem_Solving_Part1
plus_minus.cpp
#include<iostream> using namespace std; int main() { int t; cin>>t; while(t--) { int a,b,c; cin>>a>>b>>c; if((a+b)==c) cout<<"+"<<endl; else cout<<"-"<<endl; } return 0; }
ALGO
0.999963
4.262026
851cae0a-9508-4ae7-9587-a19c2ab4e511
ArushNo1/Competitive-Programming
CF/1373B.cpp
#pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef long long ll; typedef vector...
ALGO
0.999699
5.592747
e5bcfef3-5765-4e09-8cc8-7374142ba7b4
xczhang07/leetcode
cpp/easy/valid_palindrome.cpp
class Solution { public: bool isPalindrome(string s) { if(s.size() <= 1) return true; string tmpstr = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; int start = 0; int end = s.size()-1; while(start < end) { while(start < end ...
ALGO
0.999395
5.735598
c52f3595-28b5-4593-b4ff-d36fe3dc8650
abracoder/Code_subMission
Detect cycle in an undirected graph - GFG/detect-cycle-in-an-undirected-graph.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { bool dfs ( int node, int parent , vector<int> adj[], vector<int>&vis){ vis[node] =1; for(auto adjacentNode:adj[node]){ if(!vis[adjacentNode]){ ...
ALGO
0.999974
6.134773
7bf25212-8e20-4321-b051-a0f124eecf10
raincross7/code-similarity
codes/train_code/problem280/problem280_209.cpp
#include<iostream> using namespace std; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { int y, m, d; cin >> y >> m >> d; int sumDay = 0; int month1[10] = { 0,20,39,59,78,98,117,137,156,176 }; int month2[10] = { 0,20,40,60,80,100,120,140,160,180 }; int ly = 0, nly = 0; for (int i = 1; i < y...
ALGO
0.999949
3.714865
95d6af6d-5c6f-4491-9aec-5e26df1996d2
MichTronics76/zTeam-Source-Season8
GameServer/crypto/adler32.cpp
// adler32.cpp - written and placed in the public domain by Wei Dai #include "pch.h" #include "adler32.h" NAMESPACE_BEGIN(CryptoPP) void Adler32::Update(const byte *input, size_t length) { const unsigned long BASE = 65521; unsigned long s1 = m_s1; unsigned long s2 = m_s2; if (length % 8 != 0) { do { s1...
ALGO
0.987932
6.606503
d04e6ebb-797c-4103-99b5-b159c154bc9f
cmottao/CompetitiveProgrammingSolutions
codeforces/C/1538.cpp
// Made by Cristian Motta (cmottao) #include <bits/stdc++.h> using namespace std; void solve() { int n, l, r; cin >> n >> l >> r; vector<int> a(n); long long ans = 0; for(int i = 0; i < n; i++) { cin >> a[i]; } sort(a.begin(), a.end()); for(int i = 0; i < n-1; i++) { ans +...
ALGO
0.999872
4.767568
cf5e91b4-4889-4384-aab9-33fe71e84298
sakethsatti/LinChess
src/chess/perft.cpp
#include <chess/board.hpp> #include <chrono> #include <iostream> //test long perft(Board &b, const int& depth, const int& oDepth) { long count = 0; const MovesList& moves = b.genLegalMoves(); if (depth == 1) { if (depth == oDepth) { Board::print_moves(moves); } return moves.size(); } ...
ALGO
0.989648
5.088427
5f417384-6035-4306-897e-73e692ccad5c
hungchingliu/LeetCode
CSES/Graph/shortest_routes1_dijkstra.cpp
#include <iostream> #include <queue> #include <vector> #include <limits> class Solution { public: struct Node { long long int distance; int index; }; struct CompareNode { bool operator() (Node const &below, Node const &above) { if (below.distance > above.distance) { return true; ...
ALGO
0.999984
4.842033
0aa6ebc4-18a2-4ce3-9883-ee882f9c0d4f
LunchOn13/git_beakjoon
codes/7568.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; int x [50] = {0,}; int y [50] = {0,}; int result [50]; fill_n(result, 50, 1); for(int i = 0 ; i < n; i ++) { cin >> x[i] >> y[i]; } for(int i = 0; i < n; i ++) { for(int j = 0; j ...
ALGO
0.999812
3.919638
91ef9c43-065b-4ed0-864e-316577b1f5cd
alps-jbnu/25ALPStudy
2025-1/Intermediate/zunhyeok/two_pointer/BOJ-2531.cpp
#include <bits/stdc++.h> using namespace std; int arr[30001]; int sushi_check[3001]; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, d, k, c; cin >> n >> d >> k >> c; for (int i = 0; i < n;i++) { cin >> arr[i]; } int st = 0, en = 0, cnt = 0, max_sushitype = 0, cur_dish = 0; while (st < n) { if...
ALGO
0.999954
3.604558
9fc3cfd0-5c6a-4839-9f3b-5a32f2dd906f
ckp-koiken/abc_exercise
417/A_A_Substring.cpp
#include <bits/stdc++.h> using namespace std; int main() { int N, A, B; string S; cin >> N >> A >> B >> S; cout << S.substr(A, N - A - B) << endl; // another answer // 消される文字の順番をN, A, Bで指定する // int start = A; // int end = N - B; // for (int i = start; i < end; i++) { // cout << S.at(i); // ...
ALGO
0.987601
3.218686
8b50265b-d3d3-4d8f-8bb2-68249cc59afc
ishandutta2007/codeforces
mhq/normal/846/B.cpp
#include <iostream> #include <math.h> #include <set> #include <vector> #include <iterator> #include <algorithm> using namespace std; long long n,k; long long t[49]; long long M; long long ans( int a, int b) { long long time = 0; for ( int i = 0; i < a; i++) { time += n*t[i]; } for ( int i =...
ALGO
0.999995
3.178254
4762f68f-72b9-40a5-8a3d-0dbc06343900
Avdh512/LeetCode
Daily POTD/Day38/2305. Fair Distribution of Cookies Answer.cpp
class Solution { public: int ans=1e8; void find(vector<int>&nums,vector<int>&v,int k,int index) { if(index>=nums.size()) { int mx=*max_element(v.begin(),v.end()); ans=min(ans,mx); return ; } for(int i=0;i<k;i++) { v[i]+=...
ALGO
0.999992
5.128136
426744d7-3c3b-4e49-b264-40e3d94500b2
mdyasinahmed/CSE200_CompetitiveProgramming
ACM_Contest/Basic STL Practice Contest/T2.cpp
#include <bits/stdc++.h> using namespace std; int main() { long long int x, y, i; while(cin>>x>>y) { long long int arr[x+1]; for (i=0; i<x; i++) cin >> arr[i]; sort(arr, arr+x); long long int sum = 0; for(i=0; i<x; i++) { sum += arr[i] * y; ...
ALGO
0.999881
3.479535
bb458489-61ac-478b-9d28-d5f5898dd154
Mendeir/C-Primer
C++Primer/Chapter01/1.05.cpp
/* Exercise Description: Exercise 1.5: We wrote the output in one large statement. Rewrite the program to use a separate statement to print each operand. */ #include <iostream> int main () { std::cout << "/*"; std::cout << "*/"; std::cout << /* */" */"; std::cout << /* "*/" /* "/*" */; return 0; }
TOOL
0.883634
4.542973
0fb5ea13-4116-4dc3-bd66-b9f452c2dc40
mk28r/Code-
InserAtTheGivienPositionInLinkList.cpp
#include <bits/stdc++.h> using namespace std; int num = 0 ; struct node { int data; node * next; node(int x) { data = x; next = NULL; } }; void printlist(node * head) { node * curr = head; while (curr != NULL) { cout << curr->data << " "; ++num; curr = curr->next; } cout << "\n" << num; } node *I...
ALGO
0.999202
3.382152
60807629-57e4-447b-993f-5d94e3e2e7bb
TheKushagraPerspective/DSA-full-course-with-cpp
Patterns/Pattern_11.cpp
/* * * * * * * * * * * * * * * * */ #include<bits/stdc++.h> using namespace std; void printPattern(int n) { for(int i=0 ; i<n ; i++) { for(int j = 0 ; j<i ; j++) { cout << " "; } for(int j=0;j<n-i;j++) { cout << "*"; } ...
ALGO
0.999576
4.302958
de9c31ec-4007-428a-8fe9-09917b6dc0c4
Ossyyrr/cursoFlame
pruebasflame/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.996321
6.785645
27b7c1ff-51da-4bca-b1e8-1c2135bf9cdb
darzajgl/639B-ETxxx-IEP-PRZ
Z2/main.cpp
#include <iostream> using namespace std; /* 1. wymusza wpisanie liczby calkowitej x zawartej w przedziale <A,B> 2. drukuje tak okreslona wartosc x 3. wczytuje cig liczb cakowitych a do wczytania liczby parzystej lub podzielnej przez x 4. drukuje najwieksza ujemna liczbe tego ciagu (nie biorac pod uwage liczby konczace...
ALGO
0.99659
3.611548
0f15549b-71f0-4372-b9ef-0658d912637b
manikanta2901/ubuntu
.history/codingChallenges/cpp/Codechef/longChallenges/Year2021/January/BlackJack_20210108193157.cpp
#include<bits/stdc++.h> #include<vector> #include<iostream> #include<cmath> #include<algorithm> #include<iterator> #include<string> #include<map> #define vv vector #define F first #define S second #define MP make_pair #define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define printM...
ALGO
0.999975
3.644751
42b8803b-37f1-417b-953f-edde1d99bfa8
demining/Bitcoin-GUI-Google-Colab
src/key_io.cpp
#include <key_io.h> #include <base58.h> #include <bech32.h> #include <util/strencodings.h> #include <algorithm> #include <assert.h> #include <string.h> /// Maximum witness length for Bech32 addresses. static constexpr std::size_t BECH32_WITNESS_PROG_MAX_LEN = 40; namespace { class DestinationEncoder { private: ...
TOOL
0.920835
7.860221
79e4480a-a74b-4daf-af8e-2232267a8829
Al-amen/leetcode
726.Number_of_Atoms.cpp
class Solution { public: // Helper function to recursively solve the chemical formula int solve(int i, string s, int n, map<string, int>& prev_map) { map<string, int> t; // Iterate through the formula string for (; i < n; i++) { if (s[i] == '(') { // ...
ALGO
0.999993
6.167225
505f337e-6e0f-48f5-a19b-a2487ff0d4d3
rakib54/Algorithm-and-problem-solving
String/Shortest Palindrome.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long class Solution { public: string shortestPalindrome(string s) { string rev = s; reverse(rev.begin(), rev.end()); for(int i = 0; i < s.size(); i++){ // memory compare between two string if(!memcmp(s.c...
ALGO
0.999963
5.621492
2655145f-f2ef-4015-aa6e-199898f60b50
imulan/procon
hackerrank/world-codesprint-10/maximal-and-subsequences.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define all(x) (x).begin(),(x).end() #define pb push_back #define fi first #define se second const ll mod=1e9+7; ll fact(int n) { ll ret=1; for(ll i=1; i<=n; ++i) (ret*=i)%=mod; return re...
ALGO
0.999809
3.799908
df20d138-1265-4f16-aa25-8851dcd83ca5
DianaSachovska/st-pp-lab-1-DianaSachovska
task1_2_3.cpp
#include <iostream> #include <thread> #include <mutex> #include <Windows.h> #include <iterator> #include <list> #include <algorithm> using namespace std; list < int > l; void AddToList(int a) { l.push_back(a); cout << "Added " << a << endl; for (int i = 1; i <= 9; i++) { l.push_back(a + i); ...
TOOL
0.938763
5.121913
a85acb59-dfa6-47f4-bf19-b05456352109
yuriyvolkov/symboliccpp
symbolic/examples/spheric.cpp
// spheric.cpp #include <iostream> #include "symbolicc++.h" #include "asslegendre.h" using namespace std; Symbolic PI("PI"), I("I"); int factorial(int n) { int result=1; for(int i=2;i<=n;i++) result *= i; return result; } Symbolic Y(int l,int m,const Symbolic &phi,const Symbolic &w) { Symbolic a, b, u("...
ALGO
0.999942
4.25158
82d87dca-5b42-48b2-aa5c-78caefb30fb1
kaushikacharya/leetcode
src/increasing_triplet_subsequence.cpp
// https://leetcode.com/problems/increasing-triplet-subsequence/ // June 26, 2016 #include <iostream> #include <vector> using namespace std; class Solution { public: bool increasingTriplet(vector<int>& nums) { int n = nums.size(); if (n < 3) { return false; } ...
ALGO
0.999924
5.721616
c39149e2-70f1-474c-a440-e951f3e32225
bhuppidhamii/myLeetCode
3651-transformed-array/transformed-array.cpp
class Solution { public: vector<int> constructTransformedArray(vector<int>& nums) { int N = nums.size(); vector<int> res(N, -1); for (int i = 0; i < N; i++) { int k = nums[i]; if (nums[i] > 0) { int targetIndex = (i + k) % N; res[i] = ...
ALGO
0.999998
5.724549
7ac3b1af-61d2-44c2-91f6-55a253afe2d4
veedee2000/SDE_30_DAYS
Day10/Palindromic_Partition/2/DP.cpp
class Solution { vector<int>dp; vector<vector<int>>palin; int f(int i,string& s){ if(i == s.size()) return -1; if(dp[i] != -1) return dp[i]; string aux; dp[i] = INT_MAX; for(auto nextIndex:palin[i]) dp[i] = min(dp[i], 1 + f(nextIndex, s)); return dp...
ALGO
0.999976
5.703498
ccded5e8-33bc-4139-9b5a-eabb79a2d693
vbalab/algorithms_and_data_structures
problems/leetcode/0387_first_unique_character_in_a_string.cpp
#include <string> #include <vector> #include <iostream> #include <unordered_map> class Solution1 { public: int firstUniqChar(std::string& s) { std::unordered_map<char, int> m; for (int i = 0; i < s.size(); i++) { char c = s[i]; if (m.find(c) == m.end()) m[c...
ALGO
0.999781
5.769208
e43e4c47-8b22-4cca-9a8d-a9184a858dcb
kartikx/DSA
Stack/sortStackAux.cpp
/* Use a Temporary Stack, to sort a Stack. Sorting means that the greatest element is at the top. As an extreme case, consider when the Stack is completely reverse sorted. In that case, all that's needed is to use the temporary stack, to reverse the Stack. So you can push elements from top of Stack to Temp, if the el...
ALGO
0.999926
5.79103
10a75e16-d5d1-42c8-9ec9-0ece10c61b9a
st129655/2024_cpp_ZV
2024.10.12_HW4/2024.10.12_HW4/task7.cpp
#include<iostream> #define N 1000 int main(int argc, char* argv[]) { int n = 0; int x = 0; scanf_s("%d", &n); int a[N]; for (int i = 0; i < n; ++i) { scanf_s("%d", &a[i]); } for (int i = n - 1; i >= 0; --i) { printf("%d ", a[i]); } return EXIT_SUCCESS; }
ALGO
0.999725
3.736189
b0e38def-8f2e-44b9-a5d5-aa29d82b34d4
om1024bhosale/Daily-DSA-Practice
Binary Tree/987-verical-order-traversal-of-a-binary-tree.cpp
/* link -> https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree/description/ Given the root of a binary tree, calculate the vertical order traversal of the binary tree. For each node at position (row, col), its left and right children will be at positions (row + 1, col - 1) and (row + 1, col + 1) r...
ALGO
0.999999
6.854328
a1471176-e301-49ae-b00c-c8d9f115d898
birdmandayum0131/LeetBird
Matrix/(Hard)773_Sliding_Puzzle/Solution_2(46ms).cpp
#include <iostream> #include <map> #include <queue> #include <stack> #include <tuple> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; class Solution { public: int slidingPuzzle(vector<vector<int>> &board) { unordered_set<string> min_step_set; string ta...
ALGO
0.999981
6.585923
bdde11a4-af9a-456e-88b7-2c7cfdfdeac8
ratneshnamdeo0207/DSA-questions
String/string_compression.cpp
#include<iostream> #include<vector> using namespace std; void string_compression(vector<char> a ) { string s = ""; int count = 0; for(int i = 0; i < a.size();) { s += a[i]; int j = i+1; while(a[j] == a[i] && j < a.size()) { count++; cout<<count<<endl; ...
ALGO
0.999967
3.932425
80eaaffe-2d9a-4ba4-923d-2828dddc6722
Ishwarendra/Contests
CODEFORCES_CONTEST/Edu_148/E.cpp
#include "bits/stdc++.h" #ifdef LOCAL #include "F:\CPP\Debug\debug.h" #else #define print(...) 1; #endif using i64 = long long; template<class T> T power(T a, i64 b) { T res = 1; for (; b; b /= 2, a *= a) { if (b % 2) res *= a; } return res; } template <typename T> T inve...
ALGO
0.999959
4.268257
e250649c-b655-4522-9a43-dd5e01498796
can-ishk/coding-practice-competitive-dsa
cses/IntroductoryProblems/NumberSpiral.cpp
#include <bits/stdc++.h> using namespace std; /* The following is my initial approach to the problem, but it's not as fast as a mathematical solution which is also implemented below. My Observations after looking at the 5x5 number spiral given in the question: if row, y is even, spiral[1][y] = y^2 if ...
ALGO
0.999871
5.634523
084d19e5-64d8-44e8-bd14-526856abba19
Subho27/Algorithms-and-Data-Structures
Graph/BellmanFordAlgorithmAM.cpp
#include<bits/stdc++.h> using namespace std; vector<int> shortestDistanceBF(int src, int n, vector<vector<int>>& adjMat) { vector<int> distance(n, INT_MAX); distance[src] = 0; for(int i=0; i<n-1; i++) { for(int j=0; j<n; j++) { for(int k=0; k<n; k++) { if(adjMat[j][k] !=...
ALGO
0.999986
5.437513
ea6bde59-12f9-4cfd-a704-8411f61b6881
Cyber-Vadok/CPP-S-RASTER
src/cluster.cpp
#include "cluster.h" void calculate_results(std::vector<cluster_point>& results, key_set& significant_tiles, int delta, int mu, float precision, int current_time) { std::vector<std::unordered_set<point> > clusters; // https://thispointer.com/modify-elements-while-iterating-over-a-set-in-c/ ...
ALGO
0.999826
4.643971
10e6e01b-55dc-4dfc-8dac-73d89acc5eb7
Amel-CYDF/BOJ
BOJ_9205.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<pii> vpii; typedef vector<pll> vpll; typedef vector<vi> vvi; typedef vector<vl> vvl; typedef vector<vpii> vvpii; typedef vector<vpll> vvpl...
ALGO
0.999895
3.967791
310c59eb-6d20-4271-8c2b-276bf84470e8
AlexGliesch/competitive-programming
leetcode/cpp/average-of-levels-in-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.999907
6.819214
5bd1ec11-ea79-48f1-bb1f-18b203b7df9a
Arnab-000/Competitive-Programming-Problem-Solutions-by-Arnab
1688B Social Distance Solution.cpp
/* Author : Catalyst71 < While there is a code, there is a bug > ¯\_(ツ)_/¯ */ #include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; typedef long long ll; typedef unsigned long long ull; using namespace std; #define FIO ios::sync_with_stdio(0...
ALGO
0.999986
4.888462
9ad445a9-4190-4cef-8585-27e475193176
01prashu/Data-Structure-Algorithm
Basic Programing Practises/33gfg.cpp
#include <iostream> using namespace std; void equlibrium(int arr[], int size) { int l=1 ,h=size , mid=(l+h)/2; for(int i=1;i<=size;i++) { mid=(l+h)/2; int j=mid-1 , k=mid+1 , left=0 , right=0; while(j>=1 && k<=size) { left=left+arr[j]; j--; ...
ALGO
0.999973
4.646599
c98ca163-a3f4-4dd3-9109-39d4d065b066
ishandutta2007/codeforces
noam527/normal/1098/A.cpp
#include <bits/stdc++.h> #define CHECK cout << "ok" << endl #define finish(x) return cout << x << endl, 0 typedef long long ll; typedef long double ldb; const int md = 1e9 + 7, inf = 1e9 + 7; using namespace std; void debug(string names) { cout << '\n'; } template<typename A1, typename... A2> void debug(string names,...
ALGO
0.999918
3.633656
7b7c7cdc-4ab7-47ab-9e41-095f69c9b2a2
zbyhoo/WallyBall
WallyBall/libs/Box2D/Collision/b2CollideCircle.cpp
#include <Box2D/Collision/b2Collision.h> #include <Box2D/Collision/Shapes/b2CircleShape.h> #include <Box2D/Collision/Shapes/b2PolygonShape.h> void b2CollideCircles( b2Manifold* manifold, const b2CircleShape* circleA, const b2Transform& xfA, const b2CircleShape* circleB, const b2Transform& xfB) { manifold->pointCou...
ALGO
0.999056
7.757187
142ceee6-7deb-4157-90f9-798e47e83c14
shamsulalam1114/Data-Structure
codes/postorder.cpp
#include <iostream> using namespace std; struct TreeNode { int data; TreeNode* left; TreeNode* right; TreeNode(int val) { data = val; left = nullptr; right = nullptr; } }; void postorder(TreeNode *ptr) { if (ptr != nullptr) { postorder(ptr->left); ...
ALGO
0.999509
5.549215
8f4228de-de28-4b92-bc30-71f3938a2625
ishandutta2007/codeforces
deemo/normal/626/E.cpp
//Quand le temps va et vient, On ne pense a rien malgre ses blessures.. #include<iostream> #include<algorithm> #include<vector> #include<utility> #include<iomanip> using namespace std; typedef long long ll; typedef long double ld; const ll MAXN = 2e5 + 10; ll n, vec[MAXN]; ll p[MAXN]; pair<pair<ld, ll>, ll> ans[MA...
ALGO
0.999991
3.214414
a862a005-10fd-49bf-bac4-fccc56501117
shishaochen/TensorFlow-0.8-Win
third_party/eigen-eigen-50812b426b7c/build_dir/doc/snippets/compile_MatrixBase_operatorNorm.cpp
#include <Eigen/Eigen> #include <iostream> #ifndef M_PI #define M_PI 3.1415926535897932384626433832795 #endif using namespace Eigen; using namespace std; int main(int, char**) { cout.precision(3); MatrixXd ones = MatrixXd::Ones(3,3); cout << "The operator norm of the 3x3 matrix of ones is " << ones.operator...
ALGO
0.981058
3.747183
7498552f-3f33-4682-a249-3a8ee8157090
yyywkhd/LeetCode-C-Java
leetcode/203. Remove Linked List Elements_vir_head.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* removeEleme...
ALGO
0.999946
5.5741
04c401b4-5469-4709-a361-43832bec1c77
AnhDungBG/book-web
frontend/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.998303
6.76775
989c54cb-0c4f-4fcd-be04-d27c0f2feb4a
wreckage0907/DAA
CODES/DP/houserobber.cpp
/* Question : You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security systems connected and it will automatically contact the police if two adjacent houses we...
ALGO
0.999938
6.020389
d5a26d11-e59e-48f5-943b-841d1113ddf6
youoj/Algorithm
Baekjoon/[10869]사칙연산.cpp
/* 10869번 사칙연산(Input/Output) * https://www.acmicpc.net/problem/10869 */ #include <iostream> using namespace std; int main() { int a = 0, b = 0; std::cin >> a >> b; std::cout << a + b << endl; std::cout << a - b << endl; std::cout << a*b << endl; std::cout << a / b << endl; std::cout << a%b << endl; return 0...
ALGO
0.997226
3.906759
3d468f0d-2c4d-4767-a73d-690bd412c9ab
MatheusXimeness/Graphs
Trabalho5/A.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <map> using namespace std; map<string, string> achaPosicaoAdj; string find(string pos) { if(achaPosicaoAdj[pos] == "") { return pos; } return achaPosicaoAdj[pos] = find(achaPosicaoAdj[pos]); } struct Caminho...
ALGO
0.999792
4.024649
3c221389-123f-4742-889c-cac501014928
xtreme-coding/hacktoberfest-2022
GeeksforGeeks/Trapping_Rain_water.cpp
/* * कर्मणये वाधिकारस्ते मां फलेषु कदाचन । * मां कर्मफलहेतुर्भू: मांते संङगोस्त्वकर्मणि ॥ */ #include <bits/stdc++.h> using namespace std; #define bug(...) __f (#__VA_ARGS__, __VA_ARGS__) template <typename Arg1> void __f(const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << endl; } template ...
ALGO
0.999941
6.071959
d054b735-9a01-402a-977a-1d7a53c3effd
lukasmonk/lucaschess
Engines/Windows/toga/src for DeepToga1.9.6changed/book.cpp
// book.cpp // includes #include <cerrno> #include <cstdio> #include <cstdlib> #include <cstring> #include "board.h" #include "book.h" #include "move.h" #include "move_gen.h" #include "util.h" // types struct book_entry_t { uint64 key; uint16 move; uint16 count; uint16 n; uint16 sum; }; // variabl...
ALGO
0.999784
7.389058
d5c04c23-13ba-4817-92e2-7014da6b0a6a
Fuatnow/haiyangjinglinglianliankan
cocos2d/cocos/3d/CCAABB.cpp
#include "3d/CCAABB.h" NS_CC_BEGIN AABB::AABB() { reset(); } AABB::AABB(const Vec3& min, const Vec3& max) { set(min, max); } AABB::AABB(const AABB& box) { set(box._min,box._max); } Vec3 AABB::getCenter() { Vec3 center; center.x = 0.5f*(_min.x+_max.x); center.y = 0.5f*(_min.y+_max.y); center.z = 0.5...
TOOL
0.928058
7.53548
5cc59fee-5184-4f51-aebf-0fe24a67669b
jungahshin/algorithm
c:c++/1987.cpp
//알파벳 #include <iostream> #include <vector> using namespace std; int r, c; string s; int alphabet[50] = {0, };//알파벳을 가지고 있는지 유무를 체크한다(1->소유, 0->미소유) char a[22][22] = {0, }; int dx[4] = {0, 0, -1, 1}; int dy[4] = {-1, 1, 0, 0}; int visited[22][22] = {0, }; int final = 0; void go(int x, int y, int alphabet[50], int num...
ALGO
0.999894
3.748103
1360fdda-9a1a-4442-80f4-f17ca5f6de1f
qkrtjdrbs/algorithm
20002.cpp
#include <bits/stdc++.h> using namespace std; int n, ans=-987654321, psum[301][301]; int main(){ cin.tie(NULL); cout.tie(NULL); ios::sync_with_stdio(0); cin >> n; for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ cin >> psum[i][j]; psum[i][j] += psum[i-1][j] + psum[i][j-1] - ps...
ALGO
0.99995
3.268713
6030a79d-3a8a-46ba-bdd6-b3c3a681ac0c
sidjha57/Coding-Data-Transfer
Competitive/C++/Practice/Untitled-1.cpp
#include <iostream> using namespace std; int main () { for (int i = 1; i <=5;i++) { for (int j = 6-i;j>=1;j--) { cout <<"*"; } cout <<"\n"; } }
ALGO
0.997245
3.250681
b4bfae24-f03a-4ad0-9065-379ba0d25513
Waseem-Gopang/MAD-Tasks_final
gestures/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.998287
6.76073
0479b792-777b-4428-bea4-a03654e6c714
brucey125/WoI-Core
dep/g3dlite/source/MeshAlgWeld.cpp
#include "G3D/MeshAlg.h" #include "G3D/Table.h" #include "G3D/Set.h" namespace G3D { namespace _internal { class Welder { private: // Intentionally illegal Welder& operator=(const Welder& w); public: /** Indices of newVertexArray elements in <B>or near</B> a grid cell. */ typedef Array<int> List; ...
ALGO
0.995079
6.904353
75b6979d-458a-40d1-98c8-8336a1e77dee
kmjp/procon
leetcode/251-300/285/2211.cpp
typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) me...
ALGO
0.999893
4.453063
4d8abed9-fa9c-403b-ac6d-a05836a2ccae
45151431/lab1
questionB.cpp
#include<cstdio> int main() { int n; while(scanf("%d", &n)==1) { printf("%d ", n); while(n!=1) { if(n%2==1) n=3*n+1; else n=n/2; printf("%d ", n); } printf("\n"); } return 0; }
ALGO
0.999982
3.915587
0f97f15d-ca1d-4a63-b746-e5fa3ac75189
ayushmishra90/My-Learning-Space
DSA/multistring.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution{ public: /*You are required to complete below function */ string multiplyStrings(string s1, string s2) { //Your code here int h,k; const char *x=s1.c_str(); const char *...
ALGO
0.999458
6.395456
abc6b59c-d4f8-4b3a-8259-f294b00d64bc
superxiaobai-1/LLM_Voice_Flow
tts/eigen-3.4.0/doc/examples/QuickStart_example2_fixed.cpp
#include <iostream> #include <Eigen/Dense> using namespace Eigen; using namespace std; int main() { Matrix3d m = Matrix3d::Random(); m = (m + Matrix3d::Constant(1.2)) * 50; cout << "m =" << endl << m << endl; Vector3d v(1,2,3); cout << "m * v =" << endl << m * v << endl; }
ALGO
0.996546
3.375595
171a4045-30d5-4cdf-b9e1-169e56511a28
redcpp/Competitive-Programming
codeforces/388A.cpp
#include <bits/stdc++.h> #define fi first #define se second #define sz(a) (int)(a).size() #define all(a) (a).begin(), (a).end() #define deb(x) cout << #x << " = " << x << endl #define forn(i, n) for (int i = 0; i < (int)(n); ++i) #define for1(i, n) for (int i = 1; i <= (int)(n); ++i) #define fore(i, l, r) for (int i = ...
ALGO
0.999925
3.82563
0929b22a-ff49-461d-af8b-b1af09b17477
prashobkt/blender
source/blender/freestyle/intern/view_map/SphericalGrid.cpp
/** \file * \ingroup freestyle * \brief Class to define a cell grid surrounding the projected image of a scene */ #include <algorithm> #include <stdexcept> #include "SphericalGrid.h" #include "BKE_global.h" using namespace std; namespace Freestyle { // Helper Classes // OccluderData /////////////// // Cell /...
ALGO
0.933351
7.508222
54b273b8-86aa-4c73-90af-3793a9b63354
aman1123721214/Dynamic-Programming
REV/random_14_GFG_Jumbled_Strings.cpp
#include<bits/stdc++.h> using namespace std; int mod = 1e9+7; class Solution{ private: int solve(int i, int j, string &s1, string &s2, vector<vector<int>> &dp){ if(j<0) return 1; if(i<0) return 0; if(dp[i][j] != -1) return dp[i][j]; if(s1[i] == s2[j]){ int take =...
ALGO
0.999944
4.590104
240c5d51-8403-4b2a-8d62-45c29420deed
EmbersArc/kRPC_cpp_Skycrane
pid.cpp
#ifndef _PID_SOURCE_ #define _PID_SOURCE_ #include "pid.h" using namespace std; class PIDImpl { public: PIDImpl( double max, double min, double Kp, double Ki, double Kd ); ~PIDImpl(); double calculate( double setpoint, double pv ); void setKp(double newKp); void setKi(doub...
ALGO
0.975691
6.17442
60a62b81-310e-465f-98a8-4e2f17147b50
lemonroy77/sort
quicksort.cpp
#include <stdio.h> #include <stdlib.h> #define MaxSize 100 int partition(int a[],int low,int high){ int pivot=a[low]; while(low<high){ while(low<high&&a[high]>pivot) high--; a[low]=a[high]; while(low<high&&a[low]<=pivot) low++; a[high]=a[low]; } a[low]=pivot; return l...
ALGO
0.999963
4.515812
33a3ffce-11b1-46f6-876d-a36b683b1042
chanmin4/BOJ-open-code-list
백준실/dp/boj1912.cpp
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<queue> #include<stack> #include<cmath> #include<stdio.h> #include<cstring> #include<cstdio> #include<cstring> #include<set> #include<map> #include<list> #include<unordered_set> #include<time.h> #define fup(i,a,b,c) for(int i=a;i<=b;i+=c) ...
ALGO
0.999967
3.85274
3803dd79-46ef-4a2e-84ff-63afb33837c1
Rajesh351/Leetcodeall
0979-di-string-match/0979-di-string-match.cpp
class Solution { public: vector<int> diStringMatch(string s) { int n=s.size(); int j=0; vector<int>v; int a=0; int d=0; int i=0; while(i<s.size()) { if(s[i]=='D') { v.push_back(n--); d++; ...
ALGO
0.99983
6.214748
40822cfd-fb45-4de0-ad40-c068e954cbd7
Diamondsn/algorithm-programming
20180908Leetcode刷题/643_子数组最大平均数1_简单/643_子数组最大平均数1_简单.cpp
#include<string> #include<vector> #include<iostream> #include<algorithm> #include<math.h> using namespace std; //给定 n 个整数,找出平均数最大且长度为 k 的连续子数组,并输出该最大平均数。 // //示例 1: //输入: [1,12,-5,-6,50,3], k = 4 //输出: 12.75 //解释: 最大平均数 (12-5-6+50)/4 = 51/4 = 12.75 // //注意: //1 <= k <= n <= 30,000。 //所给数据范围 [-10,000,10,000]。 double ...
ALGO
0.999008
4.617089
63b06c50-c53f-49e0-8517-f7cb1d00e115
jackiehluo/practice
codeforces/500s/557a-ilya-and-diplomas.cpp
#include <iostream> using namespace std; int main() { int n, min1, max1, min2, max2, min3, max3; cin >> n >> min1 >> max1 >> min2 >> max2 >> min3 >> max3; int a(min1), b(min2), c(min3), t(min1 + min2 + min3); while (t < n) { if (a < max1) a++; else if (b < max2) ...
ALGO
0.999479
3.203813
c4c76a53-a819-45f6-aa8c-cb40123358e3
FauzanIsmail86/UTS-DASAR-PEMOGRAMAN
Bab 7/3_pencarian nilai array.cpp
#include <iostream> using namespace std; int main() { int A[10]; int Nilai; cout << "Nama : Nur alamsyah" << endl; cout << "NIM : 10630020" << endl; cout << "NIai pada : " << endl << endl; for (int C=0; C<10; C++) { cout << "Indeks [" << C << "] = "; cin >> ...
ALGO
0.995115
3.880505
443f8943-6733-4cc3-a966-069070431822
ondryaso/leoAtFit2
0ZS/GAL/Projekt/OGDF/src/ogdf/basic/CombinatorialEmbedding.cpp
#include <ogdf/basic/CombinatorialEmbedding.h> #include <ogdf/basic/FaceArray.h> #include <ogdf/basic/Math.h> #ifdef OGDF_DEBUG # include <ogdf/basic/simple_graph_alg.h> #endif using std::mutex; using std::lock_guard; #define MIN_FACE_TABLE_SIZE (1 << 4) namespace ogdf { ConstCombinatorialEmbedding::ConstCombinator...
ALGO
0.99814
6.312516
ab992678-705d-41e0-9fa4-8efabd565fc4
AggieNateHarris/EfficientMeleePathCalculator
main.cpp
#include "ExpCalculations.h" #include "Equipment.h" #include "Graph.h" #include "BestPathCalc.h" #include <iostream> #include "GearUp.h" int main() { // create an equipment object Equipment player; // create a gear up object GearUp gearUp; // pick a starting location, ( att, str, def ), initialize...
ALGO
0.963102
3.861166
96040bbc-2f99-4d0e-a42e-2e20be48ed87
xinfeng1i/AlgorithmSolution
Pat/advanced/1082.cpp
#include <iostream> #include <string> #include <vector> using namespace std; string to_chinese(char ch) { switch(ch) { case '0': return "ling"; break; case '1': return "yi"; break; case '2': return "er"; break; case '3': return "san"; break; case '4': return "si"; break; cas...
ALGO
0.996524
3.339858
c3c392f2-4155-4070-ab19-e64ea33bb918
Nanduag0/Leetcode
nandincpp/Detect Capital.cpp
class Solution { public: bool detectCapitalUse(string word) { bool res=0; int cap=0; for(auto i:word) { if(i>='A' && i<='Z') { cap++; } } if(cap==0 || cap==word.size()) { res=1; } ...
ALGO
0.999796
6.141679
76b283c1-ae7b-415a-b7d4-64c805b2b1ae
hayan2/cpp
cpp/30446.cpp
#define ull unsigned long long #include <iostream> #include <string> #include <cmath> using namespace std; ull n; int posn, endn; long long ans = 0; bool fin = false; string res = ""; void dfs(int idx) { if (fin) return; if (idx == endn) { if (stoll(res) <= n) { ans++; } else { fin = true; } return...
ALGO
0.999746
4.819211
0ca5d619-c875-4b61-8664-7a95d4e78a44
manikanta2901/ubuntu
.history/SRM/elab/OOPS/CTS/SET1/reverseStack_20201029141700.cpp
#include<bits/stdc++.h> using namespace std; struct Node1 { int data; struct Node1 *next; }; void push(struct Node1 **top,int data){ struct Node1 *new_node = (struct Node1*)malloc(sizeof(struct Node1)); new_node->data = data; new_node->next = *top; *top = new_node; } void reverse(struct Node1...
ALGO
0.999983
3.96561
09eabf0e-da48-4bb2-87a3-14b3524683eb
m-shivam/CS558Asmt1
Asmt1/q2/custom_trim.cpp
#include <iostream> #include <string> #include <algorithm> using namespace std; void removeSpaces(string &str) { bool sf=false; int n = str.length(), i = 0, j = -1; while (++j < n && str[j] == ' '); while (j < n) { if (str[j] != ' ') { if ((str[j] == '.' || str[j] == ',' || str[j] == '?') && i...
ALGO
0.999543
3.530447
53edd1b3-a0e8-4aa1-b1df-5b61c517a4f1
Dup4/competitive-programming
codeforces/gym/102007/f.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 10; int n, m, p[N], c[N]; bool check(ll x) { ll res = 0; for (int i = 1; i <= n; ++i) { ll t = 1ll * p[i] * x - c[i]; res += max(0ll, t); if (res >= m) return true; } return res >=...
ALGO
0.999986
3.574702
4ea7ad32-bc0c-49bd-ac70-4ed376405f1e
bhawarth-garg/Leetcode-Solutions
0074-search-a-2d-matrix/0074-search-a-2d-matrix.cpp
class Solution { public: bool searchMatrix(vector<vector<int>>& matrix, int target) { int m= matrix.size(); int n= matrix[0].size(); int low=0, up= m*n-1, x,y,mid; while(low<=up) { mid= low+ (up-low)/2; x= mid/n;...
ALGO
0.999974
6.230412