uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
00da6c8a-9544-40d1-a2f9-965dfc8b5be3
Xelerezex/learning-space
coursera-courses/specialization-the-art-of-development-in-modern-c++/3-red-belt/week-5/08.MatrixSum/Source/matrix_sum.cpp
#include "test_runner.h" #include <vector> using namespace std; int64_t CalculateMatrixSum(const vector<vector<int>>& matrix) { // Реализуйте эту функцию } void TestCalculateMatrixSum() { const vector<vector<int>> matrix = { {1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14,...
ALGO
0.999795
5.535621
2dc15a49-3a81-4f71-a0bb-b2c37b57a276
Padm0069/Leetcode-DSA
Binary Trees/98-validate-binary-search-tree/98-validate-binary-search-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.999789
6.614737
6b724570-2968-442b-8d53-5e6385a86660
hs094/CP
Codeforces/Polynomial Round 2022 (Div. 1 + Div. 2, Rated, Prizes!)/A_Add_Plus_Minus_Sign.cpp
#pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #include <complex> #include <queue> #include <set> #include <unordered_set> #include <list> #include <chrono> #include <random> #include <iostream> #inc...
ALGO
0.99992
4.30769
b3df13d7-1148-4e51-bcf9-88b295d46f92
lanl/kokkos-clang
llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp
#include "llvm/Transforms/Scalar.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/AssumptionCache.h" #include "llvm/Analysis/InstructionSimplify.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/LoopPass.h" #include "llvm/Analysis/ScalarEvolution.h" #include "llvm/...
ALGO
0.977006
6.309668
5b8e8fe5-45ed-423a-a120-5b8051ba9140
Mohit-106/DSA_Level_2
Graph/41_FindEventualSafeState.cpp
// class Solution // { // public: // bool dfs(vector<vector<int>> &graph, vector<int> &visited, int src) // { // if (visited[src] == 2) // { // return true; // } // else if (visited[src] == 1) // { // return false; // cycle detected // } /...
ALGO
0.999891
6.005015
44b04051-cd8f-432b-936d-2d9aefd6549d
actian-geospatial/ogr-ingres
1.9.1/frmts/nitf/nitf_gcprpc.cpp
#include "gdal_priv.h" #include "nitflib.h" CPL_CVSID("$Id"); /* Unused in normal builds. Caller code in nitfdataset.cpp is protected by #ifdef ESRI_BUILD */ #ifdef ESRI_BUILD /************************************************************************/ /* Apply() ...
DATA
0.900143
7.110042
efe28ef0-db66-4a97-a409-d3a959130ac2
GambitBSM/gambit_1.0
ColliderBit/src/analyses/Analysis_Minimum.cpp
#include <vector> #include <cmath> #include <memory> #include <iomanip> #include "gambit/ColliderBit/analyses/BaseAnalysis.hpp" #include "gambit/ColliderBit/ATLASEfficiencies.hpp" using namespace std; // Basic analysis code for copying namespace Gambit { namespace ColliderBit { class Analysis_Minimum : publi...
DATA
0.904252
6.289912
f8ceb2d4-0105-468e-baed-1d346ef5cde6
Vinay-Yadav01/CrackYourInternship
3743-reschedule-meetings-for-maximum-free-time-i/3743-reschedule-meetings-for-maximum-free-time-i.cpp
class Solution { public: int maxFreeTime(int eventTime, int k, vector<int>& startTime, vector<int>& endTime) { int n = startTime.size(); vector<int> freeArray; freeArray.push_back(startTime[0]); for (int i = 1; i < n; i++) { freeArray.push_back(startTi...
ALGO
0.999872
5.829964
6b8ee6ed-0b50-4ac4-bb7d-c4ccbb51bd52
ravi29125/Leetcode
0561-array-partition/0561-array-partition.cpp
class Solution { public: int arrayPairSum(vector<int>& n) { int ans=0; sort(n.begin(),n.end()); for(int i=0;i<n.size();i+=2) ans+=n[i]; return ans; } };
ALGO
0.999702
5.526709
42ad7e33-985c-4402-932c-b73c2836e2f1
creed121/Cedarville-Programming
C++/CS-1210/intToBin.cpp
/********************************************************* * Summary: Converts a user-provided positive integer to a binary list of * ones and zeros. Outputs the result. Can optionally be adjusted to * other bases by changing the DIVISOR variable. * * Author: Christopher Reed * Created: 20 September 2...
ALGO
0.999479
5.702675
a11eab5b-27a2-46d2-bc5a-feb86f2921c7
10kshakir/c-cpp-file
c-cpp-file/merge_sorted_array.cpp
#include<iostream> #include<vector> #include<queue> using namespace std; typedef pair<int,int> PAIR; int main() { int n; cin>>n; vector<vector<int>> all_values(n); for(int i =0;i<n;i++) { int size; cin>>size; all_values[i]=vector<int>(size); for(int j =0;j<size;j++...
ALGO
0.999976
3.546659
f5630dc2-5776-48d3-a662-ef5cf69acc29
saurabhh-svg/Contests
CodeForces/B_Grab_the_Candies.cpp
#include <bits/stdc++.h> #define int long long int using namespace std; void solve(){ int n,odd=0,even=0; cin >> n; for (int i = 0; i < n;i++){ int x; cin >> x; if(x&1) odd += x; else even += x; } if(even>odd) cout << "YES\n"; else...
ALGO
0.999011
4.911089
3abcaaea-1c23-4043-b8be-21c7c4d4b01b
NIRMAL-S-12/Coding
Series AP - GFG/series-ap.cpp
//{ Driver Code Starts // Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function template for C++ class Solution { public: int nthTermOfAP(int A1, int A2, int N) { // code here int d = A2 - A1; return A1 + (N - 1) * d; } }; //{...
ALGO
0.999688
5.355435
5b53f926-268a-40d4-b22f-6030e72cf189
RutwikPatil2024/Data-Structure-in-CPP
bubblesort.cpp
#include<iostream> using namespace std; int main() { int n; cout<<"Enter the number n : "; cin>>n; int arr[n]; cout<<"Enter the element of array : "; for(int i=0;i<n;i++) { cin>>arr[i]; } //bubble sort for(int i=0;i<n-1;i++) { bool flag=true; for(int j...
ALGO
0.99962
4.17934
2c1dee22-1535-41dd-8802-6aaa93253046
weirdrag08/WireUsChallenge_CompetitiveProgramming
Day13.cpp
#include <iostream> using namespace std; void towerOfHanoi(int n, char from_rod, char to_rod, char aux_rod) { if (n == 1) { cout << "Move disk 1 from rod " << from_rod << " to rod " << to_rod<<endl; return; } towerOfHanoi(n - 1, from_rod, aux_rod, ...
ALGO
0.99928
5.678849
a0754933-5a67-4e39-bd3d-bc6ffac66477
lailesh1999/DATA-STRUCTURE
STACK_QUEUE_CLASSES/queue.cpp
#include "iostream" using namespace std; class queue { public: int front = 0; int rear = -1, a[10], item, n; queue(int m) { n = m; } void insert() { if (rear == n - 1) { cout << "QUEUE IS FULL"; } else { cout << "ENTER ...
ALGO
0.928843
4.116493
b9b9f8bf-990f-4087-8268-d96269643d89
ujjwalkasera01/Questions
86-partition-list/partition-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* partition(L...
ALGO
0.999995
5.296352
a0c1acfc-57cd-4b32-af23-391698df0416
adivya-jain/DSA_study
LeetCode/670_maximumSwap.cpp
class Solution { public: int maximumSwap(int num) { string nums = to_string(num); vector<int> index(nums.size()); index[nums.size() - 1] = nums.size() - 1; for (int i = nums.size() - 2; i >= 0; i--) { if (nums[i] > nums[index[i + 1]]) { index[i] = i; ...
ALGO
0.999747
6.163702
b49c81b0-c99e-4ddb-88f2-f1744f5d9798
stargatedaw/stargate-soundtouch
source/SoundTouch/mmx_optimized.cpp
#include "STTypes.h" #ifdef SOUNDTOUCH_ALLOW_MMX // MMX routines available only with integer sample type using namespace soundtouch; ////////////////////////////////////////////////////////////////////////////// // // implementation of MMX optimized functions of class 'TDStretchMMX' // //////////////////////////////...
TOOL
0.995387
5.936207
a86834c5-04d5-4e1f-9cf3-00cffb5b24ac
nguyenhoang4875/CompetitiveProgramming
Spct/cf1/B.cpp
#include<bits/stdc++.h> #define int long long using namespace std; int tcs; int n; vector<pair<int, int>> vii; void solve() { vii.clear(); cin >> n; for (int i = 1; i <= n; i++) { int x; cin >> x; vii.push_back({x, i}); } sort(vii.begin(), vii.end(), [&] (pair<int, int> p...
ALGO
0.999195
4.458488
67831383-cb6a-4429-86af-ec1332435ce0
sarvex/leetcode-chez
lcp/LCP 09. 最小跳跃次数/Solution.cpp
class Solution { public: int minJump(vector<int>& jump) { int n = jump.size(); vector<bool> vis(n + 1); queue<int> q{{0}}; vis[0] = true; int ans = 0, mx = 1; while (!q.empty()) { for (int t = q.size(); t; --t) { int i = q.front(); ...
ALGO
0.999996
5.610642
831aa524-e2b8-4972-b430-2bac786adadb
iagorrr/Competitive-Programming-Solutions
submissions/Codeforces/1657B.cpp
#include <bits/stdc++.h> #define vll vector <long long int> #define lli long long int #define ulli unsigned long long int #define vbool vector <bool> #define LOOP(I, S, E) for(lli I = S; I < E; I++) #define LOOPIN(i, E, V) for(lli i = 0; i < E; i++){cin >> V[i];} #define LOOPOUT(i, E, V) for(lli i = 0; i < E; i++){c...
ALGO
0.999405
3.359682
29fbd925-2b4b-43fa-9e19-f51f2388e131
ssqstc/Cpp_Primer_Plus
Chapter_06/test07.cpp
#include "iostream" #include "cctype" using namespace std; /* * 知识点总结: * - 使用 `string` 类处理字符串输入。 * - 使用 `isalpha` 函数判断字符是否为字母。 * - 使用 `switch` 语句处理多个条件判断。 * - 统计字符串的不同类别(以元音字母开头的单词、以辅音字母开头的单词、其他情况)。 * 注意点: * - 输入验证:确保读取的字符串是否为字母开头。 * - 循环控制:正确处理用户输入的多个单词,并在遇到 'q' 时退出。 */ int main() { string word; // 存储...
ALGO
0.962307
4.274316
cfd5fb99-488b-4660-a927-7d318acccee1
raincross7/code-similarity
codes/train_code/problem054/problem054_48.cpp
#include <bits/stdc++.h> using namespace std; int main() { int A,B,X; bool Y=false; cin>>A>>B; for(X=0;X<B*20;X++){ if(X*8/100==A && X/10==B){ cout<<X<<endl; Y=true; break; } } if(Y==false){ cout<<-1<<endl; } }
ALGO
0.999364
3.576613
56e37eac-f5e8-4931-9837-9e69fa294956
bountyflow/vespa
defaults/src/vespa/defaults.cpp
#include <stdlib.h> #include <dirent.h> #include <stdio.h> #include <string.h> #include <string> #include <vector> #include <unistd.h> #include <atomic> #include <pwd.h> namespace { #define HOST_BUF_SZ 1024 const char *defaultHome = 0; const char *defaultUser = 0; const char *defaultHost = 0; int defaultWebServicePo...
CONFIG
0.927958
5.061203
d8cdc77c-f019-495d-985e-f9005c038019
mateusvrs/competitive-programming
algorithms/geometry/point-in-polygon.cpp
const double EPS = 1e-9; template <typename T> bool point_in_polygon(Point<T> point, vector<Point<T>> polygon) { int num_vertices = polygon.size(); T x = point.x, y = point.y; bool inside = false; Point<T> p1 = polygon[0], p2; // p1 is the first vertex for (int i = 1; i <= num_vertices; i++) { p2 = polyg...
ALGO
0.999561
5.806955
1cce2d96-7f39-4f03-9b17-010afdf52f77
LiUzHiAn/oj_algorithms
poj/2431-汽车加油.cpp
#include<iostream> #include<queue> using namespace std; #define MAX_N 10000 int n, l, p; struct node { int a, b; // Aÿվ복ľ룬BÿվĹ }stop[MAX_N+1]; bool cmp(node p1, node p2) { return p1.a<p2.a; } /* * һ˼·ǣÿһվͿǼӻDz * dz˼·ΪͰ޴ÿһμվΪһμ͵ĻᣨֻҪԺȱˣʱϣ */ void input() { cin >> n; for (int i = 0;i <n;i++) { cin >> stop[i].a...
ALGO
0.999954
3.402668
51f7fbea-0e27-473d-b3f3-ceb30abbe338
Anosy/C-Primer5
Chapter5/Section3/Seciton3_swith/源.cpp
#include<iostream> using namespace std; int main() { unsigned aCnt = 0, bCnt = 0, cCnt = 0, dCnt = 0, other = 0; char ch; while (cin >> ch) { switch (ch) { case 'a': ++aCnt; break; case 'b': ++bCnt; break; case 'c': ++cCnt; break; case 'd': ++dCnt; break; default: ++ot...
ALGO
0.98615
3.465649
404c75eb-4baf-4409-8989-d7325e8a64c5
ishandutta2007/codeforces
i_love_tanya_romanova/normal/560/B.cpp
/* My angel she falls Deserted down from heaven In darkness she came to me You stripped down my shields You heard all my weeps Your own heart broken Laid down my burden All sins forgiven We'll find our haven We'll heal our hearts Each other's arms My broken angel All pain forgotten Will you be here, When gone is the ...
ALGO
0.999925
3.040353
6c0b3e65-1544-4b9f-b46e-0e063fe4eb03
yuvraj1107thapa/Competitive-Programming
DS++/Graph/CompetitiveProgramming/SnakeAndLadder.cpp
#include <iostream> #include <list> #include <queue> using namespace std; class Graph { int v; list<int> *adj; public: Graph(int v) { this->v = v; adj = new list<int>[v]; } void addEdge(int u, int v, bool bidir = true) { adj[u].push_back(v); if(bidir) { adj[v].push_back(u); } } void printAdjList...
ALGO
0.999893
4.776686
aae683a2-0284-4252-a769-ba49cd009232
Nabeel-Rizwan/DSA
Circular_Queue_1.cpp
#include <iostream> using namespace std; // Circular Queue formula = (i+1)%size, use this in queue using array program struct queue{ int f; int r; int*arr; int size; }; int full(struct queue*q){ if((q->r+1)%q->size == q->f){ return 1; } else{ return 0; ...
ALGO
0.998039
4.112178
10a15180-a8d2-4982-9aae-08a88051ae1b
twoint/Robot
Robot/eigen-3.3.8/doc/examples/TutorialLinAlgRankRevealing.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Matrix3f A; A << 1, 2, 5, 2, 1, 4, 3, 0, 3; cout << "Here is the matrix A:\n" << A << endl; FullPivLU<Matrix3f> lu_decomp(A); cout << "The rank of A is " << lu_decomp.rank() << endl; c...
ALGO
0.999725
3.720849
5f7e23d1-1a5a-4b2b-89b3-1dcc7fa3108a
PRoberto04/dev_mob_2023.2
AV-09/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.99888
6.76073
66e90cf8-5c04-4bc5-9a2d-4c8f04d44a8d
Manraj-Mann/Leet-Code-Problems
7.cpp
/*Author : Manraj Singh */ #include <bits/stdc++.h> using namespace std; // Problem : 7. Reverse Integer class Solution { public: int reverse(int x) { if(x == 0){ return 0; } bool neg = 0; if (x < 0) { neg = 1; x *= -1; } ...
ALGO
0.999959
5.631803
d6cb047d-c7c9-4087-9aa7-3f8c7610e9ab
Harshkoli121/DSA
LEET CODE/Guess Number Higher or Lower.cpp
/** * Forward declaration of guess API. * @param num your guess * @return -1 if num is higher than the picked number * 1 if num is lower than the picked number * otherwise return 0 * int guess(int num); */ class Solution { public: int guessNumber(int n) { int l=1,r=n;...
ALGO
0.999979
5.950657
435b0ce2-b509-4412-8917-4a135ebb2108
henry-ph/OI-learning
problems/奇偶排序.cpp
#include<iostream> #include<algorithm> using namespace std; int a[10],b[10]; int main() { int x,s1=0,s2=0; for(int i=1;i<=10;i++) { cin>>x; if(x%2==1) { a[s1]=x; s1++; } else { a[s2]=x; s2++; } } sort(a,a+x); sort(b,b+x); for(int i=s1-1;i>=0;i++) cout<<a[i]<<" "; for(int i=0;i<s2;i++)...
ALGO
0.9999
3.339912
5eb82666-a650-4edf-88b0-c1563119f990
joannechen1223/Leetcode
src/141_linked_list_cycle.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: bool hasCycle(ListNode *head) { if (!head) return false; ListNode *slow = head; ListNode *fast = head; ...
ALGO
0.999567
5.153773
863b00ab-3651-43bf-ba2c-7da0ba190ad6
ShohrabRustam/PRODUCTIVITY_DATA_STRUCTURE
Array/reverseArray.cpp
#include <iostream> using namespace std; void swapping(int &x, int &y) { int temp = x; x= y; y= temp; } void reverse(int A[],int size){ for(int i=0;i<size/2;i++) swapping(A[i],A[size-i-1]); } int main(int argc, char** argv){ int size = 10; int *p; p = new int[size]; cout <<...
ALGO
0.997783
4.496753
f08a16dd-b003-4ad6-b5fc-91900ac03b60
klc407073648/cpp-notes
md/c++/features/c11/src/bindTest.cpp
#include <iostream> // std::cout #include <functional> // std::bind using namespace std; // a function: (also works with function object: std::divides<double> my_divide;) double my_divide (double x, double y) {return x/y;} struct MyPair { double a,b; double multiply() {return a*b;} }; struct MyAdd { doub...
TOOL
0.888041
6.265663
44a08124-3f50-42e6-9a57-e789ce83ae8f
anubhav811/DSA-Practice
2007-find-original-array-from-doubled-array/2007-find-original-array-from-doubled-array.cpp
class Solution { public: vector<int> findOriginalArray(vector<int>& changed) { vector < int > res; if(changed.size() % 2) return res; sort(changed.begin(), changed.end()); map<int, int> mp; for(auto val: changed) mp[val]++; ...
ALGO
0.999986
5.347047
2010554f-6619-40d4-901d-265e1631697c
Bhandariji-Suraj/LeetCode-100
0017-letter-combinations-of-a-phone-number/0017-letter-combinations-of-a-phone-number.cpp
class Solution { public: void solve(string digits, string output, int idx, vector<string> &ans, string mapping[]) { if(idx>=digits.length()) { ans.push_back(output); return; } int num = digits[idx] - '0'; string value = mapping[num]; ...
ALGO
0.999973
6.739664
ad6088f9-aafa-495f-b8fc-ed8aa229e72c
x-INFiN1TY-x/LeetCode_Qs
0219-contains-duplicate-ii/0219-contains-duplicate-ii.cpp
class Solution { public: bool containsNearbyDuplicate(vector<int>& nums, int k) { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n = nums.size(); int i =0; int j =0; unordered_map<int ,int>mpp; for(int i =0;i<n;i++) { if(...
ALGO
0.999894
5.728023
08a61e1e-b9d4-49f8-86f5-2631d643450d
ishandutta2007/codeforces
stevenkplus/normal/63/C.cpp
#include <cstdio> using namespace std; const int MAXN = 1010; int guesses[MAXN]; int hit[MAXN]; int miss[MAXN]; int N; bool digseen[10]; int num[4]; bool check(int n) { for(int i = 0; i < 10; ++i) digseen[i] = false; int cop = n; for(int i = 0; i < 4; ++i) { if (digseen[cop % 10]) return false; digseen[co...
ALGO
0.997914
4.012546
30e92aea-a4e9-4be2-bcf8-f3a61c94c93f
tl123987/shenlan
src/stanley_control/src/stanley_control.cpp
#include "stanley_control.h" #include <algorithm> #include <iomanip> #include <utility> #include <vector> #include "Eigen/LU" #include <math.h> using namespace std; namespace shenlan { namespace control { double atan2_to_PI(const double atan2) { return atan2 * M_PI / 180; } double PointDistanceSquare(const Traj...
ALGO
0.997136
3.118837
28be976c-8cf6-455c-a3ef-a5380ee67e79
wjakubowski/akademia
lab1/main.cpp
#include <iostream> #define ABC 2 using namespace std; #define SQR(x) ((x) * (x)) #include "helper.h" //int sum(int, int); int main() { cout << "Hello World!" << sum(1,ABC) << '\t' << SQR(1+2) << endl; #include "helper.h" #include "helper.h" return 0; }
TOOL
0.940802
3.180946
d8516ade-519a-41b3-8d03-509d4f250f48
WeileiZeng/docker-player
workspace/src/eigen-3.3.7/doc/examples/QuickStart_example2_dynamic.cpp
#include <iostream> #include <Eigen/Dense> using namespace Eigen; using namespace std; int main() { MatrixXd m = MatrixXd::Random(3,3); m = (m + MatrixXd::Constant(3,3,1.2)) * 50; cout << "m =" << endl << m << endl; VectorXd v(3); v << 1, 2, 3; cout << "m * v =" << endl << m * v << endl; }
ALGO
0.998478
3.497551
cd08fbfd-d85b-48ef-b44e-d9e0ea4e060d
ssbb1166/algorithm-problem-solving
mst/boj1197.cpp
#include <algorithm> #include <iostream> #include <vector> using namespace std; int v, e, a, b, c, res, parent[10001]; vector<pair<int, pair<int, int>>> edge; int Find(int x) { if (x == parent[x]) return x; return parent[x] = Find(parent[x]); } void Union(int a, int b) { a = Find(a); b = Find(b); ...
ALGO
0.999964
4.616064
c9978c3c-d180-4efa-829d-89106434f576
ekg/sautocorr
main.cpp
#include <iostream> #include <fstream> #include <sstream> #include <vector> #include "seqiter.hpp" #include "sautocorr.hpp" int main (int argc, char** argv) { if (argc != 6) { std::cerr << argv[0] << "<sequence file> <min repeat> <max repeat> <min z-score> <stride>" << std::endl << std::...
DATA
0.8668
6.062781
c0b64fbd-ad80-4471-8aaf-99d1144220c0
akshitmethi/algorithms
DSA_Cpp/longest_substring.cpp
#include<bits/stdc++.h> using namespace std; int check_long(string s){ int i,j,max; int check[26]; for(i=0;i<26;i++){ check[i]= 0; } max=INT_MIN; i=j=0; while(s[j]!= '\0'){ cout<<"i: "<<i<<" j: "<<j<<endl; if(check[s[j] - 'a'] == 0){ check[s[j]-'a'] = 1; j++; } else { max = j-i; while(s[i...
ALGO
0.999499
4.072359
1ad5829b-7f91-4669-917f-32ecc916285a
Abheast12/programming-contests
codeforces/misc/shorteststatement.cpp
#include<iostream> #include<vector> #include<queue> #include<map> #include<set> #include<algorithm> #include<tuple> #include<random> #include<numeric> #include<string> #include<cmath> #define int long long using namespace std; long long maxsz = 1; int find(int x, vector<long long>&root) { while (x != root[x]) { ...
ALGO
0.999963
5.151595
5b2937bf-7359-4b7f-8984-c4f808749af5
micklat/libdai_xdress
src/mr.cpp
#include <cstdio> #include <ctime> #include <cmath> #include <cstdlib> #include <dai/mr.h> #include <dai/bp.h> #include <dai/jtree.h> #include <dai/util.h> #include <dai/bbp.h> namespace dai { using namespace std; void MR::setProperties( const PropertySet &opts ) { DAI_ASSERT( opts.hasKey("tol") ); DAI_ASSER...
ALGO
0.999949
5.529117
d79dd598-5d88-4955-b505-bbaf01eca392
Imon739/Data-Structure_using-CPP
Singly_Linked-list/insert_tail.cpp
#include<bits/stdc++.h> using namespace std; class Node { public: int val; Node* next; Node(int val) { this->val = val; this->next = NULL; } }; void insert_tail(Node* &head, int num) { Node* newNode = new Node(num); if (head == NULL) { head = newNode; return; ...
ALGO
0.999036
4.789659
bece176f-5ef4-4a31-a846-c4fc0b7948c6
brynchristineloftness/ColoradoMesaUniversity_Classes
Year 1/Semester2/ComputerScience2/Program 3 INFIX to RPN/sourcecodeinfixtorpn.cpp
#include <iomanip> #include <iostream> #include <string> #include <fstream> using namespace std; const int maxstack = 100; const char initstack = '$'; void CreateStack(char Stack[], int &top) { for (int i=0;i<maxstack;i++) Stack[i]=initstack; top = -1; } int priority(char oper) { if (oper == '+') return 2; else ...
ALGO
0.992394
4.288704
167c220e-8298-4040-a4a8-ab40d633b84e
Mrsandman327/windows-book-code-c-
算法/全排列算法.cpp
#include <stdio.h> inline void Swap(char& a, char& b) {// ab char temp = a; a = b; b = temp; } void Perm(char list[], int k, int m) { //list [km ]зʽ int i; if (k == m) {//һзʽ for (i = 0; i <= m; i++) putchar(list[i]); putchar('\n'); } else // list[...
ALGO
0.999963
3.886821
a299406d-48b3-4dac-87e0-01e26124afbb
HarshTanwar143/Harsh-Tanwar_22BCS10007
arrays/287. Find the Duplicate Number.cpp
#include<iostream> #include<vector> using namespace std; class Solution { public: int findDuplicate(vector<int>& nums) { // // BY SORTING // sort(nums.begin(),nums.end()); // for(int i = 0;i<nums.size()-1;i++) // { // if(nums[i] == nums[i+1]) // { // ...
ALGO
0.999956
5.258798
3756f51a-eed7-48f0-b33c-0ecb37ce9413
IvanRenison/ProgrammingProblems
Atcoder/AtCoder Beginner Contest 301/C.cpp
// https://atcoder.jp/contests/abc301/tasks/abc301_c #include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; #define fore(i, a, b) for (ull i = a; i < b; i++) bool solve(string c1, string c2) { map<char, ull> chars1; map<char, ull> chars2; for (char c : c1) { chars1[c]++; } for ...
ALGO
0.999965
5.146208
aee0b524-be6d-4d56-ab16-6b01f3388537
Generalnuh/open-cv
modules/objdetect/src/aruco/aruco_dictionary.cpp
#include "../precomp.hpp" #include "opencv2/core/hal/hal.hpp" #include "aruco_utils.hpp" #include "predefined_dictionaries.hpp" #include "apriltag/predefined_dictionaries_apriltag.hpp" #include <opencv2/objdetect/aruco_dictionary.hpp> namespace cv { namespace aruco { using namespace std; Dictionary::Dictionary(): m...
TOOL
0.882579
5.912421
7b2a0092-2293-4f80-955c-eefb05330d38
Slava/competitiveProgramming
more-source/recursion,perebor/372_skobki-2.cpp
#include <cstdio> #include <vector> using namespace std; int n, a[20]; vector <int> s; void r (int v) { if (s.size() == n-v) { int Ss = s.size(); for (int i = 0; i < Ss; i++) { if (s[Ss-i-1] == 1) a[v+i] = -1; else a[v+i] = -2; } ...
ALGO
0.999357
3.41328
91f8dd3f-26bc-44eb-b296-1485c3d04366
carlosriveraf/UVA-submissions
673 - Parentheses Balance.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; getc(stdin); while( n-- ) { string p; getline( cin , p); stack<char> b; for( int i = 0 ; i < p.size() ; i++ ) { if( p[i] == '(' || p[i] == '[' ) b.push(p[i]); else if( p[i] == ')' ) { if( b.empty() || b.top() != '(' ...
ALGO
0.999832
4.890758
cf2f8c7a-bae1-4a1b-8a89-ecccaf5c7f8b
SuperiorOS/android_system_netd
server/NdcDispatcher.cpp
#include "NdcDispatcher.h" #include <arpa/inet.h> #include <dirent.h> #include <errno.h> #include <linux/if.h> #include <netinet/in.h> #include <stdlib.h> #include <string.h> #include <sys/socket.h> #include <sys/types.h> #include <cinttypes> #include <string> #include <vector> #include <android-base/logging.h> #inc...
TOOL
0.925897
6.56161
36fee656-4603-4f73-a244-5f67c1389d81
06Felix/CSES-Problem-Set
Sorting and Searching/sumOfTwoValues.cpp
#include <bits/stdc++.h> #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL) typedef long long ll; ll MOD = 1000000007; using namespace std; int main() { fastio; vector<pair<ll, ll>> v; ll n, k, a; cin >> n >> k; ...
ALGO
0.999966
4.261654
62ed886c-c9c5-4c2c-9314-ea9ec530a01d
lanbao2021/BlueLeopard
exercise/chapter2/2-1.cpp
// 2-1.cpp // Created by 蓝同学 on 2021/7/5. // 用标准公式求解一元二次方程 #include <iostream> #include <cmath> using namespace std; int main() { double a, b, c, x1, x2, dlt; cout << "请输入方程的3个系数" << endl; cin >> a >> b >> c; dlt = b*b - 4*a*c; x1 = (-b + sqrt(dlt)) / 2 / a; x2 = (-b - sqrt(dlt)) / 2 / a; ...
ALGO
0.999622
4.038188
9189a4ac-b0fe-44ba-b018-79986cd56357
Andy-Lv/Cpp-Learning
CPlusPlusThings-master/learn_class/modern_C++_30/container2/hash.cpp
// // Created by light on 19-12-16. // #include <algorithm> // std::sort #include <functional> // std::less/greater/hash #include <iostream> // std::cout/endl #include <string> // std::string #include <vector> // std::vector #include "../container1/output_container.h" using namespace std; int main() ...
ALGO
0.99775
4.876322
211f3975-328c-4a71-b272-94d7a80cc7db
GuacheSuede/MSSubmission1234567890
submission/rsi/boost_1_69_0/libs/compute/perf/perf_stl_next_permutation.cpp
#include <algorithm> #include <iostream> #include <numeric> #include <vector> #include "perf.hpp" int rand_int() { return static_cast<int>((rand() / double(RAND_MAX)) * 25.0); } int main(int argc, char *argv[]) { perf_parse_args(argc, argv); std::cout << "size: " << PERF_N << std::endl; // create ve...
ALGO
0.988176
5.295419
57703256-8f12-417d-a6e7-c01a20026465
raghav161/Leetcode
3114-beautiful-towers-i/3114-beautiful-towers-i.cpp
class Solution { public: long long maximumSumOfHeights(vector<int>& maxHeights) { long long ans = 0; for (int i = 0; i < maxHeights.size(); ++i) { long long sum = maxHeights[i], last = maxHeights[i]; for (int j = i - 1; j >= 0; --j) { last = min((long long)max...
ALGO
0.999972
5.797187
c8f35203-9050-4391-b4be-0f5ef37f445c
AhmedGamal-29/Leetcode---problem-solving
746-min-cost-climbing-stairs/746-min-cost-climbing-stairs.cpp
class Solution { public: int minCostClimbingStairs(vector<int>& cost) { int size = cost.size(); switch ( size ) { case 0 : return 0; case 1 : return cost[0]; case 2 : return min(cost[0], cost[1]); default: break; } ...
ALGO
0.99992
6.066206
1e18b792-03f2-4a1e-82da-7552bd018234
krishnashah921/Stack
bubble sort using stack.cpp
#include<stdio.h> #include<stdlib.h> #define MAX 5 int st1[MAX];int st2[MAX]; int top1=-1;int top2=-1; void push(int st[],int *top,int element); int pop(int st[],int *top); void sort(int st1[],int st2[],int *top1,int *top2); void display(int st[],int *top); int main() { int arr[MAX]={5,3,1,4,2,}; while(1) {...
ALGO
0.999908
3.815278
b25d4fe9-5271-4683-9bb9-70f7c61d8a86
omrajhalwa/Cpp-CodeforcesQsoln
p50.cpp
#include<iostream> using namespace std; int main(){ int n,m,r[101][101],t,l=0,a=0; cin>>n>>m; for(int i=1;i<=n;i++){ cin>>t; for(int j=1;j<=m;j++){ r[i][j]=t%10; t=t/10; }} for(int i=1;i<=m;i++){ int c=0; for(int j=1;j<=n;j++){ if(r[i][j]>=c){ c=r[i][j]; a=j+a*10; } } cout<<a<<endl; } cout<<a;}
ALGO
0.999927
3.601272
f267ebc6-db45-446c-b1f1-e2a53286a940
anuragji111/cpp-solutions-leetcode-top-150
candy.cpp
Statement 15) There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings. You are giving candies to these children subjected to the following requirements: Each child must have at least one candy. Children with a higher rating get more candies than their neighbor...
ALGO
1
7.151495
001a2f84-b080-49ac-981d-ae6b50d6b4eb
TrifanBogdan24/Probleme-PBINFO
pbinfo/coduri-cpp/clasa-X/cautarebinara.cpp
// #1155 - CautareBinara #include <iostream> using namespace std; bool cautare_binare(int n, int v[25005], int x) { int st = 1; int dr = n; while (st <= dr) { int mijl = dr - (dr - st) / 2; // <=> (st + dr) / 2 if (v[mijl] == x) return 1; else if (v[mijl] < x) ...
ALGO
0.99995
4.841568
12abeb95-3215-4549-bc57-9d46f23df64e
remlamb/MiaouEngine
physics/src/QuadTree.cpp
#include "QuadTree.h" namespace Engine { void QuadTree::Subdivide(QuadNode& node) { #ifdef TRACY_ENABLE ZoneScoped; #endif const auto center = node.bounds.Center(); const auto halfSize = node.bounds.Size() / 2; const auto topRightCorner = center + halfSize; const auto b...
TOOL
0.934644
7.44709
5956046a-6b6f-4f0a-80a8-7e1f5f20b1d9
Taimurr/C-OS-Performance-Optimization
Assignment 3/detect-primes/main.cpp
#include "detectPrimes.h" #include <chrono> #include <iomanip> #include <iostream> struct Timer { // return elapsed time (in seconds) since last reset/or construction // reset_p = true will reset the time double elapsed(bool resetFlag = false) { double result = 1e-6 * std::chrono::duration_cast<std...
ALGO
0.984169
6.021948
45c4bab0-988a-4c17-8b8e-965063088f04
SuperLiVLi/Communication-Networks
mp4/src/csma.cpp
// // Created by li Vlon on 12/1/23. // #include<stdio.h> #include<iostream> #include<fstream> #include<sstream> #include <vector> #include <iomanip> using namespace std; int node_num; int length; int M; int total_time; struct node{ int node_id; int R; int backoff; int collision_count; node(int no...
ALGO
0.987908
4.184294
f0043ff5-09af-4595-9573-d0c8ae8517a0
ParisNicolas/olimpiadas
2023/desafio_0/c++/codigo.cpp
#include <iostream> //For console output (COUT) #include <string> //For string type and methods #include <fstream> //For reading and writing files #include <algorithm> //For remove_if method using namespace std; int main (){ short N, T, key[9]; string keyT, text, out; string alphabet = "ABCDEFGHIJKLMNOPQR...
ALGO
0.999974
3.644022
ce210c0a-9c70-4aae-bc9d-3a877298b6b5
DecSP/cses-downloader
Sorting and Searching/Collecting Numbers.cpp
#include <bits/stdc++.h> #define ll long long #define fastio ios::sync_with_stdio(false); cin.tie(NULL) using namespace std; int main(){ fastio; int n; cin>>n; vector<pair<int,int>> a(n); for (int i=0;i<n;++i){ cin>>a[i].first; a[i].second=i; } sort(a.begin(),a.end()); ll re=1; for (int i=1;i<n;++i){ if...
ALGO
0.999686
4.230226
322e6a46-b292-40e7-8ebd-96ad611fa634
MaggieLee01/Coding
32_04_TreesRightSideView/rightSideView.cpp
/*һöԼվҲ࣬մӶײ˳򣬷شҲܿĽڵֵ ʾ: : [1,2,3,null,5,null,4] : [1, 3, 4] : 1 <--- / \ 2 3 <--- \ \ 5 4 <--- https://leetcode-cn.com/problems/binary-tree-right-side-view */ #include<queue> #include<vector> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *...
ALGO
0.999995
6.351443
14ff5859-658f-407d-adfe-00530ab46561
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_395_22.cpp
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; cout << (a + b < c ? "No" : "Yes") << endl; }
ALGO
0.999974
4.274664
1445395c-f746-4c62-b7a7-fe70b1632670
XChy/FIBO
UnoptGen/src/tools/unoptgen/engine/Mutator.cpp
#include "Mutator.h" #include "transforms/CFGExpand/CFGExpand.h" #include "transforms/CFGRandomSimplify/CFGRandomSimplify.h" #include "transforms/ExprExpand/ExprExpandPass.h" #include "transforms/InstRandomCombine/InstRandomCombine.h" #include "transforms/RandomCVP/RandomCVP.h" #include "transforms/RandomDSE/RandomDSE....
TOOL
0.932681
6.317178
f9f9b23d-406a-4618-9dbd-a6ef0c6343eb
Catiks/Buffer-Diverter
src/common/backend/lib/bipartite_match.cpp
#include "postgres.h" #include "knl/knl_variable.h" #include <limits.h> #include "lib/bipartite_match.h" #include "miscadmin.h" /* * The distances computed in hk_breadth_search can easily be seen to never * exceed u_size. Since we restrict u_size to be less than SHRT_MAX, we * can therefore use SHRT_MAX as the "...
ALGO
0.999791
5.876729
f6e24f7b-0f4c-4527-ae76-331b41165326
manavvinayak/cpp-and-c-programs
removing_duplicates.cpp
class Solution { public: string removeDups(string str) { int arr[26]={0}; int j=0; for(int i=0;i<str.size();i++){ if(arr[str[i]-'a']==0){ str[j++]=str[i]; } arr[str[i]-'a']=1; } return str.substr(0,j); } };
ALGO
0.999923
5.719891
6b585d04-5128-4b9e-891d-f8f7d36f48ba
Maksasj/megaboost
libs/graph/example/inclusive_mean_geodesic.cpp
//[inclusive_mean_geodesic_example #include <iostream> #include <iomanip> #include <boost/graph/directed_graph.hpp> #include <boost/graph/exterior_property.hpp> #include <boost/graph/floyd_warshall_shortest.hpp> #include <boost/graph/geodesic_distance.hpp> #include "helper.hpp" using namespace std; using namespace bo...
ALGO
0.99992
6.604304
3d4b478d-130d-4f5f-b1ea-f910436bb5bc
cbritopacheco/rodin
examples/Misc/RS2023/CellFunction.cpp
#include <Rodin/Solver.h> #include <Rodin/Geometry.h> #include <Rodin/Variational.h> using namespace Rodin; using namespace Rodin::Geometry; using namespace Rodin::Variational; static constexpr Geometry::Attribute Boundary = 2; static constexpr Real m = 1; int main(int, char**) { const size_t n = 128; // Build...
ALGO
0.999297
5.767223
68442bd2-f57f-429d-8b52-3d0a701705b8
amangupta2486/Leetcode-problems-solutions
1689-partitioning-into-minimum-number-of-deci-binary-numbers/1689-partitioning-into-minimum-number-of-deci-binary-numbers.cpp
class Solution { public: int minPartitions(string s) { int n=s.size(); char ch='0'; for(int i=0;i<n;i++) { if(s[i]>ch) { ch=s[i]; } } int ans=ch-'0'; return ans; ...
ALGO
0.999937
5.694829
51f3e78d-09f8-4799-945c-c5e8eedd80d5
theducdev/CodePTIT-Cpp
cpp0711.cpp
#include <bits/stdc++.h> using namespace std; int n, a[100]; void inkq() { for(int i=1;i<=n;i++) cout<< a[i]; cout << " "; } void Try(int i) { for(int j = 0; j <= 1; j++) { a[i]=j; if(i==n) inkq(); else Try(i+1); } } int main() { int t; cin >> t; while(t--) { ...
ALGO
0.999305
3.792583
c96acb30-1589-4ce2-8753-2eb440b3c6f7
koisokoiso/CppGame
cocos2d/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.cpp
#include "CCPUMeshSurfaceEmitter.h" #include "extensions/Particle3D/PU/CCPUParticleSystem3D.h" #include "extensions/Particle3D/PU/CCPUUtil.h" NS_CC_BEGIN // Constants const Vec3 PUMeshSurfaceEmitter::DEFAULT_SCALE(1, 1, 1); const MeshInfo::MeshSurfaceDistribution PUMeshSurfaceEmitter::DEFAULT_DISTRIBUTION = MeshInfo::...
TOOL
0.930546
6.545169
87cf632c-08b9-4b24-abeb-139862ced259
wilsjame/codeforces
problemset/779A.cpp
#include <iostream> #include <vector> #include <cmath> using namespace std; int main() { int cnt[6] = {}; // [1-5] int N; cin >> N; vector<int> A(N), B(N); for (auto &x : A) cin >> x, cnt[x]++; for (auto &x : B) cin >> x, cnt[x]--; int s = 0; for (int x = 1; x <= 5; x...
ALGO
0.99997
3.927637
e106d82c-00fd-4b07-ab19-d881b3fb92de
robjinman/dodge_old
Dodge/include/Box2D/Collision/Shapes/b2ChainShape.cpp
#include <Box2D/Collision/Shapes/b2ChainShape.h> #include <Box2D/Collision/Shapes/b2EdgeShape.h> #include <new> #include <cstring> using namespace std; b2ChainShape::~b2ChainShape() { b2Free(m_vertices); m_vertices = NULL; m_count = 0; } void b2ChainShape::CreateLoop(const b2Vec2* vertices, int32 count) { b2Asser...
ALGO
0.882573
6.244896
6e077aaf-82de-4568-a46b-916fd928c6a0
minhlam2102002/competitive-programming
CSES/5. Range Queries/Subarray Sum Queries.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; struct Node { ll l, r, mid, sum; }; struct SegmentTree { const Node NONE = {0, 0, 0, 0}; int n; vector<Node> st; SegmentTree(int n) { this->n = n; st.assign(4 * n + 1, NONE); } SegmentTree(const vector<int>...
ALGO
0.99999
4.925189
d3da93e3-5f2c-4b5b-b6e1-fa406487b366
Konstantin-Simakov/Programming-Olympiads
C++/Classwork/CW_2/permutation_generation.cpp
// permutation_generation.cpp // Generation of permutations with recursive algorithm. #include <iostream> #include <vector> #include <algorithm> using namespace std; const int N = 3; // Max number in the set. void search(vector<int> & permutation, bool chosen[]); // First version. void search_2(ve...
ALGO
0.999949
5.527276
2e105e24-07fd-4b47-bb53-f03d9fbbe255
gajgeospatial/geos-3.5.0
src/noding/MCIndexSegmentSetMutualIntersector.cpp
#include <geos/noding/MCIndexSegmentSetMutualIntersector.h> #include <geos/noding/SegmentSetMutualIntersector.h> #include <geos/noding/SegmentString.h> #include <geos/noding/SegmentIntersector.h> #include <geos/index/SpatialIndex.h> #include <geos/index/chain/MonotoneChain.h> #include <geos/index/chain/MonotoneChainBui...
ALGO
0.995638
5.273971
4649a925-f000-47f0-9ad7-81941756549e
israt-urme/UVA
11461 - Square Numbers.cpp
#include<bits/stdc++.h> using namespace std; /* * * Prosen Ghosh * American International University - Bangladesh (AIUB) * */ int main(){ int a,b; while(cin >> a >> b && a!=0 && b!=0){ int cnt = 0; for(int i = a; i <= b; i++){ int tmp = sqrt(i); if(i =...
ALGO
0.999678
3.762047
80000163-db99-4f99-b456-e5478ec832d2
NirobNabil/CP
CF_contest/1552/D.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int #define vv vector<int> #define pp pair<int,int> #define pb(x) push_back(x) #define in(x) insert(x) #define del(x) erase(x) #define emp(x) emplace_back(x) #define mt make_tuple #define X first #define Y second #define A begin #define B end #define ...
ALGO
0.999978
3.792227
e9af5437-6a9a-4e76-8a38-f122b45b45d8
androschen/codeforces
Red-BlueShuffle.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int t,n; cin>>t; while(t--){ cin>>n; char r[n]; char b[n]; for(int i=0;i<n;i++){ cin>>r[i]; } for(int i=0;i<n;i++){ cin>>b[i]; } int countr=0,countb=0; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(r[i]>b[i]) countr++; e...
ALGO
0.999939
4.042717
8f2c40a9-7882-42cf-b193-27dd27a8dc27
bolverk/huji-rich
source/newtonian/two_dimensional/point_motions/round_cells.cpp
#include "round_cells.hpp" #ifdef RICH_MPI #include <mpi.h> #endif RoundCells::RoundCells(const PointMotion& pm, const EquationOfState& eos, OuterBoundary const& outer, double chi, double eta, bool cold) : pm_(pm), eos_(eos), pouter_(-1, 1, 1, -1), outer_(outer), chi_(chi), eta_(eta), cold_(cold) {} RoundCells::Rou...
ALGO
0.9995
5.988732
b240816a-7b4a-4930-a7fd-3b00b6556e27
puneetvernekar/CP
0297-serialize-and-deserialize-binary-tree/0297-serialize-and-deserialize-binary-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Codec { public: // Encodes a tree to a single string. string serialize(TreeNode* root) { if(root==NUL...
ALGO
0.999529
6.005916
541eff22-c411-40d0-a412-4a37a931e047
mxjoly/trading-robots-factory-cpp
src/indicators/volume.cpp
#include <limits> #include "../types.hpp" #include "../utils/candles_source.hpp" #include "../utils/math.hpp" #include "indicator.hpp" #include "volume.hpp" /** * @brief Construct a new ADL object. * * @param offset Offset value. Default is 0. */ ADL::ADL(int offset) : Indicator("Accumulation/Distribution Line", "...
ALGO
0.996561
7.378573
7eae52d6-8522-42fd-a7d2-f6c21f8b5f15
Bhawnapaliwal21/Flutter-application
authsystem/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.998573
6.783439
db04be08-c965-4da4-bb93-5ee70c1b4fa2
yitianhao/gpu_sched_new
gpu-sched-exp/minor/boost_1_61_0/libs/math/example/f_test.cpp
#ifdef _MSC_VER # pragma warning(disable: 4512) // assignment operator could not be generated. # pragma warning(disable: 4510) // default constructor could not be generated. # pragma warning(disable: 4610) // can never be instantiated - user defined constructor required. # pragma warning(disable: 4180) // qualifier...
ALGO
0.937874
5.571537
d72b4c41-09e1-4b65-9fd8-78d7c492ebda
kiruthik5000/DAA
greedyAlgorithms/KnapsacAlogorithms.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; struct Job { int deadline, profit; }; bool compare(Job a, Job b) { return a.profit > b.profit; } int main() { int n; cin >> n; if (n <= 0 || n > 10) { cout << "Invalid input"; return 0; } vec...
ALGO
0.999928
5.641747
d592fa17-3eb7-4393-80f4-c4e266ea5f0f
raincross7/code-similarity
codes/train_code/problem377/problem377_410.cpp
#include<bits/stdc++.h> #define mod 1000000007 using namespace std; void addself(int &a,int b){ a+=b; if(a>=mod){ a-=mod; } } void subself(int &a,int b){ a-=b; if(a<0){ a+=mod; } } int main(){ int n,k; cin>>n>>k; int dp[k+1]={0}; dp[0]=1; int upto; for(int i=0;i<n;i++){ cin>>upto; int diff[k+1]={0};...
ALGO
0.999992
3.69981