uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
1fc2e5ce-f22c-4bb0-8b3a-28e2cab08faf
RAJ8664/Algorithm
cpp/15puzzle.cpp
#include<bits/stdc++.h> using namespace std; int position(vector<vector<int>>& arr) { int n = arr.size(); int m = arr[0].size(); for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { if (arr[i][j] == 0) return n - i; } } return -1; } int count_inv(vector<vector<i...
ALGO
0.999986
4.327261
f7a9e030-805c-4ea3-b846-afe96d201deb
Jinlee0206/BOJ
프로그래머스/lv1/70128. 내적/내적.cpp
#include <string> #include <vector> using namespace std; int solution(vector<int> a, vector<int> b) { int answer = 0; for(int i = 0;i<a.size(); i++) { answer += a[i] * b[i]; } return answer; }
ALGO
0.999926
4.729621
d4735e7a-edde-4ee1-b8fd-c394b0fa8e5c
CongJyu/Pitaya
HNU-CG/HW5-Q06/HW5-Q06/main.cpp
// // main.cpp // HW5-Q06 主要元素 // // Created by cyrain on 2021/11/15. // #include <iostream> #include <algorithm> int main() { using namespace std; int n = 0; cin >> n; int a[100]; int cnt = 1, max = 0, num = 0; for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); ...
ALGO
0.999673
4.558334
2a0e9817-40c0-4a09-bb5f-eb8fad292c93
ashutoshdas1212/DSA-Everyday
deletenoderecursive.cpp
Node *rec(Node *head, int pos) { if (head == NULL) { return head; } if (pos == 0) { Node *a = head->next; delete head; return a; } head->next = rec(head->next, --pos); return head; } Node *deleteNodeRec(Node *head, int pos) { if (head == NULL) {...
ALGO
0.999824
3.835323
383817a3-4c6f-481d-928b-b65d119687ff
Vinayak1902/Coding-Problems
Trees/same_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.999943
6.887099
69d9560d-4f75-48a3-8e74-46db35e480cd
harivishvanath7/DSA
BINARY SEARCH/005_FloorCeil.cpp
#include <bits/stdc++.h> using namespace std; void floor(int arr[], int n, int tar){ int low = 0; int high = n-1; int floor = -1; while(low <= high){ int mid = low + (high-low)/2; if(arr[mid] <= tar){ floor = mid; low = mid + 1; // the largest no. - so left s...
ALGO
0.999818
4.896158
8b4d7230-5643-4d7d-ac02-b0d9bb114f28
lionzheng10/Carnd-MPC-control
src/Eigen-3.3/unsupported/doc/examples/MatrixSinh.cpp
#include <unsupported/Eigen/MatrixFunctions> #include <iostream> using namespace Eigen; int main() { MatrixXf A = MatrixXf::Random(3,3); std::cout << "A = \n" << A << "\n\n"; MatrixXf sinhA = A.sinh(); std::cout << "sinh(A) = \n" << sinhA << "\n\n"; MatrixXf coshA = A.cosh(); std::cout << "cosh(A) = \n"...
ALGO
0.975749
5.914005
2e061ba3-1b47-4bd0-9de8-8f246f1cb7ad
cwuu/Animator
IK/ik.cpp
#include "ik.h" #include "../mat.h" #include <cstdlib> #include <iostream> #include <math.h> using namespace std; /* inverse kinematics using CCD methods*/ InverseKinematics::InverseKinematics(Vec3f end, float armLength1, float armLength2) { endPoint = end;//set end point location //set arm length arm1Length...
ALGO
0.996586
3.709289
91f1fdd5-2c15-4e29-8455-238275111e11
IgorChinyakov03092003/LabRab2
LR2.2/LR2.2/LR2.2.cpp
#include <iostream> #include <stack> using namespace std; int main() { std::stack<char> s; char c; for (char c; std::cin >> c;) { switch (c) { case '(': case '{': case '[': s.push(c); break; case ')': case '}': case ']': if (s.empty() || (c==')' ...
ALGO
0.999755
4.529699
f440a84d-39fd-4a33-97de-ccab49edea49
itsshahbazhere/dsa-consistency
LeetCode-Consistency/Leet-Code-217.cpp
// https://leetcode.com/problems/contains-duplicate/description/ // TIME COMPLEXITY = O(nlogn) // SPACE COMPLEXITY = O(1) class Solution { public: bool containsDuplicate(vector<int>& nums) { sort(nums.begin(), nums.end()); for(int i=0; i<nums.size()-1; i++){ if(nums[i] == nums[i+1]){ ...
ALGO
0.999932
5.939646
ddb3d273-9ba8-424f-bd57-581336ac2802
Anzanda/baekjoon
4386.cpp
#include <bits/stdc++.h> using namespace std; #define endl "\n" #define MAXN 100 #define FastIO ios_base::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr) #define Precision cout << fixed, cout.precision(2) int n; vector<pair<double, double>> star; vector<pair<double, pair<int, int>>> edge; int parent[MAXN]; ...
ALGO
0.999737
4.191432
ca801f4f-f0db-410c-affc-18f8214a55f9
meng789987/alg
codes/lc/lc0302.cpp
#include "pch.h" /* * tags: binary search * Time(mlogn+nlogm), Space(1) * the simple solution is to use dfs to find the 4 corners; * a better solution is to binary search to test if the row/col has 1 to find the 4 corners. */ class lc0302 { public: int minArea(vector<vector<char>>& image, int x, int y) { int ...
ALGO
0.999801
6.489206
ef69d3fb-267e-477a-b3fb-e000986dabdc
EOSCogniton/Ressources2020
EL_Electrical/Cellule chrono/Main_3/Skid.cpp
// Libraries #include "Skid.h" // Variables unsigned long Time1; unsigned long Time2; // Function void Skid(){ Serial.println("Skid"); Seg_1_Write(2); while(Finish!=1){ if(analogRead(A6)<=128 || analogRead(A6)>384){ Seg_2_Write_Clear(); break; } if(St...
ALGO
0.918896
3.994305
077f29d7-e8bc-4eeb-a02c-bf98cc6bf119
islamwagih/LeetCode-Solutions
Maximum XOR of Two Numbers in an Array.cpp
class Solution { int maxLenOfBits; class TrieNode { public: char ch; TrieNode* children[2]; TrieNode(char ch) { this->ch = ch; children[0] = children[1] = nullptr; } }; string getBits(int number)...
ALGO
0.999968
5.562657
fc3efde0-12ad-4e82-b80b-ec3c16861745
duongtrieuelec/LeetSolve
cpp-leetcode/leetcode297-serialize-and-deserialize-binary-tree_level_order_queue.cpp
#include<vector> #include<queue> #include<algorithm> #include<iostream> using namespace std; /** * 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(...
ALGO
0.999847
5.436237
05d970a0-0cf3-498f-9f77-e08402277eca
masonarchhsieh/Training_LeetC
linked-list-cycle/Accepted/10-10-2020, 9_29_43 PM/Solution.cpp
// https://leetcode.com/problems/linked-list-cycle /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: bool hasCycle(ListNode *head) { vector<ListNode*> list; bool cyc...
ALGO
0.999935
5.585421
c304efd1-6be0-4730-9c03-c88eb62b1892
yujiaoki/competitive-programming
Atcoder/arc122/tempCodeRunnerFile.cpp
#include <bits/stdc++.h> #include <atcoder/all> using namespace atcoder; #define rep(i, n) for (int i = 0; i < n; i++) #define FOR(i, start, end) for (int i = start; i <= end; i++) const int INF = 1001001001; #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define Sort(a) sort(a.begin(), a.end())...
ALGO
0.999979
3.390656
2fcb01ab-f836-49f4-898a-509abc23335c
bdsadeq/uva-problem-solutions
Accepted (386)/V-7 (5)/713.cpp
//Adding Reversed Numbers (#713) //Sadeq #include<stdio.h> #include<string.h> int main() { //freopen("in.txt","r",stdin); char in1[300],in2[300],dm[5]; char ans[300]; long ln1,ln2,car,i; long tmp1,tmp2,tmp3; long cas,c; long fz,lz; scanf("%ld",&cas);//gets(dm); for(c=1;c<=cas;c++) { scanf(" %s %s",&in1,i...
ALGO
0.999935
3.586149
a9f95859-52c7-4871-8b19-c69b45ac50d9
Jayanth-BS/Leetcode-75
755-reach-a-number/reach-a-number.cpp
class Solution { public: int reachNumber(int target) { target = abs(target); int i=0, sum=0; while(sum<target){ sum+= i; i++; } while((sum-target)%2!=0){ sum -= 2*abs(sum-target); sum+=i; i++; } retu...
ALGO
0.999986
5.424251
29d178a6-e115-45bf-95d8-9b1ba39abf4a
alexandraback/datacollection
solutions_5639104758808576_0/C++/Empty007/StandingOvation.cpp
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cst...
ALGO
0.997764
3.505103
8500c114-053f-4bcf-b692-a18bb9649175
SWEG-2014-EC-Batch/META
FoP-I/Liya Tsegaye/pattern 1 square copy.cpp
#include <iostream> using namespace std; int main() { int size = 6; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { cout << "*"; } cout << "\n"; } return 0;}
ALGO
0.995641
3.428688
180af56e-58c8-4547-bed0-7f60060a1562
pouya-haghi/workload_imbalance
miniFE_skew_diff_filesv2_writeAtTheEnd/cilk/basic/BoxPartition.cpp
#include <stdio.h> #include <stdlib.h> #include <Box.hpp> #include <BoxPartition.hpp> /*--------------------------------------------------------------------*/ static int box_map_local_entry( const Box& box , const int ghost , int local_x , ...
ALGO
0.999397
4.670965
2bf64b1b-3464-4459-b6bc-9a2681389444
Pratik-Sarkate/My-codes
MathsForCP/Hackerearth/Roy_and_Birthday.cpp
// https://www.hackerearth.com/practice/math/number-theory/basic-number-theory-1/practice-problems/algorithm/roy-and-birthday/ #include<bits/stdc++.h> #define ll long long int #define fast_io std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define endl '\n' using namespace std; int m = 1e9+7; ll N = 10...
ALGO
0.999793
5.207454
4d8ec70f-01cb-4b2c-9797-2f5cbddfe03e
Ayuphys789/competitive_programming
atcoder/typical90/074.cpp
/** * Author: Ayuphys * Problem Number: typical90-074 * Title: ABC String 2 * Link to the Problem: https://atcoder.jp/contests/typical90/tasks/typical90_bv * Link to the Submission: https://atcoder.jp/contests/typical90/submissions/63188340 * Difficulty: 6 */ #include "/home/ayuphys789/competitive_programming/t...
ALGO
0.999866
4.40944
2499ee80-b4dd-4e36-8f75-f07505a11366
uniqueFire12/Leetcode
2369-check-if-there-is-a-valid-partition-for-the-array/2369-check-if-there-is-a-valid-partition-for-the-array.cpp
class Solution { public: bool f(int n, vector<int>& nums, int i, vector<int>& dp) { if(i == n) return true; if(dp[i] != -1) return dp[i]; if(i + 1 < n && nums[i] == nums[i+1] ) { if(f(n, nums, i + 2, dp)) return true; if(i + 2 < n && nums[i] == nums[...
ALGO
0.999985
5.540351
6281724f-7852-415a-9fba-287d32d1a336
FreeDurk/flutter-weather-ui
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
42b993fc-bc6c-4c03-aba1-62dd3e3e97ad
petite-etoile/AOJ
problems/2376.cpp
/* ∫ ∫ ∫ ノヽ (_ ) (_ ) (______ ) ヽ(´・ω・)ノ | / UU */ #pragma region macro #include <bits/stdc++.h> typedef long long int64; using namespace std; using P = pair<int64, int64>; typedef vector<int> vi; const int MOD = (int)1e9 + 7; const int64 INF = 1LL << 62; const int inf = 1<<30; template<class T>bo...
ALGO
0.999268
5.319157
a8fa27e2-c39d-4667-9b7d-8a53f33861e0
naruto361/LeetCodeSolutions
PartitionArrayIntoThreePartsWithEqualSum.cpp
class Solution { public: bool canThreePartsEqualSum(vector<int>& arr) { int sum=0; for(int &i:arr) sum+=i; if(sum%3!=0) return false; int k=sum/3; bool ok1=false,ok2=false,ok3=false; int temp=0; for(auto &i:arr) { temp+=i; if(!o...
ALGO
0.999768
5.9137
db1a4e5a-42cd-4334-89cd-7c5302aad495
ishandutta2007/codeforces
intothenight/normal/778/C.cpp
#include <bits/stdc++.h> using namespace std; template<class T, class U> T &ctmax(T &x, const U &y){ return x = max<T>(x, y); } template<class T, class U> T &ctmin(T &x, const U &y){ return x = min<T>(x, y); } template<size_t SZ = 26> struct trie{ int n = 1; // # of active nodes(cnt != 0) vector<array<int, SZ>> next...
ALGO
0.999864
4.141863
01e261d8-021f-43b8-9a98-31f719441d5a
parkjuida/leetcode
c/convert_sorted_array_to_binary_search_tree.cpp
#include <vector> 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), left(left), right(right) {} }; class Solut...
ALGO
0.999998
6.530198
c5b6768c-8868-48b2-ba35-e4df277dad12
ishandutta2007/codeforces
somethingnew/normal/1628/A.cpp
#include <iostream> #include "cmath" #include "string" #include "vector" #include "set" #include "algorithm" #include "map" #include "queue" #include "array" #include "numeric" #include "iomanip" using namespace std; const int INF = 1e9 + 179; void solve() { int n; cin >> n; vector<int> a(n); for (int i...
ALGO
0.999985
4.252695
2f51b8b2-62b2-4bc6-964a-e37033fab210
JackBui00/Neptune-3-Marlin-Build
Neptune_3-main/ZNP_F401_Marlin/Marlin/src/gcode/lcd/M995.cpp
#include "../../inc/MarlinConfig.h" #if ENABLED(TOUCH_SCREEN_CALIBRATION) #include "../gcode.h" #if HAS_TFT_LVGL_UI #include "../../lcd/extui/mks_ui/draw_touch_calibration.h" #else #include "../../lcd/menu/menu.h" #endif /** * M995: Touch screen calibration for TFT display */ void GcodeSuite::M995() { #if ...
ALGO
0.882208
6.670736
5eddcba6-6c0e-494c-af3c-d54aef05ff9f
S4ltF1sh/SPOJ
P142PROH_ROUND_2H.cpp
//P142PROH - ROUND 2H - Đàn kiến #include <iostream> #include <vector> #include <string> #include <cmath> #include <algorithm> using namespace std; int main() { int r, c; cin >> r >> c; cin.ignore(); vector<vector<char>> Socola(r, vector<char>(c)); for (int i = 0; i < r; i++) { for (int ...
ALGO
0.999766
3.699141
5f4bff50-f412-4f41-944a-5be6c1950a18
dreadpiratepj/emo-framework-fork
SampleApp/ios/libs/Box2D/Collision/b2Collision.cpp
#include <Box2D/Collision/b2Collision.h> #include <Box2D/Collision/b2Distance.h> void b2WorldManifold::Initialize(const b2Manifold* manifold, const b2Transform& xfA, float32 radiusA, const b2Transform& xfB, float32 radiusB) { if (manifold->pointCount == 0) { return; } switch (manifold->type) { ...
ALGO
0.999276
7.763516
83feeb8c-bf94-43cc-b5ce-769fbd289ca3
DRCL-USC/Learning_MPC_Jumping
hw_exp/eigen-3.3.7/bench/bench_reverse.cpp
#include <iostream> #include <Eigen/Core> #include <bench/BenchUtil.h> using namespace Eigen; #ifndef REPEAT #define REPEAT 100000 #endif #ifndef TRIES #define TRIES 20 #endif typedef double Scalar; template <typename MatrixType> __attribute__ ((noinline)) void bench_reverse(const MatrixType& m) { int rows = m.r...
TEST
0.968411
5.587256
1677e670-c46f-479b-806b-29bc2d662a00
uday133/Programming
Merge_Intervals.cpp
class Solution { public: int partition(vector<vector<int>> &arr, int low, int high) { int pivot_index = low; vector<int> pivot,temp; pivot = arr[high]; for(int i = low ; i <= high-1 ; i++) { if(arr[i][0] <= pivot[0]) { temp = a...
ALGO
0.999997
6.096017
aa7190e3-dc4c-41d8-8b99-51c7d19c2906
ngochahh2005/PTIT-code
CodePTIT-DSA/Generation/DSA01010 - TẬP QUÂN SỰ.cpp
#include <bits/stdc++.h> #define ll long long #define mod 1000000007 #define lmt 1000000 using namespace std; int n, k; vector<int> a; set<int> se; int solve() { int i = k-1; while (a[i] == n-k+i+1 && i >= 0) i--; if (i < 0) return k; a[i]++; int cnt = 0; if (se.find(a[i]) == se.end()) cnt++; ...
ALGO
0.999975
4.414196
a977a68b-d2d3-49d2-b584-9efd740f0e03
sarvex/leetcode-algol
solution/1600-1699/1678.Goal Parser Interpretation/Solution.cpp
class Solution { public: string interpret(string command) { string ans; for (int i = 0; i < command.size(); ++i) { char c = command[i]; if (c == 'G') ans += c; else if (c == '(') ans += command[i + 1] == ')' ? "o" : "al"; } ...
ALGO
0.999779
5.120418
8f431a4d-d188-4baa-8b94-8b2736fd3013
czimaginginstitute/AreTomo3
AreTomo/Recon/CAlignMetric.cpp
#include "CReconInc.h" #include "../Correct/CCorrectInc.h" #include <memory.h> #include <stdio.h> #include <cuda.h> #include <cuda_runtime.h> using namespace McAreTomo::AreTomo::Recon; CAlignMetric::CAlignMetric(void) { m_pVolSeries = 0L; m_gfImg1 = 0L; m_gfImg2 = 0L; m_fBinning = 8.0f; m_fPixSize = 1.0f; } CAl...
ALGO
0.937704
4.21195
4421ccb1-92b4-4a26-b4d9-099f1e46c465
smhemel/Codeforces-Online-Judge
Educational Codeforces Round 51 - A/Educational Codeforces Round 51 - A/main.cpp
#include <iostream> #include <cstring> #include <string> using namespace std; string s,s1; int main() { int n; cin >> n; while(n--){ s = ""; cin >> s; bool f = true; int lower = 0,upper = 0,digit = 0; for(int i=0; s[i]; i++){ if(islower(s[i])) lower++; ...
ALGO
0.999425
3.690954
83809d7a-a0c7-4df9-aa38-b989bb8d083b
siukwan/algorithm
hiho/1186 Coordinates.cpp
//#include<string> //#include <iomanip> #include<vector> #include <algorithm> //#include<stack> #include<set> #include<queue> #include<map> //#include<unordered_set> #include<unordered_map> //#include <sstream> //#include "func.h" //#include <list> #include<stdio.h> #include<iostream> #include<string> #include<memory....
ALGO
0.99995
3.36048
30a7bb90-402d-4282-a90e-8ab8a7643a4b
Keybinhoainam/codecpp
old document/Range_Query_10.cpp
#include<bits/stdc++.h> using namespace std; int main() { int T;cin>>T; while(T--) { long long n; cin>>n; long long a[n]; for(int i=0;i<n;i++)cin>>a[i]; int l=0,r=n-1,kq=0; while(l<=r) { if(a[l]<a[r]) { a[l+1]=a[l]+a[l+1]; l++; kq++; } else { if(a[l]>a[r]) { a[r-...
ALGO
0.999555
3.850509
7ec2ba3c-7f36-4de7-aac7-125e3ca0d780
Prathmesh311/DSA
Array/MeetingSchedule.cpp
/** * Definition of Interval: * class Interval { * public: * int start, end; * Interval(int start, int end) { * this->start = start; * this->end = end; * } * } */ class Solution { public: static bool compare(const Interval &a, const Interval &b){ if(a.start < b.start){...
ALGO
0.999982
6.096401
1794ff16-e497-401c-be0a-99bb611cd8bc
sankha-mondal/gfg-potd
2023/10. October/04-10-2023.cpp
/* Given a string in roman no format (s) your task is to convert it to an integer . Various symbols and their values are given below. I 1 V 5 X 10 L 50 C 100 D 500 M 1000 Example 1: Input: s = V Output: 5 Example 2: Input: s = III Output: 3 Your Task: Complete the function romanToDecimal() which takes a string as ...
ALGO
0.999946
6.88555
3cc6dc30-e332-4633-babf-94fc8eedf29e
ishandutta2007/codeforces
lhic/normal/866/C.cpp
#include <bits/stdc++.h> typedef long long ll; typedef long long llong; typedef long double ld; typedef unsigned long long ull; using namespace std; /* ll pw(ll a, ll b) { ll ans = 1; while (b) { while (!(b & 1)) b >>= 1, a = (a * a) % MOD; ans = (ans * a) % MOD, --b; } return ans; } */ int n; int r; int f[12...
ALGO
0.999783
3.882079
3b6a6a0f-4b12-4fc0-9575-3d9dd565d835
e-lab/turtlebot
srv_vision/viso2/libviso2/src/matcher.cpp
#include "matcher.h" #include "triangle.h" #include "filter.h" using namespace std; ////////////////////// // PUBLIC FUNCTIONS // ////////////////////// // constructor (with default parameters) Matcher::Matcher(parameters param) : param(param) { // init match ring buffer to zero m1p1 = 0; n1p1 = 0; m1p2 = 0; ...
ALGO
0.98931
6.447721
cfb99eb9-06e5-42ff-be96-1e996ea93191
kripken/llvm-js
lib/Transforms/Scalar/BasicBlockPlacement.cpp
#define DEBUG_TYPE "block-placement" #include "llvm/Analysis/ProfileInfo.h" #include "llvm/Function.h" #include "llvm/Pass.h" #include "llvm/Support/CFG.h" #include "llvm/ADT/Statistic.h" #include "llvm/Transforms/Scalar.h" #include <set> using namespace llvm; STATISTIC(NumMoved, "Number of basic blocks moved"); name...
ALGO
0.986755
7.854384
d29ebabe-a7b9-440f-a4a6-469a44ccc25d
sidjha57/Competitive
Rough/Special_Square.cpp
//template #include<bits/stdc++.h> //#include<ext/pb_ds/assoc_container.hpp> //#include<ext/pb_ds/tree_policy.hpp> //#include <ext/pb_ds/trie_policy.hpp> //using namespace __gnu_pbds; using namespace std; //typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds; //typedef trie<strin...
ALGO
0.999935
4.366867
87aedf15-51dd-46c4-bee8-1003a9df414f
Rishi-11-2/CP
B_Typing.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; using namespace chrono; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); #define debug(x...) { cout << "(" << #x << ")" << " = ( "; PRINT(x); } tem...
ALGO
0.999953
4.025115
ff86a6b7-a401-4431-b41b-8ceef9654079
premdeshmukh18/cpp-practice
Basic/factorial.cpp
#include<iostream> using namespace std; int main() { int n; cout<<"enter your number"; cin>>n; int fact=1; while(n>0) { fact=fact*n; n--; } cout<<fact; return 0; }
ALGO
0.99996
3.916294
6e07a758-6fb8-4c44-bfc2-0c93918e1d10
DreadArceus/Codeforces
Contests/Division 3/Round #661/C.cpp
#include <iostream> #include <vector> #include <unordered_map> using namespace std; int solve(vector <int> v) { unordered_map<int, int> m; int max = 0; for(int sum = 2; sum <= 100; sum++) { vector<int> local(v); for(int i = 0; i < v.size(); i++) { if(!local[i]) { continue; ...
ALGO
0.999924
4.968753
76242e36-b20d-433d-b693-3f3e847e5adc
tomatotech/mmallow_frameworks_av
media/libstagefright/codecs/amrnb/dec/src/dec_gain.cpp
/* ------------------------------------------------------------------------------ Pathname: ./audio/gsm-amr/c/src/dec_gain.c Funtions: dec_gain Date: 01/31/2002 ------------------------------------------------------------------------------ REVISION HISTORY Description: Updating include file lists, and othe...
ALGO
0.999661
5.635387
589dbff1-5e73-4537-b6d0-958e5c44d850
legend507/MyLeetCodeSolutions
LeetCodeNo.506/main.cpp
class Solution { public: vector<string> findRelativeRanks(vector<int>& score) { int N = score.size(); // Priority queue elements with "higher priority" is always on the top of the queue. priority_queue<pair<int, int>> heap; for (int i = 0; i < N; i++) { // By def...
ALGO
0.999851
6.338604
006292fa-2ab3-4614-9a48-312fcc2183fa
ishandutta2007/codeforces
kevinxiehk/normal/1467/D.cpp
#include <bits/stdc++.h> #define mp make_pair #define pb emplace_back #define fi first #define se second #define int long long #define MOD 1000000007LL using namespace std; signed main(){ ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0); int n,k,q; cin>>n>>k>>q; int times[n+5][k+5]; mems...
ALGO
0.99995
3.600355
98408064-0826-439f-88a2-cca4c22b6b01
BinomialSheep/Competitive
AtcoderProblems/BootCampEasy/049_PictureFrame.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; // #include <atcoder/all> // g++ --std=c++14 -I "/mnt/c/Program Files (x86)/Microsoft Visual // Studio/2019/Community/VC/Tools/MSVC/14.29.30037/include" code.cpp #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int h, w; cin >> h ...
ALGO
0.999679
3.956123
8f1564d7-0c34-4ca6-a248-bb50b46c7f66
charliegeannew/codeSpaceGit
leetcode/finish/5_3.cpp
/************************************************************************* * File Name: 5.cpp * Creat Time: 2021年04月13日 星期二 21时16分37秒 * Author :Charliegean * Mail :<EMAIL> *************************************************************************/ #include <iostream> #include <string> #include <stdlib.h> using namespac...
ALGO
0.999936
4.274624
faaf973e-77eb-4c5c-bdc2-d559c7c4c15b
saurabhsaini400/Data-Structures
606-construct-string-from-binary-tree/606-construct-string-from-binary-tree.cpp
class Solution { public: string tree2str(TreeNode* root) { string ans = to_string(root->val); if (root->left) //left side check ans += "(" + tree2str(root->left) + ")"; if (root->right) { //right side check if (!root->left) ans += "()"; //left side not present, but right side present ans += "(" + tre...
ALGO
0.999884
6.584644
dc94d433-d86f-4058-ad62-dc6ffa03d776
deepin-community/android-platform-system-core
fastboot/fastboot_driver.cpp
#include "fastboot_driver.h" #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <algorithm> #include <chrono> #include <fstream> #include <memory> #include <regex> #include <vector> #include <android-base/file.h> #include <android-base/mapped_file.h> #include <an...
TOOL
0.850811
7.36389
6f464c43-f6b0-4551-a5bb-b9e2e765a974
shailendji/nefertiti
engines/sword25/util/lua/ltm.cpp
#include <string.h> #define ltm_c #define LUA_CORE #include "lua.h" #include "lobject.h" #include "lstate.h" #include "lstring.h" #include "ltable.h" #include "ltm.h" const char *const luaT_typenames[] = { "nil", "boolean", "userdata", "number", "string", "table", "function", "userdata", "thread", "proto", "u...
TOOL
0.853359
7.543264
977ced3e-6ca1-46a4-8b0f-4beac6e55255
tushar-kumar/HacktoberFest2022
Dynamic Programming/kadanesAlgo.cpp
#include<iostream> using namespace std; int maxSumSubArray(int arr[] , int n){ int currentSum = arr[0]; int maxSum = arr[0]; for(int i=1; i<n; i++){ if(currentSum >= 0){ currentSum += arr[i]; } else currentSum = arr[i]; if(currentSum > maxSum){ maxSum ...
ALGO
0.999914
4.941195
e9e196f9-19c3-45f1-978d-8b8d997574be
lantimilan/topcoder
CODEFORCE/prob148C.cpp
#include <cstdio> using namespace std; int main() { int n, a, b; scanf("%d%d%d", &n, &a, &b); int ta=a, tb=b; int s[105]; int x=0, sum; s[0]=1; sum=s[0]; while(b--) { s[++x] = sum+1; sum+=s[x]; } if (s[x]>50000) { printf("-1\n"); return 0; } int t=s[x]; for(++x;...
ALGO
0.99973
3.052598
1c429d40-751b-40f2-9bdf-c3f07596d304
hymsly/CompetitiveProgramming
codechef/SeptemberChallenge/ANDSQR.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = (1e5); const ll INF = (1<<30)-1; ll A[N+2]; ll ST[262144]; ll N; vector<ll> square; bool isSquare(ll x){ int p = lower_bound(square.begin(),square.end(),x) - square.begin(); if(p==square.size()) return false; return (square[p]==x); }...
ALGO
0.99984
4.193156
47e46f32-a473-4099-b6e4-d3ee97c57c7c
suhaas02/Data-structures-and-algorithms
leetcode/bit-manuplation/steps-to-reduce-a-number-to-zero.cpp
//number of steps to reduce a number to zero; //problem link: https://leetcode.com/problems/number-of-steps-to-reduce-a-number-to-zero/submissions/ #include<bits/stdc++.h> using namespace std; int numberOfSteps(int num) { if(num <= 0) return 0; if(num % 2 == 0) { return (1 + numberOfSteps...
ALGO
0.999946
5.277922
4ccf1ebe-2480-481e-a32d-b615ddc1a64f
ArushNo1/Competitive-Programming
CSES/Static_Range_Sum_Queries.cpp
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef long long ll; typedef vector<ll> vll; typedef vector<vll> vvll; ty...
ALGO
0.999914
4.103533
b95624b6-1a72-431d-8476-ddc11cf4230e
TinkerEdgeR-Android/frameworks_av
media/libstagefright/codecs/amrnb/common/src/lsp.cpp
/* Pathname: ./audio/gsm-amr/c/src/lsp.c Functions: ------------------------------------------------------------------------------ REVISION HISTORY Description: Updated template used to PV coding template. Changed to accept the pOverflow flag for EPOC compatibility. Description: Per review comments, added pOve...
ALGO
0.896029
3.748609
e0afe53c-1fb8-4862-8a32-bd28a01a71bd
mrwhalebones/thc
src/sync.cpp
#include "sync.h" #include "util.h" #include <boost/foreach.hpp> #ifdef DEBUG_LOCKCONTENTION void PrintLockContention(const char* pszName, const char* pszFile, int nLine) { LogPrintf("LOCKCONTENTION: %s\n", pszName); LogPrintf("Locker: %s:%d\n", pszFile, nLine); } #endif /* DEBUG_LOCKCONTENTION */ #ifdef DE...
TOOL
0.966143
5.913816
c2ae37b9-65bc-4431-9d09-924fc1dc03d7
balabit-deps/balabit-os-9-llvm-toolchain-12
libcxx/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_comp.pass.cpp
// <algorithm> // template<ForwardIterator Iter, StrictWeakOrder<auto, Iter::value_type> Compare> // requires CopyConstructible<Compare> // bool // is_sorted(Iter first, Iter last, Compare comp); #include <algorithm> #include <functional> #include <cassert> #include "test_macros.h" #include "test_iterators.h" ...
TEST
0.992704
6.740807
cbc2a375-6bdb-4a76-93a9-acf1ccd1058f
prodius7/Trial
new.cpp
//Pass by value and Pass by references. #include<bits/stdc++.h> using namespace std; void increment(int &n, int n1){ n++; n1++; } int main(){ int a=3, b=5; cout<< a << " " << b << endl; increment(a,b); cout<< a << " " << b << endl; }
ALGO
0.99901
4.443291
8c001a50-2fd0-4ce9-b79b-93e397054087
Imraan002/My-c-programs
digit_sum.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int dp[20][100][2]; ll int solve(string & num, int dig, int sum,bool tight) { ll int k=0; if(dig==0) return sum; if(dp[dig][sum][tight]!=-1) return dp[dig][sum][tight]; int ub(0); if(tight) { ub = num[num.size()-dig]-'0'; } else...
ALGO
0.999973
4.751162
18ddf3df-db50-4331-b7d6-b90c572b2d72
Rowadz/codeforces
src A/A110 Nearly Lucky Number.cpp
#include <iostream> #include <string> using namespace std; int main() { //while (true) //{ string n; cin >> n; int coutner = 0; for (int i = 0; i < n.length(); i++) { if (n[i] == '4' || n[i] == '7')coutner++; } int x = coutner /10; int xx = coutner / 100; if (coutner == 7 || coutner == 4 || ...
ALGO
0.999268
4.037611
181c3588-268f-4261-acf0-4cf8f60c110d
our-bright-future/junkpark-algorithm
cpp/boj/11650.cpp
#include <bits/stdc++.h> using namespace std; int n; vector<pair<int, int>> v; int main(){ cin >> n; for (int i = 0; i < n; i++){ int x, y; cin >> x >> y; v.push_back(make_pair(x, y)); } sort(v.begin(), v.end()); for (int i = 0; i < n; i++){ cout << v[i].first << ...
ALGO
0.999701
4.470073
8add93f9-c8dc-42a5-9cc6-336a9eb32793
KIMJUHEEEEE/codetree-TILs
241003/메이즈 러너/maze-runner.cpp
#include <iostream> using namespace std; int N, M, K; int map[11][11]; int dx[4] = { 0,0,1,-1 }; int dy[4] = { -1,1,0,0 }; pair<int, int> exits; struct p { int y; int x; int sumdis; int state; }; p person[11]; int direction(int y, int x) { int now = abs(y - exits.first) + abs(x - exits.second); ...
ALGO
0.99992
4.721854
203c4d51-7629-412a-8cbe-86714b7a8b49
morshedalam3/codeforce
Round-910-div2/a.cpp
/****************Bis'Millah Hir Rah'Manir Rahim *************** * Author: Morshed Alam * * SyntaxSorcerer * *************************************************************** problem link: */ #include<bits/stdc++.h> #define ll long long #...
ALGO
0.999824
3.898698
7ad94e21-3a31-4bfc-8b90-a5e1bc6e5920
Programmer4522/Cpp
addition.cpp
#include<iostream> using namespace std; int main() { int a,b,c; cout<<"enter a:"; cin>>a; cout<<"enter b:"; cin>>b; c=a+b; cout<<"value of c is "<<c; return 0; }
TOOL
0.916598
3.269332
0c53a1d0-1cd1-4494-b50a-62a5ef68c293
hirakuuuu/kyopro
virtual_contest/NUCODER/20240502/1.cpp
#include <bits/stdc++.h> // #include <atcoder/all> using namespace std; // using namespace atcoder; #define rep(i, a, n) for(int i = a; i < n; i++) #define rrep(i, a, n) for(int i = a; i >= n; i--) #define inr(l, x, r) (l <= x && x < r) #define ll long long #define ld long double // using mint = modint1000000007; // u...
ALGO
0.999964
5.229374
8a0027f6-1344-44b0-8df4-6ba19ebfb507
lockystocky/EssentialsInC-
Chapter5/5.3/Lab_5_3_13_6.cpp
#include <iostream> using namespace std; class Node { public: Node(int val); ~Node(); int value; Node* next; }; Node::Node(int val) : value(val), next(nullptr) { //cout << "+Node" << endl; } Node::~Node() { //cout << "-Node" << endl; } class List { public: List(); ~List(); int size(); void push_front(int valu...
ALGO
0.924025
3.951021
b39f1324-e7fe-49cd-a138-5e6b35f61f8d
shesay-noway/imageProcessing-matlab-libraries
Matlab imaging/Matlab toolbox/toolbox_fast_marching/mex/gw/gw_geodesic/GW_GeometryAtlas.cpp
/*------------------------------------------------------------------------------*/ /** * \file GW_GeometryAtlas.cpp * \brief Definition of class \c GW_GeometryAtlas * \author Gabriel Peyr * \date 2-4-2004 */ /*------------------------------------------------------------------------------*/ #ifdef GW_SC...
ALGO
0.998056
5.975611
6f4af75e-0d8b-4f24-bc62-7e2a47520be1
gunh0/cpp-atoz
Beginning C++17 From Novice to Professional/Source/05_Arrays_and_Loops/03_Floating-point_control_in_a_for_loop.cpp
// Floating-point control in a for loop #include <iostream> #include <iomanip> int main() { const double pi{3.14159265358979323846}; // The famous pi const size_t perline{3}; // Outputs per line size_t linecount{}; // Count of output lines for (double radius{0.2}; radius <= 3.0; radius += 0.2) { std:...
ALGO
0.994697
5.794051
a6e0a5ed-5976-4774-9060-03833026f59c
mirzaazwad/Competitive-Programming
Resources/MathewSamuel95Codes/BitManipulation/count_ones/count_ones.cpp
// @author Aureliano Yepez // @date Oct 22, 2018 #include <iostream> using namespace std; short count_ones(unsigned int x) { short num_bits = 0; while (x) { num_bits += x & 1; // mask one x >>= 1; } return num_bits; } int main() { int number = 10; // use any number short result = count_ones(number...
ALGO
0.999328
5.77509
90fa2bfe-2b54-431f-8bad-73f8a4d99ad2
ThedRk1607/CPtemplates
AZ/GeoMetry.cpp
//valid pts bitween circle r to r+1 in circle pb-1971F - Circle Perimeter void solve(){ int r;cin>>r; int ht=r; int ans=0; for(int i=0;i<=r;i++){ while(i*i+ht*ht>=(r+1)*(r+1))ht--; int cop=ht; while(i*i+cop*cop>=r*r and cop>0){ cop--; ans++; } } cout<<ans*4<<nl; }
ALGO
0.999417
3.774983
73ae83ec-3e3e-468c-88ef-9a2a26427963
mashingan/exampleriments
Flutter/learn-flutter-fast/builder_widget_listview/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.997045
6.76073
9b8f2a00-4e95-455d-91a7-ed8786f12b5f
AndHager/SysCallStubber
llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/copy.pass.cpp
// <vector> // vector(const vector& v); #include <vector> #include <cassert> #include "test_macros.h" #include "test_allocator.h" #include "min_allocator.h" #include "asan_testing.h" template <class C> void test(const C& x) { typename C::size_type s = x.size(); C c(x); LIBCPP_ASSERT(c.__invariants()); ...
TEST
0.857759
6.252359
680bfdb1-7367-461f-9b4a-6e142d0cc835
murphyhoucn/NPUCppCode
LeetCode/2236_root-equals-sum-of-children.cpp
#include <iostream> // struct TreeNode { // int val; // 节点中存储的数据 // TreeNode *left; // 指向左子树的指针 // TreeNode *right; // 指向右子树的指针 // // 构造函数 // TreeNode() : val(0), left(nullptr), right(nullptr) {} //这是一个默认构造函数,它将节点的值初始化为0,左子树和右子树指针初始化为nullptr(表示空指针)。 // TreeNode(int x) : val(x), left(nullptr), ...
ALGO
0.999755
5.731624
0a70b0a0-6935-4300-b200-d4df9d6bee4c
v-pereskokov/Technopark
Algorhitm/m1/7_1.cpp
#include <stdio.h> #include <vector> #include <algorithm> #include <cassert> using ulli = unsigned long long int; struct Athlete { Athlete(const ulli m, const ulli s) : _m(m), _s(s) {} ulli _m; ulli _s; }; std::size_t __maxPyramid__(const std::vector<Athlete> &athletes) { std::vector<Athlete> result{ a...
ALGO
0.999933
4.405467
de016b19-0ffd-471a-b102-08ff8c0b2677
shm512/CG2014_1
src/matrix_example.cpp
#include <iostream> #include "matrix.h" #include "io.h" using std::cout; using std::endl; using std::tuple; using std::get; using std::tie; using std::make_tuple; // Matrix usage example // Also see: matrix.h, matrix.hpp for comments on how filtering works class BoxFilterOp { public: // Radius of neighbourhood,...
TOOL
0.91167
4.464459
f9fba7b2-64a8-4878-9af8-81c331ddaeac
aluque1/FAL
03-dv/p40/sol.cpp
// Nombre del alumno Alejandro Luque Villegas // Usuario del Juez A75 #include <fstream> #include <iomanip> #include <iostream> #include <vector> using namespace std; // función que resuelve el problema int lower(vector<int> const &v, int ini, int fin) { if (ini >= fin) return ini; // cb : vector vacio else ...
ALGO
0.999823
4.362422
294471ec-3d81-4e35-b877-cd028a10fd56
friendlyarm/android_frameworks_av
services/audioflinger/AudioResamplerCubic.cpp
#define LOG_TAG "AudioSRC" #include <stdint.h> #include <string.h> #include <sys/types.h> #include <cutils/log.h> #include "AudioResampler.h" #include "AudioResamplerCubic.h" namespace android { // ---------------------------------------------------------------------------- void AudioResamplerCubic::init() { me...
ALGO
0.873085
7.001074
16f9ad07-140c-4479-8bb3-a6b1b8095a4e
phines/acsimsep
ThirdParty/Coin-Bonmin/Bonmin/src/Algorithms/BonSubMipSolver.cpp
// Code separated from BonOaDecBase to try to clarify OAs #include "BonSubMipSolver.hpp" #include "BonminConfig.h" #include "CbcModel.hpp" #include "CbcStrategy.hpp" #include "OsiAuxInfo.hpp" #include "OsiClpSolverInterface.hpp" #include <climits> #ifdef COIN_HAS_CPX #include "OsiCpxSolverInterface.hpp" #include "cple...
ALGO
0.99951
5.898094
25a321d1-fc11-4d8a-bca3-cfcf3023196d
knhooo/Cpp-Study
Chapter07/07-5/BankingSystemVer05.cpp
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cstring> using namespace std; class Account { private: int id;//계좌번호 char* name;//이름 int money;//잔액 public: Account(int pid, char* pname, int pmoney)//생성자 :id(pid), money(pmoney) { name = new char[strlen(pname) + 1]; strcpy(name, pname); } Ac...
TOOL
0.877453
4.369891
6cae99f4-b0f9-4e3b-8b39-d98ae3f7a195
ishandutta2007/codeforces
leapfrog/normal/1388/E.cpp
//{{{ #include<bits/stdc++.h> using namespace std;typedef long long ll; template<typename T>inline void read(T &x) { x=0;char c=getchar(),bz=0; for(;c<48||c>57;c=getchar()) if(!(c^45)) bz=1; for(;c>=48&&c<=57;c=getchar()) x=(x<<1)+(x<<3)+(c^48); bz?x=-x:x; }/*}}}*/ int n,L[2005],R[2005],Y[2005],at,bt;double b[40000...
ALGO
0.999846
3.237767
1171b90b-2036-468a-8568-423fb1c50af9
SanketDeshmukh007/Data-Structures-and-Algorithms
Dynamic Programming/3 Coin Change.cpp
#include <bits/stdc++.h> using namespace std; // Recursive Solution -- TLE // TC -- O(N^N) and SC -- O(N) int Rec(vector<int> &coins, int amount) { // Base Case if (amount == 0) return 0; if (amount < 0) return INT_MAX; int mini = INT_MAX; for (int i = 0; i < coins.size(); i++) ...
ALGO
0.999982
5.695187
2e286a50-3595-49fb-900a-aa1a19d94476
Coder02Aniket/C-Plus-Plus-Codes
love babbar dsa series/Code/Recursion/FibbonaciNumbers.cpp
#include<bits/stdc++.h> using namespace std; int fibbonaci(int n){ if(n == 0){ return 0 ; }else if( n== 1){ return 1 ; } return fibbonaci(n-1) + fibbonaci(n-2); } int main(){ ios::sync_with_stdio(0); cin.tie(0); int n ; cin >> n; fibbonaci(n); return 0; }
ALGO
0.999977
4.594683
bbe03076-e0aa-4dcb-8663-915a0ff87a5d
eTakazawa/procon-archive
atcoder.jp/abc113/abc113_d/Main.cpp
#include <bits/stdc++.h> using namespace std; const long long mod = 1000000007; int main(void) { int H, W, K; cin >> H >> W >> K; if (W == 1) { cout << 1 << endl; return 0; } long long amida[101][16]; memset(amida, 0, sizeof(amida)); amida[0][0] = 1; for (int h = 0; h < H; h++) { for (int...
ALGO
0.999912
4.405156
c23b0621-a88f-4a87-a6ef-58dbb4562926
ghugesachin0806/Data_Structure_n_Algorithm
01_STL/41_Array_to_Vector_conversion.cpp
#include <bits/stdc++.h> using namespace std; // vector<int> vect(array_name , (array_name + size_of_array)) int main() { int gfg[] = {5, 6, 7, 7, 6, 5, 5, 6}; vector<int> vect(gfg, gfg + 8); for (int i = 0; i < vect.size(); i++) cout << vect[i] << " "; } // 5 6 7 7 6 5 5 6
ALGO
0.999282
3.771072
89917fa9-5afe-4f3b-8a7f-f0a98b671b1c
nikitaxgusev/My_task_Cplusplus
Integral/ValueOfIntegral/ValueOfIntegral/VIntegral.cpp
#include "VIntegral.h" float VIntegral::myintgral_func(float x) { return (x*x) / (x + x); //return (2*(x + x)) / x;; //return x+1; } float VIntegral::calculate_integral(float a, float b) { float n = 8.0, h=0.0, S = 0.0, x = 0.0; h = (b - a) / n; for (int i = 0; i<n; i++) { x = a + h*(i + 0.5); S += myintgr...
ALGO
0.998484
4.923157
b46ab99f-7037-4792-a0e4-c7e836fd3f08
tongfs/leetcode
35.搜索插入位置.cpp
/* * @lc app=leetcode.cn id=35 lang=cpp * @lcpr version=21909 * * [35] 搜索插入位置 */ #include "mylib.h" // @lc code=start class Solution { public: int searchInsert(vector<int>& nums, int target) { int l = 0, r = nums.size(); while (l < r) { int mid = l + r >> 1; if (nums[mid...
ALGO
0.999969
6.570108
21834ad7-3596-4d45-847a-a962eb2a9f87
shinvipo/CTDL
Contest/Contest7/b8.cpp
/* Note: */ #include<stack> #include<string> #include<iostream> #define xxxxx ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); using namespace std; typedef long long ll; typedef unsigned long long ull; const ll MAX = 1E7 + 5; const ll mod = 1E9 + 7; void Init() { string s; cin >> s; stack<char> st; ...
ALGO
0.999865
4.156757
c0c8269f-baf0-4b0b-b576-5be5cf5922b1
lyahdav/CppWinRtUwpSandbox
SharedContent/cpp/GameContent/StereoProjection.cpp
#include "pch.h" #include "StereoProjection.h" #if !defined(XMASSERT) #define XMASSERT(Expression) ((void)0) #endif // !XMASSERT using namespace DirectX; void StereoCreateDefaultParameters(_Out_ STEREO_PARAMETERS* stereoParameters) { XMASSERT(stereoParameters != nullptr); // Default assumption is 1920x1200 ...
TOOL
0.961137
6.876132
209b9422-202c-4fb2-ad74-08ac47d94bb6
thepluck/CP-Training
Private/AnhVuong/School/Codes/distance3.cpp
#include <bits/stdc++.h> using namespace std; using type = long double; const type EPS = 1e-9; bool almost_equal(type a, type b) { return abs(a - b) < EPS; } struct point { type x, y; point(type x = 0, type y = 0): x(x), y(y) {} point& operator -= (const point &o) { x -= o.x; y -= o.y; ret...
ALGO
0.999817
4.261783
9e96f405-c82b-448a-a63a-c346ba0686db
ishandutta2007/codeforces
hydroshiba/normal/1676/B.cpp
#include "bits/stdc++.h" using namespace std; void solve(){ int n; cin >> n; vector<int> arr(n); for(int &i : arr) cin >> i; int ans = INT_MAX; for(int i = 0; i < n; ++i){ int sum = 0; for(int j = 0; j < n; ++j){ if(arr[j] < arr[i]){ sum = INT_MAX...
ALGO
0.999897
5.462167