uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
5cc22b91-7e76-425f-a302-c0a7423d9aec
tin10401/CodeForces
Red_Blue_Flowers.cpp
//████████╗██╗███╗░░██╗██╗░░░░░███████╗ //╚══██╔══╝██║████╗░██║██║░░░░░██╔════╝ //░░░██║░░░██║██╔██╗██║██║░░░░░█████╗░░ //░░░██║░░░██║██║╚████║██║░░░░░██╔══╝░░ //░░░██║░░░██║██║░╚███║███████╗███████╗ //░░░╚═╝░░░╚═╝╚═╝░░╚══╝╚══════╝╚══════╝ // __________________ // | ________________ | // || ____ || // ||...
ALGO
0.999543
3.791459
d4c8cf30-5c87-411d-947a-7704759c6acf
TianaRuiz/ComputerVision
opencv3.2/modules/calib3d/src/levmarq.cpp
#include "precomp.hpp" #include <stdio.h> namespace cv { class LMSolverImpl : public LMSolver { public: LMSolverImpl() : maxIters(100) { init(); } LMSolverImpl(const Ptr<LMSolver::Callback>& _cb, int _maxIters) : cb(_cb), maxIters(_maxIters) { init(); } void init() { epsx = epsf = FLT_EPSILON...
ALGO
0.999464
6.37447
7e26525d-348c-4c7b-844b-b2a638142095
johnaa123/miyoo_src
mame4all/src/sound/disc_flt.cpp
/************************************************************************/ /* */ /* MAME - Discrete sound system emulation library */ /* */ /* Written by Keith...
ALGO
0.994226
5.315721
d4f750a7-8f8b-4b2d-bd24-9434ab28261d
lbaby/codeGarden
exercise/lcpp/tpti.cpp
//׺ʽתΪ׺ʽ #include <ToolKits.h> int main(void) { PostfixToInfix (); }
ALGO
0.979949
3.233692
dc339e45-5a8d-44fc-8a29-170be06cfda0
joelbretz/leetcode
AccountsMerge.cpp
class Solution { protected: void printMap(map<string, vector<string>>& M) { for(auto elem : M) { cout << elem.first << ": " ; for(auto addr : elem.second) { cout << addr << " "; } cout << endl; } } void dfs(map<string,vector<string>>& adjList, map<string,bool>& visited...
ALGO
0.999863
5.786734
085b44bc-0bdc-4174-8aab-2af993ad3670
rushikeshwadghane/CPP
Linkedlist3.cpp
#include<iostream> using namespace std; struct node { int data; struct node *next; }; typedef struct node NODE; typedef struct node* PNODE; typedef struct node** PPNODE; class SinglyCLL { private: //characterstic PNODE Head; PNODE Tail; public: SinglyCLL(); void InsertFirst(in...
ALGO
0.999815
4.218421
c537643f-0231-4a08-9842-e47a651518df
yancouto/competitive-programming
ojs/timus/1207.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 10009; ll x[N], y[N]; ll cross(int a, int b, int c) { return (x[b] - x[a]) * (y[c] - y[a]) - (y[b] - y[a]) * (x[c] - x[a]); } int p[N]; int main() { int i, n; scanf("%d", &n); for(i = 0; i < n; i++) scanf("%lld %lld", &x[i], &y[i])...
ALGO
0.999941
4.371577
a7b38a69-a589-4600-a39c-702bb652d230
rsummers11/CADLab
LymphNodeRFCNNPipeline/nifty_reg-1.3.9/nifty_reg/reg-lib/_reg_aladin_sym.cpp
#ifdef _BUILD_NR_DEV #include "_reg_aladin_sym.h" #ifndef _REG_ALADIN_SYM_CPP #define _REG_ALADIN_SYM_CPP /* \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ */ template <class T> reg_aladin_sym<T>::reg_aladin_sym () :reg_aladin<T>::reg_aladin() { this->ExecutableName=(char*) "reg_aladin_sym...
TOOL
0.866108
6.16047
7e9d7e45-eb7d-4a05-a5db-99d3604f2007
HardenedBSD/hbsdfw-ports-mirror
audio/creox/files/patch-creox__effects_dsp__distortionprocessor.cpp
--- creox/effects_dsp/distortionprocessor.cpp.orig +++ creox/effects_dsp/distortionprocessor.cpp @@ -423,7 +424,8 @@ { const float omega = 2.0f*float(M_PI)*centerFrequency/m_samplerate_f; float sn,cs; - sincosf(omega, &sn, &cs); + sn = sinf(omega); + cs = cosf(omega); const float alpha = sn*sinhf(float(M_LN2/2.0...
ALGO
0.999633
6.418532
c207ee70-b480-4090-80a7-47bef3e8bc42
subrataBAEC/Programming-Fundamentals-Nano-Degree
algorithm_with_c++/11_module_lab_assignment_01/1.cpp
/* <complete> Q 1. Write code to solve the single source shortest path problem on a DAG using DFS.Take both the DAG and the source node as input and output the distance of each node. Input: example : 1 0 ----1 2------3 | | | | 5-----4 nodes edges 6 5 0 1 1 5 4 2 5 4 2 3 example 2: ...
ALGO
0.999988
5.173115
8d58de34-951f-41c2-a76f-84e43c36ef8a
MehmetKaan96/DataStructureAndAlgorithms
Recursion/static_and_global_recursion.cpp
#include <bits\stdc++.h> using namespace std; int x = 0; int fun(int n) { if(n>0) { return fun(n-1)+n; } return 0; } int fun2(int n) { if (n>0) { x++; return fun2(n-1)+x; } else return 0; } int main() { int r,k; //r = fun(5); k = fun2(5)...
ALGO
0.999854
3.429908
0ea1ff16-2c45-4636-8d44-bfd0dc333ce9
vmhl87/oly
contests/ioi11d2/parrots/both.cpp
#include "encoder.h" #include "encoderlib.h" #include <iostream> void encode(int n, int m[]){ if(n <= 32){ for(int i=0; i<n; ++i){ int hi = m[i] >> 6, mid = (m[i] >> 3) & 7, lo = m[i] & 7; for(int j=0; j<7; ++j){ int block = i << 3; if(j < lo) block |= 1; if(j < mid) block |= 2; if(j...
ALGO
0.998619
4.328352
d4d610e1-9392-40ca-9219-dbf845bede87
AlkaYadav/Companies
workspace0/GeeksQuestions/src/subsets.cpp
/* * subsets.cpp * * Created on: Oct 4, 2015 * Author: user #include<iostream> #include<stdio.h> #include<stdlib.h> #include<math.h> using namespace std; void printSubsets(int arr[],int n){ int max_sub=pow(2,n); for(int i=0 ;i<max_sub;i++){ int tmp=i; int index=0; while(tmp){ int x=tmp&1; if(...
ALGO
0.998106
4.622495
d574d84a-77da-4d35-afec-75ad674a0ee0
babaramdev-py/Data-Structures-And-Algorithms-
STL/subset.cpp
#include <bits/stdc++.h> using namespace std; void Solve(int i, vector<int> &A, vector<vector<int>> &Ans, vector<int> temp) { if(i == A.size()) { Ans.push_back(temp); return; } temp.push_back(A[i]); Solve(i+1, A, Ans, temp); temp.pop_back(); Solve(i+1, A, Ans, temp); } /* ...
ALGO
0.999978
5.262252
a3aee86f-2ef5-49e2-8a55-4abd2f1a00cd
asmmo/maximum-subsequence
O(Nlg(N))Algo.cpp
#include <iostream> #include<algorithm> template <typename T> std::pair<std::array<size_t, 2>, T> maxCrossingSubArray( const std::vector<T>& vec, const size_t & low, const size_t & high) { size_t mid {(low + high) / 2}; std::pair<std::array<size_t, 2>, T> toBeReturned{{mid, mid + 1}, T()}; size_t leftItr {...
ALGO
0.999911
5.540629
120458e3-0b98-4827-bacf-81fd61e731d2
U-Alice/CppPractice
wordCount.cpp
#include <iostream> #include <algorithm> #include <cctype> using namespace std; int main(){ string phrase; cout << "Enter your phrase : "; getline(cin,phrase); cout << "i. The Number of characters with spaces: " << phrase.length() << endl; phrase.erase(remove_if(phrase.begin(), phrase.end(), ::isspace),phrase.en...
ALGO
0.955998
4.448358
6a7b6a50-1c47-4749-b85a-33380754b2aa
SwitchGDX/switch-gdx
switch-gdx/res/switchgdx/bullet/bullet/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp
///btDbvtBroadphase implementation by Nathanael Presson #include "btDbvtBroadphase.h" #include "LinearMath/btThreads.h" // // Profiling // #if DBVT_BP_PROFILE||DBVT_BP_ENABLE_BENCHMARK #include <stdio.h> #endif #if DBVT_BP_PROFILE struct ProfileScope { __forceinline ProfileScope(btClock& clock,unsigned long& value...
ALGO
0.98972
7.362938
8c6cfb72-ff06-4676-92e3-ecc03b32a404
Sanskar31/CodeForces-Solutions
KthBeautifulString.cpp
/* Author: Sanskar Agarwal Nick: sanskaragarwal Birla Institute Of Technology, Mesra */ #include <bits/stdc++.h> using namespace std; #define ll long long int #define endl "\n" #define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define F(i,a,b) for(ll i = (ll)(a); i <= (ll)(b); i++) #define RF(i,a,b) for(ll i...
ALGO
0.999462
3.748271
ec773374-f3dd-4c1f-bd59-fe12ae0582b6
FreeZoneMods/xray16
SDK/sources/MagicSoftware/FreeMagic/Source/Intersection3D/MgcIntr3DLinSphr.cpp
#include "MgcDist3DVecLin.h" #include "MgcIntr3DLinSphr.h" using namespace Mgc; //---------------------------------------------------------------------------- bool Mgc::TestIntersection (const Segment3& rkSegment, const Sphere& rkSphere) { Real fSqrDist = SqrDistance(rkSphere.Center(),rkSegment); return fSqrDi...
ALGO
0.994925
3.524988
f8c5de1e-3c97-4751-a9ee-7ee1cfeae087
Rekwass/Bomberman
src/Game/Map/Player/AIPlayer.cpp
/* ** EPITECH PROJECT, 2022 ** src ** File description: ** AIPlayer */ #include "Game/Map/Player/AIPlayer.hpp" #include "Clock.hpp" #include "ECS/Components/Bounds3d.hpp" #include "ECS/Components/RenderableObject3d.hpp" #include "Game/Map/Items/Wall.hpp" #include "Network/Client.hpp" #include "Randomizer.hpp" game::...
ALGO
0.884202
6.118906
b682647b-626a-42b1-809c-d6fb8e425c7c
chaudharygitesh/geeksforgeeks
Medium/Find the string in grid/find-the-string-in-grid.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: int dx[8]={0,0,-1,1,-1,-1,1,1}; int dy[8]={-1,1,0,0,-1,1,1,-1}; bool solve(vector<vector<char>>&grid, string &word,int i,int j,int k,int d,int n,int m){ if(k>=word.size()) return true; ...
ALGO
0.999793
5.923071
db24c94b-2fff-4a75-a1f3-f4984c737bf9
bala-chandar12/DSA-C-
medium/[722] Slope to Angle Conversion [M].cpp
/* #### Slope to Angle Conversion #### Given a slope of a line, calculate and return the value of the angle of line (relative to the y -axis). For example, a horizontal line would be 90 degrees. [Examples] ___ convert(1) ➞ 45 convert(0) ➞ 90 convert(-1) ➞ 135 _____ [Notes] ___ *) All values returned should be ...
ALGO
0.988272
4.626601
004c84cc-55cb-42c3-8d3d-bd5664676e31
TheBurkeLab/cantera
src/thermo/RedlichKwongMFTP.cpp
//! @file RedlichKwongMFTP.cpp #include "cantera/thermo/RedlichKwongMFTP.h" #include "cantera/thermo/ThermoFactory.h" #include "cantera/thermo/Species.h" #include "cantera/base/stringUtils.h" #include "cantera/base/utilities.h" #include <boost/algorithm/string.hpp> #include <boost/math/tools/roots.hpp> namespace bmt...
ALGO
0.990009
5.586199
6d457f69-3377-4e97-b5c3-3a1a59e20d0b
Dark1-dev/CSE112-Coding-Problems-Sol
Lab Class 4 Sol/5.cpp
#include <iostream> using namespace std; int med(int a,int b,int c) { int med; if ((a > b && a < c) || (a > c && a < b)) med = a; if ((b > a && b < c) || (b > c && b < a)) med = b; if ((c > b && c < a) || (c > a && c < b)) med = c; return med; } int main() { int a,b,c; cin >> a >> b >> c;...
ALGO
0.999905
4.800416
2be7efa0-f690-4e29-aaba-fa9efcdb2f53
karim1safan/HackerRank
30 Days of Code/Day 12 - Inheritance.cpp
#include <iostream> #include <vector> using namespace std; class Person{ protected: string firstName, lastName; int idNumber; public: Person(string firstName, string lastName, int idNumber){ this->firstName = firstName; this->lastName = lastName; this->idNumber = idNumber; } ...
TOOL
0.997437
5.541319
ca6d5116-2d6b-4eb7-8b83-be1fdd878637
Nikolasplz/EDD
Clase 2/numero mayor - 2 numeros.cpp
#include<stdio.h> int numero1,numero2; int main(){ printf("Programa para comprobar el numero mayor entre 2 numeros.\n\n"); printf("ingrese 2 numeros (a b) :\n"); scanf("%d %d",&numero1,&numero2); if(numero1 > numero2){ printf("el numero mayor es : %d",numero1); } else if(numero1 < numero2){ printf...
ALGO
0.998162
3.195767
15693586-5596-4827-b321-bbd4b0ff094b
dangtrantrong/interview
String/Reverse words in a given string/main.cpp
#include <iostream> #include <string> #include <vector> #include <map> #include <set> #include <list> #include <stack> using namespace std; string reverseWords(string S) { string res = ""; stack<string> stackWords; string word = ""; for (int i = 0; i < S.length(); i++) { if (S[i] == '.')...
ALGO
0.998654
4.554196
eddf5be3-faba-442d-93ba-6ce49584a43e
INESC-TEC-MRDT/pileec2223_control_methods
src/pileec2223_control_methods/Follow_Path.cpp
#include "pileec2223_control_methods/Follow_Path.h" namespace pileec2223_control_methods { Follow_Path::Follow_Path() { readParam(); pub_cmd_vel_ = nh_.advertise<geometry_msgs::Twist>("cmd_vel", 1); sub_goal_ = nh_.subscribe("move_goal", 1, &Follow_Path::subGoal, this); sub_goal_count_ = nh_.subscribe("sub_g...
ALGO
0.976969
5.264133
50a38ad8-8b95-4261-bdb3-30fa106fd096
andrew-canada/competitive-programming
cses/math/1729-stickGame.cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back #define INF 2e18 const int mxK = 100, mxN = 1e6; int s[mxK + 1]; bool ans[mxN + 1]; int main() { int n, k; cin >> n >> k; for (int i = 0; i < k; i++) { cin >> s[i]; } for (int i = 1; i <= n; i++) { for (i...
ALGO
0.999877
3.322908
69eb3f6f-e7c3-400c-adca-45680ee80ca4
mlkorra/Prep
Operation S/GFG/DP/ncr.cpp
/* Finding nCr for given n and r Dynamic Programming */ #include <bits/stdc++.h> using namespace std; int main() { int t;cin>>t; while(t--) { const unsigned int M = 1000000007; int j,i,n,r; cin>>n>>r; int dp[n+1][r+1]; for(i=1;i<=n;i++){ for(j=0;j<=min(i,r);j++){ if(j==0 || j== i){ dp[i][...
ALGO
0.999985
5.657166
09ebb85c-deb9-4bfb-a012-f86b6a5bc007
Pentacode-IAFA/Quad-Remeshing
libs/quadwild/libs/eigen/bench/quat_slerp.cpp
#include <iostream> #include <Eigen/Geometry> #include <bench/BenchTimer.h> using namespace Eigen; using namespace std; template<typename Q> EIGEN_DONT_INLINE Q nlerp(const Q& a, const Q& b, typename Q::Scalar t) { return Q((a.coeffs() * (1.0-t) + b.coeffs() * t).normalized()); } template<typename Q> EIGEN_DONT_INL...
ALGO
0.993204
6.251058
b12eb0c6-f9ea-45fc-97b0-25c3a91ba588
bollu/optics
scenef.cpp
// scene that uses the SDF to decide how to bounce light. #include "optics.h" #define DISTANCE_APERTURE_TO_LENS 20 namespace SceneF { static SDFResult sdfAABB(Vector2 topLeft, Vector2 bottomRight, Vector2 point) { assert(topLeft.x <= bottomRight.x); assert(topLeft.y <= bottomRight.y); // tl + (br - tl) *...
TOOL
0.995319
5.085692
71f30bdd-e951-487d-ab03-cbd345570d68
mdbal-lunule/lunule
src/boost/libs/dynamic_bitset/example/example3.cpp
#include "boost/dynamic_bitset.hpp" #include <ostream> #include <iostream> int main() { boost::dynamic_bitset<> mask(12, 2730ul); std::cout << "mask = " << mask << std::endl; boost::dynamic_bitset<> x; std::cout << "x.size() = " << x.size() << std::endl; std::cout << "Enter a bitset in binar...
TOOL
0.890355
5.873268
313134a5-4e7b-4ee9-9e76-68d448379b9d
git-sidd/Algo_Imp
recursion/sum.cpp
#include<bits/stdc++.h> #include <iostream> using namespace std; void sum(int arr[],int &ans,int i,int n){ if(i==n){ return ; } ans+=arr[i]; sum(arr,ans,i+1,n); } int main(){ int n=6; int arr[n]={1,1,1,1,1,5}; int i=0, ans=0; sum(arr,ans,0,n); cout<<"ANS:"<<ans; ret...
ALGO
0.999917
3.275832
e415eeb2-9db7-43bb-ab37-4c01500e8f08
LymphV/Leetcode-of-LymphV
#07/706. 设计哈希映射/706. 设计哈希映射.cpp
#if defined(LocalLymphV) #include "../../leetcode.h" #include <LymphV> #else #define print(...) 0 #endif #if !defined(LocalLymphV) || !defined(DebugLymphV) #define debug(x) 0 #endif #define FOR(x,y) for (int x = 0; x < y; ++x) #define ffor(x,y,z) for (int x = y; x < z; ++x) class MyHashMap {///160ms 61.03% 51.2M 41....
ALGO
0.99929
5.388658
95d7c381-6418-45e3-aec3-d8dbb47f1114
cyx616/2025aaib
week03-4.cpp
///week03-4.cpp ///M90H044 ///{KCodeBlocksAg #include<stdio.h> int main() { int ans=0;///ץ[o ///jeansO0 int N;///Hjq1}lA<= scanf("%d",&N); for(int i=1;i<=N;i++){ ans+=i; } printf("%d",ans); }///j᭱ALXans
ALGO
0.999713
4.001221
0af998cc-627b-4f4c-8490-a642655f5d03
TheMagicFlute/STOJ-solutions-cpp
solution214.cpp
#include <iostream> using namespace std; bool primes[1000000]; // 0 is not prime, 1 is prime void sieve(int n) { for (int i = 2; i <= n; i++) { primes[i] = 1; } for (int i = 2; i <= n; i++) { if (primes[i]) { for (int j = i * i; j <= n; j += i) { ...
ALGO
0.999935
4.397681
17c54803-84ab-4064-8127-403e2675bcbc
Ishwarendra/Contests
ATCODER/AtcoderBeginnerContest/abc276/B.cpp
#include "bits/stdc++.h" #ifdef LOCAL #include "F:\CPP\Debug\debug.h" #else #define print(...) 1; #endif using i64 = long long; int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); int n, m; std::cin >> n >> m; std::vector<int> adj[n + 1]; for (int i = 0; i < m; i++) ...
ALGO
0.999969
4.509691
f5a73e12-2c1f-43fc-a6dc-94f117829b34
ishandutta2007/codeforces
he_ren/normal/691/B.cpp
#include<cstdio> #include<cstring> const int MAXN = 1e3 + 5; char t[]={"-d-b----------oqp----vwx--A------HI---M-O----TUVWXY-"}; char s[MAXN]; int main(void) { scanf("%s",s+1); int n=strlen(s+1); for(int i=1; i<=((n+1)>>1); ++i) { int c; if(s[i]<='Z') c=s[i]-'A'+26; else c=s[i]-'a'; if(s[n-i+1]!=t[c]...
ALGO
0.999942
3.928954
56633d94-53bc-4560-9af1-32bfe083e7e6
abdulrahman9901/LeetCode-solutions
Manually added/balanced-binary-tree/Accepted/6-19-2024, 3_15_24 AM/Solution.cpp
// https://leetcode.com/problems/balanced-binary-tree /** * 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) {} * TreeN...
ALGO
0.999781
6.580073
f07d45df-02ac-4263-829a-fb8b96092092
priyyannshhu/DSA
GITHUB/Week 5 - Strings/Lecture 3/code3.cpp
string orderCopy; class Solution { public: static bool cmp(char a, char b) { //logic -> //order wali string me dekho, k konsa character pehle //aana chahiye and konsa character baad me aana chahaiye //true -> a will be placed before b //false -> b will be placed before...
ALGO
0.999936
5.827981
877745a0-cafb-464c-a42d-1702c71cf062
prashant3110/CPP
First Repeating Element.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n; cout<<"Enter n :"; cin>>n; int arr[n]; cout<<"Enter elements :"; for(int i=0;i<n;i++) { cin>>arr[i]; } const int N=1e6+2; int idx[N]; for(int i=0;i<N;i++) { idx[i]=-1; } int mi...
ALGO
0.999952
4.458512
655c0f96-5a9b-461a-8af3-40b1b206e215
priyajit27/Leetcode
0503-next-greater-element-ii/0503-next-greater-element-ii.cpp
class Solution { public: vector<int> nextGreaterElements(vector<int>& nums) { int n=nums.size(); stack<int>st; for(int i=n-1;i>=0;i--) st.push(nums[i]); vector<int>ans; for(int i=n-1;i>=0;i--){ while(!st.empty() && nums[i]>=st.top()){ s...
ALGO
0.999822
5.654023
12feb977-8ad5-4b06-a5ab-f34fa80c57b7
weissms/owb-mirror
tags/Robespierre_2.0_post-merge/WebCore/platform/win/TextBoundariesWin.cpp
#include "config.h" #include "TextBoundaries.h" #include <unicode/ubrk.h> #include "StringImpl.h" #include "TextBreakIterator.h" namespace WebCore { int findNextWordFromIndex(const UChar* chars, int len, int position, bool forward) { UBreakIterator* it = wordBreakIterator(chars, len); int newPosition = pos...
TOOL
0.885077
6.660949
ee8b5fae-1241-4c41-a19a-55781dac6de8
sarvex/leetcode-lisp
lcp/LCP 28. 采购方案/Solution.cpp
class Solution { public: int purchasePlans(vector<int>& nums, int target) { const int MOD = 1000000007; sort(nums.begin(), nums.end()); int res = 0; for (int i = 0, j = nums.size() - 1; i < j; ++i) { while (i < j && nums[i] + nums[j] > target) --j; if (i < j) ...
ALGO
0.999948
5.988429
91f27ca1-cc28-437a-9baf-81edfdb9ffe4
Sushil2002/Problem-Solving
A_Burenka_Plays_with_Fractions.cpp
#include <bits/stdc++.h> #include <iostream> typedef long long ll; using namespace std; // ASCII of 'a'-97,'z'-123,'A'-65,'Z'-90,'0'-48,'9'-57 bool sortby(const pair<ll, ll> &a, const pair<ll, ll> &b) { return a.second < b.second; } signed main() { ll t; cin >> t; while (t--) { ll a, b, c, d...
ALGO
0.999772
4.267309
0009e6f3-0d87-4caf-86ec-c18133f63680
Shivuu2803/Data-Structure-and-Algorithm-Programs
Heap/Kth largest sum subarray.cpp
#include <iostream> #include <queue> #include <vector> using namespace std; class Subarray { public: int sum; int start; int end; Subarray(int s, int e, int sm) { this->start = s; this->end = e; this->sum = sm; } }; // Comparator function to compare two Subarray obje...
ALGO
0.999984
6.227849
98124fbf-350a-4c46-be46-c25170c674f0
romeorizzi/portafoglioVoti_public
Algoritmi/2019-07-30/all-CMS-submissions/2019-07-30.09:18:26.996048.VR439670.online_budget.cpp
/** * user: VR439670 * fname: LUCCHESE * lname: MARCO * task: online_budget * score: 0.0 * date: 2019-07-30 09:18:26.996048 */ /** * Template per soluzione in c++ per il problema tree_transcode_disc * * Romeo Rizzi, 2019-07-28 * */ #include <cassert> #include <iostream> #include <vector> #include <fstream> ...
ALGO
0.998863
3.657927
4c78d08f-6da9-4990-a4c8-a131dcf2b67b
ryanlacey20/Cpp-cli_chat_app_backend--echoes
third_party/boost_1_86_0/doc/html/boost_asio/example/cpp11/executors/actor.cpp
#include <boost/asio/any_io_executor.hpp> #include <boost/asio/defer.hpp> #include <boost/asio/post.hpp> #include <boost/asio/strand.hpp> #include <boost/asio/system_executor.hpp> #include <condition_variable> #include <deque> #include <memory> #include <mutex> #include <typeinfo> #include <vector> using boost::asio::...
TOOL
0.852803
7.792626
8b2ab825-e154-42d6-b445-cf7626a4e9bf
nehcoah/algorithm-template
leetcode/biweekly/121/d.cpp
class Solution { public: long long numberOfPowerfulInt(long long start, long long finish, int limit, string s) { for (char c : s) if (c - '0' > limit) return 0; int m = s.size(); auto check = [&](const string &t) -> long long { if (t.size() < s.size()) return 0; ...
ALGO
0.99981
5.902183
7d68925d-e0c8-434f-80b3-5f34717dc998
manuorsv/MARP
P10/Source.cpp
#include <iostream> using namespace std; #include "Grafo.h" #include <vector> #include <queue> bool resuelveCaso() { int V, A; cin >> V; if (!std::cin) return false; cin >> A; Grafo g(V); int v1, v2; for (int i = 0; i < A; ++i) { cin >> v1 >> v2; g.ponArista(v1, v2); } vector<pair<bool, int>> visitado...
ALGO
0.999805
4.721296
6578e933-af54-470e-9362-6b042a49866e
arq5x/filo
src/stats/stats.cpp
#include <iostream> #include <fstream> #include <iomanip> #include <vector> #include <map> #include <algorithm> #include <math.h> #include <exception> #include <stdexcept> // out_of_range exception #include <cstring> #include <climits> #include "version.h" #include "lineFileUtilities.h" #include "tabFile.h" using nam...
TOOL
0.889217
6.100132
3925048d-f113-49a5-9d7e-44e1d0b4178a
zhuangli1987/LeetCode
Valid Sudoku.cpp
class Solution { public: bool isValidSudoku(vector<vector<char> > &board) { // Start typing your C/C++ solution below // DO NOT write int main() function int n = board.size(); int m = board[0].size(); vector< set<char> > row, col, bol; row.resize(n); col.resiz...
ALGO
0.998994
6.345815
cb8bc6b2-f7a6-48b3-b899-d8373a9bb4cc
awishnick/sidescroller
lib/boost_1_48_0/libs/mpi/example/generate_collect_optional.cpp
// An example using Boost.MPI's split() operation on communicators to // create separate data-generating processes and data-collecting // processes using boost::optional for broadcasting. #include <boost/mpi.hpp> #include <iostream> #include <cstdlib> #include <boost/serialization/vector.hpp> #include <boost/serializat...
TOOL
0.973924
6.554121
8ec8be72-0ae6-48e9-aaec-0b77b1fa3215
7saikat7/DS_ALGO_CPP
2-add-two-numbers/2-add-two-numbers.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* addTwoNumbe...
ALGO
0.999929
6.001578
0eae8395-6519-4844-8af9-ccba65da4bfb
krishnaiq/Login-and-Signup-UI
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998693
6.797273
e143e3ba-62b0-4e6a-8c19-d4ae682abc5b
FrancescoCastagna1998/LSN_Esercitazioni_2020
Lab2/Es2.1/Integral_MC.cpp
/**************************************************************** ***************************************************************** _/ _/ _/_/_/ _/ Numerical Simulation Laboratory _/_/ _/ _/ _/ Physics Department _/ _/_/ _/ _/ Universita' degli Studi di Milano _/ _/ ...
ALGO
0.999735
4.607208
494e6777-1345-41f2-86ed-1266367be2b8
morozander/flutter-quiz-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
95e39f1e-8041-460a-9fec-c3a208325a75
rishi058/CP-DSA
DP/24_Print_SCS.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define F(a,b,i) for (int i = a; i < b; i++) #define all(v) v.begin(), v.end() typedef long double ld; typedef vector<int> vi; //------------------------------------------------------ /* SCSS len = str1.size + str2.size - LCS. SCSS = str1 + str2...
ALGO
0.999917
4.127802
60db473c-8cc8-464b-a303-ebc5cadb4465
Tanisha-saini/Algorithms
weighted_scheduling.cpp
#include <iostream> #include <algorithm> using namespace std; struct Job { int start, end, profit; }; bool comp(Job job1, Job job2) { return (job1.end < job2.end); } int nonConflictJob(Job jobList[], int i) { for (int j=i-1; j>=0; j--) { if (jobList[j].end <= jobList[i-1].start) return ...
ALGO
0.99995
5.406633
a85abfd8-b4e0-4eb6-a510-13c78691eaed
mikekazakov/pstld
benchmark/benchmark.cpp
static constexpr size_t g_Iterations = 10; static constexpr size_t g_IterationsDiscard = 1; static constexpr size_t g_Sizes[] = {1'000, 10'000, 100'000, 1'000'000, 10'000'000, 100'000'000}; template <class Tp> inline void noopt(Tp const &value) { asm volatile("" : : "r,m"(value) : "memory"); } template <class Tp>...
TEST
0.885582
7.118711
616026e5-d32e-4885-99f9-dd549bc2512b
WFRT/Comps
src/Correctors/ClimReg.cpp
#include "ClimReg.h" #include "../Obs.h" #include "../Parameters.h" #include "../Data.h" CorrectorClimReg::CorrectorClimReg(const Options& iOptions, const Data& iData) : Corrector(iOptions, iData) { iOptions.check(); } void CorrectorClimReg::correctCore(const Parameters& iParameters, Ensemble& iUnCorrected) cons...
ALGO
0.887499
6.195989
7b8a0703-0511-42ec-9af6-193efa7925dd
ZionArizona/Baekjoon-CPP
프로그래머스/unrated/181920. 카운트 업/카운트 업.cpp
#include <string> #include <vector> using namespace std; vector<int> solution(int start, int end) { vector<int> answer; for(int i = start; i <= end; i++){ answer.push_back(i); } return answer; }
ALGO
0.998283
4.104997
ec8a7cba-e206-447f-a1d8-c2c5ee5cffb6
wholmen/Master
Solvers/Solvers/ccdnaive.cpp
#include "ccdnaive.h" CCDNaive::CCDNaive(){} CCDNaive::CCDNaive(PairingBasis BASIS) { pabasis = BASIS; BasisNumber = 1; // Calculating important variables Nholes = pabasis.Nholes; Nholes2 = Nholes*Nholes; Nholes3 = Nholes2*Nholes; Nstates = pabasis.Nstates; Nparticles = Nstates - Nholes; Nparticl...
ALGO
0.999706
5.238658
c961c1d6-f92c-4627-a962-e36917b08507
Modding-Zaibatsu/Pre-Unreal-4.14
Engine/Source/ThirdParty/PhysX/PhysX_3.4/Source/LowLevelParticles/src/PtCollision.cpp
#include "PtCollision.h" #if PX_USE_PARTICLE_SYSTEM_API #include "PtConfig.h" #include "PtParticleSystemSimCpu.h" #include "PtParticleShapeCpu.h" #include "PtContext.h" #include "PtBodyTransformVault.h" #include "PtCollisionHelper.h" #include "PtParticleContactManagerStream.h" #include "GuConvexMeshData.h" #include "C...
ALGO
0.991385
6.037782
319861ca-258a-411e-b1eb-0912ecca02b0
Jormogundr/Leetcode
Easy/733. Flood Fill/floodFill.cpp
#include <vector> class Solution { public: std::vector<std::vector<int>> floodFill(std::vector<std::vector<int>>& image, int sr, int sc, int newColor) { rows_ = image.size(); cols_ = image[0].size(); newColor_ = newColor; replaced_ = image[sr][sc]; if (replaced_ == newColor)...
ALGO
0.884355
6.587594
ab4f444d-9b1a-4048-97f1-977e35400229
shadabeqbal/gfg
array/Sum_of_Array_Elements.cpp
/* // // // // \\// \>> //\\ // \\ Author: Shadab Eqbal Created on: "03-02-2021" Name: Sum of Array Elements Link: https://practice.geeksforgeeks.org/problems/sum-of-array-elements2502/1 */ #include <bits/stdc++.h> using namespace std; #define MAX 1e18 #define MIN -1e...
ALGO
0.999773
5.351487
3a68b12a-28a5-42d9-81ee-a276628bdfef
kgarun/Competitive-programming
Facebook Hacker Cup 2018/interception_source.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 5, MOD = 1e9 + 7; ifstream fin("input.txt"); ofstream fout("output.txt"); ll t, ctr = 0; long oper(long x, long y, string op) { if (op == "+") return x + y; if (op == "*") return x * y; if (op == "^") return pow(x, y); } int ...
ALGO
0.999771
4.092017
8afdd9d9-a4ad-4b2c-9fe1-3e14c10e66c6
vedantRaikar/dsapractice
pointer1.cpp
#include<iostream> using namespace std; int main(){ int sum , a , b , *ap , *bp; cin >> a >> b; ap = &a ; bp = &b ; sum = *ap + *bp ; cout << "The sum of the two numbers is : " << sum ; return 0; }
ALGO
0.995725
3.451193
0463b8c3-03cf-4007-a765-922ec39f9e59
anonymouswin/Blockchain
1.Coin/BTO/lock_free.cpp
/******************************************************************** | ***** Coin Contract BTO Miner + Decentralized validator ***** | | ***** File: lock_free.cpp ***** | | ***** Created: on Aug 25, 2018, 12:15 PM ***** | ****************************************...
TOOL
0.993269
4.188912
58be12ac-81e6-46d0-8d15-de6cb8d7c884
wscstrive/Cpp
algorithm-palace/leetcode/242.字母异位词.cpp
// 给定两个字符串 s 和 t ,编写一个函数来判断 t 是否是 s 的字母异位词。 // 注意:若 s 和 t 中每个字符出现的次数都相同,则称 s 和 t 互为字母异位词。 class Solution { public: bool isAnagram(string s, string t) { int hash[26] = {0}; for (int i = 0; i < s.size(); i++){ hash[s[i] - 'a']++; } for (int i = 0; i < t.size(); i++){ ...
ALGO
0.999874
6.049721
2250ef46-8938-4208-bb6a-4d863e983d0e
miteshkumar77/LC
minimum-absolute-difference/Accepted/1-13-2021, 8:49:16 PM/Solution.cpp
// https://leetcode.com/problems/minimum-absolute-difference class Solution { public: vector<vector<int>> minimumAbsDifference(vector<int>& arr) { sort(arr.begin(), arr.end()); int diff = INT_MAX; for (int i = 1; i < arr.size(); ++i) { if (arr[i] - arr[i - 1] < diff) { ...
ALGO
0.999975
6.412712
1b1a888e-53db-4861-9e6d-5fd87c4a0501
Heliospook/SuffixTreeConstruction
main.cpp
#include <bits/stdc++.h> #include "SuffixTree.h" using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(NULL); #ifndef ONLINE_JUDGE freopen("input.in","r",stdin); freopen("output.out","w",stdout); freopen("error.out","w",stderr); #endif string text; cin>>text; Suffi...
ALGO
0.999072
5.32386
6d08ca7b-337b-4fc4-99bc-c79936e710c2
ishandutta2007/codeforces
alpha_q/normal/1388/A.cpp
#include <bits/stdc++.h> using namespace std; int t, n; int main() { cin >> t; while (t--) { cin >> n; if (n >= 45) { puts("YES"); printf("6 10 14 %d\n", n - 30); continue; } if (n <= 30) { puts("NO"); continue; } if (n <= 35) { puts("YES"); print...
ALGO
0.999566
3.58301
b14c056d-2876-489d-b16b-fbadb01cc884
rrcorpin/NestedLoop
NestedLoop/NestedLoop.cpp
#include<iostream> #include<iomanip> using namespace std; int main() { int x, y; for (x = 1; x <= 5; x++) { for (y = 1; y <= x; y++) cout << x; cout << endl; } for (x = 4; x >= 1; x--) { for (y = 1; y <= x; y++) cout << x; cout << endl; } cout << endl; char m, n; for (m = 'A'; m <= 'E'; m++)...
ALGO
0.996741
3.043799
f1532a80-63cf-46f9-a585-41314c257ae5
fridafu/compfys
Prosjekt2/C++ Scripts/jacobi.cpp
#include <iostream> #include<fstream> #include<math.h> #include<iomanip> #include<time.h> #include<algorithm> #include<vector> #include "jacobi.h" #include <string> #include <armadillo> using namespace std; using namespace arma; //Creating a tri-diagonal matrix with diagonal elements d+V, neighbouring elements to the...
ALGO
0.999588
4.747336
58d1800a-036a-41a5-a50e-5d8d2224343e
Jyotii1302/Code_Practice
PowerOf4.cpp
class Solution { public: bool isPowerOfFour(int n) { if (n <= 0) return false; while (n > 1) { if (n % 4 != 0) return false; n /= 4; } return true; } }; ***POWER OF 2 **** class Solution { public: bool isPowerOfTwo(int n) { if(n==1)return 1...
ALGO
0.999197
6.036983
efab243f-8494-44e3-8543-ffb48acde8b5
S4ND1X/Competitive-Interviews-Programming
LeetCode 30 Days/238.cpp
//!https://leetcode.com/explore/challenge/card/30-day-leetcoding-challenge/530/week-3/3300/ #include <bits/stdc++.h> using namespace std; #define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0) #define ll long long #define ld long double #define fi first #define se second #define mp make_pair #define pb push...
ALGO
0.999978
4.09656
42514935-e12f-4c6a-b842-1283c277996e
sounak999/LeetCode-GFG-Submissions
40-combination-sum-ii/40-combination-sum-ii.cpp
class Solution { void solve(vector<int>& candidates, vector<vector<int>>& ans, vector<int>& output, int target, int index) { if(target == 0) { ans.push_back(output); return ; } if(target < 0 || index == candidates.size()) return; ...
ALGO
0.999993
6.302128
f3d9f6d1-1020-4d49-971b-60b85022373e
vsian/PetTracer
src/Ray_compute.cpp
#include "Ray_compute.h" Eigen :: Vector3f random_in_unit_shpere() { Eigen :: Vector3f p; do { p = Eigen :: Vector3f(drand48(), drand48(), drand48()) - Eigen :: Vector3f(1, 1, 1); }while((p[0] * p[0] + p[1] * p[1] + p[2] * p[2]) >= 1.0); return p; } Eigen :: Vector3f reflect(const Eigen :: Vect...
ALGO
0.999722
4.20564
7e6102a2-b99e-43f5-8666-185889704179
imayush18/practice-problems
Boundary Traversal of binary tree - GFG/boundary-traversal-of-binary-tree.cpp
// { Driver Code Starts #include <bits/stdc++.h> using namespace std; #define MAX_HEIGHT 100000 // Tree Node struct Node { int data; Node* left; Node* right; }; // Utility function to create a new Tree Node Node* newNode(int val) { Node* temp = new Node; temp->data = val; temp->left = NULL; ...
ALGO
0.999894
6.321361
2a18534d-188a-46b0-8c68-517a29ad03f8
xinchengxx/algorithm_contest
BFS/1654. 到家的最少跳跃次数.cpp
#include <iostream> #include <queue> #include <vector> using namespace std; class Solution { public: int minimumJumps(vector<int>& forbbiden, int a, int b, int x) { int n = forbbiden.size(); int ban[6000 + 1]; memset(ban, 0, sizeof(ban)); for (int num : forbbiden) { ba...
ALGO
0.998806
4.352051
c1d90e2c-87e0-4944-a6e2-94ee21bfe7f3
ishandutta2007/codeforces
raveman/normal/1270/F.cpp
#pragma comment(linker, "/STACK:60777216") #include <cassert> #include<iostream> #include<algorithm> #include<cstdio> #include<complex> #include<vector> #include<cstring> #include<set> #include<map> #include<cmath> #include<queue> #include<string> #include<cstdlib> #include<memory.h> #include<ctime> #include<bitset>...
ALGO
0.999913
3.283705
1f05a719-e5ff-4012-8215-a0e436cfde49
AldanaAranda/TUP-C-
TUP/TP3/ejercicio2/mayor.cpp
#include <iostream> using namespace std; /*Hacer un programa en C++, que lea tres números y diga cuál es el mayor.*/ int main(){ int num1, num2, num3, mayor = 0; cout << "Ingrese el primer numero" << endl; cin >> num1; if(mayor < num1){ mayor = num1; } cout << "Ingrese el segundo numer...
ALGO
0.967621
3.71172
74342124-cd27-41aa-b3f9-d3856931a51d
iamtasir/Competitive-programming
2020/April/A. Jzzhu and Children final.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long double dl; typedef unsigned long long ull; #define pb push_back #define PB pop_back #define nn "\n" #define O_O ios_base::sync_with_stdio(false); cin.tie(NUL...
ALGO
0.999985
3.181822
7ac1561f-6ea6-4e4d-b0b1-2cede02f0acc
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_9969_10.cpp
#include <bits/stdc++.h> #pragma GCC optimize("O3", "unroll-loops") using namespace std; const long long inf = numeric_limits<long long>::max() / 2; const long double eps = 1e-9; const long double pi = acos(-1); long long n; set<long long> ss; long long solve() { if (n < 11) { for (long long i = 0; i <= n; i++) {...
ALGO
0.999931
4.955415
7ef49c65-4888-47e3-9cae-b5b6398bc70a
vsupacha/le484-project
TrafficLightController/Drivers/CMSIS/NN/Examples/ARM/arm_nn_examples/gru/arm_nnexamples_gru.cpp
/** * @ingroup groupExamples */ /** * @defgroup GRUExample Gated Recurrent Unit Example * * \par Description: * \par * Demonstrates a gated recurrent unit (GRU) example with the use of fully-connected, * Tanh/Sigmoid activation functions. * * \par Model definition: * \par * GRU is a type of recurrent neura...
ALGO
0.937563
7.471897
d67321f8-6009-4a50-a978-3373fe24cffd
friedkeenan/AdventOfCode
2024/Day_05/main.cpp
#include <advent/advent.hpp> struct PageOrdering { template<advent::string_viewable_iterator It> static constexpr std::vector<PageOrdering> ParseOrderingsAndAdvanceIterator(It &it) { std::vector<PageOrdering> result; while (true) { const std::string_view line = *it; /*...
ALGO
0.99907
6.561129
3f0e30b2-5a07-4d88-8174-99f0b2e827e3
tanishqr-ck/CrackYourInternship_45
LinkedList/addtwonum2(reversing).cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* addTwoNumbe...
ALGO
0.999973
6.161679
bdf53a42-ea7f-4413-b75e-7548aa6594ff
Shashank280804/CPP-Practice
Basics/Cpp/exclusion2.cpp
#include<iostream> using namespace std; class Union { public: void read(string S,int a[],int n); }; void Union :: read(string S,int a[],int n) { int i; //cout<<"Enter fruits quantity to store in basket :\n"; cout<<"Enter the friuts type you want to buy :\n"; for(i=0;i<n;i++) { cin>>a[i]; } } int intersect...
ALGO
0.989471
3.770746
4647789a-9c08-4134-8c47-0ef702dcd5a3
CYRUS-STUDIO/LLVM
libcxx/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
// bitset(string, pos, n, zero, one); // constexpr since C++23 #include <algorithm> // for 'min' and 'max' #include <bitset> #include <cassert> #include <stdexcept> // for 'invalid_argument' #include <string> #include <type_traits> #include "test_macros.h" template <std::size_t N> TEST_CONSTEXPR_CXX23 void test_stri...
TEST
0.954458
7.826469
0e68a97f-9ba2-45db-8c7a-c48b7f8648b0
EducationLawMiningTeam/EducationLawMiningTool
Symbolic Regression/operon/operon-main/source/operators/generator/poly.cpp
#include "operon/operators/generator.hpp" #include "operon/operators/non_dominated_sorter.hpp" namespace Operon { auto PolygenicOffspringGenerator::operator()(Operon::RandomGenerator& random, double pCrossover, double pMutation, double pLocal, Operon::Span<Operon::Scalar> buf) const -> std::optional<Individual> ...
ALGO
0.99918
6.294343
701fa6e7-f348-4e0a-8bad-dc496a29329a
baconpaul/airwin2rack
src/autogen_airwin/BlockPartyProc.cpp
#ifndef __BlockParty_H #include "BlockParty.h" #endif namespace airwinconsolidated::BlockParty { void BlockParty::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) { float* in1 = inputs[0]; float* in2 = inputs[1]; float* out1 = outputs[0]; float* out2 = outputs[1]; double ...
ALGO
0.997184
3.448666
2d308a9d-82d9-4ae7-bad5-c78c5dd4eff6
TRANMINHBIBO/DSA
LyThuyetSoVaToHop/Bai60_DemUoc(Easy).cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n ; cin >> n; map<ll,ll>mp; for(int i = 0 ; i < n; i++) { ll x ; cin >> x; for(int j = 2 ; j <= sqrt(x) ;j++) { while(x % j == 0) { mp[j]++; ...
ALGO
0.999978
5.259692
a29710df-9c3f-440f-9fff-70dd75cc2eda
lonelywm/MouseKeyboardUdpRemoteControl
MKMessage/utils.cpp
#include <utils.h> int log2(int a) { int count = 0; while(a > 1) { a /= 2; count++; } return count; } bool checkBit(uint16_t a, uint16_t bitIndex) { a >> bitIndex; if (a & 1 == 0) { return 0; } return 1; }
TOOL
0.931587
5.714036
a18680a1-775b-4c1d-ac75-686c942db058
rajanraj2/100_Days_of_Code
Day35_Largest_Perimeter.cpp
// Link to problem : // https://leetcode.com/problems/largest-perimeter-triangle/description/ #include <iostream> #include <vector> #include <algorithm> using namespace std; class Solution { public: int largestPerimeter(vector<int>& nums) { sort(nums.begin(), nums.end(), greater<int>()); for (int...
ALGO
0.999728
5.188369
08f2cc06-5c66-4a8a-a390-49fd4c024b64
ishandutta2007/codeforces
.tx/normal/320/B.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <vector> #include <algorithm> #include <map> #include <set> #include <queue> #include <memory.h> #define scid(a) int a; scanf("%d", &a) #define sciid(a, b) int a, b; scanf("%d%d", &a, &b) #define sciiid(a, b, c) int a, b, c; scanf("%d%d...
ALGO
0.999989
4.137995
12a8c3a3-f43f-4489-9dc2-b591a5c4c6f1
javagovindsharma/leetscode
lcof/面试题68 - I. 二叉搜索树的最近公共祖先/Solution.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) { if (root->va...
ALGO
0.999993
6.370493
c98afda0-3496-4a0a-943b-79533b320474
ashrafulislampro/Basic_Algorithms
Assignment_1/Can_Go.cpp
#include <bits/stdc++.h> using namespace std; char grid[1005][1005]; bool vis[1005][1005]; int N, M; bool isTrue = false; vector<pair<int, int>> par = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}; bool isValid(int ci, int cj) { if (ci < 0 || ci >= N || cj < 0 || cj >= M) { return false; } return true; } v...
ALGO
0.999534
4.923712
4217a4e0-ade6-4abc-9eea-e0974142a3ac
jizhuoran/pyZKP
aten/src/ATen/native/SobolEngineOps.cpp
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <ATen/Dispatch.h> #include <ATen/native/SobolEngineOpsUtils.h> #include <c10/util/irange.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #else #include <ATen/ops/_sobol_engine_draw_native...
ALGO
0.996307
7.440845