uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
b8f1f37c-3906-4be7-9568-ca8033518282
WenShihKen/uva
ITSA_Programming Contest exams 55/2.cpp
#include<iostream> #include<cmath> #include<iostream> #include<algorithm> #include<stack> #include<string> #include<sstream> #include<vector> #include<map> using namespace std; typedef long long int LL; int main() { int in1; cin >> in1; while (in1--) { int ans = 0; int a, b, c; cin >> a >> b >> c; for (...
ALGO
0.999657
3.099208
6bc66ab3-822a-48cb-8b40-490d25a763df
DINDIN2007/ICS4U
ICS4U/301 - Linear and Binary Search.cpp
#include <iostream> #include <algorithm> // Create function createRndArray to generate and sort an array with size elements that contains random values between the provided range low to high. // (Note: for the tester you will read in the randomly created array; you will need to sort the array) int* createRndArray(int ...
ALGO
0.999703
5.361627
ebb0c0bb-4306-427d-a895-a2af519e52d6
JeongHPark/2022-Algorithm-Study
Baekjoon/SeGun/16์ฃผ์ฐจ/๋งˆ๋ฒ•์‚ฌ ์ƒ์–ด์™€ ๋น„๋ฐ”๋ผ๊ธฐ.cpp
๋ฌธ์ œ์— ๋”ฐ๋ผ์„œ ๊ตฌ๋ฆ„์„ ์ด๋™์‹œํ‚ค๊ณ  ๋น„๋ฅผ ๋‚ด๋ฆฐํ›„์— ๊ตฌ๋ฆ„์ด ์žˆ๋Š” ์ขŒํ‘œ์˜ 4๊ฐ€์ง€ ๋Œ€๊ฐ์„  ์ขŒํ‘œ๋ฅผ ํ™•์ธํ•ด์„œ ๋˜๋‹ค์‹œ ๋ฐ”๊ตฌ๋‹ˆ๋ฅผ ์ฆ๊ฐ€์‹œํ‚ค๊ณ  ์ €์žฅ๋œ ๋ฌผ์ด 2์ด์ƒ์ธ ์ง€์ ์— ๊ตฌ๋ฆ„์„ ํ‘œ์‹œํ•œ๋‹ค ์ด๋•Œ ์ „์— ๊ตฌ๋ฆ„์ด์˜€๋˜ ๊ณณ์„ ๊ตฌ๋ฆ„์ด ๋  ์ˆ˜ ์—†๋‹ค ๋ฌธ์ œ์˜ ์ˆœ์„œ๋Œ€๋กœ ์ž‘์„ฑํ•˜๋ฉด ๋œ๋‹ค๊ณ  ์ƒ๊ฐํ•จ map์˜ ๋ฒ”์œ„๋ฅผ ๋ฒ—์–ด๋‚˜๋Š” ๊ฒƒ, ๊ตฌ๋ฆ„์˜ ์ด๋™์‹œ์ผฐ์„๋•Œ์˜ ์ขŒํ‘œ์— ๊ตฌ๋ฆ„์ด ์žˆ์„๋•Œ, ์ „์— ๊ตฌ๋ฆ„์ด์˜€๋˜ ๊ณณ์€ ๊ตฌ๋ฆ„์ด ๋  ์ˆ˜ ์—†๋‹ค๋Š” ์ ์— ๋Œ€ํ•ด ์กฐ์‹ฌํ•ด์„œ ํ•ด๊ฒฐ #include<iostream> #include<vector> #include<string> using namespace std; int N, M; int map[55]...
ALGO
0.999764
4.303353
e3488af5-6399-42c4-b1f4-8195a946be7a
RahulGorai0206/android_frameworks_av
media/codecs/amrnb/common/src/shr.cpp
/* Filename: /audio/gsm_amr/c/src/shr.c ------------------------------------------------------------------------------ REVISION HISTORY Description: Created separate file for the shr function. Sync'ed up with the current template and fixed tabs. Description: 1. Modified code by seperating var2=0 condi...
ALGO
0.992055
6.593211
84e61762-af9c-4b6a-b64d-6c9a8188f855
parasite-e/XPSC
week 14/Day 3/Yet Another Card Deck.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n, q; cin >> n >> q; vector<int>v(n+1); for(int i = 0; i<n; i++) { cin >> v[i]; } for(int i = 0; i<q; i++) { int x; cin >> x; in...
ALGO
0.999977
3.685941
13b82c06-c5d1-41cd-a045-65ed25d8411f
svn2github/easymule
crypto51/blowfish.cpp
// blowfish.cpp - written and placed in the public domain by Wei Dai #include "pch.h" #include "blowfish.h" #include "misc.h" NAMESPACE_BEGIN(CryptoPP) void Blowfish::Base::UncheckedSetKey(CipherDir dir, const byte *key_string, unsigned int keylength) { AssertValidKeyLength(keylength); unsigned i, j=0, k; word32...
ALGO
0.998704
7.163196
58678995-1fd2-4d34-a655-9f1813832f27
rosy-y/LeetCode_1
Intersection of Two Arrays II/Solution.cpp
class Solution { public: vector<int> intersect(vector<int>& nums1, vector<int>& nums2) { unordered_map<int, int> m; vector<int> v; for (auto a : nums1) m[a]++; for (auto b : nums2) { if (m[b]) { v.push_back(b); m[b]--; ...
ALGO
0.999991
5.759076
6536daf2-8e67-4057-aa09-25f233542964
Dahee9532/for-coding-test
14 - แ„Œแ…ฅแ†ผแ„…แ…งแ†ฏ แ„€แ…ตแ„Žแ…ฎแ†ฏแ„†แ…ฎแ†ซแ„Œแ…ฆ/์นด๋“œ์ •๋ ฌํ•˜๊ธฐ.cpp
#include <bits/stdc++.h> using namespace std; int N; vector<int> v; //๋ฌธ์ œ : https://www.acmicpc.net/problem/1715 //ํ•ญ์ƒ ์นด๋“œ ์ˆ˜๊ฐ€ ์ตœ์†Œ๊ฐ€ ๋˜๋Š” ์นด๋“œ ๋ฌถ์Œ๋ผ๋ฆฌ ๋ญ‰์น˜๋Š” ๋ฌธ์ œ //์‚ฌ์ด์ฆˆ๊ฐ€ 1 ๋ ๋•Œ๊นŒ์ง€ ๋‹ค์Œ์„ ๋ฐ˜๋ณต //1. ์ตœ์†Œ ํž™์—์„œ ๋‘๊ฐœ๋ฅผ ๊บผ๋‚ธ๋‹ค. //2. ๋‘ ๊ฐœ๋ฅผ ๋”ํ•œ ๊ฒฐ๊ณผ๋ฅผ cnt์— ์ถ”๊ฐ€ํ•œ๋‹ค. //3. ๋‘ ๊ฐœ๋ฅผ ๋”ํ•œ ๊ฒฐ๊ณผ๋ฅผ ์ตœ์†Œ ํž™์— push ํ•œ๋‹ค. //https://seokjin2.tistory.com/29 int main(void){ cin >> N; ...
ALGO
0.999969
4.800925
cd4df2b1-374c-4e8b-9273-169aa27f3092
songsanggggg/learningNote
็จ‹ๅบ่ฎพ่ฎกๆ€็ปดไธŽๅŸบ็ก€/luogu/P1009.cpp
#include <iostream> #include <algorithm> #include <cstring> #include <cmath> #include <stdint.h> using namespace std; class bigN { private: int length; int a[1000]; public: bigN() { memset(a, 0, sizeof(a)); length = 0; } void change(const char s[]) { length = strle...
ALGO
0.999987
4.434081
d19013b2-dffe-4708-af97-035facdf9258
thakre49/CP-31
1300/E_1_Rudolf_and_Snowflakes_simple_version.cpp
#include <bits/stdc++.h> using namespace std; // Aliases using ll = long long; using lld = long double; using ull = unsigned long long; // Constants const lld pi = 3.141592653589793238; const ll mod = 1e9 + 7; // TypeDEf typedef pair<int, int> pri; typedef unordered_map<int, int> umi; typedef map<int, int> mi; // M...
ALGO
0.999021
4.595326
76357ebc-d010-403e-8c4a-414da0611d64
SeptianJRG/VKTR-Electrical-Vehicle
Transmit F103/Drivers/CMSIS/NN/Examples/ARM/arm_nn_examples/gru/arm_nnexamples_gru.cpp
/** * @ingroup groupExamples */ /** * @defgroup GRUExample Gated Recurrent Unit Example * * \par Description: * \par * Demonstrates a gated recurrent unit (GRU) example with the use of fully-connected, * Tanh/Sigmoid activation functions. * * \par Model definition: * \par * GRU is a type of recurrent neura...
ALGO
0.897287
7.471897
527e3130-1206-43f5-a862-c716f91ed03a
XessX/Angry_Bird_Alike
boost/libs/compute/perf/perf_partial_sum.cpp
#include <algorithm> #include <iostream> #include <numeric> #include <vector> #include <boost/compute/system.hpp> #include <boost/compute/algorithm/partial_sum.hpp> #include <boost/compute/container/vector.hpp> #include "perf.hpp" int rand_int() { return static_cast<int>((rand() / double(RAND_MAX)) * 25.0); } i...
ALGO
0.981675
5.899202
37a41905-213c-4266-b924-9ef1820a7e7e
soura07/Data-Structures-and-Algorithms
Variables and Data Types/biwiseMethod.cpp
//Bitwise Method to find Binary number #include<iostream> #include<cmath> using namespace std; int findBinary(int n){ int binaryno = 0; int i =0; while(n>0){ int bit =(n&1); //bitwise method binaryno = bit*pow(10, i++) + binaryno; n = n >> 1; } return binaryno; } int...
ALGO
0.999959
5.534856
4161c2ec-0e76-456f-b6cc-5be28abdb9e8
v-ankita/III-SEM-LABS
DS/postfix eval_multiple_digits.cpp
//evluation of postfix multidigit #include <iostream> using namespace std; int s[50]; int top=-1; int flag=0; int pop() { return(s[top--]); } int push(int element) { if(flag==1) { int num; num=pop(); s[++top]=element+10*num; } else if(flag==0) { s[++top]=element; flag=1; } } ...
ALGO
0.999711
3.82325
fed52835-9a0e-452f-8996-0182b16ad40f
kzamanbd/graph-problems
Can_Go_1.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e3 + 10; vector<pair<long long, long long>> grid[N]; long long distances[N]; class Compare { public: bool operator()(pair<long long, long long> a, pair<long long, long long> b) { return a.second > b.second; } }; void dijkstra(long long src)...
ALGO
0.999876
4.54153
711bf095-fef1-4f93-9ffe-7f992f76c592
tickelton/playground
challenges/lc/math/count_of_matches_in_tournament.cpp
/* ## Count of Matches in Tournament You are given an integer n, the number of teams in a tournament that has strange rules: * If the current number of teams is even, each team gets paired with another team. A total of n / 2 matches are played, and n / 2 teams advance to the next round. * If the current number of te...
ALGO
0.999979
6.345202
8c7f9878-690a-4def-9a25-af120b160990
alexandraback/datacollection
solutions_1674486_1/C++/Floop/A.cpp
#include <iostream> #include <sstream> #include <cstdio> #include <cmath> #include <cstring> #include <cctype> #include <string> #include <vector> #include <list> #include <set> #include <map> #include <queue> #include <stack> #include <algorithm> #include <climits> #include <cfloat> #include <iomanip> using namespace ...
ALGO
0.999782
4.524276
d8a6047e-2f31-4334-9608-90a808fc9094
Sachin-Kedar/LEARN-DSA-CPP
Math/Pythagorian_Triplet.cpp
// Pythagorean Triplet contains three numbers in which the square of max. number is equal to sum of square of other two numbers. // if a,b,c in which a is max then a*a == (b*b + c*c). #include<iostream> #include<cmath> using namespace std; bool check(int x, int y, int z){ int a=max(x,max(y,z)); int b,c; ...
ALGO
0.999821
4.393884
d362ca72-03d1-41f4-99f4-7d0d3d163795
INET-RC/GeoMX
3rdparty/mkldnn/src/cpu/gemm_x8s8s32x_convolution.cpp
#include "mkldnn_types.h" #include "c_types_map.hpp" #include "utils.hpp" #include "type_helpers.hpp" #include "mkldnn_thread.hpp" #include "math_utils.hpp" #include "simple_q10n.hpp" #include "gemm_x8s8s32x_convolution.hpp" namespace mkldnn { namespace impl { namespace cpu { using namespace mkldnn::impl::utils; u...
ALGO
0.971653
6.821121
43ae24b2-6fbc-441c-b6d3-06a8de5c1c91
raincross7/code-similarity
codes/train_code/problem075/problem075_382.cpp
#include <bits/stdc++.h> using namespace std; int main(void){ int x,flag=0; cin>>x; std::deque<int> deq{105,104,103,102,101,100}; for (int i=0;i<6;i++) { if (x%deq[i]==0) { cout<<1<<endl; flag=1; break; } else { int tmp=x/deq[i]; ...
ALGO
0.999917
3.225273
f5f14e90-850d-4dee-93b2-fc069c0a8ed6
Pushpajit/My-Daily-Progress
Codeforces/Round_760_div3/Missing_Bigram.cpp
#ifdef ONPC #define _GLIBCXX_DEBUG #endif //[.....Modified by Nexus007.....] #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <string.h> using namespace __gnu_pbds; using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); typedef tree<int, null_type, less<in...
ALGO
0.999776
4.046714
c4a30e18-2738-4971-bea9-45e7261f968a
diterun/AlgorithmCode
c++/programmers/kakao/2018_5.cpp
#include <iostream> #include <vector> using namespace std; vector<vector<int>> solution(vector<vector<int>> nodeinfo); int main(){ vector<vector<int>> a = {{5,3},{11,5},{13,3},{3,5},{6,1},{1,3},{8,6},{7,2},{2,2}}; vector<vector<int>> b = solution(a); for(int i = 0; i < b.size(); i++){ for(int j =...
ALGO
0.999992
4.403746
f3a98a83-3b2f-4a88-963e-ca48771a9079
yeticoder/CarND-Path-Planning-Project
src/Eigen-3.3/doc/examples/Tutorial_BlockOperations_corner.cpp
#include <Eigen/Dense> #include <iostream> using namespace std; int main() { Eigen::Matrix4f m; m << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11,12, 13,14,15,16; cout << "m.leftCols(2) =" << endl << m.leftCols(2) << endl << endl; cout << "m.bottomRows<2>() =" << endl << m.bottomRows<2>() << endl << ...
ALGO
0.997386
4.103137
b5bcd3a3-7bbf-4102-80bc-5784ccc97a52
emsr/maths_burkhardt
line_felippa_rule.cpp
# include <cstdlib> # include <iostream> # include <iomanip> # include <fstream> # include <ctime> # include <cstring> # include <cmath> # include "line_felippa_rule.hpp" //****************************************************************************80 double line_monomial ( double a, double b, int expon ) { doubl...
ALGO
0.996467
4.376063
95a23b2c-e37e-4270-abcd-f4ca87773f68
gaurav-310/Coding
2024-11-07/permutation_rows_and_cols.cpp
#include <bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> #pragma GCC optimize("Ofast") #define mem(a, b) memset(a, b, sizeof(a)) #define nl '\n' #define mod 1000000007 #define MOD 998244353 #define mod2 100000000 #define pb ...
ALGO
0.999792
4.005614
6d686aca-9adc-4ee3-81c7-5fc1ab86e1d6
Suvrojyoti/APS-2020
Codeforces_Submissions/1325D.cpp
#include <bits/stdc++.h> #define ll unsigned long long int #define pb push_back #define se second #define fi first #define rep(i, l, r) for (ll i = (ll)(l); i < (ll)(r); i++) #define print(v) for (const auto itr : v){cout << itr << ' ';}cout << endl; #define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.ti...
ALGO
0.999798
4.024461
41d68a26-b7a4-4ccf-be50-5c2dc5089a50
KINGORITHM/Hash
seungmin/failPlayer.cpp
// // Created by ์ด์Šน๋ฏผ on 2019-10-16. // #include <iostream> #include <string> #include <vector> #include <unordered_map> using namespace std; string solution(vector <string> participant, vector<string> completion){ string answer =""; unordered_map <string, int> m; for(int i = 0; i < completion.size(); i+...
ALGO
0.999689
5.262852
1d4cda9b-0e0e-49de-ba99-ae2d3e85d79f
sinian666/codes_102_1
1cpp_ๅ‰ฏๆœฌ3/chapter_backtracking/preorder_traversal_i_compact.cpp
/** * File: preorder_traversal_i_compact.cpp * Created Time: 2023-04-16 * Author: Krahets (<EMAIL>) */ #include "../utils/common.hpp" vector<TreeNode *> res; /* ๅ‰ๅบ้ๅކ๏ผšไพ‹้ข˜ไธ€ */ static void preOrder(TreeNode *root) { if (root == nullptr) { return; } if (root->val == 7) { // ่ฎฐๅฝ•่งฃ res...
ALGO
0.999948
5.612921
da75f15c-f8db-4ede-bfd6-f8e1214a73f7
VirajBP/AgriConnect
tempCodeRunnerFile.cpp
include <iostream> include <cmath> using namespace std; typedef long long ll; ll exponentiate(ll base, ll exp, ll mod) { ll result = 1; base %= mod; while (exp > 0) { if (exp & 1) result = (result * base) % mod; base = (base * base) % mod; exp /= 2; } return result; } ll m...
ALGO
0.998903
4.440207
8caedbcc-fe94-43ee-bfcf-9c91ee403840
robisto1414/cosc1030chap2
ch4/hw43.cpp
#include <iostream> #include <string> #include <cmath> #include <iomanip> using namespace std; int main(){ double calories,fatcals,percent,fat; cout << "Please enter amount of calories" << endl; cin >> calories; cout << "Please enter amount of grams of fat" << endl; cin >> fat; fatcals=fat*9; ...
ALGO
0.980292
4.104201
f301aa95-d569-4873-9bef-af6c73ddebc3
XutaxKamay/css_enhanced
game/server/ai_movesolver.cpp
#include "cbase.h" #include "ai_movesolver.h" #include "ndebugoverlay.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" //----------------------------------------------------------------------------- inline float V_round( float f ) { return (float)( (int)( f + 0.5 ) ); } /...
ALGO
0.996184
7.297202
76cb2a82-b2f1-4587-be65-6f0a139f0b0c
doocs/leetcode
solution/1700-1799/1728.Cat and Mouse II/Solution.cpp
class Solution { private: const int dirs[5] = {-1, 0, 1, 0, -1}; int calc(vector<vector<int>>& gMouse, vector<vector<int>>& gCat, int mouseStart, int catStart, int hole) { int n = gMouse.size(); vector<vector<vector<int>>> degree(n, vector<vector<int>>(n, vector<int>(2))); vector<vector...
ALGO
0.999974
6.20472
fb107b38-3669-49d5-b8a4-763fa2d5ae3e
shrivats2/dynamicProgramming
graph/Find Eventual Safe States.cpp
class Solution { public: bool dfs(vector<vector<int>>& graph, int node, vector<int>& safe) { if (safe[node] != 0) return safe[node] == 1; safe[node] = 2;//not safe for (int next : graph[node]) { if (!dfs(graph, next, safe)) return false; ...
ALGO
0.999986
6.120704
b5984c44-72f6-4f6a-a078-eeb6bd7225ed
AizaAsim/DSA
DSA1/linear_search.cpp
#include<iostream> using namespace std; void search(int arr[],int size,int key){ int i;for(i=0;i<size;i++){ if(arr[i]==key){ break; } } if(i==size){cout<<"Element not found";} else{ cout<<"Element found in the index "<<i; } } int main(){ int arr[]={1,2,3,4,5,6,7,8,9,0}; search(arr,10,5); }
ALGO
0.999373
3.885496
30b2d1d0-78e9-4252-99b0-df0d949221b5
sahmiran/Lab02
Lab02/EX1.cpp
#include<iostream> #include<stdio.h> #include<math.h> #include<stdlib.h> using namespace std; void main() { int A[] = {1,2,3,4,5,6,7,8,9}; //onceden tanimli dizi int N; //ne kadar kaydirilacagini tutan degisken char direction; //hangi yone kayma yapilacagini belirleyen degisken int temp; ...
ALGO
0.999912
3.457135
8663ce41-7c19-4259-a01f-66ba4733e09b
sinian666/code_86_6
cpp_ๅ‰ฏๆœฌ29/chapter_computational_complexity/worst_best_time_complexity.cpp
/** * File: worst_best_time_complexity.cpp * Created Time: 2022-11-25 * Author: Krahets (<EMAIL>) */ #include "../utils/common.hpp" /* ็”Ÿๆˆไธ€ไธชๆ•ฐ็ป„๏ผŒๅ…ƒ็ด ไธบ { 1, 2, ..., n }๏ผŒ้กบๅบ่ขซๆ‰“ไนฑ */ vector<int> randomNumbers(int n) { vector<int> nums(n); // ็”Ÿๆˆๆ•ฐ็ป„ nums = { 1, 2, 3, ..., n } for (int i = 0; i < n; i++) { n...
ALGO
0.998131
5.235354
4513e016-13c8-475e-98f3-f57684188469
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_8076_5.cpp
#include <bits/stdc++.h> using namespace std; const double EPS = 1e-7; unsigned long long R, N, pos, sol, cnt; double x, y, D[2100100]; unsigned long long C[2100100]; double th = 1.0 / 2; double tb = cos(M_PI / 6); double h = 2 * tb; double w = 1 + 2 * th; double dst() { return sqrt(((x) * (x)) + ((y) * (y))); } int ma...
ALGO
0.999121
3.628833
473e8d5a-e137-4df2-9f55-99cfa1c8e158
TejaThunuguntla/Object-Oriented-Design
Remote Code Repository/Downloads/Utilities.cpp
/////////////////////////////////////////////////////////////////////// // Utilities.cpp - small, generally usefule, helper classes // //-------------------------------------------------------------------// // ver 1.0 // // Application: Project-4 Depen...
TOOL
0.952321
5.596856
1a02254c-f211-4378-97eb-82d05625b6d4
raodj/cityscape
model_gen/tests/chicago/taxi_ride_data/AggregateDayOfWeek.cpp
#include <iostream> #include <fstream> #include <string> #include <ctime> #include <unordered_map> std::string getColumn(const std::string& line, const int column, const char delim = '\t') { int currCol = 0, startPos = 0; while (currCol < column) { startPos = line.find(delim, star...
DATA
0.94183
6.628656
13a0aa33-fefc-4a6d-bac4-ebd28198dbd4
Pruthvi-Parade/DSA-Practice
Code from Lecture 1-20/Problem_18.cpp
// Find the peek element of a Mountain array using the binary search apporach #include "bits/stdc++.h" using namespace std; int Find_Peek_Of_Mountain(int array[10]) { int start = 0; int end = 10 - 1; int mid = start + (end - start) / 2; while (start <= end) { if (array[mid - 1] < array[mid...
ALGO
0.999991
4.224439
44e7b652-d121-4219-a1c2-2cc055a13401
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_9732_13.cpp
#include <bits/stdc++.h> using namespace std; vector<long int> a[100000 + 10]; vector<long int> b[100000 + 10]; vector<long int> c[100000 + 10]; vector<long int> bfs; long long int dp[100000 + 10]; long long int mark[100000 + 10]; long long int n, m; long long int INF = 9999999; bool ans = true; bool mark_ans_khfan[100...
ALGO
0.999918
3.730284
e6254068-ae4a-46cc-bddd-ad3b9357c07e
VivanVatsa/c-collection
arrays/1D/arrayrearrangement/arrayreorderindex.cpp
#include <bits/stdc++.h> using namespace std; int reorder(int ar[], int index[], int n) { // if i have to assign values of one array into another array // then make a temp array and traverse all the values accordingly int temp[n]; for (int i = 0; i < n; i++) temp[index[i]] = ar[i]; // ar[i]...
ALGO
0.999893
4.094486
16c540aa-9c37-4651-8b6f-7a7b580d7548
KingMomoGiannini/Programacion-I-2022---comision-1603-T.T.
TP 4 funciones guรญa Cimino/Ej8/ej8.cpp
/*Definรญ las siguientes funciones, asegurรกndote su correcto funcionamiento con algunos tests. 8) esPrimo, que devuelva si un nรบmero entero dado como parรกmetro es o no primo.*/ #include<stdio.h> #include<stdlib.h> int esPrimo(int x){ int divPrim=0; for (int i = 1; i <=x; i++) { if(x%i==0){ ...
ALGO
0.997871
3.129024
0a2a397f-727d-4b84-91b2-4968fb1fe6f6
aayush751/Leetcode
3213-count-subarrays-where-max-element-appears-at-least-k-times/count-subarrays-where-max-element-appears-at-least-k-times.cpp
class Solution { public: long long countSubarrays(vector<int>& nums, int k) { long long left = 0, cnt = 0, ans = 0; long long maxi = -1; for( auto i: nums ) { if( i > maxi ) { maxi = i; } } for(int right = 0; righ...
ALGO
0.999946
5.676058
6485d555-198f-4dd2-9726-eb3372139a8e
OS2World/DEV-SAMPLES-IBM_OpenDoc
StdDispM.cpp
/* @(#)Z 1.5 com/src/ui/StdDispM.cpp, odui, od96os2, odos29712d 97/03/21 17:20:21 (96/07/16 17:32:51) */ /* File: StdDispM.cpp Contains: Implementation of standard dispatch module for Macintosh events Owned by: Richard Rodseth Copyright: 1993 - 1995 by Appl...
TOOL
0.883272
5.005722
a8cf35a1-83d3-4db4-9b13-1f11298b0705
GovindTelang/Leetcode
0703. Kth Largest Element in a Stream.cpp
class KthLargest { public: int K; //min heap priority_queue<int,vector<int>,greater<int>> pq; KthLargest(int k, vector<int>& nums) { K=k; for(int &num : nums){ pq.push(num); if(pq.size()>k) pq.pop(); //min element will be popped } } int add(i...
ALGO
0.999891
6.140509
93622208-02d7-438e-bf25-05218d58eeca
Anujdominoblack/DSA-using-c-
sorting/hoarespartiton.cpp
// we consider the first element as pivot element // we begin with two indices i and j as i=l-1 and j=h+1 // and we increse i and decrease j and when we find i greater than pivot we will stop // and if we find j less than pivot we will stop // if i and j crossed we return j // else we sill swap them #include<iostream> ...
ALGO
0.999989
4.826615
c7479201-5bee-4175-8913-dbbb077a5904
Amitkumersarkar/DSA-JOURNEY-WITH-C-PLUS-PLUS
Lab-Task/task2.cpp
#include <iostream> using namespace std; void TOH(int n, int A, int B, int C) { if (n > 0) { TOH(n - 1, A, C, B); cout << "Move disc from " << A << " to " << C << endl; TOH(n - 1, B, A, C); } } int main() { TOH(3, 1, 2, 3); return 0; }
ALGO
0.999537
5.065474
5f4a040d-5644-44a9-865d-e96fcc60b5f8
stikhead/mindgym
codeforces/A/1535A.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int cases; cin >> cases; int arr[cases][4]; int mx1, mx2, mx3; for(int i=0; i<cases; i++){ for(int j=0; j<cases; j++){ for(int k=0; k<4; k++){ cin >> arr[j][k]; } } for(int j=0; ...
ALGO
0.999741
3.395662
8ac20246-97fa-4c21-b9e4-43befc0ee137
ishandutta2007/codeforces
qaqautomaton/normal/1320/E.cpp
/* Author: QAQAutomaton Lang: C++ Code: E.cpp Mail: <EMAIL> Blog: https://www.qaq-am.com/ */ #include<bits/stdc++.h> #include<bits/extc++.h> #define int long long #define debug(...) fprintf(stderr,__VA_ARGS__) #define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__) #define Debug debug("Passing [%s] in L...
ALGO
0.999929
3.680026
6b471543-c9d1-46c6-8978-4b1b2739d50b
hikkiyomi/discrete-math-hw5
src/task_m.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; #define fastio ios_base::sync_with_stdio(false); cin.tie(0) #define sz(v) (int)v.size() typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef tree<int, null_type, less<in...
ALGO
0.998755
5.479352
c9efdd7f-f74f-47a4-8079-d188d0fbd2d0
nanopathi/frameworks_av_AOSP10_r33_CVE-2020-0160
media/libstagefright/codecs/amrnb/enc/src/ton_stab.cpp
/* ------------------------------------------------------------------------------ Pathname: ./audio/gsm-amr/c/src/ton_stab.c Funtions: Date: 02/06/2002 ------------------------------------------------------------------------------ REVISION HISTORY Description: For check_lsp() 1. Eliminated u...
TOOL
0.879591
7.670895
622bffad-afae-4915-841a-02036b1a643b
stonb/cplusplus_projects
009_Multiply_User_Input/main.cpp
#include <iostream> #include <array> // Program that multiplies by X and -X, N user inputs using arrays // This program uses Array library and regular C Arrays int main() { const int ARRAY_SIZE = 5; const int MULTIPLIER = 2; std::array<int, ARRAY_SIZE> userInputNumbers; int hiddenArray[ARRAY_SIZE]; ...
ALGO
0.992215
3.992454
e3467085-5836-4c06-9207-94daffa83e31
Anik-36/coding_in_laptop
unfinished/A_George_and_Accommodation.cpp
#include<bits/stdc++.h> #define endl '\n' #define ll long long #define yes cout<<"YES"<<endl; #define no cout<<"NO"<<endl; using namespace std; int main(){ int n, ct = 0; cin>>n; while(n--){ int a , b; cin>>a>>b; int dif = b -a; if(dif>=2){ ct++; } } ...
ALGO
0.999425
3.993819
0e717f2b-9196-4483-ab35-58093cf67e78
nititorn2542/CCMINER-GITHUB
mobile-mining/ccminer/nvml.cpp
#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include "miner.h" #include "nvml.h" #include "cuda_runtime.h" #ifdef USE_WRAPNVML extern nvml_handle *hnvml; extern char driver_version[32]; static uint32_t device_bus_ids[MAX_GPUS] = { 0 }; extern uint32_t device_gp...
TOOL
0.913275
6.263065
111a58d6-2a33-4a0b-9df1-de7395e168a1
dgamba/betacool
src/xForce.cpp
//--------------------------------------------------------------------------- #include "stdafx.h" #include "xForce.h" //--------------------------------------------------------------------------- xForce::xForce() { type = 0; //type of friction force formula delta._((Q_ ^ 2) / (s_ ^ 2)); Vtr_min._(m_ / s_); ...
ALGO
0.871555
4.682226
beb4d5c7-b08e-42c1-b8b3-d9ac82563e43
lumia70/algorithm-1
bitmap_sort.cpp
/**้ข˜็›ฎ๏ผš ่พ“ๅ…ฅ๏ผš ไธ€ไธชๆœ€ๅคšๆœ‰nไธชไธ้‡ๅค็š„ๆญฃๆ•ดๆ•ฐ็š„ๆ–‡ไปถ๏ผŒๅ…ถไธญๆฏไธชๆ•ฐ้ƒฝๅฐไบŽn๏ผŒไธ”n=10^7 ่พ“ๅ‡บ๏ผš ๅพ—ๅˆฐๆŒ‰ๅฐๅˆฐๅคงๅ‡ๅบๆŽ’ๅˆ—็š„ๅŒ…ๅซๆ‰€ๆœ‰่พ“ๅ…ฅ็š„ๆ•ดๆ•ฐๅˆ—่กจ ่ฆๆฑ‚๏ผš ๆœ€ๅคšๆœ‰1MBๅ†…ๅญ˜็ฉบ้—ดๅฏ็”จ๏ผŒไฝ†็ฃ็›˜็ฉบ้—ด่ถณๅคŸใ€‚่ฆๆฑ‚่ฟ่กŒๆ—ถ้—ด10็ง’ไธบไฝณใ€‚ **/ #include <iostream> #include <bitset> #include <assert.h> #include <time.h> using namespace std; const int max_each_scan=5000000; int main() { clock_t begin=clock(); bitset<max_each_scan> bi...
ALGO
0.998414
3.74816
beed3814-7710-433f-b72f-3a208809c155
XiaoyongBai/GreenFunction
src/MathOperationT.cpp
#include "math.h" #include "MathOperationT.h" using namespace std; using namespace GreenFunction; double MathOperationT::Determinant(int MD, double* matrix) { if(MD==2) { return matrix[0]*matrix[3] - matrix[1]*matrix[2]; } else if(MD==3) { return matrix[0]*(matrix[4]*matrix[8]-matrix[5]*matrix[7]) -ma...
ALGO
0.99586
4.003816
16ff8bb6-038f-489d-88aa-0b567086efbe
zhiqiang-hhhh/zhiqiang-hhhh.github.io
pre_post/ComputerScience/Algorithm/LeetCode/124. Binary Tree Maximum Path Sum.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: int maxPathSum(TreeNode* root){ int _sum = INT32_MIN; helper(root, _sum); ...
ALGO
0.999919
6.34437
c532fc7f-3a58-47e1-8030-4d1098719197
marco-1337/Workspace-2do-UCM-videojuegos
EDA/EjerciciosJuez/Tema2/Tema2-04/Tema2-04.cpp
// Nombre del alumno Marco Gonzalez Campo // Usuario del Juez EDA-GDV30 #include <iostream> #include <iomanip> #include <fstream> #include <vector> using namespace std; // complejidad de O(n) siendo n el tamaรฑo del vector datos bool comprobarDispersion(const vector<int>& datos, const int& dispersion, int ini, int fi...
ALGO
0.999957
4.456272
dec3b27c-c4fc-49b2-b14a-787b39fddacc
config44/ton-kafka
tdutils/td/utils/port/signals.cpp
#include "td/utils/port/signals.h" #include "td/utils/port/config.h" #include "td/utils/port/stacktrace.h" #include "td/utils/port/StdStreams.h" #include "td/utils/common.h" #include "td/utils/format.h" #if TD_PORT_POSIX #include <signal.h> #include <sys/mman.h> #include <unistd.h> #endif #if TD_PORT_WINDOWS #includ...
TOOL
0.888924
7.650645
d6cd2032-7036-4b4c-a126-f4c47bbd3e3c
nhatduy2401/repo
ex3/ex3.cpp
#include <iostream> using namespace std; void generateBinaryStrings(int n, string str) { if (str.length() == n) { cout << str << endl; return; } generateBinaryStrings(n, str + "0"); generateBinaryStrings(n, str + "1"); } int main() { int n; string str; cout << "Nhap do dai: "; cin >> n; generateBinaryStr...
ALGO
0.999943
5.315953
d3df8122-4369-4224-8196-e66c6e68a11c
benHobbs/cs165
wk1/week2_project.cpp
/******************************************************************************* ** Author: Benjamin Hobbs ** Modified by: n/a ** Date Created: 1/14/2014 ** Last Modification Date: n/a ** Lab/Project#: Week 2 Project ** Filename: week2_project.cpp ** ** Overview: A 2 player number guessing program. ** ** Input:...
ALGO
0.97964
4.124539
f88d84de-0b2e-4b5b-85ce-7ad313118d31
Kaileshwaran13/CodeChef
1600 - 1800 difficulty rating/Almost Sorted Permutation.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; int a[n + 1]; a[0] = 0; for (int i = 1; i <= n; i++) { cin >> a[i]; } for (int i = 1; i < n; i++) { if (a[i] > a[i + 1])...
ALGO
0.99993
4.27453
924ebdb4-e0b1-4f2c-b3a1-8917df80548e
purvasingh96/My-Leetcode-Solutions
1680-concatenation-of-consecutive-binary-numbers/1680-concatenation-of-consecutive-binary-numbers.cpp
class Solution { public: int concatenatedBinary(int n) { int mod=1e9+7, curlen=0; long long prev=0; for(int i=1;i<=n;i++){ if((i & (i-1)) == 0) curlen+=1; prev = (prev << curlen)%mod; prev%=mod; prev +=...
ALGO
0.999994
6.463595
0f605389-dd19-41bd-9297-67de8f833b2b
ei2537/VSCode-Files
ใƒ—ใƒญใ‚ณใƒณ้–ขไฟ‚/JOI็ทด็ฟ’ใ‚ณใƒณใƒ†ใ‚นใƒˆ/4.cpp
#include<bits/stdc++.h> #define endl "\n" #define ll long long #define IMAX INT_MAX #define IMIN INT_MIN #define LLMAX LLONG_MAX #define LLMIN LLONG_MIN using namespace std; auto Yn=[](bool b){cout << (b?"Yes":"No") << '\n';}; int main () { vector <int> a(3); for(auto& i:a) cin >> i; sort(a.begin(),a.end()...
ALGO
0.999973
3.795475
b42384d8-9db8-4748-b97d-1ddea369a487
ishandutta2007/codeforces
zoli9/normal/1506/G.cpp
#include <bits/stdc++.h> using namespace std; #define F first #define S second typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll; typedef pair<int, int> pii; typedef vector<pii> vpii; //mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); //(double)clock() / CLOCKS_PER_SEC; int main...
ALGO
0.999991
4.477802
14e06207-8e76-46c8-b72c-39c4a550365b
dhairyapandya05/Data-Structures-and-Algorithms
Stacks/P_901_stockspan.cpp
class StockSpanner { public: stack<pair<int,int>>st; StockSpanner() { } int next(int price) { int span=1; while(!st.empty() && st.top().second <=price){ span=span+st.top().first; st.pop(); } st.push({span,price}); return span; ...
ALGO
0.999357
6.403266
2c241c82-21d2-4ff9-b321-2a2a08c99816
sarahcrowle/crystalspace
plugins/video/loader/dds/ImageLib/Image.cpp
/* Image.cpp - Generic 24 bit image class functions */ #include "Image.h" #include "CodeBook.h" #include "fCodeBook.h" #include "Lloyd.h" #include "MedianCut.h" #include <math.h> CS_PLUGIN_NAMESPACE_BEGIN(DDSImageIO) { namespace ImageLib { QuantMethodType Image::QuantMethod = QM_MedianCut; bool Image::QuantDiffus...
TOOL
0.882055
5.888012
8f66d875-853c-4f86-a9b8-ad5370799820
mspjapan/procon
atcoder beginner/001/c.cpp
#include<iostream> #include<string> #include<cmath> using namespace std; int main(){ int dir_i,dis_i,w; double dir_b,dis_b; string dir_s; cin >> dir_i >> dis_i; dir_b = dir_i/10; if(dir_b>=326.25&&dir_b<348.75){ dir_s="NNW"; } else if(dir_b>=303.75&&dir_b<326.25){ dir_s="NW"; } else if(dir_b>=281.25&&dir_b...
ALGO
0.999784
3.732761
f5cbf56e-5837-4663-959a-3ca660c2a669
raincross7/code-similarity
codes/train_code/problem198/problem198_373.cpp
#include <bits/stdc++.h> using namespace std; int main() { string O,E; cin>>O>>E; int o=O.size(); int e=E.size(); if(e>o){ string k=O; O=E; E=k; } int h=O.size(); int g=E.size(); for(int i=0; i<g; i++){ cout<<O.at(i)<<E.at(i); } if(h>g){ cout<<O.at(h-1); } cout<<""<<endl; }
ALGO
0.999956
3.357341
207496da-ca93-4cd8-9f3b-3bd7a050de1a
anant147/Coding-Problems
Hackerrank/segmentree.cpp
#include <iostream> #include <vector> using namespace std; // implementation of segment tree in a simple way for sum query int getsum(vector<int>& stree,int nsz, int l,int r) { int sval=0; l=nsz-1+l; r=nsz-1+r; while(l<=r) { if(l%2==1) sval+=stree[l++]; if(r%2==0) sval+=stree[r--]; l=l/2; r=...
ALGO
0.999879
3.715487
e901bcee-591f-4684-bafb-14690f368e1a
Bobby999123/competitive-coding
0_CodeHelp_Youtube/Lecture-44 Linked List/revision.cpp
#include<bits/stdc++.h> using namespace std; class Node{ public: int data; Node* next; Node(int d){ this->data=d; this->next=NULL; } }; void insertAtHead(Node* head,int d){ Node* temp=new Node(d); temp->next=head; head=temp; } void printLinkedList(Node* head){ Node* temp=head; while(temp!=NULL){ c...
ALGO
0.999618
4.478885
5088553d-9031-47c0-8b4e-36c6a0a5cfe9
paulosabayomi/studio-lite-audio
deps/juce/modules/juce_box2d/box2d/Dynamics/Contacts/b2ChainAndCircleContact.cpp
#include "b2ChainAndCircleContact.h" #include "../../Common/b2BlockAllocator.h" #include "../b2Fixture.h" #include "../../Collision/Shapes/b2ChainShape.h" #include "../../Collision/Shapes/b2EdgeShape.h" #include <new> using namespace std; b2Contact* b2ChainAndCircleContact::Create(b2Fixture* fixtureA, int32 indexA, b...
ALGO
0.981271
6.138812
695f105b-e21a-48fd-a87a-5129daf90669
batman-rises/GFG-160
recursion/Solve the Sudoku.cpp
void solveSudoku(vector<vector<int>> &mat) { // code here solve(mat, 0, 0); } private: static bool solve(vector<vector<int>> &mat, int i, int j) { if (i == 9) { return true; } int nI = (j == 8) ? i + 1 : i; int nJ = (j == 8) ? 0 : j + 1; if (mat[i][j] != 0) { return...
ALGO
0.999667
6.480423
6ca8a042-c029-4f9c-96b9-02b8b77dd9da
sid1114911149/DSA_IN_C-
All_Graph_Distances.cpp
#include <iostream> #include <vector> #include <climits> #include <queue> #include <algorithm> using namespace std; // ---------- Dijkstraโ€™s ---------- int Dijkstras(int v, vector<vector<int>> &Edges, int source, int dest) { int e = Edges.size(); vector<int> ans(v, INT_MAX); vector<vector<pair<int, int>>> ...
ALGO
0.99996
5.658325
822841eb-bce3-41c7-9593-45f398114ae5
Kennyarlexy/Competitive-Programming
Cheatsheet/utilz/RUPQ.cpp
#include <bits/stdc++.h> #define ll long long using namespace std; #define LSOne(x) ((x) & (-x)) struct RUPQ { vector<ll> ft; int n; RUPQ(int n) : ft(n+5) { this->n = n; } void update(int i, int d) { while (i <= n) { ft[i] += d; i += LSOne(i); } ...
ALGO
0.999856
3.763424
a260a80f-2ec0-41d1-805c-40052e1ae41e
jonathandarryl/UVa-Code
1185.cpp
#include<iostream> #include<math.h> using namespace std; int main(void){ int n,testcase; double result; cin>>testcase; for(int i=0;i<testcase;i++){ cin>>n; result = 0; for(int j=1;j<=n;j++) result+= log10((double) j); cout<<(int)floor(result+1)<<endl; }...
ALGO
0.99312
3.39278
fcd0bfae-f10a-46c2-b15b-e0a57caeef9b
DhruvPandey1509/Vscode-Program-Folders
Problem-Solutions/Minimum_Number_of_Vertices_to_Reach_All_Nodes.cpp
#include "bits/stdc++.h" using namespace std; class Solution { public: vector<int> findSmallestSetOfVertices(int n, vector<vector<int>> &edges) { vector<vector<int>> adj(n); for (int i = 0; i < edges.size(); i++) { adj[edges[i][0]].push_back(edges[i][1]); } ve...
ALGO
0.999877
5.486127
edd8b911-2703-48ab-bf7d-8a34888fa244
Whitford/SpikeSimulations
InputDecks/DoderoRojas_eLife_2021/gromacs_flat_GR/src/gromacs/fft/fft_mkl.cpp
#include "gmxpre.h" #include <errno.h> #include <stdlib.h> #include <mkl_dfti.h> #include <mkl_service.h> #include "gromacs/fft/fft.h" #include "gromacs/utility/fatalerror.h" /* For MKL version (<10.0), we should define MKL_LONG. */ #ifndef MKL_LONG # define MKL_LONG long int #endif #if GMX_DOUBLE # define G...
TOOL
0.87381
6.374175
44c0102f-8a76-41c1-9b15-fd28af665400
divysinghal0123/Programs
sum.cpp
#include<iostream> using namespace std; int main() { int totamount,a,b; cin>>a>>b; totamount=a+b; cout<<"sum = "<<totamount<<endl; return 0; }
ALGO
0.974206
3.032949
36dbfbfd-3d93-458b-a278-3ff43dc17a3b
emathgroup/selectedTopics
content/attached/files/sdv3.cpp
#include <map> #include <iostream> typedef long mtype; typedef std::map<mtype, long> DMAP; #define ONE ((mtype)1) DMAP dmap1,dmap2,dmap3; DMAP *pmap, *qmap, *tmap, *hmap; #ifndef N #define N 37 #endif #define IS ((N*(N+1))/2) #define ISR 14 #define ISL 14 void initLN() { int i; for(i=1;i<=N;i++){ mtype x=1;...
ALGO
0.999768
3.177679
2e7ea462-a468-4560-9c93-85cb126456b8
luciaalonsomozo/Juez
Problema06/Problema18/Problema18.cpp
/*@ <answer> * * Nombre y Apellidos: Lucรญa Alonso Mozo * *@ </answer> */ #include <iostream> #include <fstream> #include <vector> using namespace std; /*@ <answer> Comentario general sobre la solucion: Coste de la solucion: @ </answer> */ bool graphCheck(int u, vector <vector <int> > & adjList, vector<st...
ALGO
0.999968
4.96719
9ce7e421-a68e-4765-ae8d-73f9e2f9496b
tranthaicong2610/hayho
kim tu thap.cpp
#include<iostream> using namespace std; int main () { float n;cin>>n; float tong=0,i; for( i=1;i<=n;i++) { tong=tong+(i+1)*i/2; if(tong>n) break; } cout<<i-1; return 0; }
ALGO
0.999935
3.312254
faa351d3-ee24-4eb1-887d-92a8941e432d
raunak2909/cubit_exp_302
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.998784
6.761023
06c6fa31-d532-45df-aea9-41d1c3f7addf
Crimson-MITK-ThirdParty/boost
libs/math/example/bernoulli_example.cpp
#pragma warning (disable : 4100) // unreferenced formal parameter. #pragma warning (disable : 4127) // conditional expression is constant. //#define BOOST_MATH_OVERFLOW_ERROR_POLICY ignore_error #include <boost/multiprecision/cpp_dec_float.hpp> #include <boost/math/special_functions/bernoulli.hpp> #include <iostream...
ALGO
0.996978
5.140999
74f0727b-9db6-4ddb-b28b-fc4fd8ba1b82
vfolunin/archives-solutions
EOlymp/3615.cpp
#include <iostream> #include <algorithm> #include <vector> #include <set> #include <map> #include <string> #include <random> using namespace std; class ImplicitTreap { inline static minstd_rand gen; struct Node { int value, priority, size = 1, minValue; Node *left = 0, *right = 0; Node...
ALGO
0.99999
5.537665
4154e719-255b-474d-959a-c3d50e530423
nusdbsystem/HAKES
search-worker/index/utils/random.cpp
// -*- c++ -*- #include "search-worker/index/utils/random.h" // extern "C" { // int sgemm_( // const char* transa, // const char* transb, // FINTEGER* m, // FINTEGER* n, // FINTEGER* k, // const float* alpha, // const float* a, // FINTEGER* lda, // ...
TOOL
0.979815
6.067568
591eb540-9de1-4c77-bcc2-723c47ba8ae7
Satyam-Bhalla/DSA-Practice
Binary-Tree/01-Find_sum_of_left_nodes.cpp
/* Given the root of a binary tree, return the sum of all left leaves. Example 1: 3 / \ 9 20 / \ 15 7 Input: root = [3,9,20,null,null,15,7] Output: 24 Explanation: There are two left leaves in the binary tree, with values 9 and 15 respectively. Example 2: ...
ALGO
0.999973
6.88399
45029ead-da07-4089-b055-cdb7f262ff80
khalwsh/Competitive-Programming
Math/Number theory 1/mod inverse/Mod inverse prime number.cpp
int ModInverse(int a,int m){ return fast_power(a,m-2,m); }
ALGO
0.999885
3.860521
c23c3d6d-239e-46be-8b12-455e7b30d2a2
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_9744_10.cpp
#include <bits/stdc++.h> using namespace std; int main(void) { int n, p, tot = 0; cin >> n >> p; for (int e = 0; e < n; e++) { int k; cin >> k; tot += k; } for (int e = 1; e <= 100; e++) { if (tot + e * p <= p * (e + n)) { if (2 * (tot + e * p) >= 2 * p * (e + n) - (e + n)) { cou...
ALGO
0.999933
3.545632
4bca7efa-96fb-438c-a20c-cb1f83e58ab5
Yeluorag/ACM-ICPC-Code-Library
CQU Summer/8-15 ๆ•ฐๅญฆ II/C - ASCII Area.cpp
#include <iostream> #include <sstream> #include <cstdio> #include <vector> #include <queue> #include <map> #include <set> #include <stack> #include <cmath> #include <string> #include <cstring> #include <algorithm> using namespace std; typedef long long LL; #define mem(a, n) memset(a, n, sizeof(a)) #define rep(i, n) for...
ALGO
0.993122
3.226459
d73c3d4f-375d-446a-a37f-42bfa0ad4fbc
tjdans6342/BaekJoon-Online-Judge
100 challenge/1188.cpp
// (M-1) - (gcd(N,M)-1) <gcd ํ•จ์ˆ˜ ์ดํ•ดํ•ด์•ผํ•จ> #include <bits/stdc++.h> using namespace std; int gcd(int a, int b){return a%b?gcd(b,a%b):b;} int main() { int n,m; scanf("%d %d", &n,&m); printf("%d",m-gcd(n,m)); return 0; }
ALGO
0.999967
3.716204
a103bce2-7d61-49dc-97de-0ef81aba24e3
jchnelson/project_euler_solutions
37_truncatable_primes.cpp
#include <chrono> #include <iostream> #include <cstddef> #include <string> #include <cmath> #include <vector> #include <bitset> using std::cout; using std::sqrt; using std::abs; using std::size_t; using std::string; bool is_prime(long long i) { if (i == 0 || i == 1) return false; long long max = long...
ALGO
0.996443
5.228428
f9a9b452-c9c6-475d-b1f1-d20a933d9e00
Sahilbatra1211/MultiThreadingRubrik
WebCrawlerMultiThreaded.cpp
// WebCrawlerMultiThreaded.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> #include<bits/stdc++.h> #include<unordered_map> #include<thread> #include<mutex> using namespace std; class HtmlParser { public: vector<string> getUrls(string url) { ...
ALGO
0.908251
4.881807
16269790-6981-4f19-9d6d-068e4485caf1
Kicamon/Note
Algorithm/ไปฃ็ ๆบไธญ็บงๅŒ…ไปฃ็ /ๅ›พ่ฎบไธญ็บงๆบไปฃ็ /7/3.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; const int V = 20100; const int E = 201000; template<typename T> struct FlowGraph { int s, t, vtot; int head[V], etot; int dis[V], cur[V]; struct edge { int v, nxt; T f; } e[E * 2]; void addedge(int u,int v, T f, T f2 = 0){ e[etot]= {v, hea...
ALGO
0.999888
3.459094
b452d90b-9a4a-4648-bd02-9d72bb1f34dc
shoaibrayeen/Data-Structures-and-Algorithms
Minimum Insertions to Sort An Array/code_1.cpp
#include <iostream> #include <vector> using namespace std; int getMinInsertionStepToSortArray(vector<int>arr) { int n = int(arr.size()); int lis[n]; for (int i = 0; i < n; i++) { lis[i] = 1; } for (int i = 1; i < n; i++) { for (int j = 0; j < i; j++) { if (arr[i] >= arr[...
ALGO
0.999693
4.997927
a1707466-5ee9-4bf8-91c0-d578e39318b1
manikuttan-davud/task4
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998859
6.785645
62bd8ca3-06e1-4f6c-a884-eafc46e2df74
dm999/buglab
python/genetics.cpp
#include <array> #include <vector> #include <random> #include <cstdio> #include <fstream> #include <iostream> #include <string> const size_t populationSize = 1000; const size_t elite = 2; const size_t populationSizeAndElite = populationSize + elite; const float crossoverRate = 1.0f; float mutationRate = 0.002f; const...
ALGO
0.99983
5.057073
265d7512-907f-45af-83c8-fb7a7b359d6f
stdstring/leetcode
Algorithms/Tasks.1001.1500/1042.FlowerPlantingWithNoAdjacent/solution.cpp
#include <queue> #include <vector> #include "gtest/gtest.h" namespace { class Solution { public: [[nodiscard]] std::vector<int> gardenNoAdj(int n, std::vector<std::vector<int>> const &paths) const { std::vector<std::vector<int>> nodes(n); for (std::vector<int> const &path : paths) { ...
ALGO
0.999945
6.632969