uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
107044d0-da51-46e6-bf43-1e35dff7c197
yu1mu/algorithm-baekjoon
cpp-automata_50-100/1546.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(void){ int num; cin >> num; vector<double> v; for (int i = 1; i <= num; i++){ int score; cin >> score; v.push_back(score); } double max = *max_element(v.begin(), v.end()); f...
ALGO
0.99924
4.248608
d74488c2-458b-4a7f-ab0f-c57393fde4dd
icanuserasengan/practice
6-1 lesson/pointer觀念 數字SWAP舉里說明 成功.cpp
#include<stdio.h> void swap(int *x,int *y){ int temp; temp = *x; *x = *y; *y = temp; printf("swap function:\na = %d \nb = %d\n",*x,*y); } int main(){ int a = 10, b = 20; swap(&a,&b); printf("main:\na = %d \nb = %d\n",a,b); return 0; }
ALGO
0.989635
4.192954
36d94694-3333-4075-b810-0465adad23fc
newpolaris/algorithm
baekjoon/2455.cpp
#include <iostream> #include <cstdio> using namespace std; int main() { int n = 4; int cnt = 0; int maxcnt = 0; while (n--) { int a, b; scanf("%d%d", &a, &b); cnt = cnt + b - a; maxcnt = max(cnt, maxcnt); } cout << maxcnt << endl; return 0; }
ALGO
0.99948
3.405625
aecb4689-e7b9-4ca8-8a56-d2e67784366c
aneeqaf/Quantum-Simulation
QuantumSim/compression/compression/gnuplot-iostream/boost_1_75_0/libs/geometry/example/ml02_distance_strategy.cpp
// Boost.Geometry (aka GGL, Generic Geometry Library) #include <boost/geometry.hpp> #include <boost/geometry/strategies/cartesian/distance_pythagoras.hpp> #include <boost/geometry/geometries/point_xy.hpp> using namespace boost::geometry; int main() { typedef model::d2::point_xy<double> point_xy; point_xy p1(0.0,...
ALGO
0.971417
4.546989
0a1a2db3-a34b-4696-b5e1-5f88ad4298ff
natalia-antileo/Algoritmos-Dividir-y-Conquistar
Selection Sort/SelectionSort.cpp
#include <bits/stdc++.h> using namespace std; using namespace std::chrono; //Implementación de Selection Sort void selectionSort(vector<int>& arr) { int n = arr.size(); // Obtiene el tamaño del arreglo // Recorre el arreglo, excluyendo el último elemento en la primera pasada for (int i = 0; i < n - 1; i+...
ALGO
0.999126
5.873065
6ffba8bc-8a4e-4758-904e-5d8fd49cbb8a
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_9276_8.cpp
#include <bits/stdc++.h> using namespace std; void fastio() { ios_base::sync_with_stdio(false); cin.tie(NULL); } int main() { long long int t; t = 1; while (t--) { long long int n, i, k, t, count[101] = {0}; cin >> n; int z = n; while (n--) { cin >> t; while (t--) { cin >> ...
ALGO
0.999912
3.444309
9d3d24b1-7f22-497e-a576-88d066154702
parasrawat007/C-Plus-Plus
25_SwitchCase.Cpp
#include<iostream> using namespace std; int main() { /* switch case : It is equivalent to if else ladder but here condion is always ==. switch (expression) { case constant1: group-of-statements-1; break; ...
ALGO
0.980869
3.37526
ae0b50f2-78b1-4572-8f79-73d0a3b3f667
hotwolf/WBPainter
firmware/Marlin/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RE/variant.cpp
#include "pins_arduino.h" #ifdef __cplusplus extern "C" { #endif // Digital PinName array const PinName digitalPin[] = { PA_0, // Digital pin 0 PA_1, // Digital pin 1 PA_2, // Digital pin 2 PA_3, // Digital pin 3 PA_4, // Digital pin 4 PA_5, // Digital pin 5 PA_6, // Digital pin 6 PA_7, // Dig...
CONFIG
0.908609
6.350003
5c7c875b-5c8b-41b5-9a4b-8912223c4792
vats0914/CrackYourPlacement
array/974.subarray-sums-divisible-by-k.cpp
//DSA Sheet by Arsh - Updated 2023 // https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ // https://leetcode.com/submissions/detail/984819031/ // https://twitter.com/VatsalGupt81731 //#CrackYourInternship //#CrackYourPlacement /* * @lc app=leetcode id=974 lang=cpp * * [974] Subarray Sums Divisible by K...
ALGO
0.999931
6.199559
ca218fc1-94cd-4b49-8213-9abc4f7c8253
weixsong/algorithm
leetcode/1.cpp
#include <vector> #include <algorithm> #include <iostream> using namespace std; bool comparer(pair<int, int> i, pair<int, int> j) { return (i.first < j.first); } // solution: sort nums and record the num's indices, then search from left and right class Solution { public: vector<int> twoSum(vector<int>& nums,...
ALGO
0.999982
5.565691
b5c0dad6-9579-4015-880d-a02d6db0dd05
Abhishek0075/Data-Structure-Sem2
BST/BST2.cpp
//max avoid this //make 2 insert into 1 #include<iostream> using namespace std; class tree { int data; tree *left, *right; public: tree(int data) { this->data = data; this->left = NULL; this->right = NULL; } tree* insert(tree *root, int data) { i...
ALGO
0.999711
4.715812
70dfef1a-d37c-4765-b23c-bf55e59108b1
Rohit31125/dsa_folder
Questions/verticaltraverse.cpp
#include<iostream> using namespace std; #include<vector> #include<queue> #include<map> class solution { public: //Function to find the vertical order traversal of Binary Tree. vector<int> verticalOrder(Node *root) { map<int,map<int,vector<int>>> nodes; queue<pair<Node*,pair<int,int>>> q;...
ALGO
0.999998
5.36247
ddf0729d-40ce-4366-ba36-6a9899d1b35e
ishandutta2007/codeforces
calabash_boy/normal/1063/F.cpp
#include<bits/stdc++.h> using namespace std; const int maxn = 5e5 + 100; typedef long long ULL; const int Base = 137; const int Mod1 = 2000029; int maxL1[Mod1 + 1]; int Hash1[maxn]; char s[maxn]; int n; bool dp[2][maxn]; int main(){ scanf("%d",&n); scanf("%s",s+1); memset(dp,1,sizeof dp); maxL1[0]= n + ...
ALGO
0.999987
3.821702
9399d87d-a202-4746-8351-d4d46a2ddf27
QDuyPhan/easy_english
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.998733
6.76775
aeebc84f-e702-4e56-88ec-b3f689e99975
ishandutta2007/codeforces
stevenkplus/normal/1510/K.cpp
// =========== Template ========== // #include <bits/stdc++.h> using namespace std; int fastio() { ios_base::sync_with_stdio(false); cout << fixed << setprecision(10); cin.tie(nullptr); return 0; } int __fastio = fastio(); template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p); template<...
ALGO
0.999909
4.025902
43ead4ea-11fb-4b13-9883-bb30c43a562f
ToothedTomb/c-BathSpaUni
Chapter-5-Functions/Exercises/Find_The_Max.cpp
/* Declare a function called max_two that compares two numbers and RETURNS the maximum value back to the main program where it should be output. The program should obtain the values from the user in the main function and pass these to the function using appropriate parameter values. */ #include <iostream> using name...
ALGO
0.99965
5.843967
89866381-1981-495f-8ae4-b7babfcb9a5d
akashghadge/competitive-programming
Striver Sheet/1 Math/43 A. Dungeon.cpp
/* You are playing a new computer game in which you have to fight monsters. In a dungeon you are trying to clear, you met three monsters; the first of them has a health points, the second has b health points, and the third has c. To kill the monsters, you can use a cannon that, when fired, deals 1 damage to the select...
ALGO
0.99988
4.587398
264a5afe-7be6-4d93-a22e-468549a5b593
Tanay-Gupta/hacktoberfest2022
Cpp/Programs/single-linked-list.cpp
#include <iostream> using namespace std; struct Node { int data; struct Node *next; }; struct Node* head = NULL; void insert(int new_data) { struct Node* new_node = (struct Node*) malloc(sizeof(struct Node)); new_node->data = new_data; new_node->next = head; head = new_node; } void display() { stru...
ALGO
0.999538
4.215797
36fc55ea-6eea-4c23-9f35-9c0481958b39
khelvendra/assignment
40. C program to check sparse AND transpose matrix.cpp
#include <stdio.h> #define ROWS 5 #define COLUMNS 5 int main(void) { int matrix[ROWS][COLUMNS] = {{0, 1, 0, 0, 0}, {0, 0, 2, 0, 0}, {0, 0, 0, 3, 0}, {0, 0, 0, 0, 4}, {0, 0, 0, 0, 0}}; in...
ALGO
0.99931
4.353375
25f3f071-39fd-4760-b842-c3d737ec3c4e
nobinov/image_resizer_server
include/boost_1_75_0/libs/spirit/example/karma/num_matrix.cpp
/////////////////////////////////////////////////////////////////////////////// // // This sample demonstrates a generator formatting and printing a matrix // of integers taken from a simple vector of vectors. The size and the // contents of the printed matrix is generated randomly. // ////////////////////////////...
TOOL
0.884831
5.799753
529b1b42-facc-4997-ad70-68e3d0f1bda8
Hopey-jr/AERSP_424_Final_Project
src/PseudoInverse.cpp
//Description: // The purpose of this function is to find the pseudo-inverse of a non-square matrix using the Eigen library //Input: // mat - The matrix that the user wants to invert // tolerance - The tolerance determined to be valid to produce a valid inverse //Output: // pinv - The inv...
ALGO
0.999643
3.940705
882718f6-989f-4415-b310-9820a1d61126
dcastrelo/PrusaBear-Ar
Marlin-2.1.2.1/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/variant.cpp
#include "pins_arduino.h" #ifdef __cplusplus extern "C" { #endif // Digital PinName array const PinName digitalPin[] = { PA_0, // Digital pin 0 PA_1, // Digital pin 1 PA_2, // Digital pin 2 PA_3, // Digital pin 3 PA_4, // Digital pin 4 PA_5, // Digital pin 5 PA_6, // Digital pin 6 PA_7, // Dig...
CONFIG
0.890175
6.350003
fae35319-88e2-4f52-af6d-fe2644c9f54a
nisarg0606/Leetcode
sortcolor.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int class Solution { public: void sortColors(vector<int>& nums) { int n=nums.size(); int left=0,right=n-1; int i=0; while(i<=right){ if(nums[i]==0){ swap(nums[i],nums[left]); ...
ALGO
0.999949
5.471787
cd06a2d3-35d1-45cc-8a40-c1a758cf6f7e
Gaurav-20/LeetCode-Solutions
53-maximum-subarray/53-maximum-subarray.cpp
class Solution { public: int maxSubArray(vector<int>& nums) { int globalMax = nums[0], localMax = 0; for (int& n : nums) { localMax += n; globalMax = max(globalMax, localMax); if (localMax < 0) { localMax = 0; } } return...
ALGO
0.999949
6.366386
e80471e6-80b3-4d91-97af-ecf8c7d996d5
AlexanderPRM/codeforces
problems/B/463.cpp
#include <iostream> #include <vector> using namespace std; int main() { size_t n; cin >> n; long long res = 0; long long energy = 0; int x = 0, y; for (size_t i = 1; i <= n; i++) { cin >> y; energy += x - y; if (energy < 0) { res += -energy; energy ...
ALGO
0.999937
4.168566
bab08519-2d4f-429a-9bfe-c56094f4d2dd
Pranjalis241/Leetcode-Daily-Practice
2057-smallest-index-with-equal-value/2057-smallest-index-with-equal-value.cpp
class Solution { public: int smallestEqual(vector<int>& nums) { bool flag = false; int res = -1; for(int i = 0; i<nums.size(); i++) { if(flag == false) { if(i % 10 == nums[i]) { res = i; ...
ALGO
0.999853
5.683639
62020217-9f09-48cb-bc8b-c6de360f9c5f
pqLee/openvino-2019-3
thirdparty/mkl-dnn/src/cpu/nspc_batch_normalization.cpp
#include <assert.h> #include <math.h> #include "c_types_map.hpp" #include "type_helpers.hpp" #include "cpu_batch_normalization_utils.hpp" #include "bfloat16_utils.hpp" #include "nspc_batch_normalization.hpp" // clang 6 and 7 generate incorrect code with OMP_SIMD in some particular cases #if (defined __clang_major__...
DATA
0.992534
7.393939
56c27f41-f367-4436-847f-3f644a13cba2
Jeffrin2005/Two-pointer
(TWO-POINTER)Find the Distance Value Between Two Arrays.cpp
class Solution { public: int findTheDistanceValue(vector<int>& arr1, vector<int>& arr2, int d) { sort(arr1.begin(), arr1.end()); sort(arr2.begin(), arr2.end()); // |arr1[i]-arr2[j]| <= d equal to arr1[i] - d <= arr2[j] <= arr1[i] + d // we need to check > arr1[i] + d if it is count it int...
ALGO
0.999982
5.905294
e2dc511e-cae1-495a-92f0-9f14dd781ea4
eyasir329/CP_Archive
03_searching_and_sorting/5_interactive/1486C2_Guessing the Greatest.cpp
#include <bits/stdc++.h> using namespace std; #define int long long int n; map<pair<int, int>, int> mp; int query(int l, int r) { if (l == r) return INT_MIN; if (mp.find(make_pair(l, r)) != mp.end()) { return mp[{l, r}]; } cout << "? " << l << " " << r << endl; int x; cin >> x; return mp[{l, r...
ALGO
0.999966
3.779083
65160330-d89b-4d7b-81c4-79c4a1d2f09d
junhee-won/problem-solving
BOJ_2533.cpp
//21 09 28 // 잘못생각했다 아래 코드는 트리의 level 당 사이즈를 구한다. // #include <iostream> // #include <vector> // using namespace std; // const int MAX = 1000000 + 1; // vector<int> edge[MAX]; // bool visited[MAX]; // int eary_num[2] = {0,0}; // int n; // void How_many_early(int state, vector<int> list) // { // vector<int> mis...
ALGO
0.99982
4.732102
34d4a517-5a0a-410e-9568-ddf15b0c2193
ishandutta2007/codeforces
jell/normal/1553/B.cpp
#line 1 "codeforces-workspace\\contest\\1553\\b\\b.cpp" #if defined(ONLINE_JUDGE) // && 0 #pragma GCC optimize("Ofast,unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,mmx,avx,avx2") #endif // #undef _GLIBCXX_DEBUG #include <bits/extc++.h> /** #include "lib/all" /*/ #line 2 "Library\\lib\\alias" /*...
ALGO
0.996649
3.751822
fd250aca-db6d-4eb0-844e-d1e451d83ccf
mrdinesh-kushwaha/DSA
Pattern_Programs/pattern9.cpp
#include<iostream> using namespace std; int main() { int n; cin>>n; for(int i=1;i<=n;i++) { int value =i; for(int j=1;j<=i;j++) { cout<<value<< " "; value++; } cout<<endl; } return 0; }
ALGO
0.999898
3.91284
56012f48-5092-446c-acaa-b0dc5178ad3b
Mephisto1995/Structuri-de-Date-ASE
12. Graph.cpp
#include <iostream> #include <fstream> #include <queue> // for BF traversal #include <stack> // for DF traversal #define GRAPH_NAME "Graph.txt" #define STUDENT_NAME "StudentGraph.txt" #define IN ios::in #pragma warning (disable:4996) using namespace std; class Student { private: int id; char* name; float average; ...
ALGO
0.864336
4.420888
1443e660-7671-46b1-8de8-de359274b051
siddharthav19/CSES-problemset
DP/8.cpp
#include <bits/stdc++.h> typedef long long int ll; using namespace std; int mod = 1e9 + 7; int dp[(int)1e5 + 10][110]; int solve(int i, int prev, vector<int> &nums, int m) { if (i >= nums.size()) return 1; if (dp[i][prev] != -1) return dp[i][prev]; ll ways = 0; if (nums[i] != 0...
ALGO
0.999997
4.86289
1cf98ab9-11ba-44bf-a49b-cdf9e06cc01f
Ethan-ZYF/CPTraining
ICPC/NAC24/A.cpp
#include <bits/stdc++.h> using namespace std; using i64 = long long; #ifdef LOCAL #include "algo/debug.h" #else #define debug(...) #endif constexpr int MX = 5e6 + 5; constexpr int inf = 1e9; void solve() { int n; cin >> n; vector<int> a(n), b(n); for (int i = 0; i < n; i++) cin >> a[i] >> b[i...
ALGO
0.999775
4.658597
f9275c74-9c58-4ea8-bffe-ff94e7ed5aff
jaywmz/BLE_Mesh_Sensor_Server
components/arduino/tests/performance/superpi/pi_fftcs.cpp
/* Based on "Calculation of PI(= 3.14159...) using FFT and AGM" by T.Ooura, Nov. 1999. https://github.com/Fibonacci43/SuperPI Modified for Arduino by Lucas Saavedra Vaz, 2024. */ #include <Arduino.h> #include <assert.h> #include <math.h> #include <limits.h> #include <float.h> #include <stdio.h> #include <stdlib....
ALGO
0.999957
5.207517
baefcc5c-9976-40e6-b026-a4618cff5339
Cardinal-AOSP/external_skia
src/pathops/SkReduceOrder.cpp
#include "SkReduceOrder.h" int SkReduceOrder::reduce(const SkDLine& line) { fLine[0] = line[0]; int different = line[0] != line[1]; fLine[1] = line[different]; return 1 + different; } static int coincident_line(const SkDQuad& quad, SkDQuad& reduction) { reduction[0] = reduction[1] = quad[0]; r...
ALGO
0.999162
5.012359
a4aef481-aa16-4599-b079-e2ee1316b23f
uxth/leetcode
cpp/989.add-to-array-form-of-integer.cpp
/* * @lc app=leetcode id=989 lang=cpp * * [989] Add to Array-Form of Integer * * https://leetcode.com/problems/add-to-array-form-of-integer/description/ * * algorithms * Easy (44.19%) * Likes: 355 * Dislikes: 65 * Total Accepted: 44.5K * Total Submissions: 100.7K * Testcase Example: '[1,2,0,0]\n34' ...
ALGO
0.999292
6.693357
785a0ff4-145b-49a8-80fd-9dacefe2b9ea
akshaychouke/DSA-programs
Linked List/Single LInked list/InsertionFront2.cpp
#include <iostream> using namespace std; class Node { public: int data; Node *next; }; void printList(Node *n) { cout << "The linked list is: "; while (n != NULL) { cout << n->data << " "; n = n->next; } } // Insertion at the front of the linked list using head reference void...
ALGO
0.998983
4.331291
98736fa2-d462-4493-895d-ed8f9a4f9914
HiepF5/CTDLGT_PTIT
code/DSA01008.cpp
#include<bits/stdc++.h> #define ll long long using namespace std; int n,k; int a[20]={}; bool check() { int ans=0; for(int i=1;i<=n;i++)if(a[i]==1)ans++; if(ans==k)return 1; return 0; } void xuat() { if(check()){for(int i=1;i<=n;i++)cout<<a[i]; cout<<endl;} } void sinh(int i) { for(int j=0;j...
ALGO
0.999968
3.339386
c73ccaf2-2e6b-4a38-a3e6-cbfb0c4e6cd9
falcon-computing/acc_genomics
pairhmm/xlnx/pairhmm_test.cpp
#include <vector> #include <string> #include <string.h> #include <fstream> #include <stdio.h> #include <stdlib.h> #include <math.h> #include <dirent.h> #include <cmath> #include <random> #include "host/FalconPairHMM.h" double avg_numReads; double avg_numHaps; int case_counter; char GenRandBase(){ std::default_ran...
DATA
0.864658
3.462036
40a89c6e-65a6-407e-b33e-4a2597763aba
bruno-avr/competitive-programming
kattis/detour.cpp
#include "bits/stdc++.h" using namespace std; #define optimize ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define endl "\n" #define ll long long #define ld long double #define pii pair<ll,ll> #define fi first #define se second #define pb push_back #define all(x) x.begin(),x.end() #define INF ...
ALGO
0.99998
4.127097
baf6db89-0019-43fa-bbac-23b23540ef47
diptu/Teaching
CSE 225L Data Structures and Algorithms/Resources/Codes Previous/Spring-2019-CSE225 1/Lab 15 ( Binary Search Tree )/binarysearchtree(10).cpp
#include "binarysearchtree.h" #include "quetype.cpp" #include <iostream> using namespace std; template <class ItemType> TreeType<ItemType>::TreeType() { root=NULL; } template <class ItemType> void Destroy(TreeNode<ItemType>*&tree) { if(tree!=NULL) { Destroy(tree->left); Destroy(tree->right...
TOOL
0.973321
4.664509
5aa7f3c4-ce31-4be9-ac82-98dc508f9186
ishandutta2007/codeforces
intothenight/normal/1575/K.cpp
#include <bits/stdc++.h> using namespace std; int main(){ cin.tie(0)->sync_with_stdio(0); cin.exceptions(ios::badbit | ios::failbit); int n, m, k, r, c; cin >> n >> m >> k >> r >> c; int ax, ay, bx, by; cin >> ax >> ay >> bx >> by; const int mod = 1e9 + 7; auto mul = [&](int x, int y)->int{ return 1LL * x * ...
ALGO
0.999573
4.373404
3fcfc3cb-ab39-4d9d-9475-38d379e7cc78
Misha0714/hw1
ulliststr.cpp
#include <cstddef> #include <stdexcept> #include "ulliststr.h" //constructor ULListStr::ULListStr() { head_ = NULL; tail_ = NULL; size_ = 0; } //destructor ULListStr::~ULListStr() { clear(); } //returns that size is 0 if empty bool ULListStr::empty() const { return size_ == 0; } //returns size of array...
TOOL
0.851696
4.803965
4ab563b8-0ddb-4183-b3e2-b776a0f2e0a5
SilenceEagle/leetcode
problems/239_sliding_window_maximum_滑动窗口最大值_HARD/solution_239_sliding_window_maximum_cpp.cpp
#include <iostream> #include <vector> #include <deque> #include <set> using namespace std; class Solution { private: class MyQue { public: deque<int> que; void push(int v) { while (!que.empty() && que.back() < v) { que.pop_back(); } que.push...
ALGO
0.999969
5.533511
82e2fdd9-5e59-45f5-8cbe-cb519c740dc9
swapnildubey29/Data-Structure-and-Algorithms
searching/lastocc.cpp
//28th may,2022; last occurance_effcient code(iterative); #include<iostream> using namespace std; int lastocc(int arr[],int n,int x){ int low = 0, high = n-1; while (low <= high) { int mid = (low + high) / 2; if (x > arr[mid]) low = mid + 1; else if(x < arr[mid]) high = mid - 1; ...
ALGO
0.999956
5.463809
52738e3f-bda5-4cae-afde-cb8f7c50ff12
tu-27-6/code-C-PTIT
order12.cpp
#include <iostream> #include <algorithm> using namespace std; typedef long long ll; ll order12(ll arr[], ll n) { ll res=1; while(true) { bool check=true; for (ll i=0; i<n; i++) { if (arr[i]==res) { check=false; break; } } if (check) { break; } else { res++; } } return r...
ALGO
0.999748
4.24861
ecf7bbb8-85a3-48f0-88ad-6b76374efba6
brucehart/adventofcode
2024/D07/d07p1.cpp
#include <iostream> #include <sstream> #include <vector> #include <string> #include <algorithm> // Define the type for unsigned long long typedef unsigned long long ull; // Define the Equation struct struct Equation { enum operators {MULTIPLY, ADD}; ull sum; std::vector<ull> elements; }; bool solveEquati...
ALGO
0.999655
5.702942
9b9ee419-579c-4916-9737-1115ccf07bae
hey-rum-ba/G4G-DSA
Maximize the sum of selected numbers from a sorted array to make it empty.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution{ public: int maximizeSum(int a[], int n) { // Complete the function multiset<int, greater<int>> ms; for(int i = 0; i < n; i++) ms.insert(a[i]); int sum = 0; ...
ALGO
0.999905
5.979204
3da27af6-c3f1-468c-80dd-dd7c8b33df69
firiexp/contest_log
atcoder/AGC/028A.cpp
#include <iostream> #include <algorithm> #include <vector> #include <iomanip> #include <map> #include <queue> static const int MOD = 1000000007; using ll = long long; using u32 = unsigned; using namespace std; template<class T> constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208; int main() { ll n, m; ...
ALGO
0.99995
4.355261
ba68fb54-8444-4a5e-81c8-8f85e8508220
RajiaRani/CPP-Programming
280delection.cpp
#include<iostream> using namespace std; int main() { int a[100], n,x, i,j,count=0; cout<<"Enter the size of the elements "; cin>>n; cout<<"Enter the array "; for(int i=0; i<n;i++) {cin>>a[i];} cout<<"Enter the element which you want to delete "; cin>>x; for(int i=0; i<n; i++) { if(a[i]==x) {for (int j=i; j<...
ALGO
0.999888
3.719149
f1404ad1-b665-4886-8488-6b9b8461eb30
Jaskamalkainth/Codeforces
BillBoard.cpp
/* * J1K7_7 */ #include <iostream> #include <sstream> #include <fstream> #include <string> #include <vector> #include <deque> #include <queue> #include <stack> #include <set> #include <cstring> #include <list> #include <map> #include <unordered_map> #include <iomanip> #include <algorithm> #include <functional> #in...
ALGO
0.999975
3.715412
181920b2-bded-478d-83a5-cb88e8d327b4
ishandutta2007/codeforces
gabrielpessoa/normal/986/B.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef pair<ii, int> iii; const int ms = 1e6+5; int a[ms]; int main(){ cin.tie(0); cin.sync_with_stdio(false); int n; cin >> n; int ans = 0; for(int i = 1; i <= n; i++) cin >> a[i]; for(int i = 1; i <= n; i++) { w...
ALGO
0.999964
3.776819
addc9062-4592-49b2-8a40-84fcb2746b10
GauthamPrabhuM/CodeforcesSolutions
substringremoval.cpp
#include <iostream> #include <bits/stdc++.h> #include<stdio.h> #include<string.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> #define ll long long int #define pb push_back #define cl CLOCKS_PER_SEC #define pi acos(-1.0) #define fastio ios_base::sy...
ALGO
0.999992
4.645598
c1c68aed-e5f0-4cf0-b748-b284227d1f0e
thuhinkumar/Leetcode
435-non-overlapping-intervals/435. Non-overlapping Intervals.cpp
class Solution { public: int eraseOverlapIntervals(vector<vector<int>>& intervals) { //sort by start index int ans = 0; sort(intervals.begin(),intervals.end(),[](const vector<int> &v1, const vector<int> &v2){return v1[0] < v2[0];}); //loop through every interval for(int i=1;i...
ALGO
0.999947
6.053792
3fe0a4e6-10d1-4755-ab1f-6ccd9a47d597
Acrsahil/100_Days_DSA
Competetive_Coding/Fix_You.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--){ int n,m; cin>>n>>m; vector<string> v(n); for(int i = 0; i<n; i++){ cin>>v[i]; } int ans = 0; // last row for(int i = 0; i<m; i++){ if(v[n-1][...
ALGO
0.999662
5.001546
d947e727-9d57-454c-a0b7-6a40aea77296
ManoharKoya/CompetitiveProgramming
SegmentTree.cpp
#include<bits/stdc++.h> using namespace std; #define lli long long int #define pb push_back #define vi vector<lli> #define NA(i,s,n) for(lli i=s; i<n; ++i) const lli N = 1e5 + 1; lli a[N], st[4*N], n; void build(lli id, lli l, lli r){ if(l==r) { st[id] = a[l]; return; } lli mid = (l+r) >>...
ALGO
0.999546
4.850683
5f4759d3-091e-4e8e-b104-92977147c8db
vfolunin/archives-solutions
MCCME/113744.cpp
#include <iostream> #include <algorithm> #include <vector> #include <set> #include <map> #include <string> using namespace std; int main() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); int a1, b1, c1, d1; cin >> a1 >> b1 >> c1 >> d1; int a2, b2, c2, d2; cin >> a2 >> ...
ALGO
0.994264
4.144219
ea95d932-8c0d-4a6e-b64a-eb374d48c947
coderbysoul/Strivers-SDE-Sheet-Challenge
Day 3/middleoflinkedlist.cpp
//https://www.codingninjas.com/codestudio/problems/middle-of-linked-list_8230764?challengeSlug=striver-sde-challenge&leftPanelTab=1 /* Following is the class structure of the Node class: class Node { public: int data; Node *next; Node() { this->data = 0; next = NULL; } Node(int...
ALGO
0.999947
5.840643
f9e18050-af1b-4136-852f-6284c39484a5
shamiulriyad/codeforces
sohoj coding contest/recurtion/B.cpp
#include <bits/stdc++.h> using namespace std; int main() { int test_case; cin >> test_case; string all = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; for (int t = 1; t <= test_case; t++) { int N,K; cin >> N>>K; string x,check; x = all.substr(0, N); check = x; cout <...
ALGO
0.999782
4.02655
501a7912-cb84-47b1-a03e-4e7878d94723
Sheshusai/Competitve-Programming
codeforces/MinimizeTheString.cpp
#include<bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; cin >> n; string s; cin >> s; string ans = ""; int i=0; for(;i<n-1;i++) { if(s[i]>s[i+1]) break; ans.push_back(s[i]); } i++; for(;i<n;i++) ans.push_back(s[i]); cout << ans ; r...
ALGO
0.999995
3.783953
14eeb4dd-dd83-49cc-a605-04c8bad289ba
ninad-moree/DataStructuresAlgorithms
Multidimensional Arrays/2373-LargestLocalValuesInMatrix.cpp
/* You are given an n x n integer matrix grid. Generate an integer matrix maxLocal of size (n - 2) x (n - 2) such that: maxLocal[i][j] is equal to the largest value of the 3 x 3 matrix in grid centered around row i + 1 and column j + 1. In other words, we want to find the largest value in every contiguous 3...
ALGO
0.999941
6.008696
e58ddf44-4dd8-4266-9819-ed38a48209ec
utsxvrai/litcod
2433-find-the-original-array-of-prefix-xor/2433-find-the-original-array-of-prefix-xor.cpp
class Solution { public: vector<int> findArray(vector<int>& pref) { vector<int>res(pref.size()); res[0] = pref[0]; for(int i = 1 ; i < pref.size() ; i++){ res[i] = pref[i] ^ pref[i-1]; } return res; } };
ALGO
0.999989
5.109873
7c793994-f583-43f9-8ee4-bbeff4abfaa6
digant73/Artillery-Sidewinder-X1_releases_main_board
artillery_swx1_marlin_fw_2.0.9.1/bltouch_diga/source/Marlin-2.0.x/Marlin/src/module/planner_bezier.cpp
/** * planner_bezier.cpp * * Compute and buffer movement commands for bezier curves */ #include "../inc/MarlinConfig.h" #if ENABLED(BEZIER_CURVE_SUPPORT) #include "planner.h" #include "motion.h" #include "temperature.h" #include "../MarlinCore.h" #include "../gcode/queue.h" // See the meaning in the documentat...
ALGO
0.99973
7.903826
ad3fb133-49f2-40fa-844e-25ec31eb9345
ishandutta2007/codeforces
pranjal.ssh/normal/377/B.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int n, m, s; cin >> n >> m >> s; vector<int> a(m), b(n), c(n), id(n), aid(m); for (int i = 0; i < m; ++i) cin >> a[i]; for (int i = 0; i < n; ++i) cin >> b[i]; for (int i = 0; i < n; ++i) cin >> c[i]; iota(id.begin...
ALGO
0.999992
3.548941
cb1a5680-a7db-4d58-90fc-60bc73d68877
7hokerz/bakjoon
bakjoonmoeum(C++)/그외 유형/자료구조/덱/18115번(주의!).cpp
#include <iostream> #include <deque> #include <string> using namespace std; /* 기술을 써서 나온 결과는 1, 2, 3...N으로 순서대로 이므로 기술을 쓴 순서의 반대로 기술을 읽으면서 결과를 맞춰볼 수 있다. 1. 제일 위의 카드 1장을 바닥에 내려놓는다. 2. 위에서 두 번째 카드를 바닥에 내려놓는다. 카드가 2장 이상일 때만 쓸 수 있다. 3. 제일 밑에 있는 카드를 바닥에 내려놓는다. 카드가 2장 이상일 때만 쓸 수 있다. */ int main(){ int N, teq, temp; s...
ALGO
0.999987
4.280484
5b0688d3-fd71-4700-89a7-5f2a31f4888d
kemkartanya/6Companies30Days
Amazon/787. Cheapest Flights Within K Stops.cpp
class Solution { public: int findCheapestPrice(int n, vector<vector<int>>& flights, int src, int dst, int k) { vector<int> prices(n, INT_MAX); prices[src] = 0; for(int i=0; i<=k; i++) { // running for k + 1 times vector<int> tempPrices = prices; for(int j=0; j<fl...
ALGO
0.999659
5.72088
eef51e79-8918-45eb-8687-49f7f72b81de
dlvguo/NoobOJCollection
LeetCode/Normal/900-999/961.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: int repeatedNTimes(vector<int> &A) { bool tag[10000]{false}; for (int a : A) { if (tag[a]) return a; else tag[a] = true; } return 0; } };
ALGO
0.999883
4.929917
1bd5c93f-6380-43f1-a884-8c74131e1fad
OmniRom-CAF/system_netd
netutils_wrappers/NetUtilsWrapper-1.0.cpp
#include <regex> #include <string> #include <libgen.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <android-base/strings.h> #define LOG_TAG "NetUtilsWrapper" #include <cutils/log.h> #include "NetUtilsWrapper.h" #define SYSTEM_DIRNAME "/system/bin/" #define OEM_IFACE "[...
TOOL
0.868381
5.580464
4fbbe511-25dc-4a54-b728-28718d40325d
Yash212806/se30
class work tops/22-04-2024/task 6.cpp
#include<stdio.h> main() { int i,j,k,n; printf("Enter value : "); scanf("%d",&n); for(i=1;i<=n;i++)//raw { for(k=1;k<=n-i;k++)//space { printf(" "); } for(j=1;j<=i;j++)//colloum { printf(" *"); } printf("\n"); } }
ALGO
0.999913
3.186576
7a0d0024-b641-4a74-b388-5f3f3ff2d60e
santosH7321/CompetetiveProgrammingInCpp
Internship/Array/maximumNumberInArray.cpp
// #include<iostream> // #include<limits.h> // using namespace std; // int main(){ // int arr[] = {2,4,3,5,6,7,8,10}; // int size = 8; // int maxi = INT_MIN; // for(int i=0; i<size; i++){ // if(arr[i] > maxi){ // maxi = arr[i]; // } // } // cout<<"Maximum number is "...
ALGO
0.998159
4.836568
5f28f136-1c54-4374-98b7-a31b52fe74ab
nirmit06/Competitive-Programming
Pair_Pain.cpp
#include<bits/stdc++.h> #define ll long long #define mod 1000000007 using namespace std; bool isPrime(int n) { if (n <= 1) return false; for (int i = 2; i < n; i++) if (n % i == 0) return false; return true; } ll combi(ll n,ll k) { ll ans=1; k=k>n-k?n-k:k; ll j=1; ...
ALGO
0.999451
3.544136
1e6e8674-75f3-4563-9ac7-e913182d095d
ebertolazzi/course-ScientificProgramming
AA2023-2024/eigen-3.4.0/bench/benchEigenSolver.cpp
// g++ -DNDEBUG -O3 -I.. benchEigenSolver.cpp -o benchEigenSolver && ./benchEigenSolver // options: // -DBENCH_GMM // -DBENCH_GSL -lgsl /usr/lib/libcblas.so.3 // -DEIGEN_DONT_VECTORIZE // -msse2 // -DREPEAT=100 // -DTRIES=10 // -DSCALAR=double #include <iostream> #include <Eigen/Core> #include <Eigen/QR> #in...
TOOL
0.977329
5.772194
94acb328-ca3d-4f27-8eab-bb53b7957484
RitanshRajput/DSA
Basic_to_intermediate/Binary_Search_Tree.cpp
// //🔴🔴Binary Search Tree // A Binary Search Tree is a special type of binary tree data structure which has the following properties: // 1. The left subtree of a node contains only nodes with keys lesser than the node’s key. // 2. The right subtree of a node contains only nodes with keys gr...
ALGO
0.999986
4.041435
dffbe1d3-f780-4ad8-8d0e-7bb87bd287c8
bfmoon/algorithmbasic
class25/Code03_LargestRectangleInHistogram.cpp
//给定一个非负数组arr,代表直方图,返回直方图的最大长方形面积 //https://leetcode.cn/problems/largest-rectangle-in-histogram/ int largestRectangleArea(vector<int>& heights) { if(heights.size()==0) { return 0; } int N=heights.size(); stack<int>sta; int ans=0; for(int i=0;i<N;i++) { while(!sta.empty()&&heights[sta.top()]>=heights[i]) ...
ALGO
0.99993
6.416692
afce10b0-b008-4a46-9cab-46c5602b0f82
KDE/plasma-integration
qt5/src/platformtheme/qxdgdesktopportalfiledialog.cpp
#include "qxdgdesktopportalfiledialog_p.h" #include <QDBusConnection> #include <QDBusMessage> #include <QDBusMetaType> #include <QDBusPendingCall> #include <QDBusPendingCallWatcher> #include <QDBusPendingReply> #include <QEventLoop> #include <QRegularExpression> #include <QFile> #include <QMetaType> #include <QMimeDa...
TOOL
0.93713
7.031168
dcf8ff34-9c17-461b-8633-6cb4492d4d58
Prabhat2002/Data_Structure_and_Algorithm
Car Pooling I.cpp
class Solution { public: bool carPooling(vector<vector<int>>& trips, int capacity) { map<int, int> lookup; for(auto trip : trips) { lookup[trip[1]] += trip[0]; lookup[trip[2]] -= trip[0]; } for(const auto& [location, num] : lookup) { ...
ALGO
0.999626
6.393532
0b040ce3-811f-4028-803c-c5aceac97680
sarvex/leetcode-vala
solution/1000-1099/1059.All Paths from Source Lead to Destination/Solution.cpp
class Solution { public: bool leadsToDestination(int n, vector<vector<int>>& edges, int source, int destination) { vector<bool> vis(n); vector<vector<int>> g(n); vector<int> f(n); for (auto& e : edges) { g[e[0]].push_back(e[1]); } function<bool(int)> dfs =...
ALGO
0.999984
6.199732
8d7cb2eb-a7e4-4d64-89f3-4efa87a0a786
saarazari5/MyGit
ugit/utils.cpp
// // utils.cpp // ugit // // Created by Saar Azari on 14/06/2024. // #include "utils.h" std::vector<std::string> split_lines(const std::string& str) { std::vector<std::string> lines; std::istringstream f(str); std::string line; while (std::getline(f, line)) { lines.push_back(line); } retu...
TOOL
0.920989
5.148252
a2a34caf-3182-4965-abb4-eaffbab74d96
yohei-freelance/atcoder
abc/173/c.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef string str; #define rep(i, n) for(int i=0; i<n; ++i) #define REP(i, n) for(int i=1; i<=n; ++i) #define all(obj) (obj).begin(), (obj).end() using P = pair<int, int>; const int inf = 1e9; const ll INF = 1e18; const ll MOD = 1e9+7; const ll MAX = ...
ALGO
0.99986
4.369194
00dd564b-0e89-4371-b203-32ffb6d47f5d
fadifrancis96/3d-animation-course-projects
igl/embree/bone_visible.cpp
template < typename DerivedV, typename DerivedF, typename DerivedSD, typename Derivedflag> IGL_INLINE void igl::embree::bone_visible( const Eigen::PlainObjectBase<DerivedV> & V, const Eigen::PlainObjectBase<DerivedF> & F, const Eigen::PlainObjectBase<DerivedSD> & s, const Eigen::PlainObjectBase<Derive...
ALGO
0.937729
6.16808
e08ea170-3ce7-4c8c-ae20-6d6abcf0e42a
IvanTan02/washcubes-user-app
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
0a49dff7-7be4-4588-b393-329b2a9d4829
Rakshana0802/July-Leetcode-Challenge
Task Scheduler.cpp
class Solution { public: int leastInterval(vector<char>& tasks, int n) { unordered_map<char,int>m; int maxN = -1; for(auto i: tasks) { m[i]++; maxN = max(maxN,m[i]); } int ans = (n+1)*(maxN-1); for(auto itr: m) if(...
ALGO
0.999976
6.586716
63bc8772-264a-4096-a3fc-3034eabbeace
roto37/compprog
cpp/math/LagrangePolynomial.cpp
/* ラグランジュ補間による多項式pn(x)にx=aとしたときの値を求める。 O[n^2] ラグランジュ補間とは 既知のすべて異なるn + 1個のデータ x0, x1, ..., xnとその値 f0, f1, ..., fn を用いてn次多項式pn(x)を求めることである。 pn(x) = Σ f(xi) * L(n, xi) 0≦i≦n L(n, xi) = Π (x - xk) / (xi - xk) (0≦k≦n, k ≠ i) */ #include <bits/stdc++.h> double Lagrange_polynomial (int n, double a, vect...
ALGO
0.999764
4.327108
9af7d2fa-d29b-4563-a73a-a4c17a535686
NamelessRom/android_device_oneplus_oneplus2
gps/utils/LocHeap.cpp
#include <LocHeap.h> class LocHeapNode { friend class LocHeap; // size of of the subtree, excluding self, 1 if no subtree int mSize; LocHeapNode* mLeft; LocHeapNode* mRight; LocRankable* mData; public: inline LocHeapNode(LocRankable& data) : mSize(1), mLeft(NULL), mRight(NULL), mDa...
ALGO
0.997679
6.439088
c6950759-d53f-48ee-ba42-560aba824b25
manikanta2901/ubuntu
.history/SRM/elab/OOPS/Inheritance/StudentsAndSports_20200917121459.cpp
#include<bits/stdc++.h> #include<iostream> using namespace std; class student{ public: int rollNo,mark1,marks2; void get(){ cin >> rollNo >> mark1 >> marks2; } }; class sports{ public: int sportMark; void getsm(){ cin >> sportMark; } ...
TOOL
0.993182
3.030755
07edf5cf-5f8a-4b15-b824-3acd18e7f9e7
ArrolCardoz/CompetitiveProgramming
Test/unionfind.cpp
#include <bits/stdc++.h> using namespace std; /* disjoint sets eg: unionFind parent(10) --> it make list that points itseld merge: merge(0,1) ---> 1 points 0 i.e. 1->0 and 0->0 find(i): if we find a num then it outputs its parent eg: if we use the same example as we merged above find(0)->0 find(1)->0 */
ALGO
0.999759
4.043995
0f80f60f-06c3-4212-ba98-20c7655a1442
mmabbasi77/onlineShop
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
469c3cc1-8072-43ba-adfd-e16a3005c2ad
abinashregmi/miscellaneous
cgLabReport/lab6.cpp
#include <stdio.h> #include <graphics.h> // Function to draw a triangle using the line() function void drawTriangle(int x1, int y1, int x2, int y2, int x3, int y3) { line(x1, y1, x2, y2); line(x2, y2, x3, y3); line(x3, y3, x1, y1); } // 4-connected boundary fill algorithm void boundaryFill4(int x, int y, ...
ALGO
0.996522
6.628114
a31446cc-45be-4912-847d-2ea6cf616186
Nickel-Nie/Leetcode-C-
DynamicProgramProblem/Solution174.cpp
// // Created by 聂伟豪 on 2023/2/15. // 难想到的地方:需要逆着推 #include <vector> using namespace std; class Solution { public: int calculateMinimumHP(vector<vector<int>>& grid) { int m = grid.size(); int n = grid[0].size(); vector<vector<int>> dp(m, vector<int>(n, 0)); //dp[i][j]表示从grid[i][j]...
ALGO
0.999873
5.695651
0297a066-7638-4a5f-9ecb-b56a2fadddef
guoyu07/HGBTool
Tool/HGBFileTool/CompressedFileTool/code/Unrar4iOS/framework/Unrar4iOS/unrar/unpack.cpp
#include "rar.hpp" #include "coder.cpp" #include "suballoc.cpp" #include "model.cpp" #ifndef SFX_MODULE #include "unpack15.cpp" #include "unpack20.cpp" #endif Unpack::Unpack(ComprDataIO *DataIO) { UnpIO=DataIO; Window=NULL; Suspended=false; UnpAllBuf=false; UnpSomeRead=false; } Unpack::~Unpack() { delete...
TOOL
0.917217
4.491823
b43025cb-8395-48d5-be9a-21f87255e483
kellazo/PinballGame
Pinball/Box2D/Box2D/Collision/Shapes/b2ChainShape.cpp
#include <Box2D/Collision/Shapes/b2ChainShape.h> #include <Box2D/Collision/Shapes/b2EdgeShape.h> #include <new> #include <string.h> b2ChainShape::~b2ChainShape() { Clear(); } void b2ChainShape::Clear() { b2Free(m_vertices); m_vertices = NULL; m_count = 0; } void b2ChainShape::CreateLoop(const b2Vec2* vertices, i...
ALGO
0.977707
6.764051
f905ccb1-fd28-4e4c-a248-024db21ca852
fsilvestrim/saliency_map
src/main.cpp
#include "OrientedPyr.h" #include "argparse.hpp" #include "fusion_methods.hpp" #include "boost/filesystem.hpp" #include "boost/regex.hpp" //#define VISUAL //#define SHOW_FINAL //#define SHOW_ORIENTATION struct hyperparams { int num_layers = 4; int center_sigma = 2; int surround_sigma = 5; int orienta...
ALGO
0.969528
6.300896
1b2d3f33-e17a-4b9c-9489-a8404de93166
aniruddhaseal/Lab_9
Prog_15.cpp
#include<iostream> using namespace std; int main() { char str[20],*p; //p is a character pointer //Input cout<<"Input about 10 characters of string\n"; cin>>str; //pointer variable refers to address of string p = str; while(*p!='\0') { cout<<p<<endl; p++; } //return statement ret...
ALGO
0.916541
3.203265
cad2728f-72d2-489d-a402-b6cbd590f078
arsh30/DSA-C-BABAR
IMPORTANT QUES/Q37_ReverseArray.cpp
// SOLVING LEETCODE AND CODE STUDIO #include <iostream> #include <vector> using namespace std; vector<int> reverseArray(vector<int> &arr) { int si = 0, ei = arr.size() - 1; while (si <= ei) { swap(arr[si], arr[ei]); si++; ei--; } return arr; } // q2 -> m ke aage se rever...
ALGO
0.999871
5.214929
62da97b7-abc6-40fa-b96a-4ad55e8bfc87
fkoyuncu/godot
thirdparty/icu4c/common/dictbe.cpp
#include <utility> #include "unicode/utypes.h" #if !UCONFIG_NO_BREAK_ITERATION #include "brkeng.h" #include "dictbe.h" #include "unicode/uniset.h" #include "unicode/chariter.h" #include "unicode/resbund.h" #include "unicode/ubrk.h" #include "unicode/usetiter.h" #include "ubrkimpl.h" #include "utracimp.h" #include "u...
TOOL
0.936524
6.615594
159a6e6a-595a-4053-9b90-bb693317a451
38Koo/algorithm-challenge
C++/recursion/fibonacci_memo.cpp
#include <iostream> #include <vector> using namespace std; // オーバーフローを避けるためにlong longを使用 vector<long long> arr; long long fibonacci(int N) { if(arr[N] != -1) return arr[N]; if(N == 0) return arr[0] = 0; if(N == 1) return arr[1] = 1; return arr[N] = fibonacci(N - 1) + fibonacci(N - 2); } int main() { int...
ALGO
0.999988
5.272345
b1349a80-4c3a-4e95-9a23-feb85a1fae65
ernieluuu/hw5_old
wordle.cpp
/* #ifndef RECCHECK // For debugging #include <iostream> // For std::remove #include <algorithm> #include <map> #include <set> #endif #include "wordle.h" #include "dict-eng.h" using namespace std; */ #ifndef RECCHECK // For debugging #include <iostream> // For std::remove #include <algorithm> #include <map> #includ...
ALGO
0.971271
5.838295
5caf5cce-f138-492f-94ae-3a6c37a965c7
microsoft/v8-jsi
src/MurmurHash.cpp
#if defined(_MSC_VER) #define FORCE_INLINE __forceinline #define ROTL64(x, y) _rotl64(x, y) #define BIG_CONSTANT(x) (x) #else // defined(_MSC_VER) #define FORCE_INLINE inline __attribute__((always_inline)) inline uint64_t rotl64(uint64_t x, int8_t r) { return (x << r) | (x >> (64 - r)); } #define ROTL64(x, y) rotl...
ALGO
0.941744
6.954899