uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
3215fabd-3e04-44f9-b359-010cc4bd3feb
partho-das/CompetitiveProgrmming
CP_CODE/Codeforces/Codeforces Round #764 (Div. 3)/c.cpp
#include <bits/stdc++.h> using namespace std; //____________________________________________________________________________________________________________________________________ #define PI 2*acos(0.0) #define pf printf #define sc scanf #define ff first #define ss second #define pb push_back typedef long long...
ALGO
0.999943
3.961795
d889b63b-9cf9-4cd2-a118-c6d849ccec4d
martonistvan/CarND-Path-Planning-Project-master
src/Eigen-3.3/bench/benchmarkXcwise.cpp
// g++ -O3 -DNDEBUG benchmarkX.cpp -o benchmarkX && time ./benchmarkX #include <iostream> #include <Eigen/Core> using namespace std; using namespace Eigen; #ifndef VECTYPE #define VECTYPE VectorXLd #endif #ifndef VECSIZE #define VECSIZE 1000000 #endif #ifndef REPEAT #define REPEAT 1000 #endif int main(int argc, c...
ALGO
0.95479
3.896122
58d2bf1a-2c36-4d52-b90f-e750904a6053
Kavin1421/Leetcode-Solution
1000-1099/1063.Number of Valid Subarrays/Solution2.cpp
class Solution { public: int validSubarrays(vector<int>& nums) { int n = nums.size(); stack<int> stk; int ans = 0; for (int i = n - 1; ~i; --i) { while (stk.size() && nums[stk.top()] >= nums[i]) { stk.pop(); } ans += (stk.size() ? s...
ALGO
0.99996
6.493869
06be4118-517c-490d-9d60-28584b4516a1
Calinou/godot-ci-temp-test
thirdparty/oidn/mkl-dnn/src/cpu/rnn/cell_common.cpp
/* * Common for RNN and LSTM cell execution */ #include "ref_rnn.hpp" namespace mkldnn { namespace impl { namespace cpu { using namespace rnn_utils; template <prop_kind_t aprop, data_type_t src_type, data_type_t weights_type> rnn_cell_execution_sig( (_ref_rnn_common_t<aprop, src_type, weights_type>::cell_ex...
ALGO
0.999806
7.199874
2417f7b4-272c-49ba-9c4e-f565a390ebc9
Mukit09/UVA_Solution
10221.cpp
#include<stdio.h> #include<string.h> #include<math.h> int main() { double a,b,angle,c,dis,e,f,g,d; char ch1[10]; while(scanf("%lf %lf %s",&dis,&angle,&ch1)!=EOF) { if(strcmp(ch1,"deg")==0) { if(angle>=180) {angle=360-angle;} a=(3.14159265358979323846*angle)/180; b=(6440+dis); c=b*a; d=2*(b*b);...
ALGO
0.999355
3.123994
d3b61c1a-807c-4340-b70b-4612071e155a
darealshinji/vapoursynth-plugins
plugins/waifu2x-w2xc/libw2xc/src/w2xconv.cpp
#define W2XCONV_IMPL #define _WIN32_WINNT 0x0600 #define ENABLE_AVX 1 #include <thread> #ifdef X86OPT //#if (defined __GNUC__) || (defined __clang__) #ifndef _WIN32 #include <cpuid.h> #endif #endif // X86OPT #ifdef ARMOPT #if defined __ANDROID__ #include <cpu-features.h> #elif (defined(__linux)) #include <sys/auxv....
TOOL
0.886982
3.38787
f463c0ff-d294-4342-a26c-4fbb93f22f77
ishandutta2007/codeforces
hyperbolic/normal/1766/D.cpp
#include <stdio.h> #include <vector> int check[10010]; std::vector<int> prime; int main() { for(int i=2;i<=3200;i++) { if(check[i]==0) { prime.push_back(i); for(int j=i;j<=3200;j+=i) check[j] = 1; } } int T; scanf("%d",&T); while(T--) { int a,b; scanf("%d%d",&a,&b); int g = b-a; if(g==1) p...
ALGO
0.999971
3.695058
02bb9e8a-97d3-4ee8-b2ca-7551bd121b9a
aharrison24/XCSoar
src/Engine/Util/Filter.cpp
#include "Filter.hpp" #include <math.h> #include <assert.h> #include <stdio.h> Filter::Filter(const fixed cutoff_wavelength, const bool bessel) { Design(cutoff_wavelength, bessel); } bool Filter::Design(const fixed cutoff_wavelength, const bool bessel) { static const fixed sample_freq = fixed_one; static const ...
ALGO
0.999198
5.331277
64f6ef2b-944b-4b34-8584-077b45fff7af
Liaac/LeetCode
150.逆波兰表达式求值.cpp
/* * @lc app=leetcode.cn id=150 lang=cpp * * [150] 逆波兰表达式求值 */ // #ifndef ONLINE_JUDGE // #include "include/leetcode_structures.h" // #include <vector> // #include <string> // #include <stack> // #include <unordered_map> // #include <unordered_set> // using namespace std; // #endif // @lc code=start class Solution...
ALGO
0.999963
6.655751
fc36556e-fc12-4520-9768-e79516185bc6
Meherab151175/graph_tree_stack_que_linked_list
tree_revision/tree/binary_tree/convert_arry_to_BST.cpp
#include<bits/stdc++.h> using namespace std; class Node{ public: int val; Node* right; Node* left; Node(int val){ this->val = val; this->right = NULL; this->left = NULL; } }; void level_order(Node* root) { if(root == NULL) return; queue<Node*> q; ...
ALGO
0.99999
5.159968
c159e045-9193-4917-bffe-6da0facdaf24
Biank23/Competitive-Programming
OI/OIA/2024/Certamen de Selección/Día 2/escribiendo.cpp
#include <bits/stdc++.h> using namespace std; #define sz(x) int(x.size()) using ll = long long; inline ll remtz(ll x) { return x >> __builtin_ctzll(x); } ll gcdOdd(ll a, ll b) { while (a != b) { if (a < b) swap(a, b); a = remtz(a - b); } return a; } ll gcd(ll a, ll b) { if (a =...
ALGO
0.999841
3.99751
0cafc2da-fd08-454a-9e21-63992c502b24
zoumson/AlgorithmCode
greedy_algorithms/prims_minimum_spanning_tree.cpp
#include <iostream> using namespace std; #define V 4 #define INFINITY 99999 int graph[V][V] = {{0, 5, 1, 2}, {5, 0, 3, 3}, {1, 3, 0, 4}, {2, 3, 4, 0}}; struct mst { bool visited; int key; int near; }; mst MST_Array[V]; void initilize() { for (int i = 0; i < V; i++) { MST_Array[i].visited = ...
ALGO
0.999976
4.534882
e86671bb-e9fa-4535-a8ee-8afc7d824aab
chenmozhijin/foo_lddc
SDK/foobar2000/shared/shared-nix.cpp
#include "shared.h" #include <dirent.h> #include <pfc/wildcard.h> #include <unistd.h> // foobar2000 SDK project method... bah namespace foobar2000_io { PFC_NORETURN void nix_io_op_fail(); } using namespace foobar2000_io; namespace { class uFindFileImpl : public uFindFile { public: uFindFileImpl ( ...
TOOL
0.954062
6.06547
745a6726-9013-437f-9ef6-9ae8d627c4de
DLR-TS/adore_libraries
lib/adore_map/src/route.cpp
#include "adore_map/route.hpp" namespace adore { namespace map { void Route::add_lane_center( Border& lane_to_add, const std::optional<MapPoint>& start_point, const std::optional<MapPoint>& end_point, bool reverse = false ) { const auto& points_to_add = lane_to_add.interpolated_points; b...
TOOL
0.954611
6.924394
44e99fd2-5aeb-410f-ac31-b2f29b94b5cb
wy3148/lc
two_pointers/container_mosted_water.cpp
//https://leetcode.com/problems/container-with-most-water/description/ class Solution { public: int maxArea(vector<int> &height) { int start = 0; int end = height.size() - 1; int ans = 0; while (start < end) { //width * height = area, we start from the ma...
ALGO
0.999852
6.446151
73cb325b-834f-46f6-a841-9ae7bb18befc
Zhaisan/ads
Prefix_Tree/1.cpp
#include <bits/stdc++.h> #define zhaiss ios_base::sync_with_stdio(false); cin.tie(NULL) typedef long long ll; using namespace std; int main(){ zhaiss; string s; cin >> s; set<string> q; for(int i = 0; i < s.size(); i++){ string x = " "; for(int j = i; j < s.size(); j++){ ...
ALGO
0.999617
4.073799
ae883908-1ff0-47aa-b5a2-e11b12802ca6
rosmianto/gamebuino-esp32
lib/Gamebuino-META-master/src/utility/Collide/Collide.cpp
#include "Collide.h" namespace Gamebuino_Meta { bool Collide::rectRect(int16_t x1, int16_t y1, int16_t w1, int16_t h1, int16_t x2, int16_t y2, int16_t w2, int16_t h2) { return (x2 < x1 + w1 && x2 + w2 > x1 && y2 < y1 + h1 && y2 + h2 > y1); } bool Collide::pointRect(int16_t pointX, int16_t pointY, uint16_t r...
ALGO
0.973762
6.256286
d5ea1159-3c02-41b2-a892-a2310cb9c012
kranthiraju/DSA---Udemy
Vectors && Arrays/Pairs.cpp
#include<bits/stdc++.h> using namespace std; // Given an array containing N integers, and an number S denoting a target Sum. // Find two distinct integers that can pair up to form target sum. vector<pair<int,int>> paircode(vector<int> arr,int target){ vector<pair<int,int>> vp; int n=arr.size(); unordered_...
ALGO
0.999741
4.872438
cbc3e4c5-c77e-4ff7-91bf-b56fab237355
ArseniAnishchanka/leetcode
0441. Arranging Coins.cpp
class Solution { public: int arrangeCoins(int n) { return (sqrt(1 + 8 * long(n)) - 1) / 2; } };
ALGO
0.999825
6.462463
350fe597-f6a5-4c29-a27d-e6c40336cb3a
RJrachit/programs
CD lab/AI assignment/water_bfs.cpp
#include <bits/stdc++.h> using namespace std; struct state { int x, y; bool operator < (const state& that) const { if (x != that.x) return x < that.x; return y < that.y; } }; int capacity_x, capacity_y, target; void bfs(state start, stack <pair <state, int> >& path) { queue <state> ...
ALGO
0.999594
4.617907
18a3b797-f175-4944-8518-e7934bae0293
WenhaoGe/Leetcode
Medium/Subarray Product Less than K/solution.cpp
class Solution { public: int numSubarrayProductLessThanK(vector<int>& nums, int k) { int count=0; int left=0; int right=0; int product=1; int size = nums.size(); for(;right<size;right++){ product *=nums[right]; while(right>=left && product>=k){...
ALGO
0.999966
5.386772
5097e0eb-cc9f-4bd7-81b1-6119e155341b
Telework-PH/library_management_rafie_mikko
src/CheckOut.cpp
#include <iostream> #include <iomanip> #include <vector> #include <fstream> #include <algorithm> #include <ctime> #include "../includes/Helper.h" #include "../includes/CheckOut.h" #include "../includes/Book.h" #include "../includes/Patron.h" using namespace std; string checkOutDataPath = "data/CheckOuts.csv"; vector...
TOOL
0.885086
4.079271
086f40cf-ae98-4576-a9c2-7cbc599b9dd3
zhengchengc/Competitive-Programming
CodeForces/25A-IQ Test.cpp
#include <iostream> using namespace std; int main() { int n,counter1(0), counter2(0), temp1, temp2; int s[100]; cin >> n; for (int i = 0; i < n; i++) { cin >> s[i]; } for (int i = 0; i < n; i++) { if (s[i] % 2 == 0) { counter1++; temp1 = i; } else { counter2++; temp2 = i; } } if (coun...
ALGO
0.999909
3.707729
816b91ae-fd3b-4eb5-b3dc-d02afe77a681
1m188/algorithm
leetcode/面试题 02.07.intersection-of-two-linked-lists-lcci.cpp
/* * @lc app=leetcode.cn id=面试题 02.07 lang=cpp * @lcpr version=30204 * * [面试题 02.07] 链表相交 * * https://leetcode.cn/problems/intersection-of-two-linked-lists-lcci/description/ * * LCCI * Easy (66.63%) * Likes: 456 * Dislikes: 0 * Total Accepted: 254.7K * Total Submissions: 382.2K * Testcase Example: ...
ALGO
0.99997
5.39471
0f272fd2-43dc-4b28-b671-362e0a2e1fe8
howardliam/word-unscrambler
src/utils.cpp
#include "utils.hpp" std::map<int, std::set<std::string>> printing::sort_words_by_length(std::set<std::string> words) { std::map<int, std::set<std::string>> sorted; for (auto word : words) { int length = word.size(); sorted[length].insert(word); } return sorted; } std::vector<int> pr...
TOOL
0.996483
5.42598
dd37fb93-a57f-43ac-bd31-2871b790e1a1
Wbrta/ACM
UVa&UVaLive/UVaLive.3363.String Compression.cpp
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int maxn = 205; const int INF = 0x3f3f3f3f; char str[maxn]; int dp[maxn][maxn]; int check(int be, int en, int k) { if ((en - be + 1) % k) return 0; for (int i = be + k; i <= en; i += k) for (int j = 0; j < k; ++j) if (str[i +...
ALGO
0.999866
3.957853
d7013d98-b3f6-4141-b322-7c2fef60a269
syf1913/IBAMR
examples/adv_diff/ex4/example.cpp
// Config files #include <SAMRAI_config.h> // Headers for basic PETSc functions #include <petscsys.h> // Headers for basic SAMRAI objects #include <BergerRigoutsos.h> #include <CartesianGridGeometry.h> #include <LoadBalancer.h> #include <StandardTagAndInitialize.h> // Headers for application-specific algorithm/data ...
ALGO
0.99993
7.633405
35643282-be62-415c-a381-ac0dd3f58df9
wwxxxx/leetcode
258.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: int addDigits(int num) { /* while (num / 10) { int sum = 0, t = num; while (t / 10) { sum += t % 10; t /= 10; } sum += t; ...
ALGO
0.999834
5.703218
0a8e608f-c791-46ac-b931-31a1b1ac2ccb
Tnwoxa1/PROGPROGPROG
MS-5/Puason/Work.cpp
#include "pch.h" #include "Work.h" using namespace std; double e0 = 8.854187817e-12; model::model() { } void model::SetParametr(int my_a, int my_d, int my_l, double my_q, int my_num_const, int my_num_line) { a = my_a; d = my_d; l = my_l; q = my_q; left_fi = q; num_fi_const = my_num_const; fi_const = vector<do...
ALGO
0.999054
3.543992
95922305-ca0a-4085-b04e-1134d4ba1112
baheti07/C-
bubblesort.cpp
#include<iostream> using namespace std; void swap(int *xp,int *yp) { int temp=*xp; *xp=*yp; *yp=temp; } void display(int *array, int size) { for(int i = 0; i<size; i++) cout << array[i] << " "; cout << endl; } void bubbleSort(int *array, int size) { for(int i = 0; i<size; i++) { int sw...
ALGO
0.999807
4.190367
5518ff53-4eac-4f54-9893-76668754f006
hiroshi-maybe/GCJ
kickstart/2019H/Hindex.cpp
#include <bits/stdc++.h> using namespace std; // type alias typedef long long LL; typedef pair<int,int> II; typedef tuple<int,int,int> III; typedef vector<int> VI; typedef vector<string> VS; typedef unordered_map<int,int> MAPII; typedef unordered_set<int> SETI; template<class T> using VV=vector<vector<T>>; // minmax te...
ALGO
0.999973
4.729971
32e735b4-f862-478c-8d45-2d9f7d625d10
kimhyeyun/Baekjoon
Graph/Graph/2667.cpp
#include<iostream> #include<stdio.h> #include<vector> #include<queue> using namespace std; #define MAX 26 int apartment[MAX][MAX]; bool visited[MAX][MAX]; int N; int dx[] = { -1,1,0,0 }; int dy[] = { 0,0,-1,1 }; int BFS(int i, int j) { int cnt = 0; visited[i][j] = true; queue<pair<int, int> > q; q.push(make_pair...
ALGO
0.999851
3.196903
bc548187-6f1b-4526-8d50-3382f548af2a
randomwalk10/my_leetcode_solutions
1461_Check_If_a_String_Contains_All_Binary_Codes_of_Size_K.cpp
#include <string> #include <unordered_set> using namespace std; class Solution { public: bool hasAllCodes(string s, int k) { if(s.size()<k) return false; unordered_set<int> nums; int tmp = 0; for (int i = 0; i < s.size() - k + 1; ++i) { if(i==0){ for (int j = 0; j < k; ++j) { tmp += (s[j]-'0')<...
ALGO
0.999845
5.555727
5550071f-5d14-424f-ae25-d071fe25cdfa
zhyack/LeetCode
445.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) { int n1 = 0, n2 = 0; ListNode *p = l1; while(p!=NULL) p...
ALGO
0.999953
6.075341
4ee63960-6755-4984-8a51-82a1de2fb136
yangjufo/LeetCode
2021/1816. Truncate Sentence.cpp
class Solution { public: string truncateSentence(string s, int k) { int index = 0; while (index < s.length()) { if (s[index] == ' ') { k--; } if (k <= 0) { break; } index++; } return s.substr(...
ALGO
0.99965
6.094884
2a207b2d-b4f3-4bbc-91c5-41ea8c3fb055
dranxer/LeetCode-Solns
single-element-in-a-sorted-array/Accepted/6-26-2024, 8_42_35 PM/Solution.cpp
// https://leetcode.com/problems/single-element-in-a-sorted-array class Solution { public: int singleNonDuplicate(vector<int>& a) { //brute is to take xor lol if(a.size()==1){ return a[0]; } int lo=1; int hi=a.size()-2; if(a[0]!=a[1]){ return ...
ALGO
0.999979
5.440452
c43aed95-1bc6-493f-9777-29729de59b5f
redcpp/Competitive-Programming
kattis/algo.is/introduction/flexible.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; const int INF = (int)1e9 + 7; #define deb(x) cerr << #x << " = " << x << endl #define sz(a) (int)(a).size() #define all(a) (a).begin(), (a).end() #define sq(x) (x) * (x) #define pb push_back #define fi first #define se second...
ALGO
0.999912
3.179414
6213f05f-264c-4fa9-a31c-4bdb18974902
0x0all/Codechef_prac
ProjectEuler/Problem35.cpp
#include<iostream> #include<vector> #define ll long long using namespace std; ll reversenum(ll a,ll num) { if(a==0) return num; ll temp=a%10; num=num*10+temp; ll store=reversenum(a/10,num); return store; } int main() { vector<ll> a; a.reserve(1000000); ll i; for(i=0;i<1000000...
ALGO
0.99958
4.16675
b425f471-3fb4-4f06-8f8b-51a50005a86c
grandb369/code-LeetHub
1115-print-foobar-alternately/1115-print-foobar-alternately.cpp
class FooBar { private: int n; mutex m1,m2; public: FooBar(int n) { this->n = n; m2.lock(); } void foo(function<void()> printFoo) { for (int i = 0; i < n; i++) { m1.lock(); // printFoo() outputs "foo". Do not change or remove this line. ...
ALGO
0.936293
5.537965
0e9204a6-e1f3-4142-b71c-3cfe0757c495
GavrilStefan-Dorian/OOP2023
L6/main.cpp
#include "Circuit.h" #include <iostream> using namespace std; int main() { Circuit c; c.SetLength(100); cout << c.GetLength() << endl; c.SetWeather(Weather::Rain); c.AddCar(new Volvo()); c.AddCar(new BMW()); c.AddCar(new Seat()); c.AddCar(new Fiat()); c.AddCar(new RangeRover()); c.Race(); c.ShowFinalRanks();...
TOOL
0.867886
3.772396
acd884e2-e9f4-4372-8051-b45bafc79d17
xxcxu/SchoolCode
CF1530F.cpp
#pragma GCC optimize(2) #pragma region #include <bits/stdc++.h> using i16 = int16_t; using i32 = int32_t; using i64 = int64_t; using u32 = uint32_t; using u64 = uint64_t; #define ep emplace #define eb emplace_back #define all(x) x.begin(), x.end() FILE *fin, *fout, *ferr; i32 read() { i32 t = 0, f = 0; char ch = fg...
ALGO
0.999771
4.132233
f6992e7d-4949-4472-be48-7f62fbfbca60
mridul891/DataStrutureAndAlgorithm
Linkedlist/Intersectionof2ll.cpp
#include <iostream> using namespace std; #include <set> #include <bits/stdc++.h> class Node { public: int data; Node *next; Node(int data) { this->data = data; this->next = NULL; } }; // brute force Node *intersection(Node *head1, Node *head2) { Node *temp2 = head2; while (...
ALGO
0.999687
4.643432
439bc44c-e6f8-4b80-a7ab-25b012a455a5
Wiriya0446/lab8
lab8_1.cpp
#include <iostream> using namespace std; int main() { char rank; cout << "Input your rank: "; cin >> rank; if(rank=='S'){ cout<<"You have received Super Ultra Rare Unit!!!\n"; }if(rank=='A'||rank=='S'){ cout << "You have received 5 gems.\n"; }if(rank<='B'||rank=='S'){ cout << "You have received...
TOOL
0.930769
3.362474
c45840c7-6b5e-4679-bebb-5d7884e56418
ZarinaNe/asd
lab_10/graph.cpp
#include "graph.hpp" graph::graph(std::vector<std::vector<int>> g) { _g = g; } bool graph::isEulerGraph() { for (int i = 0; i < _g.size(); i++) { if(GetDegree(i) % 2 == 1) return false; } return true; } int graph::GetDegree(int x) { int degree = 0; for (int i = 0; i < _g.s...
ALGO
0.999635
4.638447
cbda772a-89c1-48bf-88a4-101bfefffed9
Michael-Ma/Coding-Practice
LeetCode/N_Sum6.cpp
#include <sstream> #include <stdio.h> #include <iostream> #include <vector> #include <map> #include <cmath> #include <algorithm> //#include <unordered_map> using namespace std; /* Time Complexity : O(nlog(n)) Space Complexity : O(n) Trick: 1. using hashmap 2. sort, then use 2 pointers move from ...
ALGO
0.999941
4.902303
1fd0b4a2-6da2-4082-9eb7-e49bdb9b3015
gr-rassadnikov/itmo
sem-1/asd/lab-1/A.cpp
#include <iostream> #include <vector> using namespace std; vector <int> merge(vector <int> &x, vector <int> &y){ vector <int> a; int i=0, j=0; while (i<x.size() || j< y.size()){ if (i==x.size()){ a.push_back(y[j++]); continue; } if (j==y.size()){ ...
ALGO
0.999978
4.561033
e006f59a-e08d-4486-af4b-6fedffa1daa6
Nikki0A0S/TG-and-K-to-KM
328. Odd Even Linked List.cpp
https://leetcode.com/problems/odd-even-linked-list/ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* oddEvenList(ListNode* head) { if(head == 0) return 0; ...
ALGO
0.999976
5.900259
48ff548d-82f5-4635-8f91-0feb5e18d35e
ZhenyingZhu/ClassicAlgorithms
src/CPP/src/leetcode/ConstructBinaryTreeFromPreorderAndInorderTraversal.cpp
/* * [Source] https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/ * [Difficulty]: Medium * [Tag]: Tree * [Tag]: Array * [Tag]: Depth-first Search */ #include <iostream> using namespace std; // [Solution]: Find the first element of preorder sequence in the inorder seq. Then ...
ALGO
0.999977
6.91677
2e0f6fea-2466-42aa-a47a-ca24bbaeea26
TatyanaRicketts/cplusplusPractice
letsCountVerTwo.cpp
/*This program reads positive integer n, and prints the numbers from 1 up to n.*/ #include <iostream> using namespace std; int main() { int n; int counter; cout<<"Please enter a positive integer: "<<endl; cin>>n; //For loop. There are 3 parts -> for(initialization ; condition ; increment) fo...
TOOL
0.973973
3.528682
60914eaf-9a5d-40c1-a344-7c63c4a6b1db
Johniel/contests
topcoder/srm/src/SRM619/ChooseTheBestOne.cpp
#include <bits/stdc++.h> #define each(i, c) for (auto& i : c) #define unless(cond) if (!(cond)) using namespace std; typedef long long int lli; typedef unsigned long long ull; typedef complex<double> point; class ChooseTheBestOne { public: int countNumber(int N) { vector<int> v; for (int i = 0; i < N; +...
ALGO
0.999916
4.476158
075149ef-1652-41ba-b4e5-67ef5851f5c6
HallofFame727/Algorithm
Algorithm/10_BinarySearchTree/10_BinarySearchTree/BinarySearchTree.cpp
#include <stdio.h> #include <Windows.h> #include "BinarySearchTree.h" int main() { BinarySearchTree<int> tree; BinarySearchTree<int>::Node* root = BinarySearchTree<int>::CreateNode(123); tree.Root(root); tree.Insert(&root, BinarySearchTree<int>::CreateNode(22)); tree.Insert(&root, BinarySearchTree<int>::Create...
ALGO
0.999027
3.977399
07d67e8b-d68b-4716-b195-641b575649a1
markov-avl/ParallelProgramming
atomic.cpp
#include <thread> #include <vector> #include <iostream> #include <omp.h> #include <mutex> #include <iomanip> static unsigned threadsNum = std::thread::hardware_concurrency(); void setThreadsNum(unsigned T) { threadsNum = T; omp_set_num_threads(T); } unsigned getThreadsNum() { return threadsNum; } unsign...
ALGO
0.998618
6.022048
fdbf8fda-5488-4197-a63e-45c981d12b2a
plctlab/llvm-project
lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp
int main() { auto r = 0; for (auto i = 1; i <= 10; i++) { r += i & 1 + (i - 1) & 1 - 1; } return r; }
ALGO
0.998981
4.70404
7ef5209b-fe3a-499c-857d-13b5c72f3b23
oneskovic/CP-Problems
CodeForces/Deltix Round Summer 2021/C.cpp
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<ll> elements(n); for (int i = 0; i < n; i++) { cin >> elements[i]; } ll solution = 0; for (int l = 0; l < n; l+=2) { ll sum ...
ALGO
0.999977
4.060976
36c74db1-0eae-4340-b5aa-51576c9f7f15
superQCman/pytorch-gpgpusim
torch/lib/c10d/Utils.cpp
#include "Utils.hpp" #include <netdb.h> #include <sys/poll.h> #include <arpa/inet.h> #include <netinet/in.h> #include <netinet/tcp.h> #include <fcntl.h> #include <unistd.h> #include <algorithm> #include <cstring> #include <memory> #include <string> #include <thread> namespace c10d { namespace tcputil { namespace ...
TOOL
0.981548
7.477311
e8e86125-da44-42dd-af61-e9af24fe8027
klhftco/eecs-c106a-project
workspace/src/lab4/ar_track_alvar/src/SampleOptimization.cpp
#include "Optimization.h" #include "cv.h" #include "highgui.h" #include <time.h> #include <vector> #include <iostream> #include <string> using namespace std; using namespace alvar; const int res = 640; const double poly_res = 8.0; double random(int dist_type, double param1, double param2) { static CvRNG rng = 0; ...
ALGO
0.999127
6.303687
3c894abc-3c28-4a99-8b9c-30b8f0f6371f
GreaTuna/Lab_241
Lab_7/tusk_5.cpp
#include <iostream> using namespace std; int main() { for (double magnitude = 4.5; magnitude <= 7.5; magnitude += 0.5) { if (magnitude < 5.0) { cout << "Балів " << magnitude << ": Легке, немає руйнувань" << endl; } else if (magnitude >= 5.0 && magnitude < 5.5) { cout << "Бал...
TOOL
0.871645
5.003335
f393f3c9-2e00-41a1-a907-361d3108df91
devhimanshuu/DataAlgoPro
STL in C++/multiSet.cpp
#include <bits/stdc++.h> using namespace std; int main() { unordered_multiset<int> s; for (int i = 1; i <= 10; i++) { s.insert(i); } s.insert(5); cout << "Elements present in the unordered multiset: "; for (auto it = s.begin(); it != s.end(); it++) { cout << *it << " ";...
TOOL
0.945866
4.210422
6d144e61-c29b-4b25-8b06-7d3da76fcb34
Matheushfb067/Exercicios-de-Algoritimos-02
ListasLigadas/Ex07.cpp
// LIST - União /* Faça um programa que leia os dados de duas listas ligadas cujos elementos estão em ordem crescente, crie e mostre uma terceira lista ligada, formada pela união dos elementos das duas listas originais, também ordenada em ordem crescente. Entrada: A entrada consiste duas linhas: - A primeira contém vá...
ALGO
0.999708
5.537917
01855810-6bc3-4e60-aba7-bf1e8fadb13a
Nam1001/Leetcode
leetcode134.cpp
#include<bits/stdc++.h> using namespace std; int main() { vector<int>gas={1,2,3,4,5}; vector<int>cost={3,4,5,1,2}; if(accumulate(gas.begin(),gas.end(),0)<accumulate(cost.begin(),cost.end(),0)) { cout<<-1; exit(0); } int total=0; int res=0; for(int i=0;i<gas.size();i++) ...
ALGO
0.999982
4.05022
10c6a39f-7bfd-46f7-be67-b9e6d668465b
ishandutta2007/codeforces
nuip/normal/1286/B.cpp
#include <string> #include <vector> #include<iostream> #include<cstdio> #include<cstdlib> #include<stack> #include<queue> #include<cmath> #include<algorithm> #include<functional> #include<list> #include<deque> #include<bitset> #include<set> #include<map> #include<unordered_map> #include<unordered_set> #include<cstring>...
ALGO
0.999999
3.703187
0dfdebb5-3b8d-4f25-a64e-9c899cc9b896
ishandutta2007/codeforces
kevinwan/normal/1622/D.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int mn=5010; const ll mod = 998244353; ll a[mn]; ll ch[mn][mn]; void solve(){ int n,k; cin>>n>>k; string s; cin>>s; for(int i=0;i<n;i++)a[i+1]=a[i]+(s[i]-'0'); bool first=1; ll ans=0; for(int i=0,j=0;i<=n;i++){ ...
ALGO
0.999984
4.750533
dd3af13a-4424-4265-b6e1-e3faaf41f6a5
hRJ06/DSA
Leetcode/1609. Even Odd 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.999969
5.767629
e9ac459d-cea1-446e-91a9-95864f186a90
pce913/Algorithm
baekjoon/1956.cpp
#include<stdio.h> #include<algorithm> using namespace std; int dist[401][401]; int main(){ const int INF = 100000000; int n, m; scanf("%d %d", &n,&m); for (int i = 1; i <= n; i++){ for (int j = 1; j <= n; j++){ dist[i][j] = INF; } } for (int i = 1; i <= m; i++){ int x, y, z; scanf("%d %d %d", &x, &y,...
ALGO
0.999922
4.036627
27a81599-c3a8-4bee-bdc5-59a9057e2273
Abhishekkute234/Data-Structure-and-Algorithm-in-CPP
14_stack_CPP/12_minimum_cost_to_need_string_valid.cpp
#include <bits/stdc++.h> using namespace std; int findMinimumCost(string str) { // Odd length strings can never be balanced if (str.length() % 2 == 1) return -1; stack<char> s; // Process the string for (char ch : str) { if (ch == '{') { s.push(ch); } else { // If top ...
ALGO
0.999382
5.938371
c2d4100c-351e-465d-97f7-bafed3deb40a
EvgenyShkumat/StudentCppRevisionTask09Project
StudentCppRevisionTask09Project/taskX.cpp
#include "tasks.h" /* Task X. Unique Number Digits [уникальные цифры числа] * * Дано целое число. Необходимо определить, все ли цифры числа уникальны, * т.е. среди цифр числа нет повторяющихся. * * Формат входных данных [input] * На вход подаётся целое число в диапазоне типа long long. * * Формат выходных данных [outp...
ALGO
0.999623
5.216682
982e341c-ff5c-453c-abf9-5048e775510f
illuz/leetcode
solutions/166.Fraction_to_Recurring_Decimal/AC_simulation_m2.cpp
/* * Author: illuz <iilluzen[at]gmail.com> * File: AC_simulation_m2.cpp * Create Date: 2015-04-07 21:04:50 * Descripton: */ #include <bits/stdc++.h> using namespace std; const int N = 0; class Solution { public: string fractionToDecimal(int numerator, int denominator) { string ret; ...
ALGO
0.999913
5.602809
28f528e0-d46c-4006-819a-d35e86921481
John-PS3/RPCPS3
3rdparty/llvm/llvm/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/pstl.replace_copy.pass.cpp
// UNSUPPORTED: c++03, c++11, c++14 // UNSUPPORTED: libcpp-has-no-incomplete-pstl // template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class T> // ForwardIterator2 // replace_copy(ExecutionPolicy&& exec, // ForwardIterator1 first, ForwardIterator1 last, // ...
TEST
0.927971
6.408719
2061e1d7-b4f4-46cd-aa01-a0a58410eb93
deepgenomics/GenomeKit
src/jrdist.cpp
#include "jrdist.h" #include "util.h" #include <cstring> #include <map> #include <numeric> #include <utility> BEGIN_NAMESPACE_GK using std::map; const unsigned short c_rdist_sig = 0x0deb; const unsigned short c_rdist_ver = 0x0002; // versions: // 0001: initial format // 0002: Restructured to support all chromoso...
DATA
0.894499
6.830538
b348d625-65f1-4a4f-9301-80352c067a10
Nusrat008/C-plus-plus-Programming-basic-to-Intermediate
STL/sort_array.cpp
#include<bits/stdc++.h> // #include<iterator> // #include<algorithm> using namespace std; int main(){ int arr[10] = {89,7,4,23,12,5}; sort(arr+1,arr+5); for(int i=0;i<6;i++){ cout<<arr[i]<<"\t"; } cout<<endl; return 0; }
ALGO
0.992899
3.672201
e0d88f26-a0d8-496e-83a7-f9cbc8b5967a
bruno-avr/competitive-programming
cf/odoo1/d.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 IN...
ALGO
0.999989
6.035293
8cd31923-f474-42c8-910f-fb72f1b23cbf
f4t4nt/competitive-programming
archive/CodeForces/Regular/Rd770 Div2/okea.cpp
#include <algorithm> #include <cmath> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iostream> #include <iomanip> #include <iterator> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <s...
ALGO
0.998257
3.675564
6c1d6538-4f11-44a2-bf6d-879dcbc76b69
illuz/WayToACM
ACM_CODE/Templates/Geometric/circle.cpp
/* * Author: illuz <iilluzen[at]gmail.com> * File: circle.cpp * Create Date: 2014-09-29 09:24:19 * Descripton: */ #include <cstdio> #include <cstring> #include <cmath> #include <iostream> #include <algorithm> using namespace std; #define repf(i,a,b) for(int i=(a);i<=(b);i++) typedef long long ll; ...
ALGO
0.998772
3.314628
c2549249-fdaf-442d-a525-3261f80c5de1
rainingapple/algorithm-competition-code
数据结构与算法/算法/二叉查找树/直接删除版.cpp
#include<iostream> using namespace std; struct node { int data; node* lchild; node* rchild; }; node* newnode(int v) { node* temp = new node; temp->data = v; temp->lchild = NULL; temp->rchild = NULL; return temp; } void insert_node(node*& root, int v) { if (root == NULL) { root = newnode(v); } else if (v <...
ALGO
0.999988
3.733928
5c2af6a0-cfe1-4f21-9caf-9ae3d3339b35
MrDevang/Cpppractice
display_num_digits.cpp
#include<iostream> using namespace std; int main(){ int n,r; cout<<"enter n "; cin>>n; while(n>0){ r=n%10; n=n/10; cout<<r<<endl; } return 0; }
ALGO
0.999754
3.596276
6d85952d-930a-40bf-996a-8ec96fcbdae0
himanshu231204/DSA
Array 2/MajorityElement.cpp
// Find the Majority Element that occurs more than N/2 times // Brute Force Approach /* Approach: The steps are as follows: We will run a loop that will select the elements of the array one by one. Now, for each element, we will run another loop and count its occurrence in the given array. If any element occurs more...
ALGO
0.999991
6.415905
9b05bcde-cf71-44e3-a933-034b92c08960
Dozerhank/njl_P1-P2
blt.cpp
#include <iostream> using namespace std; int main() { int input; cout << "How many rows? "; cin >> input; cout << endl; for (int i = 0; i < input; i++) { for (int row = 0; row <= i; row++) { cout << "@"; } cout << endl; } }
ALGO
0.985967
4.229498
6f2e4098-1bf8-473e-a6a2-7a5e8b4a7a09
Koltharius/UGR_Fundamentos_Programacion
Practica_04/II_Ejercicio09.cpp
/* Autor: David Sanchez Jimenez Ejercicio 9 Relacion 2 Descripcion: Programa que calcula el precio total de venta dependiendo de cuantas unidades se hayan vendido y del precio total aplicando ciertos descuentos cuando es posible Necesita: precio unitario del producto y total ...
ALGO
0.991851
5.32717
f137247e-19dc-4207-aca3-76215a4d8b39
thomasian06/udacity-self-driving-car
controls/project/pid_controller/eigen-3.3.7/doc/examples/tut_matrix_resize.cpp
#include <iostream> #include <Eigen/Dense> using namespace Eigen; int main() { MatrixXd m(2,5); m.resize(4,3); std::cout << "The matrix m is of size " << m.rows() << "x" << m.cols() << std::endl; std::cout << "It has " << m.size() << " coefficients" << std::endl; VectorXd v(2); v.resize(5); ...
ALGO
0.966475
3.882785
efbf684e-5f7a-4162-8c62-bcff3244c468
maxencevenel/test_on_mars
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.998693
6.797273
952179c3-7d9e-45f6-b094-075b3a91bfac
Tetta8/CPP_test
dokushu/chapter12/list12-2.cpp
#include <iostream> int sum_all(int* first, int* last, int val){ while(first != last){ val += *first; ++first; } return val; } int main(){ int array[10]; for(int i = 0; i < 10; i++){ array[i] = i; } int* first = &array[0]; int* last = &array[10]; std::cou...
ALGO
0.99884
4.337282
4afa23a7-0c32-437f-8f92-aed0c9e0280f
Chirag-creator17/450-dsa-questions
graphs/dfs-apna-college.cpp
#include<bits/stdc++.h> using namespace std; #define int long long int #define f(i,a,n) for(int i=a;i<n;i++) #define vi vector<int> #define pb push_back #define se(a) a.begin(),a.end() const int N=1e5+2; bool vis[N]; vi adj[N]; vi pre,pst; void dfs(int node){ vis[node]=1; pre.pb(node); //preorder vi ::itera...
ALGO
0.999995
4.612
384fad82-d954-42b3-86e5-4143dcdf93e1
brunk23/code-challenges
AdventOfCode2017/Day17/day17.cpp
#include <iostream> using std::cout; using std::endl; class CBuff { private: int len; int stepsize; int pos; int curr; int *buffer; void shiftup(int start) { int i; for( i = len-2; i >= start; i-- ) { buffer[i+1] = buffer[i]; } } public: CBuff(int size) { int i; len = 201...
ALGO
0.999564
3.868565
0859f407-a8b1-4872-9a98-40da7b1e8a6e
AnClark/android_vendor_qcom_proprietary-1
llvm-rs/lib/Transforms/IPO/PartialInlining.cpp
#define DEBUG_TYPE "partialinlining" #include "llvm/Transforms/IPO.h" #include "llvm/Instructions.h" #include "llvm/Module.h" #include "llvm/Pass.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Transforms/Utils/FunctionUtils.h" #include "llvm/ADT/Statistic.h" #include ...
ALGO
0.967041
7.917268
db2e23bb-2512-46c7-89f7-2d9e735cac32
Greedysky/Encryption-Algorithms
Encryption-Algorithms/Algorithms/iterhash.cpp
// iterhash.cpp - written and placed in the public domain by Wei Dai #include "pch.h" // prevent Sun's CC compiler from including this file automatically #if !defined(__SUNPRO_CC) || defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) #include "iterhash.h" #include "misc.h" NAMESPACE_BEGIN(CryptoPP) template <class T...
ALGO
0.997718
6.951194
bf0409f2-8bc2-4445-a371-dd41d4ffa0d4
aoyandong/algorithms
algorithms/no_tags_yet/flatten_list.cpp
/** * // This is the interface that allows for creating nested lists. * // You should not implement it, or speculate about its implementation * class NestedInteger { * public: * // Return true if this NestedInteger holds a single integer, * // rather than a nested list. * bool isInteger() const; *...
ALGO
0.999952
6.185926
640a5b82-0cb9-4ec9-943e-3bcf0000e4f3
KunalJadhao/My_Cpp_Journey
Day9/P12.cpp
// Code to swap 2 numbers without using 3rd variable using pointers #include <iostream> using namespace std; int main() { int a = 20, b = 10; int *p1 = &a, *p2 = &b; cout << "Before swap: *p1=" << *p1 << " *p2=" << *p2 << endl; *p1 = *p1 + *p2; *p2 = *p1 - *p2; *p1 = *p1 - *p2; cout << "...
ALGO
0.999554
5.223251
694d0259-114b-490c-858a-59dfd746bc48
chitao1234/XDU_DS_Lab
sorts/mergesort.cpp
#include <iostream> using namespace std; int n; void print(int a[], int n) { for (int i = 0; i < n; ++i) { cout << a[i] << ' '; } cout << endl; } void merge(int a[], int s, int t) { int mid = (s + t) / 2; int *temp = new int[t - s + 1]; int i = s, j = mid + 1, k = 0; while (i <= mi...
ALGO
0.999962
5.067307
2468f178-4952-4421-9a3f-e57524a3c042
Reafox/fox-scanner-cltg
create_permutation_tree.cpp
/* Файл: create_permutation_tree.cpp Создано: 17 июля 2017г. Автор: Гаврилов Владимир Сергеевич E-mails: <EMAIL> <EMAIL> <EMAIL> */ #include "create_permutation_tree.h" static void create_permutation_treeR(Permutation_tree& p, si...
ALGO
0.999689
5.188901
e9723880-2a24-45c6-8f69-a36fe3d685c2
aanda-stcloudstate-edu/WebSpace
cs201/Gaddis/9e/SourceCode/Chapter 17/Program 17-23.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int searchValue; // Value to search for // Create a vector of unsorted integers. vector<int> numbers = { 10, 1, 9, 2, 8, 3, 7, 4, 6, 5 }; // Sort the vector. sort(numbers.begin(), numbers.end()); // Disp...
ALGO
0.999904
6.007292
3e786a09-a3d1-4c4c-9044-7575280015a3
rcedgar/reseek
src/swgaplessprof.cpp
#include "myutils.h" #include "mx.h" #include "alpha.h" #include "xdpmem.h" extern float B62Mf[20][20]; // float GetBlosum62Score(char a, char b); float SWGapless(Mx<float> &DPMx, const Mx<float> &SMx, uint LA, uint LB, uint &Loi, uint &Loj, uint &ColCount); static float SWFastGaplessProf(XDPMem &Mem, const float ...
ALGO
0.995783
4.952136
0dae9d9d-9cd1-497a-b76d-da8a43504652
VamsiDigamarthi/flutter_projects
quezi_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.998957
6.76073
5324eb93-bbc5-49f5-a5bb-fb8b13e24bf2
amity874/Cpp_DataStructure-Repo
IntroToDsa/Recursion/FriendsParty.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int #define loop(i,a,b) for(int i=(a);i<=(b);i++) #define looprev(i,a,b) for(int i=(a);i>=(b);i--) #define logarr(arr,a,b) for(int z=(a);z<=(b);z++) cout<<(arr[z])<<" ";cout<<endl; int Ways(int n){ if(n==1 or n==2){ return n; } int...
ALGO
0.99997
4.05531
e410e718-8962-4e2c-9195-84e8400e6ac5
SMAN2901/CPMaterials
Graph Theory/lcs_sqrt_decomposition.cpp
#include <bits/stdc++.h> using namespace std; const int MX=1003; int K; int par[MX],dis[MX]; int block[MX],head[MX]; vector <int> adj[MX]; void init(int n) { for(int i=0;i<=n;i++){ adj[i].clear(); } } int dfs(int u,int p) { int h=1; int l=adj[u].size(); for(int i=0;i<l;i++){ int ...
ALGO
0.999851
3.840619
cefdc387-77b7-49c2-aa55-cbb892298550
RishabhSkr/GFG_problems
Easy/Decimal Equivalent of Binary Linked List/decimal-equivalent-of-binary-linked-list.cpp
//{ Driver Code Starts // Program to check if linked list is empty or not #include<iostream> using namespace std; const long long unsigned int MOD = 1000000007; /* Link list Node */ struct Node { bool data; struct Node* next; Node(int x){ data = x; next = NULL; } }; // } Driv...
ALGO
0.999971
6.266855
ea1130a4-4985-40e5-aaf8-ef1b7c28ebc2
GianCarloLajarca/C--Udemy-Challenges
ChallengeSolution-Section10/main.cpp
// Section 10 // Challenge - Solution // Substitution Cipher /* A simple and very old method of sending secret messages is the substitution cipher. You might have used this cipher with your friends when you were a kid. Basically, each letter of the alphabet gets replaced by another letter of the alphabet. For example,...
ALGO
0.99798
5.744112
aeec3c8e-e463-4b2d-9677-420a642549d6
NielsHolst/UniSim3
src/plugins/boxes/sobol_g_function.cpp
#include <base/exception.h> #include <base/publish.h> #include "sobol_g_function.h" using namespace base; namespace boxes { PUBLISH(SobolGFunction) SobolGFunction::SobolGFunction(QString name, Box *parent) : Box(name, parent) { help("computes Sobol' g function"); Input(a).help("Vector of parameters"); ...
TOOL
0.984697
6.866841
f0d1649d-93a3-451d-8316-6faf0bef3398
chgaobt/cpgroup_hackathon_chatbot
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.998756
6.772262
73d24259-b0e4-45cc-966d-ffa314f02ea7
kei1107/algorithm
problems/Atcoder/ABC140_F.cpp
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int INF = 1e9; const ll LINF = 1e18; inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; } inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; } template<class S,class T> ostream& operator...
ALGO
0.999986
4.013896
b83a90c6-0b32-4c0b-9f69-f959553759ee
CSI-SRM-NCR-Chapter/100-Days-of-Code
Aman_Agnihotri/Day 024/24_2.cpp
class Solution { public: int findKthLargest(vector<int>& nums, int k) { priority_queue<int, vector<int>, greater<>> minHeap; for (const int num : nums) { minHeap.push(num); if (minHeap.size() > k) minHeap.pop(); } return minHeap.top(); } };
ALGO
0.999931
5.966874