uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
ef242be7-07eb-451e-a56f-83aefde5818f
JimWongM/OptFuzz
webkit_for_optfuzz/Source/WebCore/platform/audio/HRTFKernel.cpp
#include "config.h" #if ENABLE(WEB_AUDIO) #include "HRTFKernel.h" #include "AudioChannel.h" #include "Biquad.h" #include "FFTFrame.h" #include "FloatConversion.h" #include <wtf/MathExtras.h> namespace WebCore { // Takes the input AudioChannel as an input impulse response and calculates the average group delay. // ...
ALGO
0.874419
6.898682
fa938d9e-4001-4b8a-819e-2793c8e21092
MustangYM/ShelbyObfuscator
clang-tools-extra/test/clang-tidy/checkers/performance/inefficient-algorithm.cpp
// RUN: %check_clang_tidy %s performance-inefficient-algorithm %t namespace std { template <typename T> struct less { bool operator()(const T &lhs, const T &rhs) { return lhs < rhs; } }; template <typename T> struct greater { bool operator()(const T &lhs, const T &rhs) { return lhs > rhs; } }; struct iterator_ty...
TEST
0.887228
5.380919
427b8470-f9d3-402e-86a5-02dcc68150c6
MuhDev/FlutterNoteApp
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.998689
6.787361
def4ab9a-8c34-4e24-935c-95e6f12c149a
dsjinwongo/Algorithm
[BOJ] 12865번.cpp
/* Problem: 12865 Solver: Jinwon Reference: https://gumeum.tistory.com/25 */ #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int N, K, i, j, a, b, weight, value; vector<pair<int, int>> product; int dp...
ALGO
0.999947
4.25715
94eebbac-a9c9-4315-a9e3-70fe38d92def
fsjhhh/acm_title
cpp/match/2023_xunliansai/first/B.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <vector> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <queue> #include <deque> #include <iomanip> // std::fixed std::setprecision(x) 保留x位小数 #include <array> #include <bitse...
ALGO
0.999982
3.937076
ff8d0e3f-d65e-4f20-a33d-6b2ecedf084c
vshetty26/c-
Template/Q3.cpp
//Q3. Template with Multiple Parameters #include <iostream> using namespace std; template <typename T1, typename T2> class Pair { private: T1 first; T2 second; public: Pair(T1 f, T2 s) : first(f), second(s) {} void display() { cout << "First: " << first << ", Second: " << second << endl; }...
TOOL
0.854395
5.244463
cf3072a5-f2de-4549-b0a8-efa4e5d184fb
ishandutta2007/codeforces
joisino/normal/420/C.cpp
#include <bits/stdc++.h> #define FOR(i,a,b) for( ll i = (a); i < (ll)(b); i++ ) #define REP(i,n) FOR(i,0,n) #define YYS(x,arr) for(auto& x:arr) #define ALL(x) (x).begin(),(x).end() #define SORT(x) sort( (x).begin(),(x).end() ) #define REVERSE(x) reverse( (x).begin(),(x).end() ) #define UNIQUE(x) (x).erase( uniqu...
ALGO
0.999835
3.927991
f64377bc-5cb7-4311-abe6-80677b690a15
vnalla55/Mark-Up-Any-Fare
atseintl-master/ServiceFees/CombinationGenerator.cpp
#include "Common/FallbackUtil.h" #include "Common/Logger.h" #include "DataModel/FareMarket.h" #include "DataModel/TravelSeg.h" namespace tse { namespace { class MapFM { std::map<int, std::pair<std::vector<TravelSeg*>::const_iterator, std::vector<TravelSeg*>::const_iterator>*>& _mappe...
ALGO
0.98901
5.813213
c419af90-114f-4c5e-b54d-b001a8555dca
yebinhi/LeetcodePractice
find-minimum-in-rotated-sorted-array-ii/Wrong Answer/6-22-2016, 11:10:02 PM/Solution.cpp
// https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii class Solution { public: int findMin(vector<int>& nums) { int len=nums.size(); if(len<=0) return 0; int start =0, end=len-1; while(start<end && nums[start] >= nums[end]){ int m = (start+end)/2; ...
ALGO
0.999995
6.50036
a0092cb3-a4a0-41ca-b5e8-4473efc8d772
minmaxmean/ACMP
279/b.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef map <int, int> mii; typedef pair <int, int> pii; typedef pair <ll, ll> pll; int const maxn = int(1e5 + 12); int const maxb = int(2e6 + 12); int const inf = int(1e9 + 7); ll const linf = ll(1e18 + 12); double...
ALGO
0.999938
4.169304
dbd0dfb7-ee90-4b4b-9ff9-955cb80efff7
bozoslav/CSES-Solutions
Sorting and Searching/Collecting Numbers II.cpp
// ^^ // <{:3 #include <bits/stdc++.h> // #define int long long using namespace std; const int maxn = 2e5 + 5; int idx[maxn], v[maxn]; signed main() { cin.tie(NULL)->sync_with_stdio(false); int n, m; cin >> n >> m; for (int i = 1; i <= n; ++i) { cin >> v[i]; idx[v[i]] = i; } ...
ALGO
0.999914
4.436016
f905ada0-e0bc-486e-b324-e49cbdc4d987
Sumxylo/IPCC
Codeforces/1473/A.cpp
#include<bits/stdc++.h> #define elif else if using namespace std; int a[105]; int main(){ #ifdef FILEIO freopen("in","r",stdin); freopen("out","w",stdout); #endif int t;scanf("%d",&t); while(t--){ int n,d;scanf("%d%d",&n,&d); for(int i=0;i<n;++i) scanf("%d",&a[i]); int max=0,min1=101,min2=101; for(int ...
ALGO
0.999955
3.793611
35b37c27-1c37-45c5-a7d0-57c885fb000b
mussaiin/C
Camp/Musin Nurlybek almaty 4th day/CampDay2/Solutions/Islam-Muradov-Almaty/E.cpp
#include<iostream> #include<fstream> using namespace std; int main() { int n,a[2001],ans=0,c=0,r=0; cin>>n; ans=n; for(int i=1;i<=n;i++)cin>>a[i]; while(c<n) { if(a[1+r]==a[n-r])ans+=n-(r+1); r++; c++; } cout<<ans; return 0; }
ALGO
0.999961
3.121556
9297f017-2dae-4429-8bdf-6cf80daa4e93
Sdev0245/DesignPatterns
Behavioural/C++/Iterator/iterator.cpp
#include <iostream> #include <vector> #include <string> using namespace std; class Collection; class Iterator { vector <int> ::iterator it; Collection *m_collection; public: Iterator(vector <int> &vec, Collection *c): it(vec.begin()), m_collection(c) { } vector <int> ::iterator next() { ...
TOOL
0.928088
4.477954
e8dbaea0-9d62-46d4-b9af-7e446d1bb44a
hoosong0235/acmicpc
Codechef/Division 4/171/A.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; cout << 10000 * (n - k); }
ALGO
0.999782
3.351787
aea47bbc-419e-4902-8c50-3582d855641a
codewithaman07/codeforces
281A.cpp
#include<bits/stdc++.h> using namespace std; int main(){ #ifndef a freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif string s; cin>>s; s[0] = toupper(s[0]); cout<<s<<endl; return 0; }
ALGO
0.999521
3.648031
73a420c1-ce97-4a44-8fec-4fe965821200
iamslash/learntocode
algospot/MATCHORDER/a.cpp
int N; std::vector<int> RUS; std::vector<int> KOR; std::multiset<int> KORSET; // return max win cnt int solve() { int r = 0; // sort std::sort(RUS.begin(), RUS.end()); for (int i = 0; i < KOR.size(); ++i) KORSET.insert(KOR[i]); for (int i = RUS.size() - 1; i >= 0; --i) { if (*KORSET.rbegin() < RUS[i]...
ALGO
0.99993
3.979631
88794390-cec3-4f75-9734-a78091902edf
sir-rasel/Sadia_apu_code_library_DS_and_algorithm
FastMaxMin.cpp
inline int FastMax(int x, int y) { return (((y-x)>>(32-1))&(x^y))^y; } inline int FastMin(int x, int y) { return (((y-x)>>(32-1))&(x^y))^x; }
ALGO
0.992845
4.61563
bf6b7450-0b23-4bba-8d9d-557369162565
wzshare/Leetcode
medium/40_Combination_Sum_II.cpp
#include "../libstruct.h" using namespace std; /* * NO.40 * Given a collection of candidate numbers (candidates) and a target number (target), * find all unique combinations in candidates where the candidate numbers sums to target. * Each number in candidates may only be used once in the combination. */ class ...
ALGO
0.999821
6.2598
0d1daf9b-aab2-472e-8ab8-bd18e4bdf344
Sakshi2319/Data-Structures-and-Algorithms
GraphBFS.cpp
//using hash map and also map stores in increasing order! #include<iostream> #include<map> #include<list> #include<queue> using namespace std; template <typename T> class Graph{ map<T,list<T>> adjlist; public: Graph(){ } void addEdge(T u,T v ,bool bidir=true){ adjlist[u].push_back(v...
ALGO
0.999843
4.656761
5f6e4cb9-a507-48fb-ab4f-1f353b502bfe
PorridgeLanguage/C-plus-plus-Advanced-Programming
week01/Equation-Solution.cpp
# include <iostream> # include <iomanip> # include <cmath> double a, b; double func(double x); double solve_equation(double a, double b); int main () { std::cin >> a; std::cin >> b; double res = solve_equation(a, b); std::cout << std::fixed << std::setprecision(6) << res << std::endl; } double func...
ALGO
0.999866
3.976259
47f3b7db-3b85-4b5e-8132-0481673cb746
motidahari/BinaryTree-CPP_Ex5_Part-a
main.cpp
/** * BinaryTree - main * Create a BinaryTree * CPP course, Ariel University * Created by: Moti Dahari * https://github.com/motidahari */ #include "sources/BinaryTree.hpp" #include <fstream> #include <sstream> #include <iostream> #include <stdexcept> #include <vector> #include <stack> #include <queue> usi...
ALGO
0.911569
5.039517
6c54f413-49cf-4b9c-b283-08e2070f337f
kumasento/LeetcodeCollection
medium/CombinationSum.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; vector< vector<int> > cSum(vector<int> &cand, int target, int idx) { vector< vector<int> > res; if (target == 0) { res.push_back(vector<int>()); return res; } if (target < cand[idx]) return res...
ALGO
0.999897
4.498241
3f3bf1be-d8e0-45be-820d-2f3afcbc15c8
Lisprez/common_tools
c-cpp/concurrent/std_conditon_variable_demo.cpp
#include <thread> #include <condition_variable> #include <iostream> #include <deque> #include <mutex> std::deque<int> q; std::mutex mu; std::condition_variable cond; void producer() { int count = 10; while (count > 0) { std::unique_lock<std::mutex> uni_locker(mu); q.push_front(count); ...
TOOL
0.948446
4.406838
c340da88-4f6e-49f1-9e2c-c51cb745ab3a
Livinfly/AlgorithmPromble_Code
BeginToGreat/03_STL/02HDU4841.cpp
#include <iostream> #include <algorithm> #include <cstdio> #include <cmath> #include <cstring> #include <vector> using namespace std; int n, m, p; vector<int> man; void work() { int sum = n<<1; for(int i = 0; i < sum; i ++) man.push_back(i); for(int i = 0; i < n; i ++) { p = (p+m-1)%man.size(); man.erase(m...
ALGO
0.999386
3.069579
3c9e579c-0bef-4997-8412-8714cd37edd5
ptquanh/leetcode-cpp-practices
44. Wildcard Matching.cpp
//recursion //TLE //939 / 1809 test cases passed. class Solution { public: bool isMatch(string s, string p) { if(p.size() == 0) return s.size() == 0; bool first_match = (s.size() > 0) && (p[0] == s[0] || p[0] == '?' || p[0] == '*'); if(p[0] == '*'){ return first_match && isMatc...
ALGO
0.999991
6.040698
116a46b3-fd81-49ce-8024-51a0cd70f95b
jhymel/OpenMM_QM_MM
openmmapi/src/GayBerneForce.cpp
#include "openmm/Force.h" #include "openmm/OpenMMException.h" #include "openmm/GayBerneForce.h" #include "openmm/internal/AssertionUtilities.h" #include "openmm/internal/GayBerneForceImpl.h" #include <cmath> #include <map> #include <sstream> #include <utility> using namespace OpenMM; using std::map; using std::pair; u...
TOOL
0.994022
7.121339
681343bc-e720-4caa-be0b-9da3ff8454cc
sachin6377Tyagi/leetsubmission
2175-count-nodes-with-the-highest-score/count-nodes-with-the-highest-score.cpp
class Solution { public: int dfs(int node,vector<int>& par,unordered_map<int,vector<int>>&adj,vector<int>&cnt){ int ans=1; for(auto nbr:adj[node]){ cnt[nbr]=dfs(nbr,par,adj,cnt); ans+=cnt[nbr]; } return ans; } int countHighestScoreNodes(vector<int>& parents) { unordered...
ALGO
0.999928
5.201859
0711c418-145e-436a-a77e-6a01c19d9c72
ishandutta2007/codeforces
353cerega/normal/1662/E.cpp
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define X first #define Y second //const ll mod = 1000000007; const ll mod = 998244353; ll gcd(ll a, ll b) { a = abs(a); b = abs(b); if (a==0 or b==0) return a+b; return gcd(b,a...
ALGO
0.999867
4.757881
214d89c7-09be-4723-aa39-def4a7b3439e
SwarnalakshmiTS/cpp-lab-program
day 1 lcmand gcp.cpp
#include<conio.h> #include<stdlib.h> using namespace std; int gcd(int x, int y) { int r = 0, a, b; a = (x > y) ? x : y; b = (x < y) ? x : y; r = b; while (a % b != 0) { r = a % b; a = b; b = r; } return r; } int lcm(int x, int y) { int a; a = (x > y) ...
ALGO
0.865172
3.988341
5ca116da-e61f-40cb-9fb8-af7113c9b666
Gabrax/GABGRIND
Algorithms/Euler_totient.cpp
#include <iostream> // Function to compute Euler's totient function φ(k) for a given k int eulerTotient(int k) { int result = k; for (int i = 2; i * i <= k; i++) { if (k % i == 0) { while (k % i == 0) { k /= i; } result -= result / i; } } ...
ALGO
0.999781
6.190401
10d34961-5734-41fa-8e4b-f26fe16ecfc0
PrathamCodes1410/brb-cpp
Recursion/pow.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; int pow(int num, int power, int ans = 1){ cout << "This is the power : " << power << endl; if(power < 0){ power = 1 / power; } if(power == 0){ return 1; } if(power == 1 || power == -1){ return num; } ...
ALGO
0.999761
4.972504
8830ba1e-382f-4454-a38b-ae2fe59601e9
itsgajraj/dsa-sublimeditor
stringswithlexiographicalorder.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ map< string, int> thismap; thismap["hello"]=1; thismap["world"]=2; thismap["hello"]=3; map<string, int> ::iterator it; for(it=thismap.begin();it!=thismap.end();it++){ cout<<*(it).first<<" "<<*(it...
TOOL
0.977603
3.871189
12abe3ed-6461-4b84-be3e-75e8981b581a
ShockProof/Algorithm-Code-Library
Graph Algorithms/Bellman Ford.cpp
#include <bits/stdc++.h> using namespace std; inline int _Int() { int x; scanf("%d",&x); return x; } #define pb push_back const int inf = 1234567891; int Case; const int M = 1000 + 3; /// MAX NODE int n; vector<int> G[M]; int dist[M]; int updated[M]; void bellman_ford(int u) { queue<int> q; dist[u] = 0; q...
ALGO
0.996214
3.487619
b45172d8-692c-4b21-9bb1-d4feeb48a491
B0bby19/DSA-with-C-program
queue1.cpp
#include<stdio.h> #include<conio.h> #define max 20 int q[max]; int front=-1,rear=-1; void ins(int); int del(); void display(); int isempty(); int isfull(); int main() { int ch,item,x; char a; printf("\n\t Queue Implementation"); printf("\n\t --------------------"); printf("\n\t1.Insert"); printf("\n\t2.Delete"); printf...
ALGO
0.998688
4.353971
85f8164d-8c7b-4940-8c00-96255ce5ede1
royyandzakiy/dsa
linkedlist/linkedlist.cpp
#include <iostream> #include <memory> using namespace std; struct Node { int data; shared_ptr<Node> next; shared_ptr<Node> prev; Node(int value) : data(value), next(nullptr), prev(nullptr) {} }; class DoubleyLinkedList { public: DoubleyLinkedList(int value) { head = make_shared<Node>(valu...
ALGO
0.981075
5.923992
ecc1aa0b-d04f-446f-934d-56562e3a93ad
gabrieldemoraes/MasteringTheCodeInterview
exercise/merge_multi_level_double_linked_list.cpp
//g++ -O3 merge_multi_level_double_linked_list.cpp -o merge_multi_level_double_linked_list.exe #include "merge_multi_level_double_linked_list.hpp" #include <iostream> int main() { ListNode a; ListNode b; ListNode c; ListNode d; ListNode e; ListNode f; ListNode g; ListNode h; List...
ALGO
0.999345
4.29075
316ae4e7-5433-4a05-b5f0-6fa9df38afa5
PravinMandal/Supreme_3.0_DSA
03. Array Time and Space Complexity/06. Assignments/04_Missing_element_with_duplicate.cpp
//missing element of an array with duplicate #include<iostream> #include<vector> using namespace std; void findMissingElement(vector<int> arr) { //visited method int n = arr.size(); for(int i=0; i<n; i++){ int index = abs(arr[i]); if(arr[index-1] > 0) { //index -1 isiliye kr rh...
ALGO
0.999801
4.508647
1418ea50-f53d-4562-8832-ff92e8c12d08
tomvik/Tec_Multiprocesadores
31-08/main.cpp
#include <Windows.h> #include <stdint.h> #include <stdio.h> #include <time.h> #define kNumThreads 16 double acum = 0; clock_t start, end; struct piParams { int id = 0; double acum = 0; }; DWORD WINAPI piFunc(LPVOID pArg) { piParams *params = reinterpret_cast<piParams *>(pArg); double x; int64_t...
ALGO
0.999651
3.946764
a8e93154-eab7-4938-a3de-4ed45c330972
twareproj/tware
experiments/breakdown/h2/tpch_q4.cpp
#include "../tpch_q4_util.h" #define KEYS (TILE * 128) int main(int argc, char *argv[]) { struct timeval start, stop; string file1 = argv[1]; string file2 = argv[2]; int *o_orderkey = new int[Q4_ORDERS]; long *o_orderdate = new long[Q4_ORDERS]; char *o_orderpriority = new char[Q4_ORDERS]; ...
TEST
0.989996
4.36324
4150756c-23f5-48b6-a550-dd8b1ee7850f
singlarohan/leetcode_sol
0028-find-the-index-of-the-first-occurrence-in-a-string/2022-08-16 15.07.32 - Wrong Answer - runtime NA - memory NA.cpp
class Solution { public: int strStr(string haystack, string needle) { int count{0}; for(int i = 0; i < haystack.size(); i++){ if(haystack[i] == needle[count]) count++; else count = 0; if(count == needle.size()) retur...
ALGO
0.999918
5.932361
788c1aa0-3144-4a4d-8793-d95e00bc4d0e
marwanmusa/LeetCode-Challenges
Array-String/CPP/two_sum.cpp
#include <vector> #include <unordered_map> class Solution { public: // Brute Force vector<int> twoSum(vector<int>& nums, int target) { int n = nums.size(); for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { if (nums[i] + nums[j] == target) { ...
ALGO
0.999883
6.349556
caf37e5b-5da8-4421-962f-77f31395e903
Pierre-Terdiman/PEEL_PhysX_Edition
PEEL_Externals/5_1_0/source/geomutils/src/intersection/GuIntersectionBoxBox.cpp
#include "GuIntersectionBoxBox.h" using namespace physx; bool Gu::intersectOBBOBB(const PxVec3& e0, const PxVec3& c0, const PxMat33& r0, const PxVec3& e1, const PxVec3& c1, const PxMat33& r1, bool full_test) { // Translation, in parent frame const PxVec3 v = c1 - c0; // Translation, in A's frame const PxVec3 T(v....
TEST
0.972622
5.205412
3c8c9c85-7632-4d04-9cbd-80b86a748a72
kriti-raj/CodeChef-Contests-CPP
CODELOOP/Bhagalpur_Mess_Service.cpp
#include <iostream> #include <vector> #include <queue> #include <limits> using namespace std; const long long INF = numeric_limits<long long>::max(); struct Edge { int to, capacity, cost; }; int main() { int n, m, p; cin >> n >> m >> p; vector<vector<Edge>> graph(n + 1); for (int i = 0; i < m;...
ALGO
0.999938
4.317082
e937caa2-4377-4fa6-b182-3427f54d10ac
kifah-s/Problem_Solving
Programming_Advices_Academy/Cou_04_Alg_and_Pro_Sol_Lev_1_Sol/Problem_31_Power_of_2_3_4/Solution_Problem_31_Power_of_2_3_4_V1.cpp
#include <iostream> #include <cmath> using namespace std; //* Functions void WelcomeMessageFun() { cout << "\n\nWelcome to the Problem Solving ..\n" << endl; } int ReadNumberFun() { int num = 0; cout << "Please, enter a number: "; cin >> num; return num; } void PrintResultFun(int num)...
ALGO
0.960362
4.273368
78ea7c2d-b8b8-4007-b0eb-89cd257b9ff9
DavTurns/Object-Oriented-Programming-University
lab4_fruitapp/Controller/FruitController.cpp
// // Created by Latitude on 24.04.2023. // #include <memory> #include <vector> #include <algorithm> #include "FruitController.h" #include "../Repository/FruitRepo.h" using namespace std; namespace controller { FruitController::FruitController(repository::FruitRepo &repo) : repo(repo) {} void FruitControl...
TOOL
0.86684
4.351863
238fb004-5463-4914-b817-4b95b35f5b3f
Pulakesh5/CP
CSES/Sorting and Searching/Sum Of Four Values.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, target; cin >> n >> target; if (n < 4) { cout << "IMPOSSIBLE" << endl; return 0; } vector<pair<int, int>> arr(n); for (int i = 0; i < n; i++) { cin >> arr[i].first; arr[i].second = i; }...
ALGO
0.999986
4.209154
9f3229f1-a7ca-43f0-a910-64de00358b98
nchong/ic_liggghts
src/fix_nvt_sphere.cpp
#include "string.h" #include "stdlib.h" #include "math.h" #include "fix_nvt_sphere.h" #include "atom.h" #include "atom_vec.h" #include "force.h" #include "comm.h" #include "group.h" #include "update.h" #include "modify.h" #include "compute.h" #include "error.h" using namespace LAMMPS_NS; #define INERTIA 0.4 ...
ALGO
0.998349
6.446904
be7c1a10-0b40-439f-bd3d-651e3258e034
djs-it/LinkUp
frameworks/cocos2d-x/cocos/base/ccUtils.cpp
#include "base/ccUtils.h" #include <stdlib.h> #include "base/CCDirector.h" #include "base/CCAsyncTaskPool.h" #include "base/CCEventDispatcher.h" #include "base/base64.h" #include "renderer/CCCustomCommand.h" #include "renderer/CCRenderer.h" #include "platform/CCImage.h" #include "platform/CCFileUtils.h" #include "2d/...
TOOL
0.913421
6.048693
a5c54cf5-50a9-47ce-8a68-6e8746b6605a
ishandutta2007/codeforces
awakeanay/normal/1494/C.cpp
#include <iostream> #include <vector> #include <algorithm> #define int long long int calc(std::vector<int> a, std::vector<int> b) { if(a.size() == 0 || b.size() == 0) return 0; std::sort(a.begin(), a.end()); std::sort(b.begin(), b.end()); int n = a.size(); int m = b.size(); int val[n]; for(int i =...
ALGO
0.999945
4.653814
1ca6d054-6235-4cb2-a94a-bfc765a4f7c9
Bhanupal22600/CANDIDATE-MASTER
BubbleSort/practice.cpp
//sort a string in decreasing order of values associated after removal of values smaller than X. #include<iostream> #include<algorithm> using namespace std; int main(){ string s="AZYZXBDXJK"; string str = ""; for(int i=0;i<s.size();i++){ if(s[i]>='X'){ str.push_back(s[i]); } ...
ALGO
0.999682
4.098607
549954c4-e284-48d5-a58c-6982b7cfa925
akotadi/Competitive-Programming
Contest/ACM/Jakarta/G/G.cpp
#include <bits/stdc++.h> #define forn(i,a,b) for(int i = a; i < b; i++) #define rep(i,n) forn(i,0,n) using namespace std; __attribute__((constructor)) void _() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr); std::cerr.tie(nullptr); } const int N = 1e5+5; int n; int t[2 * N...
ALGO
0.99998
3.768288
90c9d5e2-e83e-4ce3-b80c-e12c50d70349
sumi750/C-_Programming
tree/BTS.cpp
#include<iostream> #include<queue> using namespace std; class node{ public: int data; node* left; node* right; node(int d ){ this->data = d; this->left = NULL; this->right = NULL; } }; // node* insertIntoBST(node* root, int d){ // base case if(root == NULL)...
ALGO
0.999932
5.25193
a9a9aef5-8557-4885-9273-fd2f23ebab7e
khanumar03/cp
A/A_Between_the_Offices.cpp
#include <iostream> #include <string> #include <unordered_map> #include <unordered_set> #include <set> #include <vector> #include <algorithm> #include <queue> using namespace std; typedef long long ll; template <typename T> using vec = vector<T>; int main() { int n; cin >> n; string s; cin >> s; ...
ALGO
0.999897
3.75971
a7e9f756-b86a-4573-a12e-381a603cfb2f
Coach-Academy/Fall-1-2024
Level 1/CPU - Regular - L1 - C107/Lecture/Week 04/PrintSub-Array.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; int arr[n]; for (int i = 0; i < n; i++) { cin >> arr[i]; } int l, r; cin >> l >> r; for (int i = l - 1; i <= r - 1; i++) { cout << arr[i] << " "; } }
ALGO
0.999813
3.352247
f6db26e9-ef78-4482-b21f-9281e47862e8
GeethmaMunasinghe/Mobile_Application_Development
Week 6/richtextwidget/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.998478
6.776823
64034c3b-98dc-4fff-95bf-618d8a918195
dikshamehta/Leetcode
0875-koko-eating-bananas/0875-koko-eating-bananas.cpp
class Solution { public: int minEatingSpeed(vector<int>& piles, int h) { int l = 1; int r = *max_element(piles.begin(), piles.end()); int res = r; while(l<=r){ int m = (l+r)/2; long totaltime = 0; for(int p : piles){ ...
ALGO
0.99994
6.219459
d5aa815c-7691-4343-8f88-4f3864b3f35b
roniamo/AnimationProject
igl/sum.cpp
template <typename T> IGL_INLINE void igl::sum( const Eigen::SparseMatrix<T>& X, const int dim, Eigen::SparseVector<T>& S) { assert((dim == 1 || dim == 2) && "dim must be 2 or 1"); // Get size of input int m = X.rows(); int n = X.cols(); // resize output if(dim==1) { S = Eigen::SparseVector<T>(...
ALGO
0.99853
5.695529
84d9934a-a804-4820-a460-f618a509f71c
Hytidel/SZU_Math_and_Computer
计算机课/数据结构/DSOJ答案/排序/DS内排—堆排序.cpp
#include<bits/stdc++.h> using namespace std; #define endl '\n' const int MAXN = 1e5 + 5; namespace HeapSort { int n; int a[MAXN]; void sift(int u, int length) { // 筛选 int ls = u * 2 + 1, rs = u * 2 + 2; if (ls >= length) return; // 不存在左儿子 if (rs < length) { // 存在右儿子 ...
ALGO
0.999935
4.213311
23a3d369-9974-4d99-9bf6-bd098c61181d
om-ashish-soni/Competitive-Programming
algo/algo-implementation/BipartiteGraph.cpp
// { Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: bool checkBipartite(vector<int>adj[],int color[],bool visited[],int start){ vector<int>& childs=adj[start]; for(auto child:childs){ if(color[child]==color[start]) { ...
ALGO
0.999959
6.102399
8c245d9f-599d-4774-a8a1-7e76393c1553
kickrisk/WorkSpace
Algo/c++/Main_P5_9376.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <deque> #include <tuple> using namespace std; int dx[] = {0, 0, 1, -1}; int dy[] = {1, -1, 0, 0}; vector<vector<int>> bfs(vector<string> &a, int x, int y) { int n = a.size(); int m = a[0].size(); vector<vector<int>> d(n, v...
ALGO
0.999625
3.811884
a25acf7b-8dd4-4c3d-8a92-b7e999379672
Gapex/CppPrimer
Chapter5/5.10.cpp
#include <iostream> using std::cin; using std::cout; using std::endl; int main(){ int aCnt, eCnt, iCnt, oCnt, uCnt; aCnt = eCnt = iCnt = oCnt = uCnt = 0; char ch; while(cin >> ch){ switch (ch) { case 'A': case 'a': ++aCnt; break; case...
ALGO
0.976617
4.115937
6a53d445-b1f4-4ea8-812d-b89d1a2e490a
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_3996_8.cpp
#include <bits/stdc++.h> using namespace std; int n, a[100005], m; long long tree[4 * 100005], lazy[4 * 100005]; void propagate(int node, int lo, int hi) { tree[node] = max(tree[node], lazy[node]); if (lo != hi) { lazy[(node << 1)] = max(lazy[(node << 1)], lazy[node]); lazy[((node << 1) + 1)] = max(lazy[((n...
ALGO
0.999949
4.074393
b98053c4-9919-4e87-a808-778b91472858
tanishkamakode/DSAL
PR_08.cpp
#include<iostream> #include<limits> #include<queue> using namespace std; class Node{ public: int data; Node* left; Node* right; int i; int j; Node(int d, int i, int j){ data = d; left = nullptr; right = nullptr; this->i = i; this->j = j; } }; cla...
ALGO
0.999855
4.16965
c3033de6-5a6f-4a7a-84bf-80b18c1d37a9
samyak2405/MY-LeetCoding
Count the number of possible triangles - GFG/count-the-number-of-possible-triangles.cpp
// { Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: //Function to count the number of possible triangles. int findNumberOfTriangles(int arr[], int n) { int cnt = 0; sort(arr,arr+n); for(int i = n-1;i>=2;i--) ...
ALGO
0.999958
6.056293
6bfd7c8c-e460-43fb-8825-28714f607b4e
JangIn-40/Programmers
LV1/SmallPartialString/SmallPartialString.cpp
#include <string> #include <vector> #include <iostream> using namespace std; // 자료형의 크기에 대해서 잘 생각하자 int solution(string t, string p) { int answer = 0; int N = p.size(); unsigned long pNum = stoul(p); for (int i = 0; i < t.size() - (N - 1); ++i) { unsigned long num = stoul(string(t.begin() + i...
ALGO
0.999774
4.674801
9fe6495f-7cf0-451c-88ef-aa15bd564e83
aryashsaxena/leetcode_problems
Delete a Node in Single Linked List - GFG/delete-a-node-in-single-linked-list.cpp
//{ Driver Code Starts // C program to find n'th Node in linked list #include <stdio.h> #include <stdlib.h> #include<iostream> using namespace std; /* Link list Node */ struct Node { int data; struct Node* next; Node(int x){ data = x; next = NULL; } }; void append(struct Node** he...
ALGO
0.999952
6.124883
60e7e789-4010-455f-b152-3e62680f43a3
LuvThakur/DSa_Problem
array_reverse.cpp
#include <iostream> using namespace std; int main() { int size = 4; int arr[size] = {1, 2, 3, 4}; string name = "hello"; for (int i = size - 1; i >= 0; i--) { cout << " " << arr[i]; } cout << " \t"; int j = name.length(); while (j) { cout << name[j]; ...
ALGO
0.979303
3.184124
3217db69-c9bf-41eb-8bc6-79b98fdae9df
lrquad/TongueSimulation
TongueQT/TongueQT/src/bullet3-2.83.7/src/BulletCollision/Gimpact/btGImpactBvh.cpp
/*! \file gim_box_set.h \author Francisco Leon Najera */ #include "btGImpactBvh.h" #include "LinearMath/btQuickprof.h" #ifdef TRI_COLLISION_PROFILING btClock g_tree_clock; float g_accum_tree_collision_time = 0; int g_count_traversing = 0; void bt_begin_gim02_tree_time() { g_tree_clock.reset(); } void bt_end_gim0...
ALGO
0.99946
7.141726
43e214d1-1b10-41da-81a4-c7d2fb43352f
RKMVCC-BSc-Comp-Sci-2020-21/Programming-C-Cpp-Sem1
March/commelements_in3array_shaon.cpp
// C++ program to print common elements in three arrays #include <bits/stdc++.h> using namespace std; // This function prints common elements in ar1 void findCommon(int ar1[], int ar2[], int ar3[], int n1, int n2, int n3) { // Initialize starting indexes for ar1[], ar2[] and ar3[] int i = 0, j = 0, k = 0; // Itera...
ALGO
0.99696
5.109506
5017641b-88cf-4902-96c7-22e6f5c6fb71
parthsaxenacode/myCppwithOPPScode
checking palindrome while reversing a string.cpp
#include<iostream> using namespace std; int main() { string str="MADAm"; string rev=""; int len=(int)str.length(); rev.resize(len); for(int i=0,j=len-1;i<len;i++,j--) { rev[i]=str[j]; } rev[len]='\0'; if(str.compare(rev)==0) cout<<"Palindrome"<<endl; else if (str.compare(rev)==32 || str.com...
ALGO
0.999839
3.559208
a50f33f6-1d5f-4ffc-98f7-c9dbe4868b5a
TihranPetrosian/O_P
lab3/lab_3.cpp
#include <iostream> #include <math.h> int main() { //Task 1 double x, y; // координати точки while (1) { printf("\n \033[1;32mВведіть координату x >"); scanf("%lf", &x); printf("\033[1;32m Введіть координату y >"); scanf("%lf", &y); printf("x=%6.3lf; y=%6.3lf\...
ALGO
0.958412
3.851966
cd5512dc-d3b4-4889-99ea-b787cad63ca2
VietHoang-206/Baitapnmlt
Baitapluyentaptuduy-113/main.cpp
#include <iostream> #define MAX 100 using namespace std; void NhapMang(float arr[], int &n) { cin >> n; for(int i = 0; i < n; i++) { cout << "a[" << i << "] = "; cin >> arr[i]; } cout << endl; } void XuatMang(float arr[], int n) { for(int i = 0; i < n; i++) { cout << ...
ALGO
0.997881
3.589122
30bd27ad-df22-40bc-9c16-ddeef9fc0aa9
matumoto1234/cp-crawler
AtCoder/abc125/abc125_c/27579732.cpp
// detail: https://atcoder.jp/contests/abc125/submissions/27579732 #include <bits/stdc++.h> using namespace std; #include <atcoder/segtree.hpp> using namespace atcoder; // {{{ Templates // clang-format off // Macros #define over_load_(_1,_2,_3,_4,NAME,...) NAME #define rep(...) over_load_(__VA_ARGS__, rep4, rep3, r...
ALGO
0.999986
5.206789
1a8cf851-be41-43be-92ea-831dc3b74005
ptquanh/leetcode-cpp-practices
1338. Reduce Array Size to The Half.cpp
//Runtime: 284 ms, faster than 47.30% of C++ online submissions for Reduce Array Size to The Half. //Memory Usage: 42 MB, less than 100.00% of C++ online submissions for Reduce Array Size to The Half. struct RetrieveValue { template <typename T> typename T::second_type operator()(T keyValuePair) const {...
ALGO
0.999974
5.928015
35b02bdf-42b8-4920-926e-cf16e9da4868
ash1247/CodeBlocksLinux
C__ Primer/ch10/ex10.27.cpp
#include <iostream> #include <vector> #include <list> #include <algorithm> #include <iterator> int main() { std::vector<int> vi; for(int i; std::cin >> i; vi.push_back(i)) { } std::list<int> li; std::sort(vi.begin(), vi.end() ); std::unique_copy(vi.begin(), vi.end(), std::back_inserter(li)); st...
ALGO
0.999796
4.593075
1cc4c9c0-eae0-4a3c-8b9f-fbbaf598e41d
UBERMALLOW/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
bdb94469-3a55-4d8a-8bb1-b81600c2f971
DustinBaek/Projects
Resources/opencv_contrib-master/opencv_contrib-master/modules/ximgproc/samples/fast_hough_transform.cpp
#include <opencv2/imgproc.hpp> #include <opencv2/highgui.hpp> #include <opencv2/core/utility.hpp> #include <opencv2/ximgproc.hpp> #include <iostream> #include <iomanip> #include <cstdio> #include <ctime> #include <vector> using namespace cv; using namespace cv::ximgproc; using namespace std; static void help() { ...
TOOL
0.99271
5.883912
41846f80-3e00-4bfa-b687-f19b87ebca56
sulemanrai/GeeksforGeeks
Data Structures/arrays/processarray.cpp
#include<iostream> using namespace std; void printArray(int arr[], int n) { for (int i = 0; i < n; i++) { std::cout << arr[i] << " "; } cout << endl; } void processarray(int arr[], int n) { // Auxiliary array to hold modified array int temp[1000]; int left = 0; int right = n - 1; int i = 0; while(left <= ...
ALGO
0.999174
4.767637
21a81e9c-dfa4-477b-8053-92dcf22bc142
Mohamedkelany123/Alghorithm_excercises
P11.cpp
//PROBLEM 11 SOLVED USING COIN ROW IN DYNAMIC PROGRAMMING #include<iostream> #include<array> using namespace std; //TEMPLATE TO ALLOW USER TO INPUT ONLY THE ARRAY WITHOUT ITS SIZE template <unsigned int N> int MaxSumNonAdjacent(int const (&Array)[N]) { //VARIABLE TO STORE ARRAY SIZE int ArraySize=end(Array)-be...
ALGO
0.999529
5.244195
8974ed6d-bbc7-4b70-a3b6-90c8eba6f2c3
DhruvRPurohit/SE_Assignment_M3
Template/1_swapping.cpp
/* 1. Write a program of to swap the two values using template */ #include<iostream> using namespace std; template <class t> void Swapping(t x,t y) { x=x+y; y=x-y; // swapping logic x=x-y; cout<<"\n\n\tA : "<<x; cout<<"\n\n\tB : "<<y; } template <class T> void display(T x, T y) { cout<<"\n\n\tA : "<...
ALGO
0.998897
5.124331
7f5c3b5a-6c99-4767-81b0-3876e6e1dc0d
sarvex/leetcode-prolog
solution/0100-0199/0171.Excel Sheet Column Number/Solution.cpp
class Solution { public: int titleToNumber(string columnTitle) { int res = 0; for (char c : columnTitle) { res = res * 26 + (c - 'A' + 1); } return res; } };
ALGO
0.999835
6.509163
b21ebb47-70f6-444d-8511-3c4bccc7702a
Sagarbha1991/com.example.trilinos
packages/ml/examples/Advanced/ml_user_aggr.cpp
/* ******************************************************************** */ /* person and disclaimer. */ /* ******************************************************************** */ // \author Marzio Sala, SNL 9214 // \data Last modified on 05-Dec-04 #include "ml_include.h"...
ALGO
0.999883
3.998095
a1c5e8cd-ddb5-4fdf-bd46-39132eda196b
old-yan/leetcode-solutions
leetcode_solutions/leetcode_300/274/274.cpp
#include "utils.h" class Solution { public: int hIndex(vector<int>& citations) { priority_queue<int,deque<int>,greater<int>>Q; for(int a:citations)Q.push(a); int ans=0;; REP(i,citations.size()+1){ while(Q.size()&&Q.top()<i)Q.pop(); if(Q.size()==i)chmax(ans,in...
ALGO
0.999842
5.840832
2c16c79f-5ecd-438f-a32b-b1bbf87b56b2
Sharma-Hrishabh/DSA-SDESheet
striver/binarysearch/nthrootofm.cpp
#include<iostream> using namespace std; double multiply(double number, int n) { double ans = 1.0; for(int i = 1;i<=n;i++) { ans = ans * number; } return ans; } // 1*1*1............... M*M*M search space // if mid^3 > m then search in left half because mid^3 is too big // if mid^3 < m then se...
ALGO
0.999983
4.16999
8104eab3-71b7-4d68-b504-7e1444b9bbe1
Vinaykumaryadav9199/gfg
Power of Pow | Odd Numbers - GFG/power-of-pow-odd-numbers.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: long long int sum_of_square_oddNumbers(long long int n) { // Code here. long long int sum =0; long long int k=1; { for (int i=1;i<=n;i++) { ...
ALGO
0.998735
5.902873
9810b177-1ba0-4f57-a367-f1060ee08780
HarshGalav/Leetcode-Best-Practice
0094-binary-tree-inorder-traversal/0094-binary-tree-inorder-traversal.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.999976
6.519739
4534722c-4b8d-4ff7-95f7-deecf1958b91
JianpengLi1993/leetcode_c-
889. 根据前序和后序遍历构造二叉树.cpp
/********************************************************/ 返回与给定的前序和后序遍历匹配的任何二叉树。 pre 和 post 遍历中的值是不同的正整数。 示例: 输入:pre = [1,2,4,5,3,6,7], post = [4,5,2,6,7,3,1] 输出:[1,2,3,4,5,6,7] 提示: 1 <= pre.length == post.length <= 30 pre[] 和 post[] 都是 1, 2, ..., pre.length 的排列 每个输入保证至少有一个答案。如果有多个答案,可以返回其中一个。 /***************...
ALGO
0.999877
5.482359
84756a98-dc35-4756-b180-a944d9fd9626
anuragsinghrajput123456789/DSA-Problems-Cpp
Arrays/findingElementUsingPivot.cpp
#include<bits/stdc++.h> using namespace std; int binarySearch(int arr[],int n,int s,int e,int key){ int mid = s + (e - s)/2; while(s < e){ if(arr[mid] == key){ return mid; } else if(arr[mid] > key){ //left me jaa e = mid-1; } else{ s = mid+1; } mid = s + (...
ALGO
0.999949
5.142735
46e2b8c3-e420-4a3e-af02-4e88e3622447
mdshadesh/Toph-Problem-solving-
BRACU জয়যাত্রা’50 Techfest Inter University Individual Programming Contest/Caching Combinatorics.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #ifdef APURBA #include "DEBUG_TEMPLATE.h" #else #define HERE #define debug(args...) #endif const int N = 5000 +5; const int mod = 998244353; typedef pair<int,int> pii; int stir[N][N]; int add(int x, int y) { return (x+y>=m...
ALGO
0.99999
4.497268
0f390749-000b-42c4-bf95-4584c47e8f50
microsoft/openjdk-jdk20u
src/hotspot/share/opto/c2compiler.cpp
#include "precompiled.hpp" #include "classfile/vmClasses.hpp" #include "compiler/compilerDefinitions.inline.hpp" #include "runtime/handles.inline.hpp" #include "jfr/support/jfrIntrinsics.hpp" #include "opto/c2compiler.hpp" #include "opto/compile.hpp" #include "opto/optoreg.hpp" #include "opto/output.hpp" #include "opto...
TOOL
0.910526
3.030957
543e435e-549c-4a18-a49d-58eb3774ad46
bzcryptocoinalliance/BCCA
src/sync.cpp
#include "sync.h" #include "util.h" #include <boost/foreach.hpp> #ifdef DEBUG_LOCKCONTENTION void PrintLockContention(const char* pszName, const char* pszFile, int nLine) { LogPrintf("LOCKCONTENTION: %s\n", pszName); LogPrintf("Locker: %s:%d\n", pszFile, nLine); } #endif /* DEBUG_LOCKCONTENTION */ #ifdef DE...
TOOL
0.968603
5.912034
ef923f0e-1e03-447b-bc74-c94374edb1c8
nojima/atcoder
ABC162/A.cpp
#include <iostream> #include <cstdio> #include <cstring> using namespace std; int main() { int N; cin >> N; char s[100]; sprintf(s, "%d", N); int len = strlen(s); bool ok = false; for (int i = 0; i < len; ++i) { if (s[i] == '7') { ok = true; } } if (ok) { ...
ALGO
0.996749
3.49395
00ab1950-f24d-4c2c-ae3b-08ce795ea008
hotuanan/codeforces
Meximization/main.cpp
#include <bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; unordered_map<int, int> s; vector<int> v; for(int i = 0; i < n; i++) { int tmp; cin >> tmp; if(s.find(tmp) == s.end()) { v.push_back(tmp); s[tmp] = 0; } els...
ALGO
0.999942
4.790727
80d55f8c-7f7d-4796-835d-13835a3f7c6b
Stradex/q4-librecoop
idlib/hashing/MD5.cpp
#include "../precompiled.h" #pragma hdrstop /* MD5 Message Digest Algorithm. (RFC1321) */ /* MD5 context. */ typedef struct { unsigned int state[4]; unsigned int bits[2]; unsigned char in[64]; } MD5_CTX; /* The four core functions - F1 is optimized somewhat */ /* #define F1(x, y, z) (x & y | ~x & z) */ #...
ALGO
0.998616
6.283553
e7184a57-e06b-48b3-8385-26e0950b4905
RydKrm/Competitive_Program
Codeforces/1006B.cpp
//#include <bits/stdc++.h> #include<iostream> #include<stdio.h> #include<stdlib.h> #include<math.h> #include<cstring> #include<vector> #include<string> #include<stack> #include<queue> #include<map> #include<unordered_map> #include<set> #include<unordered_set> #include<iterator> #include<algorithm> #include<bitset> #de...
ALGO
0.999937
3.235395
eaf29003-420f-49d7-9bac-190a62dd3246
Sid-0602/DataStrucuresAndAlgorithms---Beginner-to-Advaced
Basics of C++/Sorted_Rotated_Array.cpp
#include <iostream> #include<vector> #include <bits/stdc++.h> using namespace std; bool flag=true; bool check(vector<int>& nums) { int rotate_count = 0; int min = INT_MAX; int size = nums.size(); int index_of_min = 0; for(int i=0; i<size;i++){ if(nums[i]<min){ ...
ALGO
0.999946
5.182172
cdbb043a-63b3-47e9-a3b5-0a9697c0f4ca
BananaDroid-Lab/frameworks_av
services/mediametrics/StringUtils.cpp
//#define LOG_NDEBUG 0 #define LOG_TAG "MediaMetricsService::stringutils" #include <utils/Log.h> #include "StringUtils.h" #include "AudioTypes.h" namespace android::mediametrics::stringutils { std::string tokenizer(std::string::const_iterator& it, const std::string::const_iterator& end, const char *reserved...
TOOL
0.900979
6.75728
bbf5ffff-82ce-4516-ad30-588f54d4042f
hilariousabhishek/CPP-DSA
C++ Basic/No_of_set_bits.cpp
#include <iostream> using namespace std; int main() { int a, b; cin>>a>>b; int count=0; for(int i=1;i<=32;i++){ if((a&1)==1){ count++; } a=a>>1; } for(int j=1;j<=32;j++){ if((b&1)==1){ count++; } b=b>>1; } co...
ALGO
0.999856
3.882199
1396c920-df5e-4b89-9fe3-aecf75573621
ATpathi/AZ-Codefiles
Graph/Graph foundations/Easy-Graph-Queries-374.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define arrin(n,arr) for(int i=0;i<n;i++)cin>>arr[i]; #define arrout(arr) for(auto x:arr)cout<<x<<' '; #define rep(i,a,b) for(int i=a;i<b;i++) #define rrep(i,a,b) for(int i=a;i>b;i--) #define vi vector<int> int n,m,comp_no=1; vector<vi> g; vi c...
ALGO
0.999904
4.246669