uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
a73d705a-6cfb-4d2b-a3b6-7a19358ce2c1
grantlj/ImageProcess
FastActionProposal/Ptoolbox/matlab/private/dijkstra1.cpp
/************************************************************************** * Based on ISOMAP code which can be found at http:*isomap.stanford.edu/. * See accompanying m file (dijkstra.m) for usage. *************************************************************************/ /*****************************************...
ALGO
0.999956
5.857064
a5b727a3-53d8-4b5f-8e70-54c764f86f44
youxiao/yxbase
third_party/icu/source/common/bytestrieiterator.cpp
#include "unicode/utypes.h" #include "unicode/bytestrie.h" #include "unicode/stringpiece.h" #include "charstr.h" #include "uvectr32.h" U_NAMESPACE_BEGIN BytesTrie::Iterator::Iterator(const void *trieBytes, int32_t maxStringLength, UErrorCode &errorCode) : bytes_(static_cast<const...
ALGO
0.974725
7.664618
e8a04373-fd52-4cab-aa8f-a1b535e6f29e
ngtranminhtuan/Algorithm-Immediately
04. Stack & Queue/5 [spoj] MMASS - Mass of Molecule_explain.cpp
/* Duyệt từng ký tự trong chuỗi hóa chất: Nếu ký tự đó là chữ ‘C’, ‘H’, hoặc ‘O’ thì bỏ lần lượt số 12, 1, 16 vào stack. Nếu ký tự là số thì lấy phần tử đầu stack ra và nhân với số này, rồi bỏ lại vào trong stack. Nếu ký tự đó là mở ngoặc ‘(‘ thì bỏ vào −1 stack giống ‘C’, ‘H’, ‘O’. Nếu ký tự đó là đóng ngoặc ‘)’ t...
ALGO
0.99986
4.859047
340636cc-8b39-48dd-846b-8153648e15b2
masonarchhsieh/Training_LeetC
1040-maximum-binary-tree-ii/1040-maximum-binary-tree-ii.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.99996
5.983555
1b990a20-dffd-4060-aa37-f62648b4f976
chrisjbris/llvm-3.4
libcxx/test/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until_comp.pass.cpp
// <algorithm> // template<RandomAccessIterator Iter, StrictWeakOrder<auto, Iter::value_type> Compare> // requires CopyConstructible<Compare> // Iter // is_heap_until(Iter first, Iter last, Compare comp); #include <algorithm> #include <functional> #include <cassert> void test() { int i1[] = {0, 0}; ass...
TEST
0.874728
5.27621
c36a626d-56a6-4931-ba06-7d46d7357c77
sarvex/leetcode-kotlin
solution/1600-1699/1619.Mean of Array After Removing Some Elements/Solution.cpp
class Solution { public: double trimMean(vector<int>& arr) { sort(arr.begin(), arr.end()); int n = arr.size(); double s = 0; for (int start = (int) (n * 0.05), i = start; i < n - start; ++i) s += arr[i]; return s / (n * 0.9); } };
ALGO
0.999904
6.106149
8001ee0a-5483-49e2-83c8-d060957fd5ac
iDC-NEU/GeoGauss
src/gausskernel/dbmind/kernel/index_advisor.cpp
#include "postgres.h" #include "access/tableam.h" #include "access/tupdesc.h" #include "catalog/indexing.h" #include "catalog/pg_attribute.h" #include "funcapi.h" #include "nodes/makefuncs.h" #include "nodes/nodes.h" #include "nodes/parsenodes.h" #include "pg_config_manual.h" #include "parser/parser.h" #include "parse...
ALGO
0.991513
7.962531
d4ab41e2-7bb3-416a-956f-1a2e63b65d9c
jk-jung/problem-solving
codeforces/Codeforces Round 61x/R611_div3_B.cpp
#include <string.h> #include <stdio.h> #include <math.h> #include <cassert> #include <set> #include <map> #include <array> #include <stack> #include <queue> #include <vector> #include <numeric> #include <iostream> #include <algorithm> using namespace std; typedef long long ll; typedef pair<int, int> pi; typedef vecto...
ALGO
0.999947
3.895285
c0c64e96-3287-467a-9013-d229e1438bcf
Divyanshu9794/cpp_practice
Interview Prep Dsa question/LinkedList/Reverse a Linked List.cpp
// Reverse a Linked List // The Chef gives you a singly linked list // A // A integers and ask you to help him reverse the list. // Complete the function "listReverse" in the code snippet that takes a single argument: head of the linked list. // Input Format // The first line contains an integer // N // N - represe...
ALGO
0.99995
5.831873
11342f09-fcc5-4013-84c3-aa91c554099b
HexHive/EPOXY-llvm
lib/Transforms/IPO/LowerBitSets.cpp
#include "llvm/Transforms/IPO/LowerBitSets.h" #include "llvm/Transforms/IPO.h" #include "llvm/ADT/EquivalenceClasses.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/Triple.h" #include "llvm/IR/Constant.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Function.h" #include "llvm/IR/GlobalObject.h" #include "llvm...
TOOL
0.909381
7.961289
6fdd277c-7813-48fd-bc37-8061fecd50c2
ScottMackie/DevTraining
C++/Basics/cin.cpp
#include <iostream> std::string string; int var1 = 0; int var2 = 0; int main() { std::cout << "cin is used to input info to ther program from terminal/screen." << std::endl; std::cout << "Input a String, Then Hit Enter" << std::endl; std::cin >> string; std::cout << "Your string was " << string <...
TOOL
0.889846
3.733191
fbb75fac-ff4e-4ed2-baef-758846964a1c
piyaga123/Test3
ConsoleApplication7/ConsoleApplication7/ConsoleApplication7.cpp
// ConsoleApplication7.cpp : Defines the entry point for the console application. // #include "stdafx.h" int Sun3and5(int maxIn) { int sum = 0; for (int i = 1; i < maxIn; i++) { if (!(i % 3) || !(i % 5)) sum += i; } return sum; } int main() { int s = Sun3and5(1000); return 0; }
TOOL
0.986227
3.483932
d4e25fb1-c6af-4d7b-a3ca-5aad4b72cee4
aplqo/exercises
loj/3048-XorDumpling.cpp
#ifdef APTEST #include "debug_tools/judge.h" #endif #include <algorithm> #include <iostream> #include <iterator> #include <queue> const unsigned int maxn = 5e5, maxl = 31; struct ValFrom { unsigned int val, from; }; unsigned int a[maxn + 10]; namespace Trie { struct Node { unsigned int size, from; const Node* ch...
ALGO
0.999996
4.864347
bf67954d-91f4-499a-8b6b-15728fda2bea
xiaojxkevin/cloth-simulation
Coding/src/cloth_simulator.cpp
#include "cloth_simulator.hpp" #include <GLFW/glfw3.h> #include "iostream" #include <omp.h> extern const float timeStep; /// sphere info //#define COLLISION //static glm::vec3 spherePos = { 0.5f, -3.0f, 0.0f }; //static float sphereRadiance = 0.5f; RectClothSimulator:: RectClothSimulator( RectCloth* cloth, fl...
ALGO
0.996281
4.445359
745342ca-a132-431b-876b-e442273365b4
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_7572_8.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; string s; cin >> n; cin >> s; vector<int> div; for (int i = 1; i * i <= n; i++) { if ((n % i) == 0) { div.push_back(i); if (i * i != n) div.push_back(n / i); } } sort(div.begin(), div.end()); for (int i = 0; i < div....
ALGO
0.99998
4.770033
3603042a-f5b2-4ec8-a9f3-825c8ec69ea5
raincross7/code-similarity
codes/train_code/problem410/problem410_430.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define IOS ios_base::sync_with_stdio(0);cin.tie(0) /* start */ signed main(){ IOS; int n; cin >> n; vector<int> next(n + 1), ok(n + 1); for(int i = 0; i < n; i++) { cin >> next[i + 1]; } int ans = 0, now = 1; // start whi...
ALGO
0.999974
3.726579
a1f894b5-fa23-43d8-88b9-7effcecc8f2a
doublecookie2/QCom
src/Main.cpp
#include <iostream> #include "Circuit.h" int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(0); //#define EXP_HADAMARD #define EXP_BELL #ifdef EXP_HADAMARD { Circuit c (3, 0b101); c.Add(new Hadamard(1)); c.Add(new Hadamard(2)); c.Run(); c.Observe(20); } #endif // EXP_HADAMARD #ifdef E...
ALGO
0.997551
4.314833
ee5eb765-40b0-481e-b312-e430d8916f40
sarvex/leetcode-matlab
solution/2400-2499/2475.Number of Unequal Triplets in Array/Solution.cpp
class Solution { public: int unequalTriplets(vector<int>& nums) { unordered_map<int, int> cnt; for (int& v : nums) ++cnt[v]; int ans = 0, a = 0; int n = nums.size(); for (auto& [_, b] : cnt) { int c = n - a - b; ans += a * b * c; a += b; ...
ALGO
0.999969
5.930549
414a01e7-ccab-4964-a6c0-80d47497720e
the-pawns/Non-rigid-ICP-master
toolbox_graph/mex/fheap/fib.cpp
#include "fib.h" #include "fibpriv.h" #include <limits.h> #include <stdlib.h> bool fh_isempty(const struct fibheap* fh) { return fh->fh_n==0; } #define swap(type, a, b) \ do { \ type c; \ c = a; \ a = b; \ b = c; \ } while (0) \ #define INT_BITS (sizeof(int) * 8) static inline int ei...
ALGO
0.978971
3.746126
9ca54453-7dfa-4527-b386-308abc34f12d
nonnnz/noneCode
Contests/Codeforces/871/e2.cpp
#include <iostream> #include <vector> using namespace std; const int MAX_N = 1000; const int MAX_M = 1000; int n, m; int matrix[MAX_N][MAX_M]; bool visited[MAX_N][MAX_M]; int dx[] = {-1, 0, 1, 0}; int dy[] = {0, 1, 0, -1}; bool inBounds(int x, int y) { return x >= 0 && x < n && y >= 0 && y < m; } bool canVisit...
ALGO
0.999965
5.739385
492c9530-64e2-4383-9098-bff94bcd33c9
kooreshakhbari/CSC317
computer-graphics-meshes/libigl/include/igl/unproject_in_mesh.cpp
template < typename Derivedobj> IGL_INLINE int igl::unproject_in_mesh( const Eigen::Vector2f& pos, const Eigen::Matrix4f& model, const Eigen::Matrix4f& proj, const Eigen::Vector4f& viewport, const std::function< void( const Eigen::Vector3f&, const Eigen::Vecto...
ALGO
0.93494
6.341471
cb4dc9f0-2017-4d23-a2ff-1c7c57b9612d
sumitsojha88/Placement-Preparation
Leetcode Solution/Binary Search/Easy/441. Arranging Coins.cpp
class Solution { public: int arrangeCoins(int x) { long long int i=1; long long int j=x; long long int ans=0; while(i<=j) { long long int m=(i-(i-j)/2); long long int prod = m*(m+1)/2; if(prod==x) r...
ALGO
0.999966
5.769257
796531b2-8a59-427a-86b4-f99791c8472b
AlexanderLukashuk/MyRepository
source/homework_STEP/functions/1_hw16.cpp
#include <iostream> using namespace std; int Sum(int argument1, int argument2) { int sum = 0; if (argument1 < argument2) { for (int i = argument1; i <= argument2; i++) { sum += i; } } else { for (int i = argument2; i <= argument1; i++) { ...
TOOL
0.989549
4.064227
9c74415c-785c-40b9-b7f7-0e86191bc093
XifanYu/codeforces
985/F.cpp
#include <iostream> #include <sstream> #include <fstream> #include <string> #include <vector> #include <deque> #include <queue> #include <stack> #include <set> #include <map> #include <algorithm> #include <functional> #include <utility> #include <bitset> #include <cmath> #include <cstdlib> #include <ctime> #include <cs...
ALGO
0.999985
3.329931
246ba85e-20d5-4e6e-8654-699bce3ab531
vishalvatsalya7/cses
Dynamic Programming/Minimizing Coins.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int #define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int main() { fast int n, x; cin >> n >> x; vector<int> a(n); for(auto& w:a){ cin >> w; } vector<int> dp(x+1, x+1); dp[0]=0; for(int i=0;i<n;...
ALGO
0.999978
4.112278
8733cc28-5306-451c-888f-c7e26850f141
memorryy/yagudin-rinat
week4/task1/task1_B/src/main.cpp
#include <iostream> #include <string> #include "../include/ShannonEntropy.hpp" using namespace std; // Функция для форматирования вывода с двумя знаками после запятой void printFormatted(double value) { int integerPart = static_cast<int>(value); int decimalPart = static_cast<int>((value - integerPart) * 100);...
TOOL
0.883377
6.000307
d0ee03da-a4a9-422f-b992-4bcf8224b1eb
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_7821_10.cpp
#include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; long long arr[n]; for (long long i = 0; i < n; i++) { cin >> arr[i]; } long long count = 0; count = arr[n - 1]; long long temp = arr[n - 1]; for (long long i = n - 2; i >= 0; i--) { if (temp > 0) { if (arr[...
ALGO
0.999986
4.104117
381c0b94-b108-4007-83d8-599e91056ee7
sidakwalia/Competitive-coding
codevita/code/bcopy.cpp
#include<iostream> #include<vector> #include<map> #define ull unsigned long long int #define ll long long int #define loop(i,s,e) for(ll i=(s);i<(e);i++) #define rloop(i,s,e) for(ll i=(s);i>=(e);i--) #define scan(any) for(auto &i:any) cin>>i; #define print(any) for(auto i:any) cout<<i<<" ...
ALGO
0.999971
4.075321
c545bd81-74d8-4f7a-ba6d-110bed26c996
abh253/codeforces
contests/#934/D_Non_Palindromic_Substring.cpp
#include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update> ; template<typename T> using ordered_multiset = tree<T...
ALGO
0.999941
4.267272
3a994d71-3146-4b63-9501-c0bcf3605549
alexandraback/datacollection
solutions_2692487_1/C++/MatteoJug/A.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <vector> #include <map> #include <queue> #include <set> #include <algorithm> #include <cassert> #include <string> #include <cstring> using namespace std; typedef long long ll; typedef pair<int,int> ii; typedef vector<int> vi; typedef v...
ALGO
0.99987
3.869417
8e87aa8d-19e9-42eb-b43e-990a4555385c
sarvex/leetcode-zsh
solution/0600-0699/0664.Strange Printer/Solution.cpp
class Solution { public: int strangePrinter(string s) { int n = s.size(); vector<vector<int>> dp(n, vector<int>(n, INT_MAX)); for (int i = n - 1; i >= 0; --i) { dp[i][i] = 1; for (int j = i + 1; j < n; ++j) { if (s[i] == s[j]) { dp[...
ALGO
0.999991
5.479582
466e13c0-e7bb-437d-bb09-04bc99195715
tringholm/Discrete_Riemannian_Gradient_Optimization
DTI denoising/MVIRT-master/include/eigen/lapack/cholesky.cpp
#include "lapack_common.h" #include <Eigen/Cholesky> // POTRF computes the Cholesky factorization of a real symmetric positive definite matrix A. EIGEN_LAPACK_FUNC(potrf,(char* uplo, int *n, RealScalar *pa, int *lda, int *info)) { *info = 0; if(UPLO(*uplo)==INVALID) *info = -1; else if(*n<0) ...
ALGO
0.999672
6.004565
cab0afd2-4e55-46e7-aac9-7a00c12c0ea3
BBBBBbruce/PhysicsSimPro
external_lib/MFEM/mfem-4.3/miniapps/meshing/toroid.cpp
#include "mfem.hpp" #include <fstream> #include <iostream> using namespace std; using namespace mfem; static Element::Type el_type_ = Element::WEDGE; static int order_ = 3; static int nphi_ = 8; static int ns_ = 0; static double R_ = 1.0; static double r_ = 0.2; static double theta0_ = 0.0; ...
ALGO
0.889177
6.182131
bcb60e74-ce45-4196-a836-fa42df757f1b
deepanshuoct12/interviewbit-solution
ibdpwaystodecode.cpp
// #define mod 1000000007 // int helper(string data,int n,vector<int>& memo) // { // if(n==0) // return 1; // int s=data.length()-n; // // cout<<s<<":"<<"\n"; // if(data[s]=='0') // return 0; // if(memo[n]!=-1) // return memo[n]%mod; // int result=helper(data,n-1,memo); // int ...
ALGO
0.999906
5.616517
cceaf6ee-716d-48f6-9f47-c296e7ce097f
harryzhou2000/RBFVFV_EikonalA
MathHard.cpp
#include "Math.h" namespace CfvMath { void EigenLeastSquareInverse(const Eigen::MatrixXd &A, Eigen::MatrixXd &AI) { auto SVDResult = A.bdcSvd(Eigen::ComputeThinU | Eigen::ComputeThinV); AI = SVDResult.solve(Eigen::MatrixXd::Identity(A.rows(), A.rows())); } }
ALGO
0.998109
5.425514
311c39c6-eb33-4ed1-a041-279e5256e810
sakshamjain0464/Data-Structures-and-Algorithms
Stack/medium/reverse_stack.cpp
/* Question - https://www.geeksforgeeks.org/problems/reverse-a-stack/ You are given a stack St. You have to reverse the stack using recursion. Example 1: Input: St = {3,2,1,7,6} Output: {6,7,1,2,3} Explanation: Input stack after reversing will look like the stack in the output. Example 2: Input: St = {4,3,9,6} Outpu...
ALGO
0.999822
5.846968
b9828a88-7356-40cc-8ff5-3f8eacf66a3d
HowLi0/RGDIC
Eigen3/doc/examples/TutorialInplaceLU.cpp
#include <iostream> struct init { init() { std::cout << "[" << "init" << "]" << std::endl; } }; init init_obj; // [init] #include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { MatrixXd A(2,2); A << 2, -1, 1, 3; cout << "Here is the input matrix A before decompositi...
ALGO
0.999762
3.804785
4436c690-57ea-449b-bbb9-9df1827c5ce9
gustavofadel/Exercises
URI/1260.cpp
# include <bits/stdc++.h> using namespace std; # define _ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int t; string s; int main () {_ cin >> t; cout << fixed << setprecision(4); for (int tc = 0; tc < t; tc++) { int cnt = 0; map<string, int> mp; if (tc) { cout << "\...
ALGO
0.998004
3.998529
bc53e3af-bb19-4cd1-903e-afeebd4e8369
rahulseetharaman/leetcode-solutions
snapshot-array/Solution.cpp
// https://leetcode.com/problems/snapshot-array class SnapshotArray { public: unordered_map<int, unordered_map<int,int> >history; unordered_map<int, set<int> >snap_history; int snap_id=0; SnapshotArray(int length) { } void set(int index, int val) { history[index][snap_id]=val...
ALGO
0.966215
6.414717
ab422e1e-4d1e-46c4-b6a7-34ddc334172b
revyos-rocm/llvm-project-rocm
bolt/lib/Rewrite/SDTRewriter.cpp
#include "bolt/Core/BinaryFunction.h" #include "bolt/Core/DebugData.h" #include "bolt/Rewrite/MetadataRewriter.h" #include "bolt/Rewrite/MetadataRewriters.h" #include "bolt/Utils/CommandLineOpts.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Errc.h" #include "llvm/Support/Timer.h" using namespace llvm...
TOOL
0.905075
7.092064
fe005e53-41ef-4797-8d1e-a9f74ec689bf
raincross7/code-similarity
codes/train_code/problem294/problem294_269.cpp
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i,n) for (int i = 0;i < (n);i++) using ll = long long; const ll MOD=1000000007; const double pi=acos(-1); int main() { ll a,b,x; cin>>a>>b>>x; if(2*x<=a*a*b) {cout<<fixed<<setprecision(15)<<atan((double)(a*b*b)/(2*x))*180/pi<<endl; r...
ALGO
0.999653
3.985136
f766b5f2-7f63-40b9-aef4-d714a4a9c73a
Pushti1208/Striver_questions
DP/DP12.cpp
#include<iostream> #include<algorithm> #include<vector> using namespace std; int getMaxPathSum(vector<vector<int> > &matrix){ int n = matrix.size(); int m = matrix[0].size(); vector<vector<int>> dp(n,vector<int>(m,0)); // Initializing first row - base condition for(int j=0; j<m; j++)...
ALGO
0.999973
4.424438
de382ca2-de23-4b6f-a82b-9e646f5b6b9f
axlsdtkl/Question-bank
提高真题/提高2011/luogu 1312 Mayan游戏/1.cpp
#include<bits/stdc++.h> using namespace std; int n,x,a[6][8],ans[6][3],b[6][8],last[6][6][8],flag[6][8]; int check(){ for(int i=1;i<=5;i++){ if(a[i][1]>0)return 0; } return 1; } void update(){ for(int i=1;i<=5;i++){ int cnt=0; for(int j=1;j<=7;j++){ if(a[i][j]==0)cnt+...
ALGO
0.999905
3.373485
f846f3c8-5315-4541-bfec-f17a1178511d
alim-buet/CPCodes
Codes/A_Stair_Peak_or_Neither.cpp
#include<bits/stdc++.h> using namespace std; #define yes cout<<"YES"<<endl; #define no cout<<"NO"<<endl; #define vi vector<int> int main() { int t; cin >> t; while (t--) { int a, b, c; cin >> a >> b >> c; if (a < b && b < c) cout << "STAIR" << endl; else if (a<b...
ALGO
0.999945
4.046378
9d69e350-4a4a-4a03-b836-835852f1493f
ishandutta2007/codeforces
sfiction/normal/1267/J.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> PII; const int MAXN = 2e6 + 10; const int MM = 1e9 + 7; ll pw(ll p, ll q){ ll ret = 1; for (; q; q >>= 1){ if (q & 1) ret = ret * p % MM; p = p * p % MM; } return ret; } int a[MAXN]...
ALGO
0.99981
3.915481
9ffbe29e-d955-46b5-8172-c416062c8425
marqueswill/beecrowd
iniciante/BEE 1040.cpp
#include <iostream> using namespace std; int main() { double n1, n2, n3, n4, n5, media; scanf("%lf %lf %lf %lf", &n1, &n2, &n3, &n4); media = (n1 * 2 + n2 * 3 + n3 * 4 + n4 * 1) / 10; printf("Media: %.1lf\n", media); if (media >= 7) { printf("Aluno aprovado.\n"); } else if (media < 5)...
ALGO
0.999225
4.501209
5e56cd40-e504-4252-bc7b-c0e5f60164b3
limited-sky-3Q3q/ACM
tencent/test4.cpp
/************************************************ * Auther : SR * Date : 2022-04-24 20:29:07 * LastEditTime : 2022-04-24 21:42:56 ************************************************/ #include<cstdio> #include<cstring> #include<algorithm> #include<iostream> #include<string> #include<vector> #include<sta...
ALGO
0.999938
3.978624
4a75b87e-0e14-4bdd-b9f2-7fae37728108
prameetu/CP_codes
Leetcode/167_two_sum2.cpp
#include<bits/stdc++.h> using namespace std; class Solution { public: vector<int> twoSum(vector<int>& numbers, int target) { int n(numbers.size()); int i(0),j(n-1); while(i<j) { int curr_sum(numbers[i]+numbers[j]); if(curr_sum == target) ...
ALGO
0.999894
5.872647
94fe50b9-7892-4137-8004-4d316b30e881
raincross7/code-similarity
codes/train_code/problem426/problem426_12.cpp
#include<iostream> #include<iomanip> #include<math.h> #include<vector> #include<algorithm> #include<set> #include<map> #include<queue> #include<stack> #include<string> #define INF 1000000000ll #define MOD 1000000007ll #define EPS 1e-8 #define REP(i, m) for(long long i=0; i<m; ++i) #define FOR(i, n, m) for(long long i=n...
ALGO
0.99986
3.571607
f830c8c2-e57e-430c-9ee6-ccb03e897aa4
Adarshsingh2k/30-Days-Of-Code
String/MinimumswapsforBracketBalancing.cpp
/* Minimum Swaps for Bracket Balancing Easy Accuracy: 45.04% Submissions: 4172 Points: 2 You are given a string S of 2N characters consisting of N ‘[‘ brackets and N ‘]’ brackets. A string is considered balanced if it can be represented in the for S2[S1] where S1 and S2 are balanced strings. We can make an unbalanced...
ALGO
0.999199
5.933394
7723f517-5d37-4c49-b5df-9c3bd9522bd1
IshratSwarna/Codeforces
cf1335C.cpp
#include<bits/stdc++.h> #define ll long long #define pb push_back #define mkp make_pair #define pii pair<int,int> using namespace std; map<ll,ll>mp; map<ll,ll>mp2; vector<ll>ar; vector<ll>br; int main() { int t; scanf("%d",&t); ll n; ll a,km; ll l1,l2,ans; while(t--) { scanf("%lld",&...
ALGO
0.999858
3.577857
790c3941-e5b8-42fb-8859-d343e8da0b32
emilymryan/LAMMPS-SPH-Source-Code
lib/gpu/lal_lj_class2_long_ext.cpp
/*************************************************************************** lj_class2_long_ext.cpp ------------------- W. Michael Brown LAMMPS Wrappers for COMMPASS LJ long Acceleration _________________________________________...
TOOL
0.930401
4.970931
d1fe7b94-3307-4fcd-9b96-f865a3b1a574
GabMartino/ModularEvo
src/Oscillator.cpp
// // Created by gabriele on 26/06/20. // #include "Oscillator.h" Oscillator::Oscillator(string name){ std::mt19937 gen(rd()); std::uniform_real_distribution<> dis(-1, 1); // Initialize parameteres this->name = name; this->actualState.push_back(dis(gen));//X this->actualState.push_back(dis(ge...
ALGO
0.857783
4.774923
e52608a7-017e-44d5-a981-321e850d3556
DyhaCreator/programming_tasks
informatics/bin_search.cpp
#include <iostream> int main(){ int a[100000]; int N, K; std::cin >> N >> K; for(int i = 0; i < N; i++){ std::cin >> a[i]; } int l = 0, r = N; for(int i = 0; i < K; i++){ int x = 0; std::cin >> x; if(x >= a[0] && x <= a[N - 1]){ l = 0; ...
ALGO
0.999974
4.377613
5c2f97f9-61ca-403a-bc3d-9a29448d6d17
ricardovinicius/competitive-programming
codeforces/2125b.cpp
#include <bits/stdc++.h> #define endl "\n" #define ll long long using namespace std; void solve() { ll a, b, k; cin >> a >> b >> k; if (a <= k && b <= k) { cout << 1 << endl; return; } ll g = gcd(a, b); if (a / g <= k && b / g <= k) { cout << 1 << endl; } else { ...
ALGO
0.999815
4.522482
219be09f-937e-4446-ba27-3989a8c92443
mikity-mikity/KingOfMonsters
kingghidorah/eigen-3.4.0/doc/examples/function_taking_ref.cpp
#include <iostream> #include <Eigen/SVD> using namespace Eigen; using namespace std; float inv_cond(const Ref<const MatrixXf>& a) { const VectorXf sing_vals = a.jacobiSvd().singularValues(); return sing_vals(sing_vals.size()-1) / sing_vals(0); } int main() { Matrix4f m = Matrix4f::Random(); cout << "matrix m:...
ALGO
0.999821
5.283265
e31a1b38-f5f7-457c-87cc-8f1ec3983e87
Elaviers/gcpt
src/shared/commandline.cpp
#include "commandline.h" #include "assert.h" #include "string_utils.h" #include <cstring> static bool s_cmdline_initialised = false; constexpr const int COMMANDLINE_MAX_SZ = 8192; static char s_cmdLine[COMMANDLINE_MAX_SZ]; void CommandLine::Init(const char* commandLine) { StringUtils::strncpy(s_cmdLine, sizeof(s_cm...
TOOL
0.968695
6.093369
209a0e4c-7b8b-4f5f-8c92-9a70e358172b
hitonanode/FujisakiEstimation
src/evaluation/evaluation.cpp
#include "evaluation.hpp" #include <algorithm> #include <string> #include <utility> template<class Type_> using vector = std::vector<Type_>; #include <iostream> namespace stfmest { std::vector<std::pair<FilterType, CommandsCoincidenceResult> > evaluateByDP(const std::vector<FujisakiCommand> &reference_, ...
ALGO
0.987092
5.709414
88a36ada-1665-43aa-9f45-54068f68d816
SayanPal27/Speech-Based-Connect4
gamelogic.cpp
#include<bits/stdc++.h> #include<stdio.h> using namespace std; vector<vector<int>> create_board() { return vector<vector<int>>(6, vector<int>(7, 0)); } void drop_piece(vector<vector<int>>& board, int row, int col, int piece) { board[row][col] = piece; } bool is_valid_location(const vector<vector<int>>& boar...
ALGO
0.999529
5.866167
c4930060-ec60-42e1-a46a-efc34b85a66b
PatilS18/CPP-Applications
Program144.cpp
/* Input : Row : 4 Col : 4 Output : * * * # * * # * # # */ #include<iostream> using namespace std; class Display { public: int i=0,j=0; Display(int iRow,int iCol) { if(iCol != iRow) { cout<<"Invalid input"<<"\n"; r...
ALGO
0.999103
4.696064
93afecd8-a9a0-4918-82f2-b0932cdab446
12750316KUEI/2023aaib3
week16/week16-6.cpp
#include <iostream> #include <vector> using namespace std; int main() { int T,N; cin>>T; for(int t=0;t<T;t++) { cin>>N; vector<int> a(N); for(int i=0;i<N;i++) { cin>>a[i]; } int ans=0; for(int k=0;k<N-1;k++) { for(int i=0;i<N-1;i++) { if(a[i]>a[i+1]) { swap(a[i], a[i+1]); ...
ALGO
0.999894
4.185165
b6c632b5-639a-4035-a5de-506642567f68
alexandraback/datacollection
solutions_2453486_0/C++/howsiwei/a.cpp
#include <fstream> using namespace std; ifstream fin("a.in"); ofstream fout("A.out"); void solve(int case_num) { char a[4][4]; char sym[3] = "XO"; for (int i=0; i<4; ++i) { for (int j=0; j<4; ++j) { fin >> a[i][j]; } } fout << "Case #" << case_num << ": "; for (int i=0; i<2; ++i) { for (int j=0; j<4;...
ALGO
0.999797
3.955754
ba64f4d1-b682-4555-a96f-0688f169c295
CelioFsDev/shared_preferences
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
62a058e3-6ea9-4f97-b45a-ea61b0b5f05d
manishya1669/MyLeetcodeJourney
239-sliding-window-maximum/239-sliding-window-maximum.cpp
class Solution { public: int maximum(vector<int>&nums,int first ,int last){ int maxi = INT_MIN; for(int i = first;i<=last;i++){ maxi=max(maxi,nums[i]); } return maxi; } vector<int> maxSlidingWindow(vector<int>& nums, int k) { priority_queue<pair<int,int>>pq...
ALGO
0.999993
5.853137
c1cda9b7-7f50-40ae-a657-5d13a3410572
wireghoul/sploit-dev
Cryptohaze-Combined/src/GRT_CUDA_host/GRTCandidateHashesNTLM.cpp
#include "GRT_CUDA_host/GRTCandidateHashesNTLM.h" // NTLM will always have length 16 hashes. GRTCandidateHashesNTLM::GRTCandidateHashesNTLM() : GRTCandidateHashes(16) { } // Copy all the various data into the GPU with the needed transfer function void GRTCandidateHashesNTLM::copyDataToConstant(GRTThreadRunData *dat...
TOOL
0.863637
3.357611
95abe281-6e6b-4716-b727-bda1d2886e36
ishandutta2007/codeforces
far_from_noob/normal/295/A.cpp
#include <bits/stdc++.h> #define in long long #define fo(i,n) for(int i=0;i<n;i++) using namespace std; int main() { in n,m,k; cin>>n>>m>>k; in a[n]; fo(i,n)cin>>a[i]; in l[m],r[m],d[m]; fo(i,m)cin>>l[i]>>r[i]>>d[i]; in x[k],y[k]; fo(i,k)cin>>x[i]>>y[i]; in p[m]; fo(i,m)p[i]=0;...
ALGO
0.999965
3.044931
9c498461-67be-4145-9aa1-bbf6d9ec3f2b
Srijith2000/Basic-Cpp-files
Safearray class.cpp
#include<iostream> using namespace std; class safearray { int a[10], limit; public: safearray() : limit(0) { } void input() { cout<<"Enter no of elements : "; cin>>limit; cout<<"Enter elements : "; for(int i=0; i<5; i++) cin>>a[i]; } void putel(int pos,int el) { if(pos>=0 && pos<=limit-1) { for(...
ALGO
0.999436
3.868633
b4e03e2f-9ddf-4b1d-966b-97e44d410836
Coach-Academy/Summer-2-2024
Level 1/CPU - Standard - L1 - C106/Practice G4/Week 06/C.cpp
#include<bits/stdc++.h> #define ll long long using namespace std ; void reverseString(string &s){ int n = s.size() ; for(int i=0 ; i<n/2 ; ++i){ swap(s[i] , s[n-i-1]) ; } } int main(){ string s1 , s2 ; cin >> s1 >> s2 ; // reverse(s1.begin() , s1.end()) ; reverseStr...
ALGO
0.999987
3.905696
8e8198fe-dbeb-4054-9f5d-1111b294af3a
daikidaiku/procon-archive
atcoder.jp/abc218/abc218_b/Main.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) #define rep2(i,x,n) for(int i=x; i<(n); i++) #define all(...) begin(__VA_ARGS__), end(__VA_ARGS__) #define rall(...) rbegin(__VA_ARGS__), rend(__VA_ARGS__) struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; const long l...
ALGO
0.999872
4.029943
beca8d0c-086e-4871-8a78-bfbb1adc61f5
oymisaki/Cpp-Notes
cpp/LongestPalindrome.cpp
#include <string> #include <vector> #include <algorithm> #include <iostream> #include <iterator> #include <sstream> using namespace std; string longestPalindrome(string s) { const int size = s.size(); int max_len = 1; int b = 0, e = 0; for(int i = 0; i < size; ++i) { for(int r: {i, i+1})...
ALGO
0.999739
4.876134
6ce81211-63f1-4fc8-9ec8-280b9333bc57
sarvex/leetcode-matlab
solution/1000-1099/1037.Valid Boomerang/Solution.cpp
class Solution { public: bool isBoomerang(vector<vector<int>>& points) { int x1 = points[0][0], y1 = points[0][1]; int x2 = points[1][0], y2 = points[1][1]; int x3 = points[2][0], y3 = points[2][1]; return (y2 - y1) * (x3 - x2) != (y3 - y2) * (x2 - x1); } };
ALGO
0.999948
6.300484
8bd9d81c-0f03-44c3-a040-3a730ec92dbc
hs-krispy/BOJ
Rank.cpp
// // Created by 0864h on 2021-01-26. // #include<iostream> #include<algorithm> using namespace std; int N, rk[500001]; int main() { cin >> N; for(int i = 1; i <= N; i++) cin >> rk[i]; sort(&rk[0], &rk[N + 1]); long long Min = 0; for(int i = 1; i <= N; i++) { Min += abs(i - rk[i]...
ALGO
0.999932
3.928836
c2f2561d-7bf2-48ef-9248-1a15e6227ce4
bmharper/xo
examples/SplineDev.cpp
#include "../xo/xo.h" #include <omp.h> // This was used when developing the spline rendering code void Render(xo::Canvas2D* canvas, int cx, int cy, float scale); void xoMain(xo::SysWnd* wnd) { int left = 550; int width = 1000; int top = 60; int height = 1000; wnd->SetPosition(xo::Box(left, top, left + width, t...
ALGO
0.987835
4.545041
73f3c09c-7263-4d88-b1a7-ec2c0e013708
pankajazad/sem1lab
2DAG/dag.cpp
#include "dag.h" Dag::Dag(int vertices) { numberOfVertices = vertices; numberOfEdges = 0; adjList = new list<int>[numberOfVertices]; colorList = new char[numberOfVertices]; } Dag::~Dag() { delete adjList; delete colorList; } bool Dag::addEdge(int src, int dst) { bool ret = false; if( src < numberOfVertice...
ALGO
0.99686
5.146192
e60879d6-be52-48ed-879d-c8e564f6695d
KushPulkit/FOCP_2_lab
Practice Assignment 3/ques3.cpp
//Write a function int reverseNumber(int n) that returns the reversed version of a given number. #include<iostream> using namespace std; int reverseNumber(int n){ int d,flag=0; while(n!=0){ d=n%10; flag=flag*10+d; n=n/10; } return flag; } int main(){ int n; cout<<"Enter number: "; cin>>n...
ALGO
0.999448
4.507868
cf8a7b77-2d44-450f-951e-77c823e3f9df
SadmanHafizShuvo21/codeforces
A_Max_and_Mod.cpp
#include <bits/stdc++.h> using ll = long long; void solve() { int n; std::cin >> n; if (n % 2 == 0) { std::cout << "-1\n"; return; } std::vector<int> p(n); for (int i = 0; i < n; i++) { p[i] = i + 1; } std::rotate(p.begin(), p.end() - 1, p.end()); for (int...
ALGO
0.999778
5.914351
72c6b46b-0889-425f-b535-079c4d1caa68
rithika1503/File_Compressor
Decoding.cpp
#include <iostream> #include <string.h> #include <malloc.h> #include "compression.h" using namespace std; codeTable *codelist; int n; char *decodeBuffer(char buffer); char *int2string(int n); int match(char a[],char b[],int limit); int fileError(FILE *fp); int main(int argc, char** argv) { FILE *fp,*outfile; ...
ALGO
0.956936
3.636783
af947fea-dc5d-4f9e-a9ff-e2cff0aad611
papavlusha/operating-systems
Os_lab5/Server/Server.cpp
#include <process.h> #include <windows.h> #include <iostream> #include <fstream> #include <time.h> #include <conio.h> #include <algorithm> #include <string> #include "../Contracts/Employee.h" int empCount; employee* emps; HANDLE* handleReadyEvents; CRITICAL_SECTION empsCS; bool* empIsModifying; int employeeSize = siz...
TOOL
0.924849
3.956153
233628a9-15c2-4b4c-9150-8c49e5a9a109
xxfruitVT/PAB-2
daftar_belanja/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.998555
6.76073
c3d2a83a-8a94-4ac5-9582-3ee21f02ce26
nishitm/c0de
add_two_no_using_list.cpp
struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) { ListNode *head; ListNode *current = new ListNode(0); head = current; int carry=0; while(l1 || l2) { current->val=carry; ...
ALGO
0.999778
5.246266
ffca5395-ea6a-47ab-8603-f5f4087cd46f
sarantinio/Torcs-Racing
ToxicRacing-Computational Intelligence/hyperneat/MultiNEAT-master/src/NeuralNetwork.cpp
/////////////////////////////////////////////////////////////////////////////// // File: Phenotype.cpp // Description: Implementation of the phenotype activation functions. /////////////////////////////////////////////////////////////////////////////// #include <math.h> #include <float.h> #include <fstream> #in...
ALGO
0.99429
7.088977
7b0174d0-1178-48d0-963f-bb1d1ee87187
SaiTp/LeetCode-Codes
2284-sender-with-largest-word-count/2284-sender-with-largest-word-count.cpp
class Solution { public: string largestWordCount(vector<string>& messages, vector<string>& senders) { int n=messages.size(); string res; unordered_map<string,int>mp; for(int i=0;i<n;i++) { string t; int c=0; stringstream ss(messages[i]); ...
ALGO
0.999929
6.431504
660625c4-9d47-4ca6-9ba2-03e64dfe6619
qpwoeirut/competitive-programming
USACO/practice/GoldMarathon/Jan2018/spainting.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MN = 1000005; const ll MOD = 1e9 + 7; ll N, M, K; ll dp[MN]; ll psum[MN]; ll binpow(ll a, ll x) { ll ret = 1; while (x) { if (x & 1) ret = (ret * a) % MOD; a = (a * a) % MOD; x >>= 1; } return ret;...
ALGO
0.999989
4.506296
050595a3-717c-4e4e-b4c8-cf10b640e008
BinomialSheep/CompetitiveC--
AtcoderProblems/典型90/04_CrossSum.cpp
#include <bits/stdc++.h> // デバッグ用マクロ:https://naskya.net/post/0002/ #ifdef LOCAL #include <debug_print.hpp> #define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__) #else #define debug(...) (static_cast<void>(0)) #endif using namespace std; using ll = long long; using vi = vector<int>; using vl = vector<lo...
ALGO
0.999884
3.597713
ec2108d8-aa88-43be-abfb-999bc9906c41
yunxinzhang/algForRec
00_leetcode/023_merge_k_sorted_lists/test.cpp
#include <iostream> #include <vector> #include <queue> struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; using namespace std; class Solution { public: struct cmp{ bool operator()(pair<ListNode*,int> a, pair<ListNode*,int> b){ return a.first->val > b.first->val...
ALGO
0.999931
5.159342
3ff2fc98-1fb8-41ad-98a4-e16422356535
ishandutta2007/codeforces
used-fft/normal/1615/D.cpp
#include <bits/stdc++.h> using namespace std; #define int long long const int LIM = 2e5+1, INF = 2e9; struct UFDS{ vector<int> e; int operator()(int u){ return e[u] < 0 ? u : e[u] = (*this)(e[u]); } void operator()(int u, int v){ u = (*this)(u), v = (*this)(v); if(u==v) return; if(e[u] > e[v]) swap(u, v);...
ALGO
0.999923
5.246551
8496e916-c3bd-435d-a3b1-112497305026
raincross7/code-similarity
codes/train_code/problem013/problem013_77.cpp
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; typedef long long ll; const int maxn=100005,maxm=400005; int last[maxn],pre[maxm],other[maxm],t,cal[maxn],vis[maxn],q[maxn],head,tail; void add(int x,int y){++t;pre[t]=last[x];last[x]=t;other[t]=y;} int main()...
ALGO
0.99984
3.450218
a6beada5-d5ee-47f4-af7f-f6ddbc5e7b79
chakitg/cp_solutions
leetcode-potd/139. Word Break.cpp
Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words. Note that the same word in the dictionary may be reused multiple times in the segmentation. Example 1: Input: s = "leetcode", wordDict = ["leet","code"] Output: tr...
ALGO
0.99965
6.098083
56843d67-18f2-4804-bc0c-62ac56abdece
pradeep7G/DSA-CPP
Merge K sorted linked lists - GFG/merge-k-sorted-linked-lists.cpp
// { Driver Code Starts // C++ program to merge k sorted arrays of size n each #include <bits/stdc++.h> using namespace std; // A Linked List node struct Node { int data; Node* next; Node(int x){ data = x; next = NULL; } }; /* Function to print nodes in a given linked list */ void printList(Node* no...
ALGO
0.999887
5.35939
56c000fe-ed67-4533-b5b2-938575c8859d
zod331/Summit
extras/collision/extractor/stormlib/SFileFindFile.cpp
/*****************************************************************************/ /*---------------------------------------------------------------------------*/ /* A module for file searching within MPQs */ /*---------------------------------------------------------------------------*/...
TOOL
0.878155
5.866652
8cb4df75-62f4-4fe4-9de3-46cba9e594e6
UtkarshGupta12/InterviewBit
Linked List/remove-nth-node-from-list-end.cpp
#include <iostream> #include <string> #include <bits/stdc++.h> #define M 1000000007 using namespace std; struct Node { int data; Node *next;}; void printList(Node* n) { while (n != NULL) { cout << n->data << " -> "; n = n->next; }} void push(Node** head_ref, int new_data) { /* 1. ...
ALGO
0.999627
4.346791
a045a48b-45bd-437e-b21a-05b7b856c5a3
raincross7/code-similarity
codes/train_code/problem120/problem120_140.cpp
//Be Name Khoda, Besmellah Rahmane Rahim, In The Name Of God; //#include<bits/stdc++.h> #include<iostream> #include <vector> #include <algorithm> #include <cmath> #include <set> #include <queue> #include <deque> #include <map> #include <stack> #include<bitset> #include<list> #include<cassert> #include<numeric> #include...
ALGO
0.999987
4.487879
79815a67-7ad7-4946-b691-06bbdd670b2e
vfolunin/archives-solutions
LeetCode/3260.cpp
class Solution { vector<int> getPowerOfTenMod(int targetSize, int divisor) { vector<int> powerOfTenMod(targetSize + 1); powerOfTenMod[0] = 1 % divisor; for (int size = 1; size <= targetSize; size++) powerOfTenMod[size] = powerOfTenMod[size - 1] * 10 % divisor; return powe...
ALGO
0.999898
6.382708
e2ba0880-ae98-4342-9546-c88ff7a6b0bc
voucher-coin/voucher-coin
src/swifttx.cpp
#include "swifttx.h" #include "activemasternode.h" #include "base58.h" #include "key.h" #include "masternodeman.h" #include "net.h" #include "obfuscation.h" #include "protocol.h" #include "spork.h" #include "sync.h" #include "util.h" #include "validationinterface.h" #include <boost/lexical_cast.hpp> using namespace ...
TOOL
0.986757
6.250026
9c9ae4d3-2b79-4baa-92cf-176d8a345fb2
abhijeet141/Leetcode-DSA-Question
SLIDING-WINDOW/FIXED-SIZE/PROBLEM2 - First -ve Integer In Every Window/Sliding_Window.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; vector<int>ans; queue<int>q; int *a = new int[n]; for (int i = 0; i < n; i++) { cin>>a[i]; } int k; cin>>k; int i = 0, j = 0; while(j<n){ //calculation if(a[j]<0){ ...
ALGO
0.999982
3.635326
36b159fd-cf60-409e-bb4b-83a46f63d49e
RaulitoGC/competitive-programming
online-training-platform/algoexpert/invert-binary-tree/invert-binary-tree.cpp
#include <vector> using namespace std; class BinaryTree { public: int value; BinaryTree *left; BinaryTree *right; BinaryTree(int value); void insert(vector<int> values, int i = 0); void invertedInsert(vector<int> values, int i = 0); }; // Time : O(n) // Space: O(n) void invertBinaryTree(BinaryTree *tree)...
ALGO
0.999966
5.767437
fb755c43-5123-4df7-bdb2-c877de9554ec
dlwsdqdws/Matching-APP
central.cpp
#include <iostream> #include <cstdio> #include <stdlib.h> #include <unistd.h> #include <cstring> #include <netinet/in.h> #include <sys/socket.h> #include <arpa/inet.h> #include <sys/wait.h> #include <vector> #include <fstream> #include <sstream> #include <unordered_map> #include <unordered_set> #include <map> #include ...
WEB
0.880793
3.497855
0def6ba0-90d0-4dfa-af6c-9016eeeb289a
ishandutta2007/codeforces
enchom/normal/1326/D2.cpp
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; typedef unsigned long long ullong; typedef long long llong; llong B1 = 127LL; ullong B2 = 37ULL; llong MOD = 1000000009LL; llong B1Pows[1000111]; ullong B2Pows[1000111]; struct hashPair { pair<llong, ullong> H1 = make_pair(0, 0), H2 ...
ALGO
0.999974
3.929056
7309020f-2ff7-4d2a-b940-176d47afd3c9
TranAnhQuoc23521313/UIT_HOMEWORK_FUNCTION
23520335_BT02/Bai041/41.cpp
#include<iostream> #include<cmath> using namespace std; float tong(int n); int main() { int n; cin >> n; cout << tong(n); return 0; } float tong(int n) { float s = 0; int i = 1; while (i <= n) { s += i * (i + 1) * (i + 2); i++; } return s; }
ALGO
0.999868
3.975735
94a2929f-a470-488c-b442-5ac1cf110a23
LukeLIN-web/LeetCode
linklist/MyLinkedList.cpp
class MyLinkedList { public: /** Initialize your data structure here. */ struct Node { int val; Node *next; Node(int val):val(val),next(nullptr){} }; MyLinkedList() { dummy = new Node(0); size = 0; } /** Get the value of the index-th node in ...
ALGO
0.999887
5.498486