uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
454dbf8b-2849-4bc9-a5c4-a13559c58dcb
nb10008/smzc
Cool3D/Terrain/TPatchTriangulationDynamic.cpp
#include "StdAfx.h" #include ".\tpatchtriangulationdynamic.h" #include "..\Util\DebugMisc.h" #include "..\Util\Exception.h" namespace Cool3D { /////////////////////////////////////////////////////////////////////////////////////////// // class TPatchLodDynamic // TPatchLodDynamic::TPatchLodDynamic() { m_pPare...
TOOL
0.983203
3.735493
96dd4f61-6b74-42af-b662-ce39b346d864
billlin0904/xamp2
src/thirdparty/r8brain-free-src/pffft.cpp
//$ nobt /* ChangeLog: - 2011/10/02, version 1: This is the very first release of this file. */ /* detect compiler flavour */ #if defined(_MSC_VER) # define COMPILER_MSVC #elif defined(__GNUC__) # define COMPILER_GCC #endif #ifdef COMPILER_MSVC #ifndef _USE_MATH_DEFINES # define _USE_MATH_DEFINES #endif #end...
ALGO
0.996391
4.059776
ab06002d-65ab-4c53-ba71-4c4b93a65f55
thegamer1907/Code_Analysis
DP/1383.cpp
#include<bits/stdc++.h> #define fo(i,a,b) for(int i=(a);i<=(b);++i) #define fd(i,a,b) for(int i=(a);i>=(b);--i) #define fo1(i,a,b) for(int i=(a);i<(b);++i) #define LL long long #define TASK "A" using namespace std; ///--------------------------------------------------- int n, a[1005], f[1005], g[1005], res = IN...
ALGO
0.999993
4.01
64651da0-35f9-418c-9feb-9878f5c018bb
t0whid/Solved-Problem
Codeforces/50A. Domino piling.cpp
#include<bits/stdc++.h> #define ll long long #define pi acos(-1.0) #define N 1000000 int primes[N]; using namespace std; int main() { ll n, m; while(cin>>n>>m) { cout<<(n*m)/2<<endl; } return 0; }
ALGO
0.999687
4.389025
6a3ee45a-c100-4774-84e0-3a550ec8a6ca
JJJangJeongSu/clean-arch-practice
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998859
6.785645
15a12103-4d52-4856-8066-ec93c9b8dd7d
w-mj/leetcode
5087.Letter-Tile-Possibilities.cpp
#ifdef LOCAL_DEBUG #include "defines.h" class Solution { public: int numTilePossibilities(string tiles) { if (tiles.size() == 0) return 0; int ans = 0; set<string> cnads; set<string> pers; sort(tiles.begin(), tiles.end()); ans = 1; pers.insert(tile...
ALGO
0.999962
5.679582
9b3ec6d2-39de-4dcd-93a7-32de176832bd
ikorotkin/gromacs_fhmd
src/gromacs/trajectoryanalysis/modules/freevolume.cpp
/*! \internal \file * \brief * Implements gmx::analysismodules::Freevolume. * * \author David van der Spoel <<EMAIL>> * \ingroup module_trajectoryanalysis */ #include "gmxpre.h" #include "freevolume.h" #include <string> #include "gromacs/analysisdata/analysisdata.h" #include "gromacs/analysisdata/modules/avera...
ALGO
0.968214
6.777456
3b1eb38c-0707-4d99-a461-9886b2f6bf91
raincross7/code-similarity
codes/train_code/problem347/problem347_379.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll N=3e5+5; ll n,m,a[10]; ll cost[]={0,2,5,5,4,5,6,3,7,6}; ll dp[10005]; int main(){ ios_base:: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin>>n>>m; for(ll i=0;i<m;i++)cin>>a[i]; sort(a,a+m); memset(dp,-1,size...
ALGO
0.999985
4.213073
6425a74d-e582-41c3-aced-a7457e256210
just-kitkat/Competitive-Programming
Codeforces/Contests/e162d2v/c.cpp
// Author: JustKitkat // Status: AC #include <bits/stdc++.h> using namespace std; #define el "\n" #define arr array #define ll long long #define ld long double #define pii pair<int, int> #define pll pair<long long, long long> #define vi vector<int> #define vll vector<long long> #define vii vector<pair<int,int>> #def...
ALGO
0.999906
3.941329
4d44c3e5-bd6b-4bd3-b437-c7d2ec8ebba3
priyanshimaurya/leetcode-question
334.cpp
#include<iostream> #include<vector> using namespace std; bool increasingTriplet(vector<int> nums) { for(int i=0;i<nums.size();i++){ for(int j=i+1;j<nums.size();j++){ for(int k=j+1;k<nums.size();k++){ if(nums[i]<nums[j]&&nums[j]<<nums[k]){ return true; ...
ALGO
0.999919
4.384922
c04e3e11-2085-40c7-bae0-dead7506579a
aquawicket/etrigger
lib/cryptopp/rc6.cpp
// rc6.cpp - written and placed in the public domain by Sean Woods // based on Wei Dai's RC5 code. #include "pch.h" #include "rc6.h" #include "misc.h" NAMESPACE_BEGIN(CryptoPP) void RC6::Base::UncheckedSetKey(const byte *k, unsigned int keylen, const NameValuePairs &params) { AssertValidKeyLength(keylen); r = Get...
ALGO
0.99108
7.341525
95fb11ad-0fea-4d9a-bb65-400288419470
revec/llvm-revec
lib/Support/CachePruning.cpp
#include "llvm/Support/CachePruning.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Errc.h" #include "llvm/Support/Error.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" #include "llvm/Support/raw_ostream.h" #define DEBUG_TYPE "cache-pruning" #include <set> #include <system_error> us...
TOOL
0.88863
7.829858
b7c46817-7a0a-4316-b832-1b942b6df8ef
yzxo/leetcode
LeetCode6/LeetCode6/238. Product of Array Except Self.cpp
#include"common.h" #include<vector> #include<algorithm> using namespace std; //˵ô óֽ vector<int> productExceptSelf(vector<int>& A) { vector<int> ret(A.size(),0); ret[0] = 1; for (int i = 1; i < A.size(); i++) { ret[i] = ret[i - 1] * A[i - 1]; } int right = 1; for (int i = A.size() - 1; i >= 0; i--) { right...
ALGO
0.999922
4.280795
5b1b3ebf-bf64-43e3-9c97-4b58bb92749a
georgri/coding
tanya_name/sort_1/selection_sort.cpp
// Сортировка выбором #include <iostream> #include <vector> // Многократно находим в неотсортированной части массива минимальный элемент, // подставляем его в конец отсортированной части. void Sort(std::vector<int> &v) { int n = (int)v.size(); // [0 .. i - 1] - отсортированная часть массива. for (int i = 0; i < n...
ALGO
0.999939
4.978321
32aae1dc-a331-4b77-97f7-6a3d3487277b
MaicolGomez/ACM
spoj/227.cpp
#include<cstdio> #include<iostream> #include<cstring> #include<vector> #include<cmath> #include<algorithm> #include<climits> #include<set> #include<deque> #include<queue> #include<map> #include<climits> #include<string> #include<stack> #include<sstream> using namespace std; #define pi (2.0*acos(0.0)) #define eps 1e-6 #...
ALGO
0.999958
3.673133
6c7c6729-0a9a-4884-a53f-37c5733cc98f
aaddaammgg/CLionProjects
CS008_NAryTree/NAryTree.cpp
// // Created by Adam G. on 4/11/22. // #include "NAryTree.h" NAryTree::NAryTree() { } std::vector<std::string> NAryTree::split(std::string str, const std::string& delimiter) { std::vector<std::string> splitStrings; std::size_t index; std::string token; while ((index = str.find(delimiter)) != std::...
ALGO
0.971678
4.137546
cb9e986f-42f1-4d1f-a492-045fa36e8019
iamkartiknayak/pregrad-campus-app-android-redesign
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
8ea9444c-c4c8-4a4f-b082-59b8f10a3c74
shrai31/C-solution
patterHollowRectangle.cpp
#include<iostream> using namespace std; int main(){ int r,c; cout<<"Row "; cin>>r; cout<<"Column "; cin>>c; for(int i=0; i<r; i++){ for(int j=0; j<c; j++){ if(j==0 || j==c-1 || i==0 || i==r-1) { cout<<"*"; } else cout<<" "; } ...
ALGO
0.998889
3.570748
eeca1c21-4bf8-4b8c-993f-684f2f996ac9
farzamdorostkar/amon
llvm-project-17.0.6.src/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/partial_sort_copy.pass.cpp
// <algorithm> // template<InputIterator InIter, RandomAccessIterator RAIter> // requires ShuffleIterator<RAIter> // && OutputIterator<RAIter, InIter::reference> // && HasLess<InIter::value_type, RAIter::value_type> // && LessThanComparable<RAIter::value_type> // constexpr RAIter // conste...
TEST
0.998103
7.318115
971b0003-11a0-43cd-bec4-f572d477eebb
nileshkaria/cryptopp
cryptopp562/emsa2.cpp
// emsa2.cpp - written and placed in the public domain by Wei Dai #include "pch.h" #include "emsa2.h" #ifndef CRYPTOPP_IMPORTS NAMESPACE_BEGIN(CryptoPP) void EMSA2Pad::ComputeMessageRepresentative(RandomNumberGenerator &rng, const byte *recoverableMessage, size_t recoverableMessageLength, HashTransformation &has...
ALGO
0.989831
7.77748
70a4c9bc-009f-4c16-b43c-e60a23b6cd63
BinomialSheep/Competitive
AtcoderProblems/BootCampMedium/090_GetAC.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vl = vector<long long>; using vs = vector<string>; using vc = vector<char>; using vb = vector<bool>; using vpii = vector<pair<int, int>>; using vpll = vector<pair<long long, long long>>; using vvi = vector<vector<int>>; us...
ALGO
0.999673
4.558249
9562a2ef-474d-46e0-836f-3ab5400a4208
rhkwpdyd023/study
C++/C++Study44-1.cpp
#include <iostream> #include <functional> using namespace std; int main(){ plus<int> add; equal_to<int> comp; greater_equal<int> ge; cout << add(7, 3) << endl; cout << comp(7, 3) << endl; cout << ge(7, 3); return 0; }
TOOL
0.857985
3.547648
0621d856-4e04-4e46-95d1-5ef9a2e31e08
monman53/online_judge
AtCoder/ABC/070/d.cpp
// header {{{ // #define NDEBUG #include <bits/stdc++.h> using namespace std; // {U}{INT,LONG,LLONG}_{MAX,MIN} #define ALPHABET (26) #define INF INT_MAX #define MOD (1000000007LL) #define EPS (1e-10) #define EQ(a, b) (abs((a)-(b)) < EPS) #define CILING(a, b) (((a)+(b)-1LL)/(b)) te...
ALGO
0.999911
4.3642
56744385-b127-4831-8f2d-bc788265a093
DikshantBadawadagi/DSA
catalog.cpp
// #include<iostream> // #include<bits/stdc++.h> // using namespace std; // int main(){ // int n = 4; // vector<int>warehouse = {2,4,1,3}; // int q =1; // vector<pair<int,int>>catalog = {{5,7}}; // int sum=0; // sort(warehouse.begin(),warehouse.end()); // vector<int>prefixSum(n,0); // ...
ALGO
0.999558
5.278631
63c11ed5-91f3-4682-8eb1-16e3c9998c17
ankitkumar55/Competitive-Programming
Coding Exercise Solutions/Single-Use Attack.cpp
//https://www.codechef.com/problems/SINGLEUSE #include <iostream> #include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int a, b, c; cin >> a >> b >> c; int n=0, m=1; n=c; while(n<a){ n=n+b; m=m+1; ...
ALGO
0.999907
3.70523
44bbb918-b597-4a43-9174-af3cf03c98f7
SadJester/TJamCity
CitySimulator/src/core/src/map_math/contraction_builder.cpp
#include <core/stdafx.h> #include <core/map_math/contraction_builder.h> #include <core/map_math/earth_math.h> namespace tjs::core::algo { Edge create_edge(Node* start_node, Node* end_node, WayInfo* way, double dist, core::LaneOrientation orientation) { Edge edge; edge.start_node = start_node; edge.end...
ALGO
0.99851
6.579484
aba04076-38ff-4054-b8e2-903775d4db1d
Nashua354/CP-Programs
hackerrank/problem solving/AppleandOrange.cpp
#include <map> #include <set> #include <list> #include <cmath> #include <ctime> #include <deque> #include <queue> #include <stack> #include <string> #include <bitset> #include <cstdio> #include <limits> #include <vector> #include <climits> #include <cstring> #include <cstdlib> #include <fstream> #include <numeric> #inc...
ALGO
0.999784
3.819512
9b80cbc7-af06-429f-9ef0-8d1a8fa459d1
Henrik-Yao/NEUQ-ACM-Solution
winter-day4/陈益章/7-3(1).cpp
#include<iostream> #include<cstring> #include<stdlib.h> using namespace std; int m[1001][1001],n,p; int dis[1001],f[1001],Distance=0; bool visit[1001]; void find_way(int from) { dis[from]=0; for(int i=0;i<n;i++) f[i]=i; for(int i=0;i<n;i++) { int mmin=999999999,p=-1; for(int j=0...
ALGO
0.999952
3.904012
bcca2165-9174-432d-b73e-7d873f2e1810
jaopredo/data-structures
exercicios/semana_5/quest_6.cpp
#include "../../modules/tad.h" #include <iostream> using namespace std; using namespace TAD; /** * @brief This functions receives a circular queue and search for the passed value in the queue, and * returns into the pointer passed the index that the value was found * * @param q Circular Queue * @param value Des...
ALGO
0.99959
4.8434
e0e49b8b-30e4-429d-90cc-ac406f6464e5
iRobot42/Codewars
8 kyu /easy logs.cpp
#include <cmath> double EasyLogs( double x, double a, double b ) { return log( a * b ) / log( x ); }
ALGO
0.989606
4.135439
1356f256-20f4-45de-840d-7133dc3195f4
clementfarabet/xLearn
packages/contrib/powerwatersegm/union_find.cpp
#include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <union_find.h> /*================================================*/ int element_link( int x,int y, int *Rnk, int *Fth) /*================================================*/ { if( Rnk[x] > Rnk[y]) { int t; t=x; x=y; y...
ALGO
0.99974
3.756782
b83c5ccf-d7ee-4ba9-84cd-aa158f6b33cf
flyngPig/APM_simulink
ardupilot/libraries/AC_AttitudeControl/AC_AttitudeControl_Multi.cpp
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*- #include "AC_AttitudeControl_Multi.h" #include <AP_HAL/AP_HAL.h> #include <AP_Math/AP_Math.h> // get lean angle max for pilot input that prioritises altitude hold over lean angle float AC_AttitudeControl_Multi::get_althold_lean_angle_max() con...
CONFIG
0.90698
6.138481
e37e9cbe-31bb-4494-971a-458ce7027c4c
haris71rc/Leetcode
103-binary-tree-zigzag-level-order-traversal/binary-tree-zigzag-level-order-traversal.cpp
class Solution { public: vector<vector<int>> zigzagLevelOrder(TreeNode* root) { vector<vector<int>> ans; if(root==NULL) return ans; queue<TreeNode*> q; bool leftToRight=true; q.push(root); while(!q.empty()){ int size=q.size(); vector<int> v(size); for(int ...
ALGO
0.999997
6.057978
f15462be-1188-46dd-ae71-d8907a15a9ed
leotms/IA-I
global/astar_gap.cpp
#include <vector> #include "priority_queue.hpp" #include <stdlib.h> #include <stdio.h> #include <inttypes.h> #include <assert.h> #include <time.h> #include <limits.h> // Uses Best First Search with GAP Heuristic to // create A* algorithm that solves the // Pancakes Problem. // GAP Heuristic int gap(state_t state, flo...
ALGO
0.999878
4.079763
0a35ca5f-13f5-45d8-8a7d-f481ca5e9396
hiepcanhcut/CTDL-GT-PTIT
DSA02031.cpp
#include<bits/stdc++.h> using namespace std; bool check[256]; bool test(string &s) { for(int i=2;i<s.size();i++) { if(!check[s[i-2]] && check[s[i-1]] && !check[s[i]]) return 0; } return 1; } int main() { check['A'] = check['E'] = 1; char c; cin>>c; string s=""; for(ch...
ALGO
0.999872
4.233571
34b7fbc3-7b68-481f-a76f-ce0db15be70d
PiotrDimitrov/Project-Euler
problems2/problem56.cpp
/* A googol (10^100) is a massive number: one followed by one-hundred zeros; 100^100 is almost unimaginably large: one followed by two-hundred zeros. Despite their size, the sum of the digits in each number is only 1. Considering natural numbers of the form, a^b, where a, b < 100, what is the maximum di...
ALGO
0.997223
6.123857
a48d6535-e5f8-4ecc-a410-22b80239b2c2
ease-lab/gem5-old
src/systemc/tests/systemc/misc/v1.0/dash2/pulse.cpp
/***************************************************************************** pulse.cpp -- Implementation of the pulse generator. Original Author: Ali Dasdan, Synopsys, Inc. *****************************************************************************/ /*****************************************************...
TOOL
0.960696
6.370359
b1b38cad-a8ba-4e21-8760-a1cdcf1bbe57
udayaKavinda/competitive-programming
CSES problem set/Mathematics/Counting Necklaces.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll MOD = 1e9+7; int N, M; ll ans; ll fastpow(ll a, ll b){ ll res = 1; while(b > 0){ if(b&1) res = (res * a) % MOD; a = (a * a) % MOD; b >>= 1; } return res; } int main(){ scanf("%d %d", ...
ALGO
0.999993
4.695604
1c1123d5-b34b-4d57-9fc8-9b1cf8cac219
anis191/Phitron
Second Semester/Basic Data Structures/Week-04/Module-14.5(Practice Day-01)/Problem_3.cpp
/* Question: Take a stack of size N as input and copy those elements to another stack to get the values in the order they were inserted and print them. You should use STL to solve this problem. */ #include<bits/stdc++.h> using namespace std; int main(){ stack<int>st; stack<int>st_copy; int n; cin>>n; fo...
ALGO
0.999893
4.709194
57fd23ab-e1b3-42d0-8b6b-92468f440750
vsharkovski/Competitive-Programming
Programs/AtCoder/nikkei2019_qual_d - Restore the Tree.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; typedef long long ll; typedef pair<int, int> pi; typedef vector<int> vi; template<class Key, class Compare = less<Key>> using Tree = tree<Key, null_type, Compare, rb_tr...
ALGO
0.999994
4.719845
d575d143-3c93-4fe1-bdbf-d7bc72f037c9
sarahorsak/STRUMPACK
src/StrumpackSparseSolverMPIDist.cpp
#include "StrumpackSparseSolverMPIDist.hpp" #include "misc/TaskTimer.hpp" #include "sparse/EliminationTreeMPIDist.hpp" #include "sparse/iterative/IterativeSolversMPI.hpp" #include "sparse/ordering/MatrixReorderingMPI.hpp" #include "sparse/Redistribute.hpp" namespace strumpack { template<typename scalar_t,typename i...
ALGO
0.999012
6.052145
d5d50cd3-943e-434d-b157-414950d84786
WhalesState/pixel-engine
thirdparty/thorvg/src/renderer/sw_engine/tvgSwMath.cpp
#include "tvgMath.h" #include "tvgSwCommon.h" /************************************************************************/ /* Internal Class Implementation */ /************************************************************************/ static float TO_RADIAN(SwFixed angle) { ret...
ALGO
0.990319
7.126747
142ca63a-d913-40df-afa8-88b28cebc3c1
abhaysp95/cp_prac
strivers_dsa/recursion/reverse_array.cpp
#include <iostream> #include <string> using namespace std; #define INF 1e6 bool reverse_array(int* const arr, size_t x, size_t sz) { if (x >= sz - x -1) { return true; } // std::cout << "x: " << x << std::endl; std::swap(arr[x], arr[sz - x -1]); return reverse_array(arr, x + 1, sz); } // try writing the reve...
ALGO
0.999833
4.618691
3a39444e-0fdb-450f-804e-8c7e8b8b7bcb
DISASTER-RUMBLING/CODE
算法/Leetcode/Leetcode 343. 整数拆分.cpp
#define _CRT_SECURE_NO_WARNINGS #include<vector> using namespace std; class Solution { public: int integerBreak(int n) { vector<int> res(n + 1); res[1] = 1; res[2] = 1; for (int i = 3; i <= n; i++) { int mx = 0; for (int j = 1; j <= (i / 2); j++) { ...
ALGO
0.999976
5.494168
3fff231e-fed4-4791-b4ff-8e6a307de66d
vishwaspaikra007/striver-SDE-sheet-challange
P-81 4 july 2022 max-xor-queries.cpp
// striver SDE sheet challange max-xor-queries // author Vishwas Paikra #include<bits/stdc++.h> struct Node { Node *list[2]; }; class Trie { Node *root; public: Trie () { root = new Node(); } void insert(int x) { Node *curr = root; for(int i = 31; ...
ALGO
0.999779
5.289884
8e39a3d2-5b0a-4d30-b4aa-04924357baeb
SubratKumarSingh2001/GeeksForGeeks-Problems
LongestSubarrayWithSumK.cpp
#include <map> int longestSubarrayWithSumK(vector<int> a, long long k) { // Write your code here //TC: O(n^2), SC: O(1) int maxLen = 0; for(int i=0; i<a.size(); i++) { long long sum = 0; for(int j=i; j<a.size(); j++) { sum += a[j]; if(sum == k) { m...
ALGO
0.999871
5.647811
2510d4a1-4cdd-4545-8346-3276248712fb
anandman/path-planning
src/Eigen-3.3/test/denseLM.cpp
#include <iostream> #include <fstream> #include <iomanip> #include "main.h" #include <Eigen/LevenbergMarquardt> using namespace std; using namespace Eigen; template<typename Scalar> struct DenseLM : DenseFunctor<Scalar> { typedef DenseFunctor<Scalar> Base; typedef typename Base::JacobianType JacobianType; typed...
TEST
0.985158
5.862647
67aa5f4f-073d-4a06-9ebd-77e75e728a63
SunandaS76/bug-free-meme
problems/paranthesisCheck.cpp
class Solution { public: bool isValid(string st) { stack<int> s; for(auto& c: st){ if (s.empty() || c == '{' || c == '[' || c == '(') s.push(c); else if(c == '}' && s.top() == '{') s.pop(); else if(c == ']' && s.top() == '[') s.pop(...
ALGO
0.999062
6.26583
f4f81fa6-cbb5-4ac7-98f6-c0a85ff95a5f
mebusw/ball-jail-break
ball-jail-break/libs/Box2D/Dynamics/Joints/b2PulleyJoint.cpp
#include <Box2D/Dynamics/Joints/b2PulleyJoint.h> #include <Box2D/Dynamics/b2Body.h> #include <Box2D/Dynamics/b2TimeStep.h> // Pulley: // length1 = norm(p1 - s1) // length2 = norm(p2 - s2) // C0 = (length1 + ratio * length2)_initial // C = C0 - (length1 + ratio * length2) >= 0 // u1 = (p1 - s1) / norm(p1 - s1) // u2 = ...
ALGO
0.988338
6.983602
8fe52194-39d0-4fc1-8428-a0589c6562cc
ishandutta2007/codeforces
gary2005/normal/825/E.cpp
/* AuThOr GaRyMr */ #include<bits/stdc++.h> #define rb(a,b,c) for(int a=b;a<=c;++a) #define rl(a,b,c) for(int a=b;a>=c;--a) #define LL long long #define IT iterator #define PB push_back #define II(a,b) make_pair(a,b) #define FIR first #define SEC second #define FREO freopen("check.out","w",stdout) #define rep(a,b) for(...
ALGO
0.999999
4.275808
551b4257-24bd-4a6f-b713-d965ce9af70b
AAlab1819/dennyraymond-01082170017
Week 03 - Complexity/148 A - Insomnia cure.cpp
#include <iostream> using namespace std; int main() { // k = dragon got punch , l = dragon got his tail shut, // m = dragon got his paws trampled, n = dragon to call her mom ? // d = total of dragon int k,l,m,n; int dragonDMG=0; int totalDragon; cin>>k>>l>>m>>n>>totalDragon; // check ...
ALGO
0.999878
3.491217
80227e6c-c7bf-429f-ab50-90c7d2a3bc01
jlanga/smsk_selection
src/guidance.v2.02/programs/semphy/SEMPHYOptMat/cAngles.cpp
#include "cAngles.h" #include <cmath> cAngles::cAngles(size_t size) : _size(size), _phi(0), _dim(0) { _init_phi_dim(); } cRotationMatrix cAngles::ROTk(const size_t k) const { tPlane CurrentPlane(GetDim(k)); return cRotationMatrix(_size, CurrentPlane.first, CurrentPlane.second, _phi[k]); } void cAngles::RotateMa...
ALGO
0.99686
4.853845
19070912-b7a3-4d5f-88fb-2fd9f09d679b
ricardcd/splats_surface_reconstruction
src/RobustStatistics/Models/FitCentroid/CentroidModelEstimator.cpp
#include "RobustStatistics/Models/FitCentroid/CentroidModelEstimator.h" #include <math.h> #include <CGAL/centroid.h> CentroidModelEstimator::CentroidModelEstimator( double distThres ) : ModelEstimator< Point_3, double >( 1 ), m_distanceThreshold( distThres ) {} void CentroidModelEstimator::fit( const std::vector< std...
ALGO
0.996906
7.020663
586870e9-2d18-4bc6-a39e-2b4dc489e386
shai-bit/hp-assignment
prueba2/libs/boost_1_81_0/libs/spirit/repository/example/qi/derived.cpp
//[reference_includes #include <boost/spirit/include/qi.hpp> #include <boost/phoenix/core.hpp> #include <boost/phoenix/operator.hpp> #include <boost/phoenix/stl/container.hpp> #include <boost/phoenix/object.hpp> #include <boost/phoenix/fusion.hpp> #include <boost/fusion/include/adapt_struct.hpp> #include <boost/spirit/...
TOOL
0.893065
5.354881
1527a086-711c-45ed-b76d-179ecc9dc79a
dadadadawjb/DataStructureHowTo
Tree/PriorityQueue/Applications/simulator.cpp
#include "simulator.h" simulator::simulator() { cout << "input the num of servers: "; cin >> noOfServer; cout << "input the arrival time:" << endl; cout << "arrivalTimeLow: "; cin >> arrivalTimeLow; cout << "arrivalTimeHigh: "; cin >> arrivalTimeHigh; cout << "\ninput the service time:...
ALGO
0.994392
3.430857
a2a26f78-8288-4f30-9459-b9008c2433f2
moises-ph/Codigo_SENA
Unity/Prueba/Library/PackageCache/com.unity.ide.visualstudio@2.0.14/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp
#include <iostream> #include <sstream> #include <string> #include <filesystem> #include <windows.h> #include <shlwapi.h> #include "BStrHolder.h" #include "ComPtr.h" #include "dte80a.tlh" constexpr int RETRY_INTERVAL_MS = 150; constexpr int TIMEOUT_MS = 10000; // Often a DTE call made to Visual Studio can fail after ...
TOOL
0.955176
6.969462
04c85ace-1d7d-4008-80f8-8864a1cfe24e
ishandutta2007/codeforces
monogon/normal/1698/E.cpp
#include <bits/stdc++.h> #define ll long long #define sz(x) ((int) (x).size()) #define all(x) (x).begin(), (x).end() #define vi vector<int> #define pii pair<int, int> #define rep(i, a, b) for(int i = (a); i < (b); i++) using namespace std; template<typename T> using minpq = priority_queue<T, vector<T>, greater<T>>; ...
ALGO
0.999432
4.167654
238ed743-c87d-471e-ad6c-7bc4f14b575b
Techriss/leetcode
706.cpp
#include <iostream> #include <vector> using namespace std; class MyHashMap { public: MyHashMap() { size = 10007; v = vector<vector<pair<int, int>>> (size, vector<pair<int, int>>()); } void put(int key, int value) { int h = hash(key); for (auto &p : v[h]) { ...
ALGO
0.998863
5.584889
b54e9b4b-9ae4-4039-a23a-d8801e97ca80
JustinKai0527/new_leetcode
two_pointer/167. Two Sum II - Input Array Is Sorted.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: vector<int> twoSum(vector<int>& numbers, int target) { int size = numbers.size(); int i = 0, j = size - 1; while(i < j) { int sum = numbers[i] + numbers[j]; if(sum == targ...
ALGO
0.999913
6.093591
96021b60-1309-4ec9-8d13-f4a3f133e6ea
yingling-group/lammps-mspin
src/fix_spring_self.cpp
// clang-format off /* ---------------------------------------------------------------------- Contributing author: Naveen Michaud-Agrawal (Johns Hopkins University) ------------------------------------------------------------------------- */ #include "fix_spring_self.h" #include "atom.h" #include "domain.h" #incl...
TOOL
0.929437
6.532447
ac8e7faf-1cb1-4492-a39e-07e1d784a3c5
algrobelnik/wordleSolver
src/main.cpp
#include <bits/stdc++.h> #include <fstream> #include <iostream> #include <map> #include <nlohmann/json.hpp> #include <vector> using namespace std; using json = nlohmann::json; struct BestGuess { string word; double percent; BestGuess(string word, double percent) : word(word), percent(percent) {} }; map<char, v...
ALGO
0.883567
5.594991
d20959f9-c0c9-4d26-a437-6ff0f49f3dc0
AnandY4d4v/Leetcode
0876-middle-of-the-linked-list/0876-middle-of-the-linked-list.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* middleNode(...
ALGO
0.999909
5.770542
f3b03b80-5bd1-4d37-b09b-d8c59462ad12
xerohour/windows_embedded_ce_6_r3_170331
windows_embedded_ce_6_r3_170331/WINCE600/PRIVATE/WINCEOS/COREOS/CORE/CORELIBC/CRTW32/STARTUP/cexit.cpp
extern "C" { extern _PVFV __xp_a[], __xp_z[]; /* C pre-terminators */ extern _PVFV __xt_a[], __xt_z[]; /* C terminators */ extern _PVFV *__onexitbegin; extern _PVFV *__onexitend; void _initterm(_PVFV *, _PVFV *); extern LPCRITICAL_SECTION g_pcsExit; char _exitflag; static void doexit( int code, int q...
TOOL
0.930587
6.068809
fe0b7b6b-82d6-44d8-a827-b813884584c4
rainelegary/CPSC453Assignment4
thirdparty/glm-0.9.9.7/test/core/core_func_integer_find_msb.cpp
#include <glm/glm.hpp> #include <cstdio> #include <cstdlib> // To define "exit", req'd by XLC. #include <ctime> #define LE 1 // 1 for little-endian, 0 for big-endian. int pop(unsigned x) { x = x - ((x >> 1) & 0x55555555); x = (x & 0x33333333) + ((x >> 2) & 0x33333333); x = (x + (x >> 4)) & 0x0...
ALGO
0.998306
3.60046
98930885-6cd3-42f4-ad44-76d7e6c593fd
theskcd/ICPC
CODEFORCES/453-C.cpp
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> //using namespace __gnu_pbds; using namespace std; // (づ°ω°)づミe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜ #define Foreach(i, c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define For(i,a,b) for(int (i)=(a)...
ALGO
0.999928
3.606719
e6bd40fb-1caf-42d6-9e33-b184f0d7b76a
sorenhoang/Leetcode
Solves/0xxx/00xx/0006.cpp
class Solution { public: string convert(string s, int numRows) { if (numRows == 1) return s; int step = (numRows - 1) * 2; string ans = ""; for (int i = 1; i <= numRows; ++i) { int cur = i - 1; while (cur < s.size()) { ans += s[cur]...
ALGO
0.999996
6.181552
a54590a3-e0bb-46c8-9d97-fe9ff4aeea2f
biplabSarker/metallercoin
src/core_read.cpp
#include "core_io.h" #include "primitives/block.h" #include "primitives/transaction.h" #include "script/script.h" #include "serialize.h" #include "streams.h" #include <univalue.h> #include "util.h" #include "utilstrencodings.h" #include "version.h" #include <boost/algorithm/string/classification.hpp> #include <boost/...
TOOL
0.88588
7.211846
8c4360bb-3f38-4ccf-8d15-d7e5f8a62f4b
npapadimitriou/HackerRank30dayschallenge
Day 20- Sorting/solution.cpp
#include <bits/stdc++.h> using namespace std; int sorting(vector<int>*); int main() { int n; cin >> n; vector<int> a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } int swaps = sorting(&a); cout<<"Array is sorted in "<<swaps<<" swaps."<<endl; cout<<"First Element: "<<a.front...
ALGO
0.999775
4.047136
405a2e4d-3fe1-4197-85b6-c7c34a2f060f
pingchungchang/CP
tioj2229.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<ll,ll> #define fs first #define sc second int sub; const int mxn = 2808; ll a[mxn][mxn],b[mxn][mxn]; int main(){ ll n,p; cin>>sub; cin>>n>>p; for(int i = 1;i<=n;i++)for(int j =1;j<=n;j++)cin>>a[i][j]; for(int i = 1...
ALGO
0.999895
3.007503
438c1dd6-6cea-42f2-9de8-29680b13543f
jaipuneetsingh/cpp-project
BOUNDA~1.CPP
#include<conio.h> #include<iostream.h> #include<graphics.h> #include<dos.h> #include<stdlib.h> void boundaryfill(int ,int,int,int); void main() { int gdriver=DETECT,gmode,col1; int col,x1,x2,y1,y2,ch,red; initgraph(&gdriver,&gmode,"C:\\TC\\BGI"); cout<<"\nEnter 1 to draw and fill rectangle"; cout<<"\nEnter ...
ALGO
0.995243
3.25656
1ce4f834-1f5b-4120-80f2-a7682a9d1343
galibhaskar/Programming_Pathsala_Problem_Solving_Practice
dynamic_programming/0-1-knapsack-unbounded/top_bottom.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: int solve(int W, int *wt, int *val, int index, vector<vector<int>> &dp) { if (W < 0) return INT_MIN; if (index < 0) return 0; // memo check if (dp[index][W] != -1) retur...
ALGO
0.999993
5.524309
183b8b78-f671-4491-8b49-3f55f43a387b
joanbanlles/INSTADAM
instadam/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.998753
6.76775
a4d37e10-69b4-423b-b0e4-f70650ed9b98
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/Mixtral/top0-100/shortest-path-to-get-food-Solution.getFood/177904_DoS.cpp
void Splash::blitMask(SplashBitmap *src, int xDest, int yDest, SplashClipResult clipRes) { SplashPipe pipe; Guchar *p; int w, h, x, y; w = src->getWidth(); h = src->getHeight(); if (vectorAntialias && clipRes != splashClipAllInside) { pipeInit(&pipe, xDest, yDest, state->fillPattern, NULL,...
ALGO
0.988507
3.154945
d07462f6-c13e-4613-9b1c-efc6ff73e349
VikasKumarRoy/Leetcode
Problem-209.cpp
// Problem - 209 // https://leetcode.com/problems/minimum-size-subarray-sum/ // O(n) time complexity and O(1) space complexity solution class Solution { public: int minSubArrayLen(int target, vector<int>& nums) { int n = nums.size(); int sum = 0; int ans = n+1; int i = 0, j = 0; ...
ALGO
0.999992
6.666638
de1b3027-3d18-4649-91ff-5c3493e7d7e1
amitsinghbhadouriya/OOPS-Question
Question-7.cpp
#include <iostream> using namespace std; class Average { private: float calculateAverage(float n1, float n2, float n3){ return (n1 + n2 + n3)/3.0; } public: void printAverage() { float n1, n2, n3; cout << "Enter the first number whose average is to...
ALGO
0.965958
4.797219
8a09505c-9cc1-49fb-a9bc-0ae3ba0a2457
Yassineay49/Calculparall_Para
src/Matrix.cpp
#include <iostream> #include <vector> #include <algorithm> #include<fstream> #include<mpi.h> #include "Matrix.h" #include "functions.h" #include "settings.h" using namespace std; // Fonction pour déterminer la taille de la portion de données pour chaque processus MPI int size_proc(int rank,int ibeg,int iend,int n...
ALGO
0.999918
3.512392
942d0bc1-fea4-44fb-90ea-19bdbddb2a58
Allenhong0218/Huawei_codecraft2020
T10dot7055.cpp
#include <bits/stdc++.h> #include <unistd.h> #include <sys/mman.h> #include <fcntl.h> #include <sys/stat.h> #include <thread> #include <atomic> #include <unistd.h> #include <chrono> using namespace std; using namespace std::chrono; // #define TEST #define PRINT cout #define MAXTHREADNUM 4 typedef unsigned int uint;...
ALGO
0.998106
3.374611
fbbe94a2-5fa6-4132-9124-7e29921b6ff4
gafeol/competitive-programming
Algorithms/euler_cycle.cpp
// maximum node and edge constraints const int MAXN = 212345; const int MAXE = 2123456; int s[MAXN]; // adjacency list vector<pii> adj[MAXN]; int cnt; int mrk[MAXE]; int temp_path[MAXE], final_path[MAXE], tsz, fsz; void add_edge(int a, int b){ // undirected edge adj[a].pb(pii(b, cnt)); adj[b].pb(pii(a, cnt++))...
ALGO
0.999255
4.192328
c6e46c4b-3271-4096-ace3-27d8caca2710
xavi-04/PED0319-XAQC-00048219
Laboratorio 06/CW-01.cpp
#include <iostream> using namespace std; struct node { int number; node *next; }; int main(void) { node *pStart = NULL; pStart = addStack(pStart, 8); pStart = addStack(pStart, 5); pStart = addStack(pStart, 10); // addStack(&pStart, 9); } node *addStack(node *list, int n) { node *newNo...
ALGO
0.999281
4.350188
50e9307d-e51a-4a62-961e-39ebf9a9762a
amyrul-hub/cupertino-stackview-flutter
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
90265d42-b311-4de4-b515-5331262f484e
HepLib/HepLib
DE/DE.cpp
/** * @file * @brief Basic Functions, extend GiNaC */ #include "DE.h" #include "vspace.h" namespace HepLib { ev_am_t ev_am(const matrix & mat) { return ED::ev_am(mat); } pair<matrix,jcf_t> jordan(const matrix &m) { return ED::jordan(m); } pair<matrix,jcf_t> jordan(const matrix &m, ev_am_t & ev2am) { r...
ALGO
0.999691
5.610508
f869accf-d173-44e7-8f74-6358999c73a6
prasad-Bhoite/Leetcode
longest-zigzag-path-in-a-binary-tree/longest-zigzag-path-in-a-binary-tree.cpp
struct T { int leftMax; int rightMax; int subtreeMax; }; class Solution { public: int longestZigZag(TreeNode* root) { return dfs(root).subtreeMax; } private: T dfs(TreeNode* root) { if (root == nullptr) return {-1, -1, -1}; const T left = dfs(root->left); const T right = dfs(root->...
ALGO
0.99977
6.293142
7013afb2-8952-4f69-b9f2-74716d31cdec
rishavs001/Programming
CP/04_sortcheck.cpp
#include<bits/stdc++.h> using namespace std; bool asc(int *arr,int n){ int flag = 0; for(int i=0;i<n-1;i++){ if(*(arr+i)<*(arr+i+1)) { flag = 1; } else{ flag = 0; break; } } if(flag == 0) return false; return true; } ...
ALGO
0.999734
4.803482
0a3e151f-c641-45b5-a805-e695e95030ea
vampconnoisseur/cp_codes
codeforces/2131/3.cpp
// clang-format off #include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define INF 1000000000 #define ll long long #define eb emplace_back #define pb push_back #define mp make_pair #define X first #define Y second #define vi vector<int> #define vll vector<long long> #define pii pair<int, int> #define...
ALGO
0.999973
5.058741
24150028-ff4b-4902-b73e-f394c616d9b3
ranabhishek/CPP
tut48.cpp
#include<iostream> using namespace std; /* case 1: class b:public a{ order of execution -> first a() then b() }; case 2: class a: public b,public c{ order -> b() c() a() }; case 3: class a: public b,virtual public c{ order -> c() b() a() }; */ class BASE { int data; public: BASE(int i) { ...
TOOL
0.874881
4.949292
b96b7769-882a-438c-9c32-1cef6d128326
TrellixVulnTeam/blender_9WVR
source/blender/io/collada/BCMath.cpp
#include "BLI_utildefines.h" #include "BCMath.h" #include "BlenderContext.h" void BCQuat::rotate_to(Matrix &mat_to) { Quat qd; Matrix matd; Matrix mati; Matrix mat_from; quat_to_mat4(mat_from, q); /* Calculate the difference matrix matd between mat_from and mat_to */ invert_m4_m4(mati, mat_from); mu...
TOOL
0.956452
7.579013
d44fc2de-3e54-4720-a345-e00272245dfb
cxzxcht/CHT-s-Code
树[HAOI 2015].cpp
#include <cstdio> #include <algorithm> #include <cstring> #define LL long long #define N 100010 #define lc (o<<1) #define rc (o<<1 | 1) using namespace std; struct Edge{ int from,to,ne; Edge():from(0),to(0),ne(0){} Edge(int from,int to,int ne) :from(from),to(to),ne(ne){} } e[N*2]; struct treeNode{ int fa,son,ti...
ALGO
0.99988
4.060375
02e5bd6f-dcaa-44b0-a51e-f024f5e65fbb
3agwa/CompetitiveProgramming
CodeForces/CF - One-Dimensional Cellular Automaton - Asia Regionals 2012\2013.cpp
/* * It's easy to notice that if T was smaller, it would've been easily solved using DP * But since T is really large, we could think about changing our dp into a matrix power * For constructing the transition matrix, it's easy to notice that each cell is the sum of the 3 cells above it * The only exception to ...
ALGO
0.99968
3.14751
cd88f3d7-9c15-4c0d-8358-697bb7cee3f3
JeanGyuHu/Algorithm
괄호 변환/source.cpp
#include <bits/stdc++.h> using namespace std; int isBalanced(string str){ int left =0, right=0; for(char x : str){ if(x=='(') left++; else right++; if(left==right) return left+right; } return 0; } bool isRight(string str){ stack<int> s; if(str[0]!='('...
ALGO
0.999796
6.020298
58defd5b-9fc3-4891-9e13-c650b97936e2
Shaggy0815/SmartMemeMain
src/cryptonote/wild_keccak.cpp
// keccak.c // 19-Nov-11 Markku-Juhani O. Saarinen <<EMAIL>> // A baseline Keccak (3rd round) implementation. #include "wild_keccak.h" namespace crypto { const uint64_t keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x000000008000...
ALGO
0.999756
6.705164
5400bb40-e5ee-466e-8606-16e9060dad7a
Hypervariate/Orchid
Orchid/ThirdParty/Boost/libs/intrusive/example/doc_treap_algorithms.cpp
struct my_node { my_node(int i = 0, unsigned int priority = 0) : prio_(priority), int_(i) {} my_node *parent_, *left_, *right_; int prio_; //other members int int_; }; //Define our own treap_node_traits struct my_treap_node_traits { typedef my_node no...
ALGO
0.99995
6.061162
fed8c65c-b2a2-4560-b3a0-aa5b2cf480ef
MNOWAK1234/PUTcourses
AP/Lab04/RoadsAndLibraries.cpp
#include <bits/stdc++.h> using namespace std; string ltrim(const string &); string rtrim(const string &); vector<string> split(const string &); /* * Complete the 'roadsAndLibraries' function below. * * The function is expected to return a LONG_INTEGER. * The function accepts following parameters: * 1. INTEGER ...
ALGO
0.99986
5.030851
368e8c35-7885-4f83-bf0a-2e8ca3aaa5ec
pankajdaud123/CPP-and-DSA
linkedList/IntersectionLL.cpp
#include<iostream> using namespace std; class Node{ public: int val; Node *next; Node(int data){ val=data; next=NULL; } }; class LinkedList{ public: Node *head; LinkedList(){ head=NULL; } void insertAtTail(int data){ Node *new_node=new Node(data); ...
ALGO
0.999961
4.160501
cf187004-55b9-4a9d-b399-000bfd8d5580
rhino0321/C-plus
C++ Programming/lab10-2.cpp
#include <iostream> #include <fstream> #include <cstdlib> #include <string> using namespace std; void checkspace(int [], int &, string, string&); void display(ofstream &, int [], int, string); int main(int argc, char *argv[]) { char *infile = argv[1]; char *outfile = argv[2]; ifstream in_file(infile); ...
TOOL
0.967046
3.108139
5747531c-5c6e-4932-9fcd-ae89c51bb335
preetijangra15/DSA
Split a Circular Linked List into two halves - GFG/split-a-circular-linked-list-into-two-halves.cpp
//{ Driver Code Starts /* Program to split a circular linked list into two halves */ #include<stdio.h> #include<stdlib.h> /* structure for a Node */ struct Node { int data; struct Node *next; Node(int x){ data = x; next = NULL; } }; void splitList(struct Node *head, struct Node **head1_ref...
ALGO
0.999338
5.508337
da7538ef-0661-445e-88b9-d254c8d4f0b7
DaniyalArteshdar/Kattis-Cpp-Solutions
pieceofcake2.cpp
# Kattis-Cpp-Solutions // Coded by Daniyal Arteshdar #include <iostream> #include <unistd.h> #include <math.h> using namespace std; int main() { int a, b, c ; int th = 4 ; cin >> a >> b>> c ; int aa, bb ; aa = max(b, (a-b)); bb = max(c, (a-c)); cout << (th*aa*bb) ; return 0; }
ALGO
0.999794
3.937819
4e63e0d9-d3e0-4af1-8837-46765780bed9
Jaswanth03-cyber/Competitive-Programming
NeetCode/graphs/hard/sum_of_distances.cpp
#include <bits/stdc++.h> using namespace std ; /* https://leetcode.com/problems/sum-of-distances-in-tree/ */ class graph{ int vertices ; vector<vector<int>> adjlist ; vector<int> dp ; vector<int> height ; vector<int> subordinates ; public: graph(int n){ vertices = n ; adjli...
ALGO
0.999987
5.088607
81eb8d28-0472-48f6-a4b8-a0a0e9f6d6cb
mukuldeep/cs
cp/CodeForces/cdfr_1574A.cpp
/* * Created by me on 20-09-2021. */ #include <bits/stdc++.h> #define Sync ios_base::sync_with_stdio(false); cin.tie(nullptr);pre();ll t=1; I t; #define Dr int main(){Sync W(t)soln(t);return 0;} #define Drt int cc_main(){Sync W(t)soln(t);return 0;} #define F(a,c) for (ll a=0;a<c; a++) #define Fe(a,c) for(ll a=0;a<=c...
ALGO
0.998906
3.298467
ac534495-6b9e-43ef-8d4f-1496fe40655b
ishandutta2007/codeforces
lycmd/normal/839/D.cpp
#include<bits/stdc++.h> #define int long long using namespace std; int const N=1000010,MOD=1000000007; int n,ans,a[N],c[N],f[N],pw[N]; signed main(){ ios::sync_with_stdio(0); cin>>n,pw[0]=1; for(int i=1;i<=n;i++) cin>>a[i],c[a[i]]++,pw[i]=pw[i-1]*2%MOD; for(int i=N-1;i>1;i--){ int s=0; for(int j=i;j<N;j+=i) ...
ALGO
0.999958
3.612342
667ff9b6-d0e1-4e99-b272-21af7e9c489d
COPEL-BigData/opencv
samples/cpp/tutorial_code/features2D/Homography/perspective_correction.cpp
#include <iostream> #include <opencv2/core.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/calib3d.hpp> #include <opencv2/highgui.hpp> using namespace std; using namespace cv; namespace { enum Pattern { CHESSBOARD, CIRCLES_GRID, ASYMMETRIC_CIRCLES_GRID }; Scalar randomColor( RNG& rng ) { int icolor = (unsign...
ALGO
0.995233
6.124301