uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
5aaacb28-20ab-4bc2-9332-6dea8a8dac4f
Rotini85/Lewis_ECOGEN
src/AdditionalPhysics/Viscosity/APUEqViscosity.cpp
#include "APUEqViscosity.h" using namespace tinyxml2; //*********************************************************************** APUEqViscosity::APUEqViscosity(int& numberQPA, Eos** eos, const int& numbPhases) { m_muk = new double[numbPhases]; for (int k = 0; k < numbPhases; k++) { m_muk[k] = eos[k]->getMu();...
ALGO
0.996207
4.784905
37896bf3-7655-4b7a-844c-730d57002003
ivanisakov99/EC504
1. Sorting & Top-Down Splay Trees/topdownsplay.cpp
#include <iostream> #include <cstdio> #include <cstdlib> using namespace std; typedef struct Node Data_Node; struct Node{ int code; char zip[12]; char city[150]; char state[6]; }; struct Tree_node{ int key; Tree_node* lchild; Tree_node* rchild; Data_Node* data; }; class SplayTree{ public: ...
ALGO
0.999954
3.661975
f01dec22-6d4c-460d-8a32-d3840d23f50f
Devn913/DSACpp
13.Stacks&Queues/StackUsingTemplates.cpp
/* * Stack implementation using Templates */ #include "iostream" using namespace std; template <typename T> class Stack{ T * arr; int nextIndex; int size; public: Stack(){ arr = new T[5]; nextIndex = 0; size = 5; } void push(T val){ if(nextIndex == size){ ...
ALGO
0.993298
4.556583
72e063ce-b942-42b8-bb76-03345a3ac3c9
fextivity/Algorithm-Library
Graphs/Connected components, bridges, articulations points/Finding Articulation Points.cpp
int n; vi adj[N]; int tin[N], low[N]; bool ck[N], iscutpoint[N]; int tim; void dfs(int u, int p){ ck[u] = true; tin[u] = tim; low[u] = tim; tim++; int child = 0; Fora(v, adj[u]){ if (v == p){ continue; } if (ck[v]){ low[u] = min(low[u], tin[v]); ...
ALGO
0.998974
4.546928
785d04b4-5902-4ecb-bebd-4d502ac5a5b3
ishandutta2007/codeforces
maspy/normal/907/A.cpp
#line 1 "/home/maspy/compro/library/my_template.hpp" #include <bits/stdc++.h> using namespace std; using ll = long long; using pi = pair<ll, ll>; using vi = vector<ll>; using u32 = unsigned int; using u64 = unsigned long long; using i128 = __int128; template <class T> using vc = vector<T>; template <class T> using v...
ALGO
0.999
3.856489
4ea0ad9f-8063-44a1-8dfb-e0379b1b3bb7
s-shikharcse/Spoj-Code
gcd.cpp
#include<iostream> #include<algorithm> using namespace std; long long int gcd(int A,int B) { if(B==0) return A; else gcd(B,A%B); } int main() { ios::sync_with_stdio(false); cin.tie(NULL); int n=1; long long int *f = new long long int[20000]; fill(f,f+20000,0); while(1) { long long int g=0; cin>>n; ...
ALGO
0.99983
4.116317
a600f92d-5d2d-42e3-8d28-797029d8ac45
mshockwave/llvm
lib/Transforms/Utils/CtorUtils.cpp
#include "llvm/Transforms/Utils/CtorUtils.h" #include "llvm/ADT/BitVector.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Function.h" #include "llvm/IR/GlobalVariable.h" #include "llvm/IR/Module.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" #define DEBUG_TYPE "ctor_utils" namespace llvm...
TOOL
0.909604
7.805687
8789b02f-872d-4777-b666-c17a0941cb73
AnselGitAccount/USERMESO-2.0-mdpd
src/bond_fene.cpp
#include "math.h" #include "stdlib.h" #include "bond_fene.h" #include "atom.h" #include "neighbor.h" #include "domain.h" #include "comm.h" #include "update.h" #include "force.h" #include "memory.h" #include "error.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- ...
ALGO
0.999335
5.683812
0f5afe18-7722-4bd0-86ee-a38e447f3c5c
414owen/Hackerrank
Contests/ThirtyDaysOfCode/02_Arithmetic/02_Arithmetic.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <iomanip> using namespace std; int main() { double price; double tip, tax; cin >> price >> tip >> tax; double tipValue = (price/100) * tip; double taxValue = (price/100) * tax; cout << "The fi...
ALGO
0.996685
4.605884
1396e275-9799-4aa6-9eed-1f417e94834a
ammar-2023/C-For-Data-Structure
Module 6.5 ( Pracctise )/Dynamic_object_copy.cpp
#include<bits/stdc++.h> using namespace std; class person { public: string name; int age; person(string name,int age) { this->name=name; this->age=age; } }; int main() { person*rakib=new person("Rakib Hasan",25); person*sakib=new person("Sakib Hasa...
ALGO
0.935748
4.022102
79f508f9-6c99-4cff-8008-bbec08b97eaf
saks1209am/SDE-Problems-Solutions
Buy and sell stock.cpp
class Solution{ public: int maxProfit(vector<int>& prices){ int maxPro = 0; int minPrice = INT_MAX; for(int i=0;i<prices.size();i++){ minPrice = min(minPrice,prices[i]); maxPro = max(maxPro,prices[i] - minPrice); } return maxPro; } };
ALGO
0.99934
6.007606
0027d38c-9aee-4410-9b5e-9bb2aa2fdcc8
iaht211/applied-algorithm
main/tsp/test2.cpp
#include<bits/stdc++.h> using namespace std; const int inf = 1e9 + 7; int n; int a[21][21]; int x[21]; int visited[21]; int sum=0, sum_best; void enter() { cin >> n; for(int i = 1; i <= n; i++) { for(int j = 1; j <= n; j++) { cin >> a[i][j]; } } visited[1] = 1; x[1] = 1...
ALGO
0.999964
3.392082
af5048f3-5737-4da4-8c19-97e8c52fd712
timeplus-io/proton
programs/install/Install.cpp
#include <iostream> #include <filesystem> #include <boost/program_options.hpp> #include <sys/stat.h> #include <pwd.h> #if defined(OS_LINUX) #include <syscall.h> #include <linux/capability.h> #endif #if defined(OS_DARWIN) #include <mach-o/dyld.h> #endif #include <Common/Exception.h> #include <Common/Shel...
TOOL
0.852115
5.525144
1f78a0f3-ce42-4536-b673-839390a8e4b9
Absen1er/c-codes
FIB_SEQ/FIB_SEQ.cpp
#include <bits/stdc++.h> using namespace std; long long a[10001]; int main() { freopen("FIB_SEQ.inp","r",stdin); freopen("FIB_SEQ.out","w",stdout); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; } sor...
ALGO
0.999996
3.896148
c304431a-f271-4ad6-841a-4de6a4f248e3
andrecreppe/CompCodes
SCC0218_AAA/aula02/ex01.cpp
#include <stdio.h> #include <map> #include <vector> #include <algorithm> using namespace std; // void testFormat(const pair<int, pair<int,int>> &data) { // printf("%d > (%d - %d)\n", data.first, data.second.first, data.second.second); // } bool sortbysec(const pair<int,int> &a, const pair<int,int> ...
ALGO
0.999875
4.264958
068e0ebf-990c-451b-8539-46bbfa14578c
azizur-rahaman/Problem-solving-with-c-plus-plus
cp sheets/takeUForward/cpp/A. Yet Another Two Integers Problem.cpp
#include <iostream> #include <vector> #include<set> using namespace std; #define int long long #define vi vector<int> #define vii vector<vi> #define YES cout << "YES" << endl #define NO cout << "NO" << endl void solve() { int a,b; cin>>a>>b; cout << (abs(a - b) + 9) / 10 << endl; } int32_t main() {...
ALGO
0.997117
4.466606
c08f67b0-a9d0-4fcd-8ec8-f058f0fd9655
ishandutta2007/codeforces
yp155136/normal/898/A.cpp
#include <iostream> using namespace std; int main () { int x; cin >> x; if (x%10==0) { cout << x<<endl; } else if (x%10 <= 5) { cout << (x/10)*10 << endl; } else { cout << (x/10)*10+10<<endl; } }
ALGO
0.999761
3.956829
f55f3e09-ef86-461b-bbd3-653217f95e1a
yangchenleon/programming-contest
Programming-Contest-Challenge/Beginner/2-4-1_1-树和二叉树.cpp
/* * ڵ㡢ӽڵ㡢ֵܽڵ㡢Ҷӽڵ * нڵĶӸ2 * * ʹsetmap * setDzظϣͬһ * * ڶɵģܼint iҪһiter */ #include <cstdio> #include <set> #include <map> #include <string> using namespace std; int main() { set<int> s; s.insert(1); s.insert(3); s.insert(5); set<int>::iterator ite; ite = s.find(1); if(ite == s.en...
ALGO
0.975276
3.502439
9365ef1d-a0a7-49f8-b8bd-3b0d6ca93c87
skui-org/skia
modules/skottie/src/animator/Vec2KeyframeAnimator.cpp
#include "include/core/SkContourMeasure.h" #include "modules/skottie/src/SkottieJson.h" #include "modules/skottie/src/SkottieValue.h" #include "modules/skottie/src/animator/Animator.h" #include "modules/skottie/src/animator/KeyframeAnimator.h" #include <cmath> namespace skottie::internal { namespace { // Spatial 2...
TOOL
0.862121
7.752753
d0af52f7-9a94-4ba2-8ef8-d2d2508d06ff
theSt33v/Ender-3-S1-Skr-Mini-E3V3-Edition
Firmware/Marlin/src/lcd/menu/game/snake.cpp
#include "../../../inc/MarlinConfigPre.h" #if ENABLED(MARLIN_SNAKE) #include "game.h" #define SNAKE_BOX 4 #define HEADER_H (MENU_FONT_ASCENT - 2) #define SNAKE_WH (SNAKE_BOX + 1) #define IDEAL_L 2 #define IDEAL_R (LCD_PIXEL_WIDTH - 1 - 2) #define IDEAL_T (HEADER_H + 2) #define IDEAL_B (LCD_PIXEL_HEIGHT -...
TOOL
0.900643
6.458833
dd672618-fff6-4cdf-a08b-eb8ea7c0274a
tlsgkdns/study
DataStructure/Stack/3986_goodWord.cpp
#include <iostream> #include <stack> using namespace std; int N, ans = 0; string str; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> N; for (int i = 0; i < N; i++) { stack<char> s; cin >> str; for (int idx = 0; idx < str.size(); idx++) { if (!s.empty() && s.top() =...
ALGO
0.999626
4.893683
2a7fd063-d8ba-4fa7-a57e-dcd959bb5cf0
MohamadMansouri/privacy-preserving-neural-networks
2pc_model_quantized_batches/server.cpp
/********************************************* Author: Mohamad Mansouri Email: <EMAIL> Date: 11/09/2018 **********************************************/ #include <ENCRYPTO_utils/crypto/crypto.h> #include <ENCRYPTO_utils/parse_options.h> #include <abycore/aby/abyparty.h> #include <abycore/circuit/share.h> #include <abyc...
TOOL
0.873355
4.404874
9a348e1b-b8af-442d-b877-22f458b35134
liang-liang-gao/my-first-repository
实验1_2.cpp
#include<iostream> #include<math.h> int h = 0; using namespace std; class subset { public: void f(int*a,int k,int m); subset(int*a1,int k1,int m1):a(a1),k(k1),m(m1){} private: int*a; int k; int m; }; void subset::f(int* a, int k, int m) { if (k==m) { int sum=0; for(int i=0;i<=m;i++) s...
ALGO
0.999977
3.801718
9f02ae4d-d55b-4bc6-8319-72f7460c4e7b
sohardforaname/ACM_ICPC_practice
luogu/1068.cpp
#include <iostream> #include <algorithm> using namespace std; struct node { int index, grade; }num[5005]; bool cmp(node& a, node& b) { if (a.grade == b.grade) return a.index < b.index; return a.grade > b.grade; } int main() { int n, m; cin >> n >> m; m *= 1.5; for (int i = 0; i < n; ++i) cin >> num[i].index ...
ALGO
0.999977
4.05604
a347d998-d882-469a-85cd-fce3de10622d
duixin111/c-primer
SwapNum.cpp
#include<stdio.h> int main() { int a, b; scanf_s("a=%d,b=%d", &a, &b); a ^= b; b ^= a; a ^= b; //a = a ^ b; //b = a ^ b; //a = a ^ b; printf("a=%d,b=%d", a, b); return 0; }
ALGO
0.999804
3.119457
357ff2a6-a717-4d5e-98f8-9f40829ca915
Luecx/FFES
src/model/buildReducedLoadVector.cpp
#include "Model.h" #include "../system/LoadCase.h" Eigen::Matrix<Precision,Eigen::Dynamic,1> Model::buildReducedLoadVector(LoadCase* load_case) { ID max_id = this->numerateUnconstrainedNodes(load_case); Eigen::Matrix<Precision,Eigen::Dynamic,1> nodal_forces {max_id, 1}; ERROR(load_case->node_...
ALGO
0.90813
4.733109
c0634e89-00dd-4fab-b1bb-ed995457e4d4
seo-bo/ProblemSolving
프로그래머스/1/12944. 평균 구하기/평균 구하기.cpp
#include <string> #include <vector> using namespace std; double solution(vector<int> arr) { double answer = 0; int sum = 0; for(auto & i : arr) { sum += i; } return (double)sum / (int)arr.size(); }
ALGO
0.996618
4.148086
5bddd10a-41f0-4681-8a5a-7065e6a3067c
GyeongahNa/ProgrammersArchive
code/lv3_아이템줍기.cpp
#include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #include <tuple> #include <vector> #include <stack> #include <queue> #include <deque> #include <set> #include <map> #include <unordered_set> #include <unordered_map> #include <iostream> using namespace std; using ii = pair<int, int>; using iii ...
ALGO
0.999414
4.327514
c273d078-e022-4ffa-b851-67a36417175a
haritonn/cpp_tasks_2sem
sort_task/heapsort.cpp
#include <iostream> #include <vector> #include <fstream> #include <string> #include <algorithm> #include <iomanip> using namespace std; //Структура для описания каждого сотрудника struct Employee { string name, post, birth; int dd, mm, yy, exp, salary; }; //Функции для пирамидальной сортировки void heapify(...
ALGO
0.984546
4.154173
6b69d865-5268-4fd5-8141-23808231bad7
dartmol203/TEP
Estruturas-de-dados/lista1/J_-grid_city.cpp
#include <stdio.h> #include <math.h> #include <stdlib.h> int locsx[50001], locsy[50001]; int compare(const void *a, const void *b) { const int *x = (int *)a; const int *y = (int *)b; if (*x > *y) return 1; else if (*x < *y) return -1; return 0; } int main() { int T, a, s, f;...
ALGO
0.99966
3.332668
c94bf7fc-dfbc-4dcf-9283-0f1bc2bbbcf9
Nik1619/HomeWork
11.11.2018. Каникулярное дз -Alternative/3.cpp
/*3) , . , k- .*/ #include <iostream> using namespace std; int main() { int n, m = 0, k = 0, i = 0; cin>>n; while (m != n) { bool y = true; bool p = true; for (int j = 2; j < i; j++) { if (i%j == 0) { y = false; break; } } if (i < 2)y = false; if (y == true) { k++; ...
ALGO
0.999852
3.910094
c72fb55f-1d99-422f-b4ad-958b366752e0
Lee-jisang/BOJ-and-Programmers
BOJ/단계별로 풀어보기/07_문자열/02_최댓값_2562.cpp
/* 문제 N개의 숫자가 공백 없이 쓰여있다. 이 숫자를 모두 합해서 출력하는 프로그램을 작성하시오. 입력 첫째 줄에 숫자의 개수 N (1 ≤ N ≤ 100)이 주어진다. 둘째 줄에 숫자 N개가 공백없이 주어진다. 출력 입력으로 주어진 숫자 N개의 합을 출력한다. */ #include <iostream> #include <string> using namespace std; int main() { int N; //숫자의 개수 cin >> N; //1<=N<=100 string s; cin >> s; // stoi(s) 문자...
ALGO
0.994753
5.034439
00fd58a9-a092-45d0-80d6-d95c36f395ee
SayedMahdiMousavi/simple_algorithms_cpp
sorting_algorithms/binary_search/binary_search.cpp
#include <iostream> #include <vector> #include <sstream> using namespace std; vector<int> get_value(){ std::string input_str; vector<int> element; std::cout << "Enter elemnts array(separate elements with commas): "; getline(std::cin, input_str); stringstream ss(input_str); std::string tem...
ALGO
0.999175
4.993934
d038a6e1-9a17-4aff-890e-cbe46f111806
Blackcastus/Learn_C_Plusplus
Function_Overloading/Function_Overloading/Function_Overloading.cpp
/* * Function Overloading là tính năng của ngôn ngữ C++ (không có trong C). * Kỹ thuật này cho phép sử dụng cùng một tên gọi cho nhiều hàm (có cùng mục đích). * Nhưng khác nhau về kiểu dữ liệu tham số hoặc số lượng tham số. * Note: * Không thể nạp chồng hàm nếu chúng chỉ khác nhau kiểu dữ liệu trả về. * Khai báo type...
TOOL
0.922616
3.944952
1d40d354-553e-48b5-b878-6f855678760c
genkinanodesu/competitive
AtCoder/CPSCO2019/session1/B.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> Pii; typedef vector<ll> Vi; typedef vector<Vi> VVi; const double EPS = (1e-7); const ll INF =(1e13); const double PI = (acos(-1)); const ll MOD = ll(1e9) + 7; #define REP(i, n) for(ll i = 0; i < (ll)(n...
ALGO
0.999996
3.68921
b185b18f-d4c5-4a53-9ec6-976da5b45b06
gimme02/gem5-src
src/systemc/tests/systemc/misc/user_guide/chpt4.2/stage3.cpp
/***************************************************************************** stage3.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /*****************************************************************************...
ALGO
0.99948
4.191345
b25e72a6-9b80-425a-8ba6-660e75003978
OuluLinux/MathPad
src/LibGiac/derive.cpp
#include "giacPCH.h" using namespace std; #include <stdexcept> #include <cmath> #include "derive.h" #include "usual.h" #include "symbolic.h" #include "unary.h" #include "poly.h" #include "sym2poly.h" // for equalposcomp #include "tex.h" #include "prog.h" #include "intg.h" #include "subst.h" #include "plot.h" #include ...
ALGO
0.999835
5.304297
3822bae3-ebb3-40ee-b094-e6cfa098f6ee
dheerajsingh89/DSA
GeeksForGeeks/Valid Substring.cpp
class Solution { public: int findMaxLen(string s) { // code here stack<int>st; st.push(-1); int ans=0; for(int i=0;i<s.length();i++){ if(s[i]=='(')st.push(i); else{ st.pop(); if(!st.empty()){ ans=ma...
ALGO
0.999481
4.84402
0ffe01f1-23f6-420f-8b55-b4147e976678
bitwiseworks/qtwebengine-chromium-os2
chromium/third_party/SPIRV-Tools/src/source/opt/scalar_analysis.cpp
#include "source/opt/scalar_analysis.h" #include <algorithm> #include <functional> #include <string> #include <utility> #include "source/opt/ir_context.h" // Transforms a given scalar operation instruction into a DAG representation. // // 1. Take an instruction and traverse its operands until we reach a // constant ...
ALGO
0.996363
6.074487
c1844031-b3e9-4d20-81b5-920e43617103
ishandutta2007/codeforces
zdolny_kaczor/normal/1110/E.cpp
//Konrad Paluszek, University of Warsaw (former XIV LO Warsaw) #ifndef LOCAL #pragma GCC optimize("O3") #endif #include <bits/stdc++.h> using namespace std; #define sim template <class c #define mor > muu & operator<< ( #define ris return *this #define R22(r) sim> typename enable_if<1 r sizeof(dud<c>(0)), muu&>::type o...
ALGO
0.999967
3.618083
2231bafd-37ca-47c3-95ad-f2c43e0eab00
AdityaHegde02/Leetcode-Solved
3190-find-minimum-operations-to-make-all-elements-divisible-by-three/3190-find-minimum-operations-to-make-all-elements-divisible-by-three.cpp
class Solution { public: int minimumOperations(vector<int>& nums) { int ops = 0; for(auto &i : nums){ ops += ((i % 3) != 0); } return ops; } };
ALGO
0.999508
6.148901
d817b9db-d3eb-45be-912a-a256403c90c4
Illusion0-0/LCBase
2064-minimized-maximum-of-products-distributed-to-any-store/2064-minimized-maximum-of-products-distributed-to-any-store.cpp
class Solution { public: int minimizedMaximum(int n, vector<int>& q) { int l=1, r=*max_element(q.begin(),q.end()); while(l<=r){ int mid = (l+r)/2; int c=0; for(int i:q){ // if mid is the ans then to check in how many stores product[i] can goto ...
ALGO
0.999995
5.753563
9a3286f8-01b2-4c11-a253-096d41c89e10
Santanujana2001/My-Leetcode-Solutions
Permutation with Spaces - GFG/permutation-with-spaces.cpp
// { Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution{ public: vector<string> ans; void solve(string ip,string op){ if(ip.length()==0){ ans.push_back(op); return; } string op1=op; string op2=op; op1.push_b...
ALGO
0.997636
6.239753
569c6b6d-6f9a-4031-8389-6b85ddbe4f8a
theakashsarkar/competitve-programmings
lightOj-Solutions/1015-Brush(1).cpp
#include <cmath> #include <iostream> using namespace std; int main() { int numberInput; cin >> numberInput; for (int i = 1; i <= numberInput; i++) { int sum = 0; int numberOfStudent; cin >> numberOfStudent; for (int j = 1; j <= numberOfStudent; j++) { int n; ...
ALGO
0.998199
4.240199
43992379-8994-4b7c-bf1c-ebd19642c7ab
flutterde/0x08
ex01/Span.cpp
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Span.cpp :+: :+: :+: ...
TOOL
0.910954
4.91056
66673c1e-d06d-4404-aac6-da0e7b3cd3b7
actium/codeforces
1900/10/1913b.cpp
#include <iostream> #include <string> void answer(unsigned x) { std::cout << x << '\n'; } void solve(const std::string& s) { const size_t n = s.length(); unsigned f[2] = {}; for (const char c : s) ++f[c & 1]; for (size_t i = 0; i < n; ++i) { const unsigned x = s[i] - '0'; ...
ALGO
0.999836
5.660644
0eb46cbb-7b4f-49f3-952e-3d93acf9a7ad
manavtore/Leethub
1604-least-number-of-unique-integers-after-k-removals/least-number-of-unique-integers-after-k-removals.cpp
class Solution { public: struct compare { bool operator()(const pair<int,int>& a, const pair<int,int>& b) { return a.second > b.second; } }; int findLeastNumOfUniqueInts(vector<int>& arr, int k) { int min=-1; unordered_map<int,int> freq; priority_qu...
ALGO
0.999974
5.794032
7e939e67-a25e-4739-80a7-e7802b9726cb
universalDust123/Daily_coding_practice
27_remove_elements.cpp
class Solution { public: int removeElement(vector<int>& nums, int val) { int counter=0; for(int x=0; x<nums.size(); x++) { if(nums[x] == val) { nums.erase(nums.begin()+x); x--; //reset loc } else ...
ALGO
0.999562
6.133435
1b1abf90-3426-4603-9347-dd0876bd314c
limingyao/leetcode
136.cpp
// Single Number class Solution { public: int singleNumber(int A[], int n) { int result = 0; for(int i=0;i<n;i++){ result^=A[i]; } return result; } };
ALGO
0.999844
5.312752
3b012383-4b25-4c7d-9f2a-03b783d55df0
Zhoujp-Runner/Data-Structures-and-Algorithms
basic course/trietree.cpp
/*********************************************************************** * Copyright 2022 by Zhou Junping * * @file trietree.cpp * @brief 这个文件用于本人学习数据结构与算法 * * 该文件写的是一些关于前缀树的代码,包括: * 1.前缀树节点的表示 * 2.前缀树的插入 * 3.前缀树的搜索 * 4.前缀树的前缀搜索 * 5.前缀树的删除 * 最近修改日期:2022-11-20 * * @author Zhou Junping * @email ...
ALGO
0.999021
3.599781
adb39faf-06f7-4637-b4af-eb0e1337338b
ehnryx/acm
ucla-codesprint-2021/team/d.cpp
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES //#define FILENAME sadcactus #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_u...
ALGO
0.999827
4.635941
8ac97ecc-31fd-456b-baf5-86e2596aa13e
faisalOmarBadaam/Problem-Solving-Level2
problemSolvingLevel2/Problem 42/Problem 42.cpp
#include <iostream> using namespace std; int randomNumber(int from, int to) { return rand() % (to - from + 1) + from; } void genrateRandomArray(int arr[], int lenth) { for (int i = 0; i < lenth; i++) { arr[i] = randomNumber(1, 100); } } void printArray(int arr[], int lenth) { for (int i = 0; i < lenth; i++) ...
ALGO
0.928492
4.220813
4b60126c-7f91-4bc8-84e9-01589c478aae
Transurfcoin/TranSurfCoin
src/crypto/sha1.cpp
#include "crypto/sha1.h" #include "crypto/common.h" #include <string.h> // Internal implementation code. namespace { /// Internal SHA-1 implementation. namespace sha1 { /** One round of SHA-1. */ void inline Round(uint32_t a, uint32_t& b, uint32_t c, uint32_t d, uint32_t& e, uint32_t f, uint32_t k, uint32_t w) { ...
ALGO
0.998394
7.492003
cc86d59e-3ad7-4094-8afd-bc2468e6c552
eyoaab/A2SV_Solution_Pack
1046-max-consecutive-ones-iii/max-consecutive-ones-iii.cpp
class Solution { public: int longestOnes(vector<int>& nums, int k) { int le=0; int ri=0; int zeroo=0; for(ri;ri<nums.size();ri++){ if(nums[ri]==0){zeroo++;} if(zeroo>k){ if(nums[le]==0){zeroo--;} le++; } } ...
ALGO
0.999978
6.043306
8bb0611b-da9c-48c4-8e40-1b19b9832810
GhulamMustafaGM/C-Programming
09-C++ Programming/SelectionSort.cpp
// Selectoin sort #include <algorithm> #include <iostream> #include <vector> int main() { std::vector<int> v = {4, 5, 2, 3, 1, 9, 7, 8, 6, 0}; for (int i = 0; i < v.size(); std::cout << v[i++] << " ") std::swap(*std::min_element(v.begin() + i, v.end()), v[i]); }
ALGO
0.999987
4.566455
ccd8170f-4f7c-4f50-985d-93bd6259252e
edisonhello/OnlineJudge
TIOJ/1400.cpp
#include <cstdio> #include <cstdlib> #include <ctime> using namespace std; char __c; bool flag; template <typename T> inline bool rit(T& x) { __c = 0, flag = false; while (__c = getchar(), (__c < '0' && __c != '-') || __c > '9') if (__c == -1) return false; __c == '-' ? (flag = true, x = 0) : (x = __c - '0'); ...
ALGO
0.999759
3.531049
caf81e4f-cf8a-4b03-85e1-e1a380d0a5d0
RiisDev/Roblox-Executor-Sources
2023 Sources/Roblox UWP API V1 - Github/YT/Luau-Core/source/lmathlib.cpp
#include "lstate.h" #include <math.h> #include <time.h> #undef PI #define PI (3.14159265358979323846) #define RADIANS_PER_DEGREE (PI / 180.0) #define PCG32_INC 105 static uint32_t pcg32_random(uint64_t* state) { uint64_t oldstate = *state; *state = oldstate * 6364136223846793005ULL + (PCG32_INC | 1); ui...
TOOL
0.94101
6.4614
0d90d301-bf26-461d-9014-af66eda4cd17
ixray-team/xray-vss-archive
xrCore/LzHuf.cpp
// LzHuf.cpp : Defines the entry point for the console application. // #include "stdafx.h" #pragma hdrstop #include <io.h> #include <fcntl.h> #include <sys\stat.h> #define MODULE //typedef unsigned char BYTE; unsigned textsize = 0, codesize = 0; char wterr[] = "Can't write."; /********** LZSS compression ******...
TOOL
0.942389
3.115748
10d043aa-0c91-4b75-a7ac-bb3d5a45377e
cuongdeptrai827/Algorithms_Sem1
Sample Code/Sort algorithms/MergeSort/main.cpp
#include <iostream> using namespace std; void merge(int arr[], int left, int mid, int right) { int n1 = mid - left + 1; int n2 = right - mid; int L[n1]; int R[n2]; for (int i = 0; i < n1; i++) { L[i] = arr[left + i]; } for (int j = 0; j < n2; j++) { R[j] = arr[mid + 1 + j]...
ALGO
0.999985
5.358223
a108088c-5eb2-40e6-93a5-6e7adbcfdb85
Vineet95070/DSA-Training-Materials-by-RCPL
pointers.cpp
#include <iostream> using namespace std; int main(){ int x = 10; int *ptr = &x; int **pptr = &ptr; cout<< x << endl; // value in x cout<< &x << endl; // address of x cout<< ptr <<endl; // value in ptr cout<< *(&ptr) <<endl; // value at address ptr cout<< *ptr <<endl; // value at address x cout<< ppt...
ALGO
0.987732
3.683372
ea28395d-09b2-4dcf-9dbe-13aee92df15c
vishalkandu01/leetcode_solution
1340-the-dining-philosophers/the-dining-philosophers.cpp
class Semaphore { public: Semaphore() {} Semaphore(int c) : count(c){}; void setCount(int a) { count = a; } inline void signal() { std::unique_lock<std::mutex> lock(mtx); count++; if(count <= 0) cv.notify_one(); } inline void wait() { std::unique_lo...
ALGO
0.999525
5.177188
8a9019e9-5893-4c30-b86f-a932cdbe8668
Pikoti/Bioinformatics
BI TP 03 16-02-12/vidjil/algo/core/lazy_msa.cpp
#include "lazy_msa.h" #include <cassert> #include <list> #include <cstdlib> #include <string> using namespace std; LazyMsa::LazyMsa(int max, string reference) { sizeMax=max; sizeUsed=-1; ref=reference; sequences = new string[sizeMax]; gapRef= new int *[sizeMax]; gapSeq= new int *[sizeMax]; link= new ...
ALGO
0.963451
4.537047
ce85e2a2-968c-4ac5-87a1-e88fd11373b5
pakuland3/CP
contests/BOJ/2024 Chungang Kukmin Univ/C.cpp
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int n,k; cin >> n >> k; if(n==2 && k==1){ cout << "1 2"; return 0; } if(n!=1) cout << -1; else for(int i=0;i<n*k;i++) cout << "1 "; return 0; ...
ALGO
0.999945
3.292249
780db46c-85e4-4784-843e-2417e73048eb
Eafy/FFmpeg-iOS-build-script
4.2/opencore-amr-0.1.5/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/int_lsf.cpp
/* ------------------------------------------------------------------------------ Filename: int_lsf.cpp ------------------------------------------------------------------------------ */ /*---------------------------------------------------------------------------- ; INCLUDES ----------------------------------------...
ALGO
0.981652
5.449601
fef61ecd-6804-4e8e-b202-bc8a85e50021
tangs/leetcode_problems
src/97/1.cpp
#include <vector> #include <string> #include <unordered_map> using namespace std; class Solution { bool check1(const string& s1, const string& s2, const string& s3, bool* idxs, int n, int x, int y) { int sIdx = x + y; if (sIdx == s3.size()) return true; int idx = y * n + x; ...
ALGO
0.99957
5.791655
7462932b-4c11-4257-8e75-17ab73fcef05
shantanu2002git/LEET-QS
377-combination-sum-iv/combination-sum-iv.cpp
class Solution { public: int noOfWays(vector<int> &nums, int target, int size, vector<int> &dp) { if(target < 0) return 0; if(target == 0) return 1; if(dp[target] != -1) return dp[target]; int ways = 0; for(int i = 0; i<size; i++) { ways +...
ALGO
0.999984
6.177226
aab901a0-6c81-469f-8df2-e9c13ddf1bf7
ishandutta2007/codeforces
nikolapesic2802/normal/1096/A.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/rope> #define ll long long #define pb push_back #define sz(x) (int)(x).size() #define mp make_pair #define f first #define s second #define all(x) x.begin(), x.end() #define D(x) cerr << #x << " is " <<...
ALGO
0.999365
3.86151
96e58762-485c-400d-9d81-effae56e3bce
Shubham11440/LeetCode
0019-remove-nth-node-from-end-of-list/0019-remove-nth-node-from-end-of-list.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* removeNthFr...
ALGO
0.999939
5.882459
d79c1f94-6464-4939-88d2-3cd215a8eba0
iwanturequity/c-
BST/bstintro.cpp
#include<iostream> #include<queue> using namespace std; class Node{ public: int data; Node* left ; Node* right ; Node(int d){ this->data = d; this -> left = NULL; this -> right = NULL; } }; void levelOrdertraverse(Node* root){ queue<Node*>q; q.push(root); q.pu...
ALGO
0.999931
4.568606
dec458f1-5e67-475f-ba6a-f0a48fb320d0
Nheeboranga/OpenMPSnapshot
May2023/RepCPP/430749651/sha256.cpp
#include <cstring> #include <fstream> #include "../headers/sha256.h" const unsigned int SHA256::sha256_k[64] = {0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0x...
ALGO
0.996045
5.9637
9f957704-d1a2-4c4a-890f-2452d3806c62
Patateon/TER-Blocs
src/nuageDePoint.cpp
#include "../headers/nuageDePoint.h" Point_3 toPoint_3(const QVector3D& vec) { return Point_3(vec.x(), vec.y(), vec.z()); } // Fonction pour effectuer la triangulation de Delaunay void NuageDePoint::performDelaunayTriangulation(const QVector<QVector3D>& vertices,std::vector<std::vector<int>> triangles) { std:...
ALGO
0.998009
3.632261
f6d7c240-d14b-465e-8de8-03fdcc13cc05
bennyfoo/QWidgetDemo-master
qwtdemo/qwt/qwt_math.cpp
#include "qwt_math.h" /*! \brief Find the smallest value in an array \param array Pointer to an array \param size Array size */ double qwtGetMin( const double *array, int size ) { if ( size <= 0 ) return 0.0; double rv = array[0]; for ( int i = 1; i < size; i++ ) rv = qMin( rv, array...
TOOL
0.998322
6.543721
91b5abf6-80b0-40bb-87b4-76ed588bb2dd
kyulog/Language
C++/인터넷교육(basic)/Section5 STL/CPP 3. STL algorithm.cpp
ERROR: type should be string, got "https://github.com/codenuri/CPP1/tree/master/SECTION5/03_ALGORITHM\n=============STL algorithm=============\n핵심 정리\n1. 알고리즘(algorithm)의 일반적인 의미\n 어떤 문제를 해결하기 위한 절차, 방법, 명령어들의 집합\n2. STL 알고리즘\n C++ 표준 라이브러리인 STL이 제공하는 함수\n 정렬, 검색, 순열 등 다양한 알고리즘을 구현한 함수의 집합\n\nSTL 알고리즘의 특징\n1. 멤버 함수가 아니 일반 함수(템플릿)로 제공된다.\n 하나의 함수(템플릿)으로 다양한 컨테이너에 사용할 수 있다. -> 자료구조에 독립적\n 대부분의 알고리즘은 함수 인자와 반환 타입으로 반복자를 사용한다. \n --> 반복자를 사용하면 컨테이너의 내부 구조에 상관없이 동일한 방법으로 요소에 접근할 수 있다.\n2. <algorithm> 헤더가 필요함\n\nfind 알고리즘\n1. 2개의 반복자([first, end), 구간)와 검색할 값을 받아서 선형 검색을 수행하는 알고리즘\n first는 검색 대상에 포함되지만, last는 검색 대상에 포함되지 않는다.\n [first, last)\n2. 반환값\n 검색 성공시 : 요소를 가리키는 반복자\n 검색 실패시 : last 주의(null이 아님!!!!)\n#include <iostream>\n#include <vector>\n#include <list>\n#include <algorithm>\n\nint main()\n{\n int x[10] = {1,2,3,4,5,6,7,8,9,10};\n \n std::list<int> s = {1,2,3,4,5,6,7,8,9,10};\n std::vector<int> v = {1,2,3,4,5,6,7,8,9,10};\n\n //s.find(5);\n //v.find(5);\n \n std::find( begin(v), end(v), 3 );\n\n //auto p = std::find( begin(x), end(x), 3 );\n \n // auto p = std::find( x, x+10, 3 );\n \n auto p = std::find( begin(v), end(v), 3 );\n\n if ( p == end(v) )\n {\n std::cout << \"fail\" << std::endl;\n }\n else\n std::cout << *p << std::endl; //역참조\n}\n\n=============STL algorithm and predicator(조건자)=============\n핵심 정리\n1. 조건자 (predicator)\n bool을 반환하는 함수, 함수객체, 람다 표현식\n _if로 끝나는 알고리즘에 전달되어서 정책으로 사용된다.\n\n#include <iostream>\n#include <algorithm>\n#include <vector>\n\nbool foo( int n )\n{\n return n % 3 == 0;\n}\nint main()\n{\n std::vector<int> v = {10,9,8,7,6,5,4,3,2,1};\n \n // v 안에서 처음 나오는 3의 배수를 구해 보세요\n\n //auto p = std::find(begin(v), end(v), 3); \n \n //auto p = std::find_if(begin(v), end(v), foo(함수..!) ); \n \n auto p = std::find_if(begin(v), end(v), \n [](int n) { return n % 3 == 0;} );\n\n std::cout << *p << std::endl;\n}\n\n핵심정리\n\n#include <iostream>\n#include <algorithm>\n#include <vector>\n#include <numeric>\nusing namespace std;\n\nint main()\n{\n vector<int> v;\n\n int n = 0;\n \n while( 1 )\n {\n cin >> n;\n \n if ( n == -1 )\n break;\n \n v.push_back(n); \n }\n\n // 입력한 값 중 10보다 큰 값은 모두 0으로 변경해 주세요.\n replace, replace_if\n /*\n for ( auto& n : v)\n {\n if ( n >= 10 )\n n = 0;\n }\n */\n //replace( begin(v), end(v), 10, 0);\n\n replace_if( begin(v), end(v), \n [](int n) { return n >= 10;}, 0);\n\n // 모든 요소의 합 구하기, numeric에 포하ㅣㅁ\n int sum = accumulate( begin(v), end(v), 0);\n\n //sort( begin(v), end(v)); // 오름차순, 퀵소트\n // <\n sort( begin(v), end(v), \n [](int a, int b) { return a > b; });\n\n // 1로 채워서 출력해보기\n fill( begin(v), end(v), 1);\n\n for ( auto& n : v)\n std::cout << n << \", \";\n \n std::cout << endl;\n}"
ALGO
0.999041
4.65803
a8463165-69ac-404d-b5b5-0e799a245be3
CrisArevalo/EDA2-project
lineales.cpp
/****************************************************************************** Resolucion de Raíces de Ecuaciones No Lineales - Metodo Bisección *******************************************************************************/ #include <iostream> #include <iomanip> // Para establecer cantidad de decimales #include <cma...
ALGO
0.999928
4.413425
1ebb94e8-84c3-4b71-be7a-e212441024e2
ijewiarz/SPD
NEH/projekt3/projekt3.cpp
#include <iostream> #include <fstream> #include <cstdio> #include "Task.h" #include "Neh.h" using namespace std; int main() { Data D; Neh A; string path = "test.txt"; D.readData(path); //D.Test(); //vector<int> tst{ 2, 16, 8, 7, 14, 13, 10, 15, 12, 18, 5, 3, 4, 17, 0, 1, 9, 6, 19, 11}; /...
ALGO
0.983091
3.350549
283136ea-08b5-4b35-96f6-5ecf8f094e63
hydren/cplanets
src/physics/solvers/adams_moulton.cpp
/* * adams_moulton.cpp * * Created on: 8 de ago de 2016 * Author: felipe */ #include "adams_moulton.hpp" #include <utility> using std::vector; using std::deque; using std::pair; using std::make_pair; #define MAXSTEP 4 const double adams_moulton_coefficients[MAXSTEP][MAXSTEP+1] = { { 0.5, 0.5 }, { ...
ALGO
0.999908
5.974144
1dc954b5-6033-46f5-9d01-088004bd8332
exnotime/Smug2D
src/Box2D/collision/b2_collide_circle.cpp
#include "box2d/b2_collision.h" #include "box2d/b2_circle_shape.h" #include "box2d/b2_polygon_shape.h" void b2CollideCircles( b2Manifold* manifold, const b2CircleShape* circleA, const b2Transform& xfA, const b2CircleShape* circleB, const b2Transform& xfB) { manifold->pointCount = 0; b2Vec2 pA = b2Mul(xfA, circle...
ALGO
0.998517
7.741599
7132dfb8-48f8-4710-81d4-010d1ac11908
ishandutta2007/codeforces
mangooste/normal/1588/E.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define all(a) begin(a), end(a) #define len(a) ((int)((a).size())) constexpr ld EPS = 1e-9; constexpr ld PI = acos(-1); struct point { ll x, y; ll length2() const { return x * x + y * y; } point ope...
ALGO
0.999944
4.69153
ef0f4071-100b-4cbd-a66a-9dbb20a5dfe7
DCYPHERR/vsCPP
Trees/TreesIntro.cpp
// #include <iostream> // #include <vector> // using namespace std; // int main() // { // vector<int> v; // // vector<int> *v = new vector<int>(); // v.push_back(10); // v.push_back(20); // v.push_back(30); // v[1] = 100; // cout << v[0] << endl; // cout << v[1] << endl; // cout <...
ALGO
0.973783
3.62091
3b19a005-e012-4637-8bd1-004e195a4162
MOHITSAHU5649/DSA-
math/gcd.cpp
#include<iostream> using namespace std; //1. brute force un which a loop is used int gcd(int a , int b){ int gc =1; for(int i =1;i<min(a,b);i++){ if(a == 0) return b; if(b == 0) return a; if(a == b) return a; if(a%i == 0 && b%i ==0){ gc = i; } } return gc; } //2. eculid ...
ALGO
0.999401
3.509491
73f7895e-af75-4f1c-9e2e-15ddc26e4713
pahanela/leetcode
0001.4Sum/018.4Sum.cpp
class Solution { public: vector<vector<int>> fourSum(vector<int>& nums, int target) { vector<vector<int>> rtrn; if (nums.size() < 4) { return rtrn; } sort(nums.begin(), nums.end()); for (int i = 0; i < nums.size() - 3; i++) { for (int j = i + 1; j < nu...
ALGO
0.999946
6.164976
fe90e55c-af86-4753-8338-60f0f3760b3e
sxs-collaboration/spectre
src/PointwiseFunctions/AnalyticData/SelfForce/Scalar/CircularOrbit.cpp
#include "PointwiseFunctions/AnalyticData/SelfForce/Scalar/CircularOrbit.hpp" #include <complex> #include <cstddef> #include <effsource.hpp> #include <gsl/gsl_errno.h> #include <utility> #include "DataStructures/ComplexDataVector.hpp" #include "DataStructures/DataBox/Prefixes.hpp" #include "DataStructures/DataVector....
ALGO
0.998114
7.36689
c2140083-6b6b-4ad4-9953-0be74968cb72
RedemptionEngine/redemption
src/rendering/hwrenderer/scene/hw_clipper.cpp
#include "hw_clipper.h" #include "g_levellocals.h" #include "basics.h" #if defined(__SSE2__) || defined(_M_X64) #include <immintrin.h> #define USE_SSE2 #endif unsigned Clipper::starttime; Clipper::Clipper() { starttime++; } //----------------------------------------------------------------------------- // // Remov...
TOOL
0.982249
4.332142
2b7e48c7-cd25-4f76-a832-fde653c80add
joohyuk95/PS_from_BOJ
shortest_distance/38.cpp
#include <iostream> #include <vector> #include <queue> #define INF 32000 using namespace std; int main() { ios_base::sync_with_stdio(false); int n, m; cin >> n >> m; vector<vector<int> > map(n+1, vector<int> (n+1, INF)); for (int i = 1; i <= m; ++i) { int u, v, b; cin >> u >> v >> b; ...
ALGO
0.999943
3.955673
e520e160-f366-4306-80eb-26c5212f7593
nextpilot/nextpilot-flight-control
apps/estimator/ekf2/EKF/output_predictor.cpp
#include "output_predictor.h" using matrix::AxisAnglef; using matrix::Dcmf; using matrix::Quatf; using matrix::Vector2f; using matrix::Vector3f; void OutputPredictor::print_status() { printf("output predictor: IMU dt: %.4f, EKF dt: %.4f\n", (double)_dt_update_states_avg, (double)_dt_correct_states_avg); printf("ou...
ALGO
0.968372
6.611997
5b4f3917-c989-4ddf-bd3d-ae7b1317bbb5
TranAnhQuoc23521313/UIT_HomeWork_Struct
23520129_23520335_23521313_23521523_23521651_BT05/PHẦN 2/Bai018/Bai018.cpp
#include <iostream> #include <iomanip> using namespace std; struct diem { float x; float y; }; typedef struct diem DIEM; void Nhap(DIEM& P, DIEM& Q) { cout << "Nhap x:"; cin >> P.x; cout << "Nhap y:"; cin >> P.y; cout << "Nhap x:"; cin >> Q.x; cout << "Nhap y:"; cin >> Q.y; } void Xuat(DIEM P, DIEM Q) { cou...
ALGO
0.991019
3.312768
c4f51dda-3a24-4d36-af1a-baef8780eb30
neuezeldaa/Algorithms_CodeRun
solution/58.cpp
#include <iostream> #include <string> #include <vector> #include <set> using namespace std; int main() { int x, y, z, N; int c = 0; cin >> x >> y >> z >> N; set<int> digits; string str_N = to_string(N); for (int i = 0; i < size(str_N); i++) { digits.insert(N % 10); N /= 10; ...
ALGO
0.99968
3.948638
d304e21f-c57f-4d5a-8767-4c119adbdf08
folgerwang/UnrealEngine
Engine/Plugins/Experimental/AlembicImporter/Source/ThirdParty/Alembic/openexr/IlmBase/ImathTest/testTinySVD.cpp
#include "ImathMatrixAlgo.h" #include <iostream> #include <assert.h> #include <cmath> #include <limits> #include <algorithm> template <typename T> void verifyOrthonormal (const IMATH_INTERNAL_NAMESPACE::Matrix33<T>& A) { const T valueEps = T(100) * std::numeric_limits<T>::epsilon(); const IMATH_INTERNAL_NAMES...
TEST
0.973372
7.003398
748c7f4d-ba9b-4791-bde6-c69b7a8aa3d8
a920604a/leetcode
C_plus/26*_RemoveDuplicatesFromSortedArray.cpp
class Solution { public: int removeDuplicates(vector<int> &nums) { if (nums.empty()) return 0; int slow = 0, fast = 0; while (fast < nums.size()) { if (nums[fast] != nums[slow]) { slow++; // 維護nums[0...slow] 無重...
ALGO
0.999813
5.983982
07b40f9a-6093-474d-80d6-ee242b31c687
mkterhov/cpp-bits
src/memory-allocation/matrixPrimeNumbers.cpp
#include <iostream> #include <math.h> bool is_prime(int num) { if (num == 0 || num == 1) { return false; } for (int i = 2; i < std::sqrt(num); i++) { if (num % i == 0) { return false; } } return true; } void populate_square_matrix(int** matrix,...
ALGO
0.99789
4.353498
9db01c53-e48d-4038-b11f-c8a2022e364e
DS3a/esp_drone_flight_controller
managed_components/espressif__eigen/eigen/bench/perf_monitoring/trmv_upt.cpp
#include "gemv_common.h" EIGEN_DONT_INLINE void trmv(const Mat &A, Vec &B, const Vec &C) { B.noalias() += A.transpose().triangularView<Upper>() * C; } int main(int argc, char **argv) { return main_gemv(argc, argv, trmv); }
ALGO
0.969378
4.898617
494a374f-3ef0-497b-8672-f19645c17a97
ArchSecLab/xui
safepoint/src/systemc/tests/systemc/misc/v1.0/dash1/pulse.cpp
/***************************************************************************** pulse.cpp -- Implementation of the pulse generator. Original Author: Ali Dasdan, Synopsys, Inc. *****************************************************************************/ /*****************************************************...
TOOL
0.928531
6.360893
ecf2b9c5-d720-4b39-a0e3-6b576cad8ec9
lucasxia01/Competitive-Programming-Problems
Codeforces/Stanford/Practice 2/E.cpp
#include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <algorithm> #include <functional> #include <stdlib.h> #include <time.h> #include <complex> #include <iterator> #include <regex> #include <fstream> #include <utility> #include <vector> #include <string> #include <cstring> #include <stack>...
ALGO
0.999827
4.038153
6f1e9af7-3e86-47f4-906c-abaec841f886
bever209/Competitive-Programming
Cpp programs/Other_comps/CodeSprintLA_2021/C.cpp
#include <bits/stdc++.h> #define pb push_back #define f first #define s second using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); /*const int maxn = 85; ll C[maxn + 1][maxn + 1]; C[0][0] = 1; for (int n = 1; n <= maxn; ++n) { C[n][0] = C[...
ALGO
0.999664
3.993966
adc90da1-2cc9-4066-9948-4c911c11f410
akashghadge/competitive-programming
Company Test/Deloitte S Kakade/B.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n; vector<int> arr(n, 0); for (int i = 0; i < n; i++) cin >> arr[i]; cin >> k; sort(arr.begin(), arr.begin() + k); for (auto val : arr) cout << val << " "; cout << endl; }
ALGO
0.999967
3.166745
88cb9979-7a20-4a2b-9cf0-d0ffabbd0806
stone725/AOJ-SourceCode
Volume 00/0038.cpp
#include <bits/stdc++.h> using namespace std; #define FOR(i, s, n) for(int i = s; i < (int)n; i++) #define per(i, n) for(int i = n; i >= 0; i--) #define ROF(i, s, n) for(int i = s; i >= (int)n; i--) #define FORIT(i, A) for (auto i : A) #define PRINT(x) cout << (x) << "\n" #define ALL(a) (a).begin(),(a).end() #define RA...
ALGO
0.999571
4.333343
883a3b92-474a-44f1-a60d-8d0be0982374
dhuamanilu/programacion
ABC357/B.cpp
//? #pragma GCC optimize ("Ofast") //? #pragma GCC target ("avx,avx2") //! #pragma GCC optimize ("trapv") //#undef _GLIBCXX_DEBUG //? for Stress Testing #include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "../debugICPC.h" #define chk(...) if (!(__VA_ARGS__)) cerr << "\033[41m" << "Line(" << __LINE__ << ...
ALGO
0.999953
5.824807
dcd0f13d-d181-49eb-becc-8c4022e93857
ChickTheNugget/Algorithms
BfsMaze.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define INF 1e9 #define MOD 1e9 + 7 #define MAXN 1000 vector<pair<char, pair<int,int>>> directions{{'U', {1, 0}}, {'D', {-1, 0}}, {'R', {0, 1}}, {'L', {0, -1}}}; char adj[MAXN][MAXN]; bool vis[MAXN][MAXN]; int n, m; void bfs(i...
ALGO
0.99997
5.31661
df5167ba-1e14-4d65-96af-e21ed34361eb
gitchaofang/leetcode
998.cpp
class Solution { public: void dfs(TreeNode* root, std::string& res,std::string str){ str.insert(str.begin(),'a' + root -> val); if(!root -> left && !root -> right){ if(res == "") res = str; else if(res > str) res = str; } if(root -> left ) dfs(root -> left,res...
ALGO
0.999977
6.368853
1688bac2-56b3-48f8-b95b-068bf360fb66
sourabhraha/Placement_Prep
118-pascals-triangle/118-pascals-triangle.cpp
class Solution { public: vector<vector<int>> generate(int numRows) { vector<vector<int>>ans; ans.push_back({1}); if(numRows == 1) return ans; vector<int>prev(2); prev[0] = 1; prev[1] = 1; ans.push_back(prev); for(int...
ALGO
0.999988
5.647055