uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
6ec38bbe-adc1-4b7b-b02d-81494fd9647b
copper424/2023DSA
src/2084031 16-1 Dijkstra's Shortest Path Algorithm/Latest Submission/shortest_path.cpp
#include<iostream> #include<queue> #include<vector> using namespace std; struct Node{ int v,w; }; struct State{ int v,dis; }; bool operator<(const State lhs,const State other){ return lhs.dis > other.dis; } int main(){ int testcase; cin >> testcase; while(testcase--){ int n,m; cin >> n ...
ALGO
0.999968
3.758634
598bbd3d-02f0-4b0d-acce-86936e832944
ahmedredaooooo/Problem-Solutions
CodeForces/1335C/44350057_AC_46ms_3140kB.cpp
/* لَا إلَهَ إلاَّ اللَّهُ مُحَمَّدٌ رَسُولُ اللَّهِ */ #include <bits/stdc++.h> using namespace std; #define un unsigned #define ld long double #define LL long long #define int LL #define allc(x) x.begin(), x.end() #d...
ALGO
0.999961
4.687802
cfffa060-1d31-4270-bdb9-dad42d12fdec
yuta0428/abc-practice
143/c/c.cpp
#include <bits/stdc++.h> using namespace std; #define repeat(i, n) for (int i = 0; (i) < (n); ++(i)) int main() { int N; cin >> N; char s = '0'; int ans = 0; repeat(i, N) { char ss; cin >> ss; if (s != ss) { s = ss; ans++; } } cout <<...
ALGO
0.999862
3.527331
f323e6dc-d779-43a0-a7d7-88c1c211babc
Vineetmorankar/GFG
Difficulty: Medium/Merge two BST 's/merge-two-bst-s.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; #define MAX_HEIGHT 100000 // Tree Node struct Node { int data; Node* left; Node* right; Node(int val) { data = val; left = right = NULL; } }; // Function to Build Tree Node* buildTree(string str) { // Corner ...
ALGO
0.999885
6.379856
758ba402-4aa9-4f9c-b8ca-5f193f5ff939
PhillipDiCarlo/The-Corruptor
ASRC Systems Simulation Driver/boost_1_74_0/libs/contract/example/features/assertion_level.cpp
#include <boost/contract.hpp> #include <vector> #include <algorithm> #include <iostream> #include <cassert> //[assertion_level_no_impl // If valid iterator range (cannot implement in C++ but OK to use in AXIOM). template<typename Iter> bool valid(Iter first, Iter last); // Only declared, not actually defined. //] //[...
TEST
0.997838
6.488847
3a2ee9cb-3d2b-46c6-8ab7-d32a11caeb8c
Re-bro/Algorithm-PS
BOJ/Graph/Minimum Spanning Tree/[BOJ 4792] 레드 블루 스패닝 트리.cpp
/* [BOJ 4792] д Ʈ Algorithm : Minimum Spanning Tree Ķ ġ ٸ ξ, Ķ ּҷ ԵǴ д Ʈ ִ ԵǴ дƮ Ѵ. k дƮ Ķ ̿ Ȯ k ϴ.  д Ʈ ٸ дƮ Ķ +1, -1, 0 ȭ ϱ ̴. */ #include<bits/stdc++.h> #define all(v) v.begin(), v.end() #define ini(x, y) memset(x, y, sizeof(x)); using namespace std; int P[1001]; int find(int a) { return ...
ALGO
0.999897
3.984107
0fb1e176-5c1a-4375-8f2f-89fbf1bbade8
NorbertSzydlik/WebForge
lib/boost_1_60_0/libs/graph/example/tiernan_print_cycles.cpp
//[tiernan_print_cycles #include <iostream> #include <boost/graph/directed_graph.hpp> #include <boost/graph/tiernan_all_cycles.hpp> #include "helper.hpp" using namespace std; using namespace boost; // The cycle_printer is a visitor that will print the path that comprises // the cycle. Note that the back() vertex of...
ALGO
0.99918
6.558753
dd3f6940-c431-42e2-98ab-266eee42f0bb
conrisc/AiSD
Zadanie_A/main_12.03.2017_14:53.cpp
#include <cstdio> #include <vector> using namespace std; int main () { int n,m,cities = 0,id=1; bool isNew,isVisited; vector <int> ids; scanf("%d %d",&n,&m); char line[m+1]; int *pointer[m]; for (int i=0;i<m;i++) pointer[i] = NULL; for (int i=0;i<n;i++) { fgets (line, 2, stdin); //reads new li...
ALGO
0.999806
4.095255
7d209447-d8d5-4851-a5b5-ab7934c1baff
nishiinoya/laboratory-works
sem2/fp/lab4_fp/task5/main.cpp
#include "Functions_arr.h" #include <iostream> using namespace std; int main() { int intArr[] = {1, 2, 3, 4, 5}; int intSize = sizeof(intArr) / sizeof(intArr[0]); cout << "Original integer array: "; for (int i = 0; i < intSize; ++i) { cout << intArr[i] << " "; } cout << endl; swa...
TOOL
0.915918
5.884071
13e684f4-ca49-43e8-bcb5-7cce49ab3ad4
imlawcs/Mathematics-for-computer-science
eigen-3.4.0/eigen-3.4.0/doc/examples/make_circulant2.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; // [circulant_func] template<class ArgType> class circulant_functor { const ArgType &m_vec; public: circulant_functor(const ArgType& arg) : m_vec(arg) {} const typename ArgType::Scalar& operator() (Index row, Index col) const { Index index = ...
ALGO
0.998944
5.569832
7b4df637-07b6-4c85-9b17-d8eafbff37c9
KatLab-MiyazakiUniv/etrobocon2021
module/Motion/StraightRunner.cpp
/** * @file StraightRunner.cpp * @brief 直進クラス * @author hiroto0927, miyashita64 */ #include "StraightRunner.h" StraightRunner::StraightRunner() {} // 設定された距離を直進する void StraightRunner::runStraightToDistance(double targetDistance, int pwm) { // 直進前の走行距離 int initialRightMotorCount = measurer.getRightCount(); ...
TOOL
0.975224
5.533395
88625cab-aaa4-4081-ae80-d77e4fe102d9
dylanneve1/PixelPlus-Magisk
zygisk/module/jni/libcxx/test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp
// <algorithm> // template<InputIterator InIter1, InputIterator InIter2, typename OutIter, // Predicate<auto, InIter2::value_type, InIter1::value_type> Compare> // requires OutputIterator<OutIter, InIter1::reference> // && OutputIterator<OutIter, InIter2::reference> // && CopyConstructible<C...
TEST
0.99836
6.725595
aca7c02e-136d-43e0-baf9-7021105c8ad6
shashwata2003/DSA
3.DSA450/DSA Striver/Array/PowerFunction.cpp
#include<iostream> #include <bits/stdc++.h> #include <array> using namespace std; /* Implement pow(x, n), which calculates x raised to the power n (i.e., xn). Example 1: Input: x = 2.00000, n = 10 Output: 1024.00000 Example 2: Input: x = 2.10000, n = 3 Output: 9.26100 Example 3: Input: x = 2.00000, n = -2 Output: ...
ALGO
0.999765
5.859417
b9c29d90-30fd-4a30-ba17-c3844a6fd429
JJJIEYYDS/-
daimaqu/nk/hn 4/L.cpp
#include<iostream> #include<cstring> #include<algorithm> #include<iomanip> #include<vector> #include<map> #include<queue> #include<set> #include<cmath> using namespace std; typedef pair<int,int> PII; typedef pair<long long,long long> PLL; typedef long long ll; const int N=1e5+10,INF=0x3f3f3f3f,mod=998244353; int n,m...
ALGO
0.99934
4.49102
8ed7147f-cbc5-4571-95cd-b86595b26112
sheshanathkumar/coding
CountValid.cpp
#include <bits/stdc++.h> using namespace std; int validString(string expr){ stack <int> s; int count= 0; for (int i=0; i<expr.size(); i++){ if(expr[i] == '(') s.push(expr[i]); else if(expr[i] == ')'){ if(!s.empty() && s.top() == '('){ count+=2; s....
ALGO
0.992635
4.668142
ed8b7eeb-e67c-42c0-a662-5aa6a772c2cf
juneharold/USACO
usaco_practice/bronze/bronze_A/A5_complete_search/scavenger_hunt.cpp
// scavenger hunt #include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int p, q; cin >> p >> q; int p_array[6000]={}, q_array[6001]={}; // finding the factors for (int i=1; i<6000; i++) { if (p%i==0) { p_array[i] = 1; ...
ALGO
0.999847
3.538132
c15edca5-2d64-4c43-b00f-5c05f5ffd83c
fragofer/reconbench
pbrt/src/lights/distant.cpp
// lights/distant.cpp* #include "stdafx.h" #include "lights/distant.h" #include "paramset.h" #include "montecarlo.h" // DistantLight Method Definitions DistantLight::DistantLight(const Transform &light2world, const Spectrum &radiance, const Vector &dir) : Light(light2world) { lightDir = Normalize(Light...
TOOL
0.86581
5.541554
122ad333-06f3-4027-b5c2-75930efd3d93
arunkumar203/dsa
dsa/graph/floyd_warshall.cpp
#include<bits/stdc++.h> using namespace std; class Solution { public: void shortest_distance(vector<vector<int>>&matrix){ // Code here int n=matrix.size(); for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(matrix[i][j]==-1){ matrix[i][j]=1e8; } ...
ALGO
0.999991
4.750389
7a48ebc5-8a67-4f58-b781-203b7b52448c
ShikoMDS/Shiko-Sort
ShikoInventory/src/Inventory.cpp
#include <wx/wx.h> #include <wx/textfile.h> #include "Inventory.h" Inventory::Node::Node(const Item& NewItem, Node* NextItem, Node* PrevItem) { Data = NewItem; Previous = PrevItem; Next = NextItem; } Inventory::Inventory() { MHead = nullptr; MTail = nullptr; MSize = 0; } Inventory::~Inventory() { // Destructo...
TOOL
0.93223
5.433718
98927572-2121-48b6-ac78-069c93d79619
SAliulov/BoAaP
Лаба24/Лаба 24.cpp
// Лаба 24.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы. // #include <iostream> #include <Windows.h> #include <stdio.h> long factorial(int n) { if (n == 0) { return 1; } long res = factorial(n - 1) * n; return res; } void rec1(int n) { pri...
ALGO
0.999415
4.120752
6af13194-aae0-49de-9747-4905c9bcf081
algorithm006-class02/algorithm006-class02
Week_01/G20200343030614/LeetCode_88_614.cpp
//用nums1创建一个临时数组,和nums2一个个元素比较,有序插入到nums1 class Solution { public: void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) { int i=0,j=0,k=0; vector<int> tmp(nums1.begin(),nums1.begin()+m); while (i<m&&j<n) { nums1[k++] = tmp[i]<nums2[j] ? tmp[i++] : nums2[j++]; ...
ALGO
0.999984
5.448599
9bb09cb2-6ba0-4c29-ba25-1cc7c9f6e8a0
dotAlgorithm/algorithm
boj/bronze/수학/2480 (주사위 세개).cpp
#include <bits/stdc++.h> #define max(a,b) (((a)>(b))?(a):(b)) using namespace std; int dice(int a, int b, int c){ if(a==b && b==c) return 10000+(a*1000); if(a==b || a==c) return 1000+(a*100); if(b==c) return 1000+(b*100); return max(a,max(b,c))*100; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int...
ALGO
0.999465
4.301967
be0512f0-85ec-494b-80fc-058318ecb37d
ALATTIELI/drivehabit
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.998762
6.786404
b478d355-1f6f-4bf0-b8c9-849de7145605
kirit93/GRU
train.cpp
#include <sys/stat.h> #include <unistd.h> #include <iostream> #include <cstdlib> #include <ctime> #include <climits> #include <cmath> #include <math.h> #include <Eigen/Dense> #include <vector> #include <fstream> using namespace Eigen; void write_binary_matrix(std::string filename, const MatrixXf& matrix){ std::of...
ALGO
0.998743
4.328729
a19598cf-0d79-41f3-93c6-a4f9d797b65c
kyle355469/TOI-class
練習賽/2020-10-Knight.cpp
#include <iostream> #include <queue> #include <iomanip> int chess[1000][1000]; int edx, edy; int dx[8] = {1, 1, 2, 2, -1, -1, -2, -2}; int dy[8] = {2, -2, 1, -1, 2, -2, 1, -1}; struct point{ int x; int y; } p; using namespace std; int main(){ int n, m, stx, sty; cin >> n >> m >> stx >> sty >> edx >> ed...
ALGO
0.999959
4.303311
a0c1a412-0f38-47a3-86a5-d067e07cccac
tdubourg/filezilla-encrypted
filezilla/src/engine/directorylistingparser.cpp
#include <filezilla.h> #include "directorylistingparser.h" #include "ControlSocket.h" #ifdef _DEBUG #define new DEBUG_NEW #endif std::map<wxString, int> CDirectoryListingParser::m_MonthNamesMap; //#define LISTDEBUG_MVS //#define LISTDEBUG #ifdef LISTDEBUG static char data[][150]={ "" // Has to be terminated with em...
TOOL
0.958204
4.186297
0757f70c-3a73-42fb-800b-f34fe744cf54
anshul45-github/Leet-GFG-360
Solve Problems on Arrays [Easy, Medium, Hard]/Zero_Array_Transformation_I.cpp
// https://leetcode.com/problems/zero-array-transformation-i/ // 3355. Zero Array Transformation I // Medium #include<vector> using namespace std; class Solution { public: bool isZeroArray(vector<int>& nums, vector<vector<int>>& queries) { vector<int> prefix(nums.size() + 1, 0); for(int i = 0; i <...
ALGO
0.999848
6.212773
02538ff9-b30b-4e99-a4bd-aa7d770147bf
Sumelt/Daily-Coding
剑指Office/面试题49_最长不含重复字符的子字符串.cpp
/*---------------------------------------------------------------- * @Author: Su * @Description: * @Creath Date: ----------------------------------------------------------------*/ #include <iostream> #include <string> #include <vector> #include <map> using namespace std; class Solution{ private: int maxLength...
ALGO
0.999729
4.150887
3a090073-ce83-4548-a2cb-46e03a72c152
guptasonu14/DSA-IN-Cpp
Phase-1/PatternQues/7Pattern.cpp
#include<iostream> #include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int i=1; while (i<=n) { int j=1; while (j<=n) { cout<<"*"; j=j+1; } cout<<endl; i=i+1; } return 0; }
ALGO
0.999926
3.661268
2d1b653a-d243-49a6-8ed3-b3e287174b37
jshristi22/CrackMyPlacement
Arrays/permutation_in_array.cpp
#include<bits/stdc++.h> // solved on gfg // https://www.geeksforgeeks.org/problems/permutations-in-array1747/1 bool isPossible(long long a[], long long b[], int n, long long k) { int mark[n] = {0}; // for(int i = 0; i<n;i++){ // for(int j = 0; j<n; j++){ // if(a[i] + b[j] >= k){ // ...
ALGO
0.999945
4.88384
0aed3cc3-6bf1-4a66-b41b-9f0c1e16c49b
Kumilesh/Coding
markthephoto.cpp
//Balayya Forever #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<int> vi; #define M 1000000007 //#define for(u,i,j) for(int u=i;u<j;u++) #define print(x) cout << x #define prints(x) cout << x << " " #define println(x) cout << x << "...
ALGO
0.999955
3.935596
05b982e5-18c6-4588-bc89-073841df3c9a
shahidul-brur/OnlineJudge-Solution
Codeforces/1132_A - Regular Bracket Sequence.cpp
/*==============================================*\ ID: shahidul_brur Name: Md. Shahidul Islam Study: CSE, BRUR Address: Rangpur, Bangladesh mail: <EMAIL> FB : fb.com/shahidul.brur Blog: shahidul-brur.blogspot.com(in Bengali), shahidul-brur-en.blogspot.com(in English) \*==================...
ALGO
0.999496
3.441524
f0318bcd-3791-4295-a6a4-2ba42c46f5c2
Johniel/contests
codeforces/843div2/A/main.cpp
// github.com/Johniel/contests // codeforces/843div2/A/main.cpp #include <bits/stdc++.h> #define each(i, c) for (auto& i : c) #define unless(cond) if (!(cond)) // #define endl "\n" using namespace std; template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," <<...
ALGO
0.999847
4.696904
f70d3ccf-5e0a-46ad-8c13-fda16b2b3938
instr3/BZOJ-solution-legacy
A1862/1862GameZ游戏排名系统RE.cpp
#include <iostream> #include <cstdlib> #include <cstdio> #include <cstring> //#include <cmath> #include <algorithm> using namespace std; #define each(i,n) (int i=1;i<=(n);++i) #define every(i,a,b) (int i=(a);i<=(b);++i) struct lnode{char word[12];int mk,w;int next;}myl[300001];int pmyl=0; struct hnode{int first;}myh[30...
ALGO
0.999974
3.501884
73c680af-27d3-4c13-9aa6-701ac07b7f55
Leapense/problems
9232번: Crossword Puzzle Clue Numbering/Crossword Puzzle Clue Numbering.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int r, c; int puzzleNumber = 1; bool firstPuzzle = true; while (true) { cin >> r >> c; if (!cin || (r == 0 && c == 0)) break; vector<string> grid(r); for (i...
ALGO
0.996862
3.877875
24401175-0003-428b-9af6-1b97c0600db8
jardianoalmeida/exemple_share_preferences
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998693
6.797273
b61ad41e-e1c2-4515-8b7d-3e6de4e747f5
JuHyeon-Lee/BOJ
1000-9999/9020.cpp
#include <iostream> using namespace std; #define MAX 10001 bool prime[MAX]; void initPrime(){ prime[1] = true; for(int i=2; i<MAX; i++){ if(prime[i]) continue; int num = i + i; while(num<MAX){ prime[num] = true; num += i; } } } int main(){ initPrime(); int T; scanf("%d", &T); while(T--){ ...
ALGO
0.999856
3.9271
940aa73d-60df-4d3d-9953-969a76da7760
jovinlidan/competitive-programming
CodeForces/GNU C++17/1191A | Tokitsukaze and Enhancement/65233056.cpp
#include <bits/stdc++.h> using namespace std; int main() { int hp; cin >> hp; if (hp % 4 == 0) cout << 1 << " A"; else if (hp % 4 == 2) cout << 1 << " B"; else if (hp % 4 == 3) cout << 2 << " A"; else if (hp % 4 == 1) cout << 0 << " A"; cout << endl; }
ALGO
0.999819
3.653279
85b48bab-2f46-449b-81a9-3c9529a2618b
VivekKumarMishra1301/competative-coding
check3.cpp
#include <iostream> #include <math.h> using namespace std; int main() { int n; cin >> n; int ans = 0; int i = 0; while (n != 0) { int lastdigit = n & 1; // cout << lastdigit << endl; ans = (lastdigit * pow(10, i)) + ans; // this is for reverse the bit and store it into an...
ALGO
0.999991
4.381597
13cdf8e9-2c3b-424e-971a-be02b754f935
mukuldeep/cs
cp/CodeForces/cdfr_1454D.cpp
// // Created by me on 21-07-2021. // #include <bits/stdc++.h> #define SYNC ios_base::sync_with_stdio(false); cin.tie(nullptr); #define DRIVER int main(){SYNC ll t=1;I_ t;W_(t)soln(t);return 0;} #define TEST_DRIVER int cc_main(){SYNC ll t=1;I_ t;W_(t)soln(t);return 0;} #define FR_(a,c) for (ll (a)=0;(a)<(c); (a)++) #...
ALGO
0.999733
4.11504
5d3b9e96-d327-4d15-96f4-b4bd06c2bcf2
Madiyar09/Algos
Strings/Trie.cpp
/**************************************************************************** Trie. Builds tree from the set of strings. O(total length of strings) This code counts number of different substrings in the string. Based on problem B from here: http://codeforces.ru/gym/100133 ******************************...
ALGO
0.999971
3.960695
414b1532-90de-4705-89fa-c4a00f7f796b
ishandutta2007/codeforces
amnesiac_dusk/normal/932/F.cpp
#pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,fma,abm,mmx,avx,avx2,tune=native") #include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #ifdef rd #d...
ALGO
0.999986
4.420651
8bc2cc44-f568-42e2-b301-3fadb4687304
wyrover/book-code
stl_examples/ex11-01.cpp
// Illustrating the use of an adaptor for pointers to functions. #include <set.h> #include <bstring.h> bool less1(const string& x, const string& y) { return x < y; } bool greater1(const string& x, const string& y) { return x > y; } int main() { typedef set<string, pointer_to_binary_function<const...
TOOL
0.936762
5.696294
e569a052-8b69-404a-b604-87b6f9fffb45
Med16-11/365daysOfCode
DSA_Problems/TOP50interviewQuestions/Matrix/Rotate Image.cpp
void rotate(vector<vector<int>>& matrix) { int n = matrix.size(); for(int i = 0; i < n-1; i++){ for(int j = i+1; j < n; j++){ swap(matrix[i][j], matrix[j][i]); } } for(int i = 0; i < n; i++){ reverse(matrix[i].begin(), matrix[i].end());...
ALGO
0.999955
5.865716
f527a51d-bd62-4320-8da5-83523df0a3e4
TheMartian0x48/CP
UVa/volume-011/1197.cpp
// author: the__martian // 1197 #include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for(int i = a; i < (b); ++i) #define per(i, a, b) for(int i = a; i >= (b); --i) #define trav(a, x) for(auto &a : x) #define all(x) x.begin(), x.end() #define sz(x) (int)x.size() using ll = long long; using pii = pair<int...
ALGO
0.999818
4.32184
57a185db-4831-4f7c-86d6-de114f4298ba
Khellendroscn/MyLinkedList
MyLinkedList/TestLinkedList.cpp
#include"LinkedList.h" #include"LinkedListIterator.h" #include"Stack.h" #include<algorithm> using namespace std; using namespace Khellendros; void testInit() { cout << "Test LinkedList(initialize)" << endl; cout << "ĬϹ죺" << endl; LinkedList<int> list1; cout << "pushBack():" << endl; list1 << 1 << 2 << 3; cout << ...
TEST
0.947869
4.211781
b3c6f1e4-919b-41bd-97d1-d22d77de54c0
jfemon8/XPSC
Week-8/Day-6/B_Bash_s_Big_Day.cpp
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, mx = 0; cin >> n; vector<int> mp(100005); for (int i = 0; i < n; i++) { int x; cin >> x; mp[x]++; mx = max(mx, x); } ...
ALGO
0.999905
3.968771
33e68568-90d0-4d42-99d3-75bd13d2198e
SpatikaP/DSA-solutions
0413-arithmetic-slices/0413-arithmetic-slices.cpp
class Solution { public: int numberOfArithmeticSlices(vector<int>& nums) { if(nums.size() <= 2)return 0; int count = 0, ans = 0; for(int i = 0; i < nums.size() - 2; i++){ if(nums[i+1] - nums[i] == nums[i+2] - nums[i+1]){ count++; } else{ ...
ALGO
0.999724
6.275443
e2b786d0-b477-4796-b513-40b9500fec7f
nishant2147/Helix-Egg-Up-Game
Library/PackageCache/com.unity.ide.visualstudio@2.0.22/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp
#include <iostream> #include <sstream> #include <string> #include <filesystem> #include <windows.h> #include <shlwapi.h> #include <fcntl.h> #include <io.h> #include "BStrHolder.h" #include "ComPtr.h" #include "dte80a.tlh" constexpr int RETRY_INTERVAL_MS = 150; constexpr int TIMEOUT_MS = 10000; // Often a DTE call m...
TOOL
0.94689
6.933211
e5ff2d67-f7c3-4693-a09f-1ea57e26a246
9Tempest/llvm-hacked
libcxxabi/src/fallback_malloc.cpp
#include "fallback_malloc.h" #include <__threading_support> #ifndef _LIBCXXABI_HAS_NO_THREADS #if defined(__ELF__) && defined(_LIBCXXABI_LINK_PTHREAD_LIB) #pragma comment(lib, "pthread") #endif #endif #include <__memory/aligned_alloc.h> #include <assert.h> #include <stdlib.h> // for malloc, calloc, free #include <str...
TOOL
0.920573
7.641335
263715c9-c7fa-4ae6-9607-586f8faef0f6
PoomNattapoom/lab18
lab18_3.cpp
#include<iostream> #include<cstdlib> #include<ctime> #include<vector> using namespace std; vector<int> randomVector(int); void showVector(vector<int>); int dotProduct(vector<int>,vector<int>); int main(){ srand(time(0)); vector<int> x = randomVector(5); vector<int> y = randomVector(5); int z = dotProduct(x,y); s...
ALGO
0.975959
3.90572
85f644f1-95f4-4692-943f-bc151269dbf6
shivu47/100codes
armstrong2.cpp
#include<bits/stdc++.h> using namespace std; int countdigit(int n){ int count=0; while(n!=0){ n=n/10; count++; } return count; } int calculateSum (int n, int count){ int sum=0; while(n!=0){ int ld= n%10; sum=sum+ pow(ld,count); n=n/10; } return s...
ALGO
0.999957
4.612153
f7cef16a-f0b0-4d58-98ea-72f818799f30
ravya1108/hactoberfest2023
permutation.cpp
class Solution { public: void solve(vector<int>& nums,vector<vector<int>>&v,int i) { if(i>=nums.size()) { v.push_back(nums); return; } for(int j=i;j<nums.size();j++) { swap(nums[i],nums[j]); solve(nums,v,i+1); sw...
ALGO
0.999984
6.062871
e98beebf-071c-481e-b066-05d6ea3a9663
Harshit-Kotecha/Leetcode
1021-remove-outermost-parentheses/1021-remove-outermost-parentheses.cpp
class Solution { public: string removeOuterParentheses(string s) { int open = 0, k = 0; for(auto c : s) { if(c == '(') { //open++; if(++open > 1) s[k++] = c; } else { //open--; if(...
ALGO
0.999246
6.058082
7f51da85-08d5-428f-a9fb-569f59e3afe8
Koyingtw/CP
TIOJ/1175.cpp
#pragma region #pragma optimize("O3") #include <bits/stdc++.h> #define Weakoying ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); #define int long long #define pii pair<int, int> #define vi vector<int> #define vii vector<pair<int, int>> #define pqueue priority_queue #define pb push_back #define F first #define S secon...
ALGO
0.99993
5.008515
1f310e37-05b5-4950-9c85-a22c6195f2b8
sirinial/advent-of-code-2021
04/cpp/partA/main.cpp
#include <string> #include <iostream> #include <fstream> #include <map> #include <vector> #include <algorithm> #include <sstream> #include <iostream> std::ostream& operator<<(std::ostream& o, const std::pair<uint, uint>&pos) { o << "(" << pos.first << ", " << pos.second << ")"; return o; } struct BingoSheet {...
ALGO
0.991312
4.671949
bf2cedc5-1509-47e4-80af-c7e36353e51a
Bunyod16/initi_cpp_assignment
test.cpp
#include <string> #include <vector> #include <utility> #include <chrono> #include <iostream> #include <fstream> #include <set> #include "rbtc.hpp" using namespace std; using namespace chrono; using write_sequence = vector<string>; using test_pair = pair<uint64_t, string>; using modify_sequence = vector<test_pair>; u...
TEST
0.933466
5.211531
8b505a65-c7d6-4dbf-b4eb-b9222119a882
Daniil-Tevs/Tevsogor
src/Enemy.cpp
#include "Enemy.h" float Enemy::getX() const {return m_x;} float Enemy::getY() const {return m_y;} sf::Sprite *Enemy::getShape() {return m_enemy;} void Enemy::Moving(int t,std::vector<int> mass,const std::vector<Block*>& prt) { int fl_block = 0, u_fl, fl_z = 0; u_v = tec_v; for (int i = 0; i < prt_n; i++)...
ALGO
0.978088
3.733322
121b8d4c-55b7-4983-bf7d-f5f21d4212cf
arodiono/cpp-pool
d08/ex01/span.cpp
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* span.cpp :+: :+: :+: ...
ALGO
0.99033
4.842384
c9667fe1-329e-409e-8fb1-9df2b4ea322d
Soukhya7834/60-Days-Code-Challenge
2. Add Two Numbers.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* addTwoNumbe...
ALGO
0.999966
6.30792
4bbb2dc3-ec41-490f-89be-b417d0942635
Udayk02/DSA-basic
Problems/Problem1.cpp
//Kung-fu Master maximum area rectangle problem #include<iostream> #include<stdlib.h> using namespace std; void sort(int k, int a[]){ bool s = true; for(int i=0;i<k && s;i++){ bool s = true; for(int j=0;j<(k-i-1);j++){ if(a[j]>a[j+1]){ int k = a[j+1]; ...
ALGO
0.999846
3.865297
50ac7d6d-f71d-4030-9381-f4cb2d2b2b8f
coscene-io/coListener
ros2_listener/src/listener.cpp
#include <algorithm> #include <sstream> #include <cstring> #include <stdexcept> #include <string> #include <fstream> #include <memory> #include <stack> #include <vector> #include <utility> #include <rosidl_runtime_c/message_type_support_struct.h> #include <rosidl_typesupport_introspection_cpp/field_types.hpp> #include...
TOOL
0.923329
7.163817
2df69666-1285-4b2c-859b-ee96cef9cad8
calofmijuck/BOJ
Codes/4400/4470.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; cin >> n; string line; getline(cin, line); for (int i = 1; i <= n; ++i) { getline(cin, line); cout << i << ". " << line << '\n'; } return 0; }
ALGO
0.910725
3.216586
e6bcdf9d-f317-417d-a593-3eb0264f7147
Narakuuu/JatCC-online
code/timer/heaptimer.cpp
#include "heaptimer.h" //上虑操作,将堆中索引为 i 的节点上浮到正确的位置,以满足堆的性质 void HeapTimer::siftup_(size_t i) { assert(i >= 0 && i < heap_.size()); //计算父节点的索引 size_t j = (i - 1) / 2; while(j >= 0) { //检查父节点的值是否小于节点 i 的值,如果是,则退出循环 if(heap_[j] < heap_[i]) { break; } //否则交换位置 SwapNode_(i, j...
ALGO
0.988888
4.988544
63c6efa0-9ae5-4460-925a-28c480111fd2
thealonemusk/DSA_Questions
CODEFORCES/1080b.cpp
#include<bits/stdc++.h> #define endl '\n' #define ll long long int #define loop(i,a,b) for(ll i=a;i<=b;++i) #define pb push_back #define F first #define S second #define mp make_pair #define clr(x) x.clear() #define M...
ALGO
0.999604
3.72811
fcbc08f2-7d0e-4019-9630-728d628dd5ed
kaito1111/GameTemplete
GameTemplate/myEngine/ksEngine/bulletPhysics/src/Bullet3Collision/NarrowPhaseCollision/b3CpuNarrowPhase.cpp
#include "b3CpuNarrowPhase.h" #include "Bullet3Collision/NarrowPhaseCollision/b3ConvexUtility.h" #include "Bullet3Collision/NarrowPhaseCollision/b3Config.h" #include "Bullet3Collision/NarrowPhaseCollision/shared/b3ConvexPolyhedronData.h" #include "Bullet3Collision/NarrowPhaseCollision/shared/b3ContactConvexConvexSAT.h...
ALGO
0.95223
7.115927
794b85d5-0b6c-4460-8d44-a72b07438f34
FaadCoder/Leetcode-Solutions
99-recover-binary-search-tree/99-recover-binary-search-tree.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.999999
6.260496
3e920141-2043-4901-9ad0-b0ba78879023
rupav/cp
competitive_coding/contests/615/misc.cpp
#include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; #define mod 1000000007 #define lim 1000000000000000007 #define lim1 18446744073709551615 //Unsigned #define sq(a) ((a)*(a)) #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() #define mms(v,i) memset(v,i,sizeo...
ALGO
0.999939
4.270996
7748fe4a-9495-4b96-817d-20f8320f2dbb
xLAva/JediOutcastLinux
code/renderer/tr_sky.cpp
// tr_sky.c // leave this as first line for PCH reasons... // #include "../server/exe_headers.h" #include "tr_local.h" #define SKY_SUBDIVISIONS 8 #define HALF_SKY_SUBDIVISIONS (SKY_SUBDIVISIONS/2) static float s_cloudTexCoords[6][SKY_SUBDIVISIONS+1][SKY_SUBDIVISIONS+1][2]; static float s_cloudTexP[6][SKY_SUBDIVISI...
ALGO
0.89858
3.374054
8bc861f9-00bb-43ee-9b4c-d275f9cf4100
Newth-QiLiang/Regular-Simple-Path-Queries
EvaluationQuery/OurMethod.cpp
#include <vector> #include <unordered_map> #include <unordered_set> #include <set> #include <string> #include <algorithm> #include <sstream> #include <iostream> #include <stdlib.h> #include <stdio.h> #include <cstdlib> #include <ctime> #include <fstream> #include <string.h> #include <math.h> #include <time.h> #include ...
ALGO
0.994205
3.487267
1c7c1a2e-dd9e-455a-a5cd-477deb055af8
yongsoonko/solved-problems-2
143-10971.cpp
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <time.h> #include <vector> using namespace std; using ll = long long; struct Pos { int i; int j; }; int N, ans = 1e9; int W[11][11], chk[11]; void dfs(int curr, int cnt, int add) { if (cnt == N) { if (W[curr][1]) an...
ALGO
0.999899
3.529781
5ae2ffc4-108a-4419-bae9-6ba832583f0c
wan01008/RcppInv
inv.cpp
#include <RcppEigen.h> // [[Rcpp::depends(RcppEigen)]] // A function to conduct LDLt decomposition of (sparse) matrix M, then find the inverse using Eigen::Map; // 'maps' rather than copies using Eigen::MatrixXd; // variable size matrix, double precision using Eigen::VectorXd; ...
ALGO
0.999538
5.673399
21a74987-d74f-4fe1-bd16-190617b8f16b
ishandutta2007/codeforces
coderanshu/normal/1560/B.cpp
#include<bits/stdc++.h> using namespace std ; #define ll long long #define pb push_back #define all(v) v.begin(),v.end() #define sz(a) (ll)a.size() #define F first #define S second #define INF 2000000000000000000 #define popcount(x) ...
ALGO
0.999918
4.446758
5a0b8eb6-3d9b-40f7-a53c-bd2bb360af49
Walker0710/CPP
LeetCode/LongestPalindromicSubstring.cpp
#include <iostream> #include <vector> #include <algorithm> #include <limits.h> #include <map> using namespace std; // only rec bool pali(string &s, int st, int en) { while (en >= st) { if (s[en] != s[st]) return false; en--; st++; } return true; } pair<int, int> ...
ALGO
0.999957
5.798298
ad1a341c-18a0-4cda-af94-6ccb6cf362f8
InteractiviteVideoEtSystemes/opencore-amr
opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder.cpp
/* ------------------------------------------------------------------------------ Filename: pvamrwbdecoder.cpp ------------------------------------------------------------------------------ INPUT AND OUTPUT DEFINITIONS int16 mode, input : used mode int16 prms[], in...
ALGO
0.992514
4.46063
2b5a6575-8b7b-4962-ad53-73b385ba5128
TheStrix/CS
C++/FUNC1.CPP
Function Programs Name:Parth Bhatia Date: 11/03/2015 STD/DIV: XI/H Roll No: 3 Title: WAP to perform addition of 2 numbers using function 'add()' which should accept two parameters. Display output in function 'main()'. #include<iostream.h> #include<conio.h> int add(int a,int b); //function declaration ...
ALGO
0.997225
5.455618
9abb64b9-889b-4575-ad3c-c68feb57c078
StudyingFather/my-code
luogu/6608.cpp
#include <iostream> using namespace std; long long a[2000005],b[2000005]; int main() { long long k; int n=0; cin>>k; while(k) { n++; b[n]=(k-1)/(n+1)+1; k-=b[n]; } for(int i=n;i;i--) { a[i]=i*b[i]-b[i+1]; b[i]+=b[i+1]; } int p=n; while(p) { int pos=1; while(a[pos]) pos++; for(int i=1;i<po...
ALGO
0.999989
3.157205
cf3eef22-f38f-486c-b51f-f1bc065495c6
irfanshahmayeen/Data-Structure-And-Algorithm-CSE225-NSU
Practise Topicwise/c++ oop/Untitled1.cpp
#include<iostream> using namespace std; void print2(int c){ for(int i=1;i<=c;i++) { if(i==c) cout<<"#"; else cout<<"."; } // cout<<endl; } void print4(int c){ for(int i=1;i<=c;i++) { if(i==1) cout<<"#"; else cout...
ALGO
0.999885
3.085975
3e56fed2-4c59-47a1-bd95-98ff4302da9e
jacobfishel/CMPR-131
HW_5-2d/Source.cpp
// Attached: HW_2d // =================================================== // Program: HW_2d // =================================================== // Programmer: Jacob Fishel // Class: CS CMPR 131 // =================================================== //SOURCE CODE // =================================================...
ALGO
0.980808
5.693257
86e52861-2ff1-48eb-ae00-9406a876dfdd
turajred/datastructur
module 22/insert_min_heap.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n;cin>>n; vector<int>v; for(int i=0;i<n;i++){ int x;cin>>x; v.push_back(x); } int cur_id=v.size()-1; while(cur_id!=0){ int parent_id=(cur_id-1)/2; if(v[cur_id]<v[parent_id]) swap(v[cur_id],v[parent_id]);...
ALGO
0.999993
4.451337
6d048f5d-373d-4ed1-ad8a-f00fa2cf1ea2
mythreyajl/Programming
C++/Coding Challenges/Problem 016 - Power digit sum/Problem16.cpp
/* LINK: https://projecteuler.net/problem=16 PROBLEM: Power digit sum Statement: 2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 2^1000? Author: Mythreya Jayendra Lakshman */ #include <inttypes.h> #include <iostream> int sumOfDigits( int base, int p...
ALGO
0.999801
6.731778
ef63e3cd-3ef8-4f4a-9ded-b9be88243a7c
oznerot/Study
Sorting-Algorithms/Heap-Sort/HeapSort.cpp
#include "HeapClass.h" #include <vector> #include <iostream> void initialize_array(std::vector<int>& array, const int SIZE) { for(int i = 0; i < SIZE; i++){ array.push_back(i); } } void print_array(std::vector<int>& array, const int SIZE) { for(int i = 0; i < SIZE; i++){ std::cout << array...
ALGO
0.974056
4.823452
0e1fdfd9-9fd6-4bfd-9799-41e0b69e8765
Madhu-Biradakota/Mutation-Testing-using-DeepState
Final_SM_2/StringManipulator.mutant.930.cpp
#include "StringManipulator.h" #include <algorithm> #include <cctype> #include <sstream> #include <iterator> #include <map> #include <stdexcept> #include <locale> #include <regex> #include <numeric> std::string StringManipulator::reverse(const std::string& str) { std::string reversed = str; std::reverse(revers...
TOOL
0.872232
6.347883
e88d61ae-db79-400a-83df-e384c7794dfc
salron512/Projetos-Flutter
test_minio/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.997903
6.787361
6d66ce8d-db83-4f6a-9581-2bb6285027d5
buptlr/OFNet
src/caffe/layers/concat_layer.cpp
#include <vector> #include "caffe/layers/concat_layer.hpp" #include "caffe/util/math_functions.hpp" namespace caffe { template <typename Dtype> void ConcatLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) { const ConcatParameter& concat_param = this->layer_param_.c...
ALGO
0.887368
7.612041
4b6492d7-709d-4143-855c-35d3f0c1f8fb
tinutomson/AES_128
aes.cpp
#include "aes.hpp" #include <cstring> #include <iostream> #include <stdlib.h> using namespace std; Aes128::Aes128() { round_keys = 0; } const uint8_t Aes128::sbox[256] = { 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0,...
ALGO
0.999689
4.371072
6c2617d2-61b1-4418-bff2-286d6192d093
himanshuagarwal407/LeetCode_GFG_Problems
897-increasing-order-search-tree/897-increasing-order-search-tree.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.999994
6.483073
7f2d4310-81a0-405c-a9b9-3302ef0fbacd
shonjmoj/Webserver
HttpRequestResponse/MatchingLocation.cpp
#include "HttpRequest.hpp" #include <iostream> #include <vector> #include <string> int counLongtMatching(const std::string& path, const std::string& location) { int count = 0; size_t i = 0; size_t j = 0; if (!(location.size() > 0 && location[0] == '/') || !(path.size() > 0 && path[0] == '/') || (path.s...
WEB
0.986961
3.688757
b67d2741-da84-429d-8750-7118ab481a07
DovKrugerECEClasses/CPE-553hw
buildlibrary/src/examples/windows_example/windows_example.cpp
#ifdef _DEBUG #define IL_DEBUG #endif//_DEBUG #define _UNICODE // Memory leak detection #ifdef _DEBUG #define _CRTDBG_MAP_ALLOC #include <stdlib.h> #include <crtdbg.h> #endif //#define ILUT_USE_WIN32 #include <windows.h> #include <IL/il.h> #include <IL/ilu.h> #include <IL/ilut.h> #ifdef ILUT_USE_SDL #include <...
TOOL
0.880542
3.245926
143e10e5-f94d-4305-b16b-8a32f1ecd82b
cosmoharrigan/alchemy-2
src/rrf/gfeature.cpp
#include "gfeature.h" #include "rrf.h" GroundRRF::GroundRRF(RRF* rrf, Database* db) : rrf_(rrf), db_(db) { numCounts_ = 0; int numFeatures = rrf_->getNumFeatures(); for (int i = 0; i < numFeatures; i++) { allFeatures_.append(Array<GroundFeature*>()); numCounts_ += rrf_->getFeature(i)->...
ALGO
0.968068
4.853816
a6361031-8304-42d7-b01c-0b436ebfe9c8
Hjortiz23/Conversor_Divisas
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
7c2e8a3d-9c66-4b6e-983e-17461ffc73b7
mateor/pdroid
android-2.3.4_r1/tags/1.26/frameworks/base/media/libstagefright/codecs/amrnb/common/src/shr.cpp
/* Filename: /audio/gsm_amr/c/src/shr.c ------------------------------------------------------------------------------ REVISION HISTORY Description: Created separate file for the shr function. Sync'ed up with the current template and fixed tabs. Description: 1. Modified code by seperating var2=0 condi...
ALGO
0.984347
6.531946
7159e6f5-4665-4ec7-9ed5-715adcfd557d
JihyeonJeong129/BOJ_using_Cpp
10872/main.cpp
#include <iostream> int main() { int num; std::cin >> num; long long result = 1; for(int i = num; i>0; i--){ result = result * i; } std::cout << result << std::endl; return 0; }
ALGO
0.999961
4.854247
cc1ecd69-52f0-4030-b1c7-4c8e9614efce
fj0rdingz/Competive_Programming
contests/cf644/f.cpp
// lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで #include <bits/stdc++.h> #define mod 1000000007 #define INF 1001001001 #define ll long long #define ln cout<<endl #define Yes cout<<"Yes"<<endl #define No cout<<"No"<<endl #define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++) #define rep(i,n) REP(i,0,n) usin...
ALGO
0.999915
3.546017
1f959636-3fd1-421f-9dee-6444157f5793
Yixiao-Han/my-cmssw
TrackingTools/AnalyticalJacobians/test/ErrorProp_t.cpp
#include "TrackingTools/GeomPropagators/interface/HelixForwardPlaneCrossing.h" #include "TrackingTools/GeomPropagators/interface/HelixArbitraryPlaneCrossing.h" #include "TrackingTools/AnalyticalJacobians/interface/AnalyticalCurvilinearJacobian.h" #include "TrackingTools/AnalyticalJacobians/interface/JacobianLocalToCurv...
ALGO
0.989122
5.375175
d960f4a0-0702-4aaa-8558-51c9f762c70b
Ricxel/PROGRAMMAZIONE_1
SIMULAZIONI/soluzioni-20230220/es2/esercizio2_v1_sol.cpp
#include <iostream> #include <cstdlib> #include <ctime> #define MAXVALUE 100 #define MAXSIZE 100 // NON MODIFICARE IL CODICE SOTTO FINO A "NON MODIFICARE IL CODICE SOPRA" struct list { int info; list * next; }; struct tree { int info; tree * left; tree * right; }; void insert(tree * & result, const int nu...
ALGO
0.999579
3.841054
ca9358c3-c6f0-4186-9f31-2f2d14353589
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_11318_25.cpp
#include <bits/stdc++.h> using namespace std; signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, m; cin >> n >> m; vector<int> a(n), b(m); for (int i = 0; i < n; i++) { cin >> a[i]; a[i] *= 2; } for (int j = 0; j < m; j++) { cin >> b[j]; b[j] *= 2; } sort...
ALGO
0.999963
3.414685
1159af2d-fa76-4d34-a059-ddfb4cf45714
xymelon/leetcode
C++/Maximum Product Subarray1.cpp
#include<iostream> using namespace std; class Solution { public: int maxProduct(int A[], int n) { if(n == 1) { return A[0]; } int curMax = A[0]; int curMin = A[0]; int ans = A[0]; for(int i = 1; i < n; i++) { int tmp = curMax; curMax = max(A[i], max(tmp * A[i], curMin * A[i])); ...
ALGO
0.999898
4.622143
5e82da48-c767-421e-8c0c-c1b5cf749caf
ishankinger/Data-Structures-and-Algorithms
RECURSION/iking_103.cpp
// TO GET NTH FIBONNACI NUMBER #include<bits/stdc++.h> using namespace std; int fibNum(int n){ if(n==0) return 0; else if(n==1) return 1; return fibNum(n-1)+fibNum(n-2); } int main(){ cout<<fibNum(9); return 0; }
ALGO
0.999943
4.07178
a34f351e-7bfd-47c4-9d98-a457882b826e
shiva-srivastav/c-program
string_function/replace_swap.cpp
#include<bits/stdc++.h> #include<string> using namespace std; int main() {string s1,s2; cout<<"Input s1 and s2"<<endl; getline(cin,s1); getline(cin,s2); cout<<s1<<endl; cout<<s2<<endl; s1.replace(3,5,"ss"); cout<<s1<<endl; s1.push_back('z'); cout<<s1<<endl; s1.pop_back(); cout<<s1<<endl; s1.swap(s2); cout<<s1<<endl<<s...
ALGO
0.986072
3.123531