uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
88320cf9-154b-4b1d-9411-5e316aa4dd07
sdavydouski/fuzzy
src/fuzzy/fuzzy_containers.cpp
#include "fuzzy_containers.h" #include "fuzzy_memory.h" template<typename TValue, typename TKey> internal TValue * Get(hash_table<TValue> *HashTable, TKey Key, b32(*KeyComparator)(TValue *, TKey)) { TValue *Result = nullptr; u32 HashValueIndex = Hash(Key) % HashTable->Count; Assert(HashValueIndex < HashTa...
ALGO
0.935581
4.853154
a403e06c-f190-4041-9a41-516e7eb21944
Meguminn0/MyKV_Store
src/skiplist.cpp
#include "skiplist.h" #include <random> SkipList::SkipList() { srand(time(nullptr)); tail_ = nullptr; head_ = new SkipListNode("nil", "nil", tail_); count = 0; level_ = 0; } SkipList::~SkipList() { SkipListNode* p = head_; while (head_ != nullptr) { head_ = p->level_[0].forward...
ALGO
0.999315
3.987337
58a08e90-e1f7-400b-8897-1c4b9654408d
shikanon/rtbkit-deps
boost_1_57_0/libs/math/example/airy_zeros_example.cpp
#ifdef _MSC_VER # pragma warning (disable : 4512) // assignment operator could not be generated. # pragma warning (disable : 4996) // assignment operator could not be generated. #endif #include <iostream> #include <limits> #include <vector> #include <algorithm> #include <iomanip> #include <iterator> // Weisstein, E...
ALGO
0.9984
6.619509
b88b97e4-2ea4-49cd-b3e6-26e9598bbdeb
gnahtcouq/cpp
Chuong 7 Chuoi/remake/Ly Thuyet/Xay dung ham doi So thanh Chuoi/source.cpp
/* Co 2 dang: doi thanh so nguyen & doi thanh so thuc Doi thanh so nguyen "123" ->123 ta thay 123 = 1*10^2 + 2*10^1 + 3*10^0 s[0] = '1' -> co ma ascii la 49 s[1] = '2' -> co ma ascii la 50 s[2] = '3' -> co ma ascii la 51 "12345" -> 12345 ta thay 12345 = 1*10^4 + 2*10^3 + 3*10^2 + 4*10^1 + 5*10^0 quy tac: - Tu 1 ky...
ALGO
0.991805
4.592204
84616c78-a3ac-44d1-b8f1-a63b9babf2da
Junjie-Feng/Previous-Projects
C++Projects/homework1/homework1/homework1.cpp
// Name : Junjie Feng // Course : 16:332:503:01 , Programming Financial // Homework : Homework 1 #include<iostream> using namespace std; int main() { float num1, num2, num3, num4, num5;// five numbers to be input by user float max, min;//variable in which the maximum and minimum of those numbers will be stored co...
ALGO
0.999594
3.174265
02188cc2-31f5-4344-9ce3-00fba4e687a1
RoundofThree/freebsd
contrib/llvm-project/clang/lib/Format/UsingDeclarationsSorter.cpp
#include "UsingDeclarationsSorter.h" #include "clang/Format/Format.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Regex.h" #include <algorithm> #define DEBUG_TYPE "using-declarations-sorter" namespace clang { namespace format { namespace { // The order of using declaration is defined as follows: // Spli...
TOOL
0.975273
5.22842
9f29677e-348e-4095-8bf2-3438e3b96685
foxatschool/CSC196_GameEngine
Source/ThirdParty/box2d/samples/sample_collision.cpp
#include "draw.h" #include "random.h" #include "sample.h" #include "box2d/box2d.h" #include "box2d/collision.h" #include "box2d/math_functions.h" #include <GLFW/glfw3.h> #include <imgui.h> #include <imgui_internal.h> #include <stdlib.h> class ShapeDistance : public Sample { public: enum ShapeType { e_point, e_...
ALGO
0.989588
6.790849
3ca9ce86-7b8a-4965-915d-5252462d53d3
JacobMuchow/AdventOfCode
2015/day07/part1.cpp
#include "part1.h" #include <regex> #include <queue> #include "../elements/utils.h" using namespace std; void Day07Part1::run(std::string inputFile) { auto lines = readLinesFromFile(inputFile); string line = lines[0]; this->valueMap = {}; this->solveQueue = {}; for (string line : lines) { ...
ALGO
0.991821
4.975055
5f229033-1aa7-4244-be2d-fb344ca3b4c3
bokusunny/atcoder-archive
atcoder.jp/abc135/abc135_d/Main.cpp
#include <bits/stdc++.h> using namespace std; #include <atcoder/modint> using namespace atcoder; using mint = modint1000000007; int main() { string S; cin >> S; int N = (int)S.size(); // dp[i][j] := 上からi桁見た時、あまりがjであるものの個数 vector<vector<mint>> dp(N + 1, vector<mint>(13)); dp[N][0] = 1; int m = 1; // 1...
ALGO
0.999883
4.701913
8dfebdd5-6fbe-42cb-a9a8-649a09f4b910
Ashu00001/hackerrank_30_Days_of_Code
Day 3: Intro to Conditional Statements.cpp
#include <bits/stdc++.h> using namespace std; // Complete the solve function below. void solve(double meal_cost, int tip_percent, int tax_percent) { double x=meal_cost; float y=meal_cost*tip_percent/100; float z=meal_cost*tax_percent/100; float totalcost=(meal_cost+y+z); cout<<round(totalcost); } int main() { d...
ALGO
0.999364
4.219502
10241f18-dd3a-48a2-b684-ff57e11e236f
hhhxiao/Leetcode
stash/870.cpp
#include <algorithm> #include <iostream> #include <set> #include <unordered_map> #include <vector> #include "dbg.h" using namespace std; vector<int> advantageCount(vector<int>& nums1, vector<int>& nums2) { auto copy = nums2; std::sort(nums1.begin(), nums1.end(), std::greater<int>()); std::sort(nums2.begin...
ALGO
0.999993
4.7341
c41d6bf2-707c-42f4-9dfe-c3d1486dcaf6
divyanshece/LeetCode
0658-find-k-closest-elements/0658-find-k-closest-elements.cpp
class Solution { public: vector<int> findClosestElements(vector<int>& arr, int k, int x) { int n = arr.size(); vector<int>diff; for(int i=0; i<n; i++) { diff.push_back(abs(x-arr[i])); } for(int i=0;i<n-1;i++) { int min_index = i; // checks ...
ALGO
1
5.615001
95e04876-cd5a-43e9-b7ed-d2871a9a1351
cri-lab-hbku/secureais
core-master/cpp/rom_curve_SECP160R1.cpp
#include "arch.h" #include "ecp_SECP160R1.h" namespace SECP160R1 { /* Curve SECP160R1 */ #if CHUNK==16 using namespace B160_13; // Base Bits= 13 const int CURVE_A= -3; const int CURVE_Cof_I= 1; const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; const int CURVE_B_I= 0; const BIG CURVE_B= {0...
ALGO
0.894177
4.042835
d68a620b-3a2b-4afd-a94c-e4d4f07b1c75
IanDeHaan/uva-solutions
problems/119/42.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; cout << "Lumberjacks:" << endl; for (int cs = 0; cs < n; cs++) { bool incr = true; bool decr = true; int prev; cin >> prev; for (int i = 1; i < 10; i++) { int x; cin >>...
ALGO
0.999464
5.181466
c5edd7cd-2838-46b1-94c6-4ec23671f9c1
hoanpvpv/DSAPTIT
DSA08005 - SỐ NHỊ PHÂN TỪ 1 ĐẾN N.cpp
#include <bits/stdc++.h> using namespace std; const int mod=1e9+7; #define ll long long int main() { ios::sync_with_stdio(false); cin.tie(0); int t; cin>>t; while(t--) { int n; cin>>n; queue <string> s; s.push("1"); while(n--) { string tmp=s.front(); s.pop(); cout<<tmp<<" "; s.push(tmp+"0")...
ALGO
0.999987
4.296591
a2fe284e-80e3-4fac-976c-24e5fce2b04a
HaochenLiu/My-POJ
1528.cpp
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdlib> #include <cstring> #include <cstdio> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iostream> #include <iomanip> #include <list> #include <map> #include <numeric> #include <queue> #include ...
ALGO
0.998806
4.438368
fcf7e29a-c9a8-4a1e-8804-f87141dcca91
istiak7/CompettiveProgramming
codeforces/1566/B.cpp
///*BISMILLAHIR RAHMANIR RAHIM*/// #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll long long int #define pb push_back #define MP make_pair #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) #define per(i, n) for...
ALGO
0.99996
4.638291
7db87325-f0af-414f-bf16-1490975fd8f8
UtopiaBeam/competitive
Codeforces/Contest/Codeforces Round #358 (Div. 2)/D. Alyona and Strings/D. Alyona and Strings.cpp
#include<cstdio> #include<algorithm> using namespace std; int n,m,p,dp[1002][1002][12],mx=0; char a[1002],b[1002]; int main(){ scanf("%d %d %d %s %s",&n,&m,&p,a+1,b+1); for(int i=1;i<=n;i++) for(int j=1;j<=m;j++) if(a[i]==b[j]) for(int k=1;k<=p;k++) dp[i][...
ALGO
0.997964
3.171995
504d6e5f-00ce-4bff-816a-4f88f95a7c10
YamamotoDesu/flutter_mapp_widgets
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
1a77d16d-32eb-4880-adb4-f90bf77ab363
Dipti821/DSA_Questions
37-sudoku-solver/37-sudoku-solver.cpp
class Solution { public: bool isValid(vector < vector < char >> & board, int row, int col, char c) { for (int i = 0; i < 9; i++) { if (board[i][col] == c) return false; if (board[row][i] == c) return false; if (board[3 * (row / 3) + i / 3][3 * (col / 3) + i % 3] == c) return false; }...
ALGO
0.999598
6.650403
37e50337-f8d2-4619-bf2d-bd6c7cd76d02
algokelvin-373/ProjectFlutterApp
shared_preferences_flutter/windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998802
6.76073
e1198099-5f73-48d5-b42b-63ab86233116
corngood/llvm
lib/Support/DeltaAlgorithm.cpp
#include "llvm/ADT/DeltaAlgorithm.h" #include <algorithm> #include <iterator> using namespace llvm; DeltaAlgorithm::~DeltaAlgorithm() { } bool DeltaAlgorithm::GetTestResult(const changeset_ty &Changes) { if (FailedTestsCache.count(Changes)) return false; bool Result = ExecuteOneTest(Changes); if (!Result) ...
TEST
0.899421
7.018753
f0637701-d911-4c71-9115-937445f3f5a5
ishandutta2007/codeforces
gary/normal/1291/C.cpp
/* AuThOr GaRyMr */ #include<bits/stdc++.h> #define rb(a,b,c) for(int a=b;a<=c;++a) #define rl(a,b,c) for(int a=b;a>=c;--a) #define LL long long #define IT iterator #define PB push_back #define II(a,b) make_pair(a,b) #define FIR first #define SEC second #define FREO freopen("check.out","w",stdout) #define rep(a,b) for(...
ALGO
0.999991
3.601469
0c7d3f92-fd2b-4ab9-ab1c-f913a46a036a
Ash1327/My-Code-Practice-CodeForces
01 game.cpp
#include<bits/stdc++.h> using namespace std; int main(){ long long t; cin>>t; while(t--){ int c1=0,c0=0; string s; cin>>s; for(int i=0;i<s.length();i++){ if(s[i]=='1'){ c1++; } else{ c0++; } ...
ALGO
0.99997
4.513699
3fea8be9-6f14-4f25-a79e-454e7f59e5be
abdualla1/CP
CodeForces Gym/The 2023 ICPC Egyptian Collegiate Programming Contest (Qualifications Day 6)/E.cpp
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define endl '\n' #define yes cout << "YES\n"; #define no cout << "NO\n"; #define ll long long #define sz(x) (int)x.size() #define watch(x) cout << #x << " = " << x << endl void zo7le2a(){ io...
ALGO
0.999951
4.324097
5f9a773a-0350-489d-baa9-f7bd641a8217
emanfatima3417/pf-week6
pd week 10/code4.cpp
#include <iostream> using namespace std; int main (){ for(int i=5;i>=1;i--){ for (int j=i;j>=1;j--){ cout<<j; } cout<<endl; } }
ALGO
0.999635
3.155616
40608d86-3aaa-43b7-a917-6c4feae6cc8d
vaibhav8bp/Coding-Ninjas-Solutions
Data Structures/Level 1/Lecture 2 - Dynamic Allocation/Lecture Questions/jagged_arrays.cpp
#include <iostream> using namespace std; int main() { int m, i, j; cin >> m; int **p = new int *[m]; for (i = 0; i < m; i++) { p[i] = new int[i + 1]; for (j = 0; j < i + 1; j++) { cin >> p[i][j]; } } for (i = 0; i < m; i++) { for (j =...
ALGO
0.997905
3.447236
625fcdd6-fef0-4e2a-a9d1-26c83677ad0e
TajSapra/DSA_450_LOVEBABBAR
matrix/39. Find_Row_with_Maximum_Number_of_1.cpp
#include<bits/stdc++.h> #define ll long long int #define pb push_back #define uii unordered_map<int,int> #define uill unordered_map<int,ll> #define usi unordered_map<string,int> #define udi unordered_map<double, int> #define mii map<int,int> #define uci unordered_map<char,int> #define mci map<char,int> #define mci map...
ALGO
0.999995
3.651684
858dac80-1925-4ed7-aa05-744e5a10fba2
Garviljain/crypto
task3.cpp
#include <bits/stdc++.h> #include<unordered_set> using namespace std; vector<string> createBigraphs(string cipher) { vector<string> result; for (int i = 0; i < cipher.length(); i += 2) { result.push_back(cipher.substr(i, 2)); } return result; } unordered_map<string, int> calcFreq(vector<string...
ALGO
0.999983
5.479725
ca44507b-385c-47d1-9628-6eb0eeee0d39
FPSG-UIUC/Pandora
simulator/ext/systemc/src/sysc/utils/sc_hash.cpp
/***************************************************************************** sc_hash.cpp -- Implementation of a chained hash table with MTF (move-to-front). Original Author: Stan Y. Liao, Synopsys, Inc. CHANGE LOG AT END OF FILE **************************************************************...
ALGO
0.961666
6.123883
e8b8621e-93d2-4f37-87d5-7bec11419b40
NestZ/competitive-programming
AtCoder/Teleporter.cpp
#include<bits/stdc++.h> using namespace std; #define endl '\n' typedef long long int ll; #define sim template < class c #define ris return * this #define dor > debug & operator << #define eni(x) sim > typename \ enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) { sim > struct rge { c b, e; }; sim > rge<c...
ALGO
0.999998
3.490036
35e5f08f-52e8-4759-b2c0-3dcf88fc41cc
mkut/aoj
Volume01/0177/c++.cpp
#include <iostream> #include <math.h> using namespace std; int main() { double N1, E1, N2, E2; while(cin >> N1 >> E1 >> N2 >> E2, E1 != -1) { N1 *= M_PI/180; E1 *= M_PI/180; N2 *= M_PI/180; E2 *= M_PI/180; double X = acos(cos(E1)*cos(N1)*cos(E2)*cos(N2) + sin(E1)*cos(N1)*sin(E2)*cos(N2) + sin(N1)*sin(N2))...
ALGO
0.99974
3.494618
fe888852-44ea-4603-bf3a-72c98b442a62
ZYZMZM/Coding-Interviews
ZY - Coding-Interviews Of Order/面试题56-1:数组中只出现一次的两个数字/NumbersAppearOnce.cpp
// 56һֻһε // Ŀһ֮⣬ֶΡд // ҳֻһε֡Ҫʱ临ӶO(n)ռ临ӶO(1) #include <stdio.h> unsigned int FindFirstBitIs1(int num); bool IsBit1(int num, unsigned int indexBit); void FindNumsAppearOnce(int data[], int length, int* num1, int* num2) { if (data == NULL || length < 2) { return; } int resultOR = 0; for (int i = 0; i < length;...
ALGO
0.999868
4.05993
044571cf-5dd3-4ecf-bb0e-51fbfed08dec
lsqyling/PrimerAdvanced
part_5_templates/ExpressionTemplate.cpp
// // Created by shiqing on 18-12-14. // /** * chapter18:表达式模板 * 表达式模板有时依赖与深层的嵌套模板实例化,而这种实例化又和template metaprogramming 中遇到的递归实例化非常相似, * 这两种技术都是为了支持高性能的数组操作,metaprogramming 主要用于小的、大小固定的数组,而表达式模板则使用与能够 * 在运行期确定大小,中等大小的数组。 * */ #include <arpa/nameser.h> #include <cassert> #include "UsefullFwd.h" namespace ch18 { ...
TOOL
0.899015
5.561944
4af304c2-c1d0-4c42-ad6a-073a6bcb16e2
Balpreet1003/LeetCode
2490-circular-sentence/2490-circular-sentence.cpp
class Solution { public: bool isCircularSentence(string s) { bool ans = true; for (int i = 0; i < s.length(); i++) { if (s[i] == ' ') { if (s[i - 1] != s[i + 1]) return false; } } return (s[0] == s[s.length() - 1]) && ans; ...
ALGO
0.999667
5.556098
b4200fbe-3607-4f33-bb80-1ea9e53b8377
WilsNTHU/Leetcode
0367-valid-perfect-square/0367-valid-perfect-square.cpp
class Solution { public: bool isPerfectSquare(int num) { int left = 0, right = INT_MAX; long long mid, result; while(left <= right){ mid = left + (right - left)/2; result = mid * mid; if(result == num) return true; else if(result > num...
ALGO
0.999783
5.802584
eee01245-4a5f-4f3b-a100-75bc15bf3483
PengJiaqiao/Robotics
Assignment_5/1.0-Exhausted-nodes/tutorialPlan/YourPlanner.cpp
#include "YourPlanner.h" #include <rl/plan/Sampler.h> #include <rl/plan/SimpleModel.h> #include <rl/plan/Verifier.h> #include <rl/plan/Viewer.h> #include <boost/make_shared.hpp> #include <iostream> YourPlanner::YourPlanner() : RrtConConBase() { } YourPlanner::~YourPlanner() { } ::std::string YourPlanner::getName()...
ALGO
0.994838
5.041571
e0aa18ce-3107-4c69-8d7e-e057dceb688d
harshthakur3/Codeforces-Solution
B_Not_Quite_a_Palindromic_String.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long void solve(){ ll n,k; cin>>n>>k; string s; cin>>s; ll count0=0,count1=0; for(ll i=0;i<n;i++){ if(s[i]=='0'){ count0++; } else{ count1++; } } while(k--){ if(...
ALGO
0.999843
4.548856
6cd52817-c159-4518-851b-c99139bca513
AakashKT/analytic_ss_cpu
src/integrators/sppm.cpp
// integrators/sppm.cpp* #include "integrators/sppm.h" #include "parallel.h" #include "scene.h" #include "imageio.h" #include "spectrum.h" #include "rng.h" #include "paramset.h" #include "progressreporter.h" #include "interaction.h" #include "sampling.h" #include "samplers/halton.h" #include "stats.h" namespace pbrt {...
TOOL
0.993326
7.276048
25d8fcb1-3466-48a7-9085-6fb416d414d0
OM6978/CP
ITMO-EDU/DSU/1-1-array.cpp
#include <bits/stdc++.h> using namespace std; #define ump unordered_map void union_s(int a,int b,int* P,ump <int,vector<int>> & mp) { if(P[a]==P[b])return; if(mp[P[a]].size() > mp[P[b]].size()) a = b + a - (b=a); vector<int> & v1 = mp[P[b]]; vector<int> & v2 = mp[P[a]]; for(int x : v2)P...
ALGO
0.999947
5.544554
0f019310-63ae-4f8f-a9de-baf004b2d289
ycui1984/booster
crackcode/chapter1/1.7.cpp
/* Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column is set to 0. O(mn) time, const space; */ #include "matrix.h" class Solution { public: void setToZero(Matrix &m) { bool should_zero_col0 = false, should_zero_row0 = false; for (int i = 0; i < m.getRow(); i++) { if (...
ALGO
0.999443
6.494443
205bf3cb-be02-400c-90a3-2e08e94ad880
ishandutta2007/codeforces
ssrs_/normal/1559/C.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int t; cin >> t; for (int i = 0; i < t; i++){ int n; cin >> n; vector<int> a(n); for (int j = 0; j < n; j++){ cin >> a[j]; } if (a[0] == 1){ cout << n + 1; for (int j = 1; j <= n; j++){ cout << ' ' << j; ...
ALGO
0.999882
3.569169
43756221-aafc-45f6-a259-080148686c78
oybek/competitive-programming
timus/1804.cpp
#include <cmath> #include <cstdio> #include <cctype> #include <string> #include <vector> #include <cstdlib> #include <iostream> #include <algorithm> #define repeat(n) for (size_t _i = 0; _i < n; ++_i) #define skip_word { string s; cin >> s; } int main() { using namespace std; #ifndef ONLINE_JUDGE freopen("input.t...
ALGO
0.989504
3.722861
3106300b-3635-4d40-a36b-e681ba36db35
murlin212/PP2020FST
Chapter 3/Task_02/Task3_02.cpp
// Task3_02.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> int main() { const int a = 20; bool test; for(int i = 2; i <= a; i++){ test = true; for (int j = 2; j <= i / 2; j++) { if (i % 2 ==...
ALGO
0.943781
3.403266
bd0e808a-fac8-4eaf-a081-20a2e56a6ab4
agatagc/Courses
CPP/CPP_Zbior_zadan_1/cppzbz/#1/rozwiÑzania/20.cpp
#include <iostream> #include <vector> using namespace std; int main() { setlocale(LC_ALL, ""); vector<int> baza = { 1,4,7,6,3,7,23,-14,22,1 }; cout << baza.size() << endl; // 10 liczb w wektorze vector<int> kopia; for (auto e : baza) { cout << e << " "; // pokazuje zawartość pierwszego wektora (baza) if (e % 2...
ALGO
0.995999
3.510644
dd9f1979-61ec-4e80-9dd5-1c2f9304bb65
Yashwant-Tailor/LeetCodeSolution
c++_solutions/198.cpp
/* simple solution two state for DP state 1 : rob the current house state 2 : don't rob the current house look at the code for the transition of the this states */ class Solution { public: int rob(vector<int>& nums) { int n = nums.size() ; int previous_rob = 0 , previous_not_rob = 0 ; int ...
ALGO
0.999839
5.442273
64a7e9ea-1be2-4e69-9201-13ad764b2d40
samarthcode1/CodeForces1
B_Vlad_and_Shapes.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<int> vi; const int mod = 1000000007; int main() { int t; cin >> t; for (int l = 0; l < t; l++) { int n; ...
ALGO
0.999236
4.114055
344a818b-3d0e-4e5b-a2ae-87695ef7984a
andreaswanninger/conservative_levelset-contact_line-curvature
applications/ThermalDEMApplication/custom_constitutive/real_contact/real_contact_lu.cpp
// System includes // External includes // Project includes #include "real_contact_lu.h" namespace Kratos { //----------------------------------------------------------------------------------------------------------------------- RealContactLu::RealContactLu() {} RealContactLu::~RealContactLu() {} //-------...
TOOL
0.983714
5.705146
f5bcab72-845a-440b-a3f9-b645c84f3a33
nagarav/hello-world
bubble_sort.cpp
#include<stdio.h> #include"populate_array.h" using namespace std; void bubble_sort(int a[], int n); int main() { int x[30],len=30; populate_array(x,len); bubble_sort(x,len); for (int i=0; i<len;i++) { cout << x[i]<<"\t"; } cout<<endl; return 0; } void bubble_sort(int a[],int n){ for(int i=0; i<n;i++){ boo...
ALGO
0.998886
3.565181
5bf6d2b4-6825-4ccc-8f5d-9bae3d6c882d
Citrus-CAF/external_skia
experimental/SkSetPoly3To3_A.cpp
#include "SkMatrix.h" // FIXME: needs to be in a header bool SkSetPoly3To3_A(SkMatrix* matrix, const SkPoint src[3], const SkPoint dst[3]); typedef double SkDScalar; static SkScalar SkDScalar_toScalar(SkDScalar value) { return static_cast<float>(value); } static SkScalar divide(SkDScalar numer, SkDScalar denom) ...
TOOL
0.970655
6.766689
06b74a6b-bcad-46a1-a409-d16661584a0e
gaoyangu/paly-with-data-structure
03/SqList.cpp
#include <iostream> using namespace std; /* * 线性表的顺序存储的结构 */ constexpr auto MAXSIZE = 20; //存储空间初始分配量 struct SqList { int data[MAXSIZE] = {}; //数组存储数据元素 int length = 0; //线性表当前长度 }; int ShowList(SqList L) { if (L.length == 0) { cout << "该线性表为空。" << endl; return 0; } cout << "该线性表共有[ " << L.length << "...
ALGO
0.933716
3.744503
2efb0ac0-85ce-4ad7-aaf8-7a5131ee8ca6
ishandutta2007/codeforces
isonan/normal/1491/D.cpp
#include <cstdio> int q; int main(){ scanf("%d",&q); for(int i=1,u,v;i<=q;i++){ scanf("%d%d",&u,&v); if(u>v){ puts("NO"); continue; } int cnt1=0,cnt2=0; bool ans=0; for(int j=0;j<30;++j){ cnt1+=(u&(1<<j))!=0; cnt2+=(v&(1<<j))!=0; if(cnt1<cnt2)ans=1; } if(ans)puts("NO"); else puts("YE...
ALGO
0.999909
4.014608
c73d061d-4e0c-459e-a355-8ad7041ba1e3
MihHiu2829/advance_C_alogrithm
bai23.cpp
#include<iostream> #include<math.h> using namespace std ; void solve(){ int n,p; cin>>n>>p; int sum = 0 ; while(n){ n/=p ; sum+=n ; } cout<<sum<<endl ; } int main(){ int t; cin>>t; while(t--){ solve(); } }
ALGO
0.999861
3.742455
00a1e2dc-18b5-4dfe-9394-c5eeeb7ec295
kobocoin/Kobocoin
src/addrman.cpp
#include "addrman.h" #include "hash.h" #include "serialize.h" #include "streams.h" int CAddrInfo::GetTriedBucket(const uint256& nKey) const { uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << GetKey()).GetHash().GetCheapHash(); uint64_t hash2 = (CHashWriter(SER_GETHASH, 0) << nKey << GetGroup() << (has...
TOOL
0.910487
6.790201
e6cad0f3-5d71-4325-9d56-7957a6aaefd6
aryaptr12/tugas-praktikum-c-sabtu
Jawaban UTS/98.cpp
#include <iostream> using namespace std; int main() { char A[10] = {'S', 'T', 'T', 'M', 'A', 'N', 'D', 'A', 'L', 'A'}; char N; cout << "Masukkan huruf = "; cin >> N; int found = 0; cout << "Array saat ini:\n"; for (int i = 0; i < 10; i++) { cout << A[i] << " "; } cout <...
ALGO
0.997014
4.789251
d1369693-6518-4220-97f2-105a49d3e3e9
Sergio72111/lab_7
boost/libs/math/tools/minimax/f.cpp
#define L22 //#include "../tools/ntl_rr_lanczos.hpp" //#include "../tools/ntl_rr_digamma.hpp" #include "multiprecision.hpp" #include <boost/math/tools/polynomial.hpp> #include <boost/math/special_functions.hpp> #include <boost/math/special_functions/zeta.hpp> #include <boost/math/special_functions/expint.hpp> #include ...
ALGO
0.985093
4.115978
c5b5c864-3489-4cc1-bc5d-2a57f91b964b
deepmoina2005/DSA-150-Days-Challange
Day 13 (09-06-2025)/main.cpp
#include <iostream> using namespace std; class Solution { public: bool isPalindrome(int x) { // Negative numbers and numbers ending in 0 (but not 0 itself) are not palindromes if (x < 0 || (x % 10 == 0 && x != 0)) { return false; } int reversedHalf = 0; // Reve...
ALGO
0.999461
6.639411
fa2e20d3-dcfd-47ab-a86e-fde3d166a90a
aditya28sarin/Data-structures-and-Algorithms
DSA/Algorithms and Others/Recursion and Backtracking/subset_sum_problem.cpp
#include<iostream> using namespace std; bool isSubsetSum(int set[], int n, int sum) { if(sum==0) return true; if(n==0 && sum!=0) return false; if(set[n-1]>sum) return isSubsetSum(set, n-1, sum); else return( isSubsetSum(set,n-1,sum) || isSubsetSum(set, n-1, sum-se...
ALGO
0.999951
5.39522
37235be2-9297-4c1b-be9a-58a22a0f1e45
oggstr/tddd95
exercises/turbo.cpp
/** * @author: Oskar Arensmeier * @date: 2025-01-29 */ #include <iostream> using namespace std; int N; int arr [100001] = {0}; int pos [100001] = {0}; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin >> N; for (int i = 1; i <= N; ++i) { cin >> arr[i]; pos[arr[i]] ...
ALGO
0.999913
3.660892
7b64bb93-e150-4561-bcf9-89178fc71d3e
MNTracker/MNT
src/timedata.cpp
#include "timedata.h" #include "netbase.h" #include "sync.h" #include "ui_interface.h" #include "util.h" #include "utilstrencodings.h" #include <boost/foreach.hpp> using namespace std; static CCriticalSection cs_nTimeOffset; static int64_t nTimeOffset = 0; /** * "Never go to sea with two chronometers; take one or...
TOOL
0.853995
6.2183
415775e0-1ba2-40fb-ab33-ba064e8b58fc
PublicGiT-AYE/Global
Kerel/Kirill/Kirill/Kirill.cpp
#include <iostream> #include <stdio.h> #include <time.h> int main() { srand(time(0)); const int SIZE = 4; char Arr[SIZE][SIZE]; int tmp; for (int i = 0; i < SIZE; i++) { for (int j = 0; j < SIZE; j++) { Arr[i][j] = (char)(rand() % (122 - 97) + 97); } } for (int i = 0; i < SIZE; i++) { for (int j...
ALGO
0.994573
3.270515
f096592c-8c8c-4aec-982b-b42ddaf289fa
skyxroom/01
libnd4j/include/ops/declarable/generic/transforms/scatter_max.cpp
// // @author Yurii Shyrma (<EMAIL>), created on 1.08.2018 // #include <system/op_boilerplate.h> #if NOT_EXCLUDED(OP_scatter_max) #include <ops/declarable/CustomOperations.h> #include <ops/declarable/generic/helpers/ScatterHelper.h> namespace sd { namespace ops { OP_IMPL(scatter_max, 3, 1, true) { auto input = IN...
ALGO
0.995784
6.876627
ba8f1bf2-ad89-47f7-9a65-2798ef71de22
anshuman8800/DsaQuestions
Trapping-Rainwater.cpp
class Solution { public: int trap(vector<int>& height) { int maxleft=0,maxright=0; int ans=0; int left=0,right=height.size()-1; while(left<right) { if(height[left]<height[right]) { if(height[left]>maxleft) m...
ALGO
0.999969
6.501427
b6b00528-18bd-471b-b45e-dc242e7abb7a
muhammadhasan01/cp
Online Judge/TLX/TROC#13-DIV1/A.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; set<int> st; for (int i = 1; i <= n; i++) { int x; cin >> x; st.emplace(x); } int len = st.size(); if (len == 1) { ...
ALGO
0.999833
3.751468
e71c3d42-1e49-4969-b103-08371d6ce17d
ishandutta2007/codeforces
lyc_music/normal/1553/E.cpp
//QwQcOrZ yyds!!! #ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include...
ALGO
0.999959
3.920372
68f8498b-6640-472c-88a5-183bff8d9baa
ManishSingh00/Leetcode-Problems
1794-minimize-deviation-in-array/minimize-deviation-in-array.cpp
class Solution { public: int minimumDeviation(vector<int>& nums) { int n = nums.size(); priority_queue<int>pq; int ans = INT_MAX; int mini = INT_MAX; for(int i=0;i<n;i++){ if(nums[i]%2 == 1){ pq.push(nums[i]*2); mini = min(mini,nu...
ALGO
0.999908
5.253309
99d40435-d5cd-4319-9151-4594aacc367a
ishandutta2007/codeforces
vladprog/normal/1327/A.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define int ll typedef long double ld; typedef pair<int,int> pii; #define x first #define y second signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t; cin>>t; while(t--) { int n,k; ...
ALGO
0.999718
4.251833
a3b8814b-24fb-4d2d-8759-b452a5ff173c
selat/algorithms-and-programming-problems-and-solutions
chapter05/p02-02.cpp
#include <iostream> #include <iomanip> using namespace std; /* * 5.2.2. Add the following requirement to the preceding program: If a processed * part is a decimal number, its value should be placed into the variable val: real. */ struct State { State() : type(INITIAL), res(0.0), fmul(0.1) {} enum Type {ACCEPT, ...
ALGO
0.998009
4.872663
67f251e3-6b7a-428a-b423-bea4ebaf5799
samyak1326/DAA_lab
Week_3/Insertion Sort/solution.cpp
#include <iostream> using namespace std; int* insertion_sort(int* arr, int n) { int i, j, tempval, shifts=0, comp=0; int* ret = new int[2]; for(i=1; i<n; ++i) { if(arr[i]<arr[i-1]) { tempval=arr[i]; j=i-1; while(j>=0 && arr[j]>tempval) { ...
ALGO
0.999431
3.922765
890c9855-9667-46be-96bb-c361cf615453
mohammad-majoony/codeForces-submits
B. Lecture Sleep/main.cpp
// When i wrote this code, only me and God knew how it works. Now only God knows... // https://codeforces.com/problemset/problem/961/B #include <bits/stdc++.h> #define MAJOONI ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); #define ONLINE_JUDGE #define _MOD (1000000007) #define MOD(n) (((n % _MOD) + _MOD) % _MO...
ALGO
0.999907
3.630175
69232e05-789f-44d6-a018-76417a6f6039
newton-raphson/SPM2025
examples/DendriteBasics/SurfaceLoop/src/main.cpp
// // Created by maksbh on 10/15/20. // #include <DendriteUtils.h> #include <SubDA/SubDomain.h> #include <Boundary/SubDomainBoundary.h> #include "Loop.h" #include <IO/VTU.h> #include <PETSc/VecBounds.h> int main(int argc, char * argv[]){ dendrite_init(argc,argv); DENDRITE_UINT eleOrder = 1; DENDRITE_UINT nd...
ALGO
0.998918
4.853191
ad458186-4ba4-46ba-bfbc-1376c97dbac0
vivkumar2830/dsa
binaryTree/VariousViewInTree.cpp
#include<bits/stdc++.h> using namespace std; class Node{ public: int data; Node* left; Node* right; Node(int data){ this->data=data; left=NULL; right=NULL; } }; Node* buildTree(){ int data; cout<<"enter the data: "<<endl; cin>>data; if(data == -1){ ...
ALGO
0.999902
4.301508
1c737bc3-bb0f-4d16-b797-0f0fc811b7da
lionkingchuja/leet_code
2076-sum-of-digits-of-string-after-convert/2076-sum-of-digits-of-string-after-convert.cpp
class Solution { public: int getLucky(string s, int k) { int temp=0; for(auto i:s) { int curr=i-'a'+1; while(curr >0){ temp +=curr %10; curr /=10; } } int sum=temp; k--; while(k >0){ sum=0...
ALGO
0.999955
6.075616
c07634c6-c21c-4e5e-9aa1-ea0f0b21d7c9
mjkoder/Learnings
PW-DSA(codes)/4-Vector/InputInVector.cpp
#include <iostream> #include <vector> using namespace std; int main() { int m; cout<<"Size of Vector: "; cin>>m; vector <int> v(m); //TYPE-I SIZE GIVEN cout<<"Enter Elements: "; for(int i=0;i<m;i++) { cin>>v[i]; //Input } for(int i=0;i<m;i++) { cout<<v[i]<<" "; /...
ALGO
0.989439
3.72202
aec506fb-dd37-4a0c-854c-1665b058ff7f
marlinprotocol/modified-btc
src/util/system.cpp
#include <util/system.h> #include <chainparamsbase.h> #include <util/strencodings.h> #include <util/string.h> #include <util/translation.h> #ifndef WIN32 // for posix_fallocate #ifdef __linux__ #ifdef _POSIX_C_SOURCE #undef _POSIX_C_SOURCE #endif #define _POSIX_C_SOURCE 200112L #endif // __linux__ #include <algor...
TOOL
0.991381
7.126004
ec7da24b-a4c8-469a-b7ea-064f3c9c3a2e
Hub3r/Maze_Solver
main.cpp
#include <cstdio> #include <cstdlib> // For atoi #include <iostream> #include "maze_objects/inc/maze.h" #include "solving_algorithms/breadth_first/breadth_first.hpp" int main(int argc, char *argv[]) { if (argc != 4) { std::cerr << "Usage: " << argv[0] << " <rows> <cols> <algorithm>" << std::endl; ...
ALGO
0.989637
5.957571
fa7b58b8-1ced-425b-ab91-8c0a989675dd
sdycxx2279/myAlgorithm
90.cpp
// //@author Xiao Xu //@create 2018-09-13 22:34 //Subsets II // // #include <iostream> #include <vector> #include <algorithm> using namespace std; class Solution { public: vector<vector<int>> subsetsWithDup(vector<int>& nums) { vector<vector<int>> result; if(nums.empty()) return resul...
ALGO
0.999936
5.675746
c757339b-9b19-4dd7-853b-f84f9c3002d1
prateek27/Coding-Problems
Shortest Paths/Dijkshtra Adjaceny List and Heap (ELogV).cpp
#include<iostream> #include<cstdio> #include<vector> #include<queue> #include<cstring> #define INT_MAX 1000000000 using namespace std; int dist[100]; class myComparison{ public: bool operator()(const int&a,const int&b){ return dist[a]>dist[b]; // this is for Min-heap based on distance comparison } }; st...
ALGO
0.999972
3.949211
ae09c1e6-ae40-450e-b21b-bb11e115b592
anushkaGurjar99/Data-Structure-and-Algorithms
LEETCODE/Tree/Binary Search Tree/Q173. Binary Search Tree Iterator.cpp
/* * Author : Anushka Gurjar * Date : June 2020 * flags : -std=c++17 */ #include<bits/stdc++.h> using namespace std; // Problem Statement: https://leetcode.com/problems/binary-search-tree-iterator/ class BSTIterator { public: stack<TreeNode*> nodes; BSTIterator(TreeNode* root){ while(root){ ...
ALGO
0.999981
6.841146
7aeb891e-9ecf-4f8f-8864-67d543f2f544
YonahGoldberg/cilk
.history/src/benchmark_20240408162202.cpp
#include <algorithm> #include <benchmark/benchmark.h> #include <cassert> #include <chrono> #include <functional> #include <iostream> #include <iterator> #include <random> #include "scheduler.hpp" #include "simple_cs_scheduler.hpp" #include "simple_scheduler.hpp" #include "fib.hpp" #include "quicksort.hpp" SimpleSche...
TEST
0.970555
6.352425
4e10199d-11fe-4a70-9c20-aab1c0d6c4ff
fitnesswithrohit/JECRC
G2/search_element.cpp
#include<bits/stdc++.h> using namespace std; bool find(vector<vector<int> >mat, int n, int k){ for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(k == mat[i][j]){ return true; } } } return false; } void print(vector<vector<int> > mat, int n){ for(in...
ALGO
0.999808
4.123363
9da0affd-b653-4045-8fb7-6c84b79e11b3
CDPS/Competitive-Programming
RPC/2016/Round 5/juanma.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int t; scanf("%d",&t); while(t--){ int n; scanf("%d",&n); long long res= (n*n*n*n)-(6*n*n*n)+(23*n*n)-(18*n)+24; printf("%lld\n",res/24); } return 0; }
ALGO
0.998648
3.496281
9ab779cf-bda1-4758-97ea-2f476bfb9ab0
GU1LHERMESILV4/ProjetosLinguagemC
GRAUS FAHRENHEIT PARA CELSIUS/Fahrenheit para Celsius.cpp
#include <stdio.h> #include <stdlib.h> /* Autor: Guilherme Antonio Silva Data: 11/03/24 */ int main(){ float far; printf ("Informe a temperatura em graus Fahrenheint: \n"); scanf ("%f" , &far); float cel = (far - 32) * 5/9; printf ("A temperatura em graus Celsius eh: %.2f\n" , cel ); ...
TOOL
0.977609
3.610695
28844abd-6369-4d3e-ae27-6f934bf72cc1
WarpHero/LearnAlgorithm
STUDY/Week03-1/11725.cpp
//Find Root Node #include <iostream> #include <vector> #include <queue> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int N; cin >> N; int* arr = new int[N + 1]; vector<vector<int>> v(N+1); queue<int> qu; for (int i = 1; i < N; i++) { int n, m; cin >> n >> m; v[n].pu...
ALGO
0.999987
4.350182
ea4a0da1-6bcd-4497-843e-6ca256427269
ishandutta2007/codeforces
_su1sen/normal/1183/C.cpp
#include <bits/stdc++.h> #include <limits> #include <type_traits> namespace suisen { // ! utility template <typename ...Types> using constraints_t = std::enable_if_t<std::conjunction_v<Types...>, std::nullptr_t>; template <bool cond_v, typename Then, typename OrElse> constexpr decltype(auto) constexpr_if(Then&& then,...
ALGO
0.999905
3.797172
e3488a3d-bd11-4c81-9583-644d8e6ed872
ishandutta2007/codeforces
adalbert/normal/769/C.cpp
///Lol kek cheburek/// #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int,int> pii; typedef vector<int> vi; typedef vector< pii > vii; typedef long double ld; #define pb push_back #define mp make_pair #define ins insert #define ers erase #define elif...
ALGO
0.99999
3.893919
53c55e1c-b5a3-4776-b5ad-079150c7f2e0
ishandutta2007/codeforces
peti1234/normal/1687/C.cpp
#include <bits/stdc++.h> using namespace std; const int c=200005; int w, n, m; long long sum, a[c], b[c]; vector<pair<int, int> > sz[c]; queue<pair<int, int> > q; set<int> s; void cl(int a) { s.erase(a); for (auto x:sz[a]) { int f=x.first, g=x.second; if (s.find(f)==s.end() && s.find(g)==s.end(...
ALGO
0.999975
3.650142
eeb42590-cb6e-4e38-930b-ecd20137bd45
mithun1st/_flutter
dropdownbutton/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.998297
6.786404
1d87239a-208c-40bd-9246-f398ff52cac9
rohitkumar1502/CPP-CipherSchools
Lacture28-CipherSchools/Linkedlist-II.cpp
#include <iostream> using namespace std; class node { public: int data; // assume it is storing int type of data node *next; node(int data_input) { this->data = data_input; this->next = NULL; } }; void printnode(node *&node) { cout << "value " << node->data << endl; cout <...
ALGO
0.991603
4.244998
e10c1560-c5d1-45a7-ad58-f59b1199ecc0
homsluo/LeetCode
102. Binary Tree Level Order Traversal.cpp
// // Created by homsl on 2020/2/19. // vector<vector<int>> levelOrder(TreeNode* root) { vector<vector<int>> res; if(!root) return res; queue<TreeNode*> q; q.push(root); while(!q.empty()){ int size = q.size(); vector<int> list; for(int i = 0; i < size; i++){ ...
ALGO
0.999888
5.575617
913704d5-a67a-4552-a20f-4b6f088914bb
oahednoorforhad/Codeforces-Problem-Solutions
missing number.cpp
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define fo(n) for (ll i = 0; i < n; i++) #define fo1(n) for (ll i = 1; i <= n; i++) #define ll long long #define pb push_back #define ff first #define ss second #define cy cout << "YES\n"; #define cn cout << "NO\n"; #define fIO ...
ALGO
0.999818
4.378434
eaf63ad4-9a01-4f88-8760-202fde400d7b
SRV1030/c-cpp-progs
cpp/recursion/binaryprefixprint.cpp
//print all the bits of length n such that all the prefix formed have 1x>0s #include <bits/stdc++.h> using namespace std; vector < string > binary(int n,int O,int Z,string s ,vector<string>v) { if (n == 0){ v.push_back (s); return v; } string s1 = s; s1.push_back ('1'); v = binary(n-1,O+1...
ALGO
0.999797
4.014381
eb5ed07d-c056-4c77-90e0-3851dff73849
Klink314/DataStructuresCSC300
Programs/ADD_1/expTrees/parse.cpp
#include "parse.h" // ======================= PUBLIC FUNCTIONS ================================================ // Node constructor Node::Node(string val) { value = val; left = nullptr; right = nullptr; } // Constructor - initializing root Parser::Parser() { root = nullptr; } // Destructor - free ...
ALGO
0.99845
5.721345
af9f95c0-f84f-46e7-a29f-d79ef8fb13c6
Daveda2217/sort
merge_sort.cpp
void Merge(int arr[], int left, int mid, int right) { int sorted[MAX_SIZE]; // merge_sort는 additional memory가 필요하다. int first = left; // mid를 기준으로 2개의 sub arr에 대해 첫번째 index 값들을 설정하자. int second = mid + 1; int i = left; // sorted array의 시작 index 값이다. while (first <= mid && second <= right) {...
ALGO
0.999996
6.159873
8cb13ed9-9d01-4a7e-b708-0a0ce3937ad1
asifcsai/Competitive-Programming-Problem-Solution
Vjudge - NSUPS All OJ Problem Solution/goldbachs_conjecture.cpp
#include<bits/stdc++.h> using namespace std; #define optimize() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define endl '\n' const int lim = 1e7 + 10; bool arr[lim + 10]; void sieve(void) { for(int i = 0; i < lim ; ++i) arr[i] = true; arr[0] = arr[1] = false; for(int i = 4; i <= lim; i +...
ALGO
0.999276
4.018543
d9334d96-7792-4090-89ee-9406e9895076
jconsidi/dfa-games
src/test_breakthrough_game.cpp
// test_breakthrough.cpp // unit tests for BreakthroughGame #include <cassert> #include <iostream> #include <vector> #include "BreakthroughGame.h" #include "DFAUtil.h" std::vector<int> get_penultimate_vector(int width, int height) { std::vector<int> output; for(int row = 0; row < height; ++row) { int ...
TEST
0.969097
7.429525
a64f8f18-46cd-492f-9c85-f162cb25367d
Anh2806/NguyenTruongTuanAnh_MonC
Chapter 11/Challenges/BT6.cpp
#include <iostream> #include <iomanip> #include <string> using namespace std; // Define the structure for soccer player data struct SoccerPlayer { string playerName; int playerNumber; int pointsScored; }; // Function to input data for a soccer player void inputPlayerData(SoccerPlayer& player) { cout ...
ALGO
0.983622
7.812749
3f7e52bf-a405-4adc-8dc6-d7e69c5cadb3
VuseKaylous/compiler_proj
project/scanner_v2.cpp
#include<iostream> #include<fstream> #include<cstring> #include<vector> #include<map> #include<regex> using namespace std; const int N = 50; // the terminal characters vector<string> end_signs{"<=", ">=", "<", ">", "==", "!=", "=", "+", "-", "*", "/", "!", "||", "&&", ",", ")", "]", "(", "[","{", "}", ";"}; vector<st...
ALGO
0.994693
3.48162
fe96cf46-320b-4d42-941c-9c292dcaad7d
ShimuGuyue/AlgorithmPractice-Codes
Codeforces/题库/CF1904C.cpp
// $$$$$$\ $$\ $$\ $$\ $$$$$$\ $$$$$$\ $$$$$$\ // $$ __$$\ $$ | \$$\ $$ |$$ __$$\ \_$$ _|$$ __$$\ // $$ / $$ |$$ | \$$\ $$ / $$ / \__| $$ | $$ / $$ | // $$$$$$$$ |$$ | \$$$$ / \$$$$$$\ $$ | $$$$$$$$ | // $$ __$$ |$$ | \$$ / \____$$\ $$ | $$ __$$ | // $$ | $$ |$$ | ...
ALGO
0.999948
4.311123
2d096f4e-036e-4c71-8fbe-f98f120ee74f
huangallen2008/cppcode
code/contest/codeforces/Codeforces Round 1040 (Div. 1)/C1.cpp
#include<bits/stdc++.h> using namespace std; // #pragma GCC optimize("O3,unroll-loops") // #pragma GCC target("avx2,sse4,bmi2,popcnt") #define int long long #define REP(i,n) for(int i=0;i<(n);i++) #define REP1(i,n) for(int i=1;i<=(n);i++) #define RREP(i,n) for(int i=(n)-1;i>=0;i--) #define RREP1(i,n) for(int i=(n);i>=1...
ALGO
0.99971
3.86506