uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
4d28761d-c459-457d-9482-1e9007460e60
Manikya-Sharma/cp-cf
contests/1984/1984_large_addition.cpp
#include <bits/stdc++.h> using namespace std; const char nl = '\n'; typedef long long ll; typedef long double ld; void solution_fn() { ll num; cin >> num; int n = 0, arr[18]; while (num) { arr[n] = num % 10; n++; num /= 10; } // units place can be any number from 0 to 8...
ALGO
0.999901
6.108457
18228f0d-fd48-4b7b-ac0a-13db315d0755
ravisonagra/DSA-programs
c++/sorts/lineaeBinarySearch.cpp
#include<iostream> #include <climits> using namespace std; int linearSearch(int arr[], int n, int key){ for(int i = 0; i<n;i++){ if(arr[i] == key){ return i; } } return -1; } int binarySearch(int arr[], int n, int key){ int s=0; int e=n; while(s<=e){ int mid...
ALGO
0.999831
5.584633
a7626a36-27d3-4a9e-b11b-68557bccd8ca
Peepbo/Coding-Test
BAEKJOON/N과 M (4)/CodingTest/CodingTest.cpp
#include <iostream> using namespace std; int N, M; void solve(int idx, string str, int last) { if (str.size() == M) { for (const char& ch : str) { cout << ch << ' '; } cout << '\n'; return; } for (int i = 1; i <= N; i++) { if (last <= i) { solve(idx + 1, str + char(i + '0'), i); } } } int ma...
ALGO
0.999785
5.631639
a7f39844-de23-48bf-bde0-b4de2cf2071a
NeoMaster831/CodeStuff
BOJ/USACO 2022 December/Bronze1.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; #define int long long int N, C[100001]; signed main() { cin >> N; for (int i = 1; i <= N; i++) cin >> C[i]; sort(C + 1, C + N + 1); pair<int, int> maxi = { -1, 1 }; for (int i = 1; i <= N; i++) { maxi = max...
ALGO
0.999969
4.177098
f9e59140-3d3f-4bbe-831f-1ffd333f0512
Aaditya7171/DSA-Supreme-3.0
practiceQuestions/66_leetcode-190-reverseBIts.cpp
class Solution { public: int reverseBits(int n) { int result = 0; for(int i = 0; i < 32; i++){ result <<= 1; result |= (n & 1); n >>= 1; } return result; } };
ALGO
0.999869
6.165442
9cf8ddd3-d5fd-463c-b2dc-a3d519aba0b5
PandoraCoin/PandoraCoin
src/bitcoinrpc.cpp
#include "init.h" #include "util.h" #include "sync.h" #include "ui_interface.h" #include "base58.h" #include "bitcoinrpc.h" #include "db.h" #include <boost/asio.hpp> #include <boost/asio/ip/v6_only.hpp> #include <boost/bind.hpp> #include <boost/filesystem.hpp> #include <boost/foreach.hpp> #include <boost/iostreams/con...
WEB
0.977119
5.752316
9986e9f7-e324-49b5-8793-32ab3b2012b9
Ab-Abby-19/cpp-fundamentals
Basics/swap_function_value.cpp
#include <iostream> using namespace std; void swap(int a,int b){ int c; c=a; a=b; b=c; cout << "After Swapping \n first number: " << a << "\n second number: " << b <<endl; } int main() { int n,m; cout << "enter number 1: "; cin >> n; cout << "enter number 2: "; cin >> m; cout << endl; cou...
ALGO
0.999459
3.429877
047a9a1b-9283-4cb2-a566-a8a09c1ac46b
UnpureRationalist/myLeetcodeAnswer
剑指offer_2/60-n个骰子的点数-LCR 185. 统计结果概率.cpp
#include "header.h" class Solution { public: vector<double> statisticsProbability(int num) { constexpr int numSurfaces = 6; vector<vector<int>> probabilities(2, vector<int>(numSurfaces * num + 1, 0)); int flag = 0; for (int i = 1; i <= numSurfaces; ++i) { probabilities[flag][i] = 1; } ...
ALGO
0.999137
4.912905
86665a44-f2ea-4c3d-8ceb-9b15e183afda
iwtbam/leetcode
code/lt0068.cpp
// https://leetcode-cn.com/problems/text-justification/ // text justification class Solution { public: vector<string> fullJustify(vector<string>& words, int maxWidth) { size_t size = words.size(); int line = 0, start = 0; vector<string> res = {}; for(int i = 0; i < size; i++){ if(lin...
ALGO
0.999899
6.279801
0a2eb6f3-7539-4dd1-ba6f-0c32ca8686c5
Hee-won/LLVM-JSRfuzz
llvm/tools/llvm-cfi-verify/lib/GraphBuilder.cpp
#include "GraphBuilder.h" #include "llvm/BinaryFormat/ELF.h" #include "llvm/DebugInfo/Symbolize/SymbolizableModule.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCDisassembler/MCDisassembler.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCInstPrinter.h" #include "llvm/MC/MCInstr...
TOOL
0.969423
7.243461
89a20c6c-362e-4b00-8ef8-0a60eb396a3f
trash-code/valorant-external
ProjectHex/crypto/arc4.cpp
// arc4.cpp - originally written and placed in the public domain by Wei Dai #include "pch.h" #define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 #include "arc4.h" NAMESPACE_BEGIN(CryptoPP) namespace Weak1 { #if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) void ARC4_TestInstantiations() { ARC4 x; } #endif ...
ALGO
0.970575
6.987582
20cfd537-7c78-49e1-9e1d-47c34976d97c
raincross7/code-similarity
codes/train_code/problem165/problem165_480.cpp
#include <iostream> #include <string> #include <stdio.h> using namespace std; int n; string s, t; string c = "mcxi"; int v[] = {1000, 100, 10, 1}; string enc(int x) { char buf[50]; sprintf(buf, "%dm%dc%dx%di", x/1000, x/100%10, x/10%10, x%10); string tmp = buf, ret; for(int i = 0; i < tmp.size(); i++){ i...
ALGO
0.999346
4.481979
683ec910-278d-4bd3-aba5-45c1026261ff
raincross7/code-similarity
codes/train_code/problem198/problem198_256.cpp
#include<bits/stdc++.h> using namespace std; int main(){ string o,e; cin>>o; cin>>e; string ans=""; int ln=o.size()+e.size(); ans.resize(ln); for(int i=0;i<ln;i++){ if(i%2==0) ans.at(i)=o.at(i/2); if(i%2==1) ans.at(i)=e.at(i/2); } cout<<ans<<endl; }
ALGO
0.999979
3.272413
250e76f9-5abc-4fa4-afa2-a58c095294d5
ishandutta2007/codeforces
receed/normal/1055/D.cpp
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <cmath> #include <cstring> #include <cassert> #include <set> #include <map> #include <random> #include <string> #include <unordered_set> #include <unordered_map> #include <deque> #include <queue> typedef long long ll; typedef long do...
ALGO
0.999995
3.610994
a2440826-357a-4f0b-af43-e88b995c79df
Junghs-cloud/Baekjoon
Silver/3/_9342.cpp
#include <iostream> #include <regex> using namespace std; int main() { cin.tie(NULL); ios::sync_with_stdio(false); int N; string str; regex r("[A, B, C, D, E, F]?A+F+C+[A, B, C, D, E, F]?"); cin >> N; for (int i = 0; i < N; i++) { cin >> str; if (regex_match(str, r) == true) { cout << "Infected!"<<"\...
ALGO
0.997964
4.427861
2f7c86fa-663c-4c0f-ac4e-a8e2994b04be
valeriisydorov/cpp-primer
3_24/main.cpp
#include <string> #include <vector> #include <iostream> #include <sstream> using std::vector; using std::string; using std::cin; using std::cout; using std::endl; int main() { vector<int> numb3rs; string num; int temp; while (getline(cin, num)) { std::istringstream iss(num); while (is...
ALGO
0.984035
3.683699
da37fa39-fe4a-45c2-822e-849d1cfbb1b0
kuroneko/uclinux-4.4-microbeepp
user/appWeb/http/date.cpp
/// /// @file date.cpp /// @brief Date management routines /// /// Date management routines for AppWeb /// //////////////////////////////////////////////////////////////////////////////// // // Copyright (c) Mbedthis Software LLC, 2003-2004. All Rights Reserved. // Portions Copyright (c) GoAhead Software Inc, 1995-20...
TOOL
0.949333
4.766514
e19b755c-3c0d-4634-8644-8149d32be047
b0rista/cpp-karate
YellowBelt/Week1/AvgTemp2/AvgTemp2/main.cpp
// // main.cpp // AvgTemp2 // // Created by Boris Tarovik on 01.07.2021. // #include <iostream> #include <cstdint> #include <limits> #include <vector> #include <algorithm> using namespace std; int main(int argc, const char * argv[]) { int n; cin >> n; int64_t sum = 0; vector<int64_t> v(n); for...
ALGO
0.999856
4.735381
b133565f-ef41-443f-99f1-f34d130eabc4
kr-vaibhav/Vision-2024
Graph/Problems on Bfs-Dfs/Cycle Detection in Undirected Graph.cpp
https://practice.geeksforgeeks.org/problems/detect-cycle-in-an-undirected-graph/1?utm_source=youtube&utm_medium=collab_striver_ytdescription&utm_campaign=detect-cycle-in-an-undirected-graph class Solution { private: bool dfs(int node, int parent, vector<bool>&visited, vector<int>adj[]){ v...
ALGO
0.999958
6.362823
2f4473d3-ec88-4dc4-93e0-67ffb633876f
Batmanabcdefg/hp-afem
Code/solvable.cpp
#include <queue> #include "fem/solution.h" #include "math.h" #include "print.h" #include "solvable.h" #include "poly.h" using namespace std; /** * This routine solves the sparse linear system Ax=b, where A is the stiffness * matrix, and b the load vector. * * We do this by assembling A and b from the element ma...
TOOL
0.954405
4.590434
3a537cf2-94f6-4498-857a-57ffae395759
sarvex/leetcode-malbolge
solution/1100-1199/1105.Filling Bookcase Shelves/Solution.cpp
class Solution { public: int minHeightShelves(vector<vector<int>>& books, int shelfWidth) { int n = books.size(); int f[n + 1]; f[0] = 0; for (int i = 1; i <= n; ++i) { int w = books[i - 1][0], h = books[i - 1][1]; f[i] = f[i - 1] + h; for (int j =...
ALGO
0.999978
6.377368
50bcb9eb-8533-4e29-b78a-7ab079ec008d
DeveloperNasima/Number_Theory
fibonacci_by_matrix_expo.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define MOD 1000000007 #define M 2 ll A[M][M],I[M][M]; void mul(ll A[][M], ll B[][M]) { ll temp[M][M],i,j,k; for(i=0; i<2; i++) { for(j=0; j<2; j++) { temp[i][j]=0LL; for(k=0; k<2; k++) {...
ALGO
0.999982
4.538554
43b5b3d0-38d6-4ba8-8092-a1d3f9f09f8d
Yuri-m-b/Cplusplus_Course
modulo18/code51.cpp
// ---------- C++ Tutorial Example 1 ---------- /* * Multi-line Comment */ // These are called preprocessor directives // They load the files which contain premade functions // for your use // Contains functions for converting from 1 data type to // another, random number generation, memory management, // searchin...
TOOL
0.959733
3.956523
8eee1fcf-137f-4cea-966f-983314778929
divykantsharma/Coding-Ninja-Solutions
Milestone 3/Recursion 1b/String to Integer.cpp
#include<string.h> #include<math.h> int stringToNumber(char input[]) { int l =strlen(input); if(l == 1) { return (input[0] - '0'); } int a = stringToNumber(input+1); double b = input[0] - '0'; return (b* pow(10 , l-1) + a); }
ALGO
0.998525
3.559866
0ff510b1-f991-4833-8e6b-31899977843c
lindayukeyi/Stylit
thirdparties/opencv/sources/modules/video/src/tracking/tracker_mil.cpp
#include "../precomp.hpp" #include "detail/tracker_mil_model.hpp" #include "detail/tracker_feature_haar.impl.hpp" namespace cv { inline namespace tracking { namespace impl { using cv::detail::tracking::internal::TrackerFeatureHAAR; class TrackerMILImpl CV_FINAL : public TrackerMIL { public: TrackerMILImpl(const...
ALGO
0.997459
6.478055
69535481-d18e-454b-b67a-6c87fd369a5e
Ankit77760/Array
MergeSortedArrayWithoutUsingExtraSpace.cpp
#include<bits/stdc++.h> using namespace std; //tc-O(mlogm) +nlogn sc-O(1) void mergeTwoSortedArraysWithoutExtraSpace(vector<long long> &a, vector<long long> &b){ int m=b.size(); for(int i=0;i<m;i++){ a.push_back(b[i]); } sort(a.begin(),a.end()); b.clear(); } int main(){ }
ALGO
0.999625
3.943035
4b9bdf3a-2b58-499d-9f48-73454cd1287f
usher2007/Navigation
Research/TrackingTeacher/TrackingTeacher/TrackedPerson.cpp
#include "TrackedPerson.h" #include "Utility.h" TrackedPerson::TrackedPerson(const Mat& image, const Rect& location, const int ParticleNum, const int Id) { image.copyTo(initialImage); initialLocation = location; currentLocation = location; particleNum = ParticleNum; id = Id; AddInitialRoi(initialImage, initialLo...
ALGO
0.990842
5.695036
da077346-4be5-48c8-8c27-2dc7f0cff6e7
Shunaze-Sherwin/All-code
230.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned ll #define pa pair<int, int> #define fi first #define se second #define pb push_back #define mp make_pair #define gcd __gcd #define log __lg #define endl '\n' #define upper upper_bound #define lower lower_bound #define all(a) (a)....
ALGO
0.998928
4.62121
10ff4831-ce83-48ca-8586-65715e83c7b3
nlee0212/CodingTestPrep
Doit알고리즘코딩테스트withC++/3-선택정렬_백준1427.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { string str; cin >> str; int N = str.size(); for (int i = 0; i < N - 1; i++) { char max_idx = i; for (int j = i + 1; j < N ; j++) { if (str[max_idx] < str[j]) { max_idx = j; } } if (i != max_idx) swap(s...
ALGO
0.999954
4.771783
b5c207ca-e570-43d5-bdd2-596614093676
JatinVashisht1/DataStructures
Recursion/Easy/20-find-an-element-and-its-variations-using-recursion.cpp
/** * @brief Variations of finding * @note * @retval None */ #include <iostream> #include <vector> using namespace std; /** * @brief Function to find index of element in array * @param *arr: array which we have to search * @param target: target element that we will search in array * @param size: siz...
ALGO
0.999541
5.303594
1fc3bab5-0e1a-404e-8a0d-aa55669a7caf
shikhadiwakar/BUD
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.998809
6.763549
4dfd372f-bfe4-45cc-bfb6-d991b7397f00
Duonghbtt/CODEPTIT
PTIT-Source-main/SPOJ PTIT/VT09.cpp
// https://luyencode.net/problem/VT09 // VT09 - Tìm số nguyên tố trong mảng #include <bits/stdc++.h> using namespace std; bool isPrime(int n) { if (n < 2) return 0; for (int i = 2; i <= sqrt(n); ++i) { if (n % i == 0) return 0; } return 1; } int main() { int n; ...
ALGO
0.999832
5.506567
f90ad118-bcd5-4e88-9301-f204dbaa91b2
shivgupta198922/HACKEREARTH-MASTER
Data Structures/Arrays/1-D/Tram ride.cpp
#include<bits/stdc++.h> using namespace std; long long solve (int N, int start, int finish, vector<int> Ticket_cost) { start--; finish--; vector<long long> sumTill(N); sumTill[0] = Ticket_cost[0]; for(int i = 1; i < N; i++) sumTill[i] = sumTill[i - 1] + Ticket_cost[i]; long long direc...
ALGO
0.999511
4.086054
b0078458-f5a2-4998-b257-4f87274ba883
PawelMasluch/Programming-tasks-and-my-solutons
codeforces.com/A. Nicholas and Permutation.cpp
#include<iostream> // AC using namespace std; #define REP(i,a,b) for(int i=a; i<=b; ++i) const int MAX_N = 100; int n, a[MAX_N], poz1, pozn; int max(int a, int b) { return ( a > b ) ? a : b ; } int main() { ios_base::sync_with_stdio(0); cin >> n; REP(i,0,n-1) { cin >> a[i]; if( a[i] == 1 ) { ...
ALGO
0.999825
3.456064
db03ca0c-8cc3-451e-bee5-31e333b3b7b9
beketays/pp1-labs-2022-2023
quiz24/u.cpp
#include <iostream> using namespace std; int main(){ double n, m; cin >> n >> m; if(n==m){ cout << "1"; return 0; } for(int i=1; n<=m; i++){ n*=1.1; if(n>=m){ cout << i+1; return 0; } } return 0; }
ALGO
0.999983
3.253237
2ac37297-5be2-437b-beab-5a87fab8b765
Cathy-duan/Substitution-Cipher
Substitution Cipher/main.cpp
// Section 10 // Challenge - // Substitution Cipher /* A simple and very old method of sending secret messages is the substitution cipher. You might have used this cipher with your friends when you were a kid. Basically, each letter of the alphabet gets replaced by another letter of the alphabet. For example, every '...
ALGO
0.997854
4.62286
4fe6edf8-6a3b-434e-966e-3e600429c57b
yefferson12355/repositorioPensamientoComputacional
ProblemasDeOmegaCPP/Marchistas.cpp
#include <stdio.h> int n,m,x,y,r1=0,r2=0; int main(){ scanf("%i%i", &n, &m); int v[n*m]; for(int i=0;i<n*m;++i)scanf("%i", &v[i]); scanf("%i%i", &x, &y); for(int i=0;i<n*m;++i){ if(v[i]%x==0 && v[i]%y==0)r1++,r2++; else if(v[i]%x==0)r1++; else if(v[i]%y==0)r2++; } pri...
ALGO
0.999575
4.337569
8375d500-28a1-4a81-b06d-0fca16dabdbf
21omkarsase/DSA
Trees/easy/checkForBST.cpp
// Check for BST // EasyAccuracy: 25.37%Submissions: 100k+Points: 2 // Lamp // This problem is part of GFG SDE Sheet. Click here to view more. // Given the root of a binary tree. Check whether it is a BST or not. // Note: We are considering that BSTs can not contain duplicate Nodes. // A BST is defined as follows: ...
ALGO
0.999987
6.099412
c15eebc1-931d-4d40-83e3-c63d4e0ebda4
minjungsung/Algorithm
LeetCode/Count-Tested-Devices-After-Test-Operations/Solution.cpp
Input: batteryPercentages = [1,1,2,1,3] Output: 3 Explanation: Performing the test operations in order starting from device 0: At device 0, batteryPercentages[0] > 0, so there is now 1 tested device, and batteryPercentages becomes [1,0,1,0,2]. At device 1, batteryPercentages[1] == 0, so we move to the next device witho...
ALGO
0.995175
5.897812
a5702cd0-449d-41c5-a6af-439afaa5ed6b
MarquesDevADS/studies-first-semester
C- Beecrowd/ex5.cpp
#include <stdio.h> int main () { float A, B, C, D, DIFERENCA; scanf("%f", &A); scanf("%f", &B); scanf("%f", &C); scanf("%f", &D); DIFERENCA = (A*B-C*D); printf("DIFERENCA = %.2f\n",DIFERENCA); return 0; }
ALGO
0.999309
3.59439
71cbf3e3-cf18-4a6f-bde2-05feae641a1d
ShubhamKumar43/Assignment-DAA
LabWork/Week 4/W4Q1.cpp
// Sachin Bhatt // Implementing Merge sort #include <bits/stdc++.h> #define pii pair<int, int> using namespace std; pii merge(int a[], int l, int m, int h) { int i = l; int j = m + 1; int k = 0; int com = 0; int inv = 0; int b[h - l + 1]; while (i <= m && j <= h) { if (a[i] < a[j]) { if(i != k) inv++; ...
ALGO
0.999549
4.283538
684a6dcc-a6bc-45a0-bbc3-6340a44aaa98
Ash-codes18/Cpp_DSA
Programs/Leetcode/Without Readme/9_Palindrome_Number.cpp
class Solution { public: bool isPalindrome(int x) { long int p=0; int n=x; while(n>0){ int a=n%10; p=(p*10)+a; n=n/10; } if(x==p){ return true; } return false; } };
ALGO
0.999887
5.859543
75b648dc-afe6-4593-a546-b11ca0525d56
fallenoak/wowmodelviewer
src/stormlib/src/sparse/sparse.cpp
/*****************************************************************************/ /*---------------------------------------------------------------------------*/ /* This module contains Huffmann (de)compression methods */ /* */...
ALGO
0.952952
5.017963
6c4f57b2-ad8e-4e31-95b3-e15b03253f12
TheCodeArchiveProject/VirtualBox
src/VBox/Additions/WINNT/Graphics/Video/mp/xpdm/VBoxMPInternal.cpp
/* $Id: VBoxMPInternal.cpp $ */ /** @file * VBox XPDM Miniport internal functions */ #include "VBoxMPInternal.h" #include <VBoxVideo.h> #include <VBox/VBoxGuestLib.h> #include <iprt/asm.h> typedef struct _VBVAMINIPORT_CHANNELCONTEXT { PFNHGSMICHANNELHANDLER pfnChannelHandler; void *pvChannelHandler; } VBVAM...
TOOL
0.871962
5.966838
876b214f-e972-41fa-b16a-a52808e5dbd8
sarvex/leetcode-algol
solution/0400-0499/0489.Robot Room Cleaner/Solution.cpp
/** * // This is the robot's control interface. * // You should not implement it, or speculate about its implementation * class Robot { * public: * // Returns true if the cell in front is open and robot moves into the cell. * // Returns false if the cell in front is blocked and robot stays in the curren...
ALGO
0.9991
6.72853
bc884e7b-a43e-4962-a604-9723e8dab50b
katzhang/algorithms-in-cplusplus
18.17.ex.cpp
/* author: Kat Zhang PROG: Draw DFS forest that results from a standard adjacency-matrix DFS of the graph */ #include "17.7.graph-adt-imp-adj-matrix.cpp" using namespace std; template<class Graph> class SEARCH { protected: const Graph& G; int cnt; vector<int> ord; virtual void searchC(Edge) = 0; void search() {...
ALGO
0.999495
4.694511
a94c3f21-0a4e-4320-87bd-68a61f9c2229
adityakumar6225/questionsss
samsung/toggle.cpp
#include <iostream> #include <vector> #include <unordered_map> #include <string> #include <algorithm> #include <bits/stdc++.h> using namespace std; int main() { // Inputting variables int n, m, k; cin >> n >> m >> k; vector<vector<int>> mat(n, vector<int>(m)); // Inputting the matrix for (int...
ALGO
0.999833
5.798764
81e02ba1-cc0e-47ad-b7c9-ef7ed09941a0
Shantanu9799/Coding_Ninjas-Problem
SubSquad.cpp
int subsquad(vector<int> &a) { // Write your code here. set<int> Set; for(int it : a) { Set.insert(it); } return Set.size(); }
ALGO
0.992278
4.432574
7db04c80-284c-4eda-ad6a-c94332659b65
AmanDhimanD/CPP
Huffman Coding.cpp
// C program for Huffman Coding #include <stdio.h> #include <stdlib.h> // This constant can be avoided by explicitly // calculating height of Huffman Tree #define MAX_TREE_HT 100 // A Huffman tree node struct MinHeapNode { // One of the input characters char data; // Frequency of the character unsigned freq; ...
ALGO
0.999995
4.872491
3f853fa7-01a6-4b91-ac99-ceabf69c2c77
vemerion/AoC2021
day8/day8.cpp
#include <iostream> #include <vector> #include "day8.hpp" Display Display::parse() { Display display; std::string digit; for (uint8_t i = 0; i < display.digits.size(); i++) { std::cin >> digit; display.digits[i] = digit; } std::cin.ignore(2); for (uint8_t i = 0; i < display.output.size(); i++) { ...
ALGO
0.994717
6.544735
a68cee5e-2c4b-4e51-bb41-e63a4441df04
real-world-system-design/Interview_prep
live/fib.cpp
#include <iostream> using namespace std; //it is basically a pattern of numbers where the sum of previous two nums are the sum of //third one . // 0 1 1 2 3 5 8 13 int fibo(int n) { int a = 0; int b = 1; cout<<a<<" "; cout<<b<<" "; for(int i = 0; i < n -2 ;i++) { int c = a+b; //1 + 1 = ...
ALGO
0.999796
4.143147
9152389f-2745-44a2-956b-6313e0cb6b2b
gabrielrcp/Treino-Maratona
Seletiva2009/0630/2738.cpp
#include <cstdio> #include <algorithm> #define MAX 1010 using namespace std; int v[MAX]; int memo[MAX][MAX]; int vai(int i, int j) { if(i == j) return 0; if(memo[i][j] != -1) return memo[i][j]; int r1, r2; r1 = v[i] - max(v[i+1], v[j]); if(v[i+1] >= v[j]) r1 += vai(i+2, j); else r1 +=...
ALGO
0.999778
3.767961
46c2753b-de98-44c5-a585-8c224bbeab30
harshrajranjan0/Programming-Basic
DSA/Problems/even_odd.cpp
#include <iostream> using namespace std; bool iseven(int n) { if ((n & 1) == 1) //// Even number has 0 as the last bit { return 0; } else return 1; } int main() { int n; cout << "Enter Your number: "; cin >> n; if (iseven(n)) { cout << "Even Number "; } ...
ALGO
0.997106
3.83547
3ce5f586-8b30-4f3a-a2b2-b0e7316de76c
GambitBSM/gambit_1.5
contrib/MassSpectra/flexiblesusy/models/MSSMatMSUSY_mAmu/MSSMatMSUSY_mAmu_two_scale_high_scale_constraint.cpp
// File generated at Thu 10 May 2018 14:27:11 #include "MSSMatMSUSY_mAmu_two_scale_high_scale_constraint.hpp" #include "MSSMatMSUSY_mAmu_two_scale_model.hpp" #include "MSSMatMSUSY_mAmu_info.hpp" #include "wrappers.hpp" #include "logger.hpp" #include "ew_input.hpp" #include "gsl_utils.hpp" #include "minimizer.hpp" #inc...
TOOL
0.886027
5.696405
b76b2172-230b-4281-b931-855379582894
MarkoLosic/PizzaMe
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
4283ad27-2840-4c61-9454-b7343b1a0696
Soumyo001/Online_Judge_Solves
code forces/2-3 moves.cpp
#include <bits/stdc++.h> using namespace std; void solve(){ int n;cin>>n; if(n==0){ cout<<0<<"\n"; }else if(n%3==0) { cout<<n/3<<"\n"; }else if(n%3==1) { if(n==1) cout<<2<<"\n"; else cout<<(n/3) + 1<<"\n"; }else if(n%3==2) { if(n==2) cout...
ALGO
0.999809
4.008574
cd4babfa-546b-4552-9874-cfdf4945e8a3
draperlaboratory/hope-llvm-project
libcxx/test/std/algorithms/alg.nonmodifying/alg.find.end/find_end.pass.cpp
// <algorithm> // template<ForwardIterator Iter1, ForwardIterator Iter2> // requires HasEqualTo<Iter1::value_type, Iter2::value_type> // constexpr Iter1 // constexpr after C++17 // find_end(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2); #include <algorithm> #include <cassert> #include "test_macros.h" ...
TEST
0.969014
6.550647
87d2c9a1-bb56-4e4f-90b3-6d0a3c9bbc72
IshanX111/DataStructure
iterative post-order binary tree traversal.cpp
#include<bits/stdc++.h> using namespace std; typedef struct node Node; int top=-1; struct Stack { Node *po; int x; Stack(Node *p,int i) { po=p; x=i; } Stack() { } } st[100]; struct node { int data; Node *left; Node *right; }; void push(Stack temp) { ...
ALGO
0.999984
4.022566
32f2e862-b1ad-45b1-9640-0367424873e1
henaifeng/a
Part_5/cartesian_planner/src/arm7dof_cartesian_planner.cpp
// cartesian planner customized for arm7dof robot // cart_path_planner_lib: // wsn, July, 2016 // a library of arm-motion planning functions // uses package joint_space_planner to find a good joint-space path among options // from IK solutions #include <cartesian_planner/arm7dof_cartesian_planner.h> //constructor: Ca...
ALGO
0.998884
3.611067
b3f986d1-e7c5-4b42-b81a-cd76bf15b9b2
my0421kr/Problem_solving
BOJ/2079_펠린드롬.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; string s; vector<vector<int>> cache, dp; int IsPal(int head, int tail) { if(cache[head][tail] == -1) { if(head > tail) { cache[head][tail] = 1; } else if(head == tail) { cache...
ALGO
0.999951
4.785524
f1bce4ac-daf1-4569-b703-5cc1ef80e20d
jeromepalayoor/competitive-programming
codeforces/contests/Div 4/Codeforces Round 886 (Div. 4)/F-We-Were-Both-Children.cpp
// https://codeforces.com/contest/1850/problem/F #include <iostream> #include <cstdint> #include <cstdlib> #include <cmath> #include <array> #include <vector> #include <algorithm> #define sz(a) ((int)((a).size())) #define char unsigned char using namespace std; typedef long long ll; typedef long double ld; int solv...
ALGO
0.999897
4.370728
bf9e327f-62e6-489e-9eb6-497333b8634c
Jaycelation/CPP-PTIT
Object Array/CPP0628.cpp
//https://code.ptit.edu.vn/student/question/CPP0628 //Danh sach doanh nghiep nhan sinh vien thuc tap - 1 #include <bits/stdc++.h> using namespace std; using ll = long long; class DoanhNghiep { public: string id; string ten; int soluong; friend istream& operator >> (istream& in, DoanhNghiep& a) { scanf("\n...
ALGO
0.996912
4.152907
dc63b0cd-f117-4588-a2a8-d02fd0d159cf
rkq/cxxexp
third-party/src/boost_1_56_0/libs/graph/test/transitive_closure_test.cpp
#include <iostream> #include <cstdlib> #include <ctime> #include <boost/graph/vector_as_graph.hpp> #include <boost/graph/adjacency_list.hpp> #include <boost/graph/adjacency_list_io.hpp> #include <boost/graph/graph_utility.hpp> #include <boost/graph/transitive_closure.hpp> #include <boost/progress.hpp> using namespace...
ALGO
0.994528
6.770517
e855883e-8054-41e5-967f-425824af47b9
ipab-slmc/exotica
exotations/dynamics_solvers/exotica_pinocchio_dynamics_solver/src/pinocchio_dynamics_solver_derivatives.cpp
#include <exotica_pinocchio_dynamics_solver/pinocchio_dynamics_solver.h> #include <pinocchio/algorithm/aba-derivatives.hpp> #include <pinocchio/algorithm/joint-configuration.hpp> namespace exotica { void PinocchioDynamicsSolver::ComputeDerivatives(const StateVector& x, const ControlVector& u) { pinocchio::compute...
ALGO
0.999492
6.942954
4fb3954b-9033-4c1f-bb25-62f805491cbc
hzw19880723/tesseract-ocr
tesseract-3.01/textord/sortflts.cpp
#include "mfcpch.h" #include "sortflts.h" #include "notdll.h" ELISTIZE (SORTED_FLOAT) /** * @name SORTED_FLOATS::add * * Add a new entry to the sorted lsit of floats. */ void SORTED_FLOATS::add( //add new entry float value, inT32 key) { SORTED_FL...
ALGO
0.98586
4.889503
24be01e9-5e71-45ff-891b-3e75e6a52a86
moinhameed27/Ultimate-DSA
Backtracking/Split a String Into the Max Number of Unique Substrings.cpp
// Leetcode : https://leetcode.com/problems/split-a-string-into-the-max-number-of-unique-substrings/description/ // [C++]----------------------------------------------------------------------------------------------------------------------------- class Solution { void solve(string &s, unordered_set<string> substri...
ALGO
0.999227
6.622199
c6ea26f3-a707-40dc-8717-d197a8d4d9ca
siddhantkhandelwal/competitiveprog-submissions
leetcode/#GoGetIt/103.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999981
6.321246
3d9dc10d-7df8-4e64-919b-a210e250a4b8
RajatMantri/CSES-Solutions
dp/Removing_Digits.cpp
#include<bits/stdc++.h> using namespace std; #define int long long const int mod = 1e9 + 7; #define ll long long void solve() { int n; cin >> n; int dp[n+1]; if(n<10) cout<<1<<endl; else{ dp[0]=0; for(int i=1;i<=9;i++) dp[i]=1; for(int i=10;i<=n;i++){ int...
ALGO
0.999787
4.79389
f6152b52-549e-4c3c-bb27-e20fb74687de
dmorse/simpatico
src/draft/mcMd/replica/ReplicaMove_staggered.cpp
#ifdef MCMD_PERTURB #ifdef UTIL_MPI #include "ReplicaMove.h" #include <mcMd/perturb/Perturbation.h> #include <mcMd/perturb/LinearPerturbation.h> #include <mcMd/simulation/Simulation.h> #include <mcMd/simulation/System.h> #include <util/boundary/OrthorhombicBoundary.h> #include <util/mpi/MpiSendR...
TOOL
0.997487
6.132776
d387cfe1-6604-45c9-8ac4-8ed0d96c7bf7
GuacheSuede/MSSubmission1234567890
submission/rsi/boost_1_69_0/libs/compute/perf/perf_set_difference.cpp
#include <algorithm> #include <iostream> #include <numeric> #include <vector> #include <boost/compute/system.hpp> #include <boost/compute/algorithm/set_difference.hpp> #include <boost/compute/container/vector.hpp> #include "perf.hpp" int rand_int() { return static_cast<int>((rand() / double(RAND_MAX)) * 25.0); }...
ALGO
0.95002
5.842721
391baec1-7cd6-4b23-bf31-75d08e62497d
vineetjai/Codeforces_Solutions
575 Div 3/A.cpp
#include <iostream> #include <vector> #include <queue> //priority queue #include <stack> #include <map> // multimap #include <set> //multiset #include <list> #include <utility> // pair #include <iterator> #include <deque> // insertion as both ends #include <string> #include <algorithm> //binary_search,sort #include <...
ALGO
0.999364
4.848533
89b8f1f1-d88a-47dc-82cd-44e6128ec7e5
OonishiHiroki/TextureConverter
DirectXTex/DirectXTexMisc.cpp
#include "DirectXTexP.h" using namespace DirectX; using namespace DirectX::Internal; #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wignored-attributes" #endif namespace { const XMVECTORF32 g_Gamma22 = { { { 2.2f, 2.2f, 2.2f, 1.f } } }; //---------------------------------------...
TOOL
0.921209
6.882344
839b671a-59de-41f2-b4c2-be97958290ed
Vghxv/LeetStreak
cplusplus/15.cpp
#include <algorithm> #include <gtest/gtest.h> #include <vector> using namespace std; class Solution { public: vector<vector<int>> threeSum(vector<int> &nums) { vector<vector<int>> result; sort(nums.begin(), nums.end()); int i = 0; while (i < nums.size() - 2) { int tar...
ALGO
0.99976
6.224069
334b9072-8756-4268-8e7a-52e05846e6e0
abhishekraj004/DSA
questionofstack/twostackimplemenationinonearray.cpp
#include<iostream> using namespace std; #include<stack> class Stack{ public: int *arr; int size; int top1; int top2; Stack( int size){ arr=new int[size]; this->size=size; top1=-1; top2=size; } void push1(int data){ if(top2-top1==1){ // no space availabel cou...
ALGO
0.980857
3.647101
cb78d508-b45f-4038-aceb-7690409b6e02
kmjp/procon
yuki/1001-2000/1501-1600/1549.cpp
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define FORR2(x,y,arr) for(auto& [x,y]:arr) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define ...
ALGO
0.998995
3.803478
88cab9e6-adf8-41d8-b08b-e9b940b62452
jaden-dai/CPP
Problem Of the Week/It All Adds Up.cpp
#include <bits/stdc++.h> using namespace std; int main() { int number; int counter = 0; int digit_1, digit_2, digit_3, digit_4, digit_5; for (number = 10000; number < 100000; number++){ digit_1 = number%10; digit_2 = ((number - digit_1)%100)/10; digit_3 = ((number - digit_...
ALGO
0.997187
4.328522
dd2347d4-d984-4894-b20d-3cb7c0ea8a35
akien-mga/godot-test
editor/property_selector.cpp
/**************************************************************************/ /* property_selector.cpp */ /**************************************************************************/ /* This file is part of: */ /* ...
TOOL
0.903922
7.611744
4359e0ce-f63a-46aa-b24b-d0a32c187ae5
Eafy/FFmpeg-iOS-build-script
4.2/opencore-amr-0.1.5/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/oversamp_12k8_to_16k.cpp
/* ------------------------------------------------------------------------------ Filename: oversamp_12k8_to_16k.cpp ------------------------------------------------------------------------------ INPUT AND OUTPUT DEFINITIONS int16 signal[], input signal / output is divided by 16 int16 lg, ...
ALGO
0.98932
6.196213
2821bbe8-6acc-421f-84e6-8e29200a7a58
VASANTH3105/Placementprep
DAYWISE/07112023/RemoveDuplicates_Optimal_CN.cpp
int removeDuplicates(vector<int> &arr, int n) { // Write your code here. int i = 0; for (int j = 1; j < n; j++) { if (arr[i] != arr[j]) { i++; arr[i] = arr[j]; } } return i + 1; }
ALGO
0.999877
5.669494
1619079a-ef6f-4f85-8242-4b6274e06eb1
H-Shen/MyCodeCollection
校招Collection/Others/计算三角形周长和面积.cpp
// https://www.nowcoder.com/practice/109a44d649a142d483314e8a57e2c710 // Compiled in C++14(g++5.4) #include <bits/stdc++.h> using namespace std; int main() { double a, b, c; cin >> a >> b >> c; double p, s; p = (a + b + c) / 2.0; s = sqrt(p*(p-a)*(p-b)*(p-c)); printf("circumference=%.2lf area...
ALGO
0.99879
4.276109
c6b5e72d-0f22-4411-a37f-d1759833063a
Yamon955/Code
CppCode/天梯/L2-007 家庭房产.cpp
#include<iostream> #include<cstdio> #include<cstring> #include<math.h> #include<stack> #include<queue> #include<set> #include<vector> #include<algorithm> #include<numeric> #define mem(a,b) memset(a,b,sizeof a); using namespace std; typedef long long ll; typedef unsigned long long ull; const int inf = 0x3f3f3f3f; const ...
ALGO
0.998251
3.117274
ba51ad1f-b8b3-4762-ab84-423ec79d664a
scottsus/CS545
src/aikido/src/planner/vectorfield/VectorFieldConfigurationToEndEffectorOffsetPlanner.cpp
#include "aikido/planner/vectorfield/VectorFieldConfigurationToEndEffectorOffsetPlanner.hpp" #include "aikido/planner/vectorfield/VectorFieldPlanner.hpp" namespace aikido { namespace planner { namespace vectorfield { //============================================================================== VectorFieldConfigur...
TOOL
0.91346
6.96495
17fa9a21-0add-48eb-82bd-2b1ffc758d44
knzkhuka/kyopro
atcoder/abc192/submit.cpp
#include<bits/stdc++.h> using namespace std; struct fastio{fastio(){cin.tie(nullptr);ios_base::sync_with_stdio(false);std::cout<<std::fixed<<setprecision(10);}}oitsaf; #define rep(i,n) for(int i=0;i<int(n);++i) using i64 = int64_t; constexpr int64_t INF = 1ll<<60; constexpr char newl = '\n'; template<class T>std::vect...
ALGO
0.99986
3.834835
98cf5f53-29ab-4da3-8cc2-c23609b51417
madukubah/codefight
core/labyrinthOfNestedLoops/pagesNumberingWithInk.cpp
/* You work in a company that prints and publishes books. You are responsible for designing the page numbering mechanism in the printer. You know how many digits a printer can print with the leftover ink. Now you want to write a function to determine what the last page of the book is that you can number given the curre...
ALGO
0.999841
4.928572
102135ae-79f7-4e6b-b2cd-2f403573be9c
Akshansh2515/Bulb-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.998809
6.763549
545a637c-bba3-41a7-9fcd-e9190faae670
cppimprov/rog
Code/rog/rog_level_pathfinding.cpp
#include "rog_level.hpp" #include "rog_feature.hpp" #include <bump_math.hpp> #include <queue> #include <unordered_map> #include <vector> namespace rog { bool is_walkable(bump::grid2<feature, glm::ivec2> const& grid, glm::ivec2 pos) { return !(grid.at(pos).m_flags & feature::flags::NO_WALK); } bool in_bounds...
ALGO
0.998324
6.215186
0af916bb-1881-489f-a1a9-22d5bbed3f6c
KVSchandra/LeetCode
2395-longest-binary-subsequence-less-than-or-equal-to-k/longest-binary-subsequence-less-than-or-equal-to-k.cpp
class Solution { public: int solve(int i, int k, int n, string s, vector<int>&dp){ if(i == n) return 0; // if(k == 0) return 0; if(dp[i] != -1) return dp[i]; int pick = 0; if(k - ((s[i]-'0')*pow(2,i)) >= 0) pick = 1 + solve(i + 1, k-((s[i]-'0')*pow(2,i)), n, s, dp); i...
ALGO
0.999901
5.798117
96b7409e-b439-46d7-8065-8ea4ebf1afd5
pramay88/Leetcode
1227-number-of-equivalent-domino-pairs/1227-number-of-equivalent-domino-pairs.cpp
class Solution { public: int numEquivDominoPairs(vector<vector<int>>& dominoes) { unordered_map<int, int> hash; int ans = 0; for (auto& d : dominoes) { int a = min(d[0], d[1]); int b = max(d[0], d[1]); int key = a * 10 + b; ans += hash[key]; ...
ALGO
0.99977
6.791194
3d4237ba-3e89-4219-a438-6198d39e5a0f
paulkia/Leetcode
Easy/Arrays/1539. Kth Missing Positive Number.cpp
/* Given an array arr of positive integers sorted in a strictly increasing order, and an integer k. Find the kth positive integer that is missing from this array. */ class Solution { public: int findKthPositive(vector<int>& arr, int k) { int count = 0; int id = 0; for (int i = 0; i < arr.siz...
ALGO
0.999902
5.145419
52061378-d118-4676-9a12-33c67114d4eb
scp-sabuj/Programming
C-Programing/exercies/recurrsion.cpp
#include <stdio.h> int add_digits(int n); int main() { int n,result; printf("enter a number:\n"); scanf("%d",&n); result=add_digits(n); printf("sumation=%d",result); return 0; } int add_digits(int n) { int sum=0; if(n==0) { return 0; } sum=n%10+add_digits(n/10); r...
ALGO
0.999748
4.795109
d6a7f164-5e04-4091-9b59-97089309d277
treasersimplifies/DeeroftheAntihero_DotA
contracts/libc++/upstream/test/std/containers/sequences/list/list.ops/remove_if.pass.cpp
// <list> // template <class Pred> void remove_if(Pred pred); #include <list> #include <cassert> #include <functional> #include "min_allocator.h" #include "counting_predicates.hpp" bool even(int i) { return i % 2 == 0; } bool g(int i) { return i < 3; } typedef unary_counting_predicate<bool(*)(int), int> P...
TEST
0.865218
6.452619
58118f97-9384-4329-a974-74a5215ea019
PatriciaEspindola/Programacion-Orientada-a-Objetos
tarea01.cpp
#include <iostream> using namespace std; // Funcion para area del circulo float areaCirculo(float radio) { float pi = 3.1416; return pi * radio * radio; } // Funcion area de cuadrado float areaCuadrado(float lado) { return lado * lado; } // Funcion area del triángulo float areaTriangulo(float base, float...
ALGO
0.997088
4.347116
f0eedb77-7bf6-41dc-b11d-d3cb272213fa
akanerva/CSES
subarray_sums_2/main.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n; int x; cin >> n >> x; vector<int> luvut; for (int i = 0; i < n; ++i) { int a; cin >> a; luvut.push_back(a); } map<...
ALGO
0.999917
4.492258
24677854-b9c7-4bcd-a55d-356d08fd485a
ishandutta2007/codeforces
andreysergunin/normal/461/C.cpp
#include <stdio.h> #include <iostream> #include <vector> #include <algorithm> #include <cstdlib> #include <cmath> #include <cstring> #include <set> #include <map> #include <queue> #include <ctime> #define all(a) (a).begin(), (a).end() #define sz(a) (int)(a).size() using namespace std; vector<int> f; void update(int...
ALGO
0.999714
3.998863
86c2af3e-decf-428a-92d1-3de8940b2711
jerryleandro/studies
lop/listas/1 - UNIDADE/L3/qst5.cpp
//Jilcimar da Silva Fernandes #include <iostream> #include <math.h> using namespace std; main() { int n1, n2 , n3; cout << "\n Insira o 1 lado do triângulo: "; cin >> n1; cout << "\n Insira o 2 lado do triângulo: "; cin >> n2; cout << "\n Insira o 3 lado do triângulo: "; cin >> n3; //Verificando s...
ALGO
0.999421
3.795414
5ce8b10d-85a0-4728-9629-0105ea118ede
TheMartian0x48/CP
Codechef/February_Challenge_2021/HDIVISR.cpp
/* *TheMartian0x48 */ /* Problem: https://www.codechef.com/FEB21C/problems/HDIVISR Solution: https://www.codechef.com/viewsolution/42261130 */ #include <bits/stdc++.h> using namespace std; // clang-format off #define rep(i, a, b) for (int i = a; i < (b); ++i) #define per(i, a, b) for (int i = a; i >= (b); --i) #d...
ALGO
0.99996
5.342379
86bc9b48-cb5a-4a41-9666-7b029b0db45d
ishandutta2007/codeforces
chemthan/normal/803/D.cpp
#include <bits/stdc++.h> using namespace std; #define ms(s, n) memset(s, n, sizeof(s)) #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define FORd(i, a, b) for (int i = (a) - 1; i >= (b); i--) #define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++) #define sz(a) int((a).size()) ...
ALGO
0.99963
3.962682
d3f39c4e-087f-4a1a-a06f-b11b77fa7ca2
MiraiHattori/project-euler
Problem40-49/7_47_distinct_prime_factors.cpp
#include <algorithm> #include <array> #include <iostream> #include <vector> template <class T, T MAX_NUM> std::vector<T> primeList() { std::vector<T> primes; std::array<bool, MAX_NUM + 1> prime{false}; for (T i = 2; i <= MAX_NUM; i++) { if (not prime.at(i)) { prime.at(i) = true; ...
ALGO
0.999815
5.115305
fa21a5f5-05b9-431d-b78d-b49c370bb5b6
MortFred/LeetCodeCpp
49_group_anagrams.cpp
#include <vector> #include <iostream> #include <algorithm> #include <iterator> #include <unordered_map> #include <iomanip> #include <chrono> class Solution { public: std::vector<std::vector<std::string>> groupAnagrams(std::vector<std::string> &strs) { std::unordered_map<std::string, std::vector<std::st...
ALGO
0.999986
6.456106
e959b98e-0503-4b0b-9ef2-b9041a6d64f6
boatinw99/CompetitiveProgramming
SSWT 2.2/1142B.cpp
#include<bits/stdc++.h> using namespace std ; const int N = 2e5+9 ,LOG = log2(N)+1 ; #define mid (l+r>>1) int pos[N],a[N],st[N<<2],ans[N],up[N][LOG],p[N]; void construct(int l,int r,int m) { if(l==r) { st[m]=ans[l]; return ; } construct(l,mid,m<<1); construct(mid+1,r,m<<1|1); st[...
ALGO
0.999984
4.130767