uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
e9722e9f-0797-4ad3-a560-cd696d345477
coinmetrics/bitcoin-zmq-mempool-chain-events
src/qt/rpcconsole.cpp
#if defined(HAVE_CONFIG_H) #include <config/bitcoin-config.h> #endif #include <qt/rpcconsole.h> #include <qt/forms/ui_debugwindow.h> #include <chainparams.h> #include <interfaces/node.h> #include <netbase.h> #include <qt/bantablemodel.h> #include <qt/clientmodel.h> #include <qt/peertablesortproxy.h> #include <qt/plat...
TOOL
0.957692
3.002696
31d74eba-814d-4176-a23f-b921ed94bab4
UserBits/OI-Codes
Luogu/P2338[排序][线性扫描][模拟]失败的滑雪Bissie Slows Down.cpp
#include <cstdio> #include <algorithm> #include <iostream> using namespace std; int x[10005],y[10005]; int main(){ double ans=0.0,pos=0.0; int sum=1,n,lx=0,ly=0; char c; scanf("%d",&n); for(int i=1;i<=n;i++){ cin>>c; if(c=='T'){ lx++; cin>>x[lx]; } else{ ly++; cin>>y[ly]; } } sort(x+1,x+1+l...
ALGO
0.999694
3.011248
8b42db69-ae98-4234-bbdc-5e02d7757fd5
wwcodekl/project-miki-android
libraries/tess-two/jni/com_googlecode_tesseract_android/src/wordrec/lm_pain_points.cpp
#include "lm_pain_points.h" #include "associate.h" #include "dict.h" #include "genericheap.h" #include "lm_state.h" #include "matrix.h" #include "pageres.h" namespace tesseract { const float LMPainPoints::kDefaultPainPointPriorityAdjustment = 2.0f; const float LMPainPoints::kLooseMaxCharWhRatio = 2.5f; LMPainPoints...
ALGO
0.988419
5.310579
d6249a51-2580-40fe-a752-082cd208f425
awhitbeck/usercode
MEMerger/src/MEMCalculators.cpp
/************************************************************************* * Authors: MEKD & MELA fans *************************************************************************/ #ifndef MEMCalc_MEMCalc_cpp #define MEMCalc_MEMCalc_cpp /// MEMCalculators header #include "ZZMatrixElement/MEMerger/interface/MEMCalcul...
ALGO
0.995715
5.897948
4bd1b639-c7ea-4629-afbc-c416d7d067b0
PinochetLab/dynamic-algo-contest
Well/main.cpp
#include <iostream> #include <algorithm> #include <queue> #include <vector> #include <tuple> using i = uint64_t; using p = std::tuple<i, i, size_t>; size_t n; p ps[100001]; i s; int main() { i sum = 0; std::cin >> n; for (size_t j = 0; j < n; j++) { i h, l; std::cin >> h >> l; ps[j] = { h, l, j + 1 }; sum...
ALGO
0.99987
3.184659
9253f09f-ba2f-4d3c-b643-7bcd1d9640d2
yhwang1990/minimum-coresets
optimal/runOptFixSize.cpp
#include <vector> #include <iostream> #include "IOUtil.hpp" #include "Point2D.hpp" #include "OptimalCoreset.h" #include "Validation.hpp" using namespace std; int main(int argc, char *argv[]) { if (argc != 6) { cerr << "usage: ./opt-r <r> <dataset_path> <dirs_path> <valid_path> <output_path>" << endl; ...
ALGO
0.999645
5.758224
b1662e23-037b-4348-8595-fdc1e35e212f
kantinilesh/OOPDAssignment
q11.cpp
#include <iostream> using namespace std; int main(){ string month; cout<<"Enter name of the month"<<endl;; cin>>month; if(month == "January"|| month == "March" || month== "May"|| month == "July"|| month == "August" || month == "October" || month== "December") { cout<< "31 days"; }...
ALGO
0.997031
4.559185
ab23fec9-4546-4899-8f31-15a39f6cbc80
yfxhust/AntTracksVM
src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
#include "precompiled.hpp" #include "classfile/symbolTable.hpp" #include "classfile/systemDictionary.hpp" #include "code/codeCache.hpp" #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" #include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp" #include "gc_implementation/parallelScaven...
TOOL
0.87777
6.523042
593c0a34-5f55-4d99-b1fe-e888ad4bd828
mini7007/CrackYourPlacement
Find All Duplicates in an Array.cpp
class Solution { public: vector<int> findDuplicates(vector<int> &nums) { vector<int> ans; for (const int num : nums) { nums[abs(num) - 1] *= -1; if (nums[abs(num) - 1] > 0) ans.push_back(abs(num)); } return ans; } };
ALGO
0.999954
5.822238
e407a307-8aea-48ad-a067-6c636dc5546d
cheeringo/ROS
RoboRTS-ros/roborts_localization/amcl/map/amcl_map.cpp
#include "amcl_map.h" namespace roborts_localization { CachedDistanceMap::CachedDistanceMap(double scale, double max_dist) { scale_ = scale; max_dist_ = max_dist; cell_radius_ = static_cast<int>(max_dist / scale); distances_mat_.resize(cell_radius_ + 2); for (auto it = distances_mat_.begin(); it != dis...
ALGO
0.969604
6.748353
4d45ac38-d212-492f-a630-3f7ad94433e5
mp-almeida/Programacao-Estruturada
Trabalho2/Trabalho2_exc6/main.cpp
#include <iostream> using namespace std; int main() { float raio, area; cout << "Digite o raio em cm: " << endl; cin >> raio; area = (raio * raio) * 3.14; cout << "A rea do crculo " << area << " cm quadrados"; return 0; }
ALGO
0.905202
3.416172
9dca65e0-92f1-4793-827c-9a304bbf1802
solareenlo/atcoder
05_AtCoder-Beginner-Contest/abc198/D/main.cpp
#include <bits/stdc++.h> using namespace std; long long f(string &s, vector<int> &b, vector<int> &c) { if (b[c[s[0]]]==0) return -1; long long res = 0; for (auto x : s) res = res * 10 + b[c[x]]; return res; } int main() { string s1, s2, s3; cin >> s1 >> s2 >> s3; set<char> se; se.insert(s1.begin(), s1.end(...
ALGO
0.999672
4.613742
69058064-be6d-4a14-9952-9858da24098b
zzm99/Algorithm-Training
动态规划/树形DP/124. 二叉树中的最大路径和.cpp
class Solution { public: int result; int maxPathSum(TreeNode* root) { if(!root) return 0; result = root->val; dfs(root); return result; } int dfs(TreeNode* root){ if(!root) return 0; int left = max(dfs(root->left), 0); int right = max(dfs(roo...
ALGO
0.999988
6.579248
bd6482f7-74e4-43b2-a137-5ab6256d7c89
fly-vision/pointgray_aruco
aruco_ros/src/markerdetector.cpp
#include "markerdetector.h" #include "cameraparameters.h" #include "markerlabeler.h" #include "timers.h" #include <opencv2/core/core.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/features2d/features2d.hpp> #include <opencv2/calib3d/calib3d.hpp> #include <fstream> #include <iostream> #include <valarray>...
TOOL
0.872184
6.54328
f5e7b40d-b4e7-4f5f-8646-35441da9578f
anurag95/codechef
lepaint.cpp
#include<bits/stdc++.h> using namespace std; int main() { int t, n, c, k, i, j, l, r, o; scanf("%d", &t); while(t--) { scanf("%d%d%d", &n, &c, &k); double dp[51][51][101] = {0}; for(i=1;i<=n;i++) dp[0][i][1] = 1; for(i=1;i<=k;i++) { scanf("%d%d", &l, &r); for(j=1;j<=n;j++) { for(o=0;o<c;o+...
ALGO
0.999595
3.066854
4d354084-e097-46fc-a14d-05790667b77e
munafmd9849/GeeksForGeeks
Difficulty: Basic/Identical Linked Lists/identical-linked-lists.cpp
/* class Node { public: int data; Node* next; Node(int x) { data = x; next = NULL; } }; */ class Solution { public: bool areIdentical(Node *head1, Node *head2) { // code here Node *t1=head1; Node *t2=head2; while(t1!=NULL && t2!=NULL){ ...
ALGO
0.999906
5.331142
c71fe217-d196-4791-a870-29b4e4983b73
sckdtv89/cplus
Code/Order_1.cpp
#include<iostream> #include<algorithm> using namespace std; int main(){ int t; cin >> t; while(t > 0){ int n, k; cin >> n >> k; int a[n]; for(int i = 0; i < n; i++){ cin >> a[i]; } sort(a, a+n); cout << a[k-1] << endl; t--; } return 0; }
ALGO
0.999942
3.543971
9f249d65-0503-45f1-b6f5-f54a2c5575bf
songhn233/Algorithm-Packages
hdu-winter-2020/problems/图论/1001.cpp
#include<cstdio> #include<algorithm> #include<cstring> #include<iostream> #include<vector> #include<queue> #include<cmath> #include<map> #include<set> #define ll long long #define F(i,a,b) for(int i=(a);i<=(b);i++) #define mst(a,b) memset((a),(b),sizeof(a)) #define PII pair<int,int> using namespace std; template<class ...
ALGO
0.99971
3.958223
ac9b5070-1f15-4ccc-806e-e587558d8e10
utkipatel/Codeforces
617/A.cpp
#include<bits/stdc++.h> using namespace std; int main() { int x; cin>>x; int ans = (x+4)/5; cout<<ans<<endl; return 0; }
ALGO
0.999889
3.316728
1445f1b2-ddea-47ec-97c8-d6d79e20108b
STEllAR-GROUP/tutorials
examples/00_exercises/exercise6.cpp
#include <hpx/future.hpp> #include <hpx/iostream.hpp> #include <hpx/wrap_main.hpp> #include <memory> // This program compiles and runs correctly. Try to use futures, async, dataflow // etc. to parallelize the code. Note that this example is too small to see any // benefits from doing so, but forces you to use the pri...
ALGO
0.979458
6.169124
39e553a4-9610-4bb4-9b94-6794e1ee4e18
itssagnikmukherjee/BEST-CPP-GUIDE
7. Arrays/1D Arrays/Theory/2. sizeOf.cpp
// THE SIZEOF OPERATOR RETURNS THE SIZE OF A DATATYPE #include<bits/stdc++.h> using namespace std; int main(){ int a = 5; cout<<sizeof(a)<<endl; // returns 4 because 4 bytes are req to store an integer value int arr[] = {3,5,6,7,8}; cout<<sizeof(arr); // returns 20 because it has 5 int elems which tak...
ALGO
0.944253
4.212726
120ec4de-3dca-4621-86bd-ba2bb1ccba95
shoaibrayeen/Data-Structures-and-Algorithms
Egg Dropping Puzzle/code_3.cpp
#include <iostream> using namespace std; /* Time Complexity : O(n Log k) */ int getBinomialCoefficient(int mid , int numberOfEggs , int numberOfFloors) { int sum = 0, term = 1; for (int i = 1; i <= numberOfEggs && sum < numberOfFloors; ++i) { term *= mid - i + 1; term /= i; sum += term;...
ALGO
0.999902
5.388554
ce50a243-39ac-4b4d-8165-3107d3c95705
cliff-bohm/ALIFE_2024_MODES
code/Analyze/stateToState.cpp
#include "stateToState.h" // given two list of intTimeSeries, nodes and edges, and a list of lifetimes save stateToState diagram (graphviz) for each node->edge->node trasition // if there is more then one lifeTime then the node->node between lifetimes is excluded // nodes and edges are labeled, and edges labels are fo...
ALGO
0.881854
4.09494
b79c21da-b5cd-4223-8646-86891ef311c6
robertcrockett/tortoiseSVN_1_13_1
src/SVN/SVNLineDiff.cpp
// TortoiseMerge - a Diff/Patch program const svn_diff_fns2_t SVNLineDiff::SVNLineDiff_vtable = { SVNLineDiff::datasources_open, SVNLineDiff::datasource_close, SVNLineDiff::next_token, SVNLineDiff::compare_token, SVNLineDiff::discard_token, SVNLineDiff::discard_all_token }; #define SVNLINEDIFF...
TOOL
0.9895
6.430869
97749b20-ba67-43a4-a1b0-ab8b1f3caad4
fsZhuangB/leetcode_solution
35_search_and_insert_position.cpp
/** * Given a sorted array and a target value, * return the index if the target is found. * If not, return the index where it would be if it were inserted in order. * You may assume no duplicates in the array. */ /** * We use binary search to solve this problem. * Remember it's hard to write a bug-free program...
ALGO
0.999981
6.390404
a951449e-90f9-4d8c-a772-93e0c9727d46
HarudaySharma/DSA
Heap/leetcode/347.cpp
#include "bits/stdc++.h" #include <functional> #include <map> #include <queue> using namespace std; class Solution { public: vector<pair<int, int>> heap; int getParent(int i) { int p = i % 2 == 0 ? (i - 2) / 2 : (i - 1) / 2; return p < 0 ? -1 : p; } void swap(pair<int, int>&a, pair<in...
ALGO
0.999996
5.262672
d9faacea-6a81-49ce-8969-6d65d3c2713c
Nunurius/Pencarian_Universitas
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
2e6fecb8-91a4-4e95-a0e6-13a3229b766b
ishandutta2007/codeforces
icecuber/normal/1186/F.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int deg[1000000], deg0[1000000]; int main() { ios::sync_with_stdio(0); cin.tie(0); int n, m; cin >> n >> m; vector<pair<int,int>> edges; for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; a--, b--; deg[a]++, deg[b]++; ...
ALGO
0.999976
3.81436
5516011a-7366-49b1-9771-763681299678
OnePointFive99/Algorithm-Notes
test.cpp
#include<cstdio> using namespace std; int count(int n,int result){ int num = n; if(num == 1)return result; if(num % 2 == 0){ num /= 2; result++; } else { num = (3 * num + 1)/2; result++; } return count(num,result); //return 0; } int main(){ ...
ALGO
0.999941
4.231986
45b7fdf2-830e-47e2-839c-d0aff3f93c8d
chakitg/cp_solutions
gfg-potd/Determine if Two Trees are Identica.cpp
Given two binary trees, the task is to find if both of them are identical or not. Note: You need to return true or false, the printing is done by the driver code. Example 1: Input: 1 1 / \ / \ 2 3 2 3 Output: Yes Explanation: There are two trees both having 3 nodes and 2 edges...
ALGO
0.999912
6.067281
52476fa1-2794-49c9-82b8-d5aec760a240
lwgboy/Device-Testing
No65-68_Password Management (firmware-mod-kit)/src/others/squashfs-4.2/lzma-4.65/CPP/Common/CommandLineParser.cpp
// CommandLineParser.cpp #include "StdAfx.h" #include "CommandLineParser.h" namespace NCommandLineParser { void SplitCommandLine(const UString &src, UString &dest1, UString &dest2) { dest1.Empty(); dest2.Empty(); bool quoteMode = false; int i; for (i = 0; i < src.Length(); i++) { wchar_t c = src[i];...
TOOL
0.92944
5.784807
7d063b12-3f43-4059-a563-74b00a67c357
qxp1011/WOAL
ace/ACE_wrappers/examples/ASX/Message_Queue/priority_buffer.cpp
// $Id: priority_buffer.cpp 91671 2010-09-08 18:39:23Z johnnyw $ // This short program prints the contents of stdin to stdout sorted by // the length of each line via the use of an ASX Message_Queue. It // illustrates how priorities can be used for ACE Message_Queues. #include "ace/OS_NS_stdio.h" #include "ace/Mallo...
TOOL
0.906672
6.485553
9afd827f-0ff9-41c9-a186-83b2cb1527af
antoine-chan-lock/PolarInterpolants
CommonLibraries/libigl/include/igl/kelvinlets.cpp
#include "kelvinlets.h" #include "PI.h" #include "parallel_for.h" namespace igl { // Performs the deformation of a single point based on the regularized // kelvinlets // // Inputs: // dt delta time used to calculate brush tip displacement // x dim-vector of point to be deformed // x0 dim-vector of brush tip //...
ALGO
0.999695
6.608298
092657b6-60f0-498e-8a00-77f1d73c7ac1
zeyuanxy/leet-code
vol3/best-time-to-buy-and-sell-stock-ii/best-time-to-buy-and-sell-stock-ii.cpp
class Solution { public: int maxProfit(vector<int> &prices) { int n = prices.size(); int ans = 0; for(int i = 0; i < n - 1; ++ i) if(prices[i + 1] - prices[i] > 0) ans += prices[i + 1] - prices[i]; return ans; } };
ALGO
0.999742
5.93477
00225ce7-bfd9-4927-840f-f095ee461b2a
ishandutta2007/codeforces
merkurev/normal/429/D.cpp
#include <iostream> #include <cstring> #include <string> #include <vector> #include <algorithm> using namespace std; const int maxn = 1e5 + 100; int a[maxn]; int inf = 1e9; int n; int getAns(int d) { int answer = inf; for (int i = 0; i < n; i++) { int sum = 0; for (int j = i + 1; j <= i + d && j < n; j++) {...
ALGO
0.999917
3.812349
15f6d347-c0d1-4c12-910a-6994ab6c1905
ankan-ekansh/Competitive-Programming
Uncategorized/hmappy1v3.cpp
#include<bits/stdc++.h> using namespace std; int a[400000]; //int b[400000]; int n,k; int f,r; void shift(){ int temp=a[r]; f--; r--; a[f]=temp; /* for(int i=0;i<n;i++){ b[i+1]=a[i]; } b[0]=temp; for(int i=0;i<n;i++){ a[i]=b[i]; } */ } int len(){ int l=0; int...
ALGO
0.999774
3.710077
8f23cb74-c00b-4b07-904b-37fba0d00bfe
akaboydeve/75_code_challenge
20.cpp
#include <iostream> #include <string> #include <vector> #include <map> #include <bits/stdc++.h> #include <algorithm> using std::max; using std::min; using std::vector; using namespace std; class Solution { public: bool wordBreak(string s, vector<string> &wordDict) { int n = s.length(); vector<...
ALGO
0.999385
5.754163
5e8d4d1a-8410-4cac-997c-16528e99dcee
gagan1147/geeksforgeeks
sorting/sort012.cpp
#include<bits/stdc++.h> using namespace std; void solve(int arr[],int n){ int low = 0,mid =0,high = n-1; while(mid<=high){ if(arr[mid] == 0){ swap(arr[low],arr[mid]); low++; mid++; } else if(arr[mid] == 1){ mid++; } else{ ...
ALGO
0.999989
3.963774
9adb8d05-d6a0-4d2f-9e73-ea62e02e6ca4
doda42/mtrx3760_2024
LectureExamples/6B_Iters_Algs/AlgorithmSortArray.cpp
// Demonstrates std::sort #include <iostream> #include <array> #include <algorithm> int main () { // make a container std::array<int, 6> MyArray = {234, 436, 123, 1, 7436, 21}; // display for( int Val : MyArray ) std::cout << Val << ' '; std::cout << std::endl; // sort the contents of the container ...
ALGO
0.992922
4.344161
8fbe3d46-a228-4c33-ac8a-bd37ec4cfd93
PacificBeast/UniversalRobotUHL2
ur_kinematics/src/ur_kin.cpp
#include <ur_kinematics/ur_kin.h> #include <math.h> #include <stdio.h> namespace ur_kinematics { namespace { const double ZERO_THRESH = 0.00000001; int SIGN(double x) { return (x > 0) - (x < 0); } const double PI = M_PI; //#define UR10_PARAMS #ifdef UR10_PARAMS const double d1 = ...
ALGO
0.999674
4.870769
5927733f-a6cf-4a8b-9d5b-256a702446d6
shahidul-brur/OnlineJudge-Solution
Codeforces (volume 2)/476_A - Dreamoon and Stairs.cpp
#include <bits/stdc++.h> using namespace std; int main() { //freopen("in.txt", "r", stdin); int n, m, total, no; scanf("%d %d", &n, &m); if(n%2==0) total=n/2; else total=(n-1)/2+1; no=0; while(total%m!=0) { total++; if(total>n) { no=1; ...
ALGO
0.999993
3.618662
41e0ff9d-b4da-4a9d-9de7-4fb8d70a1756
gw280/gecko
gfx/skia/trunk/src/pathops/SkDCubicToQuads.cpp
/* http://stackoverflow.com/questions/2009160/how-do-i-convert-the-2-control-points-of-a-cubic-curve-to-the-single-control-poi */ /* Let's call the control points of the cubic Q0..Q3 and the control points of the quadratic P0..P2. Then for degree elevation, the equations are: Q0 = P0 Q1 = 1/3 P0 + 2/3 P1 Q2 = 2/3 P1 ...
ALGO
0.995142
3.713503
91ee060d-31c9-432a-b94d-ec5fadbfc8dc
Hemant2A2/Codeforces
expression.cpp
//https://codeforces.com/problemset/problem/479/A #include <iostream> #include <vector> using namespace std; int main() { int a,b,c; cin >> a >> b >> c; vector<int> val; val.reserve(6); val.push_back(a+b+c); val.push_back((a+b)*c); val.push_back(a*(b+c)); //val.push_back((a+c)*b); ...
ALGO
0.99961
4.071023
02c2ae97-faea-414f-968e-bf06be54748a
eugenis/boost-nacl
libs/spirit/classic/phoenix/example/fundamental/sample4.cpp
#include <vector> #include <algorithm> #include <iostream> #include <boost/spirit/include/phoenix1_operators.hpp> #include <boost/spirit/include/phoenix1_primitives.hpp> #include <boost/spirit/include/phoenix1_statements.hpp> #include <boost/spirit/include/phoenix1_special_ops.hpp> using namespace std; using namespace...
TOOL
0.908254
4.742697
5d4eee50-b6d8-4c8c-bef3-4c307bc6e672
romeorizzi/portafoglioVoti_public
Algoritmi/2019-09-04/all-CMS-submissions/2019-09-04.11:03:52.973617.VR439211.hanoi_equal_disks.cpp
/** * user: VR439211 * fname: ARIETTI * lname: LUCA * task: Prob2_hanoi_equal_disks * score: 20.0 * date: 2019-09-04 11:03:52.973617 */ /** * Un template per la tua soluzione di hanoi_equal_disks * Romeo Rizzi, 2019-08-28 * */ #include <cassert> #include <cstdio> const int DEBUG = 0; //const int DEBUG = 1; con...
ALGO
0.999931
4.295002
7a8a8d55-5653-4f5c-ab0f-7714ece45217
byumjin/Vulkan-VXGI-VR-FrameWork
VR Project/OculusSDK/LibOVR/Shim/OVR_CAPI_Util.cpp
#include <Extras/OVR_CAPI_Util.h> #include <Extras/OVR_StereoProjection.h> #include <algorithm> #include <limits.h> #include <memory> #if !defined(_WIN32) #include <assert.h> #endif #if defined(_MSC_VER) && _MSC_VER < 1800 // MSVC < 2013 #define round(dbl) \ (dbl) >= 0.0 ? (int)((dbl) + 0.5) \ ...
TOOL
0.903674
6.370524
3af04c4a-adef-4b67-a6b8-f97ce5654a1d
DetegiCE/baekjoon-ps
15000s/15483.cpp
#include<bits/stdc++.h> using namespace std; #define INP ios_base::sync_with_stdio(0); cin.tie(0) string a, b; int dp[1001][1001]; int ans = 0; int main() { INP; cin >> a; cin >> b; a = '_' + a; b = '_' + b; int asz = a.size(), bsz = b.size(); for(int i=1 ; i<bsz ; i++) { dp[0...
ALGO
0.999929
4.029045
1a23fc53-bc04-42ae-af44-5f290c09f2b4
Pooh1223/Online-Judge
Sprout/#159.cpp
#include <bits/stdc++.h> using namespace std; int v[105]; bool can[20005]; int main(){ cin.tie(0); int t; cin >> t; while(t--){ memset(can,0,sizeof(can)); memset(v,0,sizeof(v)); can[0] = 1; int n,m; cin >> n >> m; int cnt = 0; for(int i = 0;i < n;++i){ int c,k; cin >> c >> k; int sum = 0,last...
ALGO
0.999913
3.539243
7b640d73-76c4-4ee3-96b7-7c79be2fe283
timprepscius/GeometricTools-OpenGLES
WildMagic5/LibMathematics/CurvesSurfacesVolumes/Wm5BSplineFitBasis.cpp
#include "Wm5MathematicsPCH.h" #include "Wm5BSplineFitBasis.h" #include "Wm5Memory.h" namespace Wm5 { //---------------------------------------------------------------------------- template <typename Real> BSplineFitBasis<Real>::BSplineFitBasis (int quantity, int degree) { assertion(1 <= degree && degree < quantit...
ALGO
0.97847
7.340426
e1efee80-020e-406e-8a12-b7514ee9f26f
0xymoro/Masquerade-Openpose
OpenPoseTesting/openpose-master/3rdparty/caffe/src/caffe/solvers/adadelta_solver.cpp
#include <vector> #include "caffe/sgd_solvers.hpp" namespace caffe { template <typename Dtype> void AdaDeltaSolver<Dtype>::AdaDeltaPreSolve() { // Add the extra history entries for AdaDelta after those from // SGDSolver::PreSolve const vector<Blob<Dtype>*>& net_params = this->net_->learnable_params(); for (i...
ALGO
0.979462
7.575578
e501cf2e-d8c1-4722-beb0-30e92e7a1cb2
fantasticprathap/C-program
C Programming/Do while loop/dowhileperfect.cpp
//perfect number //prathap //6/1/2023 #include<stdio.h> int main() { int i,k,n; i=1; k=0; printf("Enter the number="); scanf("%d",&n); do { if (n%i==0) { k=k+i; } i++; } while(i<n); { if (k==n) printf("The number is per...
ALGO
0.999557
3.331414
babb7d95-cf4f-4968-9720-3ed57a86feac
ishandutta2007/codeforces
egor.lifar/normal/1531/E2.cpp
/* KAMUI! */ #include <iostream> #include <complex> #include <vector> #include <string> #include <algorithm> #include <cstdio> #include <numeric> #include <cstring> #include <ctime> #include <cstdlib> #include <set> #include <map> #include <unordered_map> #include <unordered_set> #include <list> #include <cmath> #incl...
ALGO
0.999979
3.115527
7240b180-0db0-4f95-b315-2402389028a2
jwnhy/lam
llvm-project/libc/src/math/amdgpu/remquo.cpp
#include "src/math/remquo.h" #include "src/__support/common.h" #include "declarations.h" #include "src/__support/macros/config.h" namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(double, remquo, (double x, double y, int *quo)) { int tmp; double r = __ocml_remquo_f64(x, y, (gpu::Private<int> *)&tmp); *quo = t...
TOOL
0.977208
6.043107
981f877f-1983-4d80-af3d-d789e142a18a
alvinpiter/competitive-programming
Codeforces/582/B.cpp
#include<bits/stdc++.h> using namespace std; #define MAXN 150000 int t, n, a[MAXN + 3], suffixMin[MAXN + 3], answer; int main() { scanf("%d", &t); for (int cases = 1; cases <= t; cases++) { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d", &a[i]); suffixMin[n] = a[...
ALGO
0.999728
4.023371
4832c806-9414-49d7-a718-4bc210c2462c
yu3mars/proconVSCodeGcc
aoj/itp2/itp2_1_b.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using pii = pair<int, int>; #define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i) #define all(x) (x).begin(),(x).end() #define m0(x) memset(x,0,sizeof(x)) int dx4[4] = {1,0,-1,0}, dy4[4] = {0,1,0,-1}; int main(){ in...
ALGO
0.999392
4.093233
750972da-47d0-4211-b83c-050354a28365
DarshanaMohan/Leetcode-submission
1019-squares-of-a-sorted-array/squares-of-a-sorted-array.cpp
class Solution { public: vector<int> sortedSquares(vector<int>& nums) { vector<int> res; for (int i = 0; i < nums.size(); i++) { int sum = nums[i] * nums[i]; res.push_back(sum); } sort(res.begin(), res.end()); return res; } };
ALGO
0.999983
6.140106
efd30261-ab78-432a-a9c4-53917b967056
raincross7/code-similarity
codes/train_code/problem220/problem220_345.cpp
#include <bits/stdc++.h> #define gcd(m,n) __gcd(m,n) #define lcm(m,n) m*(n/gcd(m,n)) #define fast std::ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define pi acos(-1.0) #define endl '\n' #define MOD 1000000007 #define ull unsigned long long #define ll long long #define ld long double #define pb push_back...
ALGO
0.999981
3.254087
85715657-d1ec-4717-a52f-95dbaaa2763d
NabeelAhmed-090/Interview-Preparation
Medium/Container-With-Most-Water.cpp
/* https://leetcode.com/problems/container-with-most-water/ */ #include <iostream> #include <vector> using namespace std; class Solution { public: int maxArea(vector<int> &height) { int maxAmount = INT_MIN; int maxHeight = height[0] - 1; int size = height.size(); if (size > 0) ...
ALGO
0.999899
6.511002
783bc318-aefd-4ca8-93dc-436f55c029c7
ronaflx/ACM_template
networkflow/mincost.cpp
typedef long long USETYPE; const USETYPE INF = numeric_limits<USETYPE>::max();//<limits> template<typename T = int> class mincost { private: const static int N = 1000; const static int E = 100000; struct edge { int u, v; T cost, cap; edge *nxt; } pool[E], *g[N], *pp, *pree[N]; ...
ALGO
0.985087
3.911246
3e8ec6af-d968-40b9-8eaf-7c1a7656c992
getcomp-dev/GETCode
solutions/1263/1263.cpp
#include <iostream> #include <string> using namespace std; int main(int argc, char *argv[]) { for(;;) { string entrada; int aliteracoes; // Quantidade de aliterações char letra; // Ultima letra encontrada bool novaLetra; // Flag que define se é a primeira vez que uma letra a...
ALGO
0.999587
3.876826
7a8ce910-3620-4915-9b16-da54398e0fb0
HuangZi-zi/OpenCV_Route_Detection
OpenCV_Route_Detection/OpenCV_Route_Detection.cpp
// OpenCV_Route_Detection.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> #include <thread> #include <chrono> #include <opencv2/imgcodecs.hpp> #include <opencv2/highgui.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/opencv.hpp> #include <opencv2/imgp...
TOOL
0.962444
3.318212
b9ab9197-c3d9-4509-aff7-e1f84211595d
nekobean/mahjong-cpp
src/misc/shanten_table/list_hand_and_melds_patterns.cpp
#undef NDEBUG #include <algorithm> #include <cassert> #include <future> #include <iostream> #include <thread> #include <vector> #include <cppitertools/combinations.hpp> #include <cppitertools/combinations_with_replacement.hpp> #include <cppitertools/product.hpp> #include <cppitertools/range.hpp> #include <spdlog/spdl...
ALGO
0.966001
7.803919
e97b9c51-8be6-4dfb-a78b-c2b738e9972f
johannzhang168/Grep-clone
phaseTwo/hash_table_values.cpp
#include <iostream> #include <string> #include <vector> #include <functional> #include <string.h> #include <functional> #include <stack> #include "hash_table_values.h" using namespace std; /* default constructor * Purpose: creates an default instance of the HashTableV class * Parameters: none * Returns: none * Effect...
ALGO
0.996063
5.3393
edc99e42-0884-4de3-992c-5761a898c5b6
devSmarak972/MyDSA
cses/graph/planet1.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int n,q; int logk=31; int main() { auto start = std::chrono::high_resolution_clock::now(); ios_base::sync_with_stdio(false); cin.tie(NULL); cin>>n>>q; // AL.assign(n+1,0); vector<vector<int>> par(n+1,vector<int>(logk,0)); f...
ALGO
0.999987
4.237092
27e1b47a-15b2-48f0-b69a-66aaeabf229c
kevinMkY/CPP_ALGO
testC++++/剑指 Offer 19. 正则表达式匹配.cpp
// // 剑指 Offer 19.cpp // testC++++ // // Created by yekaihua on 2021/2/26. // #include "剑指 Offer 19. 正则表达式匹配.hpp" #include "common.h" bool _offer_19_testisMatch(string s, string p) { int l1 = (int)s.length(); int l2 = (int)p.length(); vector<vector<int>>dp(l1+1,vector<int>(l2+1,0)); dp[0][0]=...
ALGO
0.999625
5.082814
8d1f3308-f668-4a05-b820-b29e7855aaf5
dszarkow/MFCKinect
jointfliter.cpp
//-------------------------------------------------------------------------------------- // KinectJointFilter.cpp //-------------------------------------------------------------------------------------- #include "stdafx.h" #include "jointfliter.h" using namespace DirectX; //------------------------------------------...
ALGO
0.988841
6.233575
f7fe6df3-a2fc-405e-b8e3-fea5a204cb04
SaSandeep2112/C-_Codes
LinkList/Insertionatend.cpp
#include<iostream> using namespace std; class Node { public : int data; Node * next; Node(int value){ data = value; next = NULL; } }; int main(){ int arr[5]= {1,2,3,4,5}; Node *Head; Head = NULL; Node *Tail; Tail = NULL; // Insert at beginning // Linked list does not exist for(int i = 0 ; i < 5 ; i...
ALGO
0.999802
3.606586
3e1c639c-19ed-4c1a-942d-066925834ac9
sw-AhmedAdel/Data-structure-and-algorithms
4-matrices/1-5_Symmetric_Matrix/main.cpp
#include <iostream> #include <string> using namespace std; class array{ int *arr; int n; public: array(int s) { n=s; arr=new int[n*n+1 /2]; } void set(int i,int j,int x) { if(i>=j) arr[i*(i-1)/2+j-1]=x; else arr[j*(j-1)...
ALGO
0.991619
3.11783
c19700f1-395c-4b6a-b632-6ea5a332a28a
Wilhelman/Tabula-Rasa-Engine
Tabula Rasa Engine/3D_Engine/MathGeoLib/Geometry/LineSegment.cpp
/** @file LineSegment.cpp @author Jukka Jylnki @brief Implementation for the LineSegment geometry object. */ #include "LineSegment.h" #include "../Math/MathFunc.h" #include "AABB.h" #include "Ray.h" #include "Line.h" #include "Plane.h" #include "Polygon.h" #include "Polyhedron.h" #include "Frustum.h" #include "../Mat...
ALGO
0.977362
6.653174
9685f64f-ccbb-4ad5-ab7a-01f938a46ad7
qngnode/qnodecoin
src/merkleblock.cpp
#include "merkleblock.h" #include "hash.h" #include "consensus/consensus.h" #include "utilstrencodings.h" using namespace std; CMerkleBlock::CMerkleBlock(const CBlock& block, CBloomFilter& filter) { header = block.GetBlockHeader(); vector<bool> vMatch; vector<uint256> vHashes; vMatch.reserve(block....
ALGO
0.997978
6.000265
9cb9feba-6e50-4422-89b7-8e4f66f24f6e
ishandutta2007/codeforces
amit_swami/normal/1037/E.cpp
#include <bits/stdc++.h> #define forn(i, n) for(int i = 0 ; (i) < (n) ; ++i) #define err(...) fprintf(stderr, __VA_ARGS__),fflush(stderr) using namespace std; typedef long long ll; const int N = 2e5; set<int> s[N]; int a[N]; int d[N]; int r[N]; int q[N]; int st = 0, en = 0; int total; int X[N], Y[N]; int k; void a...
ALGO
0.999984
4.250866
26618c36-246a-4fff-9a1c-0131de7ae8fe
M3IJI3/leetcode_solution
0424-longest-repeating-character-replacement/0424-longest-repeating-character-replacement.cpp
class Solution { public: int characterReplacement(string s, int k) { vector<int> count(26, 0); int left = 0; int maxFreq = 0; int ans = 0; for(int right = 0 ; right < s.size() ; right++){ count[s[right] - 'A']++; maxFreq = max(maxFreq, count[s[right] ...
ALGO
0.999985
6.369276
a54e200e-1a5a-4c2e-946f-734f878edb07
itsaky/openjdk-21-android
src/hotspot/share/opto/phaseX.cpp
#include "precompiled.hpp" #include "gc/shared/barrierSet.hpp" #include "gc/shared/c2/barrierSetC2.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" #include "opto/block.hpp" #include "opto/callnode.hpp" #include "opto/castnode.hpp" #include "opto/cfgnode.hpp" #include "opto/idealGraphPrin...
ALGO
0.963538
7.002922
37a03cbc-3be0-4f7d-b9be-9d7debb274ca
Yusha47/Monarch_Sh
Competitive programming/Practice/C_Turtle_Fingers_Count_the_Values_of_k.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; const int DEBUGGER = 1; #define MAX 10000 #define mp make_pair #define pb push_back #define II ({ ll TEMP; cin>>TEMP; TEMP; }) #define SI ({ string TEMP; cin>>TEMP; TEMP; }) #define AI(a) ({ int n=sizeof(a)/sizeof(a[0]...
ALGO
0.999854
3.77771
e7a98924-2477-4371-85d2-387ae9b89645
NilFoundation/zkllvm-circifier
mlir/lib/Dialect/SCF/Transforms/LoopSpecialization.cpp
#include "mlir/Dialect/SCF/Transforms/Passes.h" #include "mlir/Dialect/Affine/Analysis/AffineStructures.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Arith/IR/Arith.h" #include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/Dialect/SCF/Utils/Aff...
TOOL
0.943253
7.386669
801c76da-3c88-44cb-adfc-40ae35121140
antonsouto/DSA_problem_solving
HanoiTowers/src/main.cpp
#include <iostream> #include <unistd.h> #include "Juego.h" using namespace std; int main() { int ndiscos = 0; cout << "Ingrese el número de discos con los que quiere jugar a las Torres de Hanoi: "; cin >> ndiscos; Juego mijuego(ndiscos); cout << "[DEBUG] Juego creado correctamente con " << ndis...
ALGO
0.985219
5.971429
72619575-acde-4098-ae35-70102ea5034b
pcarrier/tudos
kernel/fiasco/src/lib/libk/arm/atomic-arm-up.cpp
IMPLEMENTATION [arm]: inline bool cas_unsafe(Mword *ptr, Mword oldval, Mword newval) { Mword ret; asm volatile(" mrs r5, cpsr \n" " mov r6,r5 \n" " orr r6,r6,#0xc0 \n" " msr cpsr_c, r6 \n" "" " ldr r6...
ALGO
0.968269
6.085968
a7dbce7b-7539-4c95-85fb-721b0bb21881
charliettaylor/CSA200
Lab2/BST.cpp
#include "BST.h" using namespace std; //default constructor BST::BST() : root(nullptr), count(0) {} //recursiveInsert void BST::recursiveInsert(int elemToInsert) { recursiveInsert(root, elemToInsert); } //recursiveInsert (private) void BST::recursiveInsert(Node * &ptr, int elemToInsert) { if (ptr == nullptr) ...
ALGO
0.996662
4.685303
4db72524-c1c8-4f70-8c53-0f27c4b2b7d6
SZUEA/EA-code-inspiration
luogu/P1xxx/P1004.cpp
#include <bits/stdc++.h> #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0), cout.tie(0); #define rep(i, s, t) for (register int i = (s); i <= (t); i++) #define rep_r(i, s, t) for (register int i = (s); i >= (t); i--) #define max(a, b) (a > b ? a : b) #define endl '\n' typedef long long ll; ty...
ALGO
0.999907
4.060828
1e7402ce-c09f-4339-b5ab-3e1675905e24
Anup-Chaurasiya/Leetcode-top-problems
121-best-time-to-buy-and-sell-stock/best-time-to-buy-and-sell-stock.cpp
class Solution { public: int maxProfit(vector<int>& prices) { int index = 1 ; int profit = 0 ; int buy = prices[0]; while(index < prices.size()){ if(prices[index]<buy){ buy = prices[index]; }else{ profit = max(profit,prices[index...
ALGO
0.999863
6.08389
bd335bcb-8197-4d32-98f8-6c41b923b00c
Pandey-SaurabhP/CP
Codeforces/1890/b.cpp
#include <bits/stdc++.h> using namespace std; #define read(a, n) for(int i = 0; i < n; ++i) cin >> a[i]; #define print(a, n) for(int i = 0; i < n; ++i) if(i == n - 1){ cout << a[i] << " "; } else { cout << a[i] << ' '; } typedef long long int ll; typedef long double ld; const int mod = 1e9 + 7; const int mxn = 1e6 ...
ALGO
0.999984
4.984921
ba48be92-de3b-4b2d-b3a6-85b89b8f5405
mingliangwsu/CropSyst_MicroBasin
corn/application/documentor.cpp
#include "corn/application/documentor.h" #include "corn/OS/file_system_engine.h" #include "corn/OS/uniform_resource_locator.h" #include "corn/application/documentation_directory_OS_FS.h" #include <assert.h> #ifdef _WIN32 #include <shlobj.h> #endif namespace CORN { //_____________________________________________________...
TOOL
0.921523
5.578082
09c17a4e-4721-41a6-b25f-b2ed723197d8
karan123Sharma/C-_Practice
Ceaser_Cypher.cpp
#include <iostream> using namespace std; string CeaserCypher(string Str, int key) { string Enc; for (int i = 0; i < Str.size(); i++) { Enc += (((Str[i] - 'a') + 3 ) % 26) + 'a'; } return Enc; } void Decrypt(string Enc, int key) { string Dec; for (int i = 0; i < Enc.size(); i++) ...
ALGO
0.999967
3.946374
5ac98c4c-49cd-470d-b4fc-40ff867f6627
HeavySmile/SDA-2022
hw2/hw2-1.cpp
#include <iostream> #include <cmath> #include <vector> using namespace std; int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); long unsigned int betCount; cin >> betCount; if(betCount < 1 || betCount > pow(10,6)) return 1; unsigned short int bets[betCount]; for (si...
ALGO
0.997806
4.512207
1326eb55-e38f-4fe4-90fb-54244b791e9f
tamara-kostova/OOP
lab 6/6.3.cpp
#include <iostream> #include <cstring> using namespace std; class Lekar{ protected: int faksimil; char ime[11]; char prezime[11]; double osnovnaPlata; public: Lekar(int faksimil=0, char *ime="", char *prezime="", double osnovnaPlata=0.0){ this->faksimil=faksimil; strcpy(this->ime, i...
ALGO
0.93518
3.852817
43bced85-29fe-4735-92e3-7fe688a3ebfb
AnshumanPati/Leetcode-Submissions
0417-pacific-atlantic-water-flow/0417-pacific-atlantic-water-flow.cpp
class Solution { private: void bfs(vector<vector<int>>& matrix, vector<vector<bool>>& visited, queue<pair<int, int>>& q) { vector<vector<int>> dirs = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}; int m = matrix.size(); int n = matrix[0].size(); while (!q.empty()) { pair<int, int> ...
ALGO
0.999923
6.65429
b1f15b96-7a77-4269-a035-1697c9218e78
danoan/btools-experiments
Applications/diffEnergy-study/tools/src/Estimations.cpp
#include "tools/Estimations.h" namespace Estimations { namespace Global { double estimatePerimeter(const DigitalSet& ds,double gridStep) { KSpace kspace; kspace.init(ds.domain().lowerBound(),ds.domain().upperBound(),true); Curve curve; DIPaCUS::Mi...
ALGO
0.99403
7.220927
3c4e124c-d1f4-46e3-9a6d-60024c0bbdaa
robbieowens15/UVA_CS_HW_Labs_Mini-projects
data-structures/lab_1/svutil.cpp
// utility functions for vectors of strings #include "svutil.h" // prints the strings in the vector void svOutput ( const vector<string> &vect ) { for (int i=0; i < vect.size(); ++i) { cout << vect.at(i) << " "; } cout << endl; } // finds a string in a vector and returns its index int svFind ( co...
TOOL
0.960512
5.369624
cdb9465b-9d71-4778-b3f0-5ebf03f9c6ae
ishandutta2007/codeforces
radewoosh/normal/776/F.cpp
#ifndef LOCAL #define NDEBUG #endif #include <bits/stdc++.h> using namespace std; #define sim template < class c #define ris return * this #define dor > debug & operator << #define eni(x) sim > typename \ enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) { sim > struct rge { c b, e; }; sim > rge<c> rang...
ALGO
0.999941
3.744797
e41c8b24-03b2-49b9-a9b0-a8c681425a13
Dust12345/MotionPlanning
PRM/PRM/main.cpp
#include "stdafx.h" #include <iostream> #include "cell.h" //#include "PRM.h" //#include "OBPRM.h" using namespace std; namespace bg = boost::geometry; namespace bgi = boost::geometry::index; /******************************************************************************************************************************...
ALGO
0.998265
3.080086
07c274ac-ae2a-4305-a071-1b1facf10077
bigbillfighter/OJ_Solved
practice/csp/201909/1.cpp
#include <bits/stdc++.h> using namespace std; int N, M; const int MAXN = 1e3+5; int num[MAXN], prs[MAXN]; int main(){ cin>>N>>M; int max = 0; int idx = 1; for(int i=1; i<=N; i++){ cin>>num[i]; int total = 0; for(int j=1; j<=M; j++){ cin>>prs[j]; total -= prs[j]; } if(total>max){ max = total, idx...
ALGO
0.999969
3.713169
4958323b-4014-4465-9992-b26155169d04
ishandutta2007/codeforces
fsouza/normal/382/A.cpp
#include <iostream> #include <cstdio> #include <algorithm> #include <numeric> #include <climits> #include <sstream> #include <cstring> #include <cassert> #include <vector> #include <stack> #include <queue> #include <cmath> #include <map> #include <set> #define INF (INT_MAX/2) typedef long long lint; using namespace ...
ALGO
0.99964
3.511184
37dd9a32-7f3d-4c91-b69f-34f6d9f123c3
ryzhy1/Lab_1
3/1.cpp
#include <iostream> #include <fstream> #include <time.h> #include <algorithm> #include <vector> #include <iomanip> #include <sys/time.h> // ---------- macos ---------- // #include <mach/task.h> // #include <mach/mach_init.h> // void printMemoryUsage() { // struct task_basic_info t_info; // mach_msg_type_number_t ...
ALGO
0.99982
4.336791
292173fe-5edb-4eb6-8d4b-1c72fc960750
Nelzouki22/code-Rock-Paper-Scissors-Game-using-c-
Source.cpp
#include <iostream> #include <cstdlib> #include <ctime> using namespace std; string get_user_choice() { string user_choice; cout << "Enter your choice (rock, paper, scissors): "; cin >> user_choice; while (user_choice != "rock" && user_choice != "paper" && user_choice != "scissors") { cout << ...
TOOL
0.960638
6.394114
1043b658-84b7-4c14-ac13-2f64d0c0d9aa
anksank/SPOJ-Solutions
Classical/ADDREV.cpp
#include<iostream> using namespace std; int reverse(int n) { int temp=0; while(n!=0) { temp=(10*temp)+(n%10); n=n/10; } return temp; } int main() { int T,i; cin>>T; while(T--) { int num1,num2,rev1,rev2; cin>>num1>>num2; rev1=reverse(num1); ...
ALGO
0.999798
5.369306
a8151b3b-7092-4bec-8f39-0d55f60cdf4b
cxyfer/OJ
Luogu/P_2842_纸币问题_1.cpp
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; #define endl '\n' int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n, w; cin >> n >> w; vector<int> A(n); for (int i = 0; i < n; i++) cin >> A[i]; sort(A.begin(), A.end()); vector<in...
ALGO
0.999981
4.65753
19ef407f-4675-46f9-951e-75dd8c16e4c6
AneekG8/DSA
ALGORITHM/searching/kThSnallestInMatrix..cpp
//find the kTh smallest in a n x n matrix #include<bits/stdc++.h> using namespace std; typedef pair<int,pair<int,int>> ppi; int kThSmallest(int arr[4][4],int n,int k) { priority_queue<ppi,vector<ppi>,greater<ppi>> pq; for(int i=0;i<n;i++) pq.push({arr[i][0],{i,0}}); ppi curr_min; for(int ...
ALGO
0.999959
4.075055
9a8051c4-4543-4286-bcae-af60076ae8e6
shah-zx/plus-plus-C
.history/GFG/countelintwoarr_20220828132624.cpp
#include <bits/stdc++.h> #include <stack> #include <queue> #include <math.h> #include <limits.h> #include <algorithm> #include <unordered_set> #include <unordered_map> using namespace std; #define vi vector<int> #define vii vector<pair<int, int>> #define pii pair<int, int> #define rep(i, a, b) for (int i = a; i < b; i+...
ALGO
0.999936
3.405749
6ebdca15-47ea-43d8-8f85-9d8327ba3bb4
clerkma/ptex-ng
texlive/libs/graphite2/graphite2-src/src/Position.cpp
#include "inc/Position.h" #include <cmath> using namespace graphite2; bool Rect::hitTest(Rect &other) { if (bl.x > other.tr.x) return false; if (tr.x < other.bl.x) return false; if (bl.y > other.tr.y) return false; if (tr.y < other.bl.y) return false; return true; } Position Rect::overlap(Positio...
TOOL
0.995276
5.634431
e3823a11-9931-486d-a375-b12e2caa260c
berga007/PPP2_Exercises
08_Chapter/exercise_9.cpp
// exercise 9 from chapter 8 // Programming: Principles and Practice Using C++ #include "../std_lib_facilities.h" //------------------------------------------------------------------------------ double compute_index(const vector<double>& v1, const vector<double>& v2){ double sum{0}; if(v1.size() != v2.size()...
ALGO
0.991178
4.121928