uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
6afcf4d1-343d-4197-a67d-6ea43bb342cb
HCYshawn/Project
LC/2025/7_15_1/test.cpp
class Solution { public: bool isValid(string word) { if (word.size() < 3) return false; bool mid[2]{}; for (auto s : word) { if (isalpha(s)) { s = tolower(s); mid[s == 'a' || s == 'e' || s == 'i' || s == 'o' || s...
ALGO
0.999307
5.922985
acb51cc4-90f6-4b81-b37e-0aad8e8046dc
sabastianrafa/praktikum-algoritma
bab 2/latihan 3.cpp
#include <iostream> using namespace std; int main(){ cout<<"a. 8 >> 3 = ";cout<<(8>>3)<<endl; cout<<"b. 6 << 4 = ";cout<<(6<<4)<<endl; cout<<"c. 14 ^ 3 = ";cout<<(14^3)<<endl; cout<<"d. 7 & 3 = ";cout<<(7&3)<<endl; cout<<"e. ~567 = ";cout<<(~567)<<endl; return 0; }
ALGO
0.997769
3.12131
e4f27b26-c6b7-4261-b844-1ad9c9cccc57
AndreRamosDroidex/UCSP-CPLUSPLUS
main_heap_priorityq.cpp
#include <iostream> #include <fstream> #include "heapsort.h" #include <vector> using namespace std; void imprimir(vector<int> a){ for (int i=a.size()-1;i>=0;i--) { cout<<a[i]<<" "; } } int main() { static const int a[] = {0,3,1,200,5,7,600,8}; vector<int> v(a,a+sizeof(a)/sizeof(int)); ve...
ALGO
0.999082
4.262422
4e6a47e3-671c-483b-bd65-7c3ab947dfe2
Trent-Farley/All-Code
SA/Assignment_8/main.cpp
/* THE PLAN: I plan on using merge sort for my quadratic sorting algorithim. This should be pretty simple, no nodes or classes are going to be required. HOW MERGE SORT WORKS: Merge sort is divide and conquer algorithim, so if I use an array then I will need to split it to sort it. Bassically, it breaks it down until...
ALGO
0.983165
4.885403
cf3f5d03-74aa-46ad-9ff7-1be7d57e8b6e
amanjain200/gfg_potd
5thJuly23.cpp
/* Stock buy and sell II MediumAccuracy: 13.43%Submissions: 87K+Points: 4 Sharpen up your programming skills, participate in coding contests & explore high-paying jobs The cost of stock on each day is given in an array price[] of size n. Each day you may decide to either buy or sell the stock i at price[i], you can ev...
ALGO
0.999829
5.797786
dec02607-f4ca-403d-9af8-e113e18c22a3
diegothomas/SegmentedFusion
libs/InfiniTAM/include/MiniSlamGraphLib/GraphEdge.cpp
#include "GraphEdge.h" using namespace MiniSlamGraph; static void jacobianToHessian_diagonalpart(double *residual, double *jacobian, int dimMeasure, int numPara, double *Gblock, double *Hblock) { for (int para = 0; para < numPara; ++para) { Gblock[para] = 0.0f; for (int idx = 0; idx < dimMeasure; ++idx) { //G...
ALGO
0.987775
5.863467
4ebe3f4c-9503-4e61-873d-82f65fcf1b6e
ishandutta2007/codeforces
enkognit/normal/1146/A.cpp
#include <bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair #define fi first #define fr front() #define se second #define pll pair<ll,ll> using namespace std; const ll MOD=1000000007; ll n, m, i, j, Q, k, l, T, d2[100001], whfr[100001]; int main() { //freopen("input.txt","r",stdin); ...
ALGO
0.99968
3.556745
932824d6-1ce6-41d1-b601-cb960d5bdc15
lanpokn/my_pbrt
src/pbrt/util/vecmath.cpp
#include <pbrt/util/math.h> #include <pbrt/util/print.h> #include <pbrt/util/stats.h> #include <pbrt/util/transform.h> #include <pbrt/util/vecmath.h> #include <algorithm> #include <cmath> #include <type_traits> namespace pbrt { template <> std::string internal::ToString2<Interval>(Interval x, Interval y) { retur...
TOOL
0.936037
7.550597
b6ba0bee-c704-4af1-b891-4e6c0972a2d2
ishandutta2007/codeforces
cyand1317/normal/679/B.cpp
#include <cstdio> #include <algorithm> #include <utility> typedef long long int64; std::pair<int64, int64> inquire(int64 m, int64 blocks = 0, int64 volume = 0) { if (m == 0) return std::make_pair(blocks, volume); int64 lo = 1, hi = 1e5 + 5, mid; while (lo < hi - 1) { mid = (lo + hi) >> 1; i...
ALGO
0.999939
4.658996
2cf1353f-960d-4c8e-83c8-910674f0b91e
tanvitiwari17/DSA_cpp
DS codes/binary_trees/transform_to_sum_tree_BT/main.cpp
int solve(Node* node){ if(!node) return 0; int a=solve(node->left); int b=solve(node->right); int x=node->data; node->data=a+b; return a+b+x; } void toSumTree(Node *node) { // Your code here solve(node); }
ALGO
0.999977
5.573123
39509eeb-ea9b-4c20-8371-15f1b3c40345
NirjharSingha/Algorithm_1
indegreetopo.cpp
#include <bits/stdc++.h> using namespace std; void bfs(vector<vector<int>> &adj, queue<int> &q, vector<int> &ans, vector<int> &inDegree) { while (!q.empty()) { int frontNode = q.front(); q.pop(); ans.push_back(frontNode); for (int neighbour : adj[frontNode]) { ...
ALGO
0.999959
4.954379
39930beb-3ac6-42c0-9187-87eb3ecc6133
ashik255/Codeforces-Problem_Solving
50A.cpp
#include <iostream> using namespace std; int main() { int x,a,b; cin>>a>>b; x=(a*b/2); cout<<x<<endl; return 0; }
ALGO
0.992597
3.719135
afe4ca3c-09df-45d9-8b00-23add5be5e13
revbayes/revbayes.archive
src/core/functions/math/GeographicalDistanceFunction.cpp
#include "GeographicalDistanceFunction.h" #include "RbConstants.h" #include <cmath> using namespace RevBayesCore; /** * Geographical distance function of TypedDagNode of type double * * @param lat1 a TypedDagNode of type double * @param lon1 a TypedDagNode of type double * @param lat2 a TypedDagNode of type doubl...
TOOL
0.965375
6.757111
00544192-1f78-4cfa-9d15-7cef47af93b3
joaohenalves/Beecrowd
Ad-hoc/2508.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); string s; int sum, ans; while(getline(cin, s)) { ans = sum = 0; for(char c : s) { if(c != ' ') sum += 1 + (c - (c < 'a' ? 'A' : 'a')) % 9; } while(sum > 10) { ...
ALGO
0.999931
4.390898
99c0b958-a973-4101-aeae-584ef1d817b4
Vaibhav14072004/DSA-Problems
3617-find-the-original-typed-string-i/find-the-original-typed-string-i.cpp
// Approach 1 -> // TC= O(N) class Solution { public: int possibleStringCount(string word) { int n= word.length(); int ans= 0; for(int i=1; i<n; i++) { char prev= word[i-1]; if(word[i]== prev) { ans++; ...
ALGO
0.999958
6.094938
dc1df6b2-8c97-4c45-a60b-74809f8a803c
VARUN-009/Dynamic-Programming
Partition-array-for-maximum-sum.cpp
class Solution { public: int dp[501]; int helper(vector<int> &arr, int k, int start) { // base case if (start >= arr.size()) { return 0; } if (dp[start] != -1) { return dp[start]; } // recursive case int currMa...
ALGO
0.999871
6.17866
e9b02cd4-fd20-426a-adbc-8dfaf700e8a2
ou3slati/competitive-programming
Implementations/IOI 2022 Prep/Training/[prep]{#5]/A.cpp
//Never stop trying #include "bits/stdc++.h" using namespace std; #define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0) typedef long long ll; #define int ll typedef string str; typedef long double ld; typedef pair<int, int> pi; #define fi first #define se second typedef vector<int> vi; typedef vector...
ALGO
0.999994
4.38281
9e25053d-9358-4089-8841-7b140ac3ae33
Aurora-73/Data-Structure-Code
04_BiTree/二叉树的层序遍历逆层序遍历和层次号查找.cpp
#include <iostream> #include <vector> using namespace std; // 二叉树节点的结构体 typedef struct BiTNode { char data; struct BiTNode *lchild, *rchild; }BiTNode, *BiTree; // 队列的结构体和函数定义 typedef struct QueueNode { BiTree data; struct QueueNode* next; } QueueNode; typedef struct { QueueNode* front; Queue...
ALGO
0.999996
5.083331
2bc20346-a3dd-4049-8a18-064be000f8d4
tony-t-tang/LeetCode
0322-coin-change/0322-coin-change.cpp
class Solution { public: int coinChange(vector<int>& coins, int amount) { int n = coins.size(); vector<int> dp(amount+1, amount+1); dp[0] = 0; for(int i = 1; i < amount+1; i++) { for(int j = 0; j < coins.size(); j++) { if(i - coins[j] >= ...
ALGO
0.999859
6.068219
1e378b81-99a5-4341-9983-d59f73d2320a
ou3slati/competitive-programming
Implementations/Codeforces/Training/642/F.cpp
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; #define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0) typedef string str; typedef long long ll; #define int ll typedef double db; typedef long double ld; typedef pair<int,int> pi; #define fi first #define se second typedef vec...
ALGO
0.999915
4.901014
ac709f5d-0f40-4083-9666-5cfb4ddd2940
hshindo/arrayfire
src/api/c/svd.cpp
#include <af/dim4.hpp> #include <af/array.h> #include <af/lapack.h> #include <af/util.h> #include <af/defines.h> #include <err_common.hpp> #include <backend.hpp> #include <Array.hpp> #include <handle.hpp> #include <svd.hpp> using namespace detail; template <typename T> static inline void svd(af_array *s, af_array *u...
ALGO
0.997046
6.47058
af10d44e-f50e-40f0-9fd4-ec746ff8553d
GoTo-Coders/Competitive-Programming
LeetCode/C Plus Plus/1319.Number_of_Operations_to_Make_Network_Connected.cpp
/* Problem Statement: ----------------- There are n computers numbered from 0 to n-1 connected by ethernet cables connections forming a network where connections[i] = [a, b] represents a connection between computers a and b. Any computer can reach any other computer directly or indirectly through the network. Given a...
ALGO
0.999946
6.306815
4b1b1436-760e-4a03-b8d2-d0eb0d1a1ea1
utkarsh2338/LEETCODE
0494-target-sum/0494-target-sum.cpp
class Solution { public: int n, result = 0; void solve(int idx, int sum, vector<int>& nums, int target) { // Base case if (idx == n) { if (sum == target) { result++; } return; } // Recursive calls for addition and subtraction ...
ALGO
0.999991
6.855443
2c714a13-63b3-4761-a631-91d6a75e9971
alazarslan/CPlus_tutorial
sortingALogirtmalarıi/main.cpp
#include <iostream> #include <fstream> using namespace std; void swap(int *p1, int *p2) { int temp = *p1; *p1 = *p2; *p2 = temp; } bool isSorted(const int arr[], int size) { for (int i = 0; i < size - 1; i++) { if (arr[i] > arr[i + 1]) { return false; } } return tru...
ALGO
0.939715
3.836529
fd062586-cf87-4a72-b7e1-b75f04f7f202
vivekup3424/Coding_Problems
leetcode/cpp/find-minimum-time-to-reach-last-room-i.cpp
class Solution { public: int minTimeToReach(std::vector<std::vector<int>>& moveTime) { int rows = moveTime.size(); int cols = moveTime[0].size(); std::priority_queue<std::tuple<int, int, int>, std::vector<std::tuple<int, int, int>>, std::greater<std::tuple<int, int, int>>> minHeap; ...
ALGO
0.999943
6.438953
46dd048b-84d3-46ca-b206-743a4c6ffe59
smhemel/LeetCode
67. Add Binary.cpp
class Solution { public: string addBinary(string a, string b) { int alen = a.length(); int blen = b.length(); int i = 0, carry = 0; string ans =""; while(i<alen || i<blen || carry!=0){ int x = 0; if(i<alen && a[alen-i-1] == '1') x = 1; in...
ALGO
0.999991
6.369254
8fca17af-bf72-46aa-875f-185b06dae8f8
alldinno/galon-app
tugas_prog1/flutter_application_1/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.997859
6.76073
a003c282-1eab-4318-8fd1-febb7bf6e9ac
RocmFang/DistGER-Pipe
src/examples/biased_walk.cpp
#include "walk.hpp" #include "option_helper.hpp" int main(int argc, char** argv) { MPI_Instance mpi_instance(&argc, &argv); TruncatedRandomWalkOptionHelper opt; opt.parse(argc, argv); WalkEngine<real_t, EmptyData> graph; graph.load_graph(opt.v_num, opt.graph_path.c_str(), opt.make_undirected); ...
ALGO
0.920072
4.096064
040de195-0833-4f80-a044-d69bbe1b4cd0
ishandutta2007/codeforces
scott_wu/normal/1029/E.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <map> using namespace std; typedef long long ll; const int MAXN = 200100; int N; vector <int> edge[MAXN]; int dp[MAXN][3]; // 0: need, 1: good, 2: give void flood (int cloc, int last) { int mbest = 1e9; for (int i = 0; i < ...
ALGO
0.999826
4.478451
9f0ca0cc-2e02-47ec-97c1-d33effc17024
Samarthi/ray_tracer
lib/ray.cpp
#include "../include/ray.h" #include "../include/tuple.h" #include <iostream> #include <math.h> #include <algorithm> #include <climits> Tuple ray_position(Ray r, float time) { return r.origin + r.direction * time; } Ray transform(Ray r,Matrix<float> m){ Matrix<float> m_origin = tuple_to_matrix(r.origin), m_direc...
ALGO
0.981617
3.590743
913018b8-a756-4ff9-bf65-5c5ef279dccf
camcam23/wichcoin
src/chainparams.cpp
#include "assert.h" #include "chainparams.h" #include "core.h" #include "protocol.h" #include "util.h" // // Main network // unsigned int pnSeed[] = { 0x12345678 }; class CMainParams : public CChainParams { public: CMainParams() { // The message start string is designed to be unlikely to occur in no...
TEST
0.865786
6.294419
6a467740-8f06-472a-ba16-643256be5ef2
astro2049/LeetCode-2023
72/main.cpp
#include <iostream> #include "vector" #include "algorithm" using namespace std; int main() { std::cout << "Hello, World!" << std::endl; return 0; } class Solution { public: string word1, word2; vector<vector<int>> dp; int minDistance(string word1, string word2) { this->word1 = word1; ...
ALGO
0.999968
5.361696
d2654cb8-7e59-42ec-bb28-a3b9e18cf285
wangxugreenhand/Datastruct_code
DataStruct/Heap.cpp
#include "Heap.h" MinHeap::MinHeap(int size) { maxSize = size; currentSize = 0; minHeap = new int[maxSize]; } MinHeap::MinHeap(int *arr, int n) { maxSize = n + 50; currentSize = n; minHeap = new int[maxSize]; for (int i = 0; i < n; i++) { minHeap[i] = arr[i]; } for (int i = (...
ALGO
0.999281
4.098633
ee7a95e2-ebd4-4914-b3c7-d0b87b629cb4
yansputra/pbosmt3
smt3/bahasapemograman/UAS/soal1pointer.cpp
#include <iostream> using namespace std; //Buat program untuk memasukkan dan menampilkan data barang (kode,nama dan jumlah) menggunakan array pointer dinamis dan struct int n; int *data=new int; char *brg=new char; float *kd=new float; float *jmlh=new float; int main(){ cout<<endl; cout<...
TOOL
0.870779
3.401381
8481de1b-d98b-4123-96d8-a7df0304c5a7
Ronixa584/CP
39.cpp
class Solution { public: vector<vector<int>> combinationSum(vector<int>& candidates, int target) { vector<vector<int>>output; vector<int>temp; cs(output,temp,candidates,0,target); return output; } void cs(vector<vector<int>>&output,vector<int>&temp,vector<int>& candidates,in...
ALGO
0.99998
6.63225
18caef3a-2d8c-4015-ac2d-2fe590562806
wangfeilong321/geo-maps
osgearth/src/osgEarthUtil/LinearLineOfSight.cpp
/* -*-c++-*- */ #include <osgEarthUtil/LinearLineOfSight> #include <osgEarth/TerrainEngineNode> #include <osgEarth/DPLineSegmentIntersector> #include <osgSim/LineOfSight> #include <osgUtil/IntersectionVisitor> #include <osgUtil/LineSegmentIntersector> using namespace osgEarth; using namespace osgEarth::Util; namespa...
TOOL
0.909301
5.935801
4708521e-37ca-4d12-a3fa-a70c4e7f0d18
Alex-Shen1121/SZU_Learning_Resource
计算机与软件学院/面向对象程序设计(荣誉)/大作业1/素材1/2017081130_1234_12.cpp
2017081130:Problem1234:ȷ #include <iostream> #include<cstring> #include<cstdio> #include<cmath> using namespace std; class Group { public: Group(){}; virtual int add(int x, int y) { return 1; } virtual int sub(int x, int y) { return 1; } }; class GroupA:virtual public Group ...
ALGO
0.999781
3.883412
29e40530-6550-4e30-bb1b-dfd70ba07dad
henry20160826/CppWorkspace
8. String to Integer (atoi)/src/8. String to Integer (atoi).cpp
//Implement atoi to convert a string to an integer. // //Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases. // //Notes: It is intended for this problem to be specified vaguely (ie, no given input specs). You are respons...
ALGO
0.981134
4.671737
c7aabe66-5077-4359-aec0-7835429ed86c
Glyphack/AP
S03/Hooshyari-Shayegan-610397166-stringMatch.cpp
#include <iostream> #include <bits/stdc++.h> using std::cout; using std::cin; using std::string; using std::endl; bool CheckEquality(const string &t_string1, const string &t_string2); int FindSubStrings(const string &t_string, const string &t_substring); int main() { string s_string, substring; cin >> s_str...
ALGO
0.999753
4.683598
f4ee6016-47d4-4a62-bffa-393c01733d38
sanjiv0286/CP-Daily-Practice-Problems
U_Is_B_a_subsequence_of_A.cpp
#include <bits/stdc++.h> using namespace std; int main() { long long n, m; cin >> n >> m; long long a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } int b[m]; for (int i = 0; i < n; i++) { cin >> b[i]; } int z = 0; int counter = 0; for (int i = 0; i ...
ALGO
0.999992
3.262311
498c14d0-2d2f-4206-965e-c7325d782af0
BartVandewoestyne/Cpp
books/Accelerated_C++/chapter04/median.cpp
#include <algorithm> // to get the declaration of `sort' #include <stdexcept> // to get the declaration of `domain_error' #include <vector> // to get the declaration of `vector' using std::domain_error; using std::sort; using std::vector; #include "median.h" // compute the median of a `vector<double>...
ALGO
0.999866
6.321292
ced60067-830a-4fc6-bc00-95a87b0c4d4d
BornaMat/StrukturePodataka
Vjezba23/Vjezba23/Source.cpp
//2. Definirati strukturu osoba(ime, prezime, godina roðenja) i napisati program koji : //A.dinamièki dodaje novi element na poèetak liste, //B.ispisuje listu, //C.dinamièki dodaje novi element na kraj liste, //D.pronalazi element u listi(po prezimenu), //E.briše odreðeni element iz liste, //U zadatku se ne smiju koris...
TOOL
0.979242
4.265786
a98b345e-2dac-44b6-bc81-c1c0d6e746fd
Erin2026/ENSISA-CPP-TD
TD3/exercice3/queueStack.cpp
#include <iostream> #include <queue> #include <stack> #include <cctype> using namespace std; bool isPalindrome(const string &input){ queue<char> file; stack<char> pile; for (char const letter : input){ file.push(letter); pile.push(letter); } while (!pile.empty() && !file.empty()){...
ALGO
0.996804
5.140845
fc90b709-6426-451f-825c-8ac9c1b75477
ly-huang/LeetCode
leetcode216/leetcode216/main.cpp
#include <iostream> #include <vector> using namespace std; void getResult(const int &k,const int &n,vector<vector<int>> &result,vector<int> &cur,const int &index) { cur.emplace_back(index); if(index==n&&k==1) { result.emplace_back(cur); } else if(index<n&&index+1<=9&&k>0) { getR...
ALGO
0.999905
5.403799
83b91287-881f-4e36-a21f-839048f60753
arlechann/atcoder
AtCoder/ABC189/E.cpp
#include <algorithm> #include <boost/optional.hpp> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string...
ALGO
0.999947
4.272225
36ccb929-6011-4fbf-b00c-d80e788c424a
shelltdf/osgall
prebuild/boost_1_71_0/libs/regex/example/snippets/partial_regex_iterate.cpp
/* * LOCATION: see http://www.boost.org for most recent version. * FILE partial_regex_iterate.cpp * VERSION see <boost/version.hpp> * DESCRIPTION: Search example using partial matches. */ #include <boost/regex.hpp> #include <iostream> #include <fstream> #include <sstream> #include <st...
ALGO
0.899367
6.695587
54dcb3bd-fc43-4113-8d69-93e231e91c94
Divyanshu-Verma0/StriverSdeSheet
best_time_to_buy_and_sell_stock.cpp
#include <bits/stdc++.h> int maximumProfit(vector<int> &prices){ // Write your code here. // O(n) approach // int mn=prices[0]; // int mx=INT_MIN; // for(int i=1;i<prices.size();i++) // { // if(mn>prices[i])mn=prices[i]; // mx=max(mx,prices[i]-mn); // }return mx; }
ALGO
0.999278
5.636786
4d572fe6-e1df-4f9f-b38b-cdb6406c9fdf
Jacob-Brink/214
projects/06/old/average.cpp
/* average.cpp "test-drives" function Average. * Precondition: theArray is an array of numbers. * Output: the average of the values. * * Begun by: Dr. Adams, for CS 214 at Calvin College. * Completed by: * Date: */ #include <iostream> using namespace std; double average(double anArray[], int itsSize); int mai...
ALGO
0.996614
6.849158
550a054a-0328-444d-a174-16f862f7e674
lelo52/flutter_application_rating
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
43a7d1f0-78fc-4621-baf9-8071d4e1e519
jonofarc/pkgj_partitions
Boost-prefix/src/Boost/libs/sort/example/randomgen.cpp
// See http://www.boost.org/libs/sort for library home page. #include <boost/random/mersenne_twister.hpp> #include <boost/random/uniform_int_distribution.hpp> #include <stdio.h> #include "stdlib.h" #include <fstream> #include <iostream> using namespace boost; int main(int argc, const char ** argv) { random::mt1993...
TOOL
0.988825
4.155019
d5c9ecf5-7077-4c66-9d83-5a776c190121
TheBurkeLab/cantera
src/tpx/Nitrogen.cpp
//! @file Nitrogen.cpp #include "Nitrogen.h" #include "cantera/base/stringUtils.h" using namespace Cantera; namespace tpx { static const double M = 28.01348, Tmn = 63.15, Tmx = 2000.0, Tc = 126.200, Pc = 3.4e6, Roc = ...
ALGO
0.999005
3.846813
c8915a34-596a-47ac-bd5b-5832847fe857
reddevill007/Leetcode
leetcode8.cpp
/* 8. String to Integer (atoi) Medium Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer (similar to C/C++'s atoi function). The algorithm for myAtoi(string s) is as follows: Read in and ignore any leading whitespace. Check if the next character (if not already ...
ALGO
0.997088
5.474513
26084078-dae1-4226-bc44-d06487bee05d
22youl/donga22
250423/합과 평균의 차/sub-of-average-and-sum.cpp
#include <iostream> using namespace std; int main() { int a,b,c; cin >> a >> b >> c; cout << a+b+c << endl; cout << (a+b+c)/3 << endl; cout << a+b+c-((a+b+c)/3) << endl; return 0; }
ALGO
0.999755
3.34408
3e4e54ba-4d02-4383-bfd2-8c9fe3fa1265
camil0palacios/Competitive-programming
solutions/Training Camp Argentina - 2022/day-3/c.cpp
#include <bits/stdc++.h> #define endl '\n' #define ll long long #define fori(i,a,b) for(int i = a; i < b; i++) #define forr(i,a,b) for(int i = a; i >= b; i--) #define fore(i,a,b) for(int i = a; i <= b; i++) #define ft first #define sd second #define all(v) v.begin(), v.end() #define sz(v) (int) v.size() #define mp make...
ALGO
0.999894
3.954669
f5ffe252-4da2-4cf3-a142-e542a519cdcd
Neel-max-cpu/CodingNinjaDSAsolution
Data structures in c++/recursion 1/checkNumber.cpp
/* Given an array of length N and an integer x, you need to find if x is present in the array or not. Return true or false. Do this recursively. Input Format : Line 1 : An Integer N i.e. size of array Line 2 : N integers which are elements of the array, separated by spaces Line 3 : Integer x Output Format : 'true' or ...
ALGO
0.999945
5.094983
a9b23b58-13a1-4a50-bc03-92de88f20863
sshockwave/Online-Judge-Solutions
TUOJ/contest/120/0.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <cassert> #include <cctype> using namespace std; typedef long long lint; #define cout cerr #define ni (next_num<int>()) template<class T>inline T next_num(){ T i=0;char c; while(!isdigit(c=getchar())&&c!='-'); bool neg=c=='-'; neg?c=getchar():0; whi...
ALGO
0.999764
3.38154
0590287b-9be4-494b-bc07-56893104aa6d
pranavjawale01/cp.exe
GFG/Difficulty: Medium/Remove all occurences of duplicates in a linked list/remove-all-occurences-of-duplicates-in-a-linked-list.cpp
//{ Driver Code Starts // Initial Template for C++ #include <bits/stdc++.h> using namespace std; /* Link list node */ struct Node { int data; struct Node *next; Node(int x) { data = x; next = NULL; } }; // } Driver Code Ends // User function Template for C++ /* Linked List node stru...
ALGO
0.999898
6.225272
3a9b0d46-15e6-4f01-8bb3-d7108c1b4f08
RahulDev12004461/loop-pattern
practice8.cpp
//practice8 #include<iostream> using namespace std; main() { int n; cin>>n; int i=1; while(i<=n) { int j=1; while(j<=i) { cout<<i-j+1; j++; } cout<<endl; i++; } }
ALGO
0.999952
3.669064
1b47464f-b127-4e03-a23c-b2d4488e2486
imicola/Questions-and-Impressions
main/LuoGutest/#29洛谷小白月赛TT202411/T_539827_202411_H_Enemy.cpp
//#pragma GCC optimize(2) #include <bits/stdc++.h> #define endl '\n' using namespace std; typedef long long LL; int strcount(string s, char ch) { int ans = 0; for (size_t i = 0; i < s.size(); i++) { if (s[i] == ch) ans++; } return ans; } int main() { ios::sync_with_stdio(0), cin.tie(0), co...
ALGO
0.999938
3.696519
f1513f92-a30e-4c34-b51a-696d88c77b99
DarshanaMohan/Leetcode-submission
2737-row-with-maximum-ones/row-with-maximum-ones.cpp
class Solution { public: vector<int> rowAndMaximumOnes(vector<vector<int>>& mat) { std::vector<int> res = {0, 0}; int row = mat.size(); for (int i = 0; i < row; i++) { int count = std::accumulate(mat[i].begin(), mat[i].end(), 0); if (count > res[1]) { ...
ALGO
0.999884
6.134789
7f738a32-6e32-4d14-9895-c083e6754bc6
Leixb/UPC-A_PhaseTransition
src/adaptative_calc.cpp
#include <list> #include <vector> #include "adaptative_calc.h" using std::list; using std::vector; using std::pair; #define DEPTH_LIMIT 7 #define PART_INI 10 template<typename T> T abs(const T &a) {return (a<0)? -a : a;} void calculate(list<pair<double, double>> &l, vector<list<pair<double,double> >::iterator> &v,...
ALGO
0.999959
5.502735
d239259a-e07f-4b69-88ff-7302f8b51c12
ishandutta2007/codeforces
rush_d_cat/normal/128/D.cpp
#include <iostream> #include <cstdio> #include <queue> #include <algorithm> #include <vector> using namespace std; vector<int> vec; int a[100002]; int main() { int n; cin >> n; for(int i=1;i<=n;i++) { cin >> a[i]; } sort(a+1,a+1+n); int cnt = 1; a[n+1] = 0; for(int i=2;i<=n+1...
ALGO
0.999997
3.622734
a622e70f-553b-4cf5-b341-924193204b5a
qt/qtquick3d-assimp
code/PostProcessing/TextureTransform.cpp
/** @file A helper class that processes texture transformations */ #include "TextureTransform.h" #include <assimp/Importer.hpp> #include <assimp/postprocess.h> #include <assimp/DefaultLogger.hpp> #include <assimp/scene.h> #include <assimp/StringUtils.h> namespace Assimp { // ----------------------------------------...
TOOL
0.852242
7.728667
1bd4285e-59ee-4199-be0d-f8510cacd35a
Kamran47t6/Week4_Lab-PD
Lab 4/task5.cpp
#include<iostream> using namespace std; void maximum(int number1,int number2); int main(){ int number1,number2; while(true){ cout<<"Enter number 1:"; cin>>number1; cout<<"Enter number 2:"; cin>>number2; maximum(number1,number2); } } void maximum(int number1,int number2){ if (number1>number2){ cout<<"The...
ALGO
0.978342
3.268316
f78d4d70-051d-4ea4-bedd-1d0ea71b0fa5
greenfox-zerda-sparta/Fruzsi555
week-08/day-4/01.cpp
#include <iostream> #include <string> using namespace std; void countdown(int n) { if (n>=0) { cout << n << " "; countdown(n - 1); } } int main() { // write a recursive function // that takes one parameter: n // and counts down from n int number = 5; countdown(number); system("pause"); r...
ALGO
0.99916
6.524674
843cb54e-0db2-4994-b827-d3c071a19d2f
esl000/CustomUE4VolumeRaymarching
Engine/Source/Runtime/Engine/Private/Rendering/BurleyNormalizedSSS.cpp
/*============================================================================= BurleyNormalizedSSS.cpp: Compute the transmition profile for Burley normalized SSS =============================================================================*/ #include "Rendering/BurleyNormalizedSSS.h" // estimated from the sampling i...
ALGO
0.96441
4.462016
65041f29-2869-498d-8c14-6474f96f27c3
chanhee-park0518/CodingTest
code_plus/900_ds/6549_histogram.cpp
#include <bits/stdc++.h> using namespace std; long long arr[100000]; int main() { while (true) { int n; cin>>n; if (n == 0) break; for (int i=0; i < n; i++) cin>>arr[i]; stack<long long> s; long long ans = 0; for (int i=0; i < n; i++) { ...
ALGO
0.999939
4.177309
c010da62-b951-4f40-9845-a9d3b2a19376
Abhisheksharma91122/DSA-on-cpp-
Linked_List/Reverse_Nodes_K-Group.cpp
#include <iostream> #include<vector> using namespace std; /** * Definition for singly-linked list. */ struct ListNode { int val; ListNode *next; ListNode() : val(0), next(nullptr) {} ListNode(int x) : val(x), next(nullptr) {} ListNode(int x, ListNode *next) : val(x), next(next) {} }; class Solut...
ALGO
0.999994
6.410709
4af4630e-4afd-4625-9909-2471b6029918
SusmoyNath/leetcode-codes
0445-add-two-numbers-ii/0445-add-two-numbers-ii.cpp
#include <stack> class Solution { public: ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) { std::stack<int> s1, s2; // Push elements of l1 into stack while (l1) { s1.push(l1->val); l1 = l1->next; } // Push elements of l2 into stack while...
ALGO
0.999966
7.066237
b671fd47-2647-4e0e-aa47-79eafadfd053
mohittanwarCod/RubikCubeSolver
tempCodeRunnerFile.cpp
unordered_map<RubiksCubeBitboard, bool, HashBitboard> mp1; // RubiksCubeBitboard cube; // cube.print(); // vector<RubiksCube::MOVE> shuffle_moves = cube.randomShuffleCube(5); // for (auto move : shuffle_moves) // cout << cube.getMove(move) << " "; // cout << "\n"; // cube.print(); ...
ALGO
0.987122
3.612979
e97c5531-d0f3-4dee-9048-3f84e424e9a9
amsiljak/c9-Projects
Programming-Techniques/T3/Z6/main.cpp
//TP 2017/2018: Tutorijal 3, Zadatak 6 #include <iostream> #include <vector> #include <iomanip> #include <cmath> int NajvecaSirina(std::vector<std::vector<int>> m) { std::vector<std::vector<int>> brojaci=m; for(int i=0;i<m.size();i++) { for(int j=0;j<m[i].size();j++) { brojaci...
ALGO
0.999436
4.56268
f8d3a1b3-677e-4f63-bcdc-2c3430108290
tridhapuku/DSP_MLIR
lldb/source/Host/common/HostInfoBase.cpp
#include "lldb/Host/Config.h" #include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Host/HostInfoBase.h" #include "lldb/Utility/ArchSpec.h" #include "lldb/Utility/LLDBLog.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/StreamString.h" #include "llvm/ADT/S...
TOOL
0.919402
7.133287
6ded5d1d-aa7e-4243-98d1-aaa7c55960ac
Arpit6424/-Strivers-SDE-Sheet-Challenge
#10_Find_the_Duplicate_Number.cpp
class Solution { public: int findDuplicate(vector<int>& nums) { int n = nums.size(); int low = 1; int high = n-1; while(low<high){ int mid = low +(high-low)/2; int cnt = 0; for(auto it : nums)if(it<=mid)c...
ALGO
0.999978
6.085334
692f5bf4-bda3-4de5-96e7-b3ebef473954
dhruvchandralohani/Computer-Graphics-using-OpenGL
Scan_Line.cpp
#include<stdio.h> #include<GL/glut.h> #include<math.h> int le[500], re[500], flag=1 ,m; void init() { gluOrtho2D(0, 500, 0, 500); } void edge(int x0, int y0, int x1, int y1) { if (y1<y0) { int tmp; tmp = y1; y1 = y0; y0 = tmp; tmp = x1; x1 = x0; x0 = tmp; } int x = x0; m = (y1 -...
ALGO
0.984484
3.076227
abe80606-85f1-4498-9eb9-70d7f4452ccf
gudwnsgur/Algorithm
BOJ/16505_별.cpp
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #define endl '\n' using namespace std; vector<vector<char>> star(1025, vector<char>(1025, ' '));; void rec(int x, int y, int length) { if (length == 1) { star[x][y] = '*'; return; } rec(x, y, length/2); rec(x + length/2, y, length / 2...
ALGO
0.999961
3.820366
a32c13d5-4ae2-4b63-bde5-964c8f0e7cfb
ushmita4/Leetcode-Daily-Challenge-2022
11. November/nearestexitfromentranceinmaze.cpp
class Solution { public: int nearestExit(vector<vector<char>>& maze, vector<int>& entrance) { int n = maze.size(),m = maze[0].size(),ans = 0; queue<pair<int,int>> q; q.push({entrance[0],entrance[1]}); maze[entrance[0]][entrance[1]] = '+'; while(!q.empty()){ int ...
ALGO
0.999967
5.658836
dc5b0e27-6107-42be-9eaf-75a0281ca700
piotrj3/freebsd
contrib/llvm/lib/Analysis/PostDominators.cpp
#include "llvm/Analysis/PostDominators.h" #include "llvm/IR/Function.h" #include "llvm/IR/PassManager.h" #include "llvm/Pass.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; #define DEBUG_TYPE "postdomtree" //===----------------------------------------------------------------------===// // PostDominat...
TOOL
0.983793
7.453391
ad8f0838-d765-4280-a626-ff4f1859a9b4
ancabilloni/SDC-Path-Planning
src/Eigen-3.3/bench/bench_gemm.cpp
// g++-4.4 bench_gemm.cpp -I .. -O2 -DNDEBUG -lrt -fopenmp && OMP_NUM_THREADS=2 ./a.out // icpc bench_gemm.cpp -I .. -O3 -DNDEBUG -lrt -openmp && OMP_NUM_THREADS=2 ./a.out // Compilation options: // // -DSCALAR=std::complex<double> // -DSCALARA=double or -DSCALARB=double // -DHAVE_BLAS // -DDECOUPLED // #include...
TOOL
0.941634
5.840695
99084f3d-70dc-4d85-85bc-5bb89c010355
kartik0920/CRT
armsstrong.cpp
#include <bits/stdc++.h> #include <iostream> using namespace std; bool solve(int n) { int check = 0, m = n; while (n != 0) { int r = n % 10; int digit = r * r * r; check = check + (digit); n /= 10; } return check == m; } int main() { int n = 153; cout << sol...
ALGO
0.999944
5.013155
54d8f6da-ffd2-4443-889f-8b81a842ae7e
framp/joystick-mapper
opencv-sys/opencv/modules/cudalegacy/src/calib3d.cpp
#include "precomp.hpp" using namespace cv; using namespace cv::cuda; #if !defined HAVE_CUDA || !defined HAVE_OPENCV_CALIB3D || defined(CUDA_DISABLER) void cv::cuda::transformPoints(const GpuMat&, const Mat&, const Mat&, GpuMat&, Stream&) { throw_no_cuda(); } void cv::cuda::projectPoints(const GpuMat&, const Mat&, c...
ALGO
0.982947
6.134449
1a9d6453-6611-49c1-bea3-788acfb58686
wugangca/competitive-programming
ccc/2023/s2.cpp
#include <algorithm> #include <climits> #include <cmath> #include <iostream> #include <vector> /* Use ranged dp For a ranged dp[i, j] of length len, its asymetric value is dp[i+1, j-1] + |h[i] - h[j]| where dp[i+1, j-1] is the ranged dp of len-2 len = 0: dp[i, i] = 0 len = 1: dp[i, i+1] = |h[i] - h[i+1]| .... len...
ALGO
0.999978
4.157576
7cad61af-7604-4ffd-a125-4dedca890904
ChristianPacurib/DSAA-58010
sort.cpp
#include <iostream> using namespace std; int main() { int num[] = {5 ,4 ,3 ,2, 1}; for(int i =0; i<4;i++){ for(int j =i + 1; j<5;j++){ if (num[i] > num[j]){ swap(num[i], num[j]); } } } for(int i =0; i<5;++i){ cout<<num [i]<<" "; } return 0; }
ALGO
0.999812
3.324562
8b5f28f5-62c0-4a1c-a108-d4bd7eae9138
AnupamDas054/competitve-programming
codeforces/1253a.cpp
#include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; for(int j=1;j<=t;j++) { int n; cin>>n; int arr[n+1],arr1[n+1]; for(int i=0;i<n;i++) cin>>arr[i]; for(int i=0;i<n;i++) cin>>arr1[i]; int flag=0; int left=-1,right=-1,value=0; for(int i=0;i<n;i++) ...
ALGO
0.999961
3.243506
1f74488c-4121-4219-9525-ee74f5c7ffbd
Arna03v/cp
800/doremy's_paint3.cpp
#include <iostream> #include <algorithm> #include <set> #include <vector> using namespace std; // determine if we can can arrange the array in a way that nums[0] + nums[1] == nums[1]+nums[2] ... = some k int noe(vector<int>& nums){ set<int> s; for(int& i : nums) s.insert(i); return s.size(); } int count...
ALGO
0.999807
4.398679
49f42fa0-d7b3-400a-9c64-59c1d17591e4
rajesh-ss/smart_receptionist
raspberry_pi_code/opencv-master/modules/video/src/tracking/detail/tracker_mil_model.cpp
#include "../../precomp.hpp" #include "tracker_mil_model.hpp" /** * TrackerMILModel */ namespace cv { inline namespace tracking { namespace impl { TrackerMILModel::TrackerMILModel(const Rect& boundingBox) { currentSample.clear(); mode = MODE_POSITIVE; width = boundingBox.width; height = boundingBox...
ALGO
0.994944
6.096283
d9ae24ef-2ebd-4994-acdb-ad1ac918e35b
Duonggsimp/Competitive-Programming
BOTRI.cpp
#include <bits/stdc++.h> #define ll long long #define fi first #define se second #define pb push_back #define runfast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); using namespace std; const int N=1e6+5; int main() { runfast; ll n, vt=0, d=0; cin >> n ; pair <ll,ll> a[n+1]; for (long i = 1; i<=n ;...
ALGO
0.999945
3.992654
978458a3-1e75-4964-a1ac-6a69611343c7
projeto-de-algoritmos-2025/Grafos1-Codeforces-Atcoder-Problems
Grafos-Geovanna/thirdavenue.cpp
#include <bits/stdc++.h> #include <queue> using namespace std; #define int long long #define edge tuple<int,int,int> #define pii pair<int,int> const int oo = 2e18, mod = 998'244'353; const int MAX = 2e5+20; constexpr array<pair<int, int>, 4> dxy = {{{-1, 0}, {0, 1}, {1, 0}, {0, -1}}}; void solve(){ int h, w; cin >...
ALGO
0.999863
4.249867
880a8b1f-bfba-4694-9280-83bca7114a2e
Corvey/Exercise
ACM/ACM/线段树/单点更新/hdu 1166树状数组.cpp
#include <cstdio> #include <string.h> #define lowbit(x) (x&-x) const int N = 5e4+10; int isum[N], n; inline void update(int t, int x){ for(; t<=n; isum[t]+=x, t+=lowbit(t)); } int Sum(int t) { int ans = 0; for(; t; ans += isum[t], t-=lowbit(t)); return ans; } int main(void) { int m, kase, x, pos, l,...
ALGO
0.999312
3.764086
7c00006e-c40e-4a1f-b6a8-e6da07aac9aa
Volverman/procon-archive
atcoder.jp/agc002/agc002_c/Main.cpp
#include <bits/stdc++.h> typedef long long ll; #define REP(i, n) for(int i = 0; i < n; i++) #define REP2(i, a, b) for(int i = a;i <= b;i++) #define REPR(i, a, b) for(int i = a; i >= b; i--) #define FOR(i, m, n) for(int i = m; i < n; i++) #define INF 2e9 #define MOD 1000000007 #define PI 3.14159265358979323846 #define v...
ALGO
0.999947
3.176657
738a20b0-ac9a-47cd-a3ee-54902d23dfc1
Shapooo/leetcode
2982.cpp
#include <cstdio> #include <string> using namespace std; class Solution { void h(int a[3], int v) { if (v > a[0]) { a[2] = a[1]; a[1] = a[0]; a[0] = v; } else if (v > a[1]) { a[2] = a[1]; a[1] = v; } else if (v > a[2]) { ...
ALGO
0.999962
4.436055
fc566218-f8ce-4348-a597-40f2c3b05702
yanaih16/procon_archive
atcoder.jp/abc237/abc237_d/Main.cpp
#include <bits/stdc++.h> using namespace std; using i64 = long long; int main(){ i64 n; string s; cin>>n>>s; i64 ans[n+1]; i64 l=0,r=n; for(i64 i=0;i<=n;i++){ if(s[i] == 'L'){ ans[r] = i; r--; } else { ans[l] = i; l++; ...
ALGO
0.99994
3.163503
df64d4af-636d-4f83-8f6d-b3dd5daff9ec
PANDA-CODER-3110/leetcode_hard_way
Construct Tree from Inorder & Preorder - GFG/construct-tree-from-inorder-preorder.cpp
//{ Driver Code Starts // #include<bits/stdc++.h> using namespace std; struct Node { int data; struct Node *left; struct Node *right; Node(int x){ data = x; left = NULL; right = NULL; } }; void printPostOrder(Node *root) { if(root==NULL) return; printPostOrder(root->left); printPostOrder(r...
ALGO
0.999996
6.135309
c3b3ab25-6f86-42f4-b874-4f3936172964
kyun1016/algorithm
BOJ/16. 동적 계획법 기초/2156 포도주 시식(선택의 중요성, if문을 선정할 때 고려할 것).cpp
#include<iostream> #include<algorithm> using namespace std; int N; int arr[10050]; int cache[10050]; int main() { cin >> N; for (int i = 0; i < N; i++) cin >> arr[i]; cache[0] = arr[0]; cache[1] = arr[0] + arr[1]; int ret = 0; for (int i = 2; i < N; i++) { cache[i] = max(cache[i - 2] + arr[i], cache[i - 3...
ALGO
0.999983
4.13518
f6f9d555-f4ad-4749-bf6b-2ee28162add6
hoosong0235/acmicpc
코딩 테스트 준비 - 연습/브루트 포스 - 재귀/2580.cpp
#include <bits/stdc++.h> using namespace std; vector<vector<int>> v(9, vector<int>(9)); vector<pair<int, int>> zs; bool check(int r, int c, int cand) { for (int i = 0; i < 9; i++) if (cand == v[i][c]) return false; for (int j = 0; j < 9; j++) if (cand == v[r][j]) return false; int R = 3 * (r / 3), C = 3 * (c / 3);...
ALGO
0.999795
4.698197
d997507e-be82-4c85-9c62-fb5e0f96f829
bibletime/historic-bibletime-svn
tags/rel-2-7-1/bibletime/src/backend/rendering/ctextrendering.cpp
#include "backend/rendering/ctextrendering.h" #include <boost/scoped_ptr.hpp> #include <QRegExp> #include <QtAlgorithms> #include "backend/drivers/cswordmoduleinfo.h" #include "backend/keys/cswordkey.h" #include "backend/keys/cswordversekey.h" #include "backend/managers/cdisplaytemplatemgr.h" #include "backend/manag...
TOOL
0.874505
5.22051
697bffdf-f772-49e8-8de9-d06e54719845
aditi944/Data-Structure-And-Algorithms
array/Shop in candy store.cpp
//https://practice.geeksforgeeks.org/problems/shop-in-candy-store1145/1# vector<int> candyStore(int candies[], int N, int K) { sort(candies,candies+N); vector<int> res; int minsum = 0,maxsum=0; int i = 0, q = N-1; while(i<=q) { minsum+=candies[i]; q -...
ALGO
0.999922
4.93931
807949d7-2e6b-460b-a522-8b899bd6e6db
globaledgesoft/qca_hb_ecosap
ecos/host/tools/configtool/standalone/wxwin/finddlg.cpp
#ifdef __GNUG__ #pragma implementation "finddlg.cpp" #endif #include "ecpch.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #include "wx/cshelp.h" #include "wx/valgen.h" #include "finddlg.h" #include "configtool.h" #include "configtooldoc.h" #include "configtoolview.h" #include "configtree.h" #include "mainwi...
TOOL
0.953327
5.808847
14c0518c-2aea-4e60-bdc7-068321fb1667
ArthurJulio1106/trabalho-laerte-e-ivan
SLEM/rota.cpp
#include <iostream> #include <cmath> #include <cstring> #include "Rota.hpp" #include "Veiculo.hpp" #include "Local.hpp" #include "Pedido.hpp" // Função para calcular distância euclidiana entre dois Locais double distancia(Local a, Local b) { int dx = a.x - b.x; int dy = a.y - b.y; return sqrt(dx*dx + dy*dy...
ALGO
0.999054
5.819746
ded75869-eaef-4bb0-a378-ba1865697faf
o-leolleo/RoadToCompete
codeforces/628C.cpp
#include <bits/stdc++.h> using namespace std; #define MAX 100010 pair<char, int> str[MAX]; int n, max_dist[MAX]; bool comp(pair<char, int> a, pair<char, int> b) { return max(abs(a.first - 'a'), abs('z' - a.first)) > max(abs(b.first - 'a'), abs('z' - b.first)); } int main() { int k; char _str[MAX], aux[MAX]; sca...
ALGO
0.999963
3.509219
a3ad9576-4fd9-40d3-9c70-e0aeb09258f4
jshristi22/CrackMyPlacement
Arrays/allocate_books(Binary Search).cpp
// codestudio // https://www.naukri.com/code360/problems/allocate-books_1090540?utm_source=youtube&utm_medium=affiliate&utm_campaign=codestudio_Striver_BinarySeries&leftPanelTabValue=SUBMISSION int findStd(vector<int>& arr, int n, int maxPages){ int std = 1; int pg = 0; for(int i = 0; i<n; i++){ if(p...
ALGO
0.999887
5.715492