uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
10e8c89e-a3bb-4425-861a-6ee1eb77d277
Rachit2912/Cpp-Codes
038 Recursion 8.cpp
#include <iostream> #include <string> #include <vector> using namespace std; // letter combinations of a keypad phone no. /* jese ki agar hm 23 type krenge on the the keypad phone then usse following combinations bn skte h : ad,ae,af,bd,be,bf,cd,ce,cf isme same hi approach hi use krni h jo hm inclusion - exclusion wa...
ALGO
0.999549
6.028832
c3de91d4-1204-42db-a9b2-f546fd2c9dbc
jayiuk/cpp_study
src/cpp_study10.cpp
#include <iostream> using namespace std; int main(){ int num1 = 8; int num2 = 8; int num3 = 8; num1 = num2 + 5; num2 += 5; num3 =+ 5; cout << "연산자에 의한 결과값 : " << num1 << endl; cout << "+= 연산자에 의한 결과값 : " << num2 << endl; cout << "=+ 연산자에 의한 결과값 : " << num3; return 0; }
TOOL
0.954037
3.372062
e69d0dba-b2fe-4885-99ad-bac9ebeee932
ifferreira/m08
parte1-navegacao-com-ros/workspace/src/maze_solver/src/maze_solver.cpp
#include <iostream> #include <vector> #include <queue> #include <memory> #include <cmath> #include <thread> #include "rclcpp/rclcpp.hpp" #include "cg_interfaces/srv/get_map.hpp" #include "cg_interfaces/srv/move_cmd.hpp" class AStarSolver : public rclcpp::Node { public: AStarSolver() : Node("a_star_solver") { ...
ALGO
0.994602
4.567554
5021a79c-9a2f-48b3-8d1a-8620d77ab8aa
meinanzi/yygame
cocos2d/cocos/platform/win32/CCFileUtils-win32.cpp
#include "platform/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 #include "CCFileUtils-win32.h" #include "platform/CCCommon.h" #include <Shlobj.h> #include <cstdlib> #include <regex> using namespace std; NS_CC_BEGIN #define CC_MAX_PATH 512 // The root path of resources, the character encoding is...
TOOL
0.909563
6.006353
b2e600ea-de8b-4d04-8b65-df817059f878
tykr0001/algorithm
codeforces/educational/105/a.cpp
/********* github.com/tykr0001/algorithm *********\ *$*$*$*$*$*$*$*$*$*$*$*$*$*$*$*$*$*$*$*$*$*$*$*$*$* *$* *$* *$* |||||||| || || || ||| ||||||| *$* *$* || || || || ||| || || *$* *$* || || ||| ||||||| *$* *$* ...
ALGO
0.999865
5.723695
fd184023-dfde-42c2-b100-9a6689e3ecac
Gautumn/CodingInterviewChinese2-Xcode
32_03_PrintTreesInZigzag/32_03_PrintTreesInZigzag/main.cpp
//================================================================== // 《剑指Offer——名企面试官精讲典型编程题》代码 // 作者:何海涛 //================================================================== // 面试题32(三):之字形打印二叉树 // 题目:请实现一个函数按照之字形顺序打印二叉树,即第一行按照从左到右的顺 // 序打印,第二层按照从右到左的顺序打印,第三行再按照从左到右的顺序打印, // 其他行以此类推。 #include <cstdio> #include "Bi...
ALGO
0.99889
5.070228
2d451987-8c06-408c-b42c-1d4477ad52c6
Jamiyansuren1020/Dart-Project
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
29de3a99-f98a-4e85-8373-0eb601bc464c
Alok-kumar-Maurya/codes
1249c.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define PI 3.1415926535897932384626 typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<pii> vpii; typedef vector<vi> vvi; #define debugxy(x, y) cout << "[ " << x << " " << y << " ]" << endl #define debugx(x) cout << "[ " << x << " ]" <...
ALGO
0.99947
3.99514
c3931eb0-6501-4db8-8322-6461f0243366
Gonzml1/Boundary
codigos_cpp/mandelbrotfast.cpp
#include <complex> #include <vector> #include <windows.h> #include <cstdlib> #include <omp.h> // OpenMP extern "C" { __declspec(dllexport) int* mandelbrotfast( double xmin, double xmax, double ymin, double ymax, int width, int height, int max_iter ) { int* __restrict M = new int[width ...
ALGO
0.998727
5.386106
59a791bf-fc64-44a7-8fc8-408a451fc99c
kks227/BOJ
2700/2745.cpp
#include <cstdio> using namespace std; int main(){ char N[31]; int B, result = 0; scanf("%s %d", N, &B); for(int i=0; N[i]; i++) result = result*B + N[i] - (N[i]<='9' ? '0' : 'A'-10); printf("%d\n", result); }
ALGO
0.999037
3.767558
c967a0e4-0b8b-4487-b915-bdcd9aa5a214
ericbrandwein/competencias
Codeforces/1374/e1/e1.cpp
//#pragma GCC optimize("Ofast") //#pragma GCC optimize("unroll-loops,no-stack-protector") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> #define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0) #define endl '\n' #define elif else if #define ll long long i...
ALGO
0.999836
3.728075
4593dadb-1ca1-4684-8a8d-620f01e1c3a5
sjamthe/CarND-Path-Planning-Project
src/Eigen-3.3/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType.cpp
MatrixXd X = MatrixXd::Random(5,5); MatrixXd A = X + X.transpose(); cout << "Here is a random symmetric 5x5 matrix, A:" << endl << A << endl << endl; SelfAdjointEigenSolver<MatrixXd> es(A); cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl; cout << "The matrix of eigenvectors, V, is:" << endl << ...
ALGO
0.999389
3.056724
3a8e4db8-f076-48c7-91c9-d442c2c03a72
AanyaPanigrahi/LC_Solutions
2089-maximum-matrix-sum/maximum-matrix-sum.cpp
class Solution { public: long long maxMatrixSum(vector<vector<int>>& matrix) { long long ans = 0; int min_num = INT_MAX; int neg = 0; for (auto i : matrix) { for (int j : i) { if (j < 0) neg++; min_num = min(min_num, ab...
ALGO
0.999997
6.026865
ecbd2249-9f91-432e-85bb-effb1f268636
DronovITSTEP/Practic22.04.2024
Practic22.04.2024/Array.cpp
#include "Array.h" Array::Array(int size) : arr{ new int[size] }, size{size} {} Array::Array() :arr{ nullptr }, size{ 0 } {} Array::Array(const Array& obj) : arr{ new int[obj.size] }, size{ obj.size} { forArray(size) { this->arr[i] = obj.arr[i]; } } Array::~Array(){ delete[] arr; } Array& Array::setSize(int size...
TOOL
0.988912
4.497669
6f9f53ea-a7da-423c-a8b9-9f1bb998fb5a
ttl2075-stu/COMP267
T1 - Các thành phần cơ bản/T1_tinhKhoangCanhAB.cpp
#include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { short int x1,y1,x2,y2; cin >> x1 >> y1 >> x2 >> y2; cout << fixed << setprecision(2) << sqrt(pow(x1-x2,2)+pow(y1-y2,2))*5; }
ALGO
0.998593
3.430378
189ecdc2-6181-45e2-8a1a-abb6e3641f6c
HasanOma/cpp
oving4/oppg1/main.cpp
#include <vector> #include <iostream> #include <algorithm> using namespace std; int main(){ vector<double> vec{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}; cout << "Front of list: " <<vec.front() << endl; cout << "Back of list: " <<vec.back() << endl; vec.emplace(vec.begin()+ 1, 8.0); co...
ALGO
0.984841
3.993892
9b823013-0f4d-4cb7-a527-cb7bfaafce5e
gmh5225/OLLVM-test-goron-10
libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp
// <vector> // template <class InputIter> vector(InputIter first, InputIter last, // const allocator_type& a); #include <vector> #include <cassert> #include <cstddef> #include "test_macros.h" #include "test_iterators.h" #include "test_allocator.h" #include "min_allocator.h" #include...
TEST
0.912986
7.072237
487b0c72-002d-408e-bf1f-74c0109d0564
pvl-marci/FreshAlert
Arduino/Export/FreshAlert_inferencing/src/edge-impulse-sdk/dsp/dct/fast-dct-fft.cpp
#include <math.h> #include <stdint.h> #include <stdlib.h> #include "fast-dct-fft.h" #include "../returntypes.hpp" #include "../numpy.hpp" #include "../memory.hpp" #ifndef M_PI #define M_PI 3.14159265358979323846264338327950288 #endif // M_PI // DCT type II, unscaled int ei::dct::transform(float vector[], size_t len) ...
ALGO
0.983451
5.397264
7c76f8dc-fa28-4090-8372-e93b1db604be
YvesChan/codebak
POJ 1028 模拟栈操作.cpp
#include<cstdio> #include<cstring> int main() { int n = 0,p = 0; char a[110][80],t[100]; while(gets(t) && t[0]!='Q'){ if(t[0] == 'V'){ for(int i = 6;i <= 75;i ++) a[p][i-6] = t[i]; p ++; n = p; } if(t[0] == 'B')p --; if(t[0] == 'F')p ++; if(t[0] == 'Q')return 0; if(p == 0)printf("http://www....
ALGO
0.97102
3.043334
a091ec3c-0368-4f69-b175-292692f46aad
netanel0909/Cses
1068.cpp
#include<string> #include<iostream> #include<vector> #include<algorithm> #define MAX 10000000007 int main() { int n; std::cin >> n; std::cout << n; while (n != 1) { if (n % 2 == 0) n /= 2; else n = 3 * n + 1; std::cout << n << " "; } return 0; }
ALGO
0.999979
4.792006
3dce4053-9c6b-48dd-a413-37a2ef5b4790
ishandutta2007/codeforces
ei133333/normal/845/A.cpp
#include <bits/stdc++.h> using namespace std; int main() { int N, A[200]; cin >> N; for(int i = 0; i < 2 * N; i++) { cin >> A[i]; } sort(A, A + 2 * N, greater< int >()); for(int i = 0; i < N; i++) { if(A[i] <= A[N]) { cout << "NO" << endl; return (0); } } cout << "YES" << endl;...
ALGO
0.999991
3.7173
22feee60-26b8-4003-8953-9b6a7c514d85
algprasad/localization_boat_assisted
ThirdParty/Eigen/bench/quat_slerp.cpp
#include <iostream> #include <Eigen/Geometry> #include <bench/BenchTimer.h> using namespace Eigen; using namespace std; template<typename Q> EIGEN_DONT_INLINE Q nlerp(const Q& a, const Q& b, typename Q::Scalar t) { return Q((a.coeffs() * (1.0-t) + b.coeffs() * t).normalized()); } template<typename Q> EIGEN_DONT_INL...
ALGO
0.993195
6.251058
22cce8c4-b08f-46a1-a47d-f9fb7c0f344f
thermotools/lammps_mie_fh
lib/gpu/lal_coul_dsf_ext.cpp
/*************************************************************************** coul_dsf_ext.cpp ------------------- Trung Dac Nguyen (ORNL) Functions for LAMMPS access to coul/dsf acceleration routines. __________________________...
ALGO
0.932384
5.670385
5955a13e-c33a-456f-925f-b145afa8d8e8
Guru2113/first
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
7bd4b553-71cb-4ab0-9967-3e1f9fd7dce0
Homaira-Jahan128/Codeforces_problem_solve
A_Increasing_Sequence.cpp
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); int t,n; cin>>t; while(t--){ cin>>n; int a[n],b[n]; for(int i=0;i<n;i++) cin>>a[i]; int max=0,x=0; for(int i=0,j=1;i<n;i++,j++){ ...
ALGO
0.999937
3.881452
628ca65a-b915-4582-b5c8-803513884869
Rakibul-CoU/ALGORITHM
Prime Number/Primality test- Miller-Rabin.cpp
#include<bits/stdc++.h> ///...................................*****................................................./// /// Author : MD. Rakibul Islam ( <EMAIL> ) /// /// Department of Computer Science /// /// & En...
ALGO
0.996546
4.867306
690b5bb4-9d23-4367-9d98-5a479529ebd1
ugozapad/xray-2212
xrLC/xrPhase_MergeLM.cpp
#include "stdafx.h" #include "build.h" #include "lightmap.h" #include "xrPhase_MergeLM_Rect.h" // Surface access extern void _InitSurface (); extern BOOL _rect_place (L_rect &r, lm_layer* D); IC int compare_defl (CDeflector* D1, CDeflector* D2) { // First - by material u16 M1 = D1->GetBaseMaterial(); u16 M2 ...
TOOL
0.959139
3.76481
0c6c9dac-2027-4d73-af60-bb7dd63895fb
Agasthya-Samyak-Jnan/LeetCode-Problems
Easy/Number of Common Factors.cpp
#include<bits/stdc++.h> #include<algorithm> using namespace std; // Link to the Problem : https://leetcode.com/problems/number-of-common-factors/ // Difficulty : Easy /* Time Complexity: O(min(a,b)) */ class Solution { public: int commonFactors(int a, int b) { int i=1, n = min(a,b),c=0; while (i<...
ALGO
0.999765
5.941658
f28a0ba0-d30f-4f8c-bbcd-7b9b3d06c155
ishandutta2007/codeforces
a_g/normal/1675/D.cpp
#include <bits/stdc++.h> using namespace std; const int N = 2e5+5; vector<int> children[N]; vector<vector<int>> paths; void dfs(int v) { int c = children[v].size(); if (!c) { paths.emplace_back(1, v); return; } for (int u: children[v]) { dfs(u); } paths.back().push_back(v); } int main () { ...
ALGO
0.999854
4.785447
8882cc47-ba11-42b6-bc17-89299f4a6bb9
samardzzziska/FINKI
Структурно програмирање/Втор колоквиум/Exercises for second midterm and exams/zad4.cpp
/* Write a program that will read unknown number of three integers, and for each triple (a, b, c) * will print the number (a or b) that contains the digit c more times on even positions (the positions are counted from right to left, and the first position is 1). */ #include <iostream> #include <cstring> #include <cmat...
ALGO
0.999956
3.956229
660d9802-ab3c-40e7-965b-6b97eaf6a6ba
GuiZ88/dilbert-cascade-classifier
opencv-3.4.19/samples/gpu/farneback_optical_flow.cpp
#include <iostream> #include <vector> #include <sstream> #include <cmath> #include "opencv2/core.hpp" #include "opencv2/core/utility.hpp" #include "opencv2/highgui.hpp" #include "opencv2/video.hpp" #include "opencv2/cudaoptflow.hpp" #include "opencv2/cudaarithm.hpp" using namespace std; using namespace cv; using name...
ALGO
0.969336
5.784028
ab95925a-9460-4d0c-9258-f1ad36b9ba61
SakiBee/CPU-Scheduling-Algorithms
FCFS with Arrival.cpp
#include <bits/stdc++.h> using namespace std; const int N = 100; int tq, at[N], bt[N], rem_bt[N], temp[N], ct[N], tat[N], wt[N], p[N], n; int32_t main () { int n; cin >> n; for (int i = 0; i < n; i++) cin >> bt[i]; for (int i = 0; i < n; i++) cin >> at[i]; for (int i = 0; i < n; i++) cin >> p[i]; vector...
ALGO
0.999862
3.591698
dc80c0fa-14a8-4ac4-bf9f-2c958ee2c0d9
DraSoGo/Competitive_Programming
Other/0283_Polynomail.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); long long n,a,b,c,x1,x2,k,l,r,mid,co; cin >> n; while (n--) { cin >> a >> b >> c >> k; l = 0;r = 1e7; while (l <= r) { mid = (l+r)/2; if...
ALGO
0.999931
3.341455
d37d1e5e-2bb9-4581-bb59-cbb8e5e29e60
sailor-ux/repo2
leetcode_vscode/leetcode_216/leetcode_216.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: vector<vector<int>> combinationSum3(int k, int n) { vector<int> combination; vector<vector<int>> combinations; dfs(combination, combinations, k, n); return combinations; } void dfs(vector<int>...
ALGO
0.999964
6.475215
4822e391-33e7-4362-af6b-0bc5c70912ff
AdvTrainEvalSrcDomain/adv-train-evaluation-source-code-domain
code-imitator/data/dataset_2017/dataset_2017_8_formatted_macrosremoved/evgenstf/5304486_5760761888505856_evgenstf.cpp
#include <algorithm> #include <iostream> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; const int dd = 1e6; const int inf = 1e9 + 7; const double eps = 1e-8; multiset<ll> dt; int main() { //#ifdef _DEBUG freopen("input.txt", "r", stdin); freopen("output.txt", "...
ALGO
0.999851
4.48552
01332e99-fd38-41fb-8a7d-b8822a9970fc
DuyMinh0102/My_Work
15 7/smithnum/main.cpp
#include <bits/stdc++.h> using namespace std; bool prime(long long x){ if (x <= 1){ return false;} if (x <= 3){ return true;} if (x %2 == 0){ return false;} for (long long i = 3; i <= sqrt(x); i+=2){ if (x%i == 0){ return false;} } return true; } int tongchuso(long long x){ long ...
ALGO
0.999865
4.645107
1f680c15-0ee1-449a-9c99-778f84b57586
jlallas384/ioi-solutions
2015/d1/teams/teams.cpp
#include <bits/stdc++.h> #include "teams.h" using namespace std; vector<pair<int,int>> seg; void init(int N, int A[], int B[]) { for(int i = 0; i < N; i++){ seg.emplace_back(A[i], B[i]); } sort(seg.begin(), seg.end()); } int can(int m, int K[]) { vector<int> k; for(int i = 0; i < m; i++){ k.push_back(K[i]); ...
ALGO
0.999602
4.207174
5231ba74-1b0a-4859-a6da-f6421e7158d7
imdevshiv/C_PLUS_PLUS
c++/MULTI.CPP
#include<iostream> using namespace std; class Matrix { int a[3][3]; int b[3][3]; int c[3][3]; int i,j,k; public : void InputMatrix(); void Multi(); void OutputMatrix(); }; void Matrix::InputMatrix() { cout<<"Enter the element for first Matrix: \n"; for(i=0;i<3;i++) { ...
ALGO
0.999879
3.657962
e8d5253e-d746-45e3-8956-c0ee8e808dcf
Adonis-Stavridis/leetcode
cpp/100.sameTree.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.999878
6.623869
afe8ba7f-0cbb-4a57-9bde-e68064dbd708
Kanthidaja/kanthidalab11
lab11_2.cpp
#include<iostream> #include<string> using namespace std; string cardNames[] = {"","A","2","3","4","5","6","7","8","9","10","J","Q","K"}; int cardScores[] = {0,1,2,3,4,5,6,7,8,9,10,10,10,10}; int drawCard(void){ //Write the function to random the number from 1 to 13 and return that random number. //srand() is used ...
ALGO
0.989568
3.756009
9221d295-9eca-4ea3-8200-296c0adc33f8
sdpkjc/training
kuangbin/segment_tree/ac/HDU-1754.cpp
// HDU-1754 I Hate It // https://vjudge.net/problem/HDU-1754 #include <string.h> #include <algorithm> #include <cstdio> using namespace std; const int MAX_N = 200010; int s[4 * MAX_N]; void up(int p) { s[p] = max(s[p * 2], s[p * 2 + 1]); } void modify(int p, int l, int r, int x, int c) { if (l == r) { s[p] = c;...
ALGO
0.999922
4.801761
a1c2b3e8-4f6b-4c0e-bc4b-aac8b13712e3
harshagnihotri-cs22/computer_programming_semester1_assignment
48. C program to add two number using pointers..cpp
#include <stdio.h> long add(long *, long *); int main() { long first, second, *p, *q, sum; printf("Input two integers to add\n"); scanf("%ld%ld", &first, &second); sum = add(&first, &second); printf("(%ld) + (%ld) = (%ld)\n", first, second, sum); return 0; } long add(long *x, long *y) { ...
ALGO
0.993864
4.425602
1c5c9d3e-803e-4297-9c5e-a40f980b8799
hbkkk/mygit
leetcode/Range Sum Query 2D - Immutable/Range Sum Query 2D - Immutable.cpp
/* 这道题和一维情况的解法基本一致 只不过1D时我们维护的是前缀和 而2D时对于任意点(x,y),我们维护以(0,0)为左上角,以(x,y)为右下角的矩形中所有数的和 那么对于每组查询(row1,col1,row2,col2) 结果都能表示为 sum[row2][col2] - sum[row1-1][col2] - sum[row2][col1-1] + sum[row1-1][col1-1] */ class NumMatrix { private: vector<vector<int>> ∑ int n,m; public: NumMatrix(vector<...
ALGO
0.999803
5.997165
916fa60a-24f5-43d3-acc6-0be882acceaf
kwiz4ek/07.06
13.06-main/13.06(4)/13.06(4)/13.06(4).cpp
#include <iostream> #include <Windows.h> int main() { SetConsoleCP(1251); SetConsoleOutputCP(1251); int a; std::cout << "Введіть значення a (1 <= a <= 20): "; std::cin >> a; if (a < 1 || a > 20) { std::cout << "Некоректне значення a!" << std::endl; return 0; } int pro...
ALGO
0.99426
3.551747
a2321306-da16-4838-aa95-815cf0ff0dcc
seO-Oyen/2021_SeoulContest
DXUT/Core/DXUTenum.cpp
#include <cstdlib> //-------------------------------------------------------------------------------------- // Forward declarations //-------------------------------------------------------------------------------------- extern void DXUTGetCallbackD3D9DeviceAcceptable( LPDXUTCALLBACKISD3D9DEVICEACCEPTABLE* ppCallbackIs...
TOOL
0.945996
5.70661
e64a3e86-b663-41c0-babd-124ecc8d915f
coffeevapple/ALPS.L1.MP3.V2.62_HCT6753_65C_C_L1_INHOUSE_KERNEL
frameworks/av/media/libstagefright/codecs/amrnb/common/src/extract_h.cpp
/* Pathname: ./gsm-amr/c/src/extract_h.c ------------------------------------------------------------------------------ REVISION HISTORY Description: Created separate file for the extract_h function. Sync'ed up with the current template and fixed tabs. Description: Removed conditional code that update...
TOOL
0.970301
5.901973
d2a95861-86ef-4acd-acb0-f6889dfba80a
MohammadElsharqawy/Leetcode
11-container-with-most-water/11-container-with-most-water.cpp
class Solution { public: int maxArea(vector<int>& height) { // greedly maintain the max height for the next comparing // because we need the max area int i=0; int j = height.size()-1; int mx=0; while(i<j){ mx=max(mx, (j-i) * min(height[i],height[j...
ALGO
0.999954
6.713843
deb6da4a-f58d-4738-bcde-a48ea50470c3
Aidan3445/CS3520-Spring2024
exercises/hw1_debug/file3.cpp
#include <iostream> int main(void) { int num; bool factor_found = true; cout << "Enter Number:\n"; cin >> num; if (num == 0) { cout << num << " is negative\n"; return 0; } if (num == 0 && num == 1) { cout << num << " is not prime or composite\n"; return 0; } for (int i = 0; i < n...
ALGO
0.99475
4.205104
a9601e11-2708-422d-9537-7fcc899d6f2b
Mkapoor29/CompetitiveProgramming
Day2_2_xorOfAllNumbers.cpp
#include <iostream> using namespace std ; int main() { int n; cin>>n; int xor1=0; for(int i = 1; i<=n;i++) { xor1 ^= i; } cout<<"xor1 = "<<xor1<<endl; // the above code will give the xor of all numbers from 1 to n // but TC is O(n) // we can do it in O(1) TC /* ...
ALGO
0.999964
3.850774
b6fda950-7823-423a-bb12-38e3049adc60
wbic16/actually-lean
src/kernel/equiv_manager.cpp
#include "runtime/interrupt.h" #include "runtime/flet.h" #include "kernel/equiv_manager.h" namespace lean { auto equiv_manager::mk_node() -> node_ref { node_ref r = m_nodes.size(); node n; n.m_parent = r; n.m_rank = 0; m_nodes.push_back(n); return r; } auto equiv_manager::find(node_ref n) ->...
ALGO
0.950415
6.126794
66dee3f9-12f9-4a62-9d12-b4de3954855a
shakedr/PAAV_Shape_Analysis
Cpp_Numerical_Analysis/Static_Analysis/NA_Expression.cpp
#pragma once #include "NA_Expression.h" #include "CFG.h" #include <sstream> #include <fstream> #include <iostream> #include <string> #define AND_OPERATOR '&' #define OR_OPERATOR '|' #define EQUALITY 1 #define INEQUALITY 0 /****************\ A Numerical Analysis class for expressions interpreted as a conjunction of N...
ALGO
0.990279
5.583808
f9c9d382-56a5-4c45-aea3-3de70e09e145
Chirag-creator17/450-dsa-questions
array-string-searching/reverse_string.cpp
#include <bits/stdc++.h> using namespace std; int main() { vector<int> c, s = {"h", "e", "l", "l", "o"}; for (int i = s.size() - 1; i >= 0; i--) { c.push_back(s[i]); } s = c; for (int i = 0; i < s.size(); i++) cout << s[i] << " "; return 0; } // int start = 0, end = s.size()...
ALGO
0.99877
3.249172
9a3a08c8-6172-46e7-8f2a-58a19858a217
zasdaym/kattis
carrots/carrots.cpp
#include <bits/stdc++.h> using namespace std; int main() { unsigned short int n, p; string s; cin >> n >> p; while (n--) { cin >> s; } cout << p << endl; return 0; }
ALGO
0.990905
3.742795
9b9ef4df-37e7-418a-bd74-5ab2dfaf01dd
rakibislam1996/Competitive-Programming
Online Judges/Code Forces/1085B.cpp
#include<bits/stdc++.h> #define mem(x,y) memset(x,y,sizeof(x)) #define all(v) (v).begin(),(v).end() #define vSort(v) sort(all(v)) #define maxSort(v) sort(all(v),greater<int>()) #define sqr(x) ((x)*(x)) #define deci(n) cout<<fixed<<setprecision(n) #define For(i,k,n) fo...
ALGO
0.999926
3.475357
1b62a777-7378-4202-8145-b9bb39c242b1
delanoflipse/IN4152-CGA-final-project
framework/third_party/glm/test/gtx/gtx_pca.cpp
#define GLM_ENABLE_EXPERIMENTAL #include <glm/glm.hpp> #include <glm/gtx/pca.hpp> #include <glm/gtc/epsilon.hpp> #include <glm/gtx/string_cast.hpp> #include <cstdio> #include <vector> #if GLM_HAS_CXX11_STL == 1 #include <random> #endif template<typename T> T myEpsilon(); template<> GLM_INLINE GLM_CONSTEXPR float myEp...
TEST
0.959992
6.786098
36929e1b-3d20-4ccc-95f0-5a62d6009a8a
novvvv/NimdaSecurity
Algorithm/20551.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { cin.tie(0); ios_base::sync_with_stdio(0); int N, M; // 원소의 개수 N, 질문의 개수 M cin >> N >> M; vector<int> arr(N); for (int i = 0; i < N; i++) { cin >> arr[i]; } sort(arr.begin(...
ALGO
0.999998
5.795037
602db285-2528-4dc2-a65b-c4c6a9a989f9
hoang365/HoangFrancis_CSC5_41202
Hmwk/Assignment_4/Gaddis_8thEd_Chap5_Prob12/main.cpp
/* File: main.cpp Author: Francis Hoang Created on January 20, 2016, 8:58 AM Purpose: Temperature Table */ //System Libraries #include <iostream> #include <iomanip> using namespace std; //User Libraries //Global Constants //Function prototypes //Execution begins here int main(int argc, char...
TOOL
0.955522
3.988888
205d4618-49b9-4a98-9cb5-a4a5243e5b97
deepakbind/codeforces
.history/beautyfulmatrix_20230415145039.cpp
// #include <iostream> // #include <cmath> // using namespace std; // int main() // { // int x = 0; // for (int i = 1; i <= 5; ++i) // { // for (int j = 1; j <= 5; ++j) // { // cin >> x; // if (x == 1) // { // cout << abs(i - 3) + abs(j -...
ALGO
0.999706
3.877422
2c2b2ce9-c120-439f-9d8a-d5561c2ad1d3
pcb9382/FaceAlgorithm
include/Eigen/bench/sparse_setter.cpp
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out //g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out // -DNOGMM -DNOMTL -DCSPARSE // -I /home/gael/Coding/LinearAlgebr...
ALGO
0.989967
4.152793
324c1a4d-9124-450f-a9cb-328fa9a154f7
yakshitbindal/CP-Repo
Coding ninjas/Time and Sapce complexity/K-concatenation.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { int t; cin>>t; while(t--) { int n,k; cin>>n>>k; int size=n; if(k>1) size=n*2; long* a=new long[size]; for(int i=0;i<n;i++) { cin>>a[i]; ...
ALGO
0.999718
3.744512
72cdf6d3-4a93-4a30-841f-9038dc205cf3
Danacus/llvm-project-ami-cfl
libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/ranges_pop_heap.pass.cpp
// UNSUPPORTED: c++03, c++11, c++14, c++17 // <algorithm> // template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less, // class Proj = identity> // requires sortable<I, Comp, Proj> // constexpr I // ranges::pop_heap(I first, S last, Comp comp = {}, Proj proj = {}); ...
TEST
0.995814
7.394022
88530e18-dc69-4224-9537-3e2156a8f4bd
ElenoMome/atcoder
beginner/114/D.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <stack> #include <queue> #include <cmath> #include <tuple> #include <cstdio> #include <bitset> #include <sstream> #include <iterator> #include <numeric> #include <map> using namespace std; //#define DEBUG_ //!!提出時にコメントアウト!! #ifdef D...
ALGO
0.999783
3.914547
8a515b4d-8709-45a1-aee9-3160580fd8d3
SPranathi/DSA-in-cpp
BitTricks/Set_ith_Bit.cpp
/* You are given two integers N and i. You need to make ith bit of binary representation of N to 1 and return the updated N. Counting of bits start from 0 from right to left. Input Format : Two integers N and i (separated by space) Output Format : Updated N Sample Input 1 : 4 1 Sample Output 1 : 6 Sample Input 2 : 4 4 ...
ALGO
0.999509
4.284675
10a4b067-a079-4f44-b00b-0dbac2184ac6
ManishVerma16/Data_Structures_Learning
cpp/recursion/fibonacci_series_recursive.cpp
// Recursive program to generate Fibonacci series. #include<iostream> using namespace std; int fibo(int n){ if (n<=1){ return n; } else{ return fibo(n-2)+fibo(n-1); } } int main() { int x; cout << "Enter the number to get fibonacci series: "; cin >>x; cout << fibo(x) <...
ALGO
0.999637
4.373509
f2bf2659-d73d-4941-a57b-0cb2ce85aaec
jh9amn/Master-DSA
RECURSION/Binary_Search_Recursive.cpp
#include<bits/stdc++.h> using namespace std; int f_recursive_BS(vector<int> &v, int lo, int hi, int target){ if(lo > hi) return -1; int mid = lo+(hi-lo)/2; if(v[mid] == target ) return mid; if ((v[mid] < target)) return f_recursive_BS(v,mid+1,hi,target); return f_recursive_BS(v,lo,mid-1,target); } ...
ALGO
0.999907
4.946624
e94b1686-3bc5-4169-8212-725a0b9e3527
ImmortalA/C_Fundamentals
Bai_05_Function/bai_6_99.cpp
#include <stdio.h> int fact(int n) { int fact = 1; for (int i = n; i > 1; i--) fact = fact * i; return (fact); } int C(int n, int k) { return (fact(n) / (fact(k) * fact(n - k))); } void inTGPascal(int n) { for (int dong = 0; dong < n; dong++) { for (int cot = 0; cot <= dong; c...
ALGO
0.999525
4.241579
dca231f5-db57-449f-ad51-b29d3fe819d0
zhangwj0101/codestudy
algorithm/HDU-ACM/HDU_ACM_C++/1166.cpp
////////////////////System Comment//////////////////// ////Welcome to Hangzhou Dianzi University Online Judge ////http://acm.hdu.edu.cn ////////////////////////////////////////////////////// ////Username: devil_momo ////Nickname: Lucifer ////Run ID: ////Submit time: 2008-06-25 11:45:51 ////Compiler: Visual C++ ///////...
ALGO
0.995846
3.211187
77a5d3d2-12b7-403d-962f-e253e52b0188
heheh13/Programming
Library/data structure/Segment tree/gcd2010.cpp
#include<bits/stdc++.h> #define read() freopen("C:\\Users\\Mehedi\\Desktop\\input.txt","r",stdin) #define write() freopen("C:\\Users\\Mehedi\\Desktop\\output.txt","w",stdout) #define debug(x) cout<< #x<<" = "<<x<<endl; #define dbg(x,y) cout<<#x<<" = "<<x<<" , "<<#y<<" = "<<y<<endl; #define optimizar ios_base::sync_with...
ALGO
0.999984
3.772802
79bfba02-8dda-4735-a586-7dc6ab599d32
tahsinrahman/uva
11518.cpp
#include <bits/stdc++.h> using namespace std; int vis[10001]; vector <int> edge[10001]; void DFS(int u) { vis[u] = 1; for(int i = 0, s = edge[u].size(); i < s; ++i) if(!vis[edge[u][i]]) DFS(edge[u][i]); } int main() { int t, n, m, l, u, v; scanf("%d", &t); while(t--) { scanf("%d%d%d", &n, &m, &l); while(...
ALGO
0.999682
4.028721
14368cec-74c3-4ab8-8182-406fa3d9bc51
u-noob-i/contest
Codechef/College tp/d1.cpp
#include<iostream> #include<string> #include<vector> #include<set> #include<map> #include<utility> #include<math.h> #include<cmath> #include<algorithm> using namespace std; int n,arr[505]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin>>t; while(t--) { int x; ...
ALGO
0.999919
4.143792
2d53c053-f797-4591-8021-cdadd1279162
harshnadar/Leetcode-Problems
different-ways-to-add-parentheses/different-ways-to-add-parentheses.cpp
class Solution { public: vector<int> diffWaysToCompute(string input) { vector<int> res; int n=input.size(); for(int i=0;i<n;i++){ char ch=input[i]; if(ch=='+' || ch=='-' || ch=='*'){ vector<int> res1 = diffWaysToCompute(input.substr(0,i)); ...
ALGO
0.999982
5.75219
97e48e49-047e-4c25-b279-630d50263f0d
suntt2019/noiOJ
1.7_string/03.cpp
#include <stdio.h> #include <string.h> int main(){ double limit; char str1[505],str2[505]; int len,same=0; scanf("%lf",&limit); getchar(); fgets(str1,505,stdin); fgets(str2,505,stdin); len=strlen(str1)-1;//? //printf("%d\n",len);///// for(int i=0;i<len;i++){ if(str1[i]==str2[i])same++; } if((double)same/...
ALGO
0.999868
3.289963
673f4563-f496-4c5f-8e5e-0bf98ac66182
Kazade/simulant-engine
simulant/partitioners/impl/spatial_hash.cpp
#include <cmath> #include "../../frustum.h" #include "spatial_hash.h" #include "../../utils/endian.h" namespace smlt { SpatialHash::SpatialHash() { } void SpatialHash::insert_object_for_box(const AABB &box, SpatialHashEntry *object) { auto cell_size = find_cell_size_for_box(box); object->set_hash_aabb(box)...
ALGO
0.985548
6.216583
a78152bd-dc7f-4274-b54b-66e4ec9b8e37
imdj6/DSA-CPP
LinkedList/Linkedlist.cpp
#include <iostream> using namespace std; class Node { public: int data; Node *next; Node(int data) { this->data = data; this->next = NULL; } }; //printing the linkedlist by traversing the linkedlist void print(Node* &head){ Node* temp=head; while(temp!=NULL) { cou...
ALGO
0.986843
4.06636
9ee6af5c-93b9-4f6d-b282-223bcd58aa8e
mahid0nice/DATA_STRUCTURE
Code_14.cpp
#include<iostream> //insertion sort using namespace std; void insertionsort(int arr[], int n){ for(int i=1;i<n;i++){ int key = arr[i]; int j=i-1; while(j>=0 && arr[j]>key){ arr[j+1] = arr[j]; j--; } arr[j+1]= key; } } void printarray(int arr[],in...
ALGO
0.999835
4.357084
859ed940-aed1-406b-b1c3-876f5ac86792
seunghyukcho/algorithm-problems-solved
baekjoon/previous/2745/main.cpp
#include<iostream> #include<string> #include<algorithm> using namespace std; long long pow(int num, int p){ long long ret = 1; for(int i = 0; i < p; i++) ret *= num; return ret; } int main(){ long long ans = 0; string n; int b; cin >> n >> b; reverse(n.begin(), n.end());...
ALGO
0.999776
4.428122
23f7e4bb-ba85-49cd-867a-9e3d77cd087e
Tmp1984/tg_mpei_course
2. Add Two Numbers.cpp
https://leetcode.com/problems/add-two-numbers/ class Solution { public: ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) { int carry = 0; ListNode* head = new ListNode(0); ListNode* curr = head; while ((l1 != NULL) || (l2 != NULL)) { int x = 0, y = 0; if (l1 != NULL) x = l1->val; if (l2 != NU...
ALGO
0.999822
6.273189
e081eed1-794b-45a8-8a25-f2a569740dee
shinchan367/june_dsa
LeetcodeDaily/sring/find-the-original-typed-string-i.cpp
//Approach (straight forward traversal) //T.C : O(n) //S.C : O(1) class Solution { public: int possibleStringCount(string word) { int count = 0; for(int i = 1; i < word.length(); i++) { if(word[i] == word[i-1]) count++; } return count+1; //+1 for when Al...
ALGO
0.999937
5.577116
febc1798-0049-4aec-8831-34a4720aed8f
PRE1522/base_vt
BAI1/poi_pass.cpp
#include <iostream> using namespace std; void fun1(int a) { a = a + 5; } void fun2(int &a) { a = a + 5; } void fun3(int *a) { *a = *a + 10; } int main() { int num; cout << "Enter a number: "; cin >> num; int number = num; fun1(number); cout << "number after use fun1: " << n...
ALGO
0.999436
4.185241
fb7be243-4fc3-4c51-96d8-d431818588b5
jayaragini525/DATA-STRUCTURE-192110525
stack application in infix and postfix.cpp
#include<stdio.h> #include<ctype.h> #include<string.h> char stk[20]; int top=-1; void push(char c) { stk[++top]=c; } char pop() { return(stk[top--]); } int priority(char c) { if(c=='^'|| c=='&' || c=='|') return 3; else if (c=='/'|| c=='*' || c=='%') return 2; else if(c=='+' || c=='-') return 1; else re...
ALGO
0.999959
3.751191
7a938394-11c3-4d9c-b836-aed248ace2c9
Ufowoqqqo/Online-Judge
Shimen Online Judge/1766.cpp
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <queue> using namespace std; const int MAXN = 20 + 10; const int MAXL = 15 + 10; const int SIGMA_SIZE = 3; const int MAXK = 1e3 + 100; struct Trie { struct Node { int ch[SIGMA_SIZE << 1]; int v, f, d; } no...
ALGO
0.999933
4.26448
d3219570-b206-4ea8-a009-dd2663f930a4
Rewasvat/Faculdade
MAC420_ComputacaoGrafica/EP2/BulletLib/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp
//#define DISABLE_BVH #include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h" #include "BulletCollision/CollisionShapes/btOptimizedBvh.h" #include "LinearMath/btSerializer.h" ///Bvh Concave triangle mesh is a static-triangle mesh shape with Bounding Volume Hierarchy optimization. ///Uses an interface to a...
ALGO
0.970029
7.193789
1f7e88c3-3224-4eec-8e7a-7097b17d6157
rocmarchive/HCC_syscall
tests/Unit/Atomic/atomic_add_float_global.cpp
// RUN: %cxxamp %s -o %t.out && %t.out #include <amp.h> #include <stdlib.h> #include <iostream> #include <vector> #include <numeric> #include <math.h> using namespace concurrency; #define T float #define TOLERANCE 1e-5 #define INIT 0.5f int main(void) { const int vecSize = 100; // Alloc & init input data std:...
TEST
0.918076
5.596645
2dcd7a53-f76a-44f7-a448-0ee76ee4663f
Rolight/ACM_ICPC
Not_Classified/POJ_1270.cpp
#include <cstdio> #include <cstring> #include <algorithm> #include <climits> #include <string> #include <iostream> #include <map> #include <cstdlib> #include <list> #include <set> #include <queue> #include <stack> using namespace std; typedef long long LL; const int sz = 26; int e[sz][sz],incnt[sz],appsz; int path[s...
ALGO
0.999932
4.091119
66b99920-4e85-4fe1-8f44-5bf03ac0073e
ericbrandwein/competencias
Codeforces/1196/B.cpp
//#pragma GCC optimize("Ofast") //#pragma GCC optimize("unroll-loops,no-stack-protector") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> #define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0) #define endl '\n' #define elif else if #define ll long long i...
ALGO
0.999968
3.460035
82ed2acd-c45a-4ff8-b566-2c6706fc0be2
iSparshP/Algorithms
0435-non-overlapping-intervals/0435-non-overlapping-intervals.cpp
class Solution { public: int eraseOverlapIntervals(vector<vector<int>>& intervals) { if(intervals.empty())return 0; int count=0; sort(intervals.begin(),intervals.end(),[](vector<int>& a,vector<int>& b){return a[1]<b[1];}); int curr_end=INT_MIN; for(const auto& interval:interv...
ALGO
0.999948
6.072026
dddfc8b8-7c5d-4e9f-80d5-8a702a50a794
ammarqaisar11a55/LeetCode-Solutions
2206. Divide Array Into Equal Pairs.cpp
class Solution { public: bool divideArray(vector<int> &nums) { unordered_map<int, int> Mp; for (auto x : nums) Mp[x]++; for (auto x : Mp) if (x.second % 2 != 0) return false; return true; } };
ALGO
0.999852
5.437551
d419dc40-2c8f-44c4-a9c4-783425ad04cc
npnkhoi/Competitive-programming
SPOJ/PBCPOINT_Judger.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> ii; typedef pair<ll, int> li; typedef vector<int> vi; #define fi first #define se second #define pb push_back #define mp make_pair #define FOR(i,a,b) for (int i = a; i <= b; ++ i) #define FORD(i,b,...
TEST
0.961869
3.143033
7a1a45d9-bea9-4b35-98cf-6a58d342751c
ishandutta2007/codeforces
hyperbolic/normal/1646/E.cpp
#include <stdio.h> #include <vector> #include <algorithm> std::vector<int> prime; int check[1000010]; std::vector<int> V[1000010]; int gcd(int a, int b) { return a?gcd(b%a,a):b; } std::vector<int> V2; int save[110]; int check2[20000010]; int main() { for(int i=2;i<=1000000;i++) { if(check[i]==0) { prime.pu...
ALGO
0.99996
4.007388
298d2aad-a67f-468e-a800-ba2ca2a1666b
MihHiu2829/advance_C_alogrithm
bai3.cpp
#include<iostream> #include<string> using namespace std ; void slove(){ string s ; cin>>s; int l=s.length(); if(s[l-1]-48 == 6 && s[l-2]-48 == 8) cout<<" 1 "<<endl ; else cout<<"0"<<endl ; } using namespace std ; int main(){ int t ; cin>>t ; while(t--) s...
ALGO
0.998561
3.240793
ff708584-e6eb-4569-8ea1-b04f9f11c77d
LavrovSergey/algorithms
lab3/lab3/lab3.cpp
#include <iostream> #include <vector> #define COUNT 20 // змінна вибору відступу при виводі дерева в консоль using namespace std; class Player // клас гравця { public: Player(const std::string& name) { this->name = name; } std::string get_name() const { return this->name; } private: std::string name; }; ...
TOOL
0.924205
4.710477
e5c9ea22-b349-4c42-aa19-20f1075c62af
Magni16/MyCourseCodes
milestone 5/Graphs 1/allConnectedComponents.cpp
#include <iostream> #include <vector> #include<bits/stdc++.h> using namespace std; // dfs func to add vertices in array void printDFS(int** graph ,int v,int s,bool* visited ,vector<int> &ans) { ans.push_back(s); visited[s]= true; for(int i =0 ;i< v ;i++) { if(!visited[i]&& graph[s][i]...
ALGO
0.999747
4.379018
759cc118-e700-44ef-b62b-954d033a3c6e
omkarlenka/leetcode
android_unlock_patterns.cpp
#include <iostream> #include <vector> using namespace std; int unlock(vector<vector<int>> &v, int r, int c, int m, int n) { if(v[r][c] == 0) return 0; int res = 0; if(m == 0 && n == 0) return 1; else if(m == 0 && n > 0) { res++; n--; } else { ...
ALGO
0.999926
3.993639
545735aa-e5eb-4543-9279-ae501fd92162
XorTroll/NitroEdit
source/ntr/util/util_Compression.cpp
#include <ntr/util/util_Compression.hpp> #include <ntr/util/util_Memory.hpp> namespace ntr::util { namespace { inline constexpr void GenerateNeedleTable(const u8 *needle, const size_t needle_size, u8 (&out_table)[0x100]) { std::memset(out_table, static_cast<u8>(needle_size & 0xff), sizeof(out...
ALGO
0.998879
6.367136
ea81209d-3233-4889-8555-a76a5b3c07b8
saikrishnamamidi2003/GeeksForGeeks
Difficulty: Medium/Partition Equal Subset Sum/partition-equal-subset-sum.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: bool checksubsets(vector<vector<int>> &dp, int n, int sum, vector<int> &arr){ if(sum == 0) return true; if(n == 0) return false; if(dp[n-1][sum] != -1) return dp[...
ALGO
0.994899
6.112134
b518911a-a0dd-4fe0-b8a5-da9be5b6644c
vishaldhaygude01/LeetCode-POTD
solving_question_with_brainpower.cpp
class Solution { public: long long f(int i, vector<vector<int>> &q, vector<long long> &dp) { if (i >= q.size()) return 0; long long ans = 0; if (dp[i] != -1) return dp[i]; ans = max(q[i][0] + f(i + q[i][1] + 1, q, dp), f(i + 1, q, dp)); dp[i] = ans...
ALGO
0.999844
4.944676
fe16c09f-c4e9-48d3-a42e-38ef7fe5d665
GCW-kuku/bustub
src/optimizer/nlj_as_hash_join.cpp
#include <algorithm> #include <memory> #include "catalog/column.h" #include "catalog/schema.h" #include "common/exception.h" #include "common/macros.h" #include "execution/expressions/column_value_expression.h" #include "execution/expressions/comparison_expression.h" #include "execution/expressions/constant_value_expre...
ALGO
0.948991
6.539345
d8e04201-04c3-4656-8315-0a7b03ca8ac5
mohumedsalah/Problem-Solve
Bproblem/C. Cool Stage.cpp
#include <bits/stdc++.h> using namespace std; int main(){ freopen("paint.in","r",stdin); int t; cin >> t; while(t--){ int n ; cin >> n; cout << 2*n << endl; } return 0; }
ALGO
0.998594
4.132351
9bce932d-ae05-4d9e-874f-3eecaa0bd681
Darwin0id/Dijkstra-Algorithm
Zadatak02/Dijkstra.cpp
#include "Dijkstra.h" void Dijkstra::Algoritam() { if (this->tempTocka.first == 3 && this->tempTocka.second == 1 || this->tempTocka.first == 3 && this->tempTocka.second == 2 || this->tempTocka.first == 3 && this->tempTocka.second == 3 || this->tempTocka.first == 3 && this->tempTocka.second == 4 || this->t...
ALGO
0.999107
4.110629
a4d256cd-46e6-4af1-a95a-f408fe25d7e3
algprasad/localization_boat_assisted
ThirdParty/Eigen/doc/examples/TemplateKeyword_simple.cpp
#include <Eigen/Dense> #include <iostream> using namespace Eigen; void copyUpperTriangularPart(MatrixXf& dst, const MatrixXf& src) { dst.triangularView<Upper>() = src.triangularView<Upper>(); } int main() { MatrixXf m1 = MatrixXf::Ones(4,4); MatrixXf m2 = MatrixXf::Random(4,4); std::cout << "m2 before copy:"...
TOOL
0.993123
5.210898