uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
16ee6c25-8ae7-4640-acff-0b0c91157dfc
yadhu1961/learnoops
HelloWorld/HelloWorld.cpp
/* * Author: Yadhunandana R K Email :<EMAIL> */ #include <cstdlib> #include <iostream> /* Using name space method is used to improve the readability of the code However only way to avoid name collision is explicit qualification */ using namespace std; bool exchange(int &, int &); int main(int argc, char *...
ALGO
0.965251
4.000698
dde8cf5e-35de-4c15-a8e6-e9fa56f26e6f
tgbudd/DT
HarmonicDiffusion.cpp
#include <queue> #include "HarmonicDiffusion.h" #include "TriangulationProperties.h" HarmonicDiffusion::HarmonicDiffusion(const Triangulation * const triangulation, Embedding * const embedding, CohomologyBasis * const cohomologybasis) : triangulation_(triangulation), embedding_(embedding), cohomologybasis_(co...
ALGO
0.999396
5.678484
84c95450-b22d-493d-a150-bab0a3f83ced
kimotu4632uz/Compete
abc327/a/abc327_a.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr auto seq(int begin, int end) { return ranges::iota_view(begin, end); } constexpr auto seq(int end) { return ranges::iota_view(0, end); } #define all(v) std::ranges::begin((v)), std::ranges::end((v)) int main() { ios_base::sync_with_stdio...
ALGO
0.999979
5.173369
2218374d-4516-4e1c-9d4b-04e4d201727b
erwin24092002/CS112---The_Design_and_Analysic_of_Algorithms
[WECODE#03] DIVIDE&CONQUER + DYNAMIC PROGRAMMING/03. Bop bong bong.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll, ll> pll; /* dp[config][i] là số tiền tối đa Bình thu được khi xóa bong bóng thứ i đầu tiên trong trạng thái các bong bóng là config ans[config] là số tiền tối đa Bình thu được trong trạng thái các bong bóng...
ALGO
0.999877
3.956681
34a4e8af-5273-4d67-9a08-ab84a11a2157
man0045/Data_Structure_with_Cpp
stack/infix_Expression.cpp
#include<iostream> #include<stack> using namespace std; int priority(char ch){ if(ch == '+' || ch == '-') return 1; else return 2; } int solve(int val1, int val2, char ch){ if(ch == '+') return val1+val2; else if(ch == '-') return val1-val2; else if(ch == '*') return val1*val2; else return val1/val2; } int main()...
ALGO
0.999975
4.086847
e25ad32e-0737-4a01-92fb-7d5c1879dad5
Boemia/Basic-cpp
Aula4.cpp
#include <iostream> using namespace std; int n1, n2; //Variáveis Globais. int main(){ int n3, n4; //Variáveis Locais. int res; n1 = 11; n2 = 3; n3 = 5; n4 = 2; res = (n1+n2+n3+n4)-7; cout << "A soma das variaveis: " << res << "\n"; system("pause"); return 0; }
ALGO
0.984523
3.084505
6d10a133-a571-427d-bd32-34d735880a4f
stym01/LeetCode-Solutions
0209-minimum-size-subarray-sum/0209-minimum-size-subarray-sum.cpp
class Solution { public: int minSubArrayLen(int target, vector<int>& nums) { int left=0; int n=nums.size(); int right=0; int sum=0; int mini=n+1; while(right<n){ sum+=nums[right++]; while(sum>=target){ mini=min(mini,right-left)...
ALGO
0.999996
6.365215
fc03c110-d23c-426e-b6b5-79a3f48d6e7c
EulerDanseur/MyWorks
Basics of Programming/week 4/HannoiTower.cpp
#include<iostream> using namespace std; int MinStep(int n); void PrintStep(char x, char y, char z, int start, int end); int main() { int towerNum; cin >> towerNum; int step = MinStep(towerNum); cout << step << " steps" << endl; PrintStep('A', 'B', 'C', 1, step); return 0; } int MinStep(int n)...
ALGO
0.99987
4.615216
e4680b32-5e91-49d1-babe-4688abfeb6f4
CdTCzech/Qt5
qtbase/src/widgets/graphicsview/qgraphicssceneindex.cpp
/*! \class QGraphicsSceneIndex \brief The QGraphicsSceneIndex class provides a base class to implement a custom indexing algorithm for discovering items in QGraphicsScene. \since 4.6 \ingroup graphicsview-api \internal The QGraphicsSceneIndex class provides a base class to implement a ...
TOOL
0.960037
3.518228
2731b223-e2f6-480f-82c4-142075dba491
PleXone2019/firmware-mod-kit
src/others/squashfs-4.0-realtek/lzma/CPP/7zip/UI/Common/SortUtils.cpp
// SortUtils.cpp #include "StdAfx.h" #include "SortUtils.h" #include "Common/Wildcard.h" static int CompareStrings(const int *p1, const int *p2, void *param) { const UStringVector &strings = *(const UStringVector *)param; return CompareFileNames(strings[*p1], strings[*p2]); } void SortFileNames(const UStringVec...
TOOL
0.915355
6.468472
72f55ff6-444b-4e84-8e93-b12ab86db111
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_6844_12.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; int a[n], c[n]; for (int i = 0; i < n; i++) { cin >> a[i]; c[i] = a[i]; } sort(c, c + n); int count = distance(c, unique(c, c + n)); int c_size = sizeof(c) / sizeof(c[0]); if (count >= k) { cout << "YES" <<...
ALGO
0.999998
3.812411
c8baadb3-0336-4add-910f-842ca91aac02
renbaoshuo/OI-codes
S2OJ/1702/1702.cpp
#include <iostream> using std::cin; using std::cout; const char endl = '\n'; const int N = 1e5 + 5; const long long INF = 0x3f3f3f3f3f3f3f3f; int n, m, q; long long a[N], b[N]; struct node { int l, r, cnt; long long min, max; node(int _l = 0, int _r = 0) : l(_l), r(_r), cnt(0), min(INF), max(-I...
ALGO
0.999968
4.436304
4b499ab6-f2bb-427b-8273-7cf7fd67caa1
Wvrmhat/Cpp-Basics
arrays.cpp
#include <iostream> #include <string> using namespace std; int main() { int numbers[3] = {100 ,2, 3}; // declared an array of 3 integers for (int n = 0; n < 3; n++) { // goes through each position of the array cout << numbers[n] << endl; // } cout << "---------------" << e...
ALGO
0.95125
3.139536
fa418abb-3886-46f9-9786-4ee90caff39d
seo-bo/ProblemSolving
백준/Bronze/26350. Good Coin Denomination/Good Coin Denomination.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(void) { cin.tie(0)->sync_with_stdio(0); int T = 0; cin >> T; while (T--) { int n = 0, pre = -1; cin >> n; bool flag = true; vector<int>v(n); for (auto& i : v) { cin >> i; if (pre * 2 > i) { flag = false; } ...
ALGO
0.999241
5.32632
0d0d3bc8-e040-4aad-a3a2-dc244b2ac249
himanshumaharshi/LeetCode-DSA
1765-merge-in-between-linked-lists/merge-in-between-linked-lists.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* mergeInBetw...
ALGO
0.999981
5.139605
451b0eca-dd22-4ccf-81df-7dfb6bf2350b
Kawser-nerd/CLCDSA
Source Codes/AtCoder/arc076/B/1655598.cpp
#include <algorithm> #include <cstdio> #include <cstdlib> #include <functional> #include <numeric> #include <queue> #include <tuple> #include <vector> #define repeat(i, n) for (int i = 0; (i) < int(n); ++(i)) #define repeat_from(i, m, n) for (int i = (m); (i) < int(n); ++(i)) #define whole(x) begin(x), end(x) using ll ...
ALGO
0.999946
4.291354
bf8d2ac1-f203-462c-b4d0-1c664c820b6b
Bhavya333-web/GeeksForGeeks_Streak
Difficulty Level - Medium/Indexes of Subarray Sum/Indexes_of_Subarray_Sum.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: vector<int> subarraySum(vector<int> &arr, int target) { // code here int n = arr.size(); int i = 0; int j=i+1; int sum = arr[0]; if(arr.size...
ALGO
0.99947
6.127892
762ab5a2-1d9c-417f-a3e3-2ed14da1783b
Harshit0502/stock-news-engine
cpp/faiss_helper.cpp
from fusion_cpp import knn # pybind11 neighbor = knn(latest_emb.astype('float32'), 5)[1].mean() # avg dist or label final_pred, prob = engine.predict(X_seq=np.array([seq]), neighbor_score=np.array([[neighbor]]))
ALGO
0.998943
6.167851
2b4d6712-d903-4bed-a751-e5351b197ee1
partho-das/CompetitiveProgrmming
CP_CODE/Tamplate/Normal/b.cpp
#include <bits/stdc++.h> using namespace std; //____________________________________________________________________________________________________________________________________ #define PI 2*acos(0.0) #define pf printf #define sf scan #define ff first #define ss second #define mp make_pair #define pb push...
ALGO
0.999219
3.277346
1b61ac40-57cf-411f-8f34-a310333e5ec3
hwankim123/BaekJoon_Algorithm_Codes
Unsolved/15684 - 사다리 조작.cpp
#include<iostream> #include<stdio.h> using namespace std; int N, M, H; int adj[30][11]; // 0 : false int result[11]; void print() { cout << "사다리 \n"; for (int i = 0; i <= H; i++) { for (int j = 0; j <= N; j++) { cout << adj[i][j] << ' '; } cout << endl; } } bool check(...
ALGO
0.999955
4.036927
750d4330-ba97-4edd-bc5f-eb7b1d468d08
trishantsaxena/Project_DSA
Arrays/ShiftArray.cpp
#include<iostream> #include<vector> void getSize(int &num){ std::cout<<"\nEnter Size/Shift value:\t"; std::cin>>num; } void takeInput(std::vector<int> &nums){ std::cout<<"\nEnter Elements:\t"; for(int &num:nums) std::cin>>num; } void printOutput(std::vector<int> &nums,int k){ std::cout<...
ALGO
0.999102
4.578864
2af7a62a-bc97-40a1-b532-6197bb352a52
SEOSUK/PX4-Modifying
src/modules/ekf2/EKF/ev_yaw_control.cpp
/** * @file ev_yaw_control.cpp * Control functions for ekf external vision yaw fusion */ #include "ekf.h" void Ekf::controlEvYawFusion(const extVisionSample &ev_sample, const bool common_starting_conditions_passing, const bool ev_reset, const bool quality_sufficient, estimator_aid_source1d_s &aid_src) { s...
ALGO
0.983146
6.008973
df4a2dfa-5dea-4b0e-a310-b36a2c27667e
AssoDePicche/cpp
src/Classes/Classes and Objects/Solution.cpp
#include <iostream> #include "./Student.cpp" int main() { int inputs, kristenScore, count = 0, total; std::cin >> inputs; Student *students = new Student[inputs]; for (int i = 0; i < inputs; i++) { students[i].input(); } kristenScore = students[0].calculateTotalScore(); for (int j = 1; j < input...
ALGO
0.997487
3.789534
7a8d5693-b378-4d56-a424-b52125b03908
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_11699_8.cpp
#include <bits/stdc++.h> using namespace std; const int inf = 0x3f3f3f3f, mod = 1000000007; const double pi = 3.1415926535897932, eps = 1e-9; int n, m, k, lo, hi; double dp[2][200015], ans; int main() { scanf("%d%d%d", &n, &m, &k); dp[0][k] = 1.0; lo = hi = k; for (int(ii) = (0); (ii) < (n + m); (ii)++) { i...
ALGO
0.999848
3.513033
830350c4-e139-4b18-8669-cb6bce539016
DiosDelRayo/XmrSignerCompanion
bcur/utils.cpp
#include <assert.h> #include "utils.hpp" extern "C" { #include "sha2.h" #include "crc32.h" } #include <vector> #include <sstream> #include <algorithm> #include <cctype> using namespace std; namespace ur { ByteVector sha256(const ByteVector &buf) { uint8_t digest[SHA256_DIGEST_LENGTH]; sha256_Raw(&buf[0],...
TOOL
0.932038
6.050069
2f2a75c1-ee12-4d89-9b46-e46484d24de3
ishandutta2007/codeforces
kilo_5723/normal/1255/E2.cpp
#include<iostream> #include<algorithm> #include<cstdio> #include<vector> #include<cstdlib> #include<cmath> using namespace std; typedef long long ll; typedef long long LL; const int maxn=1e6+5; ll a[maxn],b[maxn]; int n; ll ans; const LL m=7, aa[m]={2, 3, 5, 7, 11, 13, 17}; LL mul(LL u, LL v, LL p) { return (u * v ...
ALGO
0.999986
3.528125
d1ce7d2c-c6d8-4fad-99aa-bf5d9785676f
ishandutta2007/codeforces
danya.smelskiy/normal/732/C.cpp
#include <bits/stdc++.h> using namespace std; long long a[5]; int main(){ long long x,y,z; cin>>a[0]>>a[1]>>a[2]; long long ans=5e18; if (a[0]<=1 && a[1]<=1 && a[2]<=1) { if (a[0] && a[2]) ans=3-a[0]-a[1]-a[2]; if (!a[0] || !a[2]) ans=0; } for (int i=1;i<=3;++i) { for (in...
ALGO
0.999885
4.119854
163e91e8-ad6e-4589-960d-3425e68718ad
Suvansh16/Leetcode
1815-checking-existence-of-edge-length-limited-paths/1815-checking-existence-of-edge-length-limited-paths.cpp
class DSU{ vector<int>parent,rank; public: DSU(int n) { parent.resize(n); rank.resize(n,0); for(int i=0;i<n;i++) { parent[i]=i; } } int find(int a) { if(parent[a]!=a) parent[a]=find(parent[a]); r...
ALGO
0.999776
5.763961
07262f7c-33be-4751-8986-f35e6a816c70
RajputSumitSingh/Practice-Data-Structure-Algorithm
Session 38/sumOfLeftRight.cpp
#include<iostream> using namespace std; class Node{ public: int data; Node* left; Node* right; Node(int data){ this->data = data; this->left = NULL; this->right = NULL; } }; Node *buildTree(){ int data; cout << "Enter the data : "; cin >> data; if(data == -1){ return NULL; } ...
ALGO
0.999737
4.803818
d2279497-6279-4afd-ad25-558fe38f546c
islamiusupov/labs
lab04/ex1_c.cpp
#include <iostream> using namespace std; int main() { int arr[10]; cout << "Введите 10 целых чисел: "; for (int i = 0; i < 10; i++) { cin >> arr[i]; } double sum = 0; for (int i = 0; i < 10; i++) { sum += arr[i]; } double average = sum / 10; cout << "Среднее арифмети...
ALGO
0.998694
4.321449
e5e89293-ffca-4029-a8a2-c11047e922ad
AdityaKarn/cp-cpp
codeforces/734Div2/E.cpp
#include <iostream> #include <vector> #include <algorithm> #include <climits> #define REP(i, n) for (int i = 1; i <= n; i++) #define mod 1000000007 #define pb push_back #define ff first #define ss second #define ii pair<int, int> #define vi vector<int> #define vii vector<ii> #define lli long long int #define INF 10000...
ALGO
0.999641
4.801238
a7642574-e3e8-4e48-82b7-3550b6d7c40a
ishandutta2007/codeforces
.o/normal/788/A.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <memory.h> #include <math.h> #include <assert.h> #include <stack> #include <queue> #include <map> #include <set> #include <algorithm> #include <string> #include <functional> #include <vector> #include <deque> #include <utility> #include <bitset> #inclu...
ALGO
0.999977
3.891579
1ca56829-5ff5-4a2a-8067-561d202cfdbe
pingjuiliao/mlir-playground
llvm-project/libc/src/math/generic/llround.cpp
#include "src/math/llround.h" #include "src/__support/FPUtil/NearestIntegerOperations.h" #include "src/__support/common.h" namespace __llvm_libc { LLVM_LIBC_FUNCTION(long long, llround, (double x)) { return fputil::round_to_signed_integer<double, long long>(x); } } // namespace __llvm_libc
TOOL
0.996316
6.425124
9de1c4f0-cbe3-4284-ac2e-47935d44e62a
Bernardo-Leite/Tic-Tac-Toe-Game
Jogo_do_Galo_v2/Projeto_Galo/main.cpp
//============================================================================= // Estrutura de Dados e Algorítmos 2018/2019 //============================================================================= // Bernardo Alexandre dos Santos Costa Leite, 2017268958 // Roberto Luís Dias Pereira, 2017270581 //===============...
TOOL
0.959559
4.424823
2192b88c-d5d7-4ea1-9bb7-098a8f56400a
skourdes/SproutsClassic
src/kernel.cpp
#include <boost/assign/list_of.hpp> #include "kernel.h" #include "db.h" using namespace std; // Protocol switch time of v0.3 kernel protocol unsigned int nProtocolV03SwitchTime = 1435808381; unsigned int nProtocolV03TestSwitchTime = 1359781000; // Protocol switch time of v0.4 kernel protocol unsigned int nProtoc...
ALGO
0.992069
4.519861
0a6baed4-e453-413f-bd7a-145106ff527f
ThugOG/ExperimentAOA
LinearSearch.cpp
#include <stdio.h> int LinearSearch(int * arr, int n, int key){ for(int i = 0; i < n; i++){ if(arr[i] == key){ return i; } } return -1; } int main() { //Insertion Sort int arr[6] = {5,23,34,-9,78,4}; int size = 6; int key = 78; // LinearSearch(arr, size, key);...
ALGO
0.999973
4.380493
98003037-a82e-4f37-9ec3-0116c4aee859
uofs-simlab/ChasteOS
heart/src/solver/electrics/bidomain/OperatorSplittingSDIRK2O2BidomainSolver.cpp
/* Megan E. Marsh, Saeed Torabi Ziaratgahi, and Raymond J. Spiteri Numerical Simulation Laboratory University of Saskatchewan Aril 2015 Partial support provided by research grants from the National Science and Engineering Research Council (NSERC) of Canada and the MITACS/Mprime Canadian Network of Centres of Excelle...
ALGO
0.999819
5.290783
8705ad48-3a6b-490d-bcc6-26a42a08b75c
thinkphp/computer-science-in-c
foundations/dynamic-allocation/matsort.CPP
#include <iostream.h> #include <conio.h> //prototypes functions void* readMatrix(int n,int m); void displayMatrix(int n,int m,int (*adr)[20]); void sortColsMatrix(int n,int m, int (*adr)[20]); void sortColsMatrix2(int n,int m, int (*adr)[20]); void sortLinesMatrix(int n,int m, int (*adr)[20]); void sortLinesMatrix2(i...
ALGO
0.999675
3.04947
57523123-3247-4672-82e6-d30f31446827
alexvelea/competitive
infoarena/potriveala/generator.cpp
#include <fstream> using namespace std; ofstream out("potriveala.in"); int main() { srand(time(NULL)); for (int i = 0; i < 250000; ++i) out << char('A' + rand() % 26); out << '\n'; out << "A"; return 0; }
ALGO
0.988889
3.05917
00368ff5-d50d-475b-947d-650ade8d3668
asetia9/Leetcode
1870-minimum-speed-to-arrive-on-time/1870-minimum-speed-to-arrive-on-time.cpp
class Solution { public: double findt(vector<int>dist,int h) { int n=dist.size(); double gg=0.00; int sum=0; for(int i=0;i<n;i++) { if(i==n-1){ gg= (double)sum; gg+=(double)dist[i]/h; } else{ sum+=ceil(...
ALGO
0.999929
4.868497
fc4d1cd6-0ce2-423c-8ea4-4b6524cfef0e
sforn-null/test
JZ_2_7.cpp
//ָ Offer 07. ؽ //ijǰĽ빹öڵ㡣 // //ǰĽжظ֡ // // // //ʾ 1: // // //Input: preorder = [3, 9, 20, 15, 7], inorder = [9, 3, 15, 20, 7] //Output : [3, 9, 20, null, null, 15, 7] //ʾ 2 : // // Input : preorder = [-1], inorder = [-1] // Output : [-1] /** * Definition for a binary tree node. * struct TreeNode { * int val; ...
ALGO
0.999991
6.716882
1bb46b28-4242-41b1-9f91-06bbcb7916e3
raincross7/code-similarity
codes/train_code/problem417/problem417_451.cpp
#include <bits/stdc++.h> #define rep(i, ns, ne) for (int i = ns; i < ne; ++i) using namespace std; int main() { string s; cin >> s; int n = s.size(), ans = 0; rep(i, 0, n - 1) { if (s[i] != s[i + 1]) { ans++; } } cout << ans << endl; getchar(); }
ALGO
0.999789
3.913025
56664732-dd01-4af4-b894-c021e96767be
Dev-XYS/Algorithms
Sieve-of-Eratosthenes.cpp
#include <cstdio> #include <cstring> #define MAX 100 using namespace std; bool isprime[MAX + 1]; int main() { memset(isprime, true, sizeof(isprime)); for (int i = 2; i * i <= MAX; i++) { if (isprime[i] == true) { for (int j = i * i; j <= MAX; j += i) { isprime[j] = false; } } } for (int i = ...
ALGO
0.999546
4.120205
29f896d6-5027-4a61-99a1-3f6ca3c6ab77
ChinoCarbon/HebeuOJ-server
src/main/webapp/judgements/242/Main.cpp
//神奇的幻方 //描述 // //幻方是一种很神奇的N*N 矩阵:它由数字 1,2,3,??,N×N 构成,且每行、每列及两条对角线上的数字之和都相同。 // //当N 为奇数时,我们可以通过下方法构建一个幻方: // //首先将 1 写在第一行的中间。 // //之后,按如下方式从小到大依次填写每个数 K(K=2,3,?,N×N) : // //若 (K?1) 在第一行但不在最后一列,则将 K 填在最后一行,(K?1) 所在列的右一列; //若(K?1) 在最后一列但不在第一行,则将 K 填在第一列,(K?1) 所在行的上一行; //若 (K?1) 在第一行最后一列,则将 K 填在(K?1) 的正下方; //若(K?1) 既不在...
ALGO
0.999853
3.468636
1f9a9cec-5097-4cf2-9694-84595ee4b206
manojyerra/OpenGL
PhysicsRel/BulletPhysicsIntegratoin/source/BulletPhysics/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp
#include "btConvex2dConvex2dAlgorithm.h" //#include <stdio.h> #include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h" #include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h" #include "BulletCollision/CollisionDispatch/btCollisionObject.h" #include "BulletCollision/Collisio...
ALGO
0.999648
6.628144
bdd79c86-397e-4d4d-88b6-4fa5e4dcff79
hadleyhzy34/data_structure_and_algorithm
tree/src/99-recover-binary-search-tree.cpp
#include <climits> #include <iostream> #include <stack> #include <vector> 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...
ALGO
0.999913
5.685642
9445351e-bd03-49f3-98d1-4b43a993b303
saurabh-ai/dsa-practice-questions
8 Backtracking/254_RatInMaze.cpp
/* Rat in a Maze Problem - I Medium Accuracy: 37.73% Submissions: 100k+ Points: 4 Consider a rat placed at (0, 0) in a square matrix of order N * N. It has to reach the destination at (N - 1, N - 1). Find all possible paths that the rat can take to reach from source to destination. The directions in which the rat can...
ALGO
0.999937
5.44049
065e631a-7182-4953-b65c-5aa0f4656b9e
nikunj-var/DataStructureAlgorithms
dp_CP/01Knapsack.cpp
//using recursion #include<vector> using namespace std; int solve(vector<int>& weight, vector<int>& value,int index,int capacity){ //base case if(index == 0){ if(weight[0] <= capacity){ return value[0]; } else return 0; } int include; include=valu...
ALGO
0.999998
5.524268
200a2b01-0fec-4c4a-b67e-e1909864c3ba
MijaTola/Codeforce
1095E.cpp
#include <bits/stdc++.h> using namespace std; int n; char s[1000010]; int st[1000010],st2[1000010]; bool can[1000010],can1[1000010],vis[1000010]; int main() { scanf("%d %s", &n, s); if(n == 2) { if(s[0] == '(' and s[1] == '(') puts("1"); else if(s[0] == ')' and s[1] == ')') puts("1"); ...
ALGO
0.999809
3.853923
3248bb5a-d9cc-4120-aef3-d96a6c7322b5
raincross7/code-similarity
codes/train_code/problem253/problem253_415.cpp
#include <iostream> #include <algorithm> #include <cmath> #include <string> #include <vector> #include <map> #include <set> #include <queue> #include <stack> #include <bitset> #include <cassert> #define int long long #define rep(i,n) for(int i=0;i<n;i++) #define srep(i,n,m) for(int i=n;i<m;i++) #define elif else if #de...
ALGO
0.999991
3.451389
4ebc8741-5918-4518-bacd-a4f165c35079
MakinoRuki/TopCoder
SRM787Div1Easy.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <vector> #include <algorithm> #define N 500005 using namespace std; typedef long long ll; const ll mod = 1000000007; class AqaAsadiMinimizes { public: ll a[N]; double getMin(vector<int> p, int b0, int x, int y, int n) { for (int i = 0; i < n; ++i...
ALGO
0.999441
3.781736
9e368c43-ee37-4e5c-947e-4284461355ea
Arshjeet-Singh/Strivers-SDE-Sheet-Challenge
Add Two Numbers.cpp
/** * Definition of linked list: * * class Node { * public: * int data; * Node *next; * Node() { * this->data = 0; * this->next = NULL; * } * Node(int data) { * this->data = data; * this->next = NULL; * } * Node (int data, Node *next)...
ALGO
0.999876
5.367583
5cfbad5a-5701-4889-8eac-6278847894ea
HPC-AI-Team/lammps-fugaku-threadpool-sc23
src/MOFFF/pair_buck6d_coul_gauss_dsf.cpp
// clang-format off /* ---------------------------------------------------------------------- Contributing author: Hendrik Heenen (Technical University of Munich) and Rochus Schmid (Ruhr-Universitaet Bochum) References: Bureekaew and Schmid, Phys. Status Solidi B 250, 1128 (2013) ...
ALGO
0.999323
6.614558
5325089c-7605-4225-83c7-e1d1e5cc36c4
AmanGupt2020/dsa_practice_6
bubble-sort.cpp
//{ Driver Code Starts //Initial Template for C++ // C program for implementation of Bubble sort #include <stdio.h> #include <bits/stdc++.h> using namespace std; // swapping the elements void swap(int *xp, int *yp) { int temp = *xp; *xp = *yp; *yp = temp; } // } Driver Code Ends //User function Template ...
ALGO
0.99986
5.594063
fb6b301d-39ff-4981-8e7f-aaafd7f1fafa
minhle27/AlgorithmPractice
Vault/CSES/1629.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int,int> pi; typedef tuple<int, int, int> iii; #define f first #define s second #define PB push_back #define MP make_pair #define LSOne(S) ((S) & -(S)) #define sz(x) int((x).size()) #define...
ALGO
0.9999
4.630852
abd0a6c8-032b-4386-8187-d499e09b5680
Kawser-nerd/CLCDSA
Source Codes/CodeJamData/14/32/14.cpp
#include <iostream> #include <fstream> #include <string> #include <algorithm> #include <cstdlib> #include <cstring> #include <set> #include <map> #include <vector> #include <stack> #include <queue> #include <deque> #include <iomanip> #include <cassert> typedef long long ll; typedef unsigned long long ull; using names...
ALGO
0.999955
4.869143
8fceae0c-239c-48aa-8faa-002bdafde824
morishita8256/AtCoder
AGC/AGC020/A - Move and Win.cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back #define fi first #define se second #define mp make_pair #define all(x) (x).begin(), (x).end() #define rep(i, n) for (int i = 0; i < (n); ++i) #define repp(i, a, b) for (int i = a; i <= (b); ++i) #define repr(i, a, b) for (int i = a; i >= (b); --i) #defi...
ALGO
0.999806
3.918155
e5332b44-06a3-41f1-82da-d3c2ec9b97e5
Duc-Lee/ET2100_DSA_Co_TranThiThanhHai_Baitap
Bai1_Asignment1/Bai3_Tinh_cuoc_phi_taxi.cpp
#include <stdio.h> // ham tinh tien theo khoang cach float phi_theo_kc(int khoang_cach){ float tien = 0; if(khoang_cach <= 2) tien = 5; else tien = 5 + ((khoang_cach - 2) / 0.1) * 0.15; return tien; } int main() { int khoang_cach, thoi_gian; scanf("%d %d", &khoang_cach, &thoi_gian); ...
ALGO
0.997698
3.663128
9529c9b4-48a4-4db8-a500-95cb956b9788
tuanvuPresent/struct-data-algorithms
algorithms/dynamic_program/del.cpp
#include<iostream> using namespace std; int point[101]; int res[101]; int main(){ int n; cin>>n; for(int i=0; i<n; i++){ int x; cin>>x; point[x] += x; } //quy hoach dong for(int i=2; i<=100; i++){ res[i] = max(res[i-1], res[i-2] + point[i]); cout<<res[i]<<" "; } return 0; }
ALGO
0.999956
3.663653
f943adcf-7b9e-4009-ba11-a455411f7033
whlqz9300/leetcode
LeetCode123_Roman to Integer.cpp
class Solution { public: int romanToInt(string s) { unordered_map<char, int> roman_num; char roman[7] = {'I', 'V', 'X', 'L', 'C', 'D', 'M'}; int num[7] = {1, 5, 10, 50, 100, 500, 1000}; int sum = 0; for (int i = 0; i != 7; ++i){ roman_num.insert(pair<char, int>(roman...
ALGO
0.999542
6.257892
71fc6248-d78e-42ed-ba76-840ee795e8c5
grand87/timus
Problems/geeksforgeeks/top-view-of-binary-tree/main.cpp
#include<iostream> #include<map> #include<vector> #include<vector> #include<queue> #include<utility> #include<algorithm> using namespace std; /* A binary tree node has data, pointer to left child and a pointer to right child */ struct Node { int data; struct Node* left; struct Node* right; }; void topView(...
ALGO
0.999848
4.093732
6885977e-9d02-4762-896b-5679b16613c9
DamianArado/LeetCode-tracker
1020-number-of-enclaves/1020-number-of-enclaves.cpp
class Solution { private: bool dfs(int i, int j, int row, int col, int &count, vector<vector<int>> &grid, vector<vector<bool>> &visited) { if(i == -1 or i == row or j == -1 or j == col) return false; if(grid[i][j] == 0 or visited[i][j]) return true; visited[i][j] = true; ++count; ...
ALGO
0.999983
6.493839
9dfcae57-e69d-45e1-80ae-d446fc898142
uubk/mt-llvm-mirror
libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_one.pass.cpp
// <forward_list> // iterator erase_after(const_iterator p); #include <forward_list> #include <cassert> #include "test_macros.h" #include "min_allocator.h" int main(int, char**) { { typedef int T; typedef std::forward_list<T> C; const T t[] = {0, 1, 2, 3, 4}; C c(std::begin(t), s...
TEST
0.888202
5.68786
543d9c6f-256d-462d-81cd-5ac9e1abf478
raincross7/code-similarity
codes/train_code/problem148/problem148_378.cpp
#define ONLINE_JUDGE #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vl; typedef vector<vl> vvl; typedef pair<ll,ll> pl; typedef vector<pl> vp; const ll INF=1001001001; const ll LINF=1001001001001001001; const ll D4[]={0,1,0,-1,0}; const ll D8[]={0,1,1,0,-1,-1,1,-1,0}; #define _ov...
ALGO
0.999904
4.154562
df1b4954-e740-40cc-8669-7ee95a395a16
mitul3737/Mitul-s-Competitive-Programming
BRAC University Competitive Programming training/Intermediate Batch Class/Tree basics and diameter of a tree/Diameter 3.cpp
#include <bits/stdc++.h> using namespace std; vector<int> adj[100000+10]; int f1[100000+10]; /// max farthest int f2[100000+10]; /// second farthest /// adj[i] = adjacency list of node i void dfs1(int u, int par){ f1[u] = 0; f2[u] = 0; for(int v : adj[u]){ if(v == par) continue; ...
ALGO
0.999398
4.563935
63d55076-9108-4d0c-b1ef-64b6a296e927
arc-ch/DAA_LAB
LAB_7/prim.cpp
#include "cmm.H" int main(){ //DIRECTED GRAPH G1 (as an adjacency list) let G1 = { /*0*/ {{1,4},{7,8}}, /*1*/ {{0,4}, {2,8}, {7,11}}, /*2*/ {{1,8},{8,2},{5,4},{3,7}}, /*3*/ {{2,7},{4,9},{5,14}}, /*4*/ {{3,9},{5,10}}, /*5*/ ...
ALGO
0.999962
3.832873
2a7585e2-9ef3-41bb-8f69-85f02ae4049c
iamjatin08/competitive
data structures/examples.cpp
#include<iostream> #include <algorithm> #include<vector> #include<set> #include<unordered_map> #include<map> using namespace std; int main(int argc, char const *argv[]) { int arr[10] = {105,106,111,114,105,135,138,111,147,114}; // set<int> s; // for(int i = 0; i<10; i++) s.insert(arr[i]); // vector<int> v; // for...
ALGO
0.999371
3.444935
ec16f980-52e0-47ab-9aff-5e12ce705fe3
HuynhNghiaKHMT/HLTC
If/BT_SoHoc/In3SoTangDan_If_Else.cpp
#include <iostream> using namespace std; int main() { float a,b,c; cin>>a>>b>>c; if (a>b && a>c) if (b>c) cout<<c<<" "<<b<<" "<<a; else cout<<b<<" "<<c<<" "<<a; if (b>a && b>c) if (a>c) cout<<c<<" "<<a<<" "<<b; else cout<...
ALGO
0.99991
3.779611
8504ab6f-6051-4aa5-b718-f79179493b7d
ThomasKidane/Competitive_Programming
ICPC/DCPC/2019/D.cpp
#include<bits/stdc++.h> using ll = long long; using ld = long double; using namespace std; #define endl "\n"; #define ff first #define ss second #define forn(i,n) for(int i=0;i<n;i++) #define dbgv(v) cout<<#v<<" "<<v<<endl #define dbga(a,n) forn(i,n-1) {cout<<a[i]<<' ';} cout<<a[n-1]<<'\n'; bool inside(vector<int> fo...
ALGO
0.999877
4.147542
9f48bfbd-2e4b-45bb-934e-8378d6d88459
akshaychouke/LeetCode_Solutions
Medium/Rotate by 90 degree/rotate-by-90-degree.cpp
//{ Driver Code Starts //Initial template for C++ #include<bits/stdc++.h> using namespace std; void rotate (vector<vector<int> >& matrix); // } Driver Code Ends //User function template for C++ /* matrix : given input matrix, you are require to change it in place without using extra space */ void rotate(vector<vec...
ALGO
0.999911
5.737443
7445e81a-a5d1-4568-8845-2b8e47920168
ankit-144/cmpetitive-coding
prac/number theory/1203_A.cpp
#include<bits/stdc++.h> using namespace std; #ifdef LOCAL #include"debug.h" #else #define debug(...) 42 #endif #define all(x) begin(x),end(x) #define int long long int32_t main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n; cin>> n; int a[n]; int gc = 0; for(int i=0;i<n;i++){ cin>> a[i]; gc...
ALGO
0.999966
4.20932
ac426712-6349-435b-8343-08c1ac079fda
Iqra-aarshad/DS-cpp-repo
one dimensional array/insertITEMatBOTTOM.cpp
#include <iostream> using namespace std; int main() { int arr[] = {12, 45, 7, 23, 67}; int n = sizeof(arr) / sizeof(arr[0]); int newItem = 100; arr[n] = newItem; n++; cout << "Elements of the array after inserting at end:\n"; for (int i = 0; i < n; i++) { cout << arr[i] << " "; ...
ALGO
0.999316
3.850101
2c809ec7-4c78-45f7-8b84-dde3f01c99a7
rdktrnwsk/SYKOS
CYK/Ogolne.cpp
#include "Ogolne.h" int readInstance(string fileName, float**& instanceMatrix, int& instanceSize) // wczytanie pliku z danymi { fstream file; file.open(fileName + ".atsp", ios::in); string line, key, value; int i; if(file.good()) { do { getline(file, line); i = line.find(':'); if (i > 0) { ke...
ALGO
0.919222
3.566449
09b97b44-0d9b-4e70-8ed1-cd49bbfdc91e
a3828162/LeetCode
0136.SingleNumber.cpp
class Solution { public: int singleNumber(vector<int>& nums) { /*unordered_map<int,int> dic; for(auto& t:nums) dic[t]++; for(const auto& s : dic) if(s.second==1) return s.first; return 0;*/ int ans = 0; for(int i = 0 ; i < nums.size();++i){ ans ^=...
ALGO
0.999984
5.546797
8511973a-1570-486f-a033-22d06c28b2d7
ishandutta2007/codeforces
sohsoh/normal/1517/B.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pll; #define all(x) (x).begin(),(x).end() #define X first #define Y second #define sep ' ' #define endl '\n'...
ALGO
0.999957
4.725282
a7c06578-2355-429e-96b5-2d9176de26f2
ishandutta2007/codeforces
kczno1/normal/1423/I.cpp
#include<bits/stdc++.h> using namespace std; template <typename T> void chmin(T&x,const T &y) { if(x>y)x=y; } template <typename T> void chmax(T &x,const T &y) { if(x<y)x=y; } typedef int64_t s64; typedef uint64_t u64; typedef uint32_t u32; typedef pair<int,int> pii; #define rep(i,l,r) for(int i=l;i<=r;++i) #define ...
ALGO
0.999939
3.466766
4a47a44a-96db-4ced-829d-ffe8e35a403e
minmarg/comer2
src/liblib/mysort.cpp
#include <stdlib.h> #include "mysort.h" // ------------------------------------------------------------------------- // static inline void downheap( void* vector, const size_t N, size_t k, TSCompFunction cmfunc, TSSwapFunction swfunc ) { while( k <= ( N >> 1 )) { size_t j = k + k; if( j < N && ( ...
ALGO
0.999943
4.975313
b3793f65-7c75-4444-9338-5c78d29c4dde
ishandutta2007/codeforces
rns_cus/normal/40/A.cpp
/// A : Coded by Choe Kwang #include <bits/stdc++.h> using namespace std; #define ep 1e-8 double dist(double x, double y) { return sqrt(x * x + y * y); } double x, y; int main() { // freopen("a.in", "r", stdin); scanf("%lf %lf", &x, &y); if (x < 0) x = -x, y = -y; double d = dist(x, y); int m = d; if (abs(d -...
ALGO
0.999828
4.099895
3b51739a-c6b7-474a-aab0-c0d29ed58183
Mayankjoshi670/cpAlgo
contest/codechef173/c.cpp
// // Overwrite #include <bits/stdc++.h> using namespace std; #define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL) #define vi vector<int> #define vvi vector<vector<int>> #define ll long long void findAns() { int n, m; cin >> n >> m; vi a(n), b(m); for (auto &it : a) cin >> it; for...
ALGO
0.999967
3.569752
391b1243-e55a-4068-abea-4f060cb1050d
Mohammad-Nikmard/Crypto-Signal-App
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.998809
6.763549
d13ec214-b8bf-4011-ae7c-784c72bbd64b
bala-chandar12/DSA-C-
very_hard/[1311] Tic Tac Toe [VH].cpp
/* #### Tic Tac Toe #### Create a function that takes an array of char inputs from a Tic Tac Toe game. Inputs will be taken from player1 as "X", player2 as "O", and empty spaces as "#". The program will return the winner or tie results. [Examples] ___ ticTacToe([ ["X", "O", "O"], ["O", "X", "O"], ["O", "#", ...
ALGO
0.995283
4.561604
332afaf0-8658-4d46-b58c-4dacf8345e80
dmagoo/py_tc_led_table
cpplib/lib/CLI11/src/Precompile.cpp
#include <CLI/impl/App_inl.hpp> #include <CLI/impl/Argv_inl.hpp> #include <CLI/impl/Config_inl.hpp> #include <CLI/impl/Encoding_inl.hpp> #include <CLI/impl/Formatter_inl.hpp> #include <CLI/impl/Option_inl.hpp> #include <CLI/impl/Split_inl.hpp> #include <CLI/impl/StringTools_inl.hpp> #include <CLI/impl/Validators_inl.hp...
TOOL
0.88922
5.13016
c2af9f56-8813-43b1-99b5-360214ed4c9f
samadritakarak/DS-and-Algo
cocktailSort.cpp
Cocktail Sort is a variation of Bubble sort. The Bubble sort algorithm always traverses elements from left and moves the largest element to its correct position in first iteration and second largest in second iteration and so on. Cocktail Sort traverses through a given array in both directions alternatively. #include ...
ALGO
0.999991
5.341048
b45c22d1-a896-4448-a52d-f8ec863213b4
Apurvanaruka/CPP
postFix.cpp
#include<iostream> using namespace std; class stack{ private: string exp; public: void push(){} } int main(void){ string exp; cin>>exp; for(int i = 0; i < exp.length(); i++){ exp[i]; } }
ALGO
0.994107
3.304796
38ae7bc1-c54e-4498-86fd-ca2d893d19bd
wjwhhhhhh/ACM_
杂项/problemB.cpp
#include <bits/stdc++.h> #define dug(x) cerr << "死了吧小丑" << x << endl using namespace std; using i64 = long long; template <class T> void chkmax(T &a, T b) { a > b ? (a = a) : (a = b); } template <class T> void chkmin(T &a, T b) { a > b ? (a = b) : (a = a); } void solve() { int n; cin >> n; vector<in...
ALGO
0.999862
4.336779
424dcbe6-a6f7-4510-830d-82f5ee0099f6
hjiang13/LLMs-in-IR
POJ-104/69/306.cpp
#include <iostream> using namespace std; //2981????? // sst 2012.8.8 int main() { char str1[MAX_LEN+10],str2[MAX_LEN+10]; int an1[MAX_LEN+10],an2[MAX_LEN+10]; int i,j; gets(str1); gets(str2); memset(an1,0,sizeof(an1)); memset(an2,0,sizeof(an2)); int Lenth1=strlen(str1); for(j=0,i=Lenth1-1; i>=0; i--,j++) an1[j]=str1[...
ALGO
0.999898
3.031676
607c1334-7cd3-43c8-b933-8475272defbc
Moreonenight/Project2019
Game/cocos2d/cocos/base/CCConsole.cpp
#include "base/CCConsole.h" #include <thread> #include <algorithm> #include <functional> #include <cctype> #include <locale> #include <sstream> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <fcntl.h> #if defined(_MSC_VER) || defined(__MINGW32__) #include <io.h> #include <WS2tcpip.h> #include <Wins...
TOOL
0.939604
5.192574
722bbb4d-201f-4e4a-9957-ed159ea8e25a
SiskonEmilia/DataStructure_Assignment
Sicily/Stack Queue LIst/1001 Reverse Polish Notation.cpp
#include <stack> #include <string> #include <iostream> #include <iomanip> using namespace std; stack<char> oprs; string str; unsigned num; void solve(); double cal(); int main() { cin >> num; for (unsigned i = 0; i < num; ++i) { cin >> str; solve(); } } void solve() { for (unsigned i = 0; i < str.l...
ALGO
0.999603
4.201267
a39e12ca-ca2a-4f7c-be70-d3e626f15ea9
BlueberryPie-kyle/Algorithm-Exercise
Codeforces/1850(Round 886)/1850F.cpp
#include <bits/stdc++.h> #define endl "\n" #define ll long long using namespace std; const int N = 2e5 + 5; int a[N], b[N]; void solve() { int n; cin >> n; memset(a, 0, sizeof a); memset(b, 0, sizeof b); for (int i = 0, x; i < n; i++) { cin >> x; if (x <= n) a[x]++; } for (...
ALGO
0.999885
4.42214
d8fec37a-a76c-436f-adc5-76c588a17492
Ayush13082002/GFG-SOLUTIONS
Easy/Row with minimum number of 1's/row-with-minimum-number-of-1s.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 minRow(int n, int m, vector<vector<int>> a) { // code here int ans=-1,mn=INT_MAX,one=0; for(int i=0;i<n;...
ALGO
0.999934
6.352257
bf87c355-f08e-4ec5-9dab-0a3d4450fd1f
Jorin24/OSS2025
250412/정수 명령 처리 5/process-numeric-commands-5.cpp
#include <iostream> #include <vector> using namespace std; int N; string command[10000]; int num[10000]; vector<int> arr; int main() { cin >> N; for (int i = 0; i < N; i++) { cin >> command[i]; if (command[i] == "push_back" || command[i] == "get") { cin >> num[i]; if(c...
ALGO
0.995627
5.020897
261073f5-81c7-4ee0-906b-2b919e3238ac
Ayush0802/Data_Structures_and_Algorithms
deque.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; class Deque { public: int *arr; int front; int rear; int size; Deque(int size) { this->size = size; front = -1; rear = -1; arr = new int[size]; } void push_front(int e...
ALGO
0.998371
3.837934
7fa0379d-f7c5-4289-9c42-209ebcc69c83
Jeongmin4869/Algorithm
프로그래머스/Level.2/후보키.cpp
#include <string> #include <vector> #include <map> #include <iostream> #include <algorithm> using namespace std; /* 관계 데이터베이스에서 릴레이션(Relation)의 튜플(Tuple)을 유일하게 식별할 수 있는 속성(Attribute) 또는 속성의 집합 중, 다음 두 성질을 만족하는 것을 후보 키(Candidate Key)라고 한다. - 유일성(uniqueness) : 릴레이션에 있는 모든 튜플에 대해 유일하게 식별되어야 한다. - 최소성(minimality) : 유일성을 가...
ALGO
0.998978
5.278192
b2b1638a-110e-4bbe-b0a5-02885eb8642b
finetglazer/finetglazer
graph/kiem_tra_duong_di.cpp
#include<bits/stdc++.h> using namespace std; bool visited[1005]; vector<int> vv[1005]; bool bfs(int u,int v) { memset(visited,true,sizeof(visited)); bool res=true; queue<int> qu; qu.push(u); visited[u]=false; while(qu.size()!=0) { int cur=qu.front(); qu.pop(); for(aut...
ALGO
0.999953
4.473315
de3a3a09-22c3-482f-8989-e539016bcc52
perchuts/CompetitiveProgramming
cf/random/1697E.cpp
#include <bits/stdc++.h> #define all(x) x.begin(), x.end() #define sz(x) (int) x.size() #define endl '\n' #define pb push_back #define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); using namespace std; using ll = long long; using ull = unsigned long long; using ii = pair<int,int>; using iii = tup...
ALGO
0.999952
4.471437
c3156e74-ea7c-4515-9649-c56e6e2daf2b
eassisv/online-judge
Uri/1552.cpp
#include <bits/stdc++.h> using namespace std; #define MAX 512 struct ponto{ double x, y; ponto() {}; ponto(double _x, double _y) : x(_x), y(_y) {}; }; typedef pair <double, int> di; double adj[MAX][MAX]; ponto cord[MAX]; double distancia(ponto a, ponto b){ return sqrt(((a.x - b.x)*(a.x - b.x) + (a.y - b.y)*...
ALGO
0.999015
3.816109
ee38b1d6-fc8f-4f29-9a09-b393a4842827
newton427/introduction-to-programming-165877
dowhileven.cpp
#include <iostream> using namespace std; int main() { int num = 12; // Start from 12 do { cout << num << " "; // Output the current even number num += 2; // Increment by 2 to get the next even number } while (num <= 50); // Continue as long as the number is less than or equal ...
ALGO
0.98545
4.046002
62f19344-18c6-48dc-96ec-01c3baf07c87
vincentzyc/flutter-demo
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.9988
6.76073
ff227209-8281-4018-9d9b-571f47c7c7dc
NimishGupta95/Graph-Programs
dfs.cpp
#include<stdio.h> #include<iostream> #include<list> #include<algorithm> using namespace std; class Graph{ int V; list<int> *adj; void DFSUtil(int,int*); public: Graph(int); void addEdge(int,int); void DFS(int); }; Graph::Graph(int v){ this->V= v; adj = new list<int>[v]; } void Graph::addEdge(int src,int...
ALGO
0.9999
4.589868
3ababf31-07ba-4807-ac1b-9f83ceb2fafa
Darelife/CompetitiveProgramming
Problems/B_Emordnilap.cpp
#include <bits/stdc++.h> using namespace std; #define int long long using pii = pair<int, int>; #define forr(i, n) for (int i = 0; i < n; i++) #define reforr(i, n) for (int i = n; i >= 0; i--) #define eqforr(i, a, n) for (int i = a; i <= n; i++) #define sqforr(i, n) for (int i = 1; i * i <= n; i++) #define genforr(i,...
ALGO
0.999856
5.596254