uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
719a4ee4-82ed-46a0-8237-56963fa052e2
KsRn177/Leetcode
392. Is Subsequence.cpp
class Solution { public: bool isSubsequence(string s, string t) { int i = 0, j = 0; while ( i < s.size() && j < t.size()) { if ( s[i] == t[j]) { i++; j++; } else { j++; ...
ALGO
0.999811
6.200431
b9062439-4ce9-46db-8353-3cc14a772b98
dagzn/Algoritmia
UVa/PrimeFactorial.cpp
#include <iostream> #include <vector> #include <cmath> using namespace std; // Criba de Eratostenes de 1 a n. vector<int> Criba(int n) { int raiz = sqrt(n); vector<int> criba(n + 1); for (int i = 4; i <= n; i += 2) criba[i] = 2; for (int i = 3; i <= raiz; i += 2) if (!criba[i]) for (int j = i * i; j <= n; j...
ALGO
0.999801
3.628263
052997bf-bbab-4f68-a3a9-d6a5fb787e05
sinian666/codes_102_3
cpp_副本26/chapter_stack_and_queue/array_queue.cpp
/** * File: array_queue.cpp * Created Time: 2022-11-25 * Author: Krahets (<EMAIL>) */ #include "../utils/common.hpp" /* 基于环形数组实现的队列 */ class ArrayQueue { private: int *nums; // 用于存储队列元素的数组 int front; // 队首指针,指向队首元素 int queSize; // 队列长度 int queCapacity; // 队列容量 public: Arra...
ALGO
0.994765
5.57649
f64e716f-6f31-41ec-b564-ce2d8241e1fa
alexandraback/datacollection
solutions_5765824346324992_0/C++/cchao/bB.cpp
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; typedef long long ll; typedef complex<double> cd; #define rep(i, n) for(int i = 0; i < n; ++i) #define repe(i, a, b) for(int i = a; i <= b; ++i) #define ri(a) scanf("%d", &a) #define rd(a) scanf("%lf", &a) #define rs(a) scanf("%s", s) #define r...
ALGO
0.999894
3.034741
d90171d3-36a6-4553-a141-32733f97e20c
Lauu029/EDA
EJercicios satanicos/EDA-master/Cuatrimestre 1/Recursion/03.cpp
#include <iostream> #include <string> struct sol { unsigned int numero; int pot; sol() { numero = 0; pot = 1; } sol(const unsigned int &num, const int &p){ numero = num; pot = p; } }; sol invertir(const unsigned int &n) { if (n <= 9) { sol numInvertido(n, 1); return numInvertido; } sol numInvertido ...
ALGO
0.999397
5.603465
892d97df-be0c-453a-a79b-ee3dbbdcb654
H-Shen/MyCodeCollection
Leetcode/1530/1530.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999953
5.846292
515cd721-12ef-47e5-8046-3e332003f63a
jinhc0822/Algorithm
ps/Greedy/Greedt_boj_10162microwave.cpp
#include <iostream> using namespace std; /*2021.12.13 쉬움. 근데 뭔가 그리디보다는 수학 구현에 더 가까운거 같은..*/ int T, ans[3]; const int button[3] = { 300, 60, 10 }; int main() { cin.tie(NULL); ios_base::sync_with_stdio(false); cin >> T; int idx = 0; while (true) { if (T < button[idx]) { if (idx == 2) break; idx++; }...
ALGO
0.998816
3.829814
37b43f84-b46a-453b-8e0b-1548f8a5a27c
XenonIQus/TelegramOS
Telegram/SourceFiles/core/core_cloud_password.cpp
#include "core/core_cloud_password.h" #include "base/openssl_help.h" #include "mtproto/mtproto_dh_utils.h" namespace Core { namespace { using namespace openssl; constexpr auto kAdditionalSalt = size_type(32); constexpr auto kSizeForHash = 256; bytes::vector NumBytesForHash(bytes::const_span number) { const auto f...
ALGO
0.985896
7.639434
925d6d30-4cec-4a0a-b339-304890971ac8
stevenprud11/PF2Projects-C-
Project4/src/Project4.cpp
#include <iostream> #include <sstream> #include "Stack.h" #include <vector> #include <string> using namespace std; int main() { Stack stack; string temp; vector<string> str (1000); cout << "Enter, in PostFix notation boolean value to find::" << endl; cout << "Separate parameters by a ',' and end statment with a ...
ALGO
0.999554
3.836674
352a7be3-04c9-48b1-806f-b89790e4f4b2
nehcoah/algorithm-template
codeforces/1875(div2)/d.cpp
#include "bits/stdc++.h" using namespace std; using ll = long long; void solve() { int n, m = 0; cin >> n; vector<int> a(n), f(n + 1, 1e9 + 1); for (int i = 0; i < n; i++) { int x; cin >> x; if (x < n) a[x]++; } while (m < n && a[m]) m++; f[m] = 0; for (int i = m; i >= ...
ALGO
0.999844
5.383721
88c29a78-f3af-431d-88c4-08bd2e9ec660
ishandutta2007/codeforces
mjhun/normal/305/C.cpp
#include <cstdio> #include <iostream> #include <map> using namespace std; map<int,short> p; int main(){ int n,a,m; scanf("%d",&n); while(n--){ scanf("%d",&a); if(p[a]){ p.erase(a); a++; while(p[a]){ p.erase(a); a++; } p[a]=1; } else p[a]=1; } m=p.rbegin()->first+1-p.size(); cout<...
ALGO
0.999774
3.286183
e6d8ff35-b0ef-41ac-bc02-ec1431165423
dilelu94/Laboratorio-de-Computaci-n-I
TP N°7 - Funciones y Punteros/C++/Ej04.cpp
/// Ejercicio: Ej04FuncionQueRecibaDosNumerosYRetorneElMayor /// Autor: Diego Leonel Luque /// Fecha: 27/05/2023 /// Comentario: #include <iostream> #include <cstdlib> using namespace std; float mayorDeDosNumeros(float numero1, float numero2); int main() { float numero1, numero2; cout << "Ingrese un numero: "; ...
ALGO
0.99881
4.685858
f62e0d9c-a90d-4b92-b14b-c3dfb1ce2803
geme9876/PracticeC14
PracticeCplusplus/소스2.cpp
///* // // // // Ʃ Ǵ ߰Ͽϴ. ׷ 캸 Ư ڹ ־ տ Ư Բ ڹ踦 Ǫ ִ ̰ ߰ߵǾϴ. // //ִ ڹ ĭ ũⰡ 1 x 1 N x N ũ 簢 ̰ Ư M x M ũ 簢 · Ǿ ֽϴ. // //ڹ迡 Ȩ Ŀ ְ Ȩ κ ֽϴ. ȸ ̵ ϸ κ ڹ Ȩ κп ° ä ڹ谡 Ǵ Դϴ. ڹ  κп ִ Ȩ ڹ踦 , ڹ κа ڹ Ȩ κ Ȯ ġؾ ϸ ڹ Ⱑ ȵ˴ϴ. ڹ Ȩ ä ִ ڹ踦 ֽϴ. // //踦 Ÿ 2 迭 key ڹ踦 Ÿ 2 迭 lock Ű ־ , ڹ踦 true,...
ALGO
0.99995
5.083253
38fa32e3-1713-4864-a595-c0da70459846
bytegrip/multiprecision
Lab/triple.cpp
#include <vector> #include <string> #include <algorithm> #include <iostream> #include "triple.h" #include "operations.h" using namespace std; bool negative = false; vector<int> integer; vector<int> floating; int decimal_pos = -1; void triple::input() { std::string line; std::getline(std::cin, line); bool...
ALGO
0.987007
3.968745
6d94a174-c444-4abd-9891-522ff9314b47
byungwook-min/Algorithm
BOJ/1948 - 임계경로.cpp
// // 1948 - 임계경로.cpp // cpp // // Created by 민병욱 on 2023/08/28. // #include <iostream> #include <vector> #include <queue> using namespace std; #define FASTIO ios::sync_with_stdio(0); cin.tie(0); const int MAX = 1e4 + 5; int n, m; int st, en; int ans, cnt; vector<pair<int, int>> adj[MAX]; vector<pair<int, int>> ...
ALGO
0.9997
4.563644
dcee88ab-3949-4b92-8dd4-3432dccca6e2
ehmprah/coregrounds
server/ThirdParty/boost/boost_1_67_0/libs/numeric/ublas/doc/samples/matrix_vector_range.cpp
#include <boost/numeric/ublas/matrix.hpp> #include <boost/numeric/ublas/matrix_proxy.hpp> #include <boost/numeric/ublas/io.hpp> int main () { using namespace boost::numeric::ublas; matrix<double> m (3, 3); for (unsigned i = 0; i < m.size1 (); ++ i) for (unsigned j = 0; j < m.size2 (); ++ j) ...
ALGO
0.972742
3.376192
886529f8-40c2-4be4-a015-defef5d60218
NathanWoo/cs130a_prog2
final version/prog2.cpp
#include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; int minKey(vector<int> &key, vector<bool> &mstSet, int V){ int min = INT_MAX, min_index; for (int v = 0; v < V; v++) if (mstSet[v] == false && key[v] < min) min = key[v], min_index = v; ...
ALGO
0.999795
4.695731
ce8f9673-e05b-4ccb-ab0f-063b252899d8
lamabander/EeVe
EeVe_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.998406
6.76775
a929deb6-b60b-41c4-bc8a-7b254abce4ae
BUGProtectionAssociation/blender-test
intern/quadriflow/quadriflow_capi.cpp
#include <unordered_map> #include "MEM_guardedalloc.h" #include "config.hpp" #include "field-math.hpp" #include "loader.hpp" #include "optimizer.hpp" #include "parametrizer.hpp" #include "quadriflow_capi.hpp" using namespace qflow; struct ObjVertex { uint32_t p = (uint32_t)-1; uint32_t n = (uint32_t)-1; uint3...
ALGO
0.949812
6.6282
1a55fb46-f8b3-4ca8-96b3-3f842b6ae2d6
randomfeelings/dsa_resources
Sorting_Algos/quicksort.cpp
/* C++ implementation of QuickSort */ #include <bits/stdc++.h> using namespace std; // A utility function to swap two elements void swap(int* a, int* b) { int t = *a; *a = *b; *b = t; } /* This function takes last element as pivot, places the pivot element at its correct position in sorted array, and places all sm...
ALGO
0.99999
6.162482
f86efda7-b290-41f7-8d06-568b7c09f156
chrisdias2311/DSA_competetive
Recursion/Tut41_Advanced_Recursion.cpp
#include<iostream> using namespace std; //Print all the permutatiosn of a string // void permutation(string s, string ans){ // if(s.length()==0){ // cout<<ans<<endl; // return; // } // for(int i=0; i<s.length(); i++){ // char ch = s[i]; // string ros = s.substr(0,i)+s.subs...
ALGO
0.999876
4.254196
c734516b-ca96-4b5a-87aa-0ea88cade00e
bqmnhat/CompetitiveProgramming
SUM_S/SUM_S.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; long long a[100001], n ,s[100001], k; void ReadData() { for (int i=1; i<=n; i++) { cin >> a[i]; } } void Solve() { for (int i=1; i<= n; i++) { s[i] = s[i-1] + a[i]; if (s[i] == k) { cout << 1 << " " << i;...
ALGO
0.999976
4.882819
a613155b-f957-4d85-9b6c-0d638c8cca3c
eTakazawa/procon-archive
atcoder.jp/abc092/arc093_a/Main.cpp
#include <bits/stdc++.h> using namespace std; int main(void) { int N; cin >> N; vector<int> A; A.push_back(0); for (int i = 0; i < N; i++) { int a; cin >> a; A.push_back(a); } A.push_back(0); long long orgdist = 0; for (int i = 1; i <= N + 1; i++) { orgdist += abs(A[i] - A[i-1]); }...
ALGO
0.999155
4.148037
fc5f869a-809f-44b8-9a1a-b6c1103f437c
kallinosis-dev/srcmodbase-source
public/disp_powerinfo.cpp
#include "disp_powerinfo.h" #include "disp_common.h" #include "commonmacros.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" // ------------------------------------------------------------------------ // // Internal classes. // ------------------------------------------------...
ALGO
0.928086
6.458357
53b58d02-12ba-45cb-b68d-7cbae4395e28
theGateway1/DSA
LeetCode/Linked List/Medium Rotate List.cpp
int findLen(ListNode* head){ int len = 0; while(head){ head = head->next; len++; } return len; } ListNode* rotateRight(ListNode* head, int k) { if(!head || !(head->next) || k==0){ return head; } int len = findLen(head); ...
ALGO
0.99995
4.974823
41979798-b0a2-40e7-892d-ad5e87d7a219
Shrey4125/CPP-Practicals
Practicals/Practical-7/Practical-7.2/Practical-7.2(2)/Practical-7.2(2).cpp
/*Question: A data analysis firm is developing a tool to process large text files and extract key statistics, such as the total number of characters, words, and lines. This tool is essential for tasks like document indexing, text summarization, and data validation. Given the varying sizes of input files, the system mus...
TOOL
0.909708
5.732857
70f20852-bf8d-4abd-8e61-d67fc272e366
fnuadnan/Rock-Paper-
rpscode.cpp
#include <iostream> #include <list> using namespace std; int player1(list<int> p2answers) { return 1; //insert player1 code } int player2(list<int> p1answers) { return 0; //insert player2 code } int playrps(list<int> p2answers, list<int> p1answers) //rock = 0 paper = 1 scissors = 2 { int p1answer = player1(p2answe...
ALGO
0.99302
3.936906
a1c7f072-2aac-4868-a34b-592be81cab32
arkerny/oicode
Archive2022/ACWing_101.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define il inline #define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); ll n,p,h,m; int a[10005]; bool flag[10005][10005]; int main() { cin>>n>>p>>h>>m; a[1]=h; for(int i=1;i<=m;i++) { ll l,r; cin>>l>>r; ...
ALGO
0.999805
3.065593
a1039206-acd9-4392-a478-48a236483384
RichardLiuda/Coding_Practice
C/Object-Oriented Programming/id108.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; typedef double db; class Date { private: int year, month, day; public: Date() { year = 0; month = 0; day = 0; }; Date(int y, int m, int d) { year = y; month = m; day = d; }...
ALGO
0.998059
4.501441
b0d7aa65-02f8-4e15-b4d3-9fe5edb4358b
hargunmujral/Competitive-Programming
delete-columns-to-make-sorted.cpp
class Solution { public: int minDeletionSize(vector<string> &strs) { int delcount = 0; for (int i = 0; i < strs[0].size(); i++) { for (int j = 0; j + 1 < strs.size(); j++) { if (strs[j + 1][i] < strs[j][i]) { del...
ALGO
0.999923
5.896633
c052a294-7ce7-4fe9-b218-8ec3fad349aa
Nissmoline/Newton-Polynomial-Interpolation
V_M_6.3_newt/V_M_6.3_newt.cpp
#include <iostream> #include <cmath> #include <vector> #include <algorithm> #include <iomanip> using namespace std; vector<vector<double>> diffTable(const vector<double>& x, const vector<double>& y) { int n = x.size(); vector<vector<double>> diff_table(n, vector<double>(n)); for (int i = 0; i < n; i++) ...
ALGO
0.998684
4.418658
25d6aeb5-685d-4ae8-b49d-a409677f4cbf
corkangel/helper
model.cpp
#include "model.h" #include <cassert> #include <numeric> #include <cmath> #include <random> // ---------------------------- layers ---------------------------- hhLayer::hhLayer(int numNeurons, int numInputs) { this->numNeurons = numNeurons; this->numInputs = numInputs; activationValue.resize(numNeurons,...
DATA
0.98951
6.076829
5b37c866-ec99-4bda-82e3-128af86f6348
jwelyl/ps
algorithm/ch07_binary_search/07_07.cpp
#include <iostream> #include <unordered_map> using namespace std; unordered_map<int, int> map; int N, M; int main(void) { int x; ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> N; for(int i = 0; i < N; i++) { cin >> x; map[x] = 1; } cin >> M; for(int i =...
ALGO
0.999988
4.281123
47fc8d8e-1770-4ee0-808c-f3d7089a4dae
PhuocVinhLee/LuanVan_CNTT
online_exam_system_backend/temp/ok7tyde.cpp
#include <stdio.h> int main() { int number1, number2, sum; printf("Enter two integers: "); scanf("%d %d", &number1, &number2); // calculate the sum sum = number1 + number2; printf("%d + %d = %d", number1, number2, sum); return 0; }
TOOL
0.969042
4.438632
279314b9-a5dd-4b99-9b47-c813b8190bcf
Codechef-SRM-NCR-Chapter/30-DaysOfCode-March-2021
answers/Fab-Gaurav/Day 11/Answer_1.cpp
#include <bits/stdc++.h> using namespace std; int main() { string str; cout<<"Enter the string : "; cin>>str; int s=0; for(int i=0; i<str.length(); i++){ for (int j=i+1; j<str.size(); j++){ if(str[i]==str[j]) s++; } } if(s%2==0) cout<<"YE...
ALGO
0.999943
3.870705
2763cc60-5c78-46f3-9b03-9fe4881b77bd
SenseLogic/MYST
BOOST/boost_1_76_0/libs/math/example/binomial_coinflip_example.cpp
// Simple example of computing probabilities and quantiles for // a Bernoulli random variable representing the flipping of a coin. // http://mathworld.wolfram.com/CoinTossing.html // http://en.wikipedia.org/wiki/Bernoulli_trial // Weisstein, Eric W. "Dice." From MathWorld--A Wolfram Web Resource. // http://mathworld.w...
ALGO
0.998606
7.092626
3d5cf636-88e8-4fa6-af31-ea00aef2e007
Riajain05/DSA-series
hashingTheory.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int arr[n]; for (int i = 0; i < n; i++) { cin >> arr[i]; } //precompute: int hash[13] = {0}; for (int i = 0; i < n; i++) { hash[arr[i]] += 1; } int q; cin >> q; while (q--) { ...
ALGO
0.999711
4.718964
4bfa9004-6daf-450f-a991-bc6e95afcdae
alexandraback/datacollection
solutions_5631989306621952_1/C++/Stilwell/A.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; int T,Case,n,i,j,k,l,r; char s[100005],ans[100005]; int main() { freopen("2.in","r",stdin); freopen("2.out","w",stdout); scanf("%d",&T); for(;T;--T) { scanf("%s",s+1);n=strlen(s+1); l=1;r=n; for(i=n;i>=1;i=k-1) { k=i; f...
ALGO
0.999977
3.607663
ac35f8ae-840a-4b92-9b0e-56fc0f304e41
tactop/AtCoder
ABC/abc088/d.cpp
#include <algorithm> #include <cmath> #include <iostream> #include <limits> #include <numeric> #include <queue> #include <string> #include <vector> #define rep(i, x, n) for(int i = x; i < n; i++) using namespace std; const long long INF = 1LL << 60; const int INTINF = 1 << 20; template <class T> inline bool chmin(T &a,...
ALGO
0.999918
4.337351
e9b6b123-5d10-4f18-937c-072ce3649639
tridhapuku/DSP_MLIR
libc/src/string/strspn.cpp
#include "src/string/strspn.h" #include "src/__support/CPP/bitset.h" #include "src/__support/common.h" #include <stddef.h> namespace LIBC_NAMESPACE { LLVM_LIBC_FUNCTION(size_t, strspn, (const char *src, const char *segment)) { const char *initial = src; cpp::bitset<256> bitset; for (; *segment; ++segment) ...
ALGO
0.944353
6.262744
74a97bc7-3ce3-4c2e-a076-f63931d0314b
woodart8/Learning-Algorithm-CPP
5430.cpp
#include <iostream> #include <string> #include <algorithm> #include <deque> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int T; cin >> T; while(T--) { string s; //명령어 int n; //숫자 개수 string t; // 배열 deque<int> dq; //배열에서 숫자만...
ALGO
0.999615
5.64346
416cab35-2ac3-4725-893b-bd4a742b7015
hoangkhoi2k4/C-PLUS-PLUS-PTIT
SapDatDaySo.cpp
#include <iostream> #include <set> using namespace std; typedef long long ll; int main() { int t; cin >> t; while(t--) { ll n; cin >> n; ll a[n]; set<ll> s; for(ll i = 0; i < n; i++) { ll e; cin >> e; s.insert(e); a[i] = i; } for(ll i = 0; i < n; i++) { //neu a[i] ko co trong s ...
ALGO
0.999909
3.85264
33be0c1f-8d20-4280-88f1-d11132da7fc0
kokohuhusave/Programmers_Coding_Test
프로그래머스/1/12915. 문자열 내 마음대로 정렬하기/문자열 내 마음대로 정렬하기.cpp
#include <algorithm> #include <string> #include <vector> using namespace std; int num; bool cmp(string a, string b) { if (a[num] == b[num]) { return a < b; } else { return a[num] < b[num]; } } vector<string> solution(vector<string> strings, int n) { num = n; sort(strings.begin...
ALGO
0.99986
5.601388
f1788f7c-2197-43b0-96fa-b883b4f36010
wangwei2009/EventDetector
eigen/bench/benchCholesky.cpp
// g++ -DNDEBUG -O3 -I.. benchLLT.cpp -o benchLLT && ./benchLLT // options: // -DBENCH_GSL -lgsl /usr/lib/libcblas.so.3 // -DEIGEN_DONT_VECTORIZE // -msse2 // -DREPEAT=100 // -DTRIES=10 // -DSCALAR=double #include <iostream> #include <Eigen/Core> #include <Eigen/Cholesky> #include <bench/BenchUtil.h> using na...
TEST
0.990622
5.938015
5a63b649-2530-4f56-b7f8-fb619d201bfb
Kaileshwaran13/CodeChef
1600 - 1800 difficulty rating/Chef and Segment Game.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { double x; long long k; cin >> x >> k; long long c = 1; while (k > c) { k -= c; c *= 2; } cout << setprecision(10) << fixed; ...
ALGO
0.998616
3.905769
979e16d0-4451-4287-b308-9ae2f266ddb1
saumyasrivastava08/Important_Coding_Problems
Contest/Codeforces/Virtual_Contest/A. Building Permutation.cpp
#define ll long long #include<bits/stdc++.h> using namespace std; int main() { ll n; cin>>n; vector<int>v(n); for(ll i=0;i<n;i++) cin>>v[i]; sort(v.begin(),v.end()); ll k = 1,j=0; for(ll i=0;i<n;i++) { j = j+ abs(v[i]-i-1); } cout<<j<<endl; }
ALGO
0.999904
3.949329
ed6301b9-4aa6-424b-8145-778d6cc1a99e
IvyLeePopo/SiChuan
基础框架/CommonFrame2.0/TWSDNetPay/MD5.cpp
#include "MD5.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #define GET_UINT32(n,b,i) \ { \ (n) = (uint32) ((uint8 *) b)[(i)] \ | (((uint32...
ALGO
0.885636
5.22535
b8157b2d-e64b-4f31-8752-fb8000362941
Didi-Firdaus/KOMPGRAF4709
HW6-9/UAS komgraf/garis/bresenham.cpp
#include <gl/glut.h> #include <stdio.h> int x1, ystart, x2, y2; void myInit() { glClear(GL_COLOR_BUFFER_BIT); glClearColor(0.0, 0.0, 0.0, 1.0); glMatrixMode(GL_PROJECTION); gluOrtho2D(0, 500, 0, 500); } void draw_pixel(int x, int y) { glBegin(GL_POINTS); glVertex2i(x, y); glEnd(); } void draw_line(int x1, in...
ALGO
0.98241
4.305097
3c078dce-226f-4347-b799-70ad59a12360
pranavsindura/CompetitiveProgramming
codeforces/contest/1452/c.cpp
#include <bits/stdc++.h> #define ll long long int #define ld long double #define pi pair<int,int> #define all(x) x.begin(), x.end() #define allr(x) x.rbegin(), x.rend() #define sz(x) ((int)x.size()) #define ln(x) ((int)x.length()) #define mp make_pair #define pb push_back...
ALGO
0.997507
4.108932
24b16fac-4276-45ad-94cc-d46790860ba9
himanshuagarwal184/Leetcode75
394-decode-string/decode-string.cpp
class Solution { public: string decodeString(string s) { string ans=""; stack<char> stk; for(int i=0;i<s.length();i++) { if(s[i]==']') { while(stk.size()>0 && stk.top()!='[') { ans=stk.top()+ans; ...
ALGO
0.99982
6.071413
eb5b6d2a-95b7-423a-b692-e5e86f7ce3f4
davidemmanuellopez/tsppdl-unicen
src/multirelocate.cpp
#include <heuristics.h> #include <tree.h> #include <igraph.h> #include <iostream> #include "list" #include "queue" #include "multioperation.h" void saveState(Tree* t, int n, MultiState &s) { s.nodo = n; s.lbrother = t->getAnt(n); s.rbrother = t->getSig(n); s.lchildren = t->getFChildren(n); s.rchil...
ALGO
0.999626
3.516867
d8df1ceb-01df-49fb-9b41-ea84ecd78246
nakatamaho/mplapack
mplapack/test/lin/common/Cqrt11.cpp
#include <mpblas.h> #include <mplapack.h> #include <fem.hpp> // Fortran EMulation library of fable module using namespace fem::major_types; using fem::common; #include <mplapack_matgen.h> #include <mplapack_lin.h> REAL Cqrt11(INTEGER const m, INTEGER const k, COMPLEX *a, INTEGER const lda, COMPLEX *tau, COMPLEX *wor...
ALGO
0.998133
3.973332
bd558ae0-9b93-41a1-ba49-636bcd070f19
kocanory/baekjoon
gold 4/1563.cpp
#include <iostream> using namespace std; int n, mod = 1000000; int dp[2][3][1001]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n; dp[0][0][1] = dp[0][1][1] = dp[1][0][1] = 1; for(int i = 2;i <= n;i++){ dp[0][0][i] = (dp[0][0][i - 1] +...
ALGO
0.999922
4.538791
2999e268-3769-4aea-ba1f-bc3d3ab14b22
Ishwarendra/CompetitiveProgramming
CodeForces/GNU C++20 (64)/960E_Alternating Tree/960_E.cpp
#include "bits/stdc++.h" #ifdef LOCAL #include "F:\CPP\Debug\debug.h" #else #define print(...) 1; #endif using i64 = long long; template<class T> T power(T a, i64 b) { T res = 1; for (; b; b /= 2, a *= a) { if (b % 2) res *= a; } return res; } template <typename T> T inve...
ALGO
0.999725
4.072147
fdbf1626-c526-479b-9515-43269e7858f1
MichaelMarchiano/R4.0-Engine
thirdparty/icu4c/common/ucharstrieiterator.cpp
#include "unicode/utypes.h" #include "unicode/ucharstrie.h" #include "unicode/unistr.h" #include "uvectr32.h" U_NAMESPACE_BEGIN UCharsTrie::Iterator::Iterator(ConstChar16Ptr trieUChars, int32_t maxStringLength, UErrorCode &errorCode) : uchars_(trieUChars), pos_(uchars_...
ALGO
0.917726
7.70004
0d2db3d9-b898-4f42-ab03-75f1866cf6a3
mquang279/DSA
15. Number Theory/sothuannghich.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; bool isPalindrome(int n){ int original = n, reversed = 0; while (n != 0){ reversed = reversed * 10 + (n % 10); n /= 10; } return reversed == original; } bool has3PrimeFactor(int n){ int cnt = 0; for (int i = ...
ALGO
0.999872
4.652863
7dd1c781-696b-4cb1-9d59-98a9dafcc114
Ahnaf-41M/Codeforces_AtCoder
codeforces/1476/B.cpp
#include "bits/stdc++.h" #define ff first #define ss second #define MX 100005 #define pb push_back #define int long long #define PII pair<int,int> #define all(v) v.begin(),v.end() using namespace std; void Solve(int tc) { int n, k, cur = 0, ans...
ALGO
0.999292
4.375303
971b570f-108f-4591-b814-d9462f46def8
pflyly/eden-mirror
src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_fused_multiply_add.cpp
#include "shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h" namespace Shader::Maxwell { namespace { void HFMA2(TranslatorVisitor& v, u64 insn, Merge merge, Swizzle swizzle_a, bool neg_b, bool neg_c, Swizzle swizzle_b, Swizzle swizzle_c, const IR::U32& src_b, const IR::U32& src_...
TOOL
0.977298
7.211156
af5593fb-0866-4fd2-be5f-12884fb7a765
Vaishnavikumbhar/cpp
class work c++/reverse.cpp
// write the cpp program to implement kth minimum and maximum element from unsorted array #include <iostream.h> using namespace std; int main() { int num,i,a[100]; cout<<"enter the elements"; cin>>num; for(i=0;i<num;i++) { cin>>a[i]; } return 0; }
ALGO
0.999618
3.629283
96cb27e4-9a8f-44b1-8f5e-d9f701996cd9
alexandraback/datacollection
solutions_2463486_0/C++/Kompu/fai.cpp
#include <cstdio> #include <iostream> #include <algorithm> #include <string> #include <vector> using namespace std; typedef vector<int> VI; typedef vector<VI> VVI; typedef pair<int, int> PI; typedef long long LL; #define FOR(x, b, e) for(int x = b; x <= (e); ++x) #define FORD(x, b, e) for(int x = b; x >= (e); --x) #def...
ALGO
0.9997
3.968814
1db24f1d-2094-4813-9ecc-c0040b7ae0bf
tanishksarathe/Patterns_in_C-
PATTERNS/Pattern21.cpp
#include<iostream> using namespace std; /* **** *** ** * */ int main (){ int n; cin>>n; int row = 1; while(row<=n){ int j=1; while(j<=n-row+1){ cout<<"*"; j++; } row++; cout<<endl; } }
ALGO
0.999985
3.970778
92224aaf-72c0-4ae3-879e-8e36e8b473d1
UCR-UAS-2020/UCR_UAS_routeCreation_2020
marshManeuvers.cpp
#include <iostream> #include <string> #include <vector> #include <list> #include <stack> #include "prototypes.h" using namespace std; void masterRouteMaker(){ string trash; string fileName; vector<obstacle> obstacles; list<point> points; list<waypoint> waypoints; stack<point> stackOfPoints; cou...
TOOL
0.852387
4.353148
deea9ba0-54ed-4869-8c73-ffca5e51cdc7
AndreiSantos07/DSA-CPE010-CPE21S4
Exercises - Tasks/Exercise-5 - Progress.cpp
#include <iostream> #include <queue> using namespace std; void display(queue<string>pl) { while(true) { if (pl.size() == 3) cout << "The Queue is Full" << endl; cout << pl.front() << endl; pl.pop(); pl.pop(); } } int main() { queue<string>pl; cout << "P...
ALGO
0.94358
4.440584
cc07194b-787b-40ee-9d40-2c0a219548eb
alifalhasan/CP-code-vault
Codeforces/Codeforces Round/Codeforces Round 775 (Div. 2/E - Tyler and Strings/148625386.cpp
#pragma GCC optimize("Ofast") #include<bits/stdc++.h> #include<ext/pb_ds/tree_policy.hpp> #include<ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; #define ll long long template<typename temp>using ordered_set = tree<temp, null_type, less<temp>, rb_tree_tag,tree_order_statistics_node_upda...
ALGO
0.99999
4.706408
e07a5433-4501-42f0-bf76-51035634049a
People2002/fractal_flutter_test
fractal_flutter_test/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.998368
6.76073
0737035b-af47-4f9f-8af9-2bd61974d9bf
9967han/PS-Algorithm
BaekJoon/1005.cpp
#include<stdio.h> #include<algorithm> #include<queue> using namespace std; void initConn(); void input(); void find(); void ClearQueue(queue<int> &someQueue); int T, N, K, W; int D[1001], cnt[1001], ans[1001]; int conn[1001][1001]; queue<int> q; int main(){ input(); } void input(){ scanf("%d", &T); for(int i=1; i<=...
ALGO
0.999972
3.573714
9ac3f6e8-e5c8-4246-b128-936beb8e1db8
siddharthgusain/CODING_PRACTICE
Recursion_and_backtracking/5.Factorial.cpp
#include <iostream> int factorial(int num) { if (num == 1) return 1; if (num == 2) return 2; int partial_fac = factorial(num - 1); return num * partial_fac; } int main() { int num; std::cin >> num; std::cout << factorial(num); return 0; }
ALGO
0.999516
5.623347
9a086887-11ca-49d7-91e8-c0d332aece82
HP3-16/When-i-used-do-cpp
Recursion/merge-sort-rec.cpp
#include<bits/stdc++.h> #include<iostream> using namespace std; // 3 step - divide - sort - merge void merge(int *arr, int s, int e){ // 3 pointers, i,j,k and then compare the smaller element between // the elements present at i and j and push them to the merged_arr accordingly and increment the pointers ...
ALGO
0.999995
4.264967
530ee147-17f8-4fca-928b-a379e025e481
Krishna01kp/LeetCodeProblems
847-shortest-path-visiting-all-nodes/847-shortest-path-visiting-all-nodes.cpp
class Solution { public: #define pii pair<int,int> int shortestPathLength(vector<vector<int>>& graph) { int n = graph.size(); int full_mask = ( 1 << (n) )-1; queue<pii> bfs; unordered_set<string> masks; for(int i=0; i< n; i++){ bfs.push({i, 1 <<i}); ...
ALGO
0.999753
5.25622
d570cd2e-8bb7-4708-b5a1-6723a4752881
AnamayNarkar/Leetcode
100.Same_Tree.cpp
#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), left(nullptr), right(nullptr) {} TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right...
ALGO
0.999967
6.458752
4e407e20-fa2e-4a73-b180-497197d66b6f
AFKunc/sportradar
src/scoreboard.cpp
#include <algorithm> #include <iostream> #include <optional> #include <ranges> #include <string> #include <utility> #include <vector> #include <include/scoreboard.hpp> using namespace sbd; uint64_t detail::Match::total_score() const { return home_score + away_score; } bool detail::Match::operator<(const Match& o...
TOOL
0.850556
7.161487
37cf0482-90f3-4f17-981a-33e9bf9ca385
paolo-torres/interview-prep
leetcode/bloomberg/all/remove_duplicates_from_sorted_array.cpp
/* Given int array, remove duplicates, return size Ex. nums = [1,1,2] -> 2, [1,2,_] 2 pointers, iterate i only if non-equal Time: O(n) Space: O(1) */ class Solution { public: int removeDuplicates(vector<int>& nums) { int i = 0; int j = 1; while (j < nums.size()) { ...
ALGO
0.999868
6.699126
cd53628d-690e-4fdf-ab8d-be12f7f8a4ac
sarvex/leetcode-solidity
solution/2500-2599/2555.Maximize Win From Two Segments/Solution.cpp
class Solution { public: int maximizeWin(vector<int>& prizePositions, int k) { int n = prizePositions.size(); vector<int> f(n + 1); int ans = 0; for (int i = 1; i <= n; ++i) { int x = prizePositions[i - 1]; int j = lower_bound(prizePositions.begin(), prizePosi...
ALGO
0.999968
5.405985
7bc9b537-c73b-4121-9b5b-d0384fc0be3b
motoq/eom
src/parse_sinex_stations.cpp
#include <eom_parse.h> #include <algorithm> #include <cmath> #include <deque> #include <fstream> #include <memory> #include <sstream> #include <string> #include <stdexcept> #include <unordered_map> #include <Eigen/Dense> #include <utl_const.h> #include <phy_const.h> #include <cal_greg_date.h> #include <cal_julian_da...
TOOL
0.913897
6.873173
265a3490-ef14-4323-b7ef-bae5f2f7ec3b
Ahnaf-41M/Codeforces_AtCoder
codeforces/1676/A.cpp
#include "bits/stdc++.h" #define ff first #define ss second #define MX 100005 #define pb push_back #define int long long #define PII pair<int,int> #define endl "\n" #define all(v) v.begin(),v.end() #define rep(i,a,b) for(int i = a; i <= ...
ALGO
0.999139
4.13236
e69b6c53-251a-49c6-bb39-e4132919e643
Renan2010/minetest-mirror
src/util/auth.cpp
#include <algorithm> #include <string> #include "auth.h" #include "base64.h" #include "sha1.h" #include "srp.h" #include "util/string.h" #include "debug.h" // Get an sha-1 hash of the player's name combined with // the password entered. That's what the server uses as // their password. (Exception : if the password fie...
TOOL
0.902811
6.034641
cce06fe8-17c0-493f-9d11-5cd3b268b91f
allanjoseph01/100-days-of-code
Regular Bracket Sequence.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int t; cin >> t; for(int _=0;_<t;_++){ string str; cin >> str; if(str.size()%2==0 && str[0]!=')' && str[str.size()-1]!='('){ cout << "YES" << endl; } else{ cout << "NO" << endl; } } }
ALGO
0.998871
3.993779
8f19534c-12bf-45ed-a36c-9c256e934eb2
Minnalkgo/just-upload-something-
Merging_Overlapping_Intervals.cpp
#include <iostream> #include <vector> #include <stack> #include <algorithm> using namespace std; // Data structure to represent an interval struct Interval { int begin, end; bool operator<(Interval const &i) { return (begin < i.begin); } }; // Function to merge overlapping intervals void merge...
ALGO
0.999807
5.820759
1941398e-91d4-4146-8e10-d0fc8611ac37
aadilshabier/algorith-design-manual
3-28.cpp
#include <bits/stdc++.h> using namespace std; /* Solution using multiple arrays */ template <typename T> class PartialSumA { public: PartialSumA(const vector<T>& v) : m_size(v.size()) { cout << "Initializing data structure:\n"; for (size_t step = v.size(); step > 0; step /= 2) { vector<T> v_step; for (au...
ALGO
0.99989
5.995256
f6c81fe4-fce6-4372-9a6e-97a5cdea8fe4
hjiang13/LLMs-in-IR
POJ-104/104/1447.cpp
#include <iostream> using namespace std; int k; void tree(int m, int n) { if (m == n) k = m; // ?? else if (m > n) tree(m / 2, n); else if (m < n) tree(m, n / 2); // ?? } int main() { int x, y; cin >> x >> y; tree(x , y); cout << k; return 0; }
ALGO
0.999923
3.251179
2273c48e-4bfe-4aac-b0e2-5ce9dcb01177
Yotta2/CTCI_my_solution
chapter_5/5.3/sol0.cpp
#include <iostream> #include <string> #include <cstring> #include <fstream> #include <set> #include <stack> #include <vector> #include <list> #include <cstdlib> #include <climits> #include <algorithm> using namespace std; int nextSmallest(int num) { if (num == INT_MAX) //if num is INT_MAX return itself re...
ALGO
0.999619
3.676911
c8a44ec1-fba0-459e-bdbc-f82a3b6d00f1
winprn/sorting-analysis
include/SortStrategy.cpp
#include "SortStrategy.h" SortStrategy::SortStrategy() { m_array = nullptr; m_count_comparison = m_size = 0; } SortStrategy::SortStrategy(int* a, int size) { m_size = size; m_array = new int[m_size]; for (int i = 0; i < m_size; i++) m_array[i] = a[i]; } int* SortStrategy::getArray() const { return m_...
ALGO
0.980507
5.098199
95925f66-616e-4cee-86f7-a75821c69a64
ishandutta2007/codeforces
enem/normal/1257/C.cpp
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define M1 1000000007 #define M2 998244353 #define ll long long #define pll pair<ll,ll> #define REP(i,a,b) for(ll i=a;i<b;i++) #define REPI(i,a,b) for(ll i=b-1;i>=a;i--...
ALGO
0.999649
4.472982
2382cf58-403d-4cf8-9eec-d800abe84b43
ohz10/wield
wield/src/NumberOfThreads.cpp
#include <wield/schedulers/utils/NumberOfThreads.hpp> #include <algorithm> #include <thread> namespace wield { namespace schedulers { namespace utils { std::size_t numberOfThreads(const std::size_t numberOfStages) { std::size_t numCores = std::max<std::size_t>(1, std::thread::hardware_concurrency());...
TOOL
0.914342
6.207338
e963febb-4728-45f0-bc68-8caf334de42f
shishir2305/CoderArmySheetSolutions
04_Linked_List/171.cpp
// nth node from end of linked list // algorithm -> count nodes of the linked list and then traverse till you reach // count-nth node, if the count is less than n then simply return -1 // t.c -> O(n) // s.c -> O(1) #include <bits/stdc++.h> using namespace std; int getNthFromLast(Node *head, int n) { Node *curr = h...
ALGO
0.999938
5.181262
e396d8d3-ff28-44ef-ac77-23a9c4735e40
ashrafulhoda789/Basic-Data-Structure
Linked_List/reverse_doubly_linked_list.cpp
#include<bits/stdc++.h> using namespace std; class Node { public: int val; Node* prev; Node* next; Node(int val){ this->val = val; this->prev = NULL; this->next = NULL; } }; void insert_at_tail(Node* &head,Node* &tail,int val){ Node* newNode = new Node(val); i...
ALGO
0.999807
4.613631
9bc70c3e-fd35-4643-9ca9-5b0f3888d366
SynergicRobotics/CollabNav
collabnav_gmapping/gmapping_export/scanmatcher/eig3.cpp
/* Eigen decomposition code for symmetric 3x3 matrices, copied from the public domain Java Matrix library JAMA. */ #include <math.h> #ifndef MAX #define MAX(a, b) ((a)>(b)?(a):(b)) #endif #define n 3 static double hypot2(double x, double y) { return sqrt(x*x+y*y); } // Symmetric Householder reduction to trid...
ALGO
0.999998
4.89095
3859f598-a433-4512-85de-921153e82ed8
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_valid_112_10.cpp
#include <bits/stdc++.h> using namespace std; void solve() { long long a, b, c, m; cin >> a >> b >> c >> m; if (m > a + b + c - 3) { cout << "NO" << endl; return; } vector<long long> v; v.push_back(a); v.push_back(b); v.push_back(c); sort(v.begin(), v.end()); if (m + 1 >= v[2]) { cout <<...
ALGO
0.999953
4.563463
e17bade7-e9c9-4b45-b59a-1c7ba1a9c094
Kawser-nerd/CLCDSA
Source Codes/AtCoder/arc002/A/4178532.cpp
#include<algorithm> #include<iostream> #include<functional> #include<cmath> using namespace std; int main(){ int n,a=0,b=0,c=0; cin>>n; if(n%4==0){ a=1; } if(n%100==0){ b=1; } if(n%400==0){ c=1; } if(c==1){ cout<<"YES"<<endl; } if(b==1 and c==0){ cout<<"NO"<<endl; } if(a==1...
ALGO
0.999953
3.964116
f444b89b-3a87-488a-8a8a-c4ccecf66af8
roberteg16/Quark
llvm/lib/Transforms/Utils/RelLookupTableConverter.cpp
#include "llvm/Transforms/Utils/RelLookupTableConverter.h" #include "llvm/Analysis/ConstantFolding.h" #include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/Module.h" #include "llvm/InitializePasses.h" #include "l...
TOOL
0.861403
7.847823
9e072e2a-2c6e-4511-bd61-2889c976cb7d
dbrisaro/algo1
labos_algo1/labo02/ejercicio_04.cpp
/****************************************************************************** Ejercicio 04 Labo 02 AED1 Dani Risaro *******************************************************************************/ #include <iostream> #include <cmath> using namespace std; int esBinario (int n) { int divi = 0; while (n != 0) ...
ALGO
0.998292
4.273039
7b8e2dde-6718-4e15-b506-5b32006d5b4d
Shruti12130/Leetcode-Problems
0106-construct-binary-tree-from-inorder-and-postorder-traversal/0106-construct-binary-tree-from-inorder-and-postorder-traversal.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999985
6.173472
11e2cbe9-0374-48be-9538-f8e6c941566d
pyrovski/Large-Scale-Forward-Regression-using-a-partitioned-linear-model
transpose.cpp
#include <iostream> #include <fstream> #include <fcntl.h> #include <errno.h> #include <unistd.h> #include <stdlib.h> #include <stdint.h> #include <assert.h> #include <sys/mman.h> #include <sys/stat.h> #include <sys/types.h> #include <string.h> #include <algorithm> using namespace std; const char usage1[] = "usage: ", ...
ALGO
0.976444
4.369932
94f86be4-b8ba-4cff-88ec-680ff2686365
richelbilderbeek/familie_poen
main_solver.cpp
#include "game.h" #include "ai.h" #include "solver.h" #include <cassert> #include <iostream> #include <iterator> #include <stdexcept> std::vector<ai_strategy> parse_strategies(const std::string& s) { std::vector<ai_strategy> v; for (const char c: s) { v.push_back(to_strategy(c)); } return v; } std::ve...
ALGO
0.997811
5.481558
ad436d13-838e-463e-990c-277f329c94b2
raincross7/code-similarity
codes/train_code/problem307/problem307_45.cpp
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7 , N = 1e5 + 5; int memo[N][2]; string s; int add(int a , int b) { a += b; while (a >= MOD) a -= MOD; return a; } int mul(int a , int b) { return a * 1ll * b % MOD; } int solve (int i , bool l) { if (i == s.size()) ret...
ALGO
0.999972
4.745042
7326321f-5119-4c0a-be1d-050dab92e3e4
ishandutta2007/codeforces
dmitrygrigorev/normal/1404/A.cpp
#include <bits/stdc++.h> #define ll long long #define db long double #define x first #define y second #define mp make_pair #define pb push_back #define all(a) a.begin(), a.end() using namespace std; void solve() { int n, k; cin >> n >> k; string s; cin >> s; for (int i = k; i < s.size(); ++i) { if (s[i] == '...
ALGO
0.999992
3.536624
2ca674cf-fa01-414d-bef0-34d43fcef023
PabloMessina/Competitive-Programming-Material
Solved problems/UVA/558_Wormholes.cpp
// tags: graphs, shortest path, bellman ford #pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; // defines #define rep(i,a,b) for(int i = a; i < b; ++i) #define invrep(i,b,a) for(int i = b; i >= a; --i) #define umap unordered_map #define uset unordered_set #define ff first #define ss second // ...
ALGO
0.999934
4.75828
49acc47a-fb7f-4a6c-a2b9-c0fc4af0c3ee
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_11320_9.cpp
#include <bits/stdc++.h> using namespace std; int n, m, k; const int mid = 20001; vector<int> inf1, inf2; int dat1[mid * 2 + 50]; int dat2[mid * 2 + 50]; int mx; set<int> irr; vector<int> ir; bitset<60> dt1[3605]; bitset<60> dt2[3605], tt, ttt; int dt11[3605], dt22[3605]; int main() { int n, m, i, j, l, k, a, b, c, d...
ALGO
0.999769
3.423946
338d86c9-8e2a-425a-bba3-9cb66956e69c
purnamrita/LC
0368-largest-divisible-subset/0368-largest-divisible-subset.cpp
class Solution { public: vector<int> largestDivisibleSubset(vector<int>& nums) { sort(nums.begin(), nums.end()); int n = nums.size(); vector<int> dp(n, 1); vector<int> hash(n); for(int i = 0; i < n; i++){ hash[i] = i; } int maxIdx = 0; int ...
ALGO
0.999996
5.589568
c0e4caf9-9dbd-44c9-b60a-c14b86830d81
StarN2uk/Algorithm-theory-2
Algorithm theory PR3_3/모든 순열.cpp
#include<iostream> #include<algorithm> #include<vector> using namespace std; int cnt, n; bool check[8] = {false, }; vector<int> v[8]; void dfs(int x) { if(cnt == n) printf("%d", n); check[x] = true; for(int i = 0; i < v[x].size(); i++) { v[i].push_back(i); if(check[v[x][i]] = false) { dfs(v[x][i]); ...
ALGO
0.999819
4.140953