uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
a56e71fe-a94d-4a9a-adc9-b83597e7197f
etaijacob/TOYFOLD
simulator/utilities.cpp
//utilities.cpp #include <iostream> #include <stdlib.h> #include <math.h> #include <sys/types.h> #include <sys/dir.h> #include <libgen.h> #include <fstream> #include <ctype.h> #include "utilities.h" using namespace std; //from 1 to chainLength+1 PWD::PWD(int chainLength) { // cout<<"pwd::ctor "<<chainLength<<endl; ...
ALGO
0.996511
4.150959
7c29adfd-ac9f-4812-804c-cb69b56b250f
ldj202111001/data_Struct_05
data_Struct_05/ex)6.5~6.13.cpp
/* α׷ : ܼḮƮ ̿ Ʈ ü α׷ ǽ¥: 2024 - 04 - 26 й: 202111001 ̸: ̵ */ #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> typedef int Element; typedef struct LinkedNode { Element data; struct LinkedNode* link; // ü ü } Node; Node* head = NULL; // void init_list() { head = NULL; } int is_empty() { retu...
ALGO
0.99934
3.98903
6fb34ab7-7e49-42ee-9154-98c0c59f2fd4
TDDY27/CPP-CODES
SPROUT JUDGE/OK/ALGO22/可魚果運輸問題.cpp
#include <bits/stdc++.h> #define TDDY ::ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define int long long #define pii pair<int,int> #define INF 9e17 #define PB push_back #define w first #define v second using namespace std; int t,n,m,s,e,f; vector <pii> G[150]; int dis[150]; priority_queue< pii, vector...
ALGO
0.999101
4.317494
7cd3012a-9f2f-4262-85df-cb213509cc37
Vaisakh-06/dsa-series
day-18.cpp
//Day - 18 //Problem 1 - Valid Anagram //https://leetcode.com/problems/valid-anagram/ //code: class Solution { public: bool isAnagram(string s, string t){ if(s.length() != t.length()) return false; unordered_map<char,int> s_to_t, t_to_s; for(int i = 0; i < s.length(); i++){ ch...
ALGO
0.997475
5.856349
4bea982f-0eb5-4550-9acf-cba1e3e8758f
Yusuf-sust/Problem_Solving
CONTEST/team forming4/A - Pairing Chefs.cpp
#include<cstdio> #include<sstream> #include<cstdlib> #include<cctype> #include<math.h> #include<algorithm> #include<set> #include<queue> #include<stack> #include<list> #include<iostream> #include<fstream> #include<numeric> #include<string> #include<vector> #include<cstring> #include<map> #include<iterator> #include <de...
ALGO
0.999838
3.986451
c1a8f30c-3880-4b7d-8b6d-b88efcd961bd
user2001230258/kithuatlaptrinh
mang1chieu.cpp
// Online C Compiler - Build, Compile and Run your C programs online in your favorite browser #include<stdio.h> #include <stdlib.h> #include <stdbool.h> void nhapMang(int *a, int n) { for (int i = 0; i <n;i++) { printf("a[%d] = ",i); scanf("%d",&a[i]); } } void xuatMang(int *a, int n) { f...
ALGO
0.99995
4.132235
ac34f078-05b8-40d1-ae5f-bc9191811e0d
sarvex/leetcode-haskell
solution/1000-1099/1035.Uncrossed Lines/Solution.cpp
class Solution { public: int maxUncrossedLines(vector<int>& nums1, vector<int>& nums2) { int m = nums1.size(), n = nums2.size(); vector<vector<int>> dp(m + 1, vector<int>(n + 1)); for (int i = 1; i <= m; ++i) { for (int j = 1; j <= n; ++j) { if (nums1[i - 1] == nu...
ALGO
0.999995
6.404184
93422212-abfc-4e6b-bb6b-0980b5f4d652
Slowqueueue/windows-api-programming
myvar/3SemestrLab7.cpp
// Программа из конспекта "Системное программное обеспечение" // Версия для Windows // стр. ?? // Приложение MTHREADS // многопоточное приложение, синхронизация мьютексами #define _CRT_SECURE_NO_WARNINGS #include <windows.h> #include <stdio.h> #include <string.h> #define threads 64 #define BUF_SIZE 256 // гло...
TOOL
0.870998
3.391903
1c42458c-7160-4d26-852c-6c30301f8abd
aliza933/100-programs-
67.cpp
#include <iostream> using namespace std; bool isAutomorphic(int num) { int square = num * num; int temp = num; int divisor = 1; while (temp > 0) { divisor *= 10; temp /= 10; } return square % divisor == num; } int main() { int num; cout << "Enter a number: "; cin ...
ALGO
0.995857
5.144413
1a2a30bd-08ae-490d-9eca-d78c3eb8a79b
sarvex/leetcode-intercal
solution/0200-0299/0269.Alien Dictionary/Solution.cpp
class Solution { public: string alienOrder(vector<string>& words) { vector<vector<bool>> g(26, vector<bool>(26)); vector<bool> s(26); int cnt = 0; int n = words.size(); for (int i = 0; i < n - 1; ++i) { for (char c : words[i]) { if (cnt == 26) brea...
ALGO
0.999999
6.069598
99df5fcb-9d58-4d11-95d9-177b97e6df48
Rashi-Singh1/InterviewBit-Solutions
Linked List/RotateList.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ ListNode* Solution::rotateRight(ListNode* A, int B) { if(A == NULL || A->next == NULL) return A; int s = 0; ListNode *copy = A, *cur = A, *nex = A->n...
ALGO
0.999989
5.331942
4a73d33c-a50e-4ed8-aeb4-237ad43376cc
manikanta2901/ubuntu
.history/codingChallenges/cpp/Codechef/longChallenges/October/imput_20201003122603.cpp
#include<bits/stdc++.h> #include<iostream> using namespace std; int main(){ freopen("input1.txt","r",stdin); int t,n; cin >> t >> n; cout << n << endl; for(int i = 1; i <= n; i++){ cout << i << endl; } freopen("output1.txt","a",stdout); return 0; }
ALGO
0.999882
3.468723
ad3445c7-5643-4bbe-9d09-0a41c28272ee
cojmeister/CADAC
ADS6/newton.cpp
/////////////////////////////////////////////////////////////////////////////// //FILE: 'newton.cpp' //Contains 'newton' module of class 'Flat6' // //020513 Created from SRAAM6 by Peter H Zipfel //030307 Upgraded to SM Item32, PZi //060504 Picked up 'newton' module from DRMPN6, PZi /////////////////////////////////////...
ALGO
0.974224
4.485776
8e4f5e53-db38-4e0e-8cc7-5ceb461bf1ce
dubae/flutter_searchTrend
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.998784
6.761023
b864ea28-bc99-4f94-ac70-b30ee6c67853
atom015/c_boj
1000번/1439_뒤집기.cpp
#include<iostream> #include<stdio.h> #include<algorithm> #include<string> using namespace std; int main(){ int ans[2] = {0,0}; string s; cin >> s; char c = s[0]; if (c == '0'){ ans[0] = 1; }else{ ans[1] = 1; } for (int i = 1; i < s.length(); i++){ if (s[i] != s[i-1]){ if (s[i] == '0'){ ans[0] += 1...
ALGO
0.999947
3.393937
fa52eec7-1581-4f8e-850a-8f6506eec23e
raincross7/code-similarity
codes/train_code/problem228/problem228_338.cpp
#include <bits/stdc++.h> using namespace std; int main() { long N, A, B; cin >> N >> A >> B; if (A > B) return cout << 0 << "\n", 0; if (N == 1 && A != B) return cout << 0 << "\n", 0; long mx = A + B * (N - 1); long mi = A * (N - 1) + B; cout << mx - mi + 1 << "\n"; }
ALGO
0.999846
3.582613
38d14f8d-992d-4945-9d1f-87650318d512
zwang-204/TWRay
src/core/scene.cpp
// core/scene.cpp* #include "scene.h" #include "stats.h" namespace pbrt { STAT_COUNTER("Intersections/Regular ray intersection tests", nIntersectionTests); STAT_COUNTER("Intersections/Shadow ray intersection tests", nShadowTests); // Scene Method Definitions bool Scene::Intersect(const Ray &ray, Surface...
TEST
0.970663
7.609427
532d6137-b641-4683-b071-70b11a5c025d
sanjaykumar7481/Algorithms
227-basic-calculator-ii/basic-calculator-ii.cpp
class Solution { public: int precedence(string t) { if(t=="*" or t=="/")return 2; if(t=="+" or t=="-")return 1; // cout<<t<<":"; return 3; } int calculate(string s) { stack<string>st; vector<string>postfix; for(int i=0;i<s.size();i++) { ...
ALGO
0.999511
4.453467
4ca8dc58-37cb-47db-a35a-9a82c2cf0d10
SuseelKumarG/cpsolns
A_FizzBuzz_Remixed.cpp
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, l...
ALGO
0.999842
4.768578
c249125d-63d2-4275-bfe2-a1a317c6fe1b
mstone/klee
lib/Core/SeedInfo.cpp
#include "Common.h" #include "Memory.h" #include "SeedInfo.h" #include "TimingSolver.h" #include "klee/ExecutionState.h" #include "klee/Expr.h" #include "klee/util/ExprUtil.h" #include "klee/Internal/ADT/KTest.h" using namespace klee; KTestObject *SeedInfo::getNextInput(const MemoryObject *mo, ...
ALGO
0.973845
5.832922
dd3e50bf-ee15-4769-9f62-a11256598f2d
erdongshuiyang/GPIR_planner_ws
src/gpir/gp_planner/thirdparty/gtsam-4.1rc/gtsam/3rdparty/Eigen/doc/examples/DenseBase_template_int_middleCols.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; using namespace std; int main(void) { int const N = 5; MatrixXi A(N,N); A.setRandom(); cout << "A =\n" << A << '\n' << endl; cout << "A(:,1..3) =\n" << A.middleCols<3>(1) << endl; return 0; }
ALGO
0.954365
3.137618
43b34c25-bbac-4667-a8f1-05071c98ef77
hashilyze/Problem-Solving
Beakjoon/Number Theory/boj_13909.cpp
// Beakjoon 13909 - 창문 닫기 // https://www.acmicpc.net/problem/13909 #include <cmath> #include <iostream> // macros #define FASTIO std::ios::sync_with_stdio(0); std::cin.tie(0); // types // constants // variables int main(void){ FASTIO int N; std::cin >> N; std::cout << (int)std::sqrt(N); return 0; }
ALGO
0.999413
4.90433
1547df98-baed-4db1-b1d2-515893cc8139
PJH1998/ALG
BST/BinarySearchTree.cpp
#include "BinarySearchTree.h" #include <iostream> #include <windows.h> using namespace std; enum class ConsoleColor { BLACK = 0, RED = FOREGROUND_RED, GREEN = FOREGROUND_GREEN, BLUE = FOREGROUND_BLUE, YELLOW = RED | GREEN, WHITE = RED | GREEN | BLUE, }; void SetCursorPosition(int x, int y) { HANDLE output = ::...
ALGO
0.989206
5.145305
27eaeeb8-a5b1-40cc-bc6c-e206c697a3e6
ishandutta2007/codeforces
lily/normal/1716/A.cpp
#include <bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<int, int> pii; #define read(a) scanf("%d", &a) int ans[100]; void dfs(int x, int y) { if (y > 10) return; if (x > 30) return; if (ans[x] > y) ans[x] = y; else return; dfs(abs(x + 2), y + 1); dfs(abs(x - 2), y + 1); dfs(abs(x + 3), ...
ALGO
0.9988
3.42837
b0254f25-9c98-4eef-9b6d-4f1fce2d2e32
aaryan-00/Practice-Leetcode
0162-find-peak-element/0162-find-peak-element.cpp
class Solution { public: int findPeakElement(vector<int>& nums) { int n=nums.size(); int s=0,e=n-1; while(s<e) { int mid=s+e >>1; // if(mid==0) // { // if(nums[mid]>=nums[mid+1]) return mid; // else return mid+1; ...
ALGO
0.999965
5.383301
e8d6bca1-11c3-4a71-b05a-fdc1c0f60494
coderatiiita/CSES
Dynamic Programming/Array_Description.cpp
#pragma GCC optimize("O3,unroll-loops") #include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> using namespace std; using namespace chrono; using namespace __gnu_pbds; #define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define MOD 1000000007 #d...
ALGO
0.999985
4.528473
d0c22e38-523c-493f-bb7d-58068fc8e281
hank891008/LeetCode
2287-rearrange-characters-to-make-target-string/2287-rearrange-characters-to-make-target-string.cpp
class Solution { public: int rearrangeCharacters(string s, string target) { unordered_map<char, int> k, v; for(auto st: s){ k[st]++; } for(auto st: target){ v[st]++; } int ans = INT_MAX; for(auto [x, y]: v){ if(!k.count(x)){...
ALGO
0.999971
5.938469
ea790d4e-7261-4a25-8b9f-1e514dcb0d30
jerry0339/Study_Note
Algorithm/BackJun_PS/SegmentTree/lazy/BOJ_18437.cpp
#include<bits/stdc++.h> #define MAX 100001 #define MAX_N 100001 using namespace std; vector<int> adj[MAX_N]{}; int st[MAX_N]{}, ed[MAX_N]{}; int tree[MAX<<2]{}; int lazy[MAX<<2]{}; int N,M; int init(int n, int s, int e){ if(s==e) return tree[n] = 1; int mid = (s+e)>>1; return tree[n] = init(n<<1, s, mid) ...
ALGO
0.999972
4.377509
47b81c02-ce77-4632-abaa-a657507cd747
ghtormena/HackerRank
excepctional_server.cpp
#include <iostream> #include <exception> #include <string> #include <stdexcept> #include <vector> #include <cmath> using namespace std; class Server { private: static int load; public: static int compute(long long A, long long B) { load += 1; if(A < 0) { throw std::invalid_argument("A is negative"); } vec...
ALGO
0.986567
4.540905
644644d4-3727-4e19-9f2d-4377086d6648
one-saurabhsingh/Competitive-Coding
codeforces/A_Sakurako_and_Kosuke.cpp
#include "bits/stdc++.h" #define int long long #define uint unsigned long long #define vi vector<int> #define vvi vector<vi > #define vb vector<bool> #define vvb vector<vb > #define fr(i,n) for(int i=0; i<(n); i++) #define rep(i,a,n) for(int i=(a); i<=(n); i++) #define nl cout<<"\n" #define dbg(var) cout<<#var<<"="<<va...
ALGO
0.999132
3.701526
c0053206-e91f-4ac3-b4d0-f555b167a62e
TNCTRobocon/easel
trapezoid.cpp
//#include "trapezoid.hpp" #include "config.hpp" #include <stdio.h> void Trapezoid(void (*func)(float),float max_value,unsigned int delay_time){ double value; if(func==NULL){ printf("func NULL\n"); return; } if(max_value<0.15){ printf("max_value low\n"); return; }else if(max_value<0.3){ for(value = 0.1;...
ALGO
0.986818
4.132618
b0015994-db74-4101-aed3-36f0d06fa42a
kaushikaryan/Baruch_CPP_FE_HW
Level 1/1.4/1.4.7/freq2.cpp
// freq2.c // // C program to count frequency of different // numbers and characters // // @author : Kaushik Aryan // @date : 05-05-2025 #include <stdio.h> int main() { // Initialize variables int curr = -1, count0 = 0, count1 = 0, count2 = 0, count3 = 0, count4 = 0, countOther = 0; printf("Enter som...
ALGO
0.997184
4.738481
5750bf1d-f750-422b-8899-df9c092d5647
KrabbyKrabby/meta_codebench_cpp_tester
tasks/621262/src/F.cpp
#include <iostream> #include <string> #include <vector> #include <unordered_set> #include <stdexcept> class FileSystem { private: std::unordered_set<std::string> filePaths; public: // Adds a file path to the system filePaths void addFilePath(const std::string& path) { std::string normalizedPath = ...
TOOL
0.966475
6.736294
1bc90122-5de8-4995-a1be-30cfd8894e0e
muzizhi/one-year-date
栈/每日温度.cpp
739、每日温度:给出温度列表,返回离温度up天间距,无则0,返回新列表。 思路:暴力,for(for有大);用哈希存储索引的话,能搜索比谁大吗?貌似不行 官方思路:单调栈,栈1放索引,vector放结果。栈1,如果有元素j比栈顶i大,移除栈顶,ans[i]=j-i;栈顶小入栈。最后结束在栈里的都为0 class Solution { public: vector<int> dailyTemperatures(vector<int>& T) { stack<int> s; int n=T.size(); vector<int> res(n,0); //单调栈t...
ALGO
0.999965
5.703581
5515822c-3f0c-4819-bee3-d2497e0484fe
Rutuza/cpp
Basic Programs/nPrimes.cpp
#include<iostream> using namespace std; int main() { int N, i, j; cin>>N; for(i=0; i<=N; i++) { for(j=2; j<=i; j++) { if (i%j == 0) { break; } } if (i==j) { cout<<j<<" "; } }...
ALGO
0.999837
3.906462
05713202-70d0-4952-8cb5-80f8ab9853e6
Onooor/WebserverExec
lesson08/bubble.cpp
#include "sort.h" #include <iostream> using namespace std; void bubbleSort(int *array, int len) { for (int i = 0; i < len - 1; i++) { for (int j = 0; j < len - 1 - i; j++) { if (array[j] > array[j + 1]) { int temp = array[j]; array[j] = array[j + 1]; array[j + 1] = temp; } } } }
ALGO
0.999296
4.003025
10388e84-cd4e-45c1-ba37-fac6c31ed9d4
Divyanshu03chauhan103/LeetCode
3785-find-the-number-of-copy-arrays/find-the-number-of-copy-arrays.cpp
class Solution { public: int countArrays(vector<int>& original, vector<vector<int>>& bounds) { int n= original.size(); int lb=bounds[0][0]; int ub=bounds[0][1]; for(int i=1;i<n;i++){ int diff = original[i]-original[i-1]; lb=lb+diff; ...
ALGO
0.99986
5.519059
8936c008-dde3-4990-bc1a-43e42b5d5d89
TediusTimmy/FunnyMachine
ciw/alt/Expression.cpp
#include "Expression.hpp" #include "SymbolTable.hpp" #include <iostream> void DB_panic (const std::string &, size_t) __attribute__ ((__noreturn__)); void beltVal(short val) { if ((val > 0x7FF) || (val < -0x800)) { std::cout << " LDI " << ((val >> 4) & 0xFFF) << std::endl; std::cout << " ...
TOOL
0.99573
5.975294
e67fa638-0776-47d0-90d5-7d13deb013c1
diegoHurtadoG/AcesEngine
third_party/eigen-3.3.9/doc/snippets/MatrixBase_all.cpp
Vector3f boxMin(Vector3f::Zero()), boxMax(Vector3f::Ones()); Vector3f p0 = Vector3f::Random(), p1 = Vector3f::Random().cwiseAbs(); // let's check if p0 and p1 are inside the axis aligned box defined by the corners boxMin,boxMax: cout << "Is (" << p0.transpose() << ") inside the box: " << ((boxMin.array()<p0.array(...
ALGO
0.930902
3.51303
624a0e39-2cb3-4c00-ba52-c4682418e83d
4fedotov/MarkovChain
src/3rd/icu/source/i18n/rbt_rule.cpp
#include "unicode/utypes.h" #if !UCONFIG_NO_TRANSLITERATION #include "unicode/rep.h" #include "unicode/unifilt.h" #include "unicode/uniset.h" #include "unicode/utf16.h" #include "rbt_rule.h" #include "rbt_data.h" #include "cmemory.h" #include "strmatch.h" #include "strrepl.h" #include "util.h" #include "putilimp.h" ...
TOOL
0.921669
3.1702
24197768-4af5-4556-9784-b09f37cfd138
GabJL/FI2020
docs/tema4/sesion10.11.20/salud.cpp
// Ejercicio largo sobre pasos diarios #include <iostream> using namespace std; const int SEDENTARIO = 2000; const int NORMAL = 6000; const int MAX_DIAS = 31; const int ESPERANDO_SEDENTARIO = 0; const int ESPERANDO_NORMAL = 1; const int ESPERANDO_ACTIVO = 2; int main(){ int pasos, cantidad, num_sedentario, num_nor...
ALGO
0.999355
3.028455
c30e58a7-7b75-4528-94d3-27d888d66178
wdefine/fastpynq
ip/hls/vitis_lib/quantitative_finance/L2/benchmarks/MCEuropeanEngine/src/test.cpp
#include <iostream> #include "utils.hpp" #ifndef HLS_TEST #include "xcl2.hpp" #endif #include <math.h> #include "kernel_mceuropeanengine.hpp" #define XCL_BANK(n) (((unsigned int)(n)) | XCL_MEM_TOPOLOGY) #define XCL_BANK0 XCL_BANK(0) #define XCL_BANK1 XCL_BANK(1) #define XCL_BANK2 XCL_BANK(2) #define XCL_BANK3 XCL_BA...
ALGO
0.868587
5.901638
1c1b0510-7e97-4ff5-a7ce-98b99167e419
JAMM0118/Monitoria-POO
Programacion Imperativa/Ejercicios/numeroMayor_arreglo.cpp
#include<iostream> using namespace std; int main(){ int n; cout<<"Digite el tamaño del arreglo: "; cin>>n; int arreglo[n]; int mayor = 0; for(int i=0; i<n; i++){ cout<<i+1<<" Digite un numero: "; cin>>arreglo[i]; if(arreglo[i] > mayor){ mayor = arreglo[i]; ...
ALGO
0.967522
3.570115
a26b5365-cf40-4e9d-8f30-2ea37ec374ed
thinhvip1/28Tech
bai_tap_c++/struct/nap_chong_toan_tu.cpp
#include <bits/stdc++.h> using namespace std; struct phanso{ int tu, mau; // constructor khong tham so phanso(){ tu = 0; mau = 1; } // constructor co tham so phanso(int a, int b){ tu = a; mau = b; } phanso operator + (const phanso other){ phanso t...
ALGO
0.999651
4.467202
1b9e1264-0499-4ecf-8619-fae364a00bd7
lithonhaeun/algorithm
Algorithm/11866.cpp
#include<iostream> #include<string> using namespace std; struct node { int data; node* next; }; class single { private: int N; node* head; node* tail; public: single() :N{ 0 }, head{ NULL }, tail{ NULL } { } int size() { return N; } void insert(int x) { node* newnode = new node; newnode->data = x; if (N...
ALGO
0.999939
3.327011
5a7fe05e-7523-4ae9-9488-4b0c09aa532d
c910335/NCTU-ItoA-1081
qz1.5/main.cpp
#include <algorithm> #include <iostream> using std::cin; using std::cout; using std::sort; struct C { int u, v, i; }; int n, i, a[1500001], j, u, v; C c[1500000]; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(NULL); cin >> n; for (i = 0; i != n; ++i) { cin >> c[i].u >> c[i].v; c...
ALGO
0.999971
4.181698
cd712474-42e6-4110-b765-9f0ec80bfcaf
rsd15gr3/rsd3_ROS_stack
mission/src/Node.cpp
#include "Node.h" #include "iostream" #include "queue" #include "mission/action_states.h" struct search_graph { unsigned int node; vector<unsigned int> path; }; void Nodes::Construct() { Add(CHARGE); Add(BRICK); Add(DELIVERY); Add(TRANSITION); Add(CELL_1); Add(CELL_2); Add(CELL_3);...
ALGO
0.98642
3.934309
1dd71887-c261-4322-ba72-cb331e8eac44
mangowar/leetcode
kClosest.cpp
#include<iostream> #include<vector> #include<queue> using namespace std; class Solution { public: vector<vector<int>> kClosest(vector<vector<int>>& points, int k) { priority_queue<vector<int>, greater<vector<int>>> dists; vector<vector<int>> res; for(int i = 0; i < points.size(); i++) { ...
ALGO
0.999989
5.256899
b85eff8c-b062-43b4-9844-1e9475b7b5c2
hjc004/C-Language
10.18Code/lainxi2.cpp
#include <stdio.h> int main() { int a,b,c; scanf("%d%d%d",&a,&b,&c); if(a>=b>=c) printf("%d%d%d",a,b,c); else if(a>=c>=b) printf("%d%d%d",a,c,b); else if(b>=a>=c) printf("%d%d%d",b,a,c); else if(b>=c>=a) printf("%d%d%d",b,c,a); else if(c>=a>=b) printf("%d%d%d",c,a,b); else printf("%d%d%d...
ALGO
0.999893
3.457656
7cd8735b-4fe8-4993-a091-613783506c42
suryanandanbabbar/C_OOPS
Functions/overloading.cpp
#include <iostream> // Function to add two integers int add(int a, int b) { return a + b; } // Function to add two floating-point numbers double add(double a, double b) { return a + b; } // Function to add three integers int add(int a, int b, int c) { return a + b + c; } int main() { // Calls int ad...
TOOL
0.962929
6.216312
1fc28f63-67c0-4af1-841f-3a70bc590ccf
andrewei1316/OJSubmit
DATASOURCE_POJSubmit/2388/2388_20140723-093013___RE.cpp
#include<iostream> #include<cstdio> #include<stdlib.h> #include<time.h> #include<algorithm> using namespace std; int n, a[10010]; void swap(int *a, int *b){ int t = *a; *a = *b; *b = t; } void quicksort(int l, int r){ int i, j, t; if(l < r){ srand(time(NULL)); t = l + rand()%(r - ...
ALGO
0.999861
3.861761
fdc3da0c-f455-4f49-b2d3-a5e15fa0ab98
luatil/dp-class
no_adjacent_ones/no_adjacent_ones.cpp
#include <bits/stdc++.h> using namespace std; // Given the length of an array n, calculate the number of different arrays // of length n that only 1's and 0's but do not contain adjacent 1's. auto number_of_no_adjacents_ones(int n) -> int { vector<int> dp(n+1); dp[0] = 1; dp[1] = 2; for(int i = 2; ...
ALGO
0.999995
5.777277
d57d9b77-ce2b-4195-9d68-e176fda6b66e
keijak/comp-pub
cf/contest/1551/A/main.cpp
#include <bits/stdc++.h> #define REP_(i, a_, b_, a, b, ...) \ for (int i = (a), END_##i = (b); i < END_##i; ++i) #define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__) #define ALL(x) std::begin(x), std::end(x) using i64 = long long; template<typename T, typename U> inline bool chmax(T &a, U b) { ret...
ALGO
0.999638
4.811846
b8d1b1e0-8e9a-4abc-8cb1-37fdb6d56418
archit-1997/codeforces
contests/Codeforces_Raif_Round_1/d.cpp
/** * @author : archit1997 * created : Sunday Nov 08, 2020 07:27:25 IST * problem : Bouncing Boomerangs */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <functional> using namespace std; using namespace __gnu_pbds; #define ll long long ...
ALGO
0.999843
3.818426
0cc63b9b-58f9-431e-a190-17eed73f3a50
pkoi5088/ProblemSolve
baekjoon/cpp/9079.cpp
#include <iostream> #include <vector> #define endl '\n' using namespace std; /* https://www.acmicpc.net/problem/9079 */ int min(int a, int b) { if (a == -1) return b; if (b == -1) return a; return a < b ? a : b; } int getCount(int a) { int ret = 0; while (a != 0) { ret += a % 2; a /= 2; } return ret; } ...
ALGO
0.999417
5.005723
daf41b87-069f-4b12-a5da-3bad4dacc9e7
ishandutta2007/codeforces
liouzhou_101/normal/1367/B.cpp
#include <bits/stdc++.h> using namespace std; using ll = int64_t; //using ll = long long; using ull = uint64_t; using i32 = int32_t; using u32 = uint32_t; using i64 = int64_t; using u64 = uint64_t; using f64 = double; using pii = pair<int, int>; using pll = pair<ll, ll>; using ld = double; #define X first #define Y ...
ALGO
0.999929
4.331749
1c0f2ca4-a998-41d9-b64f-833cc5e96ec6
DanielChvat/CIS-17C
Class/RecursionSinCos_double_thirdangle/main.cpp
/* * File: main.cpp * Author: Dr. Mark E. Lehr * Created on April 27th, 2022, 7:30 PM * Purpose: Recursion */ //System Libraries #include <iostream> //Input/Output Library #include <cmath> //Math Library using namespace std; //STD Name-space where Library is compiled //User Libraries //Global Consta...
ALGO
0.999371
5.32312
ddd6be1d-9197-4b09-9775-62dc330687bc
ishandutta2007/codeforces
ehnryx/normal/911/D.cpp
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES typedef long long ll; typedef long double ld; typedef pair<int,int> pii; typedef complex<ld> pt; typedef vector<pt> pol; #define nl '\n' inline void srand() { srand(clock() + time(nullptr)); } const ll INF = 0x3f3f3f3f; const ll INFLL = 0x3f3f3f...
ALGO
0.999979
4.221999
499c140f-80f7-490d-a3cc-04a56ba695fe
SJTUqizhenlin/SjtuOnlineJudge
sjtu-oj1123.cpp
#include <iostream> #include <algorithm> #include <memory.h> using namespace std; class pair_xy { public: int x; int y; pair_xy() :x(0), y(0) {} pair_xy(int xx, int yy) :x(xx), y(yy) {} bool operator<(const pair_xy& b) const { return x < b.x; } bool operator==(const pair_xy& b) const { return x == b.x; }...
ALGO
0.999906
4.552231
ed8c24a4-ab96-41c3-9a82-858cd07d1784
Ph0en1xGSeek/ACM
POJ & HDU/K.Bro_Sorting.cpp
#include <iostream> #include <stdio.h> #include <algorithm> #include <string.h> #define M 1000010 using namespace std; int arr[M]; int m; int lowbit(int x) { return x & (-x); } int getSum(int n) { int sum = 0; while(n >= 1) { sum += arr[n]; n -= lowbit(n); } return sum; } void update(int n, int val) { w...
ALGO
0.999561
3.846314
e77557d6-41d1-47c8-9211-6b4987b66256
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/MixtralExpert/top0-100/uniquePathWithObstacles-Solution.uniquePathsWithObstacles/177747_DoS.cpp
bgp_attr_unknown (struct bgp_attr_parser_args *args) { bgp_size_t total; struct transit *transit; struct attr_extra *attre; struct peer *const peer = args->peer; struct attr *const attr = args->attr; u_char *const startp = args->startp; const u_char type = args->type; const u_char flag = args->fla...
ALGO
0.958889
6.191803
9801fe81-cdd8-417e-b471-036f94b0d5f0
ishandutta2007/codeforces
bohdanpastuschak/normal/735/A.cpp
#define _CRT_SECURE_NO_WARNINGS #include <cstdio> #include <vector> #include <string> #include <iostream> #include <algorithm> #include <map> #include <iterator> #include <functional> #include <set> #include <stack> #include <queue> #include <deque> #include <fstream> #include <iomanip> #include <unordered_map> #includ...
ALGO
0.999976
3.707256
8e5c3919-adb6-455a-a60e-5463873ae3ef
Nikhilpri/SPORTS_PROGRAMMING
2497-maximum-matching-of-players-with-trainers/2497-maximum-matching-of-players-with-trainers.cpp
class Solution { public: int matchPlayersAndTrainers(vector<int>& g, vector<int>& s) { int n=g.size(); int m=s.size(); int i=0,j=0; sort(g.begin(),g.end()); sort(s.begin(),s.end()); int ans=0; while(i<n&&j<m){ if(s[j]>=g[i]){ i++; ...
ALGO
0.999985
5.346723
336624c6-cff0-47f8-a248-e0a8891127f0
liaoyaonline/LeetCodeNote
算法模板/二叉树/反转二叉树的奇书层/main.cpp
/*pow(16,i),queue.front()struct Tree{};vector<string> res(8, "");mp.find(key) == * mp.end() int a[5] = {},vector<int> num(a,a+..) set test; test.insert(1),auto * it = test.begin() bool cmp(const word &num1, const word &num2) { return num1.value != num2.value ? num1.value > num2.value: num1.name < num2.name;} v.ins...
ALGO
0.999937
4.324598
46ca572e-7fe1-46fe-85bb-24bed732ff15
HohyunKim-kr/codingTest-study
programmers/Day19.cpp
// 프로그래머스 LV1 자릿수 더하기 #include <iostream> #include <string> using namespace std; int solution(int n) { int answer = 0; while (n != 0) { answer = answer + n % 10; n = n / 10; } return answer; }
ALGO
0.999782
5.406966
152c115d-0c4e-4d49-8d1b-f8f228522323
GustavoPolicarpo/maratona
URI/MATHEMATICS/2170 - Taxes of Project.cpp
// Author: Gustavo Policarpo // Name: Taxes of Project // Level: 5 // Category: MATHEMATICS // URL: https://www.beecrowd.com.br/judge/en/problems/view/2170 #include<bits/stdc++.h> //LIFE IS NOT A PROBLEM TO BE SOLVED using namespace std; #define rep(i,a,b) for(int i = int(a); i < int(b) ; i++) #define reo(i,a,b) fo...
ALGO
0.985816
3.867487
5345bf93-c6ad-4b70-ae4f-445ee27dc41e
Sanketchicku/Competitve-Coding
Codechef/NCC1903.cpp
#include<iostream> #include<vector> using namespace std; int main() { unsigned long long int t,n,k; cin>>t>>n>>k; while(t--) { unsigned long long int i,a1,temp=0,count =0; vector<unsigned long long int>a; for(i=0;i<k;i++) { cin>>a1; a.push_back(a1); temp = temp+a[i]; if(temp <= n) { co...
ALGO
0.999925
3.324557
c6a6c1b3-0656-4ca8-a247-86a864835fdf
DuyTran1234/1000ExerciseC-
Chuong 1/bai17.cpp
// S(n) = x + x^2/2! + x^3/3! +...+ x^n/n! #include <iostream> using namespace std; int BinhPhuong(int x,int n); int GiaiThua(int n); double Tong(int x, int n); int main() { int x; int n; cout<<"Nhap x: "; cin>>x; cout<<"Nhap n: "; cin>>n; cout<<"S = "<<Tong(x,n)<<endl; } int BinhPhuong(int x,int n) { int Tic...
ALGO
0.999508
4.010027
9ad77155-f69e-4f96-b0ce-2b84032be434
prashanthr11/Data-Structures-and-Algorithms-Specialization
Algorithms on Strings/Week 1/Construct a Trie from a Collection of Patterns.cpp
#include <bits/stdc++.h> using namespace std; unordered_map<char, int> mp; unordered_map<int, char> mp2; static int cnt = 0; struct Trie { struct Trie *root[4] = {0}; int count = 0; }; void add(struct Trie *head, string s) { auto tmp = head; for(auto i:s) { if (tmp -> root[mp[i]]) ...
ALGO
0.999775
4.304008
3a47a66f-5941-47fb-9900-730fb5f2bd9e
hongwenjun/cpp
examples/21_fibonacci.cpp
#include <iostream> #include <vector> using namespace std; #define COUNT 15 int main() { vector<int> F; F.push_back(1); // F(1) = 1 F.push_back(1); // F(2) = 1 for (int i = 2; i < COUNT; i++) { F.push_back(*(F.end() - 1) + *(F.end() - 2)); // F(x) = F(x-1) + // F(x-2) } cout << "Fibonacci nu...
ALGO
0.999804
4.498434
471acf0c-a9cf-4266-8912-0a99c63e15a3
IgorPBorja/competitive-programming
problems/GruPro/2024-06-01/C.cpp
// #define TESTCASES // #define DEBUG #include <bits/stdc++.h> using namespace std; #define vi vector<int> #define vb vector<bool> #define vc vector<char> #define vvi vector<vector<int>> #define vvb vector<vector<bool>> #define vvc vector<vector<char>> #define vvpi vector<vector<pair<int, int>>> #define pii pair<int,...
ALGO
0.999814
3.710153
476053c8-32ed-4d3d-a1d5-0d2b00c03573
Cliffwya/MSU-CSE-232
HW03/c.cpp
#include <iostream> #include <string> #include <vector> using namespace std; int main(){ string input; vector<char>new_string; bool can_print{true}; while(getline(cin,input)){ for(char c:input){ if(isalpha(c) && can_print==true){ new_string.push_back(c); can_prin...
ALGO
0.998224
4.431724
41918572-bfea-4dd7-90a6-5593e85d4aba
Beman/boost-trunk-git-svn
libs/graph/example/kevin-bacon2.cpp
struct vertex_properties { std::string name; template<class Archive> void serialize(Archive & ar, const unsigned int version) { ar & name; } }; struct edge_properties { std::string name; template<class Archive> void serialize(Archive & ar, const unsigned int version) { ar & name; } }; us...
ALGO
0.999794
5.665215
06c51f6c-18de-445f-8c8e-2331227e161a
venkata597/DSA
linear/queue.cpp
#include <iostream> template <typename t,int size> class Queue{ private: t queue[size]; int front = -1,rear = -1; public: void enqueue(t data){ if(rear==size-1){ std::cout << "Queue is full!!" << std::endl; } else{ queue[++rear] = data; } if(...
ALGO
0.874908
5.084706
d5cc740b-962b-47f4-a6f9-a599149e97a8
samithasan142/Online-Judge-Solves
LeetCode/2089. Find Target Indices After Sorting Array.cpp
/* #include<bits/stdc++.h> using namespace std; */ class Solution { public: vector<int> targetIndices(vector<int>& nums, int target) { sort(nums.begin(), nums.end()); vector<int> result; for(int i=0; i<nums.size(); i++){ if(nums[i] == target){ result.push_back(i)...
ALGO
0.999974
6.662382
dde054cd-0432-4943-98e4-a8e569228d23
huyhoang8398/Discreet-Math
Lab1/Ex1.cpp
#include <stdio.h> //input from file void input(FILE * stream,int a[], int *n, int *x) { fscanf(stream,"%d",n); for (int i = 0; i < *n; ++i) { fscanf(stream,"%d", &a[i]); } fscanf(stream,"%d", x); } int fpos(int a[],int n, int x) { int left=0; int right=n-1; int mid; int pos = -1; while (left!=right) { ...
ALGO
0.999851
4.153557
886d7e61-4f84-4f85-9e06-bff62190eb6e
mohammedsafvan/cpp-examples
kv_store.cpp
#include <iostream> #include <optional> #include <string> #include <unordered_map> // Hashmap {key : value} std::unordered_map<std::string, std::string> data_store; // Accepts address of string mentioned so not copying the data // And const means we are not changing the key address void set_value(const std::string &k...
TOOL
0.859717
5.900186
69940da8-99fa-4157-9134-c3c8a04e4752
Saanvi26/GeeksForGeeks_DSA
Medium/Sum Tree/sum-tree.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; struct Node { int data; struct Node *left; struct Node *right; }; // Utility function to create a new Tree Node Node* newNode(int val) { Node* temp = new Node; temp->data = val; temp->left = NULL; temp->right = NULL; ...
ALGO
0.999604
6.96246
00cf9b61-5a88-49d8-a537-40221aee6fee
Avdhesh-Varshney/CPMasterLog
CodeChef/Practice-Problem/PODIUM.cpp
// Podium Finish // Problem Code - PODIUM // https://www.codechef.com/problems/PODIUM // Solution: #include <iostream> using namespace std; int main() { // your code goes here int t; cin >> t; while(t--) { int a, b; cin >> a >> b; cout << a+b << endl; } return 0; }
ALGO
0.999736
6.19317
0f0908e7-0603-40fc-9294-f8972c307833
Jack860921/ROS
navigation/global_planner/src/quadratic_calculator.cpp
#include <global_planner/quadratic_calculator.h> namespace global_planner { float QuadraticCalculator::calculatePotential(float* potential, unsigned char cost, int n, float prev_potential) { // get neighbors float u, d, l, r; l = potential[n - 1]; r = potential[n + 1]; u = potential[n - nx_]; d...
ALGO
0.999842
4.828814
39b0f8fc-52ad-4c97-9a80-8fd24d1ba40d
kushagragarwal2443/C_codes_DSA
Dijsktra.cpp
#include <bits/stdc++.h> using namespace std; typedef pair<long long int,long long int> pi; void dijsktras(vector< long long int >&dista, long long int n,long long int m,long long int source,vector< vector< pi > > &adj) { vector < bool > visit(n,false); vector<long long int>dist(n,10000000000); priority_queue< pi,...
ALGO
0.999869
3.718084
86e03682-b4b8-4d45-9235-80fbcb94353f
Sealonk/Struktur-Data
Linked List Traversal.cpp
#include<iostream> using namespace std; struct node { int info; node *next; } *start, *newptr, *save, *ptr, *rear; node *create_new_node(int); void insert_node(node *); void travers(node *); int main() { start = rear = NULL; int inf; char ch='y'; while(ch=='y' || ch=='Y') { cout<<"Masukkan nilai untuk nod...
ALGO
0.989088
3.913705
c53680e4-301a-4049-bad1-0da70b3198ea
SarojKumarRanjan/DSA-with-cpp
05Sorting/Selection.cpp
#include<bits/stdc++.h> using namespace std; void selection_sort(int arr[], int n){ for (int i = 0; i <= (n-2); i++) { int mini = i; for(int j=i;j<=(n-1);j++){ if(arr[j] < arr[mini]){ mini = j; } } int temp = arr[mini]; arr[mini] = arr[i]; arr[i] = temp; } } in...
ALGO
0.999989
4.798877
37c7fcd6-4e67-45df-a26b-c21dd38c319e
kaushikbalasundar/cpp_dsa_solutions
recursion/valid_brackets.cpp
#include<iostream> #include<vector> #include<string> using namespace std; void generateBrackets(string output_string,int n, int open, int close, int i){ //base case if(i == 2*n){ cout << output_string << endl; return; } //recursive case if(close < open){ generateBrack...
ALGO
0.999826
5.126081
38873bc0-50c1-4782-af75-8c6307eb4784
noureldin-khaled/workspace
C++/UVA/Doves and bombs.cpp
#include <bits/stdc++.h> #define MAX 10050 using namespace std; vector<int> adjlist[MAX]; int dfs_num[MAX]; int dfs_low[MAX]; int parent[MAX]; int n, dfsCounter, root, rootChildren; int groups[MAX]; void tarjan(); void dfs(int u); bool cmp(pair<int, int> a, pair<int, int> b) { if (a.first != b.first) return a...
ALGO
0.999679
4.093775
0609630a-868d-4511-a1f1-bc1dd0ff5f0b
linkeLi0421/no-remove-no-reorder
llvm/lib/Transforms/Scalar/Float2Int.cpp
#include "llvm/InitializePasses.h" #include "llvm/Support/CommandLine.h" #include "llvm/Transforms/Scalar/Float2Int.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/APSInt.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Analysis/GlobalsModRef.h" #include "llvm/IR/Constants.h" #include "llvm/IR/IRBuilder.h" #includ...
TOOL
0.937553
6.044568
80f854e9-ee5b-4dfb-a392-4d1996d9cf5e
leedejun/offlineNavimap
openlr/openlr_stat/openlr_stat.cpp
#include "openlr/openlr_decoder.hpp" #include "routing/road_graph.hpp" #include "indexer/classificator_loader.hpp" #include "indexer/data_source.hpp" #include "storage/country_parent_getter.hpp" #include "platform/local_country_file.hpp" #include "platform/local_country_file_utils.hpp" #include "platform/platform.h...
DATA
0.966222
6.444098
06175200-a010-4c2a-bbd9-dc704bed3250
rutsky/semester06
Processors_architecture/PCX/src/pcx_decode_14.cpp
/* pcx_decode_14.cpp * PCX fast decoding routine. * Implementation #14. * Vladimir Rutsky <<EMAIL>> * 07.06.2009 */ #include "pcx.h" // // #14. I/O by blindly paired 2 DWORDs using MMX + output using SSE. // #define DO_4_TIMES(expr) expr expr expr expr namespace pcx { void decode_14( unsigned char const *inp...
ALGO
0.963269
5.80704
ba57d6ed-f37b-48b0-84e7-84ac88c139d0
HekpoMaH/Olimpiads
lekcii_peev/Tasks/TwoDim/monoa/distance.cpp
#include<bits/stdc++.h> using namespace std; int n; unsigned int ans[1<<21+1]; int lev,a[29][3];; unsigned int go(int mask, int level,int lp) { unsigned int cur=0,best=0; if(level>=lev)return 0; if(ans[mask]!=-1)return ans[mask]; for(int i=0;i<n-1;i++)if((mask&(1<<i))==0) { for(int j=i+1;j<...
ALGO
0.99904
3.485783
edcd7732-cbc0-464f-9786-a311ef2e01c2
twindb/twindb-xtrabackup-80
boost_1_68_0/libs/numeric/ublas/test/test_triangular.cpp
#include <iostream> #include <stdlib.h> #include <cmath> #include <boost/numeric/ublas/vector.hpp> #include <boost/numeric/ublas/matrix.hpp> #include <boost/numeric/ublas/matrix_sparse.hpp> #include <boost/numeric/ublas/triangular.hpp> #include <boost/numeric/ublas/io.hpp> #include <boost/timer/timer.hpp> namespace ...
ALGO
0.999631
4.725535
4b9b9532-018d-45f8-96a2-3dcfbe201c6f
MijaTola/Codeforce
1133D.cpp
#include <bits/stdc++.h> using namespace std; int a[200010]; int b[200010]; int main() { int n; cin >> n; for (int i = 0; i < n; ++i) cin >> a[i]; for (int i = 0; i < n; ++i) cin >> b[i]; map<pair<bool,pair<int,int> > ,int> mp; int cnt = 0; for (int i = 0; i < n; +...
ALGO
0.999938
3.54966
fae79477-2d6f-458b-b49b-a0439a037780
dl8sd11/online-judge
atcoder/Coloring_Dominoes.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i,n) for(int i=0;i<n;i++) #define REP1(i,n) for(int i=1;i<=n;i++) #define SZ(i) int(i.size()) #ifdef tmd #define IOS() #define debug(...) fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);_do(__VA_ARGS__); template...
ALGO
0.99999
4.25014
1d52990c-1f5c-4be6-9e11-871d9cf761f8
thegamer1907/Code_Analysis
contest/1542581781.cpp
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <map> #include <iostream> #include <string> #include <vector> #include <set> #include <algorithm> using namespace std; typedef long long LL; int n, K, sum[100]; vector <int> v; bool Judge(int S) { int cnt[6]; memset(cnt...
ALGO
0.999743
3.734875
26888734-a365-4f6a-94f8-327051b856af
devastating/misc
coding_exercise/lru_cache.cpp
#include <iostream> #include <vector> #include <unordered_map> #include <assert.h> using namespace std; class LRUCache{ struct CacheElem { int key; int value; //struct CacheElem *next; //struct CacheElem *prev; struct CacheElem *lru_next; struct CacheElem *lru_prev; }; public: LRUCache(int capacit...
ALGO
0.994018
5.674872
fc0e39b6-4f47-4239-8df5-50125f689ceb
Kushagra-Mangalam/PEP_DSA_KUSH
dsa/pep/trees/binary_search_tree.cpp
#include<iostream> using namespace std; class node{ public : int data; node* left; node* right; node(int val){ data=val; left=NULL; right=NULL; } }; node* insertnode(node* root , int val){ if(root==NULL){ return new node(val); } if(val<root->data){ ...
ALGO
0.99984
4.586161
324b04de-3fe4-4d3d-a53c-2f1ca69e6df5
ishandutta2007/codeforces
hazyknight/normal/781/C.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <time.h> #include <iostream> #include <algorithm> #include <fstream> #include <iomanip> #include <vector> #include <bitset> #include <stack> #include <queue> #include <set> #include <map> using namespace std; const int MAXN = 200005...
ALGO
0.999985
3.606927
dfd944c4-72ff-491d-b207-b42598ac16dc
Pure36/myTest
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
50827356-1826-42d7-8ed8-9a5de9b82622
AFMartinezF/mfem_prueba
mfem-4.7/fem/gridfunc.cpp
// Implementation of GridFunction #include "gridfunc.hpp" #include "quadinterpolator.hpp" #include "../mesh/nurbs.hpp" #include "../general/text.hpp" #ifdef MFEM_USE_MPI #include "pfespace.hpp" #endif #include <limits> #include <cstring> #include <string> #include <cmath> #include <iostream> #include <algorithm> na...
TOOL
0.955843
5.712627
3e08b7e8-b538-49c5-a614-3f205d6c4a57
BLBT1/MyLeetcodeSolution
1405.longest-happy-string.cpp
/* * @lc app=leetcode id=1405 lang=cpp * * [1405] Longest Happy String */ // @lc code=start class Solution { public: string longestDiverseString(int a, int b, int c) { using PIC = pair<int, char>; string res; res.reserve(a + b + c); priority_queue<PIC> pq; // max heap ...
ALGO
0.999763
5.91497
89f27bb9-5020-4ede-840a-3f9047cabcb1
abhi00999/LeetCode-Questions
45-jump-game-ii/45-jump-game-ii.cpp
class Solution { public: int jump(vector<int>& nums) { int n=nums.size(); vector<int> dp(n,n+1); dp[0]=0; for(int i=0;i<n;i++){ int start= i; int end= min(nums[i]+i, n-1); for(int j=start;j<=end;j++){ ...
ALGO
0.999974
5.951319