uuid
stringlengths
36
36
repo_name
stringlengths
5
123
relative_path
stringlengths
5
4k
content
stringlengths
33
2.85M
category
stringclasses
6 values
algo_rel_score
float64
0.85
1
quality_score
float64
3
8.76
2791f966-b166-4335-aae4-c9309a3c719c
ThalesDaviSouza/Competitive-Programming
src/queue/Copa do Mundo/copa_do_mundo.cpp
#include <iostream> #include <queue> using namespace std; #define NUM_JOGOS 15 int main(){ queue<char> times; times.push('A'); times.push('B'); times.push('C'); times.push('D'); times.push('E'); times.push('F'); times.push('G'); times.push('H'); times.push('I'); times...
ALGO
0.999896
3.519405
e1d6d055-9da8-4743-8540-2e51e3bff14c
thehashmap/leetcode
Maximize The Array - GFG/maximize-the-array.cpp
// { Driver Code Starts //Initial template for C++ #include <bits/stdc++.h> #include <unordered_map> using namespace std; // } Driver Code Ends //User function template for C++ class Solution { public: vector<int> maximizeArray(int arr1[], int arr2[], int n) { // code here vector<int> res; ...
ALGO
0.999976
4.820934
4e29cc44-a6c2-4af0-9031-614757bf6882
ishandutta2007/codeforces
dragonslayerintraining/normal/1205/D.cpp
#include <cstdio> #include <vector> #include <algorithm> std::vector<int> edges[1005]; int size[1005]; int pot[1005]; void dfs_size(int node,int parent){ size[node]=1; for(int child:edges[node]){ if(child==parent) continue; dfs_size(child,node); size[node]+=size[child]; } } int find_centroid(int no...
ALGO
0.999898
3.899829
d52a3364-3a46-4544-ab98-807d60aeb239
jh280722/online-judge
solve/codeforce/20200312/C.cpp
#include <bits/stdc++.h> #define MAX 501 #define MOD 1000000 #define INF 1000000000 #define all(v) v.begin(), v.end() #define pii pair<int,int> #define ll long long #define vi vector<int> #define vii vector<ll> #define fu(i,a,j) for(int i=a;i<j;i++) #define fd(i,a,j) for(int i=a;i>=j;i--) using namespace std; ll gcd(l...
ALGO
0.999907
4.19818
4ce7b227-55e6-4fff-a03d-e5d3a07e2371
Properks/Start_C_Plus_Plus
Chapter_8/Operator_overloading.cpp
#include<iostream> #include<string> using namespace std; class Sum_String { private: char *StrArr; int len; public: Sum_String(); // Constructor. ~Sum_String(); Sum_String operator +(const Sum_String &A); // Combine two strings '+'. Sum_String& operator +=(const Sum_String &A); // Combine two s...
ALGO
0.965142
4.386912
5d1f5089-e30b-4ee7-867b-6e521dda0236
argi-giavris/Project-Algorithms
Part2/frechet.cpp
#include <vector> #include <limits> #include <ctime> #include "frechet.hpp" namespace Frechet { namespace Continuous { distance_t error = 1; bool round = true; std::string Distance::repr() const { std::stringstream ss; ss << value; return ss.str(); } Distance distance(const Curve &curve1, cons...
ALGO
0.999887
6.801939
c30da82c-7e6e-4751-a6ff-7d357700a5a7
younes38/Competitive-Programming
UVa-Solutions/Uva 264.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll ; #define all(a) a.begin(),a.end() #define open_file freopen("input.txt","r",stdin); #define write_file freopen("output.txt","w",stdout); #define mem(A,v) memset(A, v, sizeof(A)); #define show(x) cout << x << endl #define forn(i,n) for(i=0;i<n;i++) #d...
ALGO
0.993107
4.270526
84ffc5f6-704a-4ff0-bbea-486fe118b48a
junlong-gao/recreations
src/code_practise/leetcode/cpp/00145.cpp
#define CATCH_CONFIG_MAIN #include "catch.hpp" #include <vector> #include <deque> #include <algorithm> #include <unordered_map> #include <unordered_set> namespace{ using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; class ...
ALGO
0.999406
6.427893
140e5939-19bb-43eb-80b6-bf4acbf4b62f
MrityunjayNPandey/vscode
CP/B_Playing_with_GCD.cpp
/** * codeforces: _joKer_0 * codechef: joker_0000 * created: 10-10-2022 20:49:45 **/ // clang-format off #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; #define endl "\n" #ifdef DEBUG #include "algo/debug.h" #else #define debug(...) ...
ALGO
0.999946
4.672001
ba34f545-e62f-425c-a1d5-e67479437416
ishandutta2007/codeforces
shayan.p/normal/611/E.cpp
// Remember... #include<bits/stdc++.h> #define F first #define S second #define PB push_back #define sz(s) int((s).size()) #define bit(n,k) (((n)>>(k))&1) using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; const int maxn=2e5+10,mod=1e9+7; const ll inf=1e18; multiset<int...
ALGO
0.99996
3.781703
a9b4b3e0-b129-4f43-9522-69a2e012bc33
jpsxlr8/codes
Greedy/MaximizeToys.cpp
// Given an array arr[ ] of length N consisting cost of N toys and an integer K depicting the amount with you. Your task is to find maximum number of toys you can buy with K amount. class Solution{ public: int toyCount(int N, int K, vector<int> arr) { int count_toys=0; sort(arr.begin(),arr.end(...
ALGO
0.99989
5.618314
738618ba-e114-4e54-a724-25abb792cfbf
rammendozaa/Programacion
UVA/146.cpp
/* Accepted */ #include <iostream> #include <string> #include <algorithm> using namespace std; int main(void) { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); string entrada, next; while(cin >> entrada && entrada != "#") { char input[entrada.length()], perm[entrada.length()]; ...
ALGO
0.999973
4.189938
db60a87e-3210-403e-bd84-bc11b789bcd6
saha2023/Algoexpert-Questions
Easy/removeDuplicateFromAlinkedList.cpp
class LinkedList { public: int value; LinkedList *next = nullptr; LinkedList(int value) { this->value = value; } }; LinkedList *removeDuplicatesFromLinkedList(LinkedList *linkedList) { // Write your code here. LinkedList *prev = linkedList; LinkedList *curr = linkedList; while(curr){ do{ cur...
ALGO
0.999762
5.525556
ea8e0a7b-91a1-400a-8085-bdf823212e85
zyin422/CPGrind
X_Camp/402H/G_PermutationSubarray.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define endl "\n" #define f first #define s second int INF; signed main() { IOS; int n, q; cin >> n >> q; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch()...
ALGO
0.999912
4.09838
a777241b-3fd8-4605-a44c-8ce3d3b6ba21
its-mahi/striver_sde_sheet
Day 2 : Arrays Part II/Merge Overlapping Subintervals.cpp
/** * @author : its_mahi * * Code: https://leetcode.com/problems/merge-intervals/ * Article: https://takeuforward.org/data-structure/merge-overlapping-sub-intervals/ * * Desc: Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlap...
ALGO
0.999999
6.382832
34814ad7-9ff4-4026-a43e-0932e77a5b51
Celesta01/Chat_App
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.9988
6.76073
5cd1b750-17e3-427f-b087-dcb8c7abfcdf
cechallenge/2025
llvm/llvm/tools/llvm-mt/llvm-mt.cpp
#include "llvm/Option/Arg.h" #include "llvm/Option/ArgList.h" #include "llvm/Option/Option.h" #include "llvm/Support/Error.h" #include "llvm/Support/FileOutputBuffer.h" #include "llvm/Support/LLVMDriver.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Path.h" #include "llvm/Support/PrettyStackTrace.h" #...
TOOL
0.920584
7.65257
dabc172d-e8b3-4437-8176-310cd139f93f
Umair505/Cplusplus_For_DSA
Midterm/Monkey.cpp
#include<bits/stdc++.h> using namespace std; int main() { char s[100001]; while(cin.getline(s,100001)){ int n = strlen(s); sort(s,s+n); for (int i = 0; i < n; i++) { if (s[i] == ' ') { continue; } cout << s[i]; } cout<<endl; } return 0; }
ALGO
0.999865
3.298492
498d5117-95ec-4496-84f8-f695b982773b
HyZhenSzu/LeecodeCollection
Leecode/151_ReverseWords.cpp
// 给你一个字符串 s ,请你反转字符串中 单词 的顺序。 // 单词 是由非空格字符组成的字符串。s 中使用至少一个空格将字符串中的 单词 分隔开。 // 返回 单词 顺序颠倒且 单词 之间用单个空格连接的结果字符串。 // 注意:输入字符串 s中可能会存在前导空格、尾随空格或者单词间的多个空格。返回的结果字符串中,单词间应当仅用单个空格分隔,且不包含任何额外的空格。 // 示例 1: // 输入:s = "the sky is blue" // 输出:"blue is sky the" // 示例 2: // 输入:s = " hello world " // 输出:"world hello" // 解释:反转后的字符...
ALGO
0.999923
6.196792
d8575c64-7428-4393-b9df-6f12c893d596
chesser-y/Design-and-Analysis-of-Algorithms
算法设计与分析/算法实验/lab3.cpp
#include<bits/stdc++.h> using namespace std; const int N=1000; int n; double ans; double x[N],y[N],k[N],d[N][N]; int main() { scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%lf",&x[i]); for(int j=1;j<=n;j++) scanf("%lf",&y[j]); for(int i=1;i<=n;i++) //ʼ k[i]=y[i]-x[i]; for(int i=1;i<=n;i++)//ԽԪ { double...
ALGO
0.999781
3.540971
44049919-c013-410e-9ce0-163cd1a724ae
ChaoHuang2018/POLAR_Tool
examples/AttitudeControl/flowstar_1step_v1.cpp
#include "../../POLAR/NeuralNetwork.h" //#include "../flowstar-toolbox/Constraint.h" using namespace std; using namespace flowstar; /* ******** Argument list ******** argv[1]: order argv[2]: x0_min argv[3]: x0_max argv[4]: x1_min argv[5]: x1_max argv[6]: x2_min argv[7]: x2_max argv[8]: x3_min argv[9]: x3_max argv[10...
ALGO
0.999867
5.593884
1498bb5b-7b86-45aa-a739-0ff702cb3db3
TH-takahirohara/atcoder_solve
abc250-259/abc252/e_road_reduction__after_contest.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define rep(i,a,b) for(int i=a;i<b;i++) #define fore(i,a) for(auto &i:a) struct Edge { ll to; ll w; Edge(ll to, ll w) : to(to), w(w) {} }; typedef vector<vector<Edge> > Graph; template<class T> bool chmin(T &a, ...
ALGO
0.999995
3.828959
cd74fbb9-c2db-473d-823f-e0758c60c72a
ayan2809/Competitive-Coding
CodeChef/Starters/Starters 6/MAXARXOR.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int main() { ll t=0; cin>>t; while(t--) { ll n=0,k=0; cin>>n>>k; ll maxi=pow(2,n)-1; ll answer=0; if(k<=(maxi+1)/2) answer=2*(k*maxi); else answer=2*((maxi+1)/2)*maxi; cout<<answer<<endl; } }
ALGO
0.99995
3.942128
8bac4c62-87dd-480d-8667-52b7bcbabf51
vo-cplus-plus/C_Plus_Plus
Web15/10_find.cpp
#include <set> #include <vector> #include <iostream> #include <algorithm> #include <iomanip> #include <fstream> using namespace std; int main() { set<int> s = {5, 8, 13, 2, 3, 4, 7}; vector<int> v = {5, 8, 13, 2, 3, 4, 7}; // возвращает итератор на значение 5 в упорядоченном множестве auto iter_value_5 = fi...
ALGO
0.995819
4.267884
a44b6af1-da93-4af3-82b5-f9ff2358c529
Marcelo-ML/MAC0214
Códigos/CF_GLOBAL23/d.cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back #define fs first #define sc second #define int long long const int MAXN = 200010; int n, k; vector<int> filhos[MAXN]; int score[MAXN]; map<int,int> DP[MAXN]; int dfs(int v, int P){ if(DP[v].find(P) != DP[v].end()) return DP[v][P]; if(f...
ALGO
0.9999
3.460828
a624a58e-6bca-418a-baee-07087bde7874
acf87/WPEWebKit-2.38
Source/JavaScriptCore/b3/B3BreakCriticalEdges.cpp
#include "config.h" #include "B3BreakCriticalEdges.h" #if ENABLE(B3_JIT) #include "B3BasicBlockInlines.h" #include "B3BlockInsertionSet.h" #include "B3ValueInlines.h" namespace JSC { namespace B3 { void breakCriticalEdges(Procedure& proc) { BlockInsertionSet insertionSet(proc); for (BasicBlock* block :...
TOOL
0.928657
5.855061
5306e9ab-0a58-4636-ad04-05ad6acbb10b
qqqqq4545/LeetCode
week4/25_Reverse_Nodes_in_k-Group.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* reverseKGroup(ListNode* head, i...
ALGO
0.999996
6.043197
55072534-e77a-422e-8bab-495c0139bc97
Kritarth2002/dsa-practice
linked list/insertion.cpp
#include <iostream> using namespace std; class ComplexNumbers { // Complete this class public: int real; int img; ComplexNumbers(int real,int img) { this->real=real; this->img=img; } void plus(ComplexNumbers const &c) { real=real+c.real; img=img+c.img;...
ALGO
0.99914
5.374598
e2026e3c-0772-43d1-accd-28b10281dcd2
cpp20120/sibsutis
2semester/SAOD/12_lab/src/main.cpp
#include "../include/Hash.hpp" #include "../include/Lists.hpp" #include "../include/Sorts.hpp" #include <cmath> #include <cstring> #include <iomanip> #include <iostream> bool is_simple(int num) { bool res = true; for (int k = 2; k <= static_cast<int>(std::sqrt(num) + 1); k++) { if (num % k == 0) { ...
ALGO
0.989338
4.453459
1252647b-2d3e-4519-b922-849e5ca8e292
emperor-2001/DSA-
Stacks/StackUsingSTL.cpp
#include<bits/stdc++.h> using namespace std; #define gc getchar_unlocked #define fo(i,n) for(int i=0;i<n;i++) #define Fo(i,k,n) for(int i=k;k<n?i<n:i>n;k<n?i+=1:i-=1) #define ll long long #define si(x) scanf("%d",&x) #define sl(x) scanf("%lld",&x) #define ss(s) scanf("%s",s) #define pi(x) printf("%d\n",x) #define pl(x)...
ALGO
0.999706
3.181123
4bccf880-01c7-4a2c-994e-0d8c5191177c
emthrm/cp-library
test/math/twelvefold_way/stirling_number/stirling_number_of_the_first_kind_init_with_fps.test.cpp
/* * @title 数学/写像12相/スターリング数/第1種スターリング数の数表 形式的冪級数版 * * verification-helper: PROBLEM https://judge.yosupo.jp/problem/stirling_number_of_the_first_kind */ #include <iostream> #include <vector> #include "emthrm/math/convolution/number_theoretic_transform.hpp" #include "emthrm/math/formal_power_series/formal_power_se...
ALGO
0.999892
4.450423
008122e3-1838-447c-8bd4-ad0cff03b605
javagovindsharma/leetscode
solution/0100-0199/0190.Reverse Bits/Solution.cpp
class Solution { public: uint32_t reverseBits(uint32_t n) { uint32_t ans = 0; for (int i = 0; i < 32 && n; ++i) { ans |= (n & 1) << (31 - i); n >>= 1; } return ans; } };
ALGO
0.999964
6.031476
875b3577-8020-4961-adce-d8508d84d35b
Compiler-Dependency-Analysis/llvm-levioso
compiler-rt/lib/tsan/rtl/tsan_fd.cpp
#include "tsan_fd.h" #include "tsan_rtl.h" #include <sanitizer_common/sanitizer_atomic.h> namespace __tsan { const int kTableSizeL1 = 1024; const int kTableSizeL2 = 1024; const int kTableSize = kTableSizeL1 * kTableSizeL2; struct FdSync { atomic_uint64_t rc; }; struct FdDesc { FdSync *sync; int creation_tid; ...
TOOL
0.861317
6.908645
01a5dbe4-e4f6-4fa5-9d18-4d0d1e1e75ed
ishandutta2007/codeforces
icecuber/normal/1146/H.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll,ll> point; #define x first #define y second ull mask[300][300][5]; inline ll popcount64c(uint64_t x) { const uint64_t m1 = 0x5555555555555555; //binary: 0101... const uint64_t m2 = 0x333333333333...
ALGO
0.999775
3.742937
118dde9b-9ce8-450b-a51e-ce6ca28cc080
Euraba/InfoComp
logic.cpp
#include <iostream> #include <fstream> #include <map> #include <string> #include <vector> #include <utility> #include <stdexcept> #include <bitset> std::fstream in ("logic.in", std::ios::in | std::ios::binary) ; std::fstream out ("logic.out", std::ios::out) ; // more about this class here https://github.com/Euraba/B...
ALGO
0.999977
4.925118
07917042-4e57-47a7-83e9-1e129e01abca
FACT0RN/FACT0RN
src/test/fuzz/tx_pool.cpp
#include <consensus/validation.h> #include <miner.h> #include <test/fuzz/FuzzedDataProvider.h> #include <test/fuzz/fuzz.h> #include <test/fuzz/util.h> #include <test/util/mining.h> #include <test/util/script.h> #include <test/util/setup_common.h> #include <util/rbf.h> #include <validation.h> #include <validationinterfa...
TEST
0.902293
5.979531
58890bc8-10fa-4c73-8e97-5050e8d854ee
goodchong/abacus_cusolvermp
source/module_hamilt_lcao/hamilt_lcaodft/FORCE_gamma_vl.cpp
#include "FORCE_gamma.h" #include "module_hamilt_pw/hamilt_pwdft/global.h" #include "module_base/timer.h" void Force_LCAO_gamma::cal_fvl_dphi( double*** DM_in, const bool isforce, const bool isstress, const elecstate::Potential* pot_in, Gint_Gamma &gint_gamma, ModuleBase::matrix& fvl_dphi, ModuleBa...
ALGO
0.994719
4.844219
d2d35077-c639-4347-9cb8-f0471d4d1083
rainbow-auto/rainbow-codes
Comp/23-09-09 ZR-CSP-2/A.cpp
#include <iostream> using namespace std; const int maxn = 200005; int n; int a[maxn]; namespace Task1 { inline void solve () { int ans = 0; for (int i = 1; i <= n; i++) { for (int j = i + 1; j <= n; j++) { if ((a[i] - a[j]) % 200 == 0) { ans ++; ...
ALGO
0.999665
3.890429
0a7cd963-0c3a-4705-9198-6fa8113fcfe2
ducnguyen96/leetcode
stack/valid-parenthesis/main.cpp
#include <iostream> #include <stack> #include <string> using namespace std; class Solution { public: bool isValid(string s) { stack<char> st; for (auto ch : s) { if (ch == '(' || ch == '[' || ch == '{') { st.push(ch); } else if (st.size() == 0) { return false; } else if ((ch...
ALGO
0.996643
6.604409
04b1ff43-b788-4486-b4f0-95f29a90e7ff
darioPM2002/trabajosProg
cpp/3semestre/clase_algoritmos/repositorio/tc1031-master/tc1031-master/Tema_5_Ordenamiento/biblioteca/biblioteca/Libro.cpp
#include "Libro.hpp" bool Libro::compara_titulo_asc(Libro a, Libro b) { return a.Titulo() < b.Titulo(); } bool Libro::compara_titulo_desc(Libro a, Libro b) { return a.Titulo() > b.Titulo(); } bool Libro::compara_titulo_eq(Libro a, Libro b) { return a.Titulo() == b.Titulo(); } bool Libro::compara_autor_asc...
TOOL
0.950884
4.647687
455f4f02-c5b1-40fc-8d7a-a8c7626c93f1
Sujal-Burad/Sujal-CSES-solutions
Graph Algorithms/19] Planet Queries I.cpp
#include <bits/stdc++.h> using namespace std; // Main idea = This uses the important concept of binary jumping. // parent[i][j] corresponds to i's (2 ^ j)th parent. // We can answer each query based on the binary representation of the distance. // Maximum depth of queries = ceil(log2(10 ^ 9)) = 30 // Time Complexit...
ALGO
0.999948
4.764462
81f2f9ca-b0b5-4324-8407-3251a43ce008
mastersobg/contests
yandex/trains/28.09.2013/H/src/H.cpp
#include <iostream> #include <cstdio> #include <cassert> #include <algorithm> #include <cmath> #include <ctime> #include <stdint.h> #include <vector> #include <map> #include <set> #include <queue> #include <cstring> #include <bitset> #include <deque> #include <list> #include <stack> using namespace std; typedef long...
ALGO
0.999988
3.775747
fedae6d5-a323-4fcb-8182-7566b9b64148
nitinnarwal/cp-library
geometry/rectange.cpp
#include <iostream> #include <vector> #include <unordered_map> #include <cmath> #include <cstring> #include <algorithm> #include <set> #include <map> #include <queue> #include <string> #include <sstream> #include <iomanip> using namespace std; #define int long long const int M = 1e9 + 7; const int INF = 1e18 + 5; cla...
ALGO
0.9996
3.830456
62e45811-3227-4cb2-af2c-5ddc39db44f3
krishnateja-nanduri/MyCodePractice
Mirror Tree.cpp
/* Please note that it's Function problem i.e. you need to write your solution in the form of Function(s) only. Driver Code to call/invoke your function would be added by GfG's Online Judge.*/ //function Template for C++ /* A binary tree node has data, pointer to left child and a pointer to right child / struct Nod...
ALGO
0.99989
5.477605
3f60232b-6f72-498c-abec-9dff64a071f2
ShiZhuming/pku-dsalgo
chapter3/2.cpp
// 22:15 // 22:59 #include<cstdio> #include<iostream> #include<stack> #include<string.h> using namespace std; int factor(); int term(); int exp(); int exp() { int value = term(); while (true) { switch (cin.peek()) { case '+': getchar(); value += term(); ...
ALGO
0.999555
3.389179
06c26ecb-d5a2-4fb8-b76f-fe0d87aa2e52
jakechen9/JCPlugins
SDKs/JUCE/modules/juce_gui_basics/components/juce_FocusTraverser.cpp
namespace juce { namespace FocusHelpers { static int getOrder (const Component* c) { auto order = c->getExplicitFocusOrder(); return order > 0 ? order : std::numeric_limits<int>::max(); } template <typename FocusContainerFn> static void findAllComponents (Component* parent, ...
TOOL
0.868622
7.906798
982429c3-2f7e-491c-b7e7-ecdabfd409d4
aryan999444/DSA_CPP
06_Lec_binNum/01_decToBinary.cpp
#include<iostream> using namespace std; int DecToBinary(int decNum){ int ans = 0, pow = 1; while (decNum > 0) { int rem = decNum % 2; decNum /= 2; ans += rem * pow; pow *= 10; } return ans; // Binary representation answer } // Binary to decimal code here int ...
ALGO
0.995703
5.90029
85038bb2-4651-4988-8dca-90316e74b2f7
Pyxis66/yally3dslicer
src/libigl/igl/connect_boundary_to_infinity.cpp
template <typename DerivedF, typename DerivedFO> IGL_INLINE void igl::connect_boundary_to_infinity( const Eigen::PlainObjectBase<DerivedF> & F, Eigen::PlainObjectBase<DerivedFO> & FO) { return connect_boundary_to_infinity(F,F.maxCoeff(),FO); } template <typename DerivedF, typename DerivedFO> IGL_INLINE void igl::...
ALGO
0.885386
5.795033
56423d5e-bf9f-4406-afea-5a164740cff5
zmd9220/object-trainning
객체2 5주차 과제/객체2 5주차 과제/Main.cpp
#include <iostream> #include "Distance.h" #include <string> using namespace std; string TnF(int t) // TRUE FALSE ڷ ȯ Լ { if (t == 1) { return "TRUE"; } else return "FALSE"; } int main() { Distance a(1, 2, 4); Distance b(1, 1, 4); Distance c(0, 0, 0); int tnf = a == b; c = a + b; cout << "DISTANCE CALCU...
TOOL
0.969807
4.453135
8645958c-921c-4440-9523-66b4a00311c4
arshthakur/Cplusplus-programs
reverse.cpp
#include<iostream> using namespace std; int main() { int n,reverse=0,remainder; cout<<"enter the value of n: "; cin>>n; while(n!=0){ remainder=n%10; reverse= reverse*10+remainder; n/=10; } cout<<"reverse: "<<reverse; return 0; }
ALGO
0.999612
3.913543
c046982c-983e-4be6-a1ef-8e3b8416373b
shivgupta198922/CodeForces-Master-in-cpp
1433A.cpp
/* ~ Author : @tridib_2003 */ #pragma GCC optimize("O3") // #pragma GCC optimize("Ofast") // #pragma GCC target("avx,avx2,fma") #include<bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_orde...
ALGO
0.999124
5.474644
604a9cf0-1db1-437a-bd72-5194bf161120
yaowalukth/LAB
6.cpp
#include <stdio.h> int main() { int number ; printf( "Enter your number : " ) ; scanf( "%d" , &number ) ; if(number % 2 == 1) { for(int i = 1 ; i <= number ; i += 2 ) { printf( "%d ", i ) ; } }else if(number % 2 != 1) { for(int i = number ; i >= 0 ; i -= 2) { ...
ALGO
0.994125
4.057306
1c787d5e-f547-4e53-ab74-eacde044cf9d
abhinavtiwari1729/Leetcode_solutions
UniqueNumberOccurences_1207.cpp
class Solution { public: bool uniqueOccurrences(vector<int>& arr) { unordered_map<int , int> ele_to_occ_map; for (auto ele : arr){ ele_to_occ_map[ele]++; } unordered_map<int, int> occ_to_ele_map; for (auto it = ele_to_occ_map.begin() ; it != ele_to_occ_m...
ALGO
0.99951
6.056291
9b651e7a-7714-4146-bb70-73bda64f19da
bliscosque/leetcode
CPP/104.maximum-depth-of-binary-tree.cpp
/* * @lc app=leetcode id=104 lang=cpp * * [104] Maximum Depth of Binary Tree */ // #include <bits/stdc++.h> // using namespace std; // struct TreeNode { // int val; // TreeNode *left; // TreeNode *right; // TreeNode() : val(0), left(nullptr), right(nullptr) {} // TreeNode(int x) : val(x),...
ALGO
0.999882
6.674325
e4f7276a-328e-4f88-8c7b-89b63408e242
Mateusg2022/CODEFORCES
800*/Anton_and_Darik_play_chess.cpp
#include <iostream> #include <string> using namespace std; #define pb push_back int main(){ string s; int n; cin >> n; char c; for(int i=0;i<n;i++){ cin >> c; s.pb(c); } int A_wins_count=0, D_wins_count=0; for(int i=0;i<n;i++){ if(s[i] == 'D') D_wins_count++; else A_wins_co...
ALGO
0.999822
4.204492
80ac2a08-6fa3-4625-a73c-52787d6cad7a
yonsei-hpcp/gcom
third-party/boost_1_86_0/libs/geometry/example/05_b_overlay_linestring_polygon_example.cpp
// Boost.Geometry (aka GGL, Generic Geometry Library) // NOTE: this example is obsolete. Boost.Geometry can now // overlay linestrings/polygons. // This sample will be removed in next version. #include <fstream> #include <iostream> #include <string> #include <vector> #include <boost/geometry/geometry.hpp> #include <...
ALGO
0.962246
6.907179
0f261435-3f72-452d-9179-82ace228aa7a
mcchase94/Self-Driving-Car
Project 7 - Highway Driving Path Planning/src/Eigen-3.3/unsupported/test/NumericalDiff.cpp
#include <stdio.h> #include "main.h" #include <unsupported/Eigen/NumericalDiff> // Generic functor template<typename _Scalar, int NX=Dynamic, int NY=Dynamic> struct Functor { typedef _Scalar Scalar; enum { InputsAtCompileTime = NX, ValuesAtCompileTime = NY }; typedef Matrix<Scalar,InputsAtCompileT...
TEST
0.980334
6.185318
617f1341-990b-4401-9b69-7f4fcb6677b3
Taejin1221/MyStudy
Algorithms/FibonacciNumber/FibonacciNumber1.cpp
// FibonacciNumber1.cpp /* case 1: Fibonacci with Recursion*/ /* Time: O(2^n), Space: O(n) */ int Fibonacci( int n ) { if ( n < 3 ) return 1; else return ( Fibonacci( n - 1 ) + Fibonacci( n - 2 ) ); }
ALGO
0.999082
4.77615
69cf56fa-f424-456a-bc4d-59ea99832af7
Wankupi/cpp
数据结构/可并堆/LuoguP1456 Monkey King.cpp
#include <algorithm> #include <cstdio> const int maxn = 100003; int n = 0, m = 0; int a[maxn]; int ls[maxn], rs[maxn], dis[maxn]; void node(int k) { ls[k] = rs[k] = 0; dis[k] = 0; } int combine(int x, int y) { if (x == 0 || y == 0) return x | y; if (a[x] < a[y]) std::swap(x, y); rs[x] = combine(rs[x], y); if (dis...
ALGO
0.999973
3.585435
8abfd12d-f777-4f3a-8c3c-35b3460ab1b4
kayhanayar/paralelProgramlama
Hafta07/07 Ozel degiskenlerin disari aktarilmasi/main.cpp
#include<omp.h> #include<iostream> using namespace std; int main() { int adet = omp_get_max_threads(); int* gecici = new int[adet]; int i=1; #pragma omp parallel firstprivate(i) num_threads(adet) { int j=omp_get_thread_num(); i+=j; gecici[j]=i; } for(int i=0;i<adet;i++) cout<<gecici[i]<<" "; delete[]...
ALGO
0.992617
3.478327
08f2e82d-73a4-4235-9672-d48266c5c366
HXhlx/LeetCode
ProgrammingSkills/876_MiddleOfTheLinkedList.cpp
#include <bits/extc++.h> #include "gtest/gtest.h" #include "ListNode.hpp" using namespace std; class Solution { public: ListNode *middleNode(ListNode *head) { ListNode *slow = head; for (ListNode *fast = head; fast && fast->next; fast = fast->next->next) slow = slow->next; re...
ALGO
0.997695
5.814946
d896c01d-a8bb-4944-a36b-a155334ecefd
koitaku2323/CIS45
p27.cpp
//Program name: p27 //Name: Ryan Yee //Date: 07/8/2020 //Description: Smallest, Largest, Sum, Average with Random Numbers //Write a program that generates X random integers Num. //Num is a random number between 20 to 50. //X is a random number between 10 to 15. //Calculate and show the Smallest, Largest, Sum, and Ave...
ALGO
0.953922
3.890626
d951dd03-1881-4dea-b022-df1a7a985632
Sunil-Kumar-P/competitive_programming
Cpp/isPalindrome.cpp
// 125. Valid Palindrome // A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers. // Given a string s, return true if it is a palindrome, or f...
ALGO
0.99362
6.530099
68d1a465-fa6a-48d7-b182-4c7cc92073a6
mihailovy/ads-12
greedy-algorithms/egypt/egypt.cpp
#include <iostream> using namespace std; unsigned int solve(unsigned long int pp, unsigned long int qq) { unsigned long int denominator; // Намира най-близката дроб с най-малък знаменател cout << "Searching for best match to " << pp << "/" << qq << "\n"; denominator = 2; // qq pp ...
ALGO
0.999909
5.140265
c23aa560-a8d0-453f-aa31-f23513315e95
xiaoquanjie/global_server_fk
fk/thirdparty/hiredis_wrapper/hiarray.cpp
#include <stdlib.h> #include "hiutil.h" #include "hiarray.h" struct hiarray * hiarray_create(uint32_t n, size_t size) { struct hiarray *a; ASSERT(n != 0 && size != 0); a = (hiarray *)hi_alloc(sizeof(*a)); if (a == NULL) { return NULL; } a->elem = hi_alloc(n * size); if (a->elem ...
TOOL
0.923514
5.532946
0dc29dc7-9a11-4231-82fb-b43160d45ac7
code-fans/books-source
数据结构/第4章 树/4.21哈夫曼编码/entropy.cpp
// #include <bits/stdc++.h> using namespace std; char str[110]; int Letter[260]; int main() { //freopen("entropy.in","r",stdin); //freopen("entropy.out","w",stdout); while(scanf("%s",str),strcmp(str,"END")!=0) { memset(Letter,0,sizeof(Letter)); int len = strlen(str); for(int i=0; i<len; i++) ...
ALGO
0.976531
3.201899
3c5e06b6-8ca6-49d4-a9b2-1941c92d3e0a
shibainudaifuku/Competitive-Programming
ABC/207/c.cpp
#include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> l(n), r(n); for (int i = 0; i < n; ++i) { int t; cin >> t >> l[i] >> r[i]; l[i] *= 2; r[i] *= 2; if (t >= 3) l[i]++; if (t % 2 == 0) r[i]--; } in...
ALGO
0.999904
3.721735
2daa4b39-66e5-4fbd-ae09-bcef4aaf095a
dy0314/Algospot
ITES.cpp
/* https://www.algospot.com/judge/problem/read/ITES */ #include <stdio.h> #include <queue> #include <cmath> using namespace std; const long MOD = pow(2, 32); long generateNextA(long prevA) { long nextA = (prevA * 214013 + 2531011) % MOD; return nextA; } int main(void) { int C; scanf("%d", &C); ...
ALGO
0.999468
3.720196
5d6a490c-fb30-448c-b181-65699321fa2e
Shicheng626/PreyPredator
PreyPredator/AntTweakBar/src/TwColors.cpp
// --------------------------------------------------------------------------- // // @file TwColors.cpp // @author Philippe Decaudin // @license This file is part of the AntTweakBar library. // For conditions of distribution and use, see License.txt // // ---------------------------------...
ALGO
0.861209
5.644995
5a51aef3-e7a9-46ff-a118-4c4d6ad517cc
Amatulla-Bohara/DSA_practice_questions
222. Count Complete Tree Nodes.cpp
class Solution { public: int countNodes(TreeNode* root, int l = 1, int r = 1) { if (!root) return 0; TreeNode *left = root, *right = root; while (left = left->left) ++l; while (right = right->right) ++r; if (l == r) return (1 << l) - 1; re...
ALGO
0.999956
6.506669
4d89be1c-596b-4bb9-811a-d97fe145bb9c
gkalab/cb2pgn
jni/db/db_board_base.cpp
// ====================================================================== // Author : $Author$ // Version: $Revision$ // Date : $Date$ // Url : $URL$ // ====================================================================== // ====================================================================== // _/| ...
CONFIG
0.986654
5.474229
6948ad4d-91f1-4cc3-8dff-829b1288cde0
abhaysp95/language_files
ncpp/accelerated_cpp/chap7/exercises/exercise1/src/main.cpp
// main file #include <iostream> #include <map> #include <string> #include <vector> #include <algorithm> using namespace std; using count_map = map<size_t, vector<string>>; int is_word_found(const count_map& occurances, const string& find_word) { if (occurances.empty()) { return -1; } count_map::const_iterator...
ALGO
0.997976
5.017131
d2796d50-2125-4ded-b0c9-25f24839cf08
ishandutta2007/codeforces
damians/normal/175/A.cpp
#include <string> #include <vector> #include <algorithm> #include <cmath> #include <set> #include <queue> #include <map> #include <cstdio> #include <iomanip> #include <sstream> #include <iostream> #include <cstring> #define REP(i,x,v)for(int i=x;i<=v;i++) #define REPD(i,x,v)for(int i=x;i>=v;i--) #define FOR(i,v)for(int...
ALGO
0.998527
3.683942
4a1e4780-7bff-4d1c-9127-c78342ba7f14
mbaldus/MA_Volumetric_Clouds
src/libraries/rendering/Noise.cpp
// // Created by Max on 29.05.2018. // #include "Noise.h" #include <math.h> // Perlin noise based on GLM http://glm.g-truc.net // Worley noise based on https://www.shadertoy.com/view/Xl2XRR by Marc-Andre Loyer float Noise::hash(float n) { return glm::fract(sin(n+1.951f) * 43758.5453f); } // hash based 3d value ...
ALGO
0.999135
5.716735
114415dc-d88a-4775-aeb9-7907f88d74d7
pablo-Acha/Progra-Competitiva
contest/div2/d1.cpp
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0)->sync_with_stdio(0); int t; cin >> t; while (t--) { int n; cin >> n; vector<int> ar(n), pref(n), suff(n), ans(n); for (int i = 0; i < n; i++) cin >> ar[i]; // prefix maximum pref[0]...
ALGO
0.999931
4.566975
561414b8-557d-4a85-a1d8-71087fe4b01d
ishandutta2007/codeforces
andreinet/normal/193/D.cpp
#include <algorithm> #include <iostream> #include <vector> using namespace std; const int NMAX = 300005, INF = 0x3f3f3f3f; struct Node { int min1, cnt1; int min2, cnt2; int lazy; }; Node aint[4 * NMAX]; void split(int node, int left, int right) { if (aint[node].lazy) { aint[node].min1 += aint...
ALGO
0.999981
4.231586
8a8cc537-5aa9-4189-8002-9ef7fc338427
jurgen-paul/godotengine-godot
thirdparty/icu4c/common/bmpset.cpp
#include "unicode/utypes.h" #include "unicode/uniset.h" #include "unicode/utf8.h" #include "unicode/utf16.h" #include "cmemory.h" #include "bmpset.h" #include "uassert.h" U_NAMESPACE_BEGIN BMPSet::BMPSet(const int32_t *parentList, int32_t parentListLength) : list(parentList), listLength(parentListLength) { ...
TOOL
0.888675
4.360349
1b5bbb8e-6eed-416e-bc93-0bb8f14d7d31
sagarchapara/cp
cses/graphs/1668.cpp
// g++ -o out <filename>.cpp -D SAGAR // .\out.exe #include <bits/stdc++.h> using namespace std; template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << p.first << " " << p.second ;} template<typename T_container, typename T = typename...
ALGO
0.999985
4.61922
94bdd380-2db9-4510-97b6-92a53136de00
bablooArain/Learning-cpp
lecture-4/butterfly-pattern.cpp
#include <iostream> using namespace std; int main() { int n; cout << "Enter a number: "; cin >> n; for (int i = 0; i < n; i++) { for (int j = 0; j <= i; j++) { cout << "*"; } for (int j = 0; j < n - (i + 1); j++) { cout << " "; } for (int j = 0; j <= i; j++) { cout << "*"; } cout << endl; }...
ALGO
0.999611
4.099006
e8c5c3d9-65aa-4b7e-acc6-aa689905b784
DionysiosB/CodeForces
0600-0699/641B-LittleArtemAndMatrix.cpp
#include <cstdio> #include <vector> int main(){ long n, m, q; scanf("%ld %ld %ld\n", &n, &m, &q); std::vector<std::vector<long> > op(q, std::vector<long>(4, 0)); for(long p = 0; p < q; p++){ long x; scanf("%ld ", &x); op[p][0] = x; if(x < 3){ long y; scanf("%ld\n", &y)...
ALGO
0.99948
3.295856
5e425c24-a657-4069-9da3-f68437a427fc
krosasho/LRU-Caching
LRU-Caching/Main.cpp
// Main.cpp : This file contains the 'main' function. Program execution begins and ends there. #include <string> #include <fstream> #include "LRUCache.h" #include "ARCCache.h" using namespace std; int main(int argc, char* argv[]) { if (argc != 3) { cout << "Invalid command line parameters. Should be of form:"; ...
TOOL
0.883423
3.814943
17464601-a766-43ca-a90a-4e04e9822fee
DyhaCreator/programming_tasks
tinkoff/graph1/m.cpp
#include <algorithm> #include <iostream> #include <vector> #include <set> #define F first #define S second using namespace std; using ll = long long; const int INF = 1e9 + 7; int main() { int n, m; cin >> n >> m; vector<string> a(n); for (auto &x : a) cin >> x; vector<vector<vector<int>>> ...
ALGO
0.999764
3.71436
e5968752-bd02-4127-8901-267f3d0c493f
kinishneema/Problem-Solving
leetcode/lc24.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ // class Solution { // public: // ListNode* sw...
ALGO
0.999962
5.290538
769dbbe1-9595-4c96-8c22-c955ae84062e
derekxu16/competitive-programming-solutions
CSAcademy/Round 44/p4.cpp
#include <iostream> #include <algorithm> #include <vector> #include <unordered_set> using namespace std; typedef pair<int,int> iPair; #define mp make_pair vector<int> path; unordered_set<int> graph[100001]; bool visited[100001]; int temp; const long long MOD = 10000000007; int main() { int n, m; scanf("%i %i...
ALGO
0.999944
4.044215
aa01a52c-f3f5-4484-9cc2-9e2eb569d3d0
biswass101/code_chef_solutions
Others/test2.cpp
#include<bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; cout << (a & b) << endl; return 0; }
ALGO
0.999694
3.452994
e585f500-0fdc-4a25-9739-011755e37894
alexvelea/competitive
contests/codeforcesRound317/b.cpp
//Problem b @ 22-08-2015 #include <algorithm> #include <iostream> #include <vector> #include <queue> using namespace std; const int inf = 0x3f3f3f3f, kMaxK = 5e3 + 5; #define int64 long long int64 dp[kMaxK][kMaxK]; int64 sum[int(3e5 + 5)]; void getMin(int64 &a, int b) { if (a > b) { a = b; } } int ...
ALGO
0.999981
3.497028
ab6bc5e7-ffb9-45f8-8cde-b3fb02b0cac9
fmi-lab/up-kn-2020-group-4
Seminar/Week12 - Recursion/solutions/task01.cpp
#include <iostream> #include <cstring> using namespace std; void resize(char* &str, size_t& capacity) { char* oldStr = str; str = new char[capacity*2]; for (int i = 0; i < capacity; i++) { str[i] = oldStr[i]; } capacity *= 2; delete[] oldStr; } char* insertText(char endingSymbol) { size_t capacity = 2; siz...
TOOL
0.865987
3.428643
34e52a0b-81de-4d72-9714-956a49b1ce04
phoenix-mojo/algorithms_practice
algorithmic_practice/leetcode/coinChangeBottomUP.cpp
#include<iostream> #include<vector> #include<climits> #include<algorithm> using namespace std; void minimumCoins(vector<int> denominations, int amount, vector<int>& cacheResults) { cacheResults[0] = 0; for(int i=1; i<=amount;i++) { if(cacheResults[i] == -1) { int minimumCache = INT_MAX, val; for(int j = 0; j...
ALGO
0.999867
3.972203
6d89b5d4-9928-4ce8-8ac6-0d9d0ca1707f
alexandraback/datacollection
solutions_5630113748090880_0/C++/tanakh/b.cpp
#include <iostream> #include <iomanip> #include <algorithm> #include <string> #include <vector> #include <map> #include <set> #include <cstdio> #include <cstring> #include <cassert> using namespace std; int n; vector<vector<int>> orig; bool rec(int cur, int ix, vector<vector<int>> &bd, vector<vector<int>> &ss) { ...
ALGO
0.99993
3.741371
22fd1f45-c1d3-4395-ac96-10a8f8e16bbe
xssxx/data-structure
lab-ds/lab3/LoveLetter.cpp
#include <iostream> using namespace std; int main() { string letter, ans; getline(cin, letter); int i = 0; char curr; while (i < letter.size()) { curr = letter[i]; ans += curr; if (curr == 'a' || curr == 'e' || curr == 'i' || curr == 'o' || curr == 'u') { i +=...
ALGO
0.99526
3.890201
8101da14-061b-4a6f-9030-0eef2d79928f
Huzaif-24k0640/OOP-Lab
OOP Lab/Lab 01/task 07.cpp
#include <iostream> #include <string> using namespace std; const int CITIES = 4; const int DAYS_IN_WEEK = 7; void inputAQI(int aqi[CITIES][DAYS_IN_WEEK]) { string cities[CITIES] = {"City 1", "City 2", "City 3", "City 4"}; cout << "\nEnter AQI values for each city over 7 days:\n"; for (int i = 0; i < C...
ALGO
0.994621
4.079284
054a7a6b-94a2-44ab-a3e5-42ef618ec9bb
HarikumarG/Algorithms
Stack/Implementing_queue_stackLib.cpp
#include<bits/stdc++.h> using namespace std; void transfer(stack<long>& from, stack<long>& to){ while(from.empty()==false){ to.push(from.top()); from.pop(); } } int main() { stack<long> outstack; stack<long> instack; int N; cin >> N; for(int i=0; i<N; i++){ ...
ALGO
0.999502
4.829834
c0a663dc-6072-427d-a83a-a4c40f2394f0
bhagvadgita/Leetcode
3379-score-of-a-string/score-of-a-string.cpp
class Solution { public: int scoreOfString(string s) { int score = 0; for (int i = 0; i<s.size()-1; i++){ score+= abs(s[i]-s[i+1]); } return score; } };
ALGO
0.999932
5.542642
7d495823-00ab-4582-ae0f-64eff714f1c7
coolpi-george/mpp
mpp/vproc/mpp_dec_vproc.cpp
#define MODULE_TAG "mpp_dec_vproc" #include <string.h> #include "mpp_env.h" #include "mpp_mem.h" #include "mpp_common.h" #include "mpp_dec_impl.h" #include "mpp_frame_impl.h" #include "mpp_dec_vproc.h" #include "iep_api.h" #include "iep2_api.h" #define DUMP_FILE 1 #define dec_vproc_dbg(flag, fmt, ...) \ do { ...
TOOL
0.937002
4.605575
1a519677-e4e4-47b9-b0c2-6304e4b0ca73
avdhendra/LeetCode
44.wildcard-matching.cpp
/* * @lc app=leetcode id=44 lang=cpp * * [44] Wildcard Matching */ // @lc code=start class Solution { public: bool isMatch(string s, string p) { int n=s.size(),m=p.size(); vector<vector<bool>>dp(n+1,vector<bool>(m+1,0)); dp[0][0]=true; for(int i=1;i<=m;i++){ if(p[i-1...
ALGO
0.999687
6.284142
7146dec6-7d7f-4705-80c5-218d04963802
CityAplons/otus-cpp-02-ip-filter
src/sort.cpp
#include "sort.hpp" #include "io.hpp" #include <algorithm> namespace NHomework2 { uint32_t Ip2Hex(std::array<uint8_t, OCTET_NUM> &ip) { assert(ip.size() >= OCTET_NUM); uint32_t result = 0; for (size_t i = 0; i < OCTET_NUM; ++i) { result |= ip[i] << ((OCTET_NUM - i...
ALGO
0.983688
3.830201
0c7d64e1-6197-4439-b965-cbcbd325d733
sauleddy/C_plus
data_structure/BinarySearchTree/main.cpp
/* * File: main.cpp * Author: eddy * * Created on March 1, 2017, 2:36 PM */ #include <cstdlib> #include <iostream> #include "BSTree.h" using namespace std; /* * */ int main(int argc, char** argv) { BSTree<int> t; /*t.insert(62); t.insert(58); t.insert(47); t.insert(51); t.insert(3...
TEST
0.976003
4.283426
0b2b1b28-64db-474a-ad8b-351f876616fa
1mSSong/problems
Q4948.cpp
#include <iostream> #include <vector> #include <cmath> using namespace std; void countPrime(); bool isPrime(int n); vector<int> cntPrime(123456 * 2 + 1); int main() { ios::sync_with_stdio(0); cin.tie(0); int n; countPrime(); cin >> n; while (n != 0) { cout << (cntPrime[2 * n] - cntPrime[n]) << "\n"; cin >>...
ALGO
0.999583
3.810239
46144f15-add3-4576-9b87-a8fbf7410907
Edgarrrrrr/T2-RELION
src/jaz/scripts/membrane_erase_2D.cpp
#include <src/jaz/tomography/tomo_stack.h> #include <src/jaz/tomography/projection/projection.h> #include <src/jaz/tomography/extraction.h> #include <src/jaz/membrane/blob_3d.h> #include <src/jaz/membrane/blob_fit_3d.h> #include <src/jaz/tomography/tomolist.h> #include <src/jaz/optimization/nelder_mead.h> #include <sr...
ALGO
0.977749
5.951542
2aa44c03-d0a7-4b21-967f-9c238fd670d6
SagoRohit/Daily-Leetcode
DP/leetcode-790.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: int numTilings(int n) { int mod = 1e9+7; if(n<=1) return 1; if(n==2) return 2; if(n==3) return 5; vector<int> dp(n+1,0); for(int i=4; i<=n; i++) dp[i] = (dp[i-1]*2 + dp...
ALGO
0.999979
5.47114