uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
065e637c-677f-4f38-bc1b-e9a1b3b0c021
Vinceyou1/USACO
Silver/January2023/FindAndReplace/FindAndReplace.cpp
#include <bits/stdc++.h> using namespace std; int findKeystrokes(int input[52], array<vector<int>, 52> output){ int total = 0; for(int i = 0; i < 52; i++){ auto vect = output.at(i); if(vect.size() > 0){ for(int c = vect.size()-1; c > -1; c--){ int in = vect.at(c); ...
ALGO
0.999805
3.808227
94a919d1-c20d-4b7d-bf01-33410d9d3f19
AshrafulHaqueToni/Lightoj-solution
lightoj 1328.cpp
// Created by ash_98 #include<bits/stdc++.h> using namespace std; #define mx 100005 #define ll long long #define mod 1000007 ll ar[mx]; char ch[mx]; ll n,m,k,ii; void solve() { ll add; scanf("%lld%lld%lld%lld",&k,&add,&n,&ar[1]); for(int i=2;i<=n;i++)ar[i]=(k*ar[i-1]+add)%mod; sort(ar+1,ar+1+n);...
ALGO
0.999522
3.380414
6b3ceba9-c6da-4713-9d06-ad91f2253d41
whym1here/College-DSA-Assignment
11_Heap_Hash_Table_Dijkastra/A.cpp
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "algo/debug.h" #else #define dbgv(...) #define dbg(...) #define dbgr(...) #define dbgm(...) #endif // Max Heap class Heap { public: int size; vector<int> tree; Heap(int n){ size = 0; tree.assign(n, 0LL); } void ...
ALGO
0.997593
4.019969
46b46490-c9ea-4f1f-aba6-87a5205620e8
ilovethedogs/solved
book0/ch11-greedy/ch11-q3.cpp
#include <iostream> #include <string> int main() { auto str {std::string {}}; std::getline(std::cin, str); int result[2] {0, 0}; auto cur {str[0]}; for (auto it {std::begin(str) + 1}; it != std::end(str); ++it) { if (cur != *it) { ++result[cur - '0']; cur = *it; ...
ALGO
0.999253
5.009868
3136b2d0-0f3c-470e-904b-3be1ad34ab22
parish09/Code-Library
96A.cpp
#include <iostream> #include <string> #include <sstream> #include <vector> #include <bits/stdc++.h> #include <algorithm> #include <math.h> #include <stdio.h> using namespace std; int main(){ string s;cin>>s; int x=0; for(int i=0;i<s.length();i++){ x=0; int y=s[i]; for(int j=0...
ALGO
0.999894
3.870802
b4029bfe-564e-4c37-8662-9168d18b7af6
bavish007/ACE
DSA/palindrome_BruteForce.cpp
#include <iostream> #include <string> #include <algorithm> using namespace std; // Brute Force Approach bool isPalindromeBruteForce(int x) { if (x < 0) return false; // -ve numbers are not palindromes // Convert the number to a string string original = to_string(x); // Create a reversed copy of the o...
ALGO
0.999899
5.652448
3b523ec1-9917-4877-a2ac-ef5d066c4249
huyenching/abc
CTDL/Tim_Kiem_Tuan_tu.cpp
#include<iostream> using namespace std; int timkiem(int a[], int k, int n) { for(int i=0;i<n;i++) { if(a[i]==k) return i; } return -1; } int main() { int a[100]; int n; float k; cout<<"Nhap n:"; cin>>n; for(int i=0;i<n;i++){ cout<<"a["<<i<<"]="; cin>>a[i]; } cout<<"Nhap k:"; cin>>k; co...
ALGO
0.99899
4.331842
d0601413-6b8f-4af1-9008-b65cb57ec2d6
Arup-Sarkar-24/Practice_Cpp
code_07.cpp
#include<iostream> using namespace std; int main (){ int a,b,c,max1,max2; cout<<"Enter the value of first number = "; cin>>a; cout<<"Enter the value of second number = "; cin>>b; cout<<"Enter the value of third number = "; cin>>c; max1=(a>b)? a:b;//ternary operator max2=(max1>c)? max1:c; cout<<"The greatest number is ...
ALGO
0.99989
3.606774
80e6aa5a-610c-45d4-b0f1-2722a9601a37
PaukIsUha/optimizing_formating_code
predictions/submissions-aizu-gpt4/Codenet/p02315/484633776/response_5.cpp
#include <vector> #include <iostream> #include <algorithm> int main() { int N, W; std::cin >> N >> W; std::vector<int> value(N), weight(N); for (int i = 0; i < N; i++) std::cin >> value[i] >> weight[i]; std::vector<std::vector<int>> dp(N+1, std::vector<int>(W+1, 0)); for (int i = 0; i ...
ALGO
0.999987
4.910277
18294213-4e7d-49ff-8287-47711b7a12b1
RuiqiW/geometry-processing-monte-carlo
libigl/include/igl/orientable_patches.cpp
template <typename DerivedF, typename DerivedC, typename AScalar> IGL_INLINE void igl::orientable_patches( const Eigen::MatrixBase<DerivedF> & F, Eigen::PlainObjectBase<DerivedC> & C, Eigen::SparseMatrix<AScalar> & A) { using namespace Eigen; using namespace std; // simplex size assert(F.cols() == 3); ...
ALGO
0.997318
4.041961
73582ff7-09bd-4b4c-98d2-e8b07858e6a4
nojhan/paradiseo
problems/DTLZ/application/DTLZ_NSGAII.cpp
// moeo general include #include <iostream> #include <fstream> #include <moeo> #include <es/eoRealInitBounded.h> // how to initialize the population #include <do/make_pop.h> // the stopping criterion #include <do/make_continue_moeo.h> // outputs (stats, population dumps, ...) #include <do/make_checkpoint_moeo.h> // ev...
ALGO
0.99584
5.999686
5cc82705-e9cc-4b2e-8882-962c0a00100c
joaovicmendes/aed2-trabalho
Trabalho 1/main.cpp
/* Universidade Federal de São Carlos – UFSCar Departamento de Computação 1001490 - Algoritmos e Estruturas de Dados 2 – Trabalho 1 Prof. Dr. Diego Furtado Silva Aluno: João Victor Mendes Freire RA: 758943 */ #include <iostream> #include <string> #include <unordered_map> int main() { // ...
TOOL
0.858231
4.713921
bc0e78cc-91b6-4841-ba17-3facfdcb7d9f
cici30725/Leetcode-Solutions
0080-remove-duplicates-from-sorted-array-ii/0080-remove-duplicates-from-sorted-array-ii.cpp
class Solution { public: int removeDuplicates(vector<int>& nums) { int n = nums.size(); int l = 1, r = n; int cnt = 1; while(l<r){ if(nums[l]==nums[l-1]){ cnt++; } else{ cnt = 1; } ...
ALGO
0.999858
6.191276
ed9ffb4b-e067-4d57-8d88-a208f84f26bb
ranjodhsingh1729/CSES-Solutions
Dynamic Programming/Counting Numbers.cpp
#include <bits/stdc++.h> #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b)) #define mod(a, b) ((long long) ((a) - (b)*floor((long double) (a)/(b)))) using namespace std; typedef long long ll; typedef array<int, 3> triple; const ll MOD = 1e9+7; const int MAXN = 1e6+1; const ll INF = 0x...
ALGO
0.999876
5.26347
9d962dda-16c7-473a-8179-39e708670fc1
DepinSundaram/DSA
1.BinaryTree/8.FindTypes/RootToNodePath.cpp
#include <iostream> #include <vector> #include <queue> #include <stack> #include <map> #include <set> using namespace std; struct node { int data; node* left; node* right; node(int val) : data(val) { left = right = NULL; } }; /* The path is 1 2 5 7 Time Complexity: O(N) Reason: We are d...
ALGO
0.999991
4.917928
0c054c8b-d6dd-4cde-bbd9-b352683c1db8
eliteProgrammer-1/LeetCode
minimumCostToCutAStick.cpp
class Solution { public: int help(int s, int e, vector<int>& cuts, vector<vector<int>> &dp) { if(dp[s][e] != -1) return dp[s][e]; int tempAns = INT16_MAX; for(int i = 0; i < cuts.size(); i++) { if(cuts[i] > s and cuts[i] < e) { ...
ALGO
0.999922
5.721098
3347808a-1465-4e92-b272-7068a68f1d85
mdkhyruzzaman/Phitron
2.XPSC/Contests/Codechef/Codechef-20-11-24/Moneymaking.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int x, y; cin >> x >> y; cout << x * 5000 + y * 9800; return 0; }
ALGO
0.999615
3.66942
98b095f0-b3a1-4e09-81a6-e9f8a1692a70
shanto173/DynamicPrograming
24_Shortest_Common_SuperSequence.cpp
#include<bits/stdc++.h> using namespace std; int shortestCommonSuperSequence(string a,string b,int m,int n){ int t[m+1][n+1]; for (int i = 0; i < m+1; ++i) { for (int j = 0; j < n+1; ++j) { if(i == 0 || j == 0){ t[i][j] = 0; } } } for...
ALGO
0.999945
4.994655
50267d6f-5242-465c-b419-9b9d03ec2124
MrBns/phitron-cpp-for-dsa
02.5-practices-day/M_Capital_or_Small_or_Digit.cpp
#include <bits/stdc++.h> using namespace std; int main() { char input; cin >> input; if (input >= 'a' && input <= 'z') { cout << "ALPHA" << endl; cout << "IS SMALL" << endl; } else if (input >= 'A' && input <= 'Z') { cout << "ALPHA" << endl; cout << "IS C...
ALGO
0.997396
3.979504
cdc8a1d8-841a-4c22-8a02-36f49476fe55
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_3795_4.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, i, j, a, b; cin >> n; a = n / 2, b = n / 2; for (i = 0; i <= n / 2; i++) { for (j = 0; j < n; j++) { if (j >= a && j <= b) cout << "D"; else cout << "*"; } a--; b++; cout << endl; } a += 2; b ...
ALGO
0.999949
3.642004
20b69684-a3ba-4e69-94ef-fc040920b9b9
deepaksingh26/data-structure-and-algorithms
15-3sum/15-3sum.cpp
class Solution { public: vector<vector<int>> threeSum(vector<int>& nums) { vector<vector<int>>ans; sort(nums.begin(),nums.end()); int target=0; for(int i=0;i<nums.size();i++) { target=-nums[i]; int left=i+1; int high=nums.size()-1; ...
ALGO
0.99993
5.689675
be040329-fc7f-41e5-97e8-1156a9dc5070
zunglee/code-and-create-bug
exe/7th sem lab/sms lab 1.cpp
#include <vector> #include <cstring> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <sstream> #include <iostream.h> #include <cstdio> #include <cmath> #include <cstdlib> #include <c...
ALGO
0.998979
3.244377
4a754bbe-9615-4d01-b632-f0e0fbf91dc3
Yacent/data_structure
Queue/main.cpp
#include "Queue.h" using namespace std; int main() { Queue qu; if (!qu.empty()) { cout << "FUCK YOU, there is no element" << endl; } for (int i = 0; i < 10; i++) { int test; cin >> test; qu.append(test); } int j; qu.retrieve(j); cout << j << endl; for...
ALGO
0.988248
3.467231
6da1fcf9-9f93-4632-9bb8-1f492d8de2c6
omnibor/llvm-omnibor
llvm-project/clang-tools-extra/clangd/IncludeCleaner.cpp
#include "IncludeCleaner.h" #include "Config.h" #include "Headers.h" #include "ParsedAST.h" #include "Protocol.h" #include "SourceCode.h" #include "support/Logger.h" #include "support/Trace.h" #include "clang/AST/ExprCXX.h" #include "clang/AST/RecursiveASTVisitor.h" #include "clang/Basic/SourceLocation.h" #include "cla...
TOOL
0.982163
4.195516
85fc3e22-1180-4873-ab61-dccd169061e6
Xe0n0/LeetCode
Valid Parentheses.cpp
class Solution { private: bool isMatch(char a, char b) { return b == ')' && a == '(' or b == '}' && a == '{' or b == ']' && a == '['; } public: bool isValid(string s) { // Start typing your C/C++ solution below // DO NOT write int main() function stack...
ALGO
0.99991
6.56322
c54aef3a-fcd4-4f31-b8eb-d4a86951a01d
dolmatovDan/competitive-coding-library
Binary/generator.cpp
#include <bits/stdc++.h> using namespace std; void gen(int length, int base, vector<int> &digits) { if (digits.size() == length) { for (auto x : digits) { cout << x; } cout << endl; } else { for (int k = 0; k < base; k++) { digits.push_back(k); gen(length, base, digits); dig...
ALGO
0.99958
4.31365
869c2c87-a4ae-4908-a4e6-c755286f4d2c
stevenbai0724/DMOJ-Solutions
DMOPC/dmopc16c1p3.cpp
//https://dmoj.ca/problem/dmopc16c1p3// #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define int long long #define string std::string const int mod = 1e9 + 7; signed main(){ cin.tie(nullptr)->sync_with_stdio(false); int n; cin>>n; ve...
ALGO
0.999973
4.477297
91b2a2e3-d88f-4aed-8401-07e67b4fdb40
SabiAmeno/NumericComputation
NC/NC.cpp
// NC.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <iostream> #include "nc_binary_interpolation.h" int main() { NC::PolyCOEFs coefs; coefs.push_back(NC::PolyCoef{ 1, 3 }); coefs.push_back(NC::PolyCoef{ 4, 2 }); coefs.push_back(NC::PolyCoef{ -10, 0 }); NC::BinInterp bip(coefs, 1, 2); doubl...
ALGO
0.989726
5.140368
d7c04d74-15f6-4bd6-88c1-02d8466fe11d
matt-rymar/competitive-programming
solutions/Codeforces/Contests/Div2Edu101/B.cpp
#include <algorithm> #include <array> #include <chrono> #include <cmath> #include <cstdio> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <memory> #include <numeric> #include <optional> #include <queue> #include <random> #include <set> #include ...
ALGO
0.999988
5.014036
84cc964b-1449-4fc3-81ce-934792f5fe8a
rathi710/DSA
1855-maximum-distance-between-a-pair-of-values/1855-maximum-distance-between-a-pair-of-values.cpp
class Solution { public: //2-pointer approach int maxDistance(vector<int>& nums1, vector<int>& nums2) { int n1 = nums1.size(); int n2 = nums2.size(); int maxi=0; int i=0,j=0; while(i < n1 && j < n2){ if(nums1[i] <= nums2[j]){ maxi = ma...
ALGO
0.999983
5.934647
f2e28b66-2dc3-47e0-88d5-a7ba601e0134
k8440009/Algorithm
BOJ/12865_2.cpp
// 평범한 배낭 // https://www.acmicpc.net/problem/12865 #include <iostream> #include <vector> using namespace std; int N, K; vector <pair<int,int> > backPack; int cache[101][100000 + 1]; int answer; int main() { cin >> N >> K; backPack.resize(N + 1); for (int i = 1; i <= N; i++) { int a,b; cin >> a >> b; backPac...
ALGO
0.999986
4.497574
4b09294e-5060-4e2e-aabb-ad3b17bf4678
Jorzuiz/EDA-21-22
DEFINITIVAS/803EleccionesEXAMEN/803EleccionesEXAMEN.cpp
// VJ70 // Jorge Zurdo Izquierdo #include <iostream> #include <fstream> #include <algorithm> #include <string> #include <vector> #include <map> #include <unordered_map> #include <exception> #include <stdexcept> using Estado = std::string; using Partido = std::string; class ConteoVotos { private: using Partid...
ALGO
0.999556
5.20737
8c435d69-3fee-4ad0-8fa1-7964a3f5ea97
hoanghiep1945/DSA
Graph++/DSA10017.cpp
#include <bits/stdc++.h> using namespace std; // thuật toán Bellman-Ford struct edge{ int x,y,w; }; int INF=1e9; int n,m; vector<edge> E; int d[1005]; void nhap(){ cin>>n>>m; for(int i=0 ; i<m ; i++){ int x,y,w; cin>>x>>y>>w; E.push_back({x,y,w}); } } bool check(int s){ d[s] = 0; for(int i = 1; i <= ...
ALGO
0.999943
5.268939
8a3c943a-8e67-4be1-8555-7464379dec64
thebesttv/00.ACM
03.CodeForces/665_2/b.cpp
// Tag: 贪心 #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<climits> #include<cmath> #include<ctime> #include<vector> #include<queue> #include<stack> #include<list> #include<set> #include<map> #include<utility> #include<algorithm> using namespace std; #define FOR(i,a,b) for(int i=(a);i<...
ALGO
0.999867
3.635115
e38ff98f-d1ef-40d6-be64-f0a6f5dcbe1c
nikhilgupta30/My-Spoj-Solutions
Milesandkilometers.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll fib[81]; fib[0] = 0; fib[1] = 1; for(ll i=2;i<=80;i++){ fib[i] = fib[i-1]+fib[i-2]; } ll t; cin>>t; while(t--){ ll n; cin>>n; ll ans=0; for(ll i=79;i>0;i--){ if(n >= fib[i]){ ans += fib[i+1]; n -= fi...
ALGO
0.999971
4.139126
90b0193b-5724-4535-b604-323e03f30914
otaviobenedeti/Lista-de-exercicios-LOP
Exercicio dia 05 de maio/Exercicio 7 dia 5 de maio.cpp
//bliblioteca #include <stdio.h> // int main() { int numero, i, tabuada; // Frase de apresentação printf ("----TABUADA---- \n"); printf ("Digite o numero que vc quer ver a tabuada: \n"); scanf ("%d", &numero); // para nao precisar colocar numero um por um for(int i = 0; i <= 10; i++) { ...
TOOL
0.915446
3.36874
c5e45d85-9e5b-4d23-9db0-7e178f9536d1
AnkitMalvi1/40-Days-Of-Code
2. C++ with DSA/D028/6. Introduction to Linked List/2.cpp
#include <iostream> using namespace std; class node { public: int data; node *next; node(int val) { data = val; next = NULL; } }; void insertAtHead(node *&head, int val) { node *n = new node(val); n->next = head; head = n; } void insertAtTail(node *&head, int val) { ...
ALGO
0.999846
4.832367
735536eb-62f9-4042-ac7c-c1b086cca11c
anuj308/dsac-
c++/unit 4/q13.cpp
// Single File Programming Question // Problem Statement // Rahul is tasked with creating a program that manages geometric shapes, specifically circles and squares. The program uses three classes: Shape, Circle, and Square. Shape serves as a base class for all shapes, while Circle and Square inherit from it. Each clas...
TOOL
0.978884
5.828528
198b1860-ec91-4e0c-a82f-155cf60e6a52
Crpdim/Code
172.阶乘后的零.cpp
/** * @file 172.阶乘后的零.cpp * @author Crpdim (<EMAIL>) * @brief https://leetcode-cn.com/problems/factorial-trailing-zeroes/ * @version 0.1 * @date 2022-03-25 * * @copyright Copyright (c) 2022 * */ class Solution { public: int trailingZeroes(int n) { int res = 0; long divisor = 5; w...
ALGO
0.999975
6.428626
130884d9-2017-4608-af3f-39810191696e
Phatjhhoq8/learn
selectionSort.cpp
#include<bits/stdc++.h> using namespace std; void selectionSort(int a[],int n) { for(int i = 0; i < n-1;i++) { int i_min=i; for(int j = i;j<n;j++) { if(a[j] < a[i_min]) { i_min=j; } } int temp = a[i_min]; a[i_min]=a[i]; a[i]=te...
ALGO
0.999989
4.430647
6fe867f9-9788-41cb-aaa7-903fdb06ed28
Kushala01/DSA
Heap/getMaxProfit.cpp
#include <bits/stdc++.h> using namespace std; typedef long long int ll; ll getMaxProfit(vector<ll>& elems, ll n, ll k) { vector<ll> pSum(n + 1, 0); for (ll i = 1; i <= n; ++i) { pSum[i] = pSum[i - 1] + elems[i]; } priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>> minHea...
ALGO
0.999904
4.401656
25749669-67e6-4416-8692-7dd96a417984
Raghav1209/Leetcode_practice_questions
535-encode-and-decode-tinyurl/535-encode-and-decode-tinyurl.cpp
class Solution { public: map<string,string> mp; const int MAX = 62; // Encodes a URL to a shortened URL. string encode(string longUrl) { string str = "http://tinyurl.com/"; vector<string>alphabet{ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m","n", ...
ALGO
0.998238
5.923782
c972ec59-60e9-43e3-a4af-2445fa8c3a6b
cdegree/ACM
日常/9-13/G.cpp
/* HDU 4273 Rescue һά͹ĵ̾ ģ⣺ά͹++ */ #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <cctype> #include <vector> #include <stack> #include <queue> #include <map> #include <algorithm> #include <iostream> #include <string> #include <set> #define X first #define Y second #define sqr(x) (x)*...
ALGO
0.998686
4.200618
89c6f97e-8872-44bc-8a6a-60755f3a807f
bulbulmaheshwari17/ecommerce_bul
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.998733
6.76775
7285ce5c-dcdf-4817-84e9-454e00914f11
DhruvSharma845/codeforces
cpp/way_too_long_words_71_A.cpp
#include <iostream> int main() { auto T{0}; std::cin>>T; for (size_t i = 0; i < T; i++) { std::string st; std::cin>>st; if(st.size() > 10) { std::cout << st.at(0) << st.size() - 2 << st.at(st.size() - 1) << std::endl; } else { std::cout ...
ALGO
0.999122
5.457599
4788b4eb-b043-48da-b91c-fca302a5be55
Kanadae/codetree-TILs
240228/정수 복사/copy-integer.cpp
#include <iostream> using namespace std; int main() { int a = 3, b = 4; b = a; cout << a << " " << b << "\n" << a*b ; return 0; }
ALGO
0.993204
3.226229
181aa325-5170-4ef4-b713-df08d6f118b2
diogoftm/CA_E_DES
cpp/test.cpp
#include "EDES.h" #include <iostream> #include <cstdint> #include <cmath> uint8_t key[32] = {0x2b, 0x8f, 0x1b, 0x4c, 0x71, 0x51, 0xa3, 0x9d, 0x88, 0xf2, 0x7b, 0x5a, 0x16, 0xc5, 0xe9, 0x3d, 0x01, 0x51, 0x93, 0x6f, 0x33, 0xda, 0x77, 0xb5, 0x68, 0x11, 0xf7, 0xa8, 0xd6, 0x45, 0x22, 0x04}; double getNum...
ALGO
0.99882
4.394456
f3d1092b-6e79-4fc1-8ee2-ba3314903911
alexandraback/datacollection
solutions_5686275109552128_1/C++/ivailok1/B.cpp
#include <iostream> #include <stdio.h> using namespace std; /** TASK: Problem B. Infinite House of Pancakes EVENT: Qualification Round 2015 COMPETITION: Google Code Jam **/ const int MAXD = 1000; const int MAXP = 1000; int T, D; int P[MAXD]; int main() { //freopen("B-large.in", "r", stdin); //f...
ALGO
0.999715
3.75375
db43b4ee-0bba-4a2d-96db-234d32d19036
OpenCAXPlus/OpenCAXPlus
OpenDigitalTwin-main/tools/cgal/examples/Classification/example_classification.cpp
#if defined (_MSC_VER) && !defined (_WIN64) #pragma warning(disable:4244) // boost::number_distance::distance() // converts 64 to 32 bits integers #endif #include <cstdlib> #include <fstream> #include <iostream> #include <string> #include <CGAL/Simple_cartesian.h> #include <CGAL/Classifi...
DATA
0.987489
6.791536
e06b647d-5ffb-4231-b5b4-5f71f75cfa47
iamusamaB/Laby
grid_view and Tab bar/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.998779
6.785645
088ffd9a-0469-443e-848c-493524f94f82
puba5/Algorithm_Study
sungunjo/Old/16236.cpp
#include <iostream> #include <utility> #include <queue> #include <cstring> using namespace std; #define INF 888888888 int N; int map[25][25]; int main() { pair<int, int> shark; pair<int, int> d[4]; int shark_size = 2; int ate_number = 0; d[0] = make_pair(-1, 0); d[1] = make_pair(0, -1); d[2] = make_pair(0, 1...
ALGO
0.999865
3.53591
8124eeda-d514-45df-a8f4-efb4df806a2b
elzoghpy/Bmi
bmi/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.998357
6.785645
ebfc6613-03ce-47e3-95dc-020a37e5dadf
NopasitJ/C
Projectweek12/Source.cpp
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <set> #include <string> #include <vector> using std::map; using std::set; using std::string; using std::vector; using namespace std; static bool isPalindome(long long n); int main() { long long upper_limit = 10000...
ALGO
0.999682
4.978262
aa2f6954-f1bb-469d-8e9b-a5d8f9fb15fe
Swastik-Dubey/DSA_solve
DSA_solve/Math/4_Trailing Zeros in Factorial.cpp
#include <iostream> #include <limits.h> using namespace std; int countTrailingZeros(int n) { int res = 0; for(int i=5; i<=n; i=i*5) { res = res + (n / i); } return res; } int main() { int number = 251; cout<<countTrailingZeros(number); return 0; }
ALGO
0.999772
4.809422
f8555955-044e-44aa-bdee-0c0483899450
slitvinov/lammps-swimmer
src/GPU/pair_coul_cut_gpu.cpp
/* ---------------------------------------------------------------------- Contributing author: Trung Dac Nguyen ------------------------------------------------------------------------- */ #include "math.h" #include "stdio.h" #include "stdlib.h" #include "pair_coul_cut_gpu.h" #include "atom.h" #include "atom_vec.h"...
ALGO
0.995547
6.496565
68d0f9cb-8bb8-489c-ab8f-75b888a39004
Ahmed-Amamou/CP
Codeforces/Practice/A_Turtle_Puzzle_Rearrange_and_Negate.cpp
/* ▄▀▀▄ ▄▄ ▄▀▀█▄ ▄▀▀▄ ▄▀▄ ▄▀▀▀▀▄ ▄▀▀▀▀▄ ▄▀▀█▄▄ █ █ ▄▀ ▐ ▄▀ ▀▄ █ █ ▀ █ █ █ █ █ █ ▄▀ █ ▐ █▄▄▄█ █▄▄▄█ ▐ █ █ █ █ █ █ ▐ █ █ █ █ ▄▀ █ █ █ ▀▄ ▄▀ ▀▄ ▄▀ █ █ ▄▀ ▄▀ █ ▄▀ ▄▀ ▄▀ ▀▀▀▀ ▀▀▀▀ ▄▀▄▄▄▄▀ █ █ ▐ ▐ █ █ ...
ALGO
0.99984
5.068044
76cfb379-db14-4229-a773-58d5580f4bf2
awadhiya33/data_structure_algorithm_practice
lab_assign/combination.cpp
/*2) Write a program that, for all positive integers i, j, k and l from 1 through 100, finds and prints all combinations of i, j, k and l such that i + j + k = l and i < j < k < l.*/ #include<iostream> using namespace std; int main(){ for(int i=0;i<100;i++){ for(int j=i+1;j<100;j++){ for(int k=...
ALGO
0.999657
3.431582
2a45e1a1-1c55-455e-a253-3919df7b846c
oneapi-src/Velocity-Bench
easywave/CUDA/src/EasyWave.cpp
#define HEADER "easyWave ver.2013-04-11" #include "Utilities.h" #include "FileHandler.h" #define CPP_MODULE "MAIN" #include "Logging.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <cassert> #include "utilits.h" #include "easywave.h" //#ifdef __CUDACC__ #include "ewGpuNode.c...
ALGO
0.906356
4.8781
4d2555f9-26aa-4873-8a00-3249457cf023
prayag29-sahu/OOP-S
OOPs/oops lab/2.cpp
/**Write a program to find the area of circle, rectangle and triangle using function overloading**/ #include <iostream> #define PI 3.1416 using namespace std; float area(float radius) { float area = PI * radius * radius; return area; } // overloaded function 1 float area(int length, int breadth) { return l...
ALGO
0.999369
5.154592
a075c3c2-4519-4bef-92d3-48c767bcd293
viet-tech/mercuriuscoin
src/kernel.cpp
#include <boost/assign/list_of.hpp> #include "kernel.h" #include "txdb.h" using namespace std; typedef std::map<int, unsigned int> MapModifierCheckpoints; // Hard checkpoints of stake modifiers to ensure they are deterministic static std::map<int, unsigned int> mapStakeModifierCheckpoints = boost::assign::map_l...
ALGO
0.982165
6.541565
0add5168-2a83-49f4-88c1-4b5cd17fcb84
YichenZhou113/CS225-Data-Structure
lab_gdb2/gdb-examples/recurse.cpp
#include <iostream> #include <cstdlib> /* * This function should print a right triangle of stars * */ void recurse(int index, int length) { // if(index == 0) return; for(int q=1; q<index; q++) std::cout<<'*'; std::cout<<std::endl; recurse(index+1, length); } int main (int argc, char * argv[]) { //...
ALGO
0.993591
4.664701
ef7fb8da-f1d3-4c03-8300-ec5e7a9b5799
ifilot/hfhsl
exercises/05_h2_molecule/src/gamma.cpp
/* * Incomplete Gamma Function * * Used in the evaluation of the two-electron integrals. * */ /* * The functions below were extracted from: * * Numerical Recipes * William H. Press, Saul A. Teukolsky, William T., * Vetterling and Brian P. Flannery * 3rd edition page 261 * ISBN-13: 978-0521880688 */ #inc...
ALGO
0.999721
6.482946
04797eea-acff-44c8-b62f-55453a43d1ef
FeiZhan/Algo-Collection
answers/lintcode/Binary Search.cpp
//@level Easy //@type Binary Search Array //@result Accepted Total Runtime: 158 ms 100% test cases passed. class Solution { public: /** * @param nums: The integer array. * @param target: Target number to find. * @return: The first position of target. Position starts from 0. */ int binarySe...
ALGO
0.999994
6.433886
7d7f6dd3-8a98-46e6-b88c-abd44bc74072
TengFeiyang01/Algorithm
ACODE/cf/cf_883/a.cpp
#include <bits/stdc++.h> const int inf = 0x3f3f3f3f; using i64 = long long; using PII = std::pair<int, int>; const int N = 1e5 + 13; void solve() { int n; std::cin >> n; std::vector<int> a(n), b(n); for (int i = 0; i < n; ++i) { std::cin >> a[i] >> b[i]; } int ans = 0; for (int i = 0;...
ALGO
0.999954
4.37673
48e6c1a4-21d2-4aa0-b068-62b6dc80b2ab
shahabe9558/dsaNotes
11-TREE/BINARYTREE/4-minMax.cpp
#include<iostream> using namespace std; class Node{ public : int data; Node* left; Node* right; Node(int d) { this->data = d; this->left = NULL; this->right = NULL; } }; Node* buildTree(Node* root, int data) { // base case if(root == NULL) { root...
ALGO
0.999974
3.914178
9dba9a80-1a6b-4362-821d-f2750087a05d
Elegalaxy/Leetcode-Record
solutions/226. Invert Binary Tree.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.999975
6.538879
551ad07b-74b5-4340-86a7-efa4a10d93f1
QinlinChen/oj-templates
动态规划/poj 1276 Cash Machine.cpp
//poj1276 Cash Machine //Ҫ //ԶرĶŻתΪ01 //01ŻģΪ //for i=1..N // for v=V..0 // f[v]=max{f[v],f[v-c[i]]+w[i]}; //ȫŻģΪ //for i=1..N // for v=0..V // f[v]=max{f[v],f[v-c[i]]+w[i]} #include <iostream> #include <cstdio> #define MAX(x, y) ((x)>(y)?(x):(y)) using namespace std; int cash, N; int biop[1000]; //Ż int mai...
ALGO
0.999916
3.616851
4a30f7c2-f77d-41a7-b693-4aa9343c69ad
ryo97321/cpp-workspace
atcoder/abc154/d.cpp
#include <bits/stdc++.h> using namespace std; double calc_mean(vector<int> &p_vec, int j) { int numerator = 0; // 分子 if (p_vec[j] == 1) { numerator = 1; } else { if (p_vec[j] % 2 == 0) { for(int i=1; i<=(p_vec[j]/2); i++) { numerator += (i + (p_vec[j]-i+1));...
ALGO
0.999874
4.352698
bb8e237f-99f1-4112-8d02-466f42f0725e
kunyavskiy/competitive-programming-archive
codeforces.com/round/125/A.cpp
#include <iostream> #include <fstream> #include <vector> #include <set> #include <map> #include <string> #include <cmath> #include <cassert> #include <ctime> #include <algorithm> #include <queue> #include <memory.h> #include <stack> #define mp make_pair #define pb push_back #define setval(a,v) mems...
ALGO
0.999683
3.304438
09c5ff91-0cee-4f38-826c-d97b882d3ecc
pengcuo/ACL
src/runtime/CL/functions/CLHarrisCorners.cpp
#include "arm_compute/runtime/CL/functions/CLHarrisCorners.h" #include "arm_compute/core/CL/OpenCL.h" #include "arm_compute/core/CL/kernels/CLFillBorderKernel.h" #include "arm_compute/core/CL/kernels/CLHarrisCornersKernel.h" #include "arm_compute/core/Error.h" #include "arm_compute/core/TensorInfo.h" #include "arm_com...
ALGO
0.980123
6.917791
5f2f520f-044a-4bd7-b995-e283621d57e8
FuckMrs0Z/proxine-auth
lib/FormAuth1/crypto/esign.cpp
// esign.cpp - originally written and placed in the public domain by Wei Dai #include "pch.h" #include "config.h" // TODO: fix the C4589 warnings #if CRYPTOPP_MSC_VERSION # pragma warning(disable: 4589) #endif #include "esign.h" #include "modarith.h" #include "integer.h" #include "nbtheory.h" #include "algparam.h" #...
TOOL
0.960369
7.577659
fd6c4fc6-6c12-467b-8d74-4fa03ee53704
alexandraback/datacollection
solutions_2458486_0/C++/venco5/D-small.cpp
#include <string> #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <bitset> #include <cmath> #include <numeric> #include <complex> #include <algorithm> #include <functional> #include <cctype> #include <cstring> #include <sstream> #include <iostream> #include <iomanip> #ifdef HOM...
ALGO
0.999931
4.2425
4706f494-06ec-4cbd-8619-fe76ee891109
yeohj0710/old-solutions
20000s/20499.cpp
#include <cstdio> using namespace std; int main() { int K, D, A; scanf("%d/%d/%d", &K, &D, &A); if(K+A<D || !D) printf("hasu"); else printf("gosu"); }
ALGO
0.985709
3.420018
06834a24-0d02-483f-a7a0-7a2cb7ff3304
suryanshurao/LeetcodeWeek1
SingleNumber.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: int singleNumber(vector<int>& nums) { int sum=0; for(int i = 0;i<nums.size();i++) sum^=nums[i]; return sum; } }; int main() { Solution obj; vector<int> vec = {4,1,2,1,2}; cout<...
ALGO
0.999844
5.389346
e8935dd6-0c79-4db9-a545-9f72e6bc168d
avery-stephens/GAT350
ThirdParty/glm/test/gtx/gtx_fast_trigonometry.cpp
#include <glm/ext/scalar_ulp.hpp> #define GLM_ENABLE_EXPERIMENTAL #include <glm/gtc/type_precision.hpp> #include <glm/gtx/fast_trigonometry.hpp> #include <glm/gtx/integer.hpp> #include <glm/gtx/common.hpp> #include <glm/gtc/constants.hpp> #include <glm/gtc/vec1.hpp> #include <glm/trigonometric.hpp> #include <cmath> #i...
TEST
0.974703
6.277224
8bd5b2e5-0346-4884-ac96-2af32da29be1
avin/coding-algo-cheatsheets-cpp
recursion.cpp
#include <stack> // --------------------------------------------------- // 📌 Рекурсия с базовым случаем // --------------------------------------------------- void recur(int n) { if (n == 0) return; recur(n - 1); } // --------------------------------------------------- // 📌 Итерация через стек (DFS) для бин...
ALGO
0.999926
4.698691
4eaeac3d-900c-4b62-9870-ab2c1cb4c374
debasishsahoo/DSA_ARYA_C_P_P
STACK/Using Structure/Stack_Using_Cpp_Structure.cpp
// C++ Program for Implementation of stack (array) using structure #include <limits.h> #include<bits/stdc++.h> using namespace std; // A structure to represent a stack struct Stack { int top; int maxSize; int* array; }; struct Stack* create(int max) { struct Stack* stack = (struct Stack*)malloc(sizeof...
ALGO
0.992332
5.32084
f64d93c3-d11f-4773-ae85-5aa1f63780a8
Havoc/mangos-boost
dep/g3dlite/ConvexPolyhedron.cpp
/** @file ConvexPolyhedron.cpp @author Morgan McGuire, http://graphics.cs.williams.edu @created 2001-11-11 @edited 2009-08-10 Copyright 2000-2009, Morgan McGuire. All rights reserved. */ #include "G3D/platform.h" #include "G3D/ConvexPolyhedron.h" #include "G3D/debug.h" namespace G3D { ConvexPolyg...
ALGO
0.985967
7.668023
0b9f7b49-2c44-46ee-9c7f-c7fad9a70aa9
aditi2205/Algo-
codingblocks/Algo_17_Summer_Dwarka-master/Algo_17_Summer_Dwarka-master/13-Jun-02/replacePi.cpp
#include <iostream> using namespace std; void shift2(char arr[], int be){ int j = be; while(arr[j] != '\0') ++j; while(j >= be){ arr[j + 2] = arr[j]; --j; } } void replacepi(char arr[], int be){ if (arr[be] == '\0'){ // I am at the end of the string return; } if (arr[be] == 'p' && arr[be + 1] == 'i...
ALGO
0.999922
3.586123
3b888bc6-96a2-4a72-9670-4e5aa72df848
AkhileshKumar10/TCS_NQT_PRACTICE
STRINGS_PRACTICE/remove_space_from_string.cpp
#include<iostream> #include<string> using namespace std; string remove_space(string s){ //string new; string new_s=""; for(int i =0; i <s.size(); i++){ if(s[i]!=' '){ new_s+=s[i]; //count++; } } // s[count]='\0'; return new_s; } int main(){ string s; ...
ALGO
0.996216
3.765615
37d16747-a29f-4261-907c-8df58b72db92
AdityaRaj212/AZ_practice_codes
dp/Form2_EndingForm/1_longest_increasing_subseq.cpp
#include<bits/stdc++.h> using namespace std; int n; vector<int> arr; int dp[10010]; int rec(int level){ // pruning if(level<0){ return 0; } // base case // cache check if(dp[level]!=-1){ return dp[level]; } // transition int ans = 0; for(int i=0;i<level;i++){...
ALGO
0.999902
4.437648
da720e31-bb5f-4eb3-8904-2adb2fcc6e39
wuqizhichu/Cyuyan
test9.1/test9.1.cpp
#include<stdio.h> #include <malloc.h> typedef struct lnode { int data; struct lnode* next; }lnode, * linklist; //ʹеԪص int a[5] = { 2,4,1,7,3 }; int n = 5; void buildlist(linklist& L) { L = (linklist)malloc(sizeof(lnode)); lnode* s = L->next, * r = L; for (int i = 0; i < n; i++) { s = (lnode *)malloc(sizeof(ln...
ALGO
0.999918
3.536007
4c3b163d-e49b-41d7-825f-f3a647ebf3c0
Bharat2044/365-days-coding-challanges
Day_329/03_makePalindrome2.cpp
// Question Link: https://www.codechef.com/problems/MAKEPAL2 #include<bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; string s; cin >> s; int c = 0, d = 0; for (int i = 0; i < n...
ALGO
0.99999
4.515901
051b549d-3c55-4744-96ab-021f2a55e8f9
balabit-deps/balabit-os-8-llvm-toolchain-12
llvm/lib/Transforms/Utils/MatrixUtils.cpp
#include "llvm/Transforms/Utils/MatrixUtils.h" #include "llvm/Analysis/DomTreeUpdater.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Dominators.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/Type.h" using namespace llvm; BasicBlock *TileInfo::CreateLoop(BasicBlock *Prehe...
ALGO
0.979346
8.110435
5baebba9-e5de-4173-946f-b0d13f972c6d
KhronosGroup/LLVM-SPIRV-Backend
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" #include <numeric> #define DEBUG_TYPE "ctor_uti...
TOOL
0.913287
7.793811
a15c2a30-04ea-46f3-ab7b-88f23d6da141
ishandutta2007/codeforces
errichto/normal/1044/C.cpp
#ifndef LOCAL #pragma GCC optimize("O3") #endif #include "bits/stdc++.h" using namespace std; #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 > r...
ALGO
0.99995
3.484104
e7e0ed36-8903-4758-911a-834bfab0f296
webturing/NIOP
1020RecognizeNumber.cpp
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { string s; cin >> s; cout << s.length() << endl; for (auto i = s.begin(); i != s.end(); ++i) cout << *i << endl; return 0; }
ALGO
0.95884
3.361628
744f97c2-dd61-4793-b78f-a8a59dcce01f
LoveMyPillow/Delaunay
Delaunay.cpp
#include "Delaunay.h" const std::string psfn = R"(./pointset.dat)"; void main() { std::ifstream frptr; frptr.open(psfn, std::ios::binary); frptr.seekg(0, std::ios::end); const int filelen = frptr.tellg(); frptr.seekg(0, std::ios::beg); const int pointnum = filelen / 16; double2* pointset = new double2[pointnu...
ALGO
0.998897
3.676994
53d7e032-138b-4964-82af-640d73b8c75c
WangwangZhu/auto_meta
drivers/pnc_dependencies/Ipopt/src/Algorithm/Inexact/IpInexactCq.cpp
#include "IpInexactCq.hpp" #include "IpIpoptNLP.hpp" namespace Ipopt { #if IPOPT_VERBOSITY > 0 static const Index dbg_verbosity = 0; #endif InexactCq::InexactCq( IpoptNLP* ip_nlp, IpoptData* ip_data, IpoptCalculatedQuantities* ip_cq ) : ip_nlp_(ip_nlp), ip_data_(ip_da...
ALGO
0.987012
5.680828
a077e586-a265-44d0-a207-a87d840c406e
parth-sakariya/flutter_state_management
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.99887
6.783439
7a0bbc48-090e-4225-8c78-b795b461db66
vusec/stickytags
llvm-project/libc/src/math/generic/sinhf.cpp
#include "src/math/sinhf.h" #include "src/__support/FPUtil/FPBits.h" #include "src/math/generic/explogxf.h" namespace __llvm_libc { LLVM_LIBC_FUNCTION(float, sinhf, (float x)) { using FPBits = typename fputil::FPBits<float>; FPBits xbits(x); bool sign = xbits.get_sign(); uint32_t x_abs = xbits.uintval() & FPB...
ALGO
0.994368
7.11067
31199518-bdd5-4319-97a9-cbdede605e78
agisna0106/cpp
linkedList.cpp
#include <iostream> using namespace std; struct Node{ char data; Node *next = NULL; }; Node *head = NULL; Node *tail = NULL; int count_list() { int count = 0; Node *bantu = head; while(bantu != NULL) { count++; bantu = bantu->next; } return count; } void show_list() { Node *bantu = head; if(head == NUL...
ALGO
0.995094
4.045502
76d51bb4-0197-4ad8-8de4-ead53d3b5532
ishandutta2007/codeforces
zhoushang2003/normal/1145/D.cpp
#include<iostream> using namespace std; int n,a[11],A=33; int main() { cin>>n; for(int i=0;i<n;i++) cin>>a[i]; for(int i=0;i<n;i++) A=min(A,a[i]); cout<<(a[2]^A)+2; return 0; }
ALGO
0.997766
3.15271
dddfdba7-e134-4150-8d88-7a0b4b1dea66
Sid110307/WhatsAppBot
src/neuralNetwork.cpp
#include "include/neuralNetwork.h" NeuralNetwork::NeuralNetwork(const std::vector<int> &layers) { std::random_device randomDevice; std::mt19937 gen(randomDevice()); std::uniform_real_distribution<> distribution(-1, 1); weights.resize(layers.size() - 1); weightChanges.resize(layers.size() - 1); gradients.resize(...
DATA
0.973857
4.492113
75d0ee04-8a02-4bd0-9ed7-268464816f17
aujasvit/competitive-programming
USACO/Gold/Graphs/shortest_routes_1.cpp
//Problem Link: https://cses.fi/problemset/task/1671 #include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define mp make_pair #define pii pair<int, int> #define fr first #define sc second #define all(a) a.begin(),a.end() int n, m; vector <pii> graph[100005]; int dp[100005]; void...
ALGO
0.999982
4.174782
59ca750a-3230-4971-b6b1-d5d81c5b8bce
Mohamed-ELshamy-1/Problem-Solving-Essay
Fox And Snake.cpp
#include <iostream> using namespace std; int main() { int lines, hashs; cin >> lines >> hashs; int counter = 0; for(int i=0; i<lines; i++) { if(i%2 == 0) { for(int j=0; j<hashs; j++) { cout << "#" ; } } else { // Print Hash at end and begin ...
ALGO
0.999751
3.041971
6062771e-51d8-4a13-bb68-138072c9bfad
LyTruongsinh/DSA
Practice/lecture15/ex4.cpp
#include <iostream> #include <vector> #include <cstring> using namespace std; vector<int> result; bool visited[1001]; void permutation(int n) { if (result.size() == n) { for (int i = 0; i < result.size(); i++) { cout << result[i] << " "; } cout << endl; return...
ALGO
0.999837
4.798904
fb496b82-7102-42d2-99ab-f1c418c567ed
DuanYaQi/leetcode
CS_Math/460+LFU Cache.cpp
struct Node { int key, val, freq; Node(int k, int v, int f) : key(k), val(v), freq(f) {} }; class LFUCache { private: int mMinFreq, mCapacity; unordered_map<int, list<Node>::iterator> mKey_table; // 存迭代器 每个key unordered_map<int, list<Node>> mFreq_table; // 频率表,相同频率保存在一起 public: LFUCache(int...
ALGO
0.999919
5.935674
6cc2de8a-cd33-444f-a985-03a43dfccf1a
arsh30/Data-Structures-and-Algorithm-Babbar
Lec4_Patterns/pattern_07.cpp
/* 1 2 2 3 3 3 4 4 4 4 */ #include<iostream> using namespace std; int main(){ int n; cin >> n; int row = 1; while(row <= n) { // 1st obser - kitni rows hai int col = 1; while(col <= row) { // 2nd row- har row m kitne col hai, 1st row - 1 col, 2nd row = ...
ALGO
0.999979
4.359316
0581f3ed-77eb-41fe-a32b-ea58e49025a6
Struna1292/LeetCode
0147-insertion-sort-list/0147-insertion-sort-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: void insertionSort(ve...
ALGO
0.99999
5.924214