uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
774ee3d0-bbd9-4288-8d70-a49a65023cc7
DHimeka/CS2023_200222K
lab11_200222K/lab11.cpp
#include <iostream> #include <climits> #define V 6 //no of vertices int minimumKey(int key[], bool mstSet[]) { int minVal = INT_MAX, minIndex; for (int v = 0; v < V; v++) { if (!mstSet[v] && key[v] < minVal) { minVal = key[v]; minIndex = v; } } return minIndex...
ALGO
0.999952
5.099237
1a339579-f3f1-4a93-8333-da133a7899ec
CDPS/Competitive-Programming
Codeforces/Ladders/1300 bonus/012-Sereja and Mugs.cpp
#include <bits/stdc++.h> using namespace std; int a[100]; int n,s; bool solve(){ for(int i=0;i<n-1;i++){ s-=a[i]; if(s<0) return false; } return true; } int main(){ cin >> n >> s; for(int i=0;i<n;i++) cin >> a[i]; sort(a,a + n); cout << ( solve()? ...
ALGO
0.999952
3.475094
fb5b6f8c-6bdc-4f05-a905-d90ed1efef84
David-Ventura24/David-Ventura-Practica
Ejercicio9.cpp
#include <iostream> using namespace std; double calcularCUM(double notas[], int unidades[], int cantidad); int main() { int cantidad; cout << "Ingrese el numero de materias cursadas: "; cin >> cantidad; int notas[cantidad], unidades[cantidad]; for(int i = 0; i < cantidad; i++) { ...
ALGO
0.988265
4.347615
53908813-f327-462a-ac60-1506ce8186b0
raincross7/code-similarity
codes/train_code/problem178/problem178_380.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(0); cin.tie(0); int a, b, c; cin >> a >> b >> c; if (c >= a && c <= b) cout << "Yes" << "\n"; else cout << "No" << "\n"; }
ALGO
0.999965
3.785448
ffba71f2-a6b4-4403-ab1d-707d8b24be8c
jigarvyasidea/DSA
Leetcode July Challenge/C++/Isomorphic Strings.cpp
class Solution { public: bool isIsomorphic(string s, string t) { int len = s.size(); char seen[128] = {}; for (int i = 0; i < len; i++) { char c = s[i]; if (!seen[c]) { for (char s: seen) if (s == t[i]) return false; seen[c] = t[i]; ...
ALGO
0.999967
6.168315
bd0d19fb-a7d9-4c89-94f1-5b1999d74994
reneldegazon/reng
modules/bioinspired/samples/cpp/OpenEXRimages_HDR_Retina_toneMapping_video.cpp
#include <iostream> #include <stdio.h> #include <cstring> #include "opencv2/bioinspired.hpp" // retina based algorithms #include "opencv2/imgproc.hpp" // cvCvtcolor function #include "opencv2/highgui.hpp" // display #ifndef _CRT_SECURE_NO_WARNINGS # define _CRT_SECURE_NO_WARNINGS #endif static void help(std::string ...
TOOL
0.852344
5.074901
90425777-449d-432f-9afd-a6bc1d6a529f
AdamBlane/Cps
coursework 1/code/coursework/coursework.cpp
#include <algorithm> #include <cassert> #include <chrono> #include <cmath> #include <functional> #include <iostream> #include <random> #include <vector> #include <fstream> #include <iostream> #include <string> #include <omp.h> #include <thread> #include <time.h> #include <iostream> #include <cstdio> #include <ctime> ...
ALGO
0.998532
5.103603
8f990553-6be0-4cb4-aaf7-017c56d8489e
shreyanshsinghparmar/competitive-programming
2020/Kick_Start_2020/00_Bike_Tour.cpp
#include <bits/stdc++.h> #define int long long #define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0) const unsigned int mod = 1e9 + 7; using namespace std; void solve() { int n; cin >> n; int a[n]; int ans = 0; for(int i = 0; i < n; ++i) cin >> a[i]; for(int i = 1; i < n - 1; ++i) { if(a[i] > a[i ...
ALGO
0.999398
4.649633
7ed08db2-aace-49c7-b386-b4d06448be6f
sarahemm/llvm-eclair
lib/CodeGen/ScheduleDAG.cpp
#include "llvm/CodeGen/ScheduleDAG.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/iterator_range.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/ScheduleHazardRecognizer.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetInstrInfo.h" ...
ALGO
0.998358
7.530356
5c758be9-bb6c-468f-a84f-484d218aa958
GMD369/PD6
games.cpp
#include <iostream> #include <cmath> using namespace std; int calculateVolleyballGames(string yearType,int holidays,int hometownWeekends); main() { string type; int holi,week; cout<<"Enter year type: "; cin>>type; cout<<"Enter number of holidays: "; cin>>holi; cout<<"Enter number of weekends...
ALGO
0.99665
4.595305
7920f9d2-4ea8-4882-b74f-a788e1fe0230
gorlak/panda3d-thirdparty
eigen/include/test/eigen2/eigen2_visitor.cpp
#include "main.h" template<typename MatrixType> void matrixVisitor(const MatrixType& p) { typedef typename MatrixType::Scalar Scalar; int rows = p.rows(); int cols = p.cols(); // construct a random matrix where all coefficients are different MatrixType m; m = MatrixType::Random(rows, cols); for(int i =...
TEST
0.924422
5.877094
bc85b5b4-51ae-427c-84a9-4a6e3d3d7521
xuzhikuan/xzk_nav
hybrid_astar_planner/src/node3d.cpp
#include "node3d.h" #include <iostream> #include <math.h> // 设计启发函数 namespace hybrid_astar_planner { void Node3D::setT(float _t) { if (_t>3.1415) { _t = _t - 6.283; } t = _t / Constants::deltaHeadingRad; } float Node3D::calcG() { float g; if(reverse) { // 如果进行的是倒车,对倒车、转向、改变方向进行惩罚 if (reverse != ...
ALGO
0.999717
4.533302
9cf35c65-fc5a-4523-bbcc-85f7b55f7e78
xuqianmamba/Tribase
third_party/faiss/faiss/IndexAdditiveQuantizerFastScan.cpp
#include <faiss/IndexAdditiveQuantizerFastScan.h> #include <cassert> #include <climits> #include <memory> #include <omp.h> #include <faiss/impl/FaissAssert.h> #include <faiss/impl/LocalSearchQuantizer.h> #include <faiss/impl/LookupTableScaler.h> #include <faiss/impl/ResidualQuantizer.h> #include <faiss/impl/pq4_fast...
ALGO
0.973526
6.2839
66c8e141-3a61-4e4d-a8b2-40d6d7de5657
andrew-canada/competitive-programming
cses/introductory/1083-2.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; cin >> n; ll sum = 0; for (int i = 0; i < n - 1; i++) { int a; cin >> a; sum += a; } cout << n * (n + 1) / 2 - sum; }
ALGO
0.999315
3.460041
173c4b60-6050-4356-bf58-4eb4cafa7dc6
ooici-dm/CGAL-Mesh
examples/Triangulation_3/info_insert_with_zip_iterator.cpp
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Delaunay_triangulation_3.h> #include <CGAL/Triangulation_vertex_base_with_info_3.h> #include <boost/iterator/zip_iterator.hpp> #include <vector> typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Triangulat...
ALGO
0.990248
7.208889
995b0199-ab97-45e7-8096-488afbbee2a3
Daisyprakash/Leetcode-solutions
1519-number-of-nodes-in-the-sub-tree-with-the-same-label/1519-number-of-nodes-in-the-sub-tree-with-the-same-label.cpp
class Solution { public: vector<int> findans(vector<vector<int>>&v,string &l,int node ,vector<int>&ans,int par) { vector<int>val(26,0); for(auto i:v[node]) { if(i!=par) { auto temp= findans(v,l,i,ans,node); for(int i=0;i<26;i++)...
ALGO
0.999983
6.252097
d2745ec5-bc6d-4afb-b060-5b10ba3e800c
NaderEG/competitive-programming
leetcode/cpp/twoOutOfThree.cpp
class Solution { public: vector<int> twoOutOfThree(vector<int>& nums1, vector<int>& nums2, vector<int>& nums3) { set<int> set1; set<int> set2; set<int> set3; for(int n : nums1) { set1.insert(n); } for(int m : nums2) { set2.insert(m); }...
ALGO
0.999922
5.87291
6fd43ca9-a7cc-4560-a129-3e71487ad959
anukraticodes/DailyCodeChallenges
0040-combination-sum-ii/0040-combination-sum-ii.cpp
class Solution { public: vector<vector<int>> combinationSum2(vector<int>& candidates, int target) { sort(candidates.begin(), candidates.end()); vector<vector<int>> v; vector<int> ds; func(0, target, candidates, v, ds); return v; } void func(int index, int target, vec...
ALGO
0.999988
6.513349
5bd8636a-6abb-472a-b9a5-7a15a5b05987
thegreywalker/Cpp-On-Way
A4/ArraySort.cpp
#include <iostream> using namespace std; int main() { // Array Decleration int array[10]; int size; // User Prompt cout << "Enter the Size of Array ( Max 10 )? "; cin >> size; cout << endl; // Data Insertion for(int i = 0; i < size; i++) { cin >> array[i]; } in...
ALGO
0.998053
4.283855
a2ee7486-ad75-4b57-9a05-fffc803b25bb
fardad/2251_OOP345
NBB/08-Feb06/h-binaryfileout.cpp
#include <iostream> #include <vector> #include <fstream> using namespace std; int main( ) { cout << "08 - Feb 06, OOP345NBB" << endl; ofstream file( "nums.bin", ios::binary ); vector<double> d{ 10.123456, 11.2343545, 12.334453 , 13.43434 }; for ( auto& v : d ) { file.write( reinterpret_cast<const char...
TOOL
0.870089
4.567965
e795d1a4-3b3b-4b96-bd72-3103f7a7352f
manikanta2901/ubuntu
.history/SRM/elab/AlgorithmAnalysisAndDesign/Random/InsertionSort_20210121143857.cpp
#include<bits/stdc++.h> using namespace std; vector<int> insertionSort(vector<int> numbers){ for (int i = 1; i < numbers.size(); i++) { intkey = arr[i]; j = i - 1; while (j >= 0 && arr[j] > key) { arr[j + 1] = arr[j]; j = j - 1; } ...
ALGO
0.999968
4.547343
ad3d831f-06ca-45db-8d88-330fc59157cb
Najma-Lopa/Codeforces
B_Chips_on_the_Board.cpp
//* بِسْمِ ٱللَّٰهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ #include <bits/stdc++.h> using namespace std; #define optimize() \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define endl '\n' #define ll long long #define fl float int main() { optimize(); ll t; cin...
ALGO
0.999969
3.445228
b2eab4f8-34bf-4d19-95b9-398ededcf718
openthos/oto_packages_apps_OtoCompress
jni/p7zip/p7zip_9.38.1/CPP/7zip/Compress/BZip2Decoder.cpp
// BZip2Decoder.cpp #include "StdAfx.h" #include "../../../C/Alloc.h" #include "BZip2Decoder.h" #include "Mtf8.h" namespace NCompress { namespace NBZip2 { #undef NO_INLINE #define NO_INLINE static const UInt32 kNumThreadsMax = 4; static const UInt32 kBufferSize = (1 << 17); static const UInt16 kRandNums[512] ...
ALGO
0.977617
6.029201
b577040b-d014-4421-8675-54d9b5374315
saurabhjais12/DSA-in-C--
Lecture064 Tree Interview Questions Day2/boundaryTraversal.cpp
#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; temp->right = NULL; ...
ALGO
0.999784
6.339921
d7e3a082-8ea0-47df-9309-8a2b364b8999
aron566/Soft_I2C
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.914648
7.471897
dc703b57-0c05-441d-a2d7-52a2b14a2a40
ishandutta2007/codeforces
kolesov93/normal/480/B.cpp
#include <iostream> #include <stdio.h> #include <set> using namespace std; bool has(const set<int>& q, int x) { return q.find(x) != q.end(); } int main() { int n, l, x, y; scanf("%d%d%d%d", &n, &l, &x, &y); set<int> q; for (int i = 0; i < n; ++i) { int a; scanf("%d", &a); q.inser...
ALGO
0.999991
3.418252
0c13a054-c350-44bc-9206-a56620fe2280
alexandraback/datacollection
solutions_5708921029263360_0/C++/gh546/1012.cpp
#include<cstdio> #include<iostream> #include<cstring> using namespace std; const int N=11; struct PP{ int j,p,s; PP(int j=-1,int p=-1,int s=-1):j(j),p(p),s(s){} }pp[N*N*N]; int num[3][N][N]; int n,j,p,s,k; int aa[N*N*N],n1; int ans[N*N*N],n2; void dfs(int id){ //printf("%d\n",id); if(id==n){ if...
ALGO
0.999766
3.121522
e2a26a7c-316e-40e2-b90b-90e5bddd9561
PriyankaRoy1012/Computer_Vision
opencv/modules/imgproc/src/segmentation.cpp
#include "precomp.hpp" /****************************************************************************************\ * Watershed * \****************************************************************************************/ namespace cv { // A no...
ALGO
0.998811
5.880879
9a4bf431-6925-44b7-ab65-5127dabcc8ed
tad315/DSA-code.ptit
DSA07025 - HẬU TỐ.cpp
#include <bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define mod 1000000007 #define endl '\n' #define ll long long ll com(ll a, ll b, const string &op) { switch (op[0]) { case '+': return a + b; case '-': return a - b; case...
ALGO
0.999875
4.884269
5ff7d5a1-079d-4197-8565-af8fd5105d71
hieupham1103/TINHOC
SCHOOL/TUYENSINH10-2024/A.cpp
#include"bits/stdc++.h" #define int long long //#define double long double #define ii pair <int,int> #define fi first #define se second #define endl '\n' #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() using namespace std; signed main(){ //freopen("input.INP", "r", stdin); //freopen("out...
ALGO
0.99978
3.417346
75f5d4f3-f5d1-43b2-b035-81f51f8c6aa2
PRANAVJARANDE/CodeForces
A - Soccer.cpp
#include <bits/stdc++.h> using namespace std; typedef long int int32; typedef unsigned long int uint32; typedef long long int int64; typedef unsigned long long int uint64; typedef long long ll; typedef long double ld; typedef unsigned int ui; typedef unsigned long long ull; typedef pair<ll, ll> pl; typedef vector<int...
ALGO
0.999869
4.110795
ee8e28ff-58f8-447d-bf9f-8f55c3984582
Bitani/Competitve-Programming
Minimum_Absolute_Difference.cpp
// Time Comlexity of O(nlogn). // Space Complexity of O(n). class Solution { public: vector<vector<int>> minimumAbsDifference(vector<int>& array) { sort(array.begin(),array.end()); int N =array.size(); int abs_diff=INT_MAX; for(int i=0;i<N-1;++i) { abs_dif...
ALGO
0.999901
6.118948
b9b3e926-bc5a-4d51-9a0b-e0b57e427129
xiaofushengs/Test
Leetcode/数组/移除元素.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; int removeElement(vector<int> &v,int target){ int slowIndex=0; for(int fastIndex=0;fastIndex<v.size();fastIndex++){ if(target!=v[fastIndex]){ v[slowIndex++]=v[fastIndex]; } } v.resize(slowInde...
ALGO
0.999902
5.127981
2c6b8f0e-744d-40ce-8e7d-2f83edab4d34
man02123/leetcode-solutions
1838-frequency-of-the-most-frequent-element/1838-frequency-of-the-most-frequent-element.cpp
#define ll long long int class Solution { public:vector<ll> pre;int op;int x; int maxFrequency(vector<int>& nums, int k) { sort(nums.begin(),nums.end()); op = k; x = nums[0]; ll s = 0; pre.push_back(0); for(auto it:nums){ s+=it; pre.push_back(s)...
ALGO
0.999983
5.141672
c183c783-9f4c-4015-a445-34d021d7a35f
cnsuhao/vcf
vcf/src/vcf/RegExKit/RegExKit.cpp
//#include "oniguruma.h" #include "vcf/RegExKit/RegExKit.h" OnigSyntaxType* onigTranslateSyntax(const VCF::RegExKit::Syntax& syntax) { OnigSyntaxType* returned; switch (syntax) { case VCF::RegExKit::sDefault: returned = onigTranslateSyntax(VCF::RegExKit::getDefaultSyntax()); break; case VCF::RegExKit::sASI...
TOOL
0.880352
4.249171
d021df11-ef53-4870-8e6a-f755f287ff73
ishandutta2007/codeforces
cookiedoth/normal/1662/A.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using db = long double; // or double, if TL is tight using str = string; // yay python! // pairs using pi = pair<int,int>; using pl = pair<ll,ll>; using pd = pair<db,db>; #define mp make_pair #define f first #define s second #define tcT template<c...
ALGO
0.999905
4.377671
18c4beb6-9e39-42cf-83c5-3f4dde6c2b36
BlissRoms-RPi/platform_frameworks_av
media/libstagefright/codecs/amrnb/dec/src/d_plsf_3.cpp
/* ------------------------------------------------------------------------------ Pathname: ./audio/gsm-amr/c/src/d_plsf_3.c Functions: D_plsf_3 ------------------------------------------------------------------------------ INPUT AND OUTPUT DEFINITIONS Inputs: st -- Pointer to type struct D_plsfState mo...
ALGO
0.999461
6.625631
fadcd5d1-1c98-4231-9939-6bffa4648915
roytam1/mypal68-changes
modules/fdlibm/src/e_log.cpp
/* @(#)e_log.c 1.3 95/01/18 */ /* __ieee754_log(x) * Return the logrithm of x * * Method : * 1. Argument Reduction: find k and f such that * x = 2^k * (1+f), * where sqrt(2)/2 < 1+f < sqrt(2) . * * 2. Approximation of log(1+f). * Let s = f/(2+f) ; based on log(1+f) = log(1+s) - l...
ALGO
0.9999
5.725077
248fb280-ff70-4d88-8e0b-1c1b84c41330
harshb910/CP-Questions
ThreeSumCloset.cpp
// Given an integer array nums of length n and an integer target, find three integers in nums such that the sum is closest to target. // Return the sum of the three integers. // You may assume that each input would have exactly one solution. // Example 1: // Input: nums = [-1,2,1,-4], target = 1 // Output: 2 // Exp...
ALGO
0.999997
6.25351
1f63acd1-c161-4e02-af38-421f8b8b13e2
AnupeshVerma/LeetCode_DSA
2530-Maximal-Score-After-Applying-K-Operations/2530-Maximal-Score-After-Applying-K-Operations.cpp
class Solution { private: long long bruteForce(vector<int>& nums, int k, int n) { long long score = 0; while(k--) { int curr_max = INT_MIN; int max_ind = 0; for(int i=0; i<n; i++) { if(curr_max < nums[i]){ curr_max = nu...
ALGO
0.999971
5.50994
a20e185c-81a7-4a46-b24b-8d3c88eb61b7
Ajaymalikkk/leetcode_cpp
0001-two-sum/0001-two-sum.cpp
class Solution { public: std::vector<int> twoSum(std::vector<int>& nums, int target) { // Create an unordered_map to store numbers and their corresponding indices std::unordered_map<int, int> numToIndexMap; // Loop through the array for (int i = 0; i < nums.size(); i++) { ...
ALGO
0.999952
6.928126
691d50f7-6748-42be-91a4-ad0a9b178087
Kashif-Ahmad-1/100-days-Code-Challenge
Day 1/TwoSum.cpp
#include <iostream> using namespace std; int twoSum(int a[], int target, int n) { for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { if (a[i] + a[j] == target) { // return {i, j}; } } } return 0; } int main()...
ALGO
0.999953
5.276893
943f6ac4-1402-4f2b-8cee-788bd5caff04
Drone-Banks/ACM
HDU/1143.cpp
/************************************************************************* > File Name: test.cpp > Author: Akira > Mail: <EMAIL> ************************************************************************/ #include <iostream> #include <iomanip> #include <sstream> #include <cstdio> #include <cstring> #inclu...
ALGO
0.99972
3.722086
76fff0b7-a007-4abb-b2ee-eac8f3c5c30d
laxmishinde29/Logic_Building
program306.cpp
#include<iostream> using namespace std; int CountEven(int Arr[], int iSize) { static int i = 0; static int iCount = 0; if(i< iSize) { if(Arr[i] % 2 == 0) { iCount++; } i++; CountEven(Arr,iSize); } return iCount; } int main() { int *Arr =...
ALGO
0.991817
4.762639
e6f78dc4-2760-48d5-aa4d-9495feeebf48
sarvex/leetcode-powershell
solution/0800-0899/0804.Unique Morse Code Words/Solution.cpp
class Solution { public: int uniqueMorseRepresentations(vector<string>& words) { vector<string> codes = {".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."}; ...
ALGO
0.999907
6.510392
4c740588-ccf5-4c51-b987-16d9c7482d65
peacefullyquietly/baekjoon_study
JEJE/클래스3/DSLR 9019.cpp
using namespace std; int start, flag; int D(int n){ return (n*2)%10000; }int S(int n){ if(n == 0)return 9999; else return n-1; }int L(int n){ return 10*(n%1000)+n/1000; }int R(int n){ return 1000*(n%10)+(n/10); } string bfs() { queue<pair<int, string>> q; int qs = 0; bool visited[1000...
ALGO
0.999911
5.013853
5123cdae-2e32-44db-a5da-6563c6b24e60
Lucifosh/3row
three in row/Move.cpp
#include "Move.h" #include "Object.h" #include <iostream> #include <thread> bool Move::tryToMove(int x, int y) { int count = 0; bool reset = true; for (int side = 0; side < 4; side++) { int k = 1; if (side == 2 && reset) { count = 0; reset = false; } while (true) { if (count >= 2) return t...
ALGO
0.98973
4.327039
45ec561e-4ab1-408e-94d3-cd44ee869476
Madhavan0210/ProblemSolving-GFG
Difficulty: Easy/Isomorphic Strings/isomorphic-strings.cpp
//{ Driver Code Starts // C++ program to check if two strings are isomorphic #include <bits/stdc++.h> using namespace std; #define MAX_CHARS 256 // } Driver Code Ends class Solution { public: // Function to check if two strings are isomorphic. bool areIsomorphic(string &S1, string &S2) { // Your c...
ALGO
0.999517
6.160353
14066594-bdd6-43f8-a1a9-cf739587d123
IqraRehman/Sorting-and-graph
sorting/main.cpp
#include <iostream> #include<graphics.h> using namespace std; class Sort{ int arr[5] , bs , sw , ins , sh; public: void input(){ cout<<"\nEnter 5 elements\n"; for(int i=0 ; i<=4 ; i++) cin>>arr[i]; } void bubble(){ int a[5] , temp ,i; bs = 0; for(i=0 ; i<=4 ; i...
ALGO
0.999065
3.99324
0aeb7d98-7540-49ba-88d1-c61bc3e43226
dk-kling/drivefuzz
carla-autoware/Autoware/src/autoware/core_perception/lidar_apollo_cnn_seg_detect/nodes/cluster2d.cpp
#include "cluster2d.h" bool Cluster2D::init(int rows, int cols, float range) { rows_ = rows; cols_ = cols; grids_ = rows_ * cols_; range_ = range; scale_ = 0.5 * static_cast<float>(rows_) / range_; inv_res_x_ = 0.5 * static_cast<float>(cols_) / range_; inv_res_y_ = 0.5 * static_cast<float>(...
DATA
0.976478
6.073399
3e8c476b-a19b-4538-99aa-cbbd14ed2b41
talinke/lammps_langevin
src/MANIFOLD/manifold_spine.cpp
// clang-format off #include "manifold_spine.h" #include <cmath> #include "math_special.h" using namespace LAMMPS_NS; using namespace user_manifold; manifold_spine::manifold_spine( LAMMPS *lmp, int /*argc*/, char **/*argv*/ ) : manifold(lmp) { power = 4; } manifold_spine_two::manifold_spine_two( LAMMPS *lmp, i...
ALGO
0.992197
6.136486
7cfb0765-6aa7-4c1d-950e-8bb0aeb9465f
matsumoto2004/competitive_programming
archive/archive_cf/cf1868/b.cpp
#include<bits/stdc++.h> #include<cassert> //#include<ext/pb_ds/assoc_container.hpp> //#include<ext/pb_ds/tree_policy.hpp> //#include<ext/pb_ds/tag_and_trait.hpp> #define overload4(_1, _2, _3, _4, name, ...) name #define rep1(i, n) for (ll i = 0; i < ll(n); ++i) #define rep2(i, s, n) for (ll i = ll(s); i < ll(n); ++i) #...
ALGO
0.999894
4.175325
e757b5f5-89c8-43b0-9e10-0e2b3544296b
Gobson995/Cplusplus-BRUTE
Neps/CFaleatorio/ql.cpp
#include <bits/stdc++.h> using namespace std; int main () { string p; char l; cin >> p; cin >> l; int contador = 0; for (int i=0; i < size(p); i++) { if (p[i] == l) { contador++; } } cout << contador << endl; }
ALGO
0.999715
3.346949
eec0cf60-cb52-473c-b20a-e8627c6b1f01
Rahul-skush/leetcode-solutions
2225-find-players-with-zero-or-one-losses/2225-find-players-with-zero-or-one-losses.cpp
class Solution { public: vector<vector<int>> findWinners(vector<vector<int>>& matches) { unordered_map<int, vector<int>> mp; for(auto x : matches) { if(mp.find(x[0])!=mp.end()) mp[x[0]][0]+=1; else mp[x[0]] = {1, 0}; ...
ALGO
0.999913
5.583893
1db62b14-2711-4d4b-ac7d-662e22998201
lezasantaizi/HarrisCornerDetect
HarrisCornerDetect/HarrisCornerDetect/main.cpp
#include <iostream> #include <math.h> #include "../3rdparty/include/opencv.hpp" using namespace std; using namespace cv; #pragma comment(lib, "opencv_highgui249d.lib") #pragma comment(lib, "opencv_imgproc249d.lib") #pragma comment(lib, "opencv_core249d.lib") #pragma comment(lib, "opencv_highgui249.lib") #pragma commen...
ALGO
0.985604
4.462018
e64cd6a6-bb3c-4064-90b5-cc84e975bae0
ArtoriasKein/cpp-search-server
search-server/search_server.cpp
#include "search_server.h" #include <cmath> #include <numeric> using namespace std; SearchServer::SearchServer(const string_view stop_words_text) : SearchServer(SplitIntoWords(stop_words_text)) { } SearchServer::SearchServer(const string& stop_words_text) : SearchServer(SplitIntoWords(stop_words_text)) { } ...
WEB
0.992151
6.717634
9d02d32c-b0db-4980-a074-fe0f43537cd6
AnjaliNaik07/DATA-STRUCTURE-LAB-LIST
DFS 123.cpp
///12.DFS.....//// #include<iostream> #include<conio.h> #include<stdlib.h> using namespace std; int cost[10][10],i,j,k,n,stk[10],top,v,visit[10],visited[10]; int main() { int m; cout <<"Enter no of vertices:"; cin >> n; cout <<"Enter no of edges:"; cin >> m; cout <<"\nEDGES \n"; for(k=1; k<...
ALGO
0.999967
4.197457
40b127a7-23e2-4706-9ec7-a49646d486b6
ishandutta2007/codeforces
tempura0224/normal/1076/E.cpp
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<iomanip> #include<math.h> #include<complex> #include<queue> #include<deque> #include<stack> #include<map> #include<set> #include<bitset> #include<functional> #include<assert.h> #include<numeric> using namespace std; #define REP(i,m,n) for...
ALGO
0.999976
4.229728
a5e8f162-a4d7-4d84-81de-3e3032621600
Dup4/competitive-programming
codeforces/contest/1229/c.cpp
#include <bits/stdc++.h> using namespace std; #define debug(...) \ { \ printf("# "); \ printf(__VA_ARGS__); \ puts(""); \ } #define fi first #define se second #define endl "\n" using ll = long long; using pII = pair<int, int>; using pLL ...
ALGO
0.999534
4.351272
6c8edcf1-0ed7-4ad6-b1e4-d603c5086d15
RivinduT/DSA
DSA TakeHomeLabs/L1.2_3.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <functional> #include <cctype> #include <locale> #include <vector> // Add this line to include the vector library using namespace std; /* * Complete the 'rotateLeft' function below. * * The function is expected to return an INTEGE...
ALGO
0.999972
6.049616
f386a194-1caa-49f7-aecb-51732fa6716f
ishandutta2007/codeforces
hongzy/normal/1726/C.cpp
#include <bits/stdc++.h> #define LOG(FMT...) fprintf(stderr, FMT); #define rep(i, j, k) for(int i = j; i <= k; ++ i) #define per(i, j, k) for(int i = j; i >= k; -- i) using namespace std; #define fs first #define sc second #define pb push_back #define mp make_pair typedef double db; typedef long long ll; typedef long d...
ALGO
0.999749
3.624799
760272f8-f324-4537-8300-976fecf523e6
M-E-K-J-2102/CSI-240-PA-3
DataPoint.cpp
/* Author: Matthew Kane Class: CSI-240-04 Assignment: PA 3 Date Assigned: 22/3/2024 Due Date: 92/3/2024 @ 1:00 PM Description: A program that uses the knn algorithm with a mushroom attribute database Certification of Authenticity: I certify that this is entirely my own work, exce...
ALGO
0.929727
5.664841
2f606a7c-ba03-49b2-8dee-89c4a2df240a
Prateek-agrawal04/DSA_Basic
C++/powof2.cpp
#include <iostream> #include<cmath> using namespace std; bool power(int n){ int i =0; while(true){ if(n= pow(2,i)) return true; if(n< pow(2,i)) return false; i++; } } int main(){ int n; cin>>n; int i =0; while(true){ if(n< pow(2,i)){ cout<<false...
ALGO
0.999528
4.295596
25e9dd19-a567-41cb-8843-ed1cada04eb7
yunwei37/gdal-proj-wasm
gdal/port/cpl_quad_tree.cpp
#include "cpl_port.h" #include "cpl_quad_tree.h" #include <cstdio> #include <cstring> #include "cpl_conv.h" #include "cpl_error.h" CPL_CVSID("$Id$") constexpr int MAX_DEFAULT_TREE_DEPTH = 12; constexpr int MAX_SUBNODES = 4; typedef struct _QuadTreeNode QuadTreeNode; struct _QuadTreeNode { /* area covered by thi...
ALGO
0.992797
6.981395
8b110321-db4b-4342-a029-98d69b4a047e
Zu-rin/AtCoder
AtCoder_Beginner_Contest/ABC089/ABC089C.cpp
#include <iostream> #include <string> using namespace std; int main(void) { int num, i = 0, p; long long ans = 0, a[5] = { 0 }; cin >> num; string s, march = "MARCH"; for (; i < num; i++) { cin >> s; p = march.find(s[0]); a[p]++; } ans += a[0] * a[1] * (a[2] + a[3] + a[4]); ans += a[2] * a[3] * (a[0] + ...
ALGO
0.999866
3.824535
1156dab5-1ef0-4b05-938b-7233a48598b3
PaukIsUha/optimizing_formating_code
predictions/submissions-aizu-cot-gpt35/Codenet/p02315/244218806/response_1.cpp
#include <iostream> #include <vector> int main() { int N, W; std::cin >> N >> W; std::vector<int> v, w; v.reserve(N); w.reserve(N); for (int i = 0; i < N; i++) { int vi, wi; std::cin >> vi >> wi; v.push_back(vi); w.push_back(wi); } std::vector<std::vector<int>> dp(N + 1, std::vector<...
ALGO
0.999969
4.827759
26b42146-8c22-4887-b785-10ddf58514cc
RisingOS-OSS/android_frameworks_native
cmds/installd/otapreopt_utils.cpp
#include "otapreopt_utils.h" #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <android-base/logging.h> #include <android-base/stringprintf.h> #include <android-base/strings.h> using android::base::Join; using android::base::StringPrintf; namespace android { namespace installd { bool Exec(c...
TOOL
0.891764
6.737495
e0bc5ac6-c1bf-4763-a3a0-8f4e706c589a
junjiecjj/Data-Structure-And-Algorithm
target_offer/题51.不用循环求和.cpp
/************************************************************************* >> File Name: 不用循环求和.cpp >> Author: chenjunjie >> Mail: 2716705056qq.com >> Created Time: 2019.04.02 题目描述 求1+2+3+...+n,要求不能使用乘除法、for、while、if、else、switch、case等关键字及条件判断语句(A?B:C)。 ******************************************************************...
ALGO
0.999962
3.80209
efde77fa-9984-4110-91f1-0018d0afb2bb
M-abdullah-liaqat/DSA-Practice
mutipleparan.cpp
#include<iostream> using namespace std; struct stack { int size; int top; char * arr; }; int isempty(stack *ss){ if(ss->top== -1){ return 1; } else return 0; } int isfull(stack *ss){ if(ss->top== ss->size-1){ return 1; } else return 0; } void push(stack * ss, ...
ALGO
0.999275
4.508343
fd7de1bb-5457-412e-89fc-a8bd9deb17e6
hzratali/DSA-Problems
2379-maximum-total-importance-of-roads/2379-maximum-total-importance-of-roads.cpp
class Solution { public: long long maximumImportance(int n, vector<vector<int>>& roads) { vector<long long> deg(n, 0); for(vector<int> &edge : roads){ deg[edge[0]]++; deg[edge[1]]++; } sort(deg.begin(), deg.end()); long long val = 1, ans = 0; f...
ALGO
0.999954
5.776289
aa8f6c62-19a7-4f5a-b288-f3ea01373f49
adityanjr/code-DS-ALGO
CodeForces/Complete/1-99/18B-Platforms.cpp
#include <iostream> int main() { int64_t n, d, m, l; std::cin >> n >> d >> m >> l; int64_t ans(0); for (int64_t a = 0; a < n; a++) { int64_t b = m * a + l + d; ans = b - b % d; if (b - b % d < m * (a + 1)){break;} } std::cout << ans << std::endl; return 0; }
ALGO
0.999885
3.330036
a888bde1-852d-4164-88dd-6761a0c17e25
Kushagra-Mangalam/PEP_DSA_KUSH
dsa/pep/heap/heap.cpp
#include<iostream> using namespace std; class heap{ public: int arr[100]; int size; heap(){ arr[0]=-1; size=0; } void insert(int val){ size=size+1; int index=size; arr[index]=val; while(index>1){ int parent=index/2; ...
ALGO
0.999861
4.607961
eda4a6a2-01aa-4f42-b75c-24c8c727dbc5
huwenyue/STL
BFS-1.cpp
#include <cstdio> #include <queue> using namespace std; const int maxn = 100; struct node{ int x,y; //位置(x,y) }Node; int n,m; //矩阵大小为n*m int matrix[maxn][maxn]; //01矩阵 bool inq[maxn][maxn] = {false}; //记录位置(x,y)是否已经入过队 int X[4]={0,0,1,-1}; //增量数组,代表4个方向 int Y[4]={1,-1,0,0}; bool judge(int x,int y){ ...
ALGO
0.999768
4.137188
095532a0-8ede-4ad4-84e9-416976ac73df
deepakiiitkota/Competitive
C++_GDrive/bloomberg1.cpp
#include <iostream> #include <string> #include <vector> using namespace std; // "3[abc]" -> "abcabcabc" // "3[abc][abc]" Invalid // "3[abc]1[abc]" -> "abcabcabcabc" // "3[1[a]1[bc]]1[abc]" -> "abcabcabcabc" // x[string]y[string]z[] // "3[1[a]1[bc]]" -> "abcabcabc" (invalid) // "3[123[abc]]" //A similar question...
ALGO
0.997078
4.665324
e6f6855d-4c75-422c-9c11-5d23b05c3168
amarjeet-kumar-shah/Leetcode
0476-number-complement/number-complement.cpp
class Solution { public: static int findComplement(int num) { return num^((1u<<(32-countl_zero((unsigned)num)))-1); } };
ALGO
0.999278
5.438674
0e0c54e8-3bc0-402c-bc0f-7a8a03de39d9
chriszzhou/C
C++slist/test.cpp
#include<iostream> using namespace std; #define SIZE 10 class Node { public: int date; Node * ptr; }; class sList { public: sList(int a) { head = new Node; head->ptr = NULL; head->date = a; } ~sList() { Node *p; while (head) { p = head; head = head->ptr; delete p; } head = NULL; } void p...
ALGO
0.994022
3.444216
c977bc47-7add-4fbc-9fb7-132d064edf14
StevenG3/LeetCode
disjoint_sets/128_longest_consecutive_sequence.cpp
#include "../template/unionfind.h" using namespace std; int longestConsecutive(vector<int>& nums) { if(nums.empty()) return 0; // 去重 unordered_map<int, int> ump; int cnt = 0; for(auto x : nums) { if(ump.count(x) == 0) { ump[x] = cnt++; } } UnionFind uf(cnt); for(auto&& [x, pos] : ump) { if(ump.count...
ALGO
0.999876
4.870656
dfaf51cb-6c9b-4fa0-a0eb-498893aaf6d3
RishikeshDwivedi-99/LeetCode
2639-separate-the-digits-in-an-array/separate-the-digits-in-an-array.cpp
class Solution { public: vector<int> separateDigits(vector<int>& nums) { vector<int> ans; for (int num : nums) { string s = to_string(num); for (char c : s) { ans.push_back(c - '0'); } } return ans; } };
ALGO
0.999835
6.660394
b5ede952-f40c-491c-96ae-6f63403c79a9
brunodccarvalho/competitive
code/test/poly_series.cpp
#include "test_utils.hpp" #include "numeric/fft.hpp" #include "numeric/polynomial.hpp" using namespace polymath; using num = modnum<998244353>; void speed_test_polynomial() { vector<int> Ns = {6000, 15000, 30000, 50000, 100000, 200000, 300000, 500000, 800000}; vector<int> inputs = Ns; const int FIXED = ...
TEST
0.907962
5.078346
44713a79-e959-4410-8e61-3cb0da1e3f4a
Wind0City/niconiconi-
C/数据结构C/二叉树/BinaryTree.cpp
//二叉树相关基本操作 #include <stdio.h> #include <stdlib.h> #include <iostream> #include <queue> #include <stack> using namespace std; typedef struct bTree { int ele; //数据 struct bTree *lchild; struct bTree *rchild; //左右结点指针 } * tr; tr buildtree() //递归建树 { tr T; //先建立一个节点 int data; scanf("%d", &data); //...
ALGO
0.999866
3.668082
b2a0454b-752c-46dc-96e6-c8e9dd497dbd
mdhasanurdev/dinebd-partner-demo
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
8da77d36-a9bf-4a93-a3e9-dd4df6843481
8thMay03/DSA
DSA07110.KiemTraDayNgoacDung.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int main(){ int t; cin >> t; while(t--){ stack<char> st; string s; cin >> s; for(int i=0;i<s.size();i++){ if(st.empty()){ st.push(s[i]); } else...
ALGO
0.999604
4.516267
0f58edbd-fb9a-49ce-b25b-f7a6e4b54a8c
hushmirror/hush3
src/pow.cpp
#include "pow.h" #include "consensus/upgrades.h" #include "arith_uint256.h" #include "chain.h" #include "chainparams.h" #include "crypto/equihash.h" #include "primitives/block.h" #include "streams.h" #include "uint256.h" #include "util.h" #include "sodium.h" #ifdef ENABLE_RUST #include "librustzcash.h" #endif // ENABL...
ALGO
0.99968
5.260915
9747cc1e-a2b4-4f90-a0de-eadf5d597643
shivangstreak/comp
Practise/More/Spoj/MMAXPER.cpp
#include<bits/stdc++.h> using namespace std; const int N=1e3+5; #define ll long long int l[N],b[N],stood; int dp[2][N]; int main(){ int n;scanf("%d",&n); for(int i=1;i<=n;i++){ scanf("%d%d",&b[i],&l[i]); } dp[0][1]=b[1]; dp[1][1]=l[1]; for(int j=2;j<=n;j++){ for(int i=0;i<2;i++){ if(i==0){ dp[i][j]=ma...
ALGO
0.999953
3.459552
daedeeb9-a5e7-43e4-9f9e-dfd0040eed94
Pawan109/DSA_Practice_LEETCODE
893-all-nodes-distance-k-in-binary-tree/all-nodes-distance-k-in-binary-tree.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: void makeGraph(TreeNode * curr,int parent, unordered_map<int,vector<int>> &adj){ if(...
ALGO
0.999997
5.58633
77b824bd-3064-4143-aeab-f6257daa0783
troore/unico
benchmark/stream/lte/lib/fft/test.cpp
#include <stdio.h> #include <stdlib.h> #include <math.h> #include "fft.h" #include "util.h" #include "timer/meas.h" #include "check/check.h" #define PI 3.14159265358979323846264338327950288 #ifdef _RAPL extern "C" { #include "papi-rapl/rapl_power.h" } #endif int num_threads; int main(int argc, char *argv[]) { in...
ALGO
0.998027
4.633147
fd400f15-2a40-4fce-a94f-bb4afbd96794
qtcyy/LeetCode-Record-3.17
滑动窗口与双指针/chapter2/2.1/No1695/main.cpp
#include <iostream> #include <unordered_map> #include <vector> using namespace std; class Solution { public: int maximumUniqueSubarray(vector<int> &nums) { int n = nums.size(); vector<int> pre(n + 1, 0); for (int i = 0; i < n; i++) { pre[i + 1] = pre[i] + nums[i]; } int ans = 0, left = 0; ...
ALGO
0.999812
6.356202
8df24d91-d543-4c61-8bf6-020a051e6e56
peeradonthien/DataStructure
Exercise structure cpp/VectorIntersection.cpp
#include <iostream> #include <vector> #include <algorithm> #include <set> using namespace std; int main() { int n,m,value1,value2; vector<int> v1,v2,intersec; cin >> n >> m; for(int i =0; i<n ;i++){ cin >> value1; v1.push_back(value1); } for(int j =0; j<m ;j++){ cin >> va...
ALGO
0.999971
3.390783
454ba776-1e0b-4dbd-a74b-d33c07987242
ashrafulislampro/Basic_Algorithms
Assignment_2/Water.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t, n, num, f_height, s_height; cin >> t; while (t--) { cin >> n; vector<int> arr(n); vector<int> tmp(n); for (int i = 0; i < n; i++) { cin >> num; arr[i] = num; tmp...
ALGO
0.999955
3.803528
89ddaee9-8c39-46f2-b220-e488d01ba8e9
rafaelmm16/Compiladores
Calculadora-Com-XML.cpp
#include <iostream> #include <string> #include <vector> #include <boost/regex.hpp> #include <boost/archive/basic_xml_archive.hpp> #include <boost/property_tree/xml_parser.hpp> #include <boost/property_tree/ptree.hpp> #include <boost/foreach.hpp> using namespace std; //Essa função repete uma string s dada n vezes stri...
ALGO
0.981146
4.083738
93dfdf6f-9059-41cc-aee5-9c6626bfd239
Francis070/LeetCode-concise-and-optimal-solutions
307-range-sum-query-mutable/range-sum-query-mutable.cpp
struct node{ int value; node(){ this->value = 0; } node(int val){ this->value = val; }; }; struct segtree{ int size; vector<node> tree; void init(int n){ size = 1; while(size < n) size *= 2; tree.resize((2 * size)); } node merge(node ...
ALGO
0.999975
5.874289
7d42e263-e3b1-4b79-ac90-14bf0b7e590e
tecnodeveloper/VSOSS
cpp_oldcode/2darray.cpp
////2d array //#include<iostream> //using namespace std; //int main() //{ // //First is row and second is column; //// int A[2][3]={{1,2,3},{5,3,6}}; // int A[2][3]; // cout<<"Enter 2d array: "; // for(int i = 0; i<2; i++) // { // for(int j = 0; j<3; j++) // { // cin>>A[i][j]; // } // cout<<endl; // } // for(int...
ALGO
0.961143
3.559045
21b4c599-48ab-4f8b-aeb3-b139b8939af8
TejalCho/C-
HeightOfTree.cpp
#include<iostream> using namespace std; struct Node{ int data; Node* left; Node* right; }; Node* Newnode(Node* newnode, int data){ newnode = new Node; newnode->data = data; newnode->left = NULL; newnode->right = NULL; } int heightofTree(Node *newnode){ if(newnode == NULL){ re...
ALGO
0.999862
5.377259
61597f56-4346-40a1-a50e-4ff5acbdfd84
sribhargav1345/Striver-SDE
Greedy/MinPlatforms.cpp
class Solution { public: // Function to find the minimum number of platforms required at the // railway station such that no train waits. int findPlatform(vector<int>& arr, vector<int>& dep) { // Your code here int n = arr.size(); sort(arr.begin(),arr.end()); sort(dep.begin...
ALGO
0.99992
5.868527
bfc81f01-4dfe-4760-9f04-1f481e2fc253
rajputji/CPP-Codes
Data-Structures/LinkedList/CircularSinglyLinkedList.cpp
#include<iostream> #include<conio.h> using namespace std; struct node { int data; node* next; }; class cll { node *head,*tail; int size; public: cll() { head=tail=NULL; size=0; } void create(int); void insertatbeg(int); void insertatend(int); void i...
ALGO
0.999574
3.038092
77b94282-bdf3-4383-bb23-fe7127a72469
namoi4009/LAB_DSA_241
week4/BinarySearchTree/question5.cpp
#include <iostream> #include <stack> #include <queue> #include <utility> using namespace std; class BTNode { public: int val; BTNode *left; BTNode *right; BTNode() { this->left = this->right = NULL; } BTNode(int val) { this->val = val; ...
ALGO
0.999751
4.839166
94e21d35-5b6b-4c6d-93a4-0e0819e954c9
aanu2021/Leetcode-Solutions
0168-excel-sheet-column-title/0168-excel-sheet-column-title.cpp
class Solution { public: /* Let say the string str will be of length d , then we can easily say that , num = str[0]*26^(d-1) + str[1]*26^(d-2) + str[2]*26^(d-3) + ... + str[d-1]*26^0 now , we need to figure out how do we fetch those str[0] , str[1] , str[2] , str[3] values ??? ...
ALGO
0.999987
6.350565
70824339-9232-42cf-80dd-2f532d880609
Katsudon10/Competitive-programming
Atcoder/PAST/第1回/e.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<n;++i) #define ALL(a) (a).begin(),(a).end() const int inf = INT_MAX; using ll = long long; const ll INF = 1e18; using P = pair<int,int>; struct Edge{ int to; ll cost; Edge(int to,ll cost):to(to),cost(cost){} }; using Graph = vecto...
ALGO
0.999485
4.027792
ac1a77f8-0894-4f9e-99e5-5af08c26a398
Shre26ya/Leetcode-Bootcamp-NYU-Fall-23
Practice/916.cpp
class Solution { public: bool isSubset(vector<int>& freq2, vector<int>& temp) { for (int i = 0; i < 26; i++) { if (temp[i] < freq2[i]) { return false; } } return true; } vector<string> wordSubsets(vector<string>& words1, vector<string>& words2) { vector<string> result; ...
ALGO
0.999898
6.244462
0158a456-62a6-478c-833e-9fcdf364e4d9
jason5122/leetcode-cpp
no-debugging/remove_duplicate_letters.cpp
/* n == s.length() runtime: O(n) space: O(n) */ class Solution { public: string removeDuplicateLetters(string s) { unordered_map<char, int> count; for (char ch : s) { count[ch]++; } unordered_set<char> seen; stack<char> stk; for (char ch : s) { ...
ALGO
0.999981
7.084221