uuid
stringlengths
36
36
repo_name
stringlengths
5
123
relative_path
stringlengths
5
4k
content
stringlengths
33
2.85M
category
stringclasses
6 values
algo_rel_score
float64
0.85
1
quality_score
float64
3
8.76
b31e2d44-8ab1-43c2-bef1-d0f694babbeb
Vivekyy/competitive_programming
dsu.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define dqll deque<ll> class DSU{ public: dqll parent; dqll size; ll num_sets; DSU(ll n){ parent.resize(n); size.resize(n); num_sets = n; } // Assignment flattens tree during lookup ll find_set(ll a...
ALGO
0.995651
3.091283
127b6c0c-ffd7-49f5-b803-9fc07315160f
AhmedYAbbas/Problem-Solving
LeetCode/reverse-vowels-of-a-string/Accepted/7-8-2023, 4_05_02 PM/Solution.cpp
// https://leetcode.com/problems/reverse-vowels-of-a-string class Solution { public: bool IsVowel(char c) { c = toupper(c); return c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U'; } string reverseVowels(string s) { int i = 0, j = s.size() - 1; while (i < ...
ALGO
0.999949
6.645785
8b9119ca-8ee9-446b-a88d-7eb986e971d4
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_1074_3.cpp
#include <bits/stdc++.h> using namespace std; int main() { std::ios::sync_with_stdio(false); int n, a[1000] = {0}; cin >> n; double res = 0, temp = 0; for (int i = 1; i <= n; i++) { cin >> a[i]; } sort(a + 1, a + n + 1); for (int i = 1; i <= n; i += 2) { res += (a[i] * a[i] - a[i + 1] * a[i + 1]...
ALGO
0.998142
3.863939
abc08a1f-0c98-4f92-a70b-8a81f3f59fc4
NAGAVENIGOWDA/My_Placement_prep_DSA
Striver's Sheet/string-subsequences.cpp
//{ Driver Code Starts // Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ class Solution { public: bool isVowel(char ch) { return (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u'); } void solve(string ...
ALGO
0.999502
6.318303
0fc011ce-24b1-4218-be62-2a627ca1fd99
devgoel186/Leetcode-Solutions
longest-valid-parentheses/Accepted/8-16-2021, 3_27_33 PM/Solution.cpp
// https://leetcode.com/problems/longest-valid-parentheses class Solution { public: /* Sol 2 */ int longestValidParentheses(string s) { stack<int> st; st.push(-1); int i = 0, maxLen = 0; while(i < s.length()) { if(s[i] == '(') st.push...
ALGO
0.999752
5.541615
bde3e901-003b-42a5-b285-cd1631be2f4c
qq82850696/Learning-Note
code/leetcode/13.cpp
#include <iostream> #include <stdio.h> #include <memory.h> #include <vector> #include <math.h> #include <time.h> #include <map> #include <string> #include <sstream> using namespace std; //关闭流输出 static auto static_lambda = []() { std::ios::sync_with_stdio(false); std::cin.tie(0); return 0; }(); //main class...
ALGO
0.99969
4.210067
7527d63e-de23-40f1-ac6c-672c5692f33c
MShajieShah/Programming-Fundamentals-Training
Second Month (1- 15 Sep)/problem10.cpp
#include <iostream> #include <stdlib.h> using namespace std; class twoStacks { int* arr; int size; int top1, top2; public: // Constructor twoStacks(int n) { size = n; arr = new int[n]; top1 = n / 2 + 1; top2 = n / 2; } void push1(int x) { if (top1 > 0) { top1--; arr[top1] = x; } else { ...
ALGO
0.997112
4.376587
ed40975c-79f6-4c21-9c96-7c2f7d633931
sureyeaah/Competitive
CSAcademy/Round-73/three-equal.cpp
// Gear4 #define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> using namespace std; #define DEBUG(x) cout << '>' << #x << ':' << x << endl; #define FOR0(i,n) for(int i=0, _##i=(n); i<_##i; ++i) #define FOR(i,l,r) for(int i=(l), _##i=(r); i<_##i; ++i) #define FORD(i,l,r) for(int i=(r), _##i=(l); --i>=_##i; ) ...
ALGO
0.999733
3.58124
3a2513d6-9202-4af6-835b-fcf4d3c9dedf
rofeleo/OOP-Spring-2023
anashkin_i_a/prj.lab/rational/rational.cpp
#include "rational/rational.hpp" int32_t Rational::Gcd(const int32_t a, const int32_t b) const { return b ? Rational::Gcd(b, a % b) : a; } std::istream& Rational::ReadFrom(std::istream& istrm) { constexpr auto max_size = std::numeric_limits<std::streamsize>::max(); int num, denom; char slash('/'); int num_o...
TOOL
0.949986
5.576892
df1fd3c5-d40f-47bc-92b2-c272e2279d31
danu-ramdhani/my-weather
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
f2c92a8c-7066-4cfb-9657-fb094caddbfd
RishadPVM/zerbee_privacy-policy
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.998799
6.776823
120c0c0e-516e-4d77-b5f2-7e8134cd78c6
you4rin/CreativeSoftwareProgramming
7-1-1/main.cpp
#include<iostream> #include<cstdlib> #include<string> #include"sorted.h" int main(){ SortedArray s; while(1){ std::string task; std::cin>>task; if(task=="0"||atoi(task.c_str()))s.AddNumber(atoi(task.c_str())); else if(task=="ascend"){ std::vector<int> v=s.GetSortedAs...
ALGO
0.998264
4.41023
d1b1a221-a3b0-497d-9536-3e63096fc348
oigomezz/Retos
Hackerearth/Algorithms/Searching/Binary-Search/Smallest-Substring/solution.cpp
#include <bits/stdc++.h> using namespace std; int SmallestSubString(string S) { int n = (int)S.size(); int left = 0, right = 0; set<int> s; for (auto x : S) s.insert(x); int target = (int)s.size(); map<char, int> mp; int ans = n; while (right < n) { mp[S[right]]++; while (mp.size() == tar...
ALGO
0.999985
4.887749
98e31aeb-b911-4013-907b-426babded0e7
gvikthor/Programozas
20-21-1/4. Gyak/E4. Feladat/main.cpp
#include <iostream> using namespace std; int main() { const int meret = 5; int helyek[meret] = {1,2,3,4,5}; //felttelezzk, hogy az 1-es s a legnmagyobb sorszm hely, le van foglalva int i = 1; bool talalt = false; while(i < meret && !talalt){ if(helyek[i-1] + 1 != helyek[i]){ ...
ALGO
0.998144
4.364624
132bbab1-b9a5-4991-b012-40b925bf014f
edionu97/Algorithms-DataStructures-ContestsSolutions
Algorithms/Lock Resolution.cpp
// Lock Resolution.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <vector> #include <algorithm> #include <list> #include <cstdlib> #include <utility> #include <bitset> #include <iostream> #include <string> #include <fstream> #include <sstream> #include <queue> #include <ccty...
ALGO
0.999803
4.659324
99f697dc-0a0b-4609-88ed-1c3aa4ce1fe2
Malav5372/Py2CppDSA
C++/Algorithms/BinarySearch/NthRootOfInteger.cpp
#include <bits/stdc++.h> using namespace std; double multiply(double number, int n) { double ans = 1.0; for(int i = 1;i<=n;i++) { ans = ans * number; } return ans; } void getNthRoot(int n, int m) { double low = 1; double high = m; double eps = 1e-7; while((high - low) > e...
ALGO
0.999975
4.387416
2f1a3803-2347-4ec8-90f5-95c6d02a63f1
aolixin/dx_learn
src/assimp/code/PostProcessing/ProcessHelper.cpp
/// @file ProcessHelper.cpp /** Implement shared utility functions for postprocessing steps */ #include "ProcessHelper.h" #include <limits> namespace Assimp { // ------------------------------------------------------------------------------- void ConvertListToStrings(const std::string &in, std::list<std::string> &o...
TOOL
0.949587
7.507528
5f589efd-88df-491b-867b-ff27dd10344d
Esmail-Sameh/shop_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
83c236d7-82a2-4c64-89ea-20105ef230e4
its-Hitesh/Codeforeces-questions
G_Good_Key_Bad_Key.cpp
#include <bits/stdc++.h> #include <bits/extc++.h>// #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; using ll = long long ; #define pb push_back #define ld long double #define sz size() #define foo(i,a,b) f...
ALGO
0.999906
4.084905
d28ff26e-bd81-429a-8fee-1100524f21c9
RomeshKTripathi/CP
EP6/distinctFactors.cpp
#include<iostream> using namespace std; int main(){ int n; cin>>n; int ct=0; for(int i=1;i<=n;i++) { if(n%i==0)ct++; } cout<<ct<<endl; for(int i=1;i<=n;i++){ if(n%i==0)cout<<i<<" "; } return 0; }
ALGO
0.999933
4.184611
38d295e6-430d-42b7-a5f9-edb21fece49b
tvdv/metastorey
lib/boost_1_53_0/libs/math/src/tr1/assoc_legendref.cpp
extern "C" float BOOST_MATH_TR1_DECL boost_assoc_legendref BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, unsigned m, float x) BOOST_MATH_C99_THROW_SPEC { return (m&1 ? -1 : 1) * c_policies::legendre_p BOOST_PREVENT_MACRO_SUBSTITUTION(l, m, x); }
TOOL
0.881879
4.049271
763677fe-dfdc-487b-8016-8b5073cce6bf
nmartin0/dawnbsd-src
gnu/llvm/clang/lib/InstallAPI/Frontend.cpp
#include "clang/InstallAPI/Frontend.h" #include "clang/AST/Availability.h" #include "clang/InstallAPI/FrontendRecords.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" using namespace llvm; using namespace llvm::MachO; namespace clang::installapi { std::pair<GlobalRecord *, FrontendAttrs *> Fronten...
TOOL
0.901555
7.789723
e1ef04a0-aabf-40d3-84f9-eabef6edf204
Parthgaba/programming
C++/Vector STL/vectorOfVector.cpp
#include <iostream> #include <vector> using namespace std; void displayVector(vector<vector<int> > &v) { for (int i = 0; i < v.size(); i++) { for (int j = 0; j < v[i].size(); j++) { cout << v[i][j] << " "; } cout << endl; } } int main() { int size; cout...
ALGO
0.995771
3.674217
a6a003f1-bdd8-4b61-bc26-c557cb1b13e5
Simba-ExC/base-CPP
Multi-file_projects_and_libraries/01/Mathematical functions/Mathematical functions.cpp
#include <iostream> #include <fstream> #include <string> #include "math_power.h" using namespace std; int main(int argc, char** argv) { setlocale(LC_ALL, ""); int a = 0; int b = 0; int chose = 0 ; int equally = 0; std::cout << "Введите первое число: "; std::cin >> a; std::cout << "Вв...
ALGO
0.924449
3.36014
fffbce95-bb0b-4d0e-ad9a-47ead0555f71
Darui99/ITMO-Algorithms-And-Data-Structures
Laboratory work 7 - Range queries/Segment function.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXX = (int)1e+6 + 5; const int S = 450; ll cnt[MAXX]; struct ask { int l, r, num; }; bool cmp(const ask &a, const ask &b) { return make_pair(a.l / S, a.r) < make_pair(b.l / S, b.r); } int main() { ios_base::sync_with_stdio(false); c...
ALGO
0.999962
4.116498
3af54a1e-fb45-42ef-b9da-d60dcc9935f8
adobe/avmplus
halfmoon/hm-identityanalyzer.cpp
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 2 -*- */ /* vi: set ts=2 sw=2 expandtab: (add to ~/.vimrc: set modeline modelines=5) */ #include "hm-main.h" #ifdef VMCFG_HALFMOON namespace halfmoon { /// Return the identity def for the given instruction, which will either /// be effect_in, or ...
TOOL
0.989569
7.149862
bbe26a88-da6b-4f39-b779-87c0cccd7e73
AdityaMalu/LeetCode
0011-container-with-most-water/0011-container-with-most-water.cpp
class Solution { public: int maxArea(vector<int>& height) { int i = 0 , j = height.size()-1, ans = 0; while(j > i){ ans = max(ans,(j-i)*min(height[j],height[i])); if(height[j] > height[i]){ i++; } else{ j--; ...
ALGO
0.99998
6.550798
0d815a80-9285-4d15-af57-5b473ea57a42
Andrean2305/Data-Struct-Final-Project
BackTrack/backtracking.cpp
#include <stdio.h> #include <iostream> #include <ctime> #include <stack> using namespace std; clock_t c_start = clock(); #define N 8 int Movement_Check(int i, int j, int board[N+1][N+1]) { if (i>=1 && i<=N && j>=1 && j<=N && board[i][j]==-1) return 1; return 0; } int knight_move(int board[N+1][N+1], int x,...
ALGO
0.999774
4.452189
f003e478-d55f-4b28-8e95-6dc63d0ab62e
ViktorMilanov05/LeetCode-Tasks
2816_Double_a_Number_Represented_as_a_Linked_List.cpp
#include <iostream> #include <algorithm> /*You are given the head of a non-empty linked list representing a non-negative integer without leading zeroes. Return the head of the linked list after doubling it.*/ struct ListNode { int val; ListNode* next; ListNode() : val(0), next(nullptr) {} ListNode(int x) : val(...
ALGO
0.999983
6.322507
f23fea71-ef30-4b27-abee-8a55afe635b1
Ccccaramel/C
Base/CPP/18-模板.cpp
#include <iostream> using namespace std; template <typename T> // 函数模板 T Max(T a, T b) { return a > b ? a : b; } template <class H> H Min(H a, H b) { return a < b ? a : b; } template <typename X, class Y> void Show(X x, Y y) { cout << x << "," << y << endl; } void Show(int a, int b) { cout << "一般函数:" <<...
ALGO
0.985919
4.505007
df873253-abfc-4ec8-9687-dbd44cce51fb
ishandutta2007/codeforces
ksun48/normal/1406/E.cpp
#include <bits/stdc++.h> using namespace std; const int TEST = 0; int nq; int n; set<int> s; int X; void init(){ nq = 0; cin >> X; for(int i = 1; i <= n; i++) s.insert(i); } int A(int x){ if(x > n) return 0; nq++; if(TEST){ int ret = 0; for(int a : s) if(a % x == 0) ret++; return ret; } else { cou...
ALGO
0.999956
3.764768
23fb1a45-2210-4be1-a92c-caca4befeff3
alexandraback/datacollection
solutions_5648941810974720_1/C++/pavelz/A.cpp
// Description // https://code.google.com/codejam/contest/11254486/dashboard #include <bits/stdc++.h> using namespace std; #define FOR(c, m) for(int c=0;c<(int)(m);c++) #define FORE(c, f, t) for(int c=(f);c<(t);c++) #define LLI long long int #define MOD 1000000007 int power(int a, int b) { int sq = a; int re...
ALGO
0.999959
4.530018
ffab598d-ee9f-4cc0-9b19-099f4a2a0f8a
sarvex/leetcode-go
solution/1600-1699/1690.Stone Game VII/Solution.cpp
class Solution { public: int stoneGameVII(vector<int>& stones) { int n = stones.size(); int f[n][n]; memset(f, 0, sizeof f); int s[n + 1]; s[0] = 0; for (int i = 0; i < n; ++i) { s[i + 1] = s[i] + stones[i]; } function<int(int, int)> dfs = ...
ALGO
0.999861
5.246441
64b93b58-9059-45ad-9a46-cd5f34176538
PauwayHu/2023c
Week13/week13-4d.cpp
#include <stdio.h> int main() { int w,c; scanf("%d%d",&w,&c); int ans =w/c; if(w%c>0) ans++; printf("%d",ans); } //M
ALGO
0.99991
3.457971
b46a0a45-8969-4304-8bee-a900728e23c7
Vedant-Pra/Data-Structure-and-Algorithms
structure.cpp
#include <stdio.h> using namespace std; #include <bits/stdc++.h> typedef struct rectangle{ float length; float breath; }rectanngle; int main(){ //Declration rectangle rect1; rect1.length = 10.5; rect1.breath = 11.5; cout<<"Area of reactangle 1: "<<rect1.length*rect1.breath<<endl; //Decl...
TOOL
0.899196
3.483969
16bae9ba-6c15-485d-b21f-ef0c663c9284
maa040424/ChallengeNNN
Bantu_orang/Rahmad/tugas3/tugas3/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.997699
6.767714
475d0177-1079-4cac-ac5a-525517d7b372
Atlantis357/PhotoMosaicCreator
tests/tests_part1.cpp
#include <catch2/catch_test_macros.hpp> #include <algorithm> #include <iostream> #include <string> #include <vector> #include <cctype> #include <locale> #include "cs225/point.h" #include "kdtree.h" #include "tests_part1.h" // https://stackoverflow.com/a/217605 // trim from end (in place) static inline void rtrim(s...
TEST
0.935593
7.538652
3b64317f-1504-4f9f-bfbc-143647251c0d
ifradK/Competitive-Programming-Solutions
C++ Programs/New Years Number.cpp
#include<iostream> #include <bits/stdc++.h> #define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define endl '\n' using namespace std; bool solve1(long long n) { if(n<2020) { return false; } if(n%2021==0) { return true; } if(n%2020==0) { ...
ALGO
0.999925
4.365984
626598ea-9d50-45e9-acaf-e384f823cab9
nibrary/nibrary
src/dMRI/tractography/algorithms/ptt/algorithm_ptt_initialize.cpp
#include "../../tracker/tracker.h" #include "algorithm_ptt.h" #include "ptf.h" using namespace NIBR; Propagation_Decision TrackWith_PTT::initialize() { // Sample initial curve by rejection sampling int tries = 0; bool failed = false; float dataSupport = 0; // Initial max estimate posteriorMax = 0; ...
ALGO
0.999844
5.674906
e640b3b8-1f81-4837-9c61-55a88afe1666
ishandutta2007/codeforces
he_ren/normal/1453/B.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; const int MAXN = 2e5 + 5; int n; int a[MAXN]; inline int calc(int pos){ return pos == 1 || pos > n? 0: abs(a[pos] - a[pos-1]);} void solve(void) { scanf("%d",&n); for(int i=1; i<=n; ++i) scanf("%d",&a[i]); ll sum = 0; ...
ALGO
0.999925
4.172775
c6c39727-cb8f-425c-ae0f-b2108589e7eb
aphrim/codeforces-workspace
completed/1300/getting-zero.cpp
#include <bits/stdc++.h> #define int long long int //#define USACO using namespace std; template<typename T> istream& operator>>(istream& in, vector<T>& a) {for(auto &x : a) in >> x; return in;}; template<typename T> ostream& operator<<(ostream& out, vector<T>& a) {for(auto &x : a) out << x << ' '; return out;}; tem...
ALGO
0.999909
4.278571
c5f26852-3f8b-405d-86d2-01a764411ca4
yongkangSun/Games101
homework/1/code/eigen/eigen3/bench/vdw_new.cpp
#include <iostream> #include <Eigen/Core> using namespace Eigen; #ifndef SCALAR #define SCALAR float #endif #ifndef SIZE #define SIZE 10000 #endif #ifndef REPEAT #define REPEAT 10000 #endif typedef Matrix<SCALAR, Eigen::Dynamic, 1> Vec; using namespace std; SCALAR E_VDW(const Vec &interactions1, const Vec &inter...
ALGO
0.999726
3.519938
8ccfab11-2962-4b74-83eb-b3c6437aafbd
be39na/MP_2020
LabaMP_2/Utils.cpp
#include "stdafx.h" #include "Utils.h" namespace Utils { std::vector<std::string> Split(std::string str, char delimetr) { std::vector<std::string> tokens; std::string line; std::stringstream ss(str); while (std::getline(ss, line, ' ')) { tokens.push_back(line); } return tokens; } }
TOOL
0.933002
4.656906
5ff9d232-2fe6-484e-91e3-4db45e29c6c2
velu402/bio
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.99874
6.767714
4ba5862f-195b-4ea0-8037-e477d53b581a
ManyaMittal05/DSALeetCode
2411-spiral-matrix-iv/2411-spiral-matrix-iv.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: vector<vector<int>> s...
ALGO
0.999988
5.783346
19d49ced-5ff2-4057-899a-053dcc7b3333
sanchit-sinha/CP
Contests/Hackerrank/HACKERRANK-CODEFEST/C/test.cpp
#include "bits/stdc++.h" using namespace std; #define IOS {ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);} #define pb push_back #define ll unsigned long long #define ld long double #define all(c) (c).begin(),(c).end() #define sz(c) (int)(c.size()) #define mp make_pair #define mt make_tuple #define get(x,c) get<x>(...
ALGO
0.999988
3.860454
ddc002d4-491e-4257-9a29-407b49eb0f86
green-fox-academy/gabortrajtler
week-01/day-4/PrintEven/main.cpp
#include <iostream> int main() { // Create a program that prints all the even numbers between 0 and 500 // Solution: for now "between" is inclusive (incl. first and last num.). for (int i = 0; i < 501; ++i) { if (i % 2 == 0){ std::cout << i << " is even.\n"; } } retur...
ALGO
0.923544
3.337108
f8a50cc2-793a-4942-a8ba-f0ce1f308f60
tamhd0410/lear_flutter
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.998859
6.785645
6794ec97-040a-4d22-bb6f-a78cccc338c5
StackDoubleFlow/LLVMStackPU
libcxx/test/std/containers/associative/map/map.ops/count_transparent.pass.cpp
// UNSUPPORTED: c++03, c++11 // <map> // class map // template<typename K> // size_type count(const K& x) const; // C++14 #include <cassert> #include <map> #include <utility> #include "min_allocator.h" #include "private_constructor.h" #include "test_macros.h" struct Comp { using is_transparent = void; ...
TEST
0.893944
6.062565
26ba6ff8-c265-45a0-9552-2341d1c3034d
SI-FMI-2019/UP-2019
group5/2020.01.07_12_Struct_Recursion/Structures/main.cpp
#include <iostream> #include <math.h> using namespace std; struct University { char name[100]; char city[100]; int rank; }; struct Point { int x; int y; }; calculateDist( Point p1, Point p2) { } int main() { int a = 5; // University su; // cin>>su.name; // cin>>su.city; // cin>>su....
ALGO
0.999644
3.774728
da6b0c86-4511-491c-b9b0-251d10a8f451
liuawen/Play-Leetcode
0094-Binary-Tree-Inorder-Traversal/cpp-0094/main3.cpp
/// Source : https://leetcode.com/problems/binary-tree-inorder-traversal/ /// Author : liuyubobobo /// Time : 2017-05-30 #include <iostream> #include <vector> #include <stack> using namespace std; /// Definition for a binary tree node. struct TreeNode { int val; TreeNode *left; TreeNode *right; Tre...
ALGO
0.999999
6.710706
5c46fea7-05fc-441d-80cf-cc3f2435c427
DRCL-USC/Learning_MPC_Jumping
hw_exp/eigen-3.3.7/bench/benchVecAdd.cpp
#include <iostream> #include <Eigen/Core> #include <bench/BenchTimer.h> using namespace Eigen; #ifndef SIZE #define SIZE 50 #endif #ifndef REPEAT #define REPEAT 10000 #endif typedef float Scalar; __attribute__ ((noinline)) void benchVec(Scalar* a, Scalar* b, Scalar* c, int size); __attribute__ ((noinline)) void be...
TOOL
0.950365
5.111393
6bd954af-b1c8-40f1-896b-e8f077eac377
Shahir-Abdullah/competitive-programming
connect_ropes_with_minCost.cpp
#include <bits/stdc++.h> using namespace std; int solution(){ int n; cin>>n; vector<int> ropes(n); for(int i = 0; i < n; i++){ cin>>ropes[i]; } priority_queue<int, vector<int>, greater<int>> min_heap; for(int i = 0; i < n; i++){ min_heap.push(ropes[i]); } int cost = 0; while(min_heap.size() > 1){ i...
ALGO
0.999954
4.010266
7ae2f385-8290-4a06-b241-004cc130dada
rohitash18/Codsoft
guessing number.cpp
#include<iostream> using namespace std; int main() { int answer = 5; int guess; while(answer != guess){ cout << "enter your number:"; cin >> guess; if (guess < answer) { cout << "Too low!" << endl; } else if (guess > answer) { cout << "Too high!" << ...
TOOL
0.955771
3.208719
2f789f76-3bfd-4d95-8d88-066f0cf63181
atultechd/sde-sheet-challenge
sort_a_stack.cpp
void sort_stack(stack<int> &s, int num){ if(s.empty() || (!s.empty() && s.top() < num)){ s.push(num); return; } int n=s.top(); s.pop(); sort_stack(s,num); s.push(n); } void sortStack(stack<int> &s) { if(s.empty()) return; int num = s.top(); s.pop(); sortSta...
ALGO
0.999931
4.892827
cb095c40-7c0c-46f0-a31e-89638dacf1b5
sekheng/ProgGameEngine
AssignmentTwo/cocos2d/cocos/2d/CCAutoPolygon.cpp
#include "2d/CCAutoPolygon.h" #include "poly2tri/poly2tri.h" #include "base/CCDirector.h" #include "renderer/CCTextureCache.h" #include "clipper/clipper.hpp" #include <algorithm> #include <math.h> USING_NS_CC; static unsigned short quadIndices9[]={ 0+4*0,1+4*0,2+4*0, 3+4*0,2+4*0,1+4*0, 0+4*1,1+4*1,2+4*1, 3+4*...
ALGO
0.996286
4.411828
66411bc7-37ad-4619-b3a6-1ded8aa861ba
sachinkumar012/Placement2026
DSA/Problems/MaxDifff.cpp
#include <iostream> #include <string> #include <cstdlib> using namespace std; class Solution { public: int maxDiff(int num) { string s = to_string(num); string a = s, b = s; for (char &ch : a) { if (ch != '9') { char target = ch; for (char &c2 : ...
ALGO
0.998131
5.343522
21c7af47-113a-41a1-975d-c0aea228d8ab
rmallela0426/LeetCodeProblems
Medium/718-MaximumLengthOfRepeatedSubarray.cpp
/* * Author: Raghavendra Mallela */ /* * LeetCode 718: Maximum Length Of Repeated Subarray * * Given two integer arrays nums1 and nums2, return the maximum length of a subarray that * appears in both arrays. * * Example 1: * Input: nums1 = [1,2,3,2,1], nums2 = [3,2,1,4,7] * Output: 3 * Explanation: The repe...
ALGO
0.999905
6.904355
362af930-4c93-4474-87e6-6bd999b90c3a
ishandutta2007/codeforces
ce_wa_tle/normal/1303/B.cpp
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #includ...
ALGO
0.998608
3.212865
b90c3f24-385c-43e8-8853-86e7fe06a0ac
virtualsecureplatform/llvm-rv16k
openmp/runtime/src/kmp_barrier.cpp
/* * kmp_barrier.cpp */ #include "kmp.h" #include "kmp_wait_release.h" #include "kmp_itt.h" #include "kmp_os.h" #include "kmp_stats.h" #if OMPT_SUPPORT #include "ompt-specific.h" #endif #if KMP_MIC #include <immintrin.h> #define USE_NGO_STORES 1 #endif // KMP_MIC #include "tsan_annotations.h" #if KMP_MIC && USE_N...
TOOL
0.899381
5.337369
7c4da52b-d969-44a6-b274-7878674a3a39
nightsky87/Sub-image-Coding
source/SiCDec/SiCDecCU.cpp
#include "SiCDecCU.h" void SiCDecCU(s16 *img, u16 width, u16 height, paramStruct param) { // Create a buffer for the coding blocks (CB) and the sub-image coding blocks (SCB) const u16 cbNumPix = CU_SIZE * CU_SIZE; static s16 cbLuma[cbNumPix], cbResLuma[cbNumPix]; static s16 cbChroma1[cbNumPix], cbResChroma1[cbNum...
ALGO
0.976934
4.870326
810a1188-612d-4a09-b082-fcbd3426a0b6
algo-geek/Codes
Greedy/activity selection problem.cpp
// 1 #include <bits/stdc++.h> using namespace std; bool myCmp(pair <int, int> a, pair <int, int> b) { return (a.second < b.second); } int maxActivities(pair <int, int> arr[], int n) { sort(arr, arr + n, myCmp); int prev = 0; int res = 1; for(int curr = 1; curr < n; curr++) { if(arr[curr].first >= arr[pr...
ALGO
0.99998
5.181749
3eaee643-d1b0-4b12-b756-4fc617b33166
ilkoninn/CPP-Tasks
Test50.cpp
#include <iostream> #include <cmath> using namespace std; int main(){ int n, a, b, c; cin>>n; a = n / 100; b = n / 10 % 10; c = n % 10; int max, min, orta; max = min = orta = a; if(max < b) max = b; if(max < c) max = c; if(min > b) min = b; if(min > c) min = c; if(min < b && b < max) orta = b; if(...
ALGO
0.997645
3.700056
f4ea643e-a491-405d-8f56-eeafe4ed55fb
ishandutta2007/codeforces
jo_ulej/normal/1093/B.cpp
#include <bits/stdc++.h> #define INT_INF (2 * 1e9) #define LL_INF (2LL * 1e18) #define FAST_IO ios_base::sync_with_stdio(false); cin.tie(NULL); using namespace std; typedef long long int ll; typedef unsigned long long int ull; int main(int argc, char** argv) { int t; cin >> t; for(int i = 0; i < t; ++i) { ...
ALGO
0.999972
4.12299
3655b046-0ec6-41e5-8f75-f7607cf831c0
xiameng666/CR
数据结构_学生管理系统/二分查找版本/version_10.22/CMyString.cpp
#define _CRT_SECURE_NO_WARNINGS #include "CMyString.h" #include <cstring> #include <string> #include <algorithm> #include <cstdio> // ɾ customCompare ʵ CMyString::CMyString() : m_pData(new char[1]), m_nLength(0) { m_pData[0] = '\0'; } CMyString::CMyString(const char* pString) { if (pString) { m_nLeng...
TOOL
0.916859
4.075165
7a67ff3b-65d9-4f66-bf3f-87b3ffb1675b
ishandutta2007/codeforces
froggyzhang/normal/1404/C.cpp
#include<iostream> #include<cstdio> #include<cstring> using namespace std; #define N 300030 inline int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9'){ if(c=='-')f=-1; c=getchar(); } while(c>='0'&&c<='9'){ x=(x<<1)+(x<<3)+c-'0'; c=getchar(); } return x*f; } int n,Q,a[N],d[N]; namespace FHQ{ i...
ALGO
0.999973
3.807032
ee81c679-7efc-49a8-817e-f7fb4d70c45c
opencv/opencv_attic
opencv/samples/cpp/tutorial_code/ShapeDescriptors/moments_demo.cpp
/** * @function moments_demo.cpp * @brief Demo code to calculate moments * @author OpenCV team */ #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <iostream> #include <stdio.h> #include <stdlib.h> using namespace cv; using namespace std; Mat src; Mat src_gray; int thresh = 1...
ALGO
0.981945
7.307768
d0e170b8-256b-4c2f-83b3-6384890b1366
anishclw/CrackYourPlacement
Minimum Spanning Tree.cpp
class Solution { public: //Function to find sum of weights of edges of the Minimum Spanning Tree. int find(int x, vector<int>&par){ if(x==par[x]){ return x; } return par[x]=find(par[x], par); } void Union(int x, int y, vector<int>&par, vector<int>&rank){ int p...
ALGO
0.999967
5.365075
d1e61e80-3d55-4044-8739-3ec35fa37ea2
JosephJostar0/pat
乙级cpp/1034有理数四则运算.cpp
#include<iostream> #include<string> #include<stdio.h> #include<stdlib.h> using namespace std; int divisor(int a, int b) { int c = a % b; while (c) { a = b; b = c; c = a % b; } return b; } int multiple(int a, int b) { int c = divisor(a, b); return (a * b / c); } string sort1(int x1, int y1, bool ta) { in...
ALGO
0.999714
3.620136
e5f59be5-1540-499b-b04d-0299ca42d81d
aravind-jagadabi/Data-Structures-and-Algo
dynamic programming/Word Break problem.cpp
/*Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequence of one or more dictionary words. Note: The same word in the dictionary may be reused multiple times in the segmentation. You may assume the dictionary does not c...
ALGO
0.99956
6.124414
d6514dee-8356-4169-b892-2899d33b85bd
umbertoloria/icfl2sa_legacy
merge.cpp
#include "merge.h" unsigned long int tot_n_confronti=0,tot_n_confronti_evitati=0,tot_n_confronti_regola=0,tot_n_confronti_strcmp=0; unsigned long int tot_two_custom=0,tot_one_custom=0; int n_suffissi_clacolati_sinistra=0,n_suffissi_clacolati_destra=0; int custom_strcmp_skip=0; //0 -> x<y //1 -> y<x int custom_strc...
ALGO
0.999298
3.530987
35d7d659-8ffe-4e6b-9289-60e98f001e56
absuii/Competitive-Programming
practice/angrycows.cpp
#include <bits/stdc++.h> using namespace std; int simulate(vector<int>& cows, int r){ int ans = 1; int lastCow = 0; for(int i=0; i<cows.size(); i++){ if(cows[i] - cows[lastCow] > 2 * r){ ans++; lastCow = i; } } return ans; } int main() { freopen("angry.i...
ALGO
0.999984
4.417947
e3567ae8-b059-4dd7-ad1f-0f807bfc9dca
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_52_8.cpp
#include <bits/stdc++.h> using namespace std; string s; void kill() { cout << "Impossible"; exit(0); } int po = 1, ne = 0; void print(int a, int b) { cout << "Possible" << endl; char last = '+'; int target1 = 0, cnt1 = 0; int target2 = 0, cnt2 = 0; if (po) { target1 = a / po; cnt1 = a % po; } ...
ALGO
0.999966
3.412556
8bccecad-6e3a-496b-bff7-e31bbcacf761
Nakib-Arman/CSE318---ArtificialIntelligence
4.DecisionTree/.history/a_20250709225031.cpp
#include<bits/stdc++.h> using namespace std; class Node { int column_num; string label; unordered_map<string,Node*> children; float threshold; public: Node(int column_num){ this->column_num = column_num; this->label = ""; this->threshold = 0; } Node(string labe...
ALGO
0.984736
4.892568
b2fee83b-4589-44f6-92fe-5695324dbcdd
shashikantpawar21/DSA-practice
5-Recursion/Recursion-KunalSeries/1-Level1-Questions/1-PrintNto1.cpp
#include<iostream> using namespace std; void print(int n) { if(n==0) { cout << endl; return; } cout << n << " "; print(n-1); cout << n << " "; } int main(){ print(5); }
ALGO
0.999908
3.978249
f96dcc35-ad09-449d-8585-80034e3dda93
Malkankhulika/Praktikum-Struktur-Data-Assignment
Modul-9/guided2.cpp
#include <iostream> using namespace std; void functionB(int n); void functionA(int n) { if (n > 0) { cout << n << " "; functionB(n - 1); // Panggilan rekursif tidak langsung } } void functionB(int n) { if (n > 0) { cout << n << " "; functionA(n / 2); // Panggilan rekursif tid...
ALGO
0.999843
4.93001
0d6cb86b-db33-457f-ae9b-b2d0eb44ddfd
Petkub/toi-zero
A3_C++/A3-023.cpp
#include <bits/stdc++.h> using namespace std; const int MAX_N = 15005; bool is_prime[MAX_N]; vector <int> prime; int main() { cin.tie(nullptr)->sync_with_stdio(false); int A, B; cin >> A >> B; memset(is_prime, true, sizeof(is_prime)); for (int i = 2; i <= 15000; i++) { if (is_prime[i] =...
ALGO
0.999894
4.657242
490e2d6b-efc4-476d-a44b-6fcca51c3b77
vertoker/cpp-studyfield
library/1-cpp-primer/ch05/ex20.cpp
#include <iostream> #include <string> int main() { std::string lastWord, input; bool successful = false; while (std::cin >> input) { if (lastWord == input) { successful = true; break; } else { lastWord = input; } }...
ALGO
0.99889
5.239102
c786ed99-0ac4-4b8d-b51c-b1a39dc2005b
tausif39/Leetcode
Detect cycle in an undirected graph - GFG/detect-cycle-in-an-undirected-graph.cpp
// { Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: // Function to detect cycle in an undirected graph. // int N=1e5; bool dfs(int ver,vector<int> adj[],int par,bool vis[]) { vis[ver]=true; bool cycle=false; ...
ALGO
0.999969
6.058163
29f884d6-be24-491a-93a4-255f5a25222e
BlissRoms-Beta/platform_frameworks_av
media/libeffects/lvm/lib/Common/src/dB_to_Lin32.cpp
/************************************************************************/ /* */ /* %created_by: sra % (CM/S)*/ /* %name: dB_to_Lin32.c % (CM/S)*/ /* %version: 2 % (CM/S)*/ /* %date_created: Wed Jun 18 11:27:46 2008 ...
ALGO
0.909448
6.199811
a9efe40c-735b-4e5e-957e-6e223eba1c3e
swapnilsparsh/100DaysOfCode
Day05/02_PrimeNumber.cpp
#include<iostream> #include<math.h> using namespace std; bool prime(int num){ for (int i = 2; i<=num; i++){ if (num%2 == 0){ return false; } } return true; } int main(){ int a,b; cout<<"Enter two numbers: "; cin>>a>>b; for (int i=a;i<= b;i++){ if(prime(i)){ cout<<i<<endl; } ...
ALGO
0.999593
3.932652
a6e0266f-24ef-4cff-b051-94bf4390a791
xyliuke/boost_ios_mac
boost-ios/src/boost_1_55_0/libs/intrusive/example/doc_slist_algorithms.cpp
struct my_node { my_node *next_; //other members... }; //Define our own slist_node_traits struct my_slist_node_traits { typedef my_node node; typedef my_node * node_ptr; typedef const my_node * const_node_ptr; stati...
TOOL
0.958186
6.206973
1c5048a2-f675-4b5e-8c15-aecf92c42613
875325155/Start_Leetcode_caishunzhe
Leetcode/844. 比较含退格的字符串.cpp
//ջ #include<stack> #include<string> #include<iostream> using namespace std; bool backspaceCompare(string S, string T) { stack<char> s,t; for(int i=0;i<S.size();i++) { if(S[i]=='#') { if(s.empty()) s.pop(); } else s.push(S[i]); } ...
ALGO
0.999439
3.781885
fc47e4d4-8532-455f-9b6c-9915be66c843
joonyle99/Algorithm
Solved.ac/Solved.ac/11866_Josephus.cpp
#include <iostream> #include <queue> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; int K; cin >> K; // 似Ǫ // (N, K) - 似Ǫ queue<int> queue; // ʱȭ for (int i = 0; i < N; ++i) queue.push(i + 1); cout << "<"; while (!queue.empty()) { for (int i = ...
ALGO
0.999928
3.920725
cf633e0e-7b01-4a68-bab6-52c7d529211a
JorgeDaray/SEDA
comprobaciones/Ejercicio3.cpp
#include <iostream> using namespace std; //Funcion paso por valor void multiplicacion(int numero1, int numero2){ numero1 = numero1 * numero2; cout << "\n multiplicacion :"<<numero1<<endl; } //Funcion paso por referencia void multiplicacion(int *n, int &n2){ *n = *n * n2; cout << "Resultado : "<<*n<<endl...
TOOL
0.945478
3.861553
7fceec7b-d11f-4fbb-bc70-ae6b5b5cda66
ToshikiShimizu/AtCoder
ABC/087/c.cpp
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define ALL(a) (a).begin(),(a).end() #define SUM(a) accumulate((a).begin(),(a).end(),0) #define SORT(a) sort(ALL(a)) #define REV(a) reverse(ALL(a)) #define dump(x) cerr << #x << " = " << (x) << endl...
ALGO
0.999986
3.565485
658ec1de-9b53-4a85-a7aa-b214066f5586
KtlTheBest/mylisp
lexing/partition.cpp
// Code written by Hans de Nivelle, May 2021. #include "partition.h" #include <algorithm> void lexing::partition::refine( const stateset& filter, std::stack< size_t > & unchecked ) { for( state s : filter ) { stateset& overlap = eqclass[ index[ s. nr ]]; // The ...
ALGO
0.989592
6.105228
560b6e2f-dd70-4662-b261-a312c2013059
NullAwe/competitive-programming
codeforces/combined/Global Round 16/BudsReHanging.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int getNumLeaves(vector<vector<int>>& adj, int node, int parent) { int l = 0; bool did = false; for (int next : adj[node]) { if (next == parent) continue; did = true; l += getNumLeaves(adj, next, node); } if (!did) return 1; re...
ALGO
0.99982
5.597584
ca7f4bee-c16f-482c-91d5-0a9a0c75e76c
DengKaiCQ/VGGT-Long
thirdparty/eigen-3.4.0/lapack/cholesky.cpp
#include "lapack_common.h" #include <Eigen/Cholesky> // POTRF computes the Cholesky factorization of a real symmetric positive definite matrix A. EIGEN_LAPACK_FUNC(potrf,(char* uplo, int *n, RealScalar *pa, int *lda, int *info)) { *info = 0; if(UPLO(*uplo)==INVALID) *info = -1; else if(*n<0) ...
ALGO
0.998871
6.009887
e467cf7c-5db6-4a48-b8a3-88669761ab24
aslamovamir/CppProgramsFromDataStructuresTextbook
C-1.1.cpp
#include <iostream> void reverse(int array[], int size) { int reversed [size]; int i, j; for (i = size - 1, j = 0; i >= 0 && j < size; i--, j++) { reversed[j] = array[i]; } std::cout<<"\nHere is the reversed array: "; for (i = 0; i < size; i++) { std::cout<<reversed[i] << " "...
ALGO
0.991255
4.817677
c1dd27a6-58bb-4d32-ad69-5153e5282ab9
ChestnutFu/PAT-
1003. Emergency.cpp
#include<iostream> #include<stdio.h> #include<vector> #define inf 0x6FFFFFF using namespace std; int N;//节点/城市 int M;//边/路 int C1, C2; int map[501][501]; int teams[501]; int findmin(vector<bool>&collected,vector<int>&dist) { int min, mindis = inf; for (int i = 0; i < N; i++) { if (collected[i] == false && dist[i] ...
ALGO
0.999924
3.644363
32c00ecf-d322-4ab7-9d9b-ae09085a7f69
manikanta2901/CCC
.history/Day 2/Practice/Answers/StringConcatenation_20210305191218.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int p; string word; cin >> p >> word; map return 0; }
ALGO
0.999458
3.55092
0c459592-7949-4869-bc79-125870491079
stillbreeze/Online-Stereo-Calibration
gtsam/3rdparty/Eigen/unsupported/doc/examples/MatrixLogarithm.cpp
#include <unsupported/Eigen/MatrixFunctions> #include <iostream> using namespace Eigen; int main() { using std::sqrt; MatrixXd A(3,3); A << 0.5*sqrt(2), -0.5*sqrt(2), 0, 0.5*sqrt(2), 0.5*sqrt(2), 0, 0, 0, 1; std::cout << "The matrix A is:\n" << A << "\n\n"; std::cout << "...
ALGO
0.99934
3.595733
e8ebd101-0140-49e0-bafc-7d5cc6de1d28
16akash/practice-codes
c++cource/bitMnpltionQ2.cpp
#include<iostream> using namespace std; int unique(int arr[],int n){ int xorsum=0; for(int i=0;i<n;i++){ xorsum=xorsum^arr[i]; } return xorsum; } int main(){ int arr[7]={1,2,3,4,1,2,3}; cout<<unique(arr,7)<<endl; ...
ALGO
0.999938
4.670879
0069b796-6920-4d5c-a706-42b8f8f5f5b1
strange-tiger/Baekjoon_practice
_2024_BOJ_Practice/1417_GeneralElection.cpp
#include <iostream> #include <queue> using namespace std; int N, dasom, temp; int cnt = 0; priority_queue<int> candidate; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> N; cin >> dasom; while(--N) { cin >> temp; candidate.push(temp); } while (!candidate.empty() && ...
ALGO
0.999818
3.489101
cc98a5bc-2cd3-46b8-a212-ad23c0debe57
huongtrannguyen1994/huongtn
DominoAndTrominoTiling.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int D[n+1]; int T[n+1]; int modu = 1e9 + 7; D[0] = 0; D[1] = 1; D[2] = 2; T[0] = 0; T[1] = 0; T[2] = 1; for(int i=3; i <= n; ++i) { D[i] = ((D[i-1] + D[i-2]) % modu + (2 * T[i-1]) % modu) % modu; ...
ALGO
0.999992
4.789964
ef2019e0-ce0c-4cba-9269-fe46ea0f1a02
Asmit-Mohan/Data-Structure-Algorithms
Binary Search Tree/Convert sorted list to bst.cpp
/* Approach 1 Time :- O(N) Space :- O(N) */ class Solution { public: TreeNode* sortedListToBST(ListNode* head) { if(head==NULL) { return NULL; } if(head->next==NULL) { return new TreeNode(head->val); } ListNode *slow = head; ...
ALGO
0.999999
6.279976
5d3ad889-3636-4e84-b131-36c43bb0e06a
arafat-yasin-2413/PHITRON-B5
CP_Problems/637B.cpp
#include <bits/stdc++.h> using namespace std; #define nl "\n" // https://codeforces.com/problemset/problem/637/B int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin>>n; stack<string> st; for(int i=1;i<=n;i++) { string s; cin>>s; st.push(s); ...
ALGO
0.999913
4.486907
d332fd5b-fdae-4726-957e-3a79d33ef59b
brendandagys/CPP-drills
chapter-7/calculator.cpp
#include<iostream> #include<string> #include<vector> #include<algorithm> #include<cmath> using namespace std; const char number = '8'; const char quit = 'Q'; const char print = ';'; const string prompt = "> "; const string result = "= "; const char name = 'a'; const char let = 'L'; const string declkey = "let"; const...
TOOL
0.978707
3.951221
f14d8619-eedb-4285-a3fe-3cf5044a43de
BarDavid2394/Projects
Leetcode Questions/0225-implement-stack-using-queues/0225-implement-stack-using-queues.cpp
class MyStack { public: queue<int> q1; queue<int> q2; MyStack() { } void push(int x) { if(q1.empty()){ q1.push(x); while(!q2.empty()){ q1.push(q2.front()); q2.pop(); } } else{ q2.pus...
ALGO
0.999567
5.480974