uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
a79904cb-5a9c-4918-81d3-e28f0f92325e
RohithBoppey/leetcode-sol
1079-sum-of-root-to-leaf-binary-numbers/1079-sum-of-root-to-leaf-binary-numbers.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.999997
6.057517
07665827-dcff-4efc-bda3-60ed19617d35
catsudon/TOI-prep
passed/ข้อเลข 0 + โจทย์ในค่าย/candle.cpp
#include<bits/stdc++.h> using namespace std; string board[2009]; int m,n,c=0; int dx[8] = {0,1,1,1,0,-1,-1,-1}; int dy[8] = {-1,-1,0,1,1,1,0,-1}; int start(int x,int y) { if(board[x][y]=='0' || y<0 || x<=0 || x>m || y>=n) return 0; board[x][y]='0'; for(int i=0;i<8;++i) start(x+dx[i],y+dy[i]); return 0; ...
ALGO
0.999785
4.502592
109e9451-9351-4820-bc37-0153283f3704
Ashmita-Srivastav/Cpp
63-function_farenheit_celsius_table.cpp
#include <iostream> using namespace std; int farenheit(int S, int E,int W){ while(S<=E){ int C = (S-32)*5/9; cout << S <<" "<<C<<endl; S = S+W; } return S; } int main(){ int S; cout<<"Ente the start Farenheit value:"; cin>>S; int E; cout<<"Ente the end Farenheit ...
ALGO
0.999485
3.170645
afe564fa-3572-4ed0-a3b8-50fdebbaf568
ishandutta2007/codeforces
eecs/normal/1651/F.cpp
#include <bits/stdc++.h> using i64 = long long; struct Tree { Tree *l; Tree *r; i64 sc; i64 sr; Tree() : l(nullptr), r(nullptr), sc(0), sr(0) {} }; Tree *null = new Tree(); Tree *newTree() { Tree *t = new Tree(); t->l = t->r = null; return t; } Tree *add(Tree *t, int l, int r, int x...
ALGO
0.999897
4.196638
58d9eff4-1630-4d0e-97f9-ada98bb94ec3
jki14/competitive-programming
2010/zoj10Aug/POJ/p1035/src/p1035.cpp
#include <iostream> #include <sstream> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <climits> #include <algorithm> #include <map> #include <string> using namespace std; #define maxm 11000 #define maxn 51 #define maxl 20 char s[maxm][maxl]; char str[maxl]; map<string,int> c; map<stri...
ALGO
0.994194
3.215425
af958d79-ef82-4203-88bd-bd306fa076bc
dnjfs/Algorithm
Baekjoon/1707_이분_그래프.cpp
//1707 이분 그래프 #include "iostream" #include "vector" #include "queue" using namespace std; int bin[20001]; //정점에 번호를 부여하여 그래프 분할 void bfs(vector<vector<int>> v, int s, bool *ans) //너비우선탐색 { queue<int> q; q.push(s); bin[s] = 1; //1번부터 부여 while (!q.empty()) { int w = q.front(); q.pop(); for (int i = 0; i < ...
ALGO
0.999981
4.677212
876a5b74-e19a-4c01-9bb1-3ffcb14b5e13
TimeSea05/LeetCode101
201-300/234-isPalindrome.cpp
#include <iostream> 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) {} }; ListNode *reverseList(ListNode *list) { if (list == nullptr || list->next == nullptr) { return list;...
ALGO
0.999818
5.857226
7d2eaeed-1d63-4c47-999a-4fcc66e79be9
nandayvk/EECE5554_Final_Project
openvslam/libraries/open_cv/opencv-3.4.0/modules/core/src/convert.sse4_1.cpp
#include "precomp.hpp" #include "convert.hpp" namespace cv { namespace opt_SSE4_1 { int cvtScale_SIMD_u8u16f32_SSE41(const uchar * src, ushort * dst, int width, float scale, float shift) { int x = 0; __m128i v_zero = _mm_setzero_si128(); __m128 v_scale = _mm_set1_ps(scale), v_shift = _mm_set1_ps(shift); ...
ALGO
0.900761
4.163047
aa861837-766f-4fd4-87e5-ae487f0cb75c
ivabby/Competitive-Programming
CodeForces/CodeForces Practice Problems/Pride.cpp
#include<bits/stdc++.h> #include<set> #include<iterator> #include<algorithm> using namespace std; #define forr(a,n) for(int i=a;i<=n;i++) #define MAX 1000000007LL #define mod 998244353 #define forn(n,a) for(int i=n;i>=a;i--) #define all(x) x.begin() , x.end() #define mp(x,y) make_pair(x,y) #define pb(x) push_back(x) #d...
ALGO
0.999976
3.830333
9fa2f0f1-315e-48a6-ba75-0f5e0dc926d2
blackout-yash/PVF
Basics/Graphs Basic Graph Theory/07_CF22C_System_Administrator.cpp
// CF22C - System Administrator // Link - https://codeforces.com/contest/22/problem/C #include <iostream> #include <vector> using namespace std; int main() { int n, m, index; cin >> n >> m >> index; vector <pair<int, int>> ans; vector <int> graph; for (int i = 1; i < n; i++) { if (i != index) graph.push_back...
ALGO
0.999995
4.496093
46986d14-128c-46ec-abaf-fde234499b7e
usvibrus/c---problems
Recursion/replscepiwith3.14.cpp
#include <bits/stdc++.h> using namespace std; void replacepi(string s){ if(s.length()==0){ return; } if(s[0]=='p' && s[1]=='i'){ cout<<"3.14"; }else{cout<<s[0]; } replacepi(s.substr(2)); } int amin9{ }
ALGO
0.99963
3.601355
2611c932-557f-4549-8467-5d3c3f94174a
wgy0804/build
saber/funcs/impl/cuda/vender_gru.cpp
#include "saber/funcs/impl/cuda/vender_gru.h" #include "cuda_fp16.h" namespace anakin { namespace saber { template <> void VenderGru<NV, AK_FLOAT, AK_FLOAT, AK_FLOAT, NCHW, NCHW, NCHW>::\ seq2hw(std::vector<DataTensor*> outputs, std::vector<DataTensor*> inputs, GruParam<OpTensor>& param, int hidden_si...
ALGO
0.874282
5.554067
2fdd210a-df25-41e1-8398-7fde037ec1d6
Kira-1937/repo-for-codeforces-contests
1833E.cpp
#pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> p32; typedef pair<ll,ll> p64; typedef pair<double,double> pd...
ALGO
0.999888
3.99515
11e585e1-c978-4f90-878e-89c666a80f22
ScriptingClubDelhi/ScriptDump
Sort/radixsort.cpp
// C++ implementation of Radix Sort #include <iostream> using namespace std; // A utility function to get maximum value in arr[] int getMax(int arr[], int n) { int mx = arr[0]; for (int i = 1; i < n; i++) if (arr[i] > mx) mx = arr[i]; return mx; } // A function to do counting sort of...
ALGO
0.99999
6.111023
0bcec61b-83cf-444d-9832-2a06496e640f
oldlick/CompetitiveProgramming
atcoder/5 other/2020_0418 第二回 アルゴリズム実技検定/G.cpp
#include <cstdio> #include <cmath> #include <iostream> #include <vector> #include <string> #include <utility> #include <algorithm> #include <queue> #include <map> using namespace std; #define FOR(i,a,b) for(ll i=a;i<b;i++) #define REP(i,n) for(ll i=0;i<n;i++) #define REPR(i,n) for(ll i=n-1;i>=0;i--) typedef long long ...
ALGO
0.999673
3.370915
94057441-05e6-4b8a-b81f-734e9beef873
doraemoncoin-project/doraemoncoin
src/qt/guiutil.cpp
#include <QApplication> #include "guiutil.h" #include "bitcoinaddressvalidator.h" #include "walletmodel.h" #include "bitcoinunits.h" #include "util.h" #include "init.h" #include <QDateTime> #include <QDoubleValidator> #include <QFont> #include <QLineEdit> #if QT_VERSION >= 0x050000 #include <QUrlQuery> #else #inclu...
TOOL
0.862277
6.897079
722735f1-0fe5-42bd-8814-52913ebce833
Mr-Bangladesh/Problem-Solving
HackerEarth/GCD Recruit in-ex.cpp
/**In the name of Allah, the Most Merciful, the Most Merciful.**/ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define INF 9223372036854775806 #define pb push_back #define mp make_pair #define MOD 1000000007 #define PI 2*acos(0.0) #define EPS 1e-9 ll max(ll a,ll b)...
ALGO
0.999945
3.658028
2bf4235f-8f9a-452f-9467-f8a1ea3f583b
RealChiragOO7/College
DAA/0-1knapsack.cpp
#include <bits/stdc++.h> using namespace std; int knapSack(int W, int wt[], int val[], int n) { int dp[W + 1]; memset(dp, 0, sizeof(dp)); for (int i = 1; i < n + 1; i++) { for (int w = W; w >= 0; w--) { if (wt[i - 1] <= w) // Finding the maximum valu...
ALGO
0.999836
5.105038
732259e1-3723-460b-8d21-09ed1c3aaebc
prompt412/Gold100
김연우/2022_05_03_1013.cpp
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <vector> #include <queue> #include <algorithm> #include <iostream> #include <sstream> #include <string> #include <bitset> #include <map> #include <set> #include <tuple> #include <string.h> #include <math.h> #include <random> #include <functional> #include <as...
ALGO
0.999923
4.205522
845d6fa5-6d48-4e67-ac40-0c201af5db6e
Garyxud/ros-kinetic-desktop-full
src/opencv3/opencv_contrib/tracking/src/trackerMIL.cpp
#include "precomp.hpp" #include "trackerMILModel.hpp" namespace cv { class TrackerMILImpl : public TrackerMIL { public: TrackerMILImpl( const TrackerMIL::Params &parameters = TrackerMIL::Params() ); void read( const FileNode& fn ); void write( FileStorage& fs ) const; protected: bool initImpl( const Mat& ...
TOOL
0.974817
6.265048
ee7057bd-8b22-4882-8395-61bb059d215f
plctlab/plct-gem5
src/systemc/tests/systemc/misc/unit/data/datawidth_signed/extension/datawidth.cpp
/***************************************************************************** datawidth.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /**************************************************************************...
ALGO
0.985021
5.296924
f6f7370c-7945-4077-9877-fc770396e108
zarif98sjs/Competitive-Programming
AtCoder/Educational DP Contest/L Deque2.cpp
/** Which of the favors of your Lord will you deny ? **/ #include<bits/stdc++.h> using namespace std; #define LL long long #define PII pair<int,int> #define PLL pair<LL,LL> #define MP make_pair #define F first #define S second #define ALL(x) (x).begin(), (x).end() #define DBG(x) cerr << __LINE__ << " says: " << #x ...
ALGO
0.999992
3.88295
95714704-d1e2-4576-8d0b-1b9796f813f3
openfheorg/openfhe-development
src/binfhe/examples/boolean.cpp
/* Example for the FHEW scheme using the default bootstrapping method (GINX) */ #include "binfhecontext.h" using namespace lbcrypto; int main() { // Sample Program: Step 1: Set CryptoContext auto cc = BinFHEContext(); // STD128 is the security level of 128 bits of security based on LWE Estimator ...
ALGO
0.991937
5.386863
a4dacd24-f99c-4c7f-bcd4-1311950de620
RashmiMaxCoder/Data-Structure
linklist/geek/removeLoop.cpp
void removeLoop(Node* head) { // code here // just remove the loop without losing any nodes // 1. Take two pointers named fast and slow of type Node and // initialize it with head pointer. // 2. Run a loop until fast and fast's next becomes NULL // 3. Increase slow by 1 // 4...
ALGO
0.99988
5.157089
4175fd71-afe3-4bac-bfc0-3a708ca82070
GaurangJotwani/LeetcodeForAll
0980-find-the-shortest-superstring/0980-find-the-shortest-superstring.cpp
class Solution { public: int calcDist(string s1, string s2) { for (int i = 1; i < s1.size(); i++) { if (s2.find(s1.substr(i)) == 0) { return s2.size() - (s1.size() - i); } } return s2.size(); } int tsp(int currWord, int visited, int n, vector<vector<int>> &dp, vector<vector<int>...
ALGO
0.999987
5.648273
653f8a20-97e5-4829-b1e7-6b6d1afab975
GuidoBitti/ProgramacionCompetitivaResueltos
CodeForces/Round 898 (Div. 4)/c.cpp
#include <bits/stdc++.h> using namespace std; // g++ -std=c++20 -02 -wall template.cpp -o template #define forr(i,a,b) for(int i=(int)a ; i<(int)b ; i++) #define forn(i, n) for(int i = 0; i < n; i ++) #define all(x) (x).begin(),(x).end() #define fst first #define snd second #define pb(x) push_back(x) typedef long lon...
ALGO
0.998365
4.144649
97fccb35-648e-47a3-9383-ce615bc4ae7c
hasnain-cyber/competitive-programming
codeforces/B_Anatoly_and_Cockroaches.cpp
#include <bits/stdc++.h> #define MOD 1000000007 //#define MOD 998244353 #define MIN numeric_limits<int>::min() #define MAX numeric_limits<int>::max() #define int long long int #define double long double #define endl '\n' using namespace std; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL);...
ALGO
0.999466
5.486383
ee11cf16-9b00-4aad-9b06-58832f7ef602
Maplewing-Personal-Projects/SPtestdata
27/answer.cpp
#include <iostream> using namespace std; int main(){ double a, b; cin >> a >> b; cout << a*b/2 << endl; return 0; }
ALGO
0.999346
3.317284
308eac4c-8728-4e21-8c26-0b35b78af1ae
Domain-Cmap/assignments-day-1-to-day-9-pulkitagg17
Day 5/Hard/2.cpp
#include <vector> #include <queue> using namespace std; int kthSmallest(vector<vector<int>>& mat, int k) { auto mergeRows = [](vector<int>& a, vector<int>& b, int k) { priority_queue<int> maxHeap; for (int x : a) { for (int y : b) { int sum = x + y; maxHe...
ALGO
0.999994
5.846414
c6fcf5bd-2f17-4c48-bc7e-aad545beda7d
JESSE-max1/30DaysofCoding
day4/FourSum.cpp
class Solution { public: vector<vector<int>> fourSum(vector<int>& nums, int target) { vector<vector<int>>res; if(nums.empty()) return res; int n=nums.size(); sort(nums.begin(),nums.end()); for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ int target_2 ...
ALGO
0.999973
5.88985
91570913-ea39-4e1d-83e8-35b2f05551da
intfloat/AlgoSolutions
leetcode/TotalHammingDistance.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: int totalHammingDistance(vector<int>& nums) { int res = 0; for (int i = 0; i < 32; ++i) { int zeros = 0, ones = 0, mask = (1 << i); for (auto n : nums) { if (mask & n) ++ones; ...
ALGO
0.999951
5.720241
25f8f3ef-7ab4-43d2-9d4d-4051f92ddcc6
fgwu/leetcode-cpp
p155-min-stack.cpp
class MinStack { /*pushing current min and the value when min changes..*/ /*AC 20170615 1634 */ public: /** initialize your data structure here. */ stack<int> s; long min; MinStack() { min = INT_MAX; } void push(int x) { if (x <= min) { s.push(min); min = x; } s.push(x); } void pop() { if (...
ALGO
0.999966
5.790775
4a660011-285a-4d89-8239-2b9de2e7a26d
bluster980/Leetcode-Solutions
2461-maximum-sum-of-distinct-subarrays-with-length-k/2461-maximum-sum-of-distinct-subarrays-with-length-k.cpp
vector<int> count_num(100002,0); class Solution { public: long long maximumSubarraySum(vector<int>& nums, int k) { long long i=0, j=0, sum=0, max_sum=0; while(j<nums.size()) { count_num[nums[j]]++; sum+=nums[j]; while(count_num[nums[j]]>1) ...
ALGO
0.999944
5.356955
2a9a7a35-a9df-4914-9a16-77fec7f9b0f4
fra-nc/Programming-Files
C++ Files/Recursion.cpp
#include<iostream> //Recursive function to calculate sum of integers from 1 to k int sum(int k) { if (k > 0) { return k + sum(k - 1); } else { return 0; } } int main() { //Call the function with argument 10 int result = sum(10); std::cout << result; return 0; }
ALGO
0.999032
5.651409
049c82d6-b945-4702-b9ed-fc41f13a8eb6
MadG0blin359/CPP-CodeGlitch
Process Management/Fork03.cpp
#include <iostream> #include <unistd.h> #include <sys/wait.h> #include <sys/types.h> using namespace std; int main() { pid_t pid; // 2 level process tree if ((pid = fork()) == -1) { cout << "Error!" << endl; } else if (pid > 0) { cout << "I am parent: " << getpid() << endl; wait(NULL); pid = fork(); if...
ALGO
0.999084
3.641031
ef9dff5a-74b8-4099-880e-d9352916b202
rottaca/FallDetectionProject
processor.cpp
#include "processor.h" #include <QtConcurrent/QtConcurrent> #include <QImageReader> #include <qimage.h> #include <assert.h> #include <sstream> Processor::Processor(): m_timewindow(TIME_WINDOW_US), m_updateStatsInterval(UPDATE_INTERVAL_COMP_US) { m_newFrameAvailable = false; m_nextId = 0; m_curr...
ALGO
0.924712
4.68649
3a7db70a-2ae7-46ef-96af-d8bfa477ae3a
yongjunleeme/BOJ
프로그래머스/lv2/42578. 위장/위장.cpp
#include <bits/stdc++.h> using namespace std; int solution(vector<vector<string>> clothes) { int answer = 1; unordered_map <string, int> m; for(auto c : clothes){ m[c[1]]++; } for(auto i: m){ answer *= (i.second+1); } return answer -1; }
ALGO
0.999268
4.712339
66d05120-8549-4e07-8a37-d20b2e4f8c33
Deepsresthi/LeetCode-Solution
56. Spiral Matrix 2.cpp
class Solution { public: vector<vector<int>> generateMatrix(int n) { vector<vector<int>> matrix(n, vector(n, 0)); int rowBegin = 0, rowEnd = n-1,colBegin = 0, colEnd = n-1; int k = 1; while(rowBegin <= rowEnd && colBegin <= colEnd){ for(int i = colBegin; i <= col...
ALGO
0.999989
6.116767
5c7b66bf-7ba1-431b-a4e6-544334e9d84e
Taha-Adeel/CP
ICPC 2023 Amritapuri Regionals/vault.cpp
void solve() { for (int d = 1; d <= 10; ++d) { set<pii> poss; for (int i = 0; i < (1 << (2*d)); ++i) { // This corresponds to something int x = 0, y = 0; for (int m = 0, j = i, cur = 1; m < d; ++m, cur *= k) { switch (j & 3) { c...
ALGO
0.995726
3.914567
7a3a39e5-5f00-4161-bb8e-252b51a4ae94
jay-wlj/eos3
contracts/libc++/upstream/test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy.pass.cpp
// <algorithm> // template<InputIterator InIter, class OutIter> // requires OutputIterator<OutIter, RvalueOf<InIter::value_type>::type> // && EqualityComparable<InIter::value_type> // && HasAssign<InIter::value_type, InIter::reference> // && Constructible<InIter::value_type, InIter::reference...
TEST
0.974589
6.011661
33673934-ae15-4256-a599-b70a18273e08
Coder-Vippro/Code
Archived/GiaHung/KT01 (3).cpp
#include <bits/stdc++.h> using namespace std; int main() { freopen("KT01.inp","r",stdin) freopen("KT01.out","w",stdout) int n,s=0,a=1; cin>>n; for(int i=1;i<n;i++) { s+=i; if(n==s)cout<<"YES"<<endl; else cout<<"NO"<<endl; } int numberMax(int n) { if (n == 0) return 0;...
ALGO
0.999956
3.716054
545dec7d-fd0d-4ded-917a-aee94812decc
dungtran174/CPP_Code
basic-c++/dem-so-nghiem-của-pt-dong-du.cpp
#include <stdio.h> int main(){ int t; scanf("%d",&t); while(t--){ long long b,p,s=0; scanf("%lld%lld",&b,&p); for(long long i=1;i<p;i++){ if((i*i)%p==1){ long long k=i+p*(b/p); if(k>b) k-=p; s+=(k-i)/p+1; } } printf("%lld\n",s); } }
ALGO
0.999878
3.786804
08da937e-4848-4a49-8333-b1d9e77f120f
AwaisOem/Cpp-Basic-OOP-DSA
loops practice/comp(C).cpp
#include <iostream> using namespace std; int main() { float x, sum, ng, fct, a, b, c; int i, n; cout << "Enter X: "; cin >> x; cout << "Enter n: "; cin >> n; a = 2; sum = 1; ng = 1; cout << " term 1 value is: " << ng << endl; for (i = 1; i < n; i++) { fc...
ALGO
0.999951
3.50538
7d870dab-d13b-4813-9fa6-ac1f30edced1
GhiocelAndrei/Client-Server-Messaging-App-TCP-UDP
Server_utils.cpp
#include "Server_utils.h" #include <iostream> Server::Server(int port) { // Disable buffering setvbuf(stdout, NULL, _IONBF, BUFSIZ); server_address.sin_family = AF_INET; server_address.sin_port = htons(port); server_address.sin_addr.s_addr = INADDR_ANY; // Clear file descriptor sets FD_ZE...
WEB
0.918583
6.256976
50573765-7a73-4e79-8c82-bfbb2925c8bc
Pandafuchs/codingame
ClashOfCode/Fastest/moveCharInAlphabet.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main() { string l; getline(cin, l); int i = 0; for(; i < l.length(); i++) { cout << (char) (l[i] + i); } }
ALGO
0.991167
3.624264
86d29039-99eb-4f44-816b-b9ba077f0957
Pulkitbarala/gfg_self_paced_answers
Tree/Inorder Traversal.cpp
class Solution { public: vector<int> inOrder(Node* root) { vector<int> result; stack<Node*> s; Node* current = root; while (current != NULL || !s.empty()) { while (current != NULL) { s.push(current); current = current->left; } current = s.top(); ...
ALGO
0.999984
6.63658
9cf5f26b-66ac-4e52-9367-7385f206bf46
kush8789/CodeNow
cpp/Array/removeduplicatesfromsortedarray.cpp
#include<bits/stdc++.h> using namespace std; int removeDuplicates(vector<int>& nums, int n) { if(n==0) { return 0; } int j=0; for(int i=1;i<n;i++) { if(nums[i]!=nums[j]) { j++; nums[j]=nums[i]; } } return j+1; // int ...
ALGO
0.999801
5.262136
08641e20-3cf3-4ddb-90f7-b391861c7b12
roarem/compPhys2_p1
program/main/main.cpp
#include <stdlib.h> #include "../System/System.h" #include "../System/Particle.h" #include "../Sampler/Sampler.h" #include "../Hamiltonian/Hamiltonian.h" #include "../WaveFunction/WaveFunction.h" #include "../InitialState/InitialState.h" #include "../Hamiltonian/HarmonicOscillator.h" #include "../Hamiltonian/HarmonicOs...
ALGO
0.999531
4.966838
11db3de9-e2e2-49b8-80cd-670db9691588
coderrishu12/Leetcode
2385-amount-of-time-for-binary-tree-to-be-infected/2385-amount-of-time-for-binary-tree-to-be-infected.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.99997
6.120567
960c1ad4-ab0a-4171-9b0e-69a0617f50f1
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_7507_0.cpp
#include <bits/stdc++.h> using namespace std; struct Object { int u, v, d; }; bool operator<(Object a, Object b) { return a.u < b.u; } int n, m, i, j, u, v, d, In[2000], Ou[2000], D[2000]; Object tmp; vector<Object> ans; int main() { scanf("%d%d", &n, &m); memset(In, -1, sizeof(In)); memset(Ou, -1, sizeof(Ou));...
ALGO
0.999976
4.130985
3bccd15d-663f-423f-a6b9-733fca6f7aca
Chisj1/C-Course
Bai tap C tuan 8/House Robber.cpp
#include<stdio.h> #include<stdlib.h> int max(int a, int b) { if(a>b) return a; return b; } int getMoney (int * houses, char * path) { int i=0; FILE *f = fopen(path,"r"); while(!feof(f)) { fscanf(f, "%d", &houses[i]); i++; } return i; } int rob(int * houses, int numOfHouses) { int maxg[numOfHouses];...
ALGO
0.999802
3.634301
3df7c23c-0da5-46d3-b2f0-0c5c897bc0c9
PeaceTem/competitive-programming
global_round_27/b.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define pb push_back #define mp make_pair #define F first #define S second #define endl '\n' #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) (int)(x).size() #define lb lower_bou...
ALGO
0.999715
5.029846
e6ed91bf-a788-4235-92f7-39875e93ca09
UsmanNadeem/llvm-6-register-allocator
lib/DebugInfo/CodeView/TypeStreamMerger.cpp
#include "llvm/DebugInfo/CodeView/TypeStreamMerger.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringExtras.h" #include "llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h" #include "llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h" #include "llvm/DebugInfo/CodeView/TypeIndex.h" #include "llvm/DebugInfo/Code...
TOOL
0.869757
7.733313
59b2ee36-e1a2-46d4-ab9b-ef3175c669fb
Srivatsha108/DataStructures-using-Cpp
array/MaximuminStructArray/main.cpp
/*Given a struct array of type Height, having two elements feet and inches. Find the maximum height, where height is calculated sum of feet and inches after converting feet into inches.*/ #include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { int n,sum=0; c...
ALGO
0.999516
5.035316
9cefe80f-fbe8-4c33-a49b-935100ec2bd8
guptaaa19/Leetcode
0350-intersection-of-two-arrays-ii/0350-intersection-of-two-arrays-ii.cpp
class Solution{ public: vector<int>intersect(vector<int> nums1, vector<int>nums2){ int n = nums1.size(); int m = nums2.size(); sort(nums1.begin(), nums1.end()); // O(nlogn) sort(nums2.begin(), nums2.end()); vector<int>ans; int i=0,j=0; while (i<n && j<...
ALGO
0.999981
6.091808
83df9afd-10e4-4a4e-965c-06d06eb58a9e
vitalina909090/Practical14
Practical14.cpp
#include <iostream> #include <Windows.h> using namespace std; int change(const char* mas) { long numbers = 0; int max = 2147483647; bool minus = false; if (*mas == '-') { minus = true; mas++; } for (int i = 0; mas[i] != '\0'; i++) { if (mas[i] < '0' || mas[i] > '9') {...
ALGO
0.921231
3.709952
2c86be4a-e915-4c10-8921-1238abf464c1
VinayJangotra/Striver_sheet
BinarySearch/Easy/_2Darray.java/Maximum_1.cpp
int rowWithMax1s(vector<vector<int>> &matrix, int n, int m) { int max=-1; int idx=-1; for(int i=0;i<n;i++){ int count=0; for(int j=0;j<n;j++){ if(matrix[i][j]==1){ count++; } } if(count>max){ max=count; ...
ALGO
0.999801
4.940266
be6a3c27-e0f7-4535-bdda-74e37b84f1ba
EmuZoneDEV/WARCRYCORE-CLASSIC
src/modules/Eluna/ElunaUtility.cpp
#include "ElunaUtility.h" #include "World.h" #include "Object.h" #include "Unit.h" #include "GameObject.h" #include "DBCStores.h" uint32 ElunaUtil::GetCurrTime() { #if !defined TRINITY && !AZEROTHCORE return WorldTimer::getMSTime(); #else return getMSTime(); #endif } uint32 ElunaUtil::GetTimeDiff(uint32 oldMS...
TOOL
0.906827
4.517624
245e2e23-563d-4450-94d8-27a93a0deb20
DengMinghua/RexToNFA
NFA.cpp
#include"NFA.h" #include<iostream> #include<queue> #include<algorithm> #include<string> NFA::NFA(std::string i_rex) { Epsilon_NFA = 0; possible = false; Number = -1; rex = i_rex; int len = i_rex.length(); for (int i = 0; i < len; i++) { char x = i_rex[i]; switch (x) { cas...
ALGO
0.997929
3.197008
fcf1e077-b196-48f2-ae61-5cb787aaa05f
aayush751/Leetcode
300-longest-increasing-subsequence/longest-increasing-subsequence.cpp
class Solution { public: int lengthOfLIS(vector<int>& nums) { int size = nums.size(); vector<int> dp( size, 1e5); for(int i = 0; i < size; i++ ) { int p = lower_bound(dp.begin(), dp.end(), nums[i] ) - dp.begin(); if( p < size ) { ...
ALGO
0.999989
6.018221
2dbcea82-641e-4132-859d-111e939a5976
Noorous/Wiki-2.0
thirdparty/astcenc/astcenc_color_quantize.cpp
#if !defined(ASTCENC_DECOMPRESS_ONLY) /** * @brief Functions for color quantization. * * The design of the color quantization functionality requires the caller to use higher level error * analysis to determine the base encoding that should be used. This earlier analysis will select * the basic type of the endpoin...
TOOL
0.965531
4.532351
1e26c9ec-185d-43e6-b355-d7409693a041
ankittkp/Competitive-Programming
Array/missing_no.cpp
using namespace std; int main() { int t; cin>>t; while(t--) { int n,i=0,sum=0; cin>>n; int a[n]; int temp=n; for(int i=0;i<temp-1;i++) { cin>>a[i]; sum+=a[i]; } cout<<((n*(n+1))/2)-sum<<endl; } }
ALGO
0.999728
3.670279
5e67a729-9c17-42ec-b430-8299566ee328
lucascoelho33/Estrutura-de-dados-2
Atividade_Cap.13/arvore.cpp
#include <iostream> #include <stdio.h> using namespace std; typedef struct arvoreS { struct arvoreS *direita; int item; struct arvoreS *esquerda; } *Arvore; Arvore criarArvore(Arvore e, int item, Arvore d){ Arvore novo = (Arvore)malloc(sizeof(arvoreS)); novo->esquerda = e; novo->item = item; novo->direit...
ALGO
0.999738
4.557498
09d5ab09-81b1-426f-a0fd-9dec6d1a74aa
PrometheanWorld/VLC
medialibrary/jni/AndroidMediaLibrary.cpp
#include "AndroidMediaLibrary.h" #define LOG_TAG "VLC/JNI/AndroidMediaLibrary" #include "log.h" #define THREAD_NAME "AndroidMedialibrary" #define FLAG_MEDIA_UPDATED_AUDIO 1 << 0 #define FLAG_MEDIA_UPDATED_AUDIO_EMPTY 1 << 1 #define FLAG_MEDIA_UPDATED_VIDEO 1 << 2 #define FLAG_MEDIA_UPDATED_VIDEO_EMPTY 1 <<...
TOOL
0.973084
7.012806
9212cbad-f261-46d9-adc9-486699170df4
nirmala1721/DSA
Arrays/Problems/Removing_Duplicate_elements.cpp
// // Removing Duplicate Elements using Extra array in DSA #include<iostream> using namespace std; void removeDuplicates(int arr[], int n) { int uniqueArr[100]; int uniqueCount = 0; for(int i = 0; i < n; i++) { bool isDuplicate = false; for(int j = 0; j < uniqueCount; j++) { ...
ALGO
0.997832
5.075719
5a332e86-cfcd-4975-8811-6d33fab62054
PtCu/practice
OJ/PAT/1067.cpp
#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; int pos[maxn]; //pos[i]表示i所在的位置 int main() { int n, x; cin >> n; //除0外错位的数目 int cnt = 0; for (int i = 0; i < n; ++i) { cin >> x; pos[x] = i; if (pos[x] != x && x != 0) { ++cnt; ...
ALGO
0.999934
3.798212
a8cb75ab-5303-4a62-b39d-f1e5c225968c
Himanshukaushik8266/ModeenCPP
Week3/Practice/Promise_future_practice.cpp
#include<iostream> #include<future> #include<functional> int Consumer(std::future<int> &pr){ int *ptr=(int *)malloc(sizeof(int)); int answer=pr.get(); *ptr=answer*answer; // std::cout<<"Answer is : "<<*ptr<<std::endl; return *ptr; } int main(){ std::promise<int> promisedVariable; std:...
TOOL
0.989441
4.742468
82edf0a5-f1ff-4b20-9e27-841ad85530a2
leecher227/scriptdev2
scripts/northrend/naxxramas/boss_heigan.cpp
/* ScriptData SDName: Boss_Heigan SD%Complete: 0 SDComment: Place Holder SDCategory: Naxxramas EndScriptData */ #include "precompiled.h" #include "naxxramas.h" #define SAY_AGGRO1 -1533109 #define SAY_AGGRO2 -1533110 #define SAY_AGGRO3 -1533111 #define SAY_SLAY -1533112 #define SA...
TOOL
0.891302
5.189737
8f879fbc-585a-41d3-b38b-fdaf6bf00532
reum2y/YeoMinYoung-SCE-DS-2020SUMMER
day7_2_hard.cpp
#include <iostream> #include <vector> #include <string> using namespace std; class tree { public: int max(int a, int b) { return a > b ? a : b; } int depth(vector<vector<int>>& v, int start, int h) { if (v[start].size() == 0) return h; int d = 0; for (int...
ALGO
0.9999
4.235541
f7e292ac-7712-416a-bb59-51ed74cf4b3b
raincross7/code-similarity
codes/train_code/problem190/problem190_269.cpp
#include<stdio.h> #include<string.h> int main(){ int n; scanf("%d",&n); char arr[n+1]; scanf("%s",arr); int flag = 1; for(int i=0;i<(n/2);i++){ if(arr[i] != arr[i + (n/2)]){ flag = 0; } } if(n%2 != 0){ flag = 0; } if(flag == 1){ printf("Yes"); } else{ printf("No"); } return 0; }
ALGO
0.99999
3.113829
5378d243-c714-4652-a08a-39236545443b
AnasImloul/Leetcode-Solutions
scripts/algorithms/T/Two Furthest Houses With Different Colors/Two Furthest Houses With Different Colors.cpp
class Solution { public: int maxDistance(vector<int>& colors) { int Max = INT_MIN; int N = colors.size(); // find the first house from the end which does not match the color of house at front int j=N; while(--j>=0 && colors[0]==colors[j]) { } // worst-case O(n) ...
ALGO
0.998486
5.676026
361ec3e0-d5f2-4d91-9785-162fb1e706a7
vinhuchi/cp-chap-may-thang-nhoc
tinhoctre.vn/chuyentin/TIENAN.cpp
#include <bits/stdc++.h> using namespace std; // Type using LL = long long; // Functions #define IO(value) freopen(value".inp", "r", stdin); freopen(value".out", "w", stdout); #define FIO() \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define loop(x, start, end) for (int x = start; x < end; x+...
ALGO
0.999883
3.84582
3109f8b3-af14-4946-b43e-5c90f4931ac5
cormac-doyle/OpenGL-Facial-Animation
libraries/eigen-3.4.0/doc/examples/Tutorial_ArrayClass_cwise_other.cpp
#include <Eigen/Dense> #include <iostream> using namespace Eigen; using namespace std; int main() { ArrayXf a = ArrayXf::Random(5); a *= 2; cout << "a =" << endl << a << endl; cout << "a.abs() =" << endl << a.abs() << endl; cout << "a.abs().sqrt() =" << endl << a.abs().sqrt() << endl...
ALGO
0.977478
3.130341
9dbaeedb-081e-443f-98c1-813c03b68a10
sinian666/code_41_26
cpp_副本10/chapter_sorting/bubble_sort.cpp
/** * File: bubble_sort.cpp * Created Time: 2022-11-25 * Author: Krahets (<EMAIL>) */ #include "../utils/common.hpp" /* 冒泡排序 */ void bubbleSort(vector<int> &nums) { // 外循环:待排序元素数量为 n-1, n-2, ..., 1 for (int i = nums.size() - 1; i > 0; i--) { // 内循环:冒泡操作 for (int j = 0; j < i; j++) { ...
ALGO
0.999945
6.035518
13d83a17-df26-43cf-87c1-f61e15d24dad
Sohel440/gfg
Medium/Geek and its Game of Coins/geek-and-its-game-of-coins.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: bool wins(int n, int x, int y, std::vector<int>& dp) { if (n == 0) { return false; // If no coins are left, the current player loses } if (dp[n] != -1) { return dp[n];...
ALGO
0.999932
5.331182
ccb42254-98f4-4958-bb06-f80101842af0
tsunghuanghsieh/leetcode
problems/reorganize-string/Solution.cpp
#include <iostream> #include <map> #include <queue> #include <sstream> #include <string> #include <vector> using namespace std; class Solution { public: string reorganizeString(string s) { int maxChar = 0; vector<int> freq(26, 0); priority_queue<vector<int>> pq; stringstream ss; ...
ALGO
0.99998
5.649898
b0d14c26-b99c-47b8-adbb-3ab8f40d34ba
glerium/acm-life
codeforces/CF633B.cpp
#include <bits/stdc++.h> using namespace std; int main() { int m; cin >> m; int c2=0, c5=0; bool in = false; vector<int> ans; for(int i=1;;i++) { int ii = i; while(ii%2==0) { ii/=2; c2++; } while(ii%5==0) { ii/=5; c5++; ...
ALGO
0.999989
3.573887
5894c358-36b0-444a-a8a0-8919c7da9efc
iSenpo/Practice
Course/DP/B_Contiguous_Repainting.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int MOD = 1e9 + 7; const int N = 1e5 + 500; int a[N]; void solve() { } int main(){ ios::sync_with_stdio(false); cin.tie(NULL); /*-------------------------------------*/ int n , k; cin >> n >> k; vector<ll> postive(n + 1 , 0); ...
ALGO
0.999933
3.886846
23f1ba9e-0202-44ba-aa1d-d7c162c7ddd2
LizonuE/Irish_Classification
venv/lib/python3.9/site-packages/sklearn/svm/src/liblinear/tron.cpp
#include <math.h> #include <stdio.h> #include <string.h> #include <stdarg.h> #include "tron.h" #ifndef min template <class T> static inline T min(T x,T y) { return (x<y)?x:y; } #endif #ifndef max template <class T> static inline T max(T x,T y) { return (x>y)?x:y; } #endif static void default_print(const char *buf) {...
ALGO
0.99947
5.847107
ae02c452-f828-43c4-b326-ebba02268343
samarthshetty2000/Dsa
dsa-prac/pyramid.cpp
#include<iostream> using namespace std; int main(){ int i,j; for(i=4;i>=1;i--){ for(j=1;j<=i;j++) { cout<<"*"; } cout<<endl;}}
ALGO
0.999974
3.494859
0d416137-bc69-4465-a864-ffb016375b24
boxnos/codeforces
1213A/main.cpp
#include <cstdio> #include <utility> #include <cctype> #include <algorithm> using namespace std; #ifdef __linux #define _U(s) s##_unlocked #else #define _U(s) _##s##_nolock #define _CRT_DISABLE_PERFCRIT_LOCKS #endif #define gcu _U(getchar) #define pcu _U(putchar) #define _DEF(r, n, ...) inline r n(__VA_ARGS__) noexcep...
ALGO
0.999891
4.149452
1f16796e-d4bf-424a-a9d7-c7f7f68deb70
AngusRitossa/Heaps
Stoer-Wagner/strictfibonacci.cpp
// Stoer-Wagner's algorithm implemented with a strict fibonacci heap: O(ve + v^2 log v) #include <cstdio> #include <vector> #include <utility> #include <chrono> using namespace std::chrono; using namespace std; #define MAXN 500000 typedef long long ll; typedef struct HeapNode* pnode; typedef struct ActiveRecord* pactiv...
ALGO
0.999967
3.399448
fc92eb28-8533-4c7e-a827-a74aec4cbe81
adarshpandey327/DSA_Questions
ppt_assingnment_3/Q4.cpp
/* Question 4 Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You must write an algorithm with O(log n) runtime complexity. Example 1: Input: nums = [1,3,5,6], target = 5 Output: 2 */ #inclu...
ALGO
0.999944
6.141784
ce5ec32d-f462-4891-a5ba-627f03079a30
mmxsrup/procon
yukicoder/500/520/524.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vint; typedef pair<int,int> pint; typedef vector<pint> vpint; #define rep(i,n) for(int i=0;i<(n);i++) #define REP(i,n) for(int i=n-1;i>=(0);i--) #define reps(i,f,n) for(int i=(f);i<(n);i++) #define each(it,v) for(__typeof((v).begin(...
ALGO
0.999954
3.987795
381ea419-ca37-401b-8b0e-c6d8e7c4bb9e
rathena/rathena
src/common/utils.cpp
#include "utils.hpp" #include <cmath> // floor() #include <cstdlib> #include <cstring> #ifdef WIN32 #include "winapi.hpp" #ifndef F_OK #define F_OK 0x0 #endif /* F_OK */ #else #include <unistd.h> #include <dirent.h> #include <sys/stat.h> #endif #include "cbasetypes.hpp" #include "showmsg.hpp" #include "so...
TOOL
0.890139
4.922143
39eca780-3ec2-4efe-92fd-2989b007bc1f
42somoim/42somoim5
gim/week_2/11054.cpp
#include <iostream> #include <cstdio> #include <algorithm> using namespace std; int main(void) { int inc[1001] = {0}; int dec[1001] = {0}; int arr[1001]; int N, result = 0, flag; scanf("%d", &N); for (int i = 0; i < N; i++) scanf("%d", &arr[i]); for (int i = 0; i < N; i++) { ...
ALGO
0.999821
4.125036
667edc60-d672-489e-9fdd-6372356a7463
dhnesh12/codechef-solutions
03-CodeChef-Medium/121--Arigeom Beats.cpp
#include <bits/stdc++.h> #define MOD 1000000007 #define EPS ((long double)1e-12) #define ll long long #define ld long double #define ull unsigned long long #define pb push_back #define mp make_pair #define mt make_tuple #define F first #define S second #define sz(x) ((long long)(x).size()) #define endl '\n' #define DUM...
ALGO
0.999852
3.290329
b6a8f5cd-34d0-4866-a6a8-00f57653e9ab
KappaDistributive/advent_of_code
cpp/src/2021/day_13.cpp
#include "../utils/geometry.hpp" #include "../utils/input.hpp" using Point = utils::geometry::Point<int, 2>; auto prepare_input(const std::vector<std::string>& input) { std::vector<Point> coordinates; std::vector<Point> folds; bool parsing_coords{true}; for (auto line : input) { if (line == "") { pa...
ALGO
0.997861
6.780096
6626e452-4df8-4850-9566-91517cc40be9
SHAIMA-HAQUE/LeetCode-Solve
112-path-sum/112-path-sum.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.999959
6.466403
92b609c8-b920-45b4-91b4-39076fd0b348
mstrommer/ALDA_Exercise6v12022
main.cpp
#define CATCH_CONFIG_RUNNER #define TEST 1 // Always change to 1 before your final submission to Github Classroom. #include "lib/catch.hpp" #include <stdlib.h> #include "sort.hpp" // DO NOT CHANGE THIS METHOD int runCatchTests(int argc, char* const argv[]) { return Catch::Session().run(argc, argv); } void print_s...
ALGO
0.976545
4.600662
cfeb9c50-0d91-4719-a81b-e47c4a6b4ace
BigSecret1/leetcode
standard-problems/topological_sort.cpp
void Dfs(int node) { if(mark[node]) return; mark[node] = true; for(auto it : edge[node]) { if(mark[it] == 1) continue; Dfs(it); } stk.push(node); } for(int i = 0; i < n; ++i) { if(mark[i] == false) Dfs(i); }
ALGO
0.998982
4.450824
84e6f182-68ab-463c-b894-b3fab748806f
Grdsznt/DMOJ-Solutions
USACO2024JanuarySilverP1Cowmpetency.cpp
#include <bits/stdc++.h> #include <iostream> using namespace std; /* TYPES */ #define ll long long #define pii pair<int, int> #define pll pair<long long, long long> #define vi vector<int> #define vll vector<long long> #define mii map<int, int> #define si set<int> #define sc set<char> /* INPUTS */ #define scan(x) do{...
ALGO
0.999933
3.977846
6dc492cd-ffa9-470d-8937-831fbb00965e
orphaelius/C-Learning-Exercises-
Ch2/2.27summingDigitsofInt.cpp
#include <stdio.h> // Write a program that inputs one 4-digit number, sums each of the individual digits, and displays the result. Use division and remainder operator). // HINT: Use division and remainder operator. i.e., 3 + 5 + 8 + 1 = 17 int main(void) { // initialize variable int initial_dig = 0; // request ...
ALGO
0.999397
5.124354
9bdea49b-51fc-4035-9986-e547a2af0a48
beelisais2793/FX
Synthesizer/Waves/Oscillators/NOISE/noise/RainbowNoise/src/Shuffling/UniformFairKernelSize.cpp
/* UniformFairKernelSize.cpp Li-Yi Wei 06/09/2009 */ #include "UniformFairKernelSize.hpp" #include "Math.hpp" UniformFairKernelSize::UniformFairKernelSize(const vector<float> & domain_size, const vector<int> & num_samples_per_class) : UniformKernelSize(domain_size, num_samples_per_class) { // nothing els...
ALGO
0.98017
6.219386
4bd3ab9e-f3b5-499c-9100-850b08cee26a
tlarbals824/study
algorithm/2chapter/41.cpp
#include<stdio.h> #include<algorithm> #include<vector> using namespace std; int main(){ int num; scanf("%d",&num); int count=2; int size=0; for(;;){ int sum=0; for(int i=0;i<count;i++){ sum+=(i+1); } if(sum>num) break; if((num-sum)%count==0){ size++; for(int i=0;i<count;i++){ printf("%d ",i+...
ALGO
0.999961
3.139183
d19eaf8d-036f-437e-897f-8a12103afaba
Team-AlgorithmStudy/AlgorithmStudy
현우/세 수,두 M.cpp
#include<iostream> #include<vector> #include<algorithm> #include<math.h> using namespace std; int n; vector<long long>ar; int main() { cin >> n; for (int i = 0; i < n; i++) { long long a; cin >> a; ar.push_back(a); } sort(ar.begin(), ar.end()); long long ans = 0; for (int i = 0; i < n - 2; i++) { long lon...
ALGO
0.999929
3.757096
598eef60-1222-4143-973a-d5f5332bbe2d
shilpiroy98/codeforces
implementation-problems/1185E.cpp
#include <cmath> #include <iostream> #include <vector> #include <algorithm> #include <string> #include <stack> #include <set> #include <map> #include <list> #include <time.h> #include <math.h> #include <random> #include <deque> #include <queue> #include <cassert> #include <unordered_map> #include <iomanip> #include <bi...
ALGO
0.999837
3.55722
e12ac2d8-6c0c-4404-a101-ae9bf4dee74f
awerty1/basics_C_plus_plus_programming
14 variant/lab1.2.cpp
/* Задание 2. Вводятся два целых трехзначных числа. Вывести произведение центральных цифр этих чисел. Например, для 657 и 421 произведение будет равно 10. */ #include <iostream> int getCentralDigit(int number) { return (number / 10) % 10; } int main() { int number1, number2; int digit1, digit2; ...
ALGO
0.99984
6.497305
9a08ca16-14ff-471c-ba51-43bc82ffa3d1
PiyushPachare/Coding
LinkedList/intersect.cpp
#include<iostream> using namespace std; //Node Structure class node{ public: int data; node* next; node(int val){ data=val; next=NULL; } }; void insertAtTail(node* &head,int val){ node* n = new node(val); if(head == NULL){ head=n; ...
ALGO
0.999875
4.520892
f6ae8073-a1b7-4a77-a2fd-7ba22fd3bddf
Tiagosf00/Competitive-Programming
C++/Math/pollard_rho.cpp
ll mul(ll a, ll b, ll m) { ll ret = a*b - (ll)((ld)1/m*a*b+0.5)*m; return ret < 0 ? ret+m : ret; } ll pow(ll a, ll b, ll m) { ll ans = 1; for (; b > 0; b /= 2ll, a = mul(a, a, m)) { if (b % 2ll == 1) ans = mul(ans, a, m); } return ans; } bool prime(ll n) { if (n < 2) re...
ALGO
0.999907
4.747203