uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
4eedfca3-6135-46aa-b334-e0b9b886df85
jun-pac/PS
241005/4set/C.cpp
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define cediv(a,b) ((a)%(b)==0?((a)/(b)):((a)/(b))+1) #define rng(i,a,b) for(int i=int(a);i<=int(b);i++) #define rep(i,b) rng(i,0,b-1) #define gnr(i,b,a) for(int i=int(b);i>=int(a);i--) #define per(i,b) gnr(i,b-1,0) #define pb push_back...
ALGO
0.999927
4.874244
5ebd1438-ccdb-4ab7-bfdf-4dbef237f136
nxp-imx-android/aosp_platform_frameworks_av
media/libmedia/StringArray.cpp
// // Sortable array of strings. STL-ish, but STL-free. // #include <stdlib.h> #include <string.h> #include <media/StringArray.h> namespace android { // // An expanding array of strings. Add, get, sort, delete. // StringArray::StringArray() : mMax(0), mCurrent(0), mArray(NULL) { } StringArray:: ~StringArray(...
TOOL
0.971086
6.43154
cce71732-cd1c-44b5-9848-2d01837b95e7
satakratu6/DSA-Practice
LinkedList/singlylinkedlist.cpp
#include <iostream> using namespace std; // Define a Node structure struct Node { int data; Node *next; Node(int value) { data = value; next = NULL; } }; // Traversal void traverse(Node *head) { Node *current = head; while (current != NULL) { cout << current->da...
ALGO
0.999731
5.417186
5dc62b2d-5ff9-4b4f-beed-d1a42d8ebd6a
neuroimaginador/utils4ni
src/extend_labels.cpp
#include "BinaryHeapLabel.h" // #include "pointers_neighborhoods.h" #include <memory.h> #include <math.h> #include <Rcpp.h> using namespace Rcpp; #define INF 10000000 enum state {DEAD, ACTIVE, INACTIVE, BOUNDARY, SEED}; // [[Rcpp::export]] IntegerVector extend_labels(IntegerVector pIn, IntegerVector maskImage) { ...
ALGO
0.999253
4.077235
0a9a0f31-cc2f-4f96-929f-c9d0085bd7ae
Chbharath002/dsa-assignment02
As02question10.cpp
#include <iostream> #include <string> using namespace std; string shortestCommonSupersequence(string str1, string str2) { int m = str1.length(); int n = str2.length(); int dp[m+1][n+1]; for(int i=0; i<=m; i++) { for(int j=0; j<=n; j++) { if(i==0 || j==0) dp[i][j] = ...
ALGO
0.999816
4.471994
6cd2c221-8b8f-4523-8aeb-70be5c89ada0
yaman-694/DS
stacks and queue/circular_queue.cpp
#include <bits/stdc++.h> using namespace std; class Cqueue{ int arr[5]; int start,rear; public: Cqueue(){ start=0; rear=1; } void enqueue(int data){ if(rear==5){ cout<<"Full\n"; return; } else{ arr[rear]; ...
ALGO
0.994407
4.539708
fc8758ec-1896-4aef-8969-75f94e8ddc07
FIngerFrings/leetcode
Easy/leetcode707.cpp
/* * 设计链表的实现。您可以选择使用单链表或双链表。单链表中的节点应该具有两个属性:val 和 next。val 是当前节点的值,next 是指向下一个节点的指针/引用。如果要使用双向链表,则还需要一个属性 prev 以指示链表中的上一个节点。假设链表中的所有节点都是 0-index 的。 * 在链表类中实现这些功能: * get(index):获取链表中第 index 个节点的值。如果索引无效,则返回-1。 * addAtHead(val):在链表的第一个元素之前添加一个值为 val 的节点。插入后,新节点将成为链表的第一个节点。 * addAtTail(val):将值为 val 的节点追加到链表的最后一个元素。 ...
ALGO
0.9997
5.508541
b5489e39-84ef-4e74-851e-b09b531ac2cd
DivNai/C-programming-
find the missing number in the array.cpp
#include <bits/stdc++.h> using namespace std; void findMissing(int arr[], int N){ int i; int temp[N + 1]; for(int i = 0; i <= N; i++){ temp[i] = 0;} for(i = 0; i < N; i++){ temp[arr[i] - 1] = 1; } int ans; for (i = 0; i <= N ; i++) { if (temp[i] == 0) ans = i...
ALGO
0.999929
3.721459
ab466826-9a1f-48ce-911b-cb92bfc0a09c
kanhaiyabaranwal/my-programs-old
CPP_source_programs-Microsoft/MinimumNumberOfCoinsthatmakeagivenvalue.cpp
#include<iostream> #include<algorithm> using namespace std; //Find minimum number of coins that make a given value FindMin(int coins[],int m,int V) { int table[V+1]; sort(coins,coins+4); for(int i=0;i<m;i++) cout<<coins[i]<<","; cout<<endl; for(int i=1;i<=V;i++) { table[i]=INT_MAX; } table[0]=0; for(int...
ALGO
0.999823
4.221601
3be7be16-c48f-4e59-999d-9c0acb5d2064
smartel99/opengl
Dependencies/opencv/sources/modules/core/src/opencl/runtime/opencl_clamdfft.cpp
#include "../../precomp.hpp" #ifdef HAVE_CLAMDFFT #include "opencv2/core/opencl/runtime/opencl_core.hpp" #include "opencv2/core/opencl/runtime/opencl_clamdfft.hpp" #if defined(_WIN32) #include <windows.h> static void* WinGetProcAddress(const char* name) { static HMODULE opencl_module = NULL; ...
ALGO
0.852854
6.39067
7de5cf32-b78b-4525-9f15-8d295b6af14e
relcodego/relcodego
bookcode/algorithm/Data-Structure-master/GetNumberOfK.cpp
#include <cstdio> int FindFirstOfK(int* data, int length, int k, int start, int end) { if(start > end) return -1; int middle = (start + end) / 2; int middleData = data[middle]; if(middleData == k) { if((middle > 0 && data[middle-1] != k) || middle == 0) return middle; else end = middle - 1; } else ...
ALGO
0.999897
4.580182
302bfc89-be31-4b99-9fc7-0a431b505f79
codewithAkash1326/DSA_IN_CPP
LinkedList/insertLast.cpp
#include<bits/stdc++.h> using namespace std; class Node{ public: int data; Node* next; Node(){ this->data=0; this->next=NULL; } Node(int data){ this->data=data; this->next=NULL; } }; void print(Node* head){ Node* temp = head; while(temp!=NULL){ ...
ALGO
0.998941
4.619312
c3dad156-1de0-4c4b-b048-5bbe7790dc26
pathakshrikant26/C-
Graph Standard Problems/connectedComponentInUndirectd.cpp
#include <bits/stdc++.h> using namespace std; class Graph { int V; list<int> *adj; void dfsutil(int v, bool visited[]); public: Graph(int V); void addedge(int v, int w); void connectedComponents(); }; void Graph::connectedComponents() { bool *visited = new bool[V]; for (int i = 0;...
ALGO
0.999645
5.505578
e26ac6d2-e140-4f4d-9593-cfa107c52c2c
maboulho/cpp-pool
CPP09/ex02/main.cpp
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* main.cpp :+: :+: :+: ...
ALGO
0.989872
5.139713
c221fa9a-485a-4d94-9a8f-b9844c6f1fd5
AutomotiveNegotiation1/-K-AutoDrivingLocalization
src/positioning/matlab/Positioning_Alg_20231004/codegen/lib/UWBpos6/combineVectorElements.cpp
// Include Files #include "combineVectorElements.h" #include "rt_nonfinite.h" #include "coder_array.h" // Function Definitions // // Arguments : const ::coder::array<creal_T, 3U> &x // Return Type : creal_T // namespace coder { creal_T combineVectorElements(const ::coder::array<creal_T, 3U> &x) { creal_T y; if...
ALGO
0.963084
5.014924
f57d4f6e-0dff-4fee-8544-451432c8818d
KavyaV00/Interview-Preparation
Dynamic Programming/lcs.cpp
#include <iostream> #include <string> #include <cstring> #include <algorithm> using namespace std; int dp[10][10]; int t[10][10]; int lcs(string x, string y, int n, int m) { if(n==0 || m==0) { return 0; } if(dp[n][m]!=-1) return dp[n][m]; if(x[n-1]==y[m-1]) { dp[n][m]=1+lcs(x,...
ALGO
0.999976
4.073834
6f8548e3-49d8-4b85-b7bf-08c6d13181ff
ssjf409/PS
동적계획법/117262xn타일링.cpp
#include <iostream> #include <vector> using namespace std; int n; vector<int> cache; int tiling(int index) { if(n - 1 == index) return 1; if(n - 2 == index) return 2; int& ret = cache[index]; if(ret != -1) return ret; ret = (tiling(index + 1) + tiling(index + 2)) % 10007; return ret; } in...
ALGO
0.999959
5.214564
a13448b7-328e-4390-b745-f566bf444383
ithsarasak/Programming
Compettitive programming/ALL OI/COCI/2014/utrka.cpp
#include <bits/stdc++.h> using namespace std; map<string,int> mp, mp2; int n; int main() { scanf("%d",&n); for( int i = 1 ; i <= n ; i++ ) { string s; cin >> s; mp[s]++; } for( int i = 1 ; i < n ; i++ ) { string s; cin >> s; mp2[s]++; } for( aut...
ALGO
0.999843
3.157079
ce6a8e0d-fbac-4d10-8e6f-a0a428ee74ff
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_2239_20.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long d1, d2, d3; cin >> d1 >> d2 >> d3; cout << min(min((2 * d1 + 2 * d2), (d1 + d2 + d3)), min((2 * d1 + 2 * d3), (2 * d2, 2 * d3))); return 0; }
ALGO
0.999782
4.223541
c205476d-a6df-4e31-b756-7ddd25aa8be1
bingleilou/fSEAD
fpga/hls/xstream_e20/shuttle/C5/xstream_shuttle_E20C5.cpp
#include "xstream_shuttle_E20C5.h" void windower(interface_t data, interface_t X0[DIM_MAX],interface_t X1[DIM_MAX],interface_t X2[DIM_MAX],interface_t X3[DIM_MAX],interface_t X4[DIM_MAX],interface_t X5[DIM_MAX],interface_t X6[DIM_MAX],interface_t X7[DIM_MAX],interface_t X8[DIM_MAX],interface_t X9[DIM_MAX],i...
ALGO
0.991591
4.226057
4d2e28ae-7f1c-4951-81be-f113d5b7263a
mukhfakhruddin/app_pengumpulan_data
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.998809
6.763549
235f7a72-d2a2-49de-bc1e-00ff6ac41b38
RedPandaProjects/RedSource
src/Utils/Bullet/src/BulletCollision/CollisionShapes/btTetrahedronShape.cpp
#include "btTetrahedronShape.h" #include "LinearMath/btMatrix3x3.h" btBU_Simplex1to4::btBU_Simplex1to4() : btPolyhedralConvexAabbCachingShape (), m_numVertices(0) { m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE; } btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0) : btPolyhedralConvexAabbCachingShape (), m_numVert...
TOOL
0.886409
6.559873
fdbf1e17-68f1-4266-aef2-b69993fdf823
jayjaisswal/Data-Structure
DSA Using cpp/DSA Revision/Recursion/Part 2/1Fibonacci.cpp
#include <iostream> using namespace std; // as calling two times so TC=O(n) too bad int fibonacci(int n) { if(n==1 || n==2) return 1; int leftAns = fibonacci(n-1); int rightAns = fibonacci(n-2); return leftAns+ rightAns; } int main() { cout << "Enter Nth Number" << endl; int x; cin >> x; ...
ALGO
0.99993
4.878307
0d11db21-cfec-4f3f-9bc2-080fa423a0ba
sambler/myblender
extern/bullet2/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp
#include "btSphereSphereCollisionAlgorithm.h" #include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h" #include "BulletCollision/CollisionShapes/btSphereShape.h" #include "BulletCollision/CollisionDispatch/btCollisionObject.h" #include "BulletCollision/CollisionDispatch/btCollisionObjectWrapper.h" btSphere...
ALGO
0.999278
6.541942
36f15b85-cbb2-4719-9534-df3717f75eb0
skyrpex/Flatty-Dev
src/mathhelper.cpp
#include "mathhelper.h" #include <cmath> qreal Math::modulo(qreal a, qreal b) { return std::fmod(a, b); } qreal Math::angleDifference(qreal a, qreal b) { return modulo(modulo(a - b, 360.0) + 540.0, 360.0) - 180.0; } qreal Math::normalizedAngle(qreal angle) { angle = modulo(angle, 360.0); if(angle < 0.0) ...
TOOL
0.872927
5.85652
6039e9da-a82b-4e11-b94c-2d97a41217e1
ishandutta2007/codeforces
kalptaru/normal/1343/C.cpp
#include <bits/stdc++.h> #include <string> #include <cmath> #include <sstream> #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define FORD(i, a, b) for(int i = (a); i > (b); i--) #define pb(a) push_back(a) #define mp(a,b) make_pair(a,b) typedef long long int ll; using namespace std; ll mod=1000000007; //ll mod=67...
ALGO
0.999973
4.475359
f20ad456-727d-4a79-9e1b-b402b3867f13
ishandutta2007/codeforces
davidlee1999wtk/normal/1667/A.cpp
#include<cstdio> #include<iostream> #include<algorithm> #include<cstring> #include<cmath> #include<vector> #include<queue> #include<map> #include<set> #include<stack> #include<cstdlib> #include<string> #include<bitset> #define INF 1000000000 #define N 100005 #define fi first #define se second #define debug(x) cout<<#x<...
ALGO
0.999987
3.177335
8288d198-ec08-4bbc-9c4e-a8f78bb3a117
ishandutta2007/codeforces
ngfam/normal/535/A.cpp
#include <bits/stdc++.h> using namespace std; string num[900] = { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"}; string root[10] = {"twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety", "ten"}; void out(string ans){ cout << ans; } int main(){ #ifndef ONLI...
ALGO
0.997631
5.422837
4956c1ac-ed8a-43b3-bb52-0562b9a604cf
AryanRai/StarSim
ParsecCore/src/parsec/EquationManager.cpp
#include "parsec/EquationManager.h" #include <stdexcept> #include <iostream> #include <sstream> #include <set> namespace parsec { // Helper to trim whitespace std::string trim(const std::string& str) { size_t first = str.find_first_not_of(" \t\n\r"); if (std::string::npos == first) { return str; }...
ALGO
0.989682
7.320234
c7bade06-66a6-4bc8-9f3c-fcdf5d0cdf51
nsskvkn/Programming-Fundamentals-1
labs/1.7/random_generator_inside_func.cpp
// Static Local Variable Example: Random Number Generator Seed #include <iostream> #include <cstdlib> #include <ctime> int getRandomNumber() { static bool initialized = false; // Static variable to track initialization if (!initialized) { srand(time(0)); // Seed the random number generator only once...
ALGO
0.969366
6.093869
9078d76f-f0be-4c78-a51b-b712fc38798d
bastamon/Cpp-Standard-library-development-guide-V2
ch13/Ex13-25/Ex13-25/Ex13-25.cpp
// Ex13-25.cpp : Defines the entry point for the console application. // #include <iostream> #include <functional> #include <algorithm> #include <vector> using namespace std; struct B{ virtual int f(int x)const=0; }; struct D :public B{ int val; D(int x) : val(x) { } int f(int x)const { return val+x; } }; vo...
ALGO
0.980844
5.0586
35c12dc6-3d4e-44b0-9649-d295d343d87f
CodeFish99/PAT
B1028.cpp
#include<bits/stdc++.h> using namespace std; bool judge(int y,int m,int d){ if(y>2014||(y==2014&&m>9)||(y==2014&&m==9&&d>6)||y<1814||(y==1814&&m<9)||(y==1814&&m==9&&d<6)){ return false; } return true; } int main(){ int oldY=2015,oldM=13,oldD=40,youY=1800,youM=-1,youD=-1,y,m,d,n,count=0; string oldname,youname,na...
ALGO
0.991787
3.807063
aa77923e-71d5-418a-b7db-4a62cc3aeba9
Karunesh1124/IS-practical
Q_5 Playfair Cipher.cpp
#include<iostream> #include<string> #include<vector> #include<map> using namespace std; int main(){ int i,j,k,n; cout<<"Enter the message"<<endl; string s,origin; getline(cin,origin); cout<<"Enter the key"<<endl; string key; cin>>key; for(i=0;i<origin.size();i++){ if(origin[i]!='...
ALGO
0.999994
3.309908
57c1e734-e99e-4374-8a9d-0571885bcac8
UangoWW/Cpp-Study-Neo
[P1111]修复公路.cpp
#include <iostream> #include <algorithm> #include <cstring> #include <cstdio> using namespace std; typedef long long ll; int fa[100005],n; struct road{ int x,y,t; }r[100005]; int getfa(int u){ if(fa[u]==u||fa[u]==0) return fa[u]=u; return fa[u]=getfa(fa[u]); } void merge(int u,int v){ if(getfa(u)!=getf...
ALGO
0.999823
3.935868
754e3557-8acd-435d-961a-4b376c04307e
mirinta/leet_code
dynamic_programming/game_theory/0877_stone_game.cpp
#include <array> #include <vector> /** * Alice and Bob play a game with piles of stones. There are an even number of piles arranged in a * row, and each pile has a positive integer number of stones piles[i]. * * The objective of the game is to end with the most stones. The total number of stones across all * the ...
ALGO
0.999984
5.990626
21c52f57-81ec-4bb6-9c68-c20d973adae1
ArtemMaslov/SSE-optimizations
Mandelbrot/AlphaBlending.cpp
#include <assert.h> #include <emmintrin.h> #include <smmintrin.h> #include "Mandelbrot.h" #include "TXLib.h" #include "FileIO.h" ///***///***///---\\\***\\\***\\\___///***___***\\\___///***///***///---\\\***\\\***\\\ ///***///***///---\\\***\\\***\\\___///***___***\\\___///***///***///---\\\***\\\***\\\ const size...
ALGO
0.963475
4.51151
bd5af12f-a60d-4a39-a8cf-a026ae4063da
Tanvir-Mahamood/Competitive-Programming
Algorithm/Subarray/2.cpp
//Number of sub-array having sum divisible by d #include <bits/stdc++.h> using namespace std; #define nn "\n" #define ll long long #define ull unsigned long long #define yes cout<<"YES\n" #define no cout<<"NO\n" #define mod 1000000007 void solve() { ll d, n, i, val, cnt = 0, sum = 0; cin >> d >> n; ma...
ALGO
0.999865
3.970795
eaa61551-84d1-4af3-a4bb-c9ed71d7c456
abhaypatidar3/faaltu-codes
lect44/kunj.cpp
#include<bits/stdc++.h> using namespace std; bool moist() { cout<<"is there a moist?"<<endl; string s; cin>>s; if(s=="yes" || "yes") { return 1; } else { return 0; } } void surveymotor() { cout<<"rotating survey motors to 90 degree upward"; } int main() { int...
ALGO
0.993213
3.09204
039af814-ceba-4c5f-a4d5-d5bfde066645
Arvy1998/Calculus-and-Play-with-New-Syntax
Numeric Problem Nr. 4.cpp
/* You are given an N x M size grid where N is the number of rows and M is the number of columns. Your task is to calculate in how many ways you can go from the upper-left corner to the bottom-right corner if you can only move down and to the right. Input: The input consists of two space-separated integers N and M ...
ALGO
0.999982
5.023696
67aea63b-1b91-4404-95dd-40785821b9b5
michaelwro/HummingbirdFCU
src/maths/math_functs.cpp
// ---------------------------------------------------------------------------- // EXTRA MATH FUNCTIONS // // Code By: Michael Wrona | B.S. Aerospace Engineering // Created: // ---------------------------------------------------------------------------- /** * Extra math functions such as fast square root, 'safe' tri...
ALGO
0.980646
6.933281
cbd10e13-b782-4bb4-90c7-5e3937d071f4
Katya0208/OS_MAI
lab3/program/func.cpp
#include "func.h" int sum_numbers(char input_nums[100]) { int sum = 0; int numbers[100]; int count = 0; char* token = strtok(input_nums, " "); while (token != NULL && count < 100) { numbers[count] = atoi(token); // Convert string to integer count++; token = strtok(NULL, " "); } for (int num ...
ALGO
0.957659
4.228268
0d015b63-4fdf-4e09-b786-edfacd40660c
LnG-a/btvn
week1/bai27.cpp
#include <iostream> #include <cmath> #include <iomanip> #include <algorithm> using namespace std; int main() { int n = 0; cin >> n; while (n != -1) { if (n % 5 == 0 && n >= 0) cout << n / 5 << endl; else cout << -1 << endl; if (n == -1)cout << "Bye"; cin >> n; } return 0; }
ALGO
0.999878
4.412987
d957109c-09d8-49ad-9902-3d49c93d94d6
prakhar-deb/DSA
0075-sort-colors/0075-sort-colors.cpp
class Solution { public: void sortColors(vector<int>& nums) { int zeroes=0,ones=0,twos=nums.size()-1; while(ones<=twos){ if(nums[ones]==2){ swap(nums[ones],nums[twos]); twos--; } else if(nums[ones]==0){ swap(nums[ones...
ALGO
0.999869
5.900601
17909f9f-66dd-4223-9560-ae81dd416ccb
dongchen-coder/locapo
trace_src/symm_ref_arr.cpp
#include "../utility/rt.h" #include "../utility/data_size.h" #ifdef ORG #define M 1024 #define N 1024 #elif defined(TX) #elif defined(FX) #elif defined(EX) #endif #define A_OFFSET 0 #define B_OFFSET M * M #define C_OFFSET M * M + M * N void symm_trace(double* A, double* B, double* C, double alpha, double beta) {...
ALGO
0.998307
3.50597
901cf14e-0a03-4be7-b101-04cd7255e58c
shyam640/Data-Structure-and-Algorithm
codechef/Starter 32/FLIPSORT.cpp
#include<bits/stdc++.h> using namespace std; #define li long int #define lf long float #define ld long double #define lli long long int #define llf ...
ALGO
0.999711
3.686209
e8007897-904c-4af1-a587-408ac3d20dcf
allanlaal/firefox
intl/icu/source/i18n/numparse_decimal.cpp
#include "unicode/utypes.h" #if !UCONFIG_NO_FORMATTING // Allow implicit conversion from char16_t* to UnicodeString for this file: // Helpful in toString methods and elsewhere. #define UNISTR_FROM_STRING_EXPLICIT #include "numparse_types.h" #include "numparse_decimal.h" #include "static_unicode_sets.h" #include "num...
TOOL
0.870895
7.728786
1c68f56d-25fd-4649-bbaf-d7136aca192a
shitan198u/Solving-Problems
codeforces_aug20_.cpp
#include <bits/stdc++.h> using namespace std; int main() { int samples; cin >> samples; while (samples--) { unsigned int n; long long unsigned int i; long long unsigned int k,b,s; long long unsigned int sum; cin>>n>>k>>b>>s; long long unsigned int last=b*k+k-1; long long unsi...
ALGO
0.999354
3.096489
694b7bbe-b517-4742-9c9e-8def056beac6
didrlgus/algorithm-practice
programmers/level2/s8.cpp
// 쇠막대기 #include <string> #include <vector> #include <stack> using namespace std; // '(' 입력 시 스택에 추가 // ')' 입력 시 이전 값이 '(' 이면 레이저, ')'이면 막대기의 끝 // -> '('이면 pop 수행 후 + 스택의 크기 // -> ')'이면 pop 수행 후 +1 int solution(string arrangement) { int answer = 0; stack<char> s; s.push('('); for(int i=1;i<arrangem...
ALGO
0.997627
4.615962
2ad25712-2df6-471b-9efe-0edd1bd6a46f
trongvan245/ICPC-FieryFireFly-Journal
2023/17_09_2023/I.cpp
// Hello I'm Nekan // #include <bits/stdc++.h> #define Nekan "test" #define fi first #define se second #define pb push_back #define zs(v) ((int)(v).size()) #define BIT(x, i) (((x) >> (i)) & 1) #define pii pair<int, int> typedef long double ld; typedef long long ll; const int N = 1e5 + 5; const long long mod = 1e9 + 7...
ALGO
0.999829
5.151935
bcb4ad81-8ad6-41d6-bb33-1b5707f39cd7
abhinav-nayak/DSA
11. Two-Integer-Sum-II.cpp
// Problem: https://neetcode.io/problems/two-integer-sum-ii?list=neetcode150 // Hints that this is two-pointer problem and not hashing: // 1. It is mentioned "Your solution must O(1) additional space.". Hashing uses O(n) space. // 2. The input array is sorted. // A strong clue that the problem can be solved using t...
ALGO
0.999965
6.620861
d0f6c953-73f8-41bb-a546-fcb6aae13214
shelltdf/osgall
prebuild/cgal-master/BGL/examples/BGL_surface_mesh/write_inp.cpp
#include <CGAL/Simple_cartesian.h> #include <CGAL/Surface_mesh.h> #include <CGAL/boost/graph/io.h> #include <iostream> #include <fstream> #include <boost/graph/connected_components.hpp> typedef CGAL::Simple_cartesian<double> Kernel; typedef Kernel::Point_3 ...
ALGO
0.905216
3.651927
9ba34c19-39c0-4450-bf2b-770972b5f6d9
prprprpony/oj
cf/666A.cpp
#include <bits/stdc++.h> using namespace std; // nichijou #define REP(i,s,e) for (int i = (s), __e = (e); i < __e; ++i) #define RP(i,n) REP(i,0,n) #define PER(i,s,e) for (int i = (s) - 1, __e = (e); i >= __e; --i) #define PR(i,n) PER(i,n,0) #define DO(n) REP(__i,0,n) template<typename T> void cmax(T & a, T b) {a = max(...
ALGO
0.999934
3.269952
23ac0958-e7f8-458e-b022-8de366923cc7
azizcanakkaya/cse241-projects
PS12/main_2.cpp
#include <iostream> #include <string> using namespace std; int getProductID( int ids[], string names[],int numProducts, string target){ try{ for ( int i=0; i < numProducts; i++){ if (names[i] == target) return ids[i]; } throw -1; }catch( int error ){ ...
ALGO
0.932371
5.544564
2596e349-7f6b-4792-956b-970975e80158
EylonNaamat/SS_b_Ex6
Schedule.cpp
// // Created by eylon on 6/14/22. // #include "Schedule.hpp" namespace ariel{ void Schedule::play(){ if(this->period == 20){ std::vector<Team*> tmp = this->home; this->home = this->away; this->away = tmp; this->period++; }else{ for(int i ...
TOOL
0.929767
3.135398
c011e6df-4ef6-4969-8a97-d7c09da1814d
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/Phi/top0-100/earliest-second-to-mark-indices-ii-Solution.earliestSecondToMarkIndices/177796_Overflow.cpp
static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, char **target) { uint32_t data[1024]; uint32_t *p; uint32_t len; struct packet *nfs_packet; /* * struct READLINK3args { * nfs_fh3 symlink; * }; * * struct READLINK3resok { * post_op_attr symlink_attributes; * nfspath3 d...
ALGO
0.991551
4.120367
2df82afe-8495-4138-97ff-bedeff0c7617
jiachengxu/oj
acwing/717.cpp
#include <algorithm> #include <cstring> #include <iostream> using namespace std; int main() { int n, tmp; cin >> n; int a1 = 0, a2 = 1; for (int i = 0; i < n; i++) { cout << a1 << " "; tmp = a1; a1 += a2; a2 = tmp; } return 0; }
ALGO
0.999956
3.16156
49815852-f62c-4c2c-ad5a-f197dd0ae95f
didislimm/labs2B
7/7_2/7_2/7_2.cpp
#include <iostream> #include <ctime> #include <iomanip> #include <stdlib.h> using namespace std; int** get_memory1(int n) { int** array = new int*[n]; for (int i = 0; i < n; i++) array[i] = new int[n]; return array; } void free_memory (int **array, int n) { for (int i = 0; i < n; i++) delete...
ALGO
0.99971
3.726828
65d53e2d-6bf7-4446-9517-a67e08371c8d
kazi-nayeem/Programming-Problems-Solutions
yandex/Qualification Round 2018/A.cpp
//#include <bits/stdc++.h> #include<cstdio> #include<cstring> #include<cctype> #include<cmath> #include<cstdlib> #include<iostream> #include<string> #include<algorithm> #include<vector> #include<stack> #include<queue> #include<set> #include<map> #include<bitset> #include<complex> using namespace std; typedef long lo...
ALGO
0.999619
3.354921
b2926683-79b6-446d-b49a-f2fd484d1b83
NikhilRaj-25/Owl-Coder
Count possible ways to construct buildings.cpp
//GFG int TotalWays(int n) { // Code here int a=2,b=3; long long c; int mod=1e9+7; if(n==1) return a*a; else if(n==2) return b*b; else{ n-=2; while(n--){ c=a+b; c=c%mod; a=b; b=c; } return (1LL*c*c)%mod; } }
ALGO
0.999989
5.013039
41f4b5a6-abfa-466d-854a-ff1afbcc24fe
rasibn/competitive-programming
OTHER_SOURCES/CP_BOOK_PRACTICE/coin.cpp
#include <cstdint> #include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> prev(n + 1); vector<int> counts(n + 1); counts[0] = 0; vector<int> coins = {1, 3, 4}; for (int x = 1; x <= n; x++) { counts[x] = INT32_MAX; for (auto &c : coins) { if (...
ALGO
0.99996
4.063128
7fcc9273-0ba0-4d05-b1f8-47e84939c32b
huangallen2008/cppcode
code/TCIRC/d102/d102.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define int ll #define FOR(i,a,b) for(int i=a;i<b;i++) #define REP(i,n) FOR(i,0,n) #define REP1(i,n) FOR(i,1,n+1) #define RREP(i,n) for(int i=n-1;i>=0;i--) #define f first #define s second #define pb push_back #define ALL(x) x.begin(),x.end() #define SZ(...
ALGO
0.999974
3.82675
726c0c69-8ab4-4632-9971-cceae73047ea
ishandutta2007/codeforces
interestinglsy/normal/2/A.cpp
#include <iostream> #include <map> #include <set> #include <cstring> #include <string> using namespace std; map<string,int> mp , t; int n; string s[1004]; int sc[1004]; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cin >> n; for( int i = 1 ; i <= n ; i++ ){ cin >> s[i] >> sc[i]; mp[s[i]] = mp[s[i]] + ...
ALGO
0.999921
3.677651
11a4399a-2e5a-4f4b-b592-e2e344ee65ad
ahmedbougacha/dagger
lib/Transforms/IPO/ConstantMerge.cpp
#include "llvm/Transforms/IPO/ConstantMerge.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/PointerIntPair.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/Statistic.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Module.h" #include "llvm...
TOOL
0.990117
7.833248
f9e0923c-81fe-4bed-bb66-2bdbf45125bd
serenitymiao/c--
第七章/第七章13.cpp
#include<stdio.h> double P(int n,double x) { if (n == 0) return 1; else if (n == 1) return x; else { return ((2.0 * n - 1) * x - P(n - 1,x) - (n - 1) * P(n - 2,x)) / n; } } int main() { int n; double x,value; printf(" n and x : "); scanf("%d %lf", &n,&x); value=P(n,x); printf("%lf",value); return 0; }
ALGO
0.999946
3.422127
09391b92-0190-4635-a069-1979079f4ee1
YNG2020/Pazhou_RadarData_Track
struct.cpp
#include <iomanip> #include<iostream> #include<string> #include<fstream> #include<vector> #include "struct.h" #include "math.h" #include "Solution.h" void rtk::readRtk(const char* rtkPath, std::vector<rtk>& rtkline) { rtkline.reserve(11000); std::ifstream inputFile(rtkPath); // һļָļ std::string line; w...
DATA
0.927492
4.027914
1102e352-7fce-48c0-9349-61d7192f7a6d
seonghwan7694/BOJ_solved
c++/2902번.cpp
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); string input, ans; cin >> input; for(int i = 0; i < input.size(); i++){ if('A' <= input[i] and input[i] <= 'Z') ans.push_back(input[i]); } cout << ans << "\n"; return 0; }
ALGO
0.996526
4.793088
f588c861-c6af-4f29-afe1-5109d02e58f8
sp9820e-kaios/android_frameworks_av
media/libstagefright/codecs/amrnb/dec/src/dec_lag6.cpp
/* ------------------------------------------------------------------------------ Pathname: ./audio/gsm-amr/c/src/dec_lag6.c Functions: Dec_lag6 Date: 01/31/2002 ------------------------------------------------------------------------------ REVISION HISTORY Description: (1) Updated to accept new parameter...
ALGO
0.99952
6.897988
6182d0ea-b49e-44ca-abd1-143148657a82
lucianmot/codechef-problems
799 + C++ - Cost of Groceries.cpp
// C++ - Cost of Groceries // Rating - 799 // https://www.codechef.com/problems/KITCHENCOST #include <bits/stdc++.h> using namespace std; int main() { int t, n, x; cin >> t; while(t--) { cin >> n >> x; int freshList[n]; int answer = 0; for (int i = 0; i < n; ++i) { cin >> freshList[i];...
ALGO
0.999417
4.271112
18b10815-fee6-46e1-8e61-20107469cda2
Anooj29/code
C++/Practice/DS/singly.cpp
#include <iostream> using namespace std; class Node { public: int data; Node* next; //constructor Node(int data){ this -> data = data; this -> next = NULL; }; }; void insertAtHead(Node* &head, int d){ //new node create Node* temp = new Node(d); temp -> next = head...
ALGO
0.99929
5.127193
9cb2ce2b-1b13-47cb-93f9-8d1ef29be8d3
tjmtmmnk/Algorithm
challenge_book/section2/partial_sum_problem.cpp
// p34 部分和問題 #include <iostream> using namespace std; int num, tgt_sum; int a[20]; bool dfs(int i, int sum) { if (i == num) { return sum == tgt_sum; } if (dfs(i + 1, sum)) { return true; } if (dfs(i + 1, sum + a[i])) { return true; } return false; } int main(void...
ALGO
0.999992
4.430353
44178dcb-79d4-45cf-aa66-3753376e58dd
chenruida/img_resize_xlys
src/threshold_partition.cpp
// // Created by 陈瑞达 on 2022/1/8. // #include "threshold_partition.h" #include <utility> thresholdPartition::thresholdPartition(std::string srcPath) { this->srcPath = std::move(srcPath); srcImage = cv::imread(this->srcPath, 1); } cv::Mat thresholdPartition::preProcess() { cv::Mat gray, binary, element; ...
TOOL
0.997321
4.713799
0e7cde4f-5c7d-40ca-9487-7d728bdea45a
mrxYan6/mrx-s-ACM-templates
text/String/stringHashing.cpp
#include <string> #include <iostream> #include <vector> using namespace std; #define ull unsigned long long const int mod1 = 1e9 + 9, mod2 = 1e9 + 7, p = 2333, N = 1e6; pair<ull,ull> prprv[N], prsa[N]; void getHash(string s){ prprv[0].first = prprv[0].second = 0; for(int i = 0; i < s.length(); ++i){ prprv[i + 1]...
ALGO
0.999854
4.507919
fecd03c0-067b-4f22-8c54-6ee019a86fb9
Junaid7200/University-Labs
Data Structures/Stacks/.history/DynamicStacks_20240330053424.cpp
#include <iostream> using namespace std; // dynamic stacks are created using linked lists, you can use singly or doubly or circular linked lists i guess...the following code is for dynamic stacks using doubly linked lists // the goal is to insert at the end of the stack, delete from the end of the stack and also displa...
ALGO
0.999349
4.233334
0427fb23-a849-4e71-a450-10398678873e
ngocquys/DSA-PTIT
DSA06025.cpp
#include<bits/stdc++.h> using namespace std; #define foru(i,a,b) for(int i=a;i<=b;++i) #define ford(i,b,a) for(int i=b;i>=a;--i) #define ii pair<int,int> #define ll long long #define fi first #define se second #define fill(a,b) memset(a,b,sizeof(a)) const int N=105; int t,n,a[N]; vector<int> b; int main(){ ios_b...
ALGO
0.999588
3.877754
9683ed87-123a-44b9-b4f5-6da8d06a48e7
AbdulKreemShah2408/leetcode
0104-maximum-depth-of-binary-tree/0104-maximum-depth-of-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.999703
6.388947
df6971a8-2ca8-4eb1-bf3d-9c79b591cf97
gp-b2g/frameworks_base
media/libstagefright/httplive/M3UParser.cpp
//#define LOG_NDEBUG 0 #define LOG_TAG "M3UParser" #include <utils/Log.h> #include "include/M3UParser.h" #include <media/stagefright/foundation/ADebug.h> #include <media/stagefright/foundation/AMessage.h> #include <media/stagefright/MediaErrors.h> namespace android { M3UParser::M3UParser( const char *baseUR...
TOOL
0.860065
5.783016
2e71d2d6-39c7-4853-8cf9-95895d333207
shajini66/UserMech
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.9988
6.76073
dffd1911-e5fc-48b0-bc5e-abe77ecdf97c
AngieGarro/TipoArboles
nodo.cpp
#include <iostream> #include <cstdlib> #include <stdlib.h> #include <fstream> #include "nodo.h" using namespace std; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Constructor ListaValor::ListaValor(){ principio = NULL; anterior = NULL; donde ...
ALGO
0.999137
3.754742
d6d013aa-7b56-4b4b-8b11-6e9ed997b2e7
zhengxiang94/ocs2_ros2
ocs2_oc/src/rollout/RolloutBase.cpp
#include "ocs2_oc/rollout/RolloutBase.h" #include <algorithm> #include <iomanip> #include <iostream> #include <ocs2_core/NumericTraits.h> #include <ocs2_core/misc/Numerics.h> namespace ocs2 { /******************************************************************************************************/ /******************...
ALGO
0.962872
7.642877
fd90ab03-ac0b-4d09-9d61-420ac5545bfd
harshturakhia/Data-Structure-Algorithm-in-CPP
Queue_ab.cpp
#include <iostream> using namespace std; class Queue { int front, rear, size; int *Q; public: Queue() { front = -1; rear = -1; size = 10; Q = new int[size]; } Queue(int size) { front = -1; rear = -1; this->size = size; Q = new...
ALGO
0.938009
4.613637
9755693e-151b-4fa9-8bee-fd3893ada13d
flere114/hackerrank
Algorithms/Warmup/Extra long factorials.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <string.h> using namespace std; int ans[10000]; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int N; scanf(" %d",&N); memset(ans,0,sizeof(ans)); ans[0] = ...
ALGO
0.999857
4.109234
47dbddba-722e-4566-951c-39683f28bb7b
lmc5474/Algorithm-cpp
Class079/CourseSelect.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; // 节点i的子节点,选j节课,考虑[0, k]区间的子节点 int f( vector<vector<vector<int>>>& dp, vector<int>& scores, vector<int>& sons, vector<vector<int>>& graph, int i, int j, int k ){ if(j == 0) return 0; if(k < 0 || j == 1) return scores[i...
ALGO
0.999948
3.621097
2ed8213a-c22c-4afc-b0ac-225649d6b18c
surdebmalya/data-structure-implementation
coding practice/miscellaneous/validate_an_ip_address.cpp
// https://practice.geeksforgeeks.org/problems/validate-an-ip-address-1587115621/1 // Medium // { Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends /* The function returns 1 if IP string is valid else return 0 You are required to complete this method */ class Solution { priv...
ALGO
0.98937
5.700755
9260e155-dcda-4f84-a45f-e7671f5ecefb
NirobNabil/CP
vjudge/marathon#2(basic string)/C.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int #define X first #define Y second #define A begin #define B end #define S1 100000 #define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end))) void pv(){ printf("\n");...
ALGO
0.996574
4.549011
e2e88ba0-646a-4d01-bcca-71d0b3981126
UnendingGlory/daily_leetcode
[1] 合集/剑指offer_C++/49-丑数.cpp
#include "header.h" // 只包含2, 3, 5为因数的数为丑数 // 如果x为丑数,那么2x,3x,5x也为丑数 // Solution1: 使用优先级队列 + set去重 // 将第一个丑数1丢入优先级队列中 // 每次从优先级队列中取一个数x // 再将2x, 3x, 5x也丢入优先级队列中 // 前面需要判断该数是否重复出现过 // 求第n个丑数 // 注意数据长度可能超过32位 class Solution { public: int nthUglyNumber(int n) { int d[3] = {2, 3, 5}; using LL = long lon...
ALGO
0.999875
5.434725
bee19ae3-4531-40e0-9c76-22a53419b2a4
Nitin1130/Data-Structures-ProblemsCplusplus
ReverseStack.cpp
#include<bits/stdc++.h> using namespace std; stack<int> st; void print() { while(!st.empty()) { cout<<st.top()<<endl; st.pop(); } } void insertAtBottom(int x) { if(st.size() == 0) st.push(x); else { int a = st.top(); st.pop(); insertAtBottom(x); st.push(a); ...
ALGO
0.999945
5.019662
6a08fe15-e7a5-4258-9965-272b880ff9fd
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_353_2.cpp
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e5 + 10; const int MAXV = 3 * MAXN; const int INF = 0x01010101; bool compx(pair<int, int> p1, pair<int, int> p2) { p1.second *= -1; p2.second *= -1; return p1 < p2; } bool compy(pair<int, int> p1, pair<int, int> p2) { return pair<int, int>(p1.secon...
ALGO
0.999948
3.902401
43bf1c3b-185d-4bed-b186-8e8f1b2a80fc
kovacsgb/bolygo
src/shooting.cpp
#include "shooting.hpp" ODE_solver::ODE_solver(Function& f_, std::vector<double> y0_,double start_,double end_,double step_) : yval(y0_.size()), y0(y0_), dy(y0_.size()), var(start_), start(start_), end(end_), step(step_), f(f_),solving(), output(std::cout) { if (end > start && step > 0) { ...
ALGO
0.999771
4.985238
df79f34d-509c-4ecb-8e5c-6f4ddf87b6a7
Neuronsmatrix/workspace
olympiads/codeforces/Div_3/div 3 753/a.cpp
#include <bits\stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; constexpr int INF = INT_MAX-1; constexpr ll LINF = LLONG_MAX-1; constexpr ll MOD = 1000000007; constexpr char nl = '\n'; #define pb push_back #define F first #define S second #define pii pair<i...
ALGO
0.999818
5.537397
f31f133d-65c7-4719-9ad3-eea33714fe2d
chuthimai/CodePTIT_C-
Ex3_phan_tich_thua_so_nguyen_to_1.cpp
// // Ex3_phan_tich_thua_so_nguyen_to_1.cpp // CodePTIT_C++ // // Created by Chu Mai on 17/09/2022. // #include <bits/stdc++.h> using namespace std; void oneTime(){ int sang[10001]; sang[0]=0; sang[1]=0; for(int i=2; i<10001; i++) sang[i]=1; for(int i=2; i<10001; i++){ if(sang...
ALGO
0.999698
3.5761
0320d5b3-f580-4fec-b1c9-0ab20c675a8f
VisualIdeation/Vrui-2.2-003
ExamplePrograms/EarthFunctions.cpp
#include <Math/Math.h> #include <Math/Constants.h> #include <Geometry/Geoid.h> #include <GL/gl.h> #include <GL/GLVertexArrayParts.h> #define NONSTANDARD_GLVERTEX_TEMPLATES #include <GL/GLVertex.h> #include <GL/Extensions/GLARBVertexBufferObject.h> /**********************************************************************...
ALGO
0.99814
6.256438
861c6b29-1e1b-4a73-84f7-876fff99a704
Tyferse/C_Cpp_public
OAiP/CATS1/B_tasks/AiSD1-B0.cpp
#include <cmath> #include <iostream> using namespace std; int main() { int n; FILE *f1 = fopen("input.txt", "r"); fscanf(f1, "%d", &n); fclose(f1); FILE *f2 = fopen("output.txt", "w"); int bin[n]; int tmp; for (int i = 0; i <= (1 << n) - 1; i++) { tmp = i; // cout << tm...
ALGO
0.999982
4.108934
497bc2bd-5838-4c8e-85a3-19d4301ae79b
miruddin11/Algorithms
0104-maximum-depth-of-binary-tree/0104-maximum-depth-of-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.999474
6.383748
49c03b1e-6754-4f4e-94c8-932b71155648
BIT-zhangxin/AlogrithmLearning
做题/15.数字游戏.cpp
//#include <stdio.h> //#include <stdlib.h> //#include <string.h> // //int cmp(const void *a, const void *b) //{ // char *x = (char *)a; // char *y = (char *)b; // while (1) // { // int x_len = strlen(x); // int y_len = strlen(y); // int min = (x_len > y_len) ? y_len : x_len; // for (int i = 0; i < min; i++) // { /...
ALGO
0.999825
3.855184
13734fae-c528-4c23-b2e6-09eca41392f7
Aman18111625/LeetCode-Solutions
145-binary-tree-postorder-traversal/145-binary-tree-postorder-traversal.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999989
6.212434
94b48bc3-add0-466b-8a8a-148fee4a73e1
lunw1024/OI
codeforces/edu131/d.cpp
#include <iostream> #include <algorithm> #include <vector> #include <queue> #include <cmath> using namespace std; using ll = long long; using pii = pair<int, int>; int N; int main() { ios::sync_with_stdio(false); cin.tie(0); int T; cin >> T; for (int t = 0; t < T; t++) { cin >> N; vect...
ALGO
0.999179
3.515719
28a708c7-ec84-4dc9-8e13-5eca0ff1e236
limitatiom/AcWing
Basis_of_algorithm/basic_algorithm/Sort.cpp
// // Created by 21050 on 2023/4/6. // //快速排序:基于分治的思想: /* * 1.确定分界点:l, r, mid = (r + l) / 2, 随机一个数 * 2.调整区间:小于等于基准的在分界点左边, 大于等于基准的在分界点右边(可能存在基准和分界点的交换) * 3.递归处理左右两个区间 */ /* * 法一: * 1.开辟新数组 * 2.处理思路: 新数组分为两个区间 * 3.扫描原数组中的每一个数 * 4.左区间放小于等于基准的,右区间放大于基准的 * 5.再返回 * 法二: * 双指针: * 1.左指针一直移动直至遇到大于等于基准的,停止 * 2.右指针一...
ALGO
0.999992
5.324321
f3b92ce3-31c7-4a01-91e0-a7b7559b5ad9
titocs/Random-Competitive-Programming
IDEAFUSE 2014 Final CP/It's Magic.cpp
#include <iostream> using namespace std; int main(){ int K, N; cin >> K >> N; cout << "Think of a number, any number" << "\n"; cout << "Multiply it by " << K <<"\n"; cout << "Add " << K*N << " to your number" << "\n"; cout << "Now, divide your total by " << K << "\n"; cout << "Finally, subt...
ALGO
0.998391
3.232319
df790bf6-960a-427d-b20b-005877d082dc
Solomonov98/CppLabs
лаб.раб2/лаб2зад2.cpp
//2. Дан массив размерности n. Если отрицательные и положительные элементы в массиве чередуются (+ - + - + … или - + - + - + …) //заменить максимальные элементы минимальными, иначе – наоборот. #include <iostream> using namespace std; int main() { int n = 0; int mx = 0; int mn = 0; int k = 0; cout << "n="; cin >...
ALGO
0.999994
3.925859
9f2b468f-d425-4fa2-ac4f-675a0bd8cf63
Dileepredd/parallel_computing_ass_2
q5.cpp
#include<bits/stdc++.h> #include<thread> using namespace std; void random_number_generator(vector<int>& array,int start,int end) { srand(time(NULL)); for (int i=start;i<end;i++) { int temp = rand()%10; array.push_back(temp); } } void compute_sum(vector<int>& array,vector<int>& sum,int ...
ALGO
0.99953
3.721888