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
fb8d0507-09ae-4ba5-af21-49284ecbc94d
divyansh1511/CPP
DS ALGO (CPP)/TREES/print_at_k_depth.cpp
#include<iostream> #include<vector> #include<queue> using namespace std; class treenode{ public: int data; vector<treenode *> children; treenode(int data){ this->data = data; } ~treenode(){ for (int i = 0; i < children.size(); i++) { delete children[i]; ...
ALGO
0.999602
4.270203
73b76d7c-199e-4aa1-8ff8-75981ff76eb7
Pr0grammerSimon/Competitive-Programming
CSES/Mountain_Range.cpp
#include <iostream> #include <vector> #include <unordered_map> #include <queue> #include <stack> using namespace std; using ll = long long; using vi = vector<int>; using vpii = vector<pair<int, int>>; const int MAXN = 2 * 1e5 + 7; int left_s[MAXN]; int right_s[MAXN]; const int base = 1 << 18; int tree[base * 2]; ...
ALGO
0.999986
4.95338
89a078e7-623a-46d0-a705-314feafa95f1
DakshDudeja/CFC
Backtracking/Knight_Tour.cpp
#include <iostream> #include <vector> using namespace std; int tp=0; bool isItSafe(vector<vector<int>>&grid,int i,int j,int n,vector<vector<bool>>&visited); void display(vector<vector<int>>&grid , int n); void knightsTour(vector<vector<int>>&grid,int n,int i,int j,int count,vector<vector<bool>>&visited){ if(count ...
ALGO
0.999671
4.959545
e6d735d0-7fc0-4745-ae6b-ebed2d1e29c4
uddipan/LeetCode
315.Numbers after self/source.cpp
class Solution { public: void modi(int cd, int idx, vector<int>& nums, vector<int> &xx) { int cnt = 0; for(int i=0; i<nums.size(); i++) { if(cd <= nums[i])break; cnt++; } xx[idx] += cnt; } vector<int> helper(vector<int>& nums) { ...
ALGO
0.999996
6.050908
bec2f5e7-ca40-4242-90b3-69dbc2d59d23
danhphan90/Game
cocos2d-x-3.2/cocos/base/CCEventDispatcher.cpp
#include "base/CCEventDispatcher.h" #include "base/CCEvent.h" #include "base/CCEventTouch.h" #include "base/CCEventCustom.h" #include "base/CCEventListenerTouch.h" #include "base/CCEventListenerAcceleration.h" #include "base/CCEventListenerMouse.h" #include "base/CCEventListenerKeyboard.h" #include "base/CCEventListene...
TOOL
0.914959
4.206809
94329ef3-bf1b-4d58-936c-cd369ba7ba83
ong-wei-hong/coding-problems
codeforces/2130/C/main.cpp
#include <bits/extc++.h> #include <bits/stdc++.h> using namespace __gnu_pbds; using namespace std; #define rep(i, a, b) for (int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define rall(x) rbegin(x), rend(x) #define sz(x) (int)(x).size() #define LSB(x) (x) & (-x) #define fi first #define se second #define mp m...
ALGO
0.99995
4.404807
5ff9fb32-d207-4491-85aa-e400c12dc794
Maiwosz/Vulkan3DEngine
Vulkan3DEngine/Src/VulkanUtilities.cpp
#include "VulkanUtilities.h" #include <stdexcept> #include <vector> #include <algorithm> #include <cstring> #include <iostream> #include "Engine.h" #include "Window.h" namespace VulkanUtils { bool hasStencilComponent(VkFormat format) { return format == VK_FORMAT_D32_SFLOAT_S8_UINT || format ==...
TOOL
0.927018
7.265653
a3b5c8e2-2fbe-4467-ae22-db75a35e6e76
LGuilhermeMoreira/EDA
Codigos/BinarySearchTree/BuildingBST/main.cpp
#include <iostream> #include <string> #include <vector> #include <sstream> #include "bst.h" using namespace std; #define MAX 70 // Funcao recursiva 'construirBST_balanceada' // Essa funcao recebe como entrada: // (1) Um ponteiro para uma BST vazia; // (2) Um vetor de inteiros A[p..q] em ordem crescente com q-p+1 eleme...
ALGO
0.996579
4.75267
65f5b14b-37a6-493a-96e9-11136ce2cd22
ChinhNgo02/CTDL-GT
C++/lietkehoanvi.cpp
#include<bits/stdc++.h> #define MAX 20 using namespace std; int n; int A[MAX]; int a[MAX]={0}; void xuat(){ for(int i = 1; i <= n;i++) cout << A[i]; cout << " "; } void check(int k){ //int a[MAX]={0}; for(int i = 1; i <= n;i++){ if(!a[i]){ A[k] = i; a[i] = 1; ...
ALGO
0.999806
4.043813
0a8284f2-c073-4f36-ae9b-0f3f31326754
ShahrukhSatti21/minCharacters
textord/gap_map.cpp
#define EXTERN EXTERN BOOL_VAR (gapmap_debug, FALSE, "Say which blocks have tables"); EXTERN BOOL_VAR (gapmap_use_ends, FALSE, "Use large space at start and end of rows"); EXTERN BOOL_VAR (gapmap_no_isolated_quanta, FALSE, "Ensure gaps not less than 2quanta wide"); EXTERN double_VAR (gapmap_big_gaps, 1.75, "xht multipl...
TOOL
0.915947
3.005607
7108cb0f-dc02-4229-94c6-566055a909bc
intfloat/AlgoSolutions
gcj/gcj2015_apac_D/A.cpp
#include <bits/stdc++.h> #define FOR(i, n) for (int i = 0; i < (int)n; ++i) using namespace std; typedef long long ll; typedef pair<int, int> pii; int g[105][105]; const int dir_x[] = {1, -1, 0, 0}; const int dir_y[] = {0, 0, 1, -1}; int bfs(int row, int col) { vector<vector<bool> > visited(row, vector<bool>(col, f...
ALGO
0.999258
4.892724
fd22f3e2-e8e3-4e9c-a3a9-1bc3d76b7615
ishandutta2007/codeforces
quailty/normal/632/E.cpp
#include<cstdio> #include<cstring> #include<cstdlib> #include<cmath> #include<iostream> #include<algorithm> using namespace std; typedef double db; const db PI=acos(-1.0); struct Complex { db x,y; Complex(db x=0.0,db y=0.0):x(x),y(y){} Complex operator + (const Complex &b)const { return Complex(...
ALGO
0.999979
3.067517
ab18c532-66fb-431b-90e3-a40d75abdde7
HristoHristov95/Interesting_C-_Projects
Square_In_To_Squares_Protect_Trees/Source.cpp
#include<iostream> #include<vector> using namespace std; class Decomp { public: static vector<long long> decompose(long long n) { vector<long long> tests; vector<long long> numbers; vector<long long>results; long long checker = n*n; long long currentResult = 0; for (long long i = n - 1; i >= 1; i--) { t...
ALGO
0.999897
3.622424
8cc6f130-8530-4be5-b792-64f021594c94
TINYSTRING/university_life
practise/fuck.cpp
#include <stdio.h> #include <algorithm> #include <string.h> #include <iostream> #include <map> using namespace std; typedef long long ll; int ans = 0; ll arr[1000000] = {0}; map <long long,int>k; int e = 0; bool isprime(int w) { if (k[w]) { return 1; } for (int i = 2; i * i <= w; i++) { ...
ALGO
0.999901
3.729619
ad8074fa-38b5-4bd7-8ab4-2359e7a571c2
Kaustubh22327/CFsols
A_Vasya_the_Hipster.cpp
#include<bits/stdc++.h> using namespace std; int main() { int a,b; cin>>a>>b; int faishon=min(a,b); int regular=(max(a,b)-faishon)/2; cout<<faishon<<" "<<regular; }
ALGO
0.999908
3.848226
b3ce59e7-e15d-4c61-990e-6d5549f6a0ac
arasruislam/Fundamental-Programming
C++/week-2/final-exam/Sort_It_Again.cpp
#include <iostream> #include <string> #include <utility> using namespace std; class student { public: string name; int cls; char section; int studentId; int math_marks; int eng_marks; }; int main() { int n; cin >> n; student a[n]; for (int i = 0; i < n; i++) { cin...
ALGO
0.99973
4.217987
6bb8148e-51d8-49b6-b3ec-5eec2e2c1961
ishandutta2007/codeforces
tokusakurai/normal/1625/E2.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, x, n) for (int i = x; i <= n; i++) #define rep3(i, x, n) for (int i = x; i >= n; i--) #define each(e, v) for (auto &e : v) #define pb push_back #define eb emplace_back #define all(x) x.begin(), x.end() #define ra...
ALGO
0.9999
4.670949
fcb06ac0-99ab-41c8-81ed-69b285f2479b
didwl0stn/codetree-TILs
250514/달에서 무게 구하기/weight-on-the-moon.cpp
#include <iostream> using namespace std; int main() { // Please write your code here. int choo = 13; double weight = 0.165; cout << fixed; cout.precision(6); cout << choo << " * " << weight << " = " << choo*weight; return 0; }
TOOL
0.994674
3.246367
42df26fa-2d63-4057-90ea-04461f8ba255
wormtql/learnopengl-impl
deps/assimp/code/PostProcessing/CalcTangentsProcess.cpp
/** @file Implementation of the post processing step to calculate * tangents and bitangents for all imported meshes */ // internal headers #include "CalcTangentsProcess.h" #include "ProcessHelper.h" #include <assimp/TinyFormatter.h> #include <assimp/qnan.h> using namespace Assimp; // -----------------------------...
TOOL
0.989567
6.100907
8895e778-bf8a-42a6-a35f-fa0ea3f386a8
UdaySingh131105/6_Companies_30_Days_Challenge
Company 1 - Goldman Sachs/Day 5/Run Length Encoding/code.cpp
#include <bits/stdc++.h> using namespace std; string encode(string src){ //Your code here string ans = ""; int count = 1; for(int i = 1; i <= src.size(); i++){ if(src[i-1] != src[i]){ ans += src[i-1]; ans += to_string(count); ...
ALGO
0.99999
5.66926
9a17ebb7-33f9-4253-9890-2ba4f36992e6
mayankmanipant/Problem-Solving-DSA
LC 930. Binary Subarrays With Sum.cpp
class Solution { public: int numSubarraysWithSum(vector<int>& nums, int goal) { int i=0,j=0; int n=nums.size(); int sum=0,count=0; while(j<n){ sum+=nums[j]; while(i<j &&sum>goal){ sum-=nums[i]; i++; } if(...
ALGO
0.999952
6.272353
eff83c33-08ac-4fbe-b98c-948e4b8db439
dreninimanaj/leetcode
det20.cpp
#include <iostream> #include <vector> using namespace std; int maximumWealth(vector<vector<int>>& accounts) { int result = 0; int rreshti = accounts.size(); // 3 int kolona = accounts[0].size(); // 2 for (int i=0;i<rreshti;i++){ int shuma = 0; for (int j=0;j<kolona;j++){ shuma += ...
ALGO
0.999152
5.11606
459518d3-cce3-4de5-9438-15e0aab0f9ac
saurabhsoodpec/selfdriving
CarND-Path-Planning-Project/src/Eigen-3.3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_rowwise.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; int main() { Eigen::MatrixXf mat(2,4); mat << 1, 2, 6, 9, 3, 1, 7, 2; std::cout << "Row's maximum: " << std::endl << mat.rowwise().maxCoeff() << std::endl; }
ALGO
0.99955
3.891046
1018ea4f-0aab-42c7-9efb-9354bc6b649e
chriswengqi/kattis
ticketcompleted/ticketcompleted.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; typedef long long ll; #define int ll typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vector<string> vs; typedef vector<double> vd; typedef vector<vd> ...
ALGO
0.999435
4.834826
63d211a7-b0c8-4251-87b1-d1d0dd941dea
eliot-exdev/boost-morphos
libs/histogram/examples/guide_custom_minimal_axis.cpp
//[ guide_custom_minimal_axis #include <boost/histogram.hpp> #include <cassert> int main() { using namespace boost::histogram; // stateless axis which returns 1 if the input is even and 0 otherwise struct even_odd_axis { axis::index_type index(int x) const { return x % 2; } axis::index_type size() cons...
ALGO
0.88466
6.889628
ad2113c8-ff05-46d2-a07f-4ff5d17ffc10
atalia/leetcode
26.remove-duplicates-from-sorted-array.cpp
/* * @lc app=leetcode id=26 lang=cpp * * [26] Remove Duplicates from Sorted Array */ // #include <vector> // #include <iostream> // using namespace std; // @lc code=start class Solution { public: int removeDuplicates(vector<int>& nums) { int left = 0, right=1; int ret = 1; while(right <...
ALGO
0.999619
6.323157
c00ecb6f-5a94-4096-8837-b8ce7e6197f3
Ayush-023/DSA-Problems
zeroSumSubarrays.cpp
// { Driver Code Starts //Initial function template for C++ #include<bits/stdc++.h> using namespace std; #define ll long long // } Driver Code Ends //User function template for C++ class Solution{ public: //Function to count subarrays with sum equal to 0. ll findSubarray(vector<ll> arr, int n ) { ...
ALGO
0.999768
6.153918
e8548f45-1379-45b5-8fc7-631321f6aa82
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_7410_2.cpp
#include <bits/stdc++.h> using namespace std; const int N = 5e3 + 5; int d[N]; int n, ok = 1, vis[N]; vector<pair<int, int> > G[N]; int check() { queue<int> q; for (int i = 1; i <= n; i++) if (!d[i]) q.push(i); while (!q.empty()) { int u = q.front(); q.pop(); for (auto v : G[u]) { vis[v.seco...
ALGO
0.999961
4.033026
388c1fe9-dcc2-4f43-affa-40691d60998d
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_11774_0.cpp
#include <bits/stdc++.h> using namespace std; int n, m, k, first[200005], second[200005], vis[200005]; vector<int> a[200005], par[200005]; string s; map<pair<int, int>, int> mp; vector<string> res; void sol(int in) { if (in == n + 1) { res.push_back(s); if ((int)res.size() == k) { cout << k << '\n'; ...
ALGO
0.999991
4.337299
90111112-e9b3-4d3f-b860-fb1548f56031
Alaxe/noi2-ranking
2018/solutions/A/AVG-Haskovo/rot.cpp
#include<iostream> #include<string> using namespace std; string s,ans,st; int a[131072]; int b[131072]; int c[131072]; int n,k,u; /*void prt(string kk) { for(int i=0;i<n;i++) { if(kk[i]>=0&&kk[i]<=9)cout<<(char)(kk[i]+'0'); else cout<<(char)(kk[i]-10+'A'); }cout<<'\n'; }*/ void check() { ...
ALGO
0.999945
3.620992
b7493103-890f-4581-8723-eb8e219bd200
harshmahalle/-Data-Structure-And-Algorithm-
Most_IMP_DP/DP1_3-fibonacci_series.cpp
#include<bits/stdc++.h> using namespace std; //this is space optimization approach //TC:O(N) //SC:O(N) int main() { int n=5; int prev2=0; int prev=1; for(int i=2;i<=n;i++){ int curr_i=prev2+prev; prev2=prev; prev=curr_i; } cout<<prev; return 0; }
ALGO
0.999987
4.166783
9916524c-bf0c-4a33-9995-3a3767684d29
Dejavu-Jamaisvu/BOJ_Study
Algorithms/Implementation/AC/5430.cpp
#include <iostream> #include <vector> #include <algorithm> // reverse 함수를 사용하기 위해 필요 #include <sstream> using namespace std; void PrintX(vector<int> &x) { cout << "["; for (int j = 0; j < x.size(); j++) { cout << x[j]; if (j != x.size() - 1) // 마지막이 아니면 cout << ","; } ...
ALGO
0.999404
4.67629
713d83db-ae56-48f6-9ce3-b19de021b662
boxerprogrammer/Mathmatics
ClassicRaytracing/RayTracing/main.cpp
#include<dxlib.h> #include<cmath> #include<vector> #include<functional> #include<iostream> #include<omp.h> #include<cassert> #include"Geometry.h" using namespace std; constexpr int screen_width = 640; constexpr int screen_height = 480; struct ColorU8 { UINT8 r, g, b, a; ColorU8() :r(0), g(0), b(0), a(0) {} ColorU...
ALGO
0.881099
4.1439
6583d841-2a70-46fe-b087-50a4574ed612
Abhinav7076/My-Codes
LeetCode-Solutions-master/C++/add-two-numbers-ii.cpp
// Time: O(m + n) // Space: O(m + n) /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) { stack<int> stk1, stk2; ...
ALGO
0.999979
6.673793
87ea94cd-962e-41a0-a791-5cdae6e1b1e6
pku-liang/lasa
Halide/src/Memoization.cpp
#include "Memoization.h" #include "Error.h" #include "IRMutator.h" #include "IROperator.h" #include "Param.h" #include "Scope.h" #include "Util.h" #include "Var.h" #include <map> namespace Halide { namespace Internal { namespace { class FindParameterDependencies : public IRGraphVisitor { public: FindParameterDe...
TOOL
0.985403
7.398275
486f1c05-5ac0-4972-a70c-6601c755e08c
matthewsunsailing/clothsim
ext/nanogui/ext/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.99901
3.621207
6f2c2c9f-20df-42d3-a0ce-517098e9b7d7
its-kevin228/bucket_list
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
44a9b35a-6045-4304-be24-aa1bc0ec3fe1
kuang-jy/cpp-project
WD/tree/treeP149_06.cpp
// // Created by Kjoye on 2022/7/23. // #include <bits/stdc++.h> using namespace std; typedef struct tNode{ int data; tNode *left,*right; }tNode,*Tree; Tree getTree(int preOrder[],int inOrder[],int l1,int r1,int l2,int r2){ //先序,中序,先序的开始和结束,中序的开始和结束 tNode *root = (tNode*) malloc(sizeof(tNode)); roo...
ALGO
0.999975
5.113818
8e4074a3-4a61-4a1b-b950-5c12b097b6fc
GIT-heyok/PS
BOJ/Solutions/DP/Knapsack DP/1750_Improved1.cpp
#include <iostream> #include <vector> #include <stack> #include <queue> #include <sstream> #include <string> #include <algorithm> #include <numeric> #include <iomanip> #include <set> #include <map> #include <cmath> #include <memory.h> #define FAST \ ios::sync_with_stdio(false); \ cin.tie(nu...
ALGO
0.99992
4.326917
a270493a-ae1d-4f6b-9736-3cdb8e42eff1
iamseojin/baekjoon
baekjoon/0x04연결리스트/5397.cpp
//#include <bits/stdc++.h> #include <iostream> #include <list> #include <algorithm> #include <vector> #include <map> #include <string> #include <stack> #include <queue> #include <cstring> #include <cmath> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int N; cin >> N; ...
ALGO
0.999984
4.2618
ef8da03a-ca8e-4bd1-b9f0-0ab4bfdf7cb3
Satyam1799/100-Days-of-Code
Day 3/patternchar.cpp
#include<iostream> using namespace std; int main() { int n; cin>>n; int row=1; while(row<=n){ int col=1; while(col<=n){ char ch=('A'+row-1); cout<<ch; col=col+1; } cout<<endl; row=row+1; } return 0; }
ALGO
0.999304
3.542354
b37b55de-743a-4e0c-bcf6-644d33c4ab0f
veenits123/SDE-Sheet
785. Is Graph Bipartite?.cpp
// never the same!! #include <iostream> #include <cstdio> #include <cmath> #include <set> #include <algorithm> #include <vector> #include <map> #include <iomanip> #include <cassert> #include <string> #include <cstring> #include <queue> using namespace std; /*ϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕ*/ ...
ALGO
0.999921
4.645085
acc00082-6119-417a-9774-6ade235bb96b
configithub/internship-liama-corn-optimization
OptimisationMais/TestGen.cpp
/*--------------------------------------------------------------- * * TESTGEN.CPP * *-------------------------------------------------------------*/ #include "TestGen.h" void TestGen::calcul() { AlgoGen* alg; alg = new AlgoGen(inf,sup,Ngen,Npop,0); for(int i=0;i<Ntest;i++) { alg->ca...
ALGO
0.963703
3.527974
853dac3e-7781-4f8d-8212-14759baef876
Arpitpandey992/cpp-vscode
Contests and Practice/CodeForces/A_Wonderful_Permutation.cpp
const long long M = 1e9 + 7; const int INF = 2147483647; const long long INFLL = 9223372036854775807ll; #pragma region #include <algorithm> #include <chrono> #include <cmath> #include <cstring> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <iomanip> #include <iostream> #include ...
ALGO
0.999929
5.035122
b8c29cd1-4857-473c-81c2-bdfee92d1136
rogue-kitten/DSA
Problems/CodeForces/1200/1553C.cpp
// link to the problem -> https://codeforces.com/contest/1553/problem/C #include<bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> using namespace std; // using namespace __gnu_pbds; #define ll long long #define ull unsigned long long #define mod 9 #define vi vector<i...
ALGO
0.999496
3.511525
8931269c-adc1-44b9-aa8b-31b56dca2c5a
khan-ayanama/Course102-DSA
Complete DSA/01-Introduction/Lecture-08/file-02.cpp
#include <iostream> using namespace std; // Finding whether number is odd or not void isOdd(int n) { if (n % 2 == 0) { cout << "Number is Even" << endl; return; } cout << "Number is Odd" << endl; } // Printing fibonacci void fibonacci(int num) { int a = 0; int b = 1; cout <...
ALGO
0.998805
5.09383
794b7aa7-e1fb-4653-8e4d-238b35812113
syntacore/snippy
libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar_t/find.pass.cpp
// <string> // template<> struct char_traits<wchar_t> // static const char_type* find(const char_type* s, size_t n, const char_type& a); // constexpr in C++17 // UNSUPPORTED: no-wide-characters #include <string> #include <cassert> #include "test_macros.h" #if TEST_STD_VER > 14 constexpr bool test_constexpr() { ...
TEST
0.958628
6.096732
108ba535-0771-4448-9554-8a138b8f21ed
aastha-0711/DSA
0057-insert-interval/0057-insert-interval.cpp
class Solution { public: vector<vector<int>> insert(vector<vector<int>>& intervals, vector<int>& newInterval) { vector<vector<int>> res; int i = 0; int n = intervals.size(); // Step 1: Add intervals that end before newInterval starts while (i < n && intervals[i][1] < newInte...
ALGO
0.999974
6.660224
d855b29c-76dd-45bc-8b99-64e4124cac8e
davidgregoriom/Programacion
C++/Estructura de Datos y Algoritmos/2022/untitled10/main.cpp
#include <iostream> using namespace std; #define N 8 int solveKTUtil(int x, int y, int movei, int sol[N][N], int xMove[], int yMove[]); bool isSafe(int x, int y, int sol[N][N]) { return (x >= 0 && x < N&& y >= 0 && y < N&& sol[x][y] == -1); } void printSolution(int sol[N][N]) { for (int x = 0; x < N; x++) { ...
ALGO
0.99962
4.609107
aab7c069-5993-4bcb-80d0-b94c65801948
mohamedtamer0/LeetCode
567/ Permutation in String/Solution.cpp
class Solution { public: bool checkInclusion(string s1, string s2) { int m = s1.size(), n = s2.size(); if (m > n) return false; vector<int> cnt1(26); vector<int> cnt2(26); for (int i = 0; i < m; ++i) { cnt1[s1[i] - 'a']++; cnt2[s2[i] - 'a']++; ...
ALGO
0.999985
6.447236
0e206fe8-edb1-4741-b321-12a5a13fca86
Abunyawa/contests
ozon/c.cpp
#include<bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define F first #define S second #define vi vector<int> #define vl vector<long long> #define pii pair<int, int> #define pll pair<long long, long long> #define abu ios_base::sync_with_stdio(0) #de...
ALGO
0.999997
4.080909
7ef618c7-4d66-49e1-a6b2-7be1aa2a95c4
gtxygyzb/OI_and_ICPC
luogu/B/std.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 50; struct Data { int opt, val; void input() { char c[10]; scanf("%s%d", c, &val); opt = (c[0] == '*') ? 2 : 1; } }a[N]; int n, id[N]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) a[...
ALGO
0.999975
3.520687
8ec40481-0f51-48d1-a340-8d182b3a816a
ishandutta2007/codeforces
iakovlev.zakhar/normal/677/A.cpp
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define szof(x) int32_t((x).size()) using namespace std; typedef long long ll; typedef long double ld; const ll MOD = 1e9 + 7; const ll MOD998 = 998244353; typedef unsigned int uint; typedef unsigned long long ull; int32_t main() { ios::sync_with_std...
ALGO
0.999706
4.281223
61974c26-eb1a-41ba-b905-890c991497bb
sarvex/leetcode-nelua
solution/0900-0999/0948.Bag of Tokens/Solution.cpp
class Solution { public: int bagOfTokensScore(vector<int>& tokens, int power) { sort(tokens.begin(), tokens.end()); int i = 0, j = tokens.size() - 1; int ans = 0, t = 0; while (i <= j) { if (power >= tokens[i]) { power -= tokens[i++]; ans =...
ALGO
0.999961
6.339206
ab6550fa-77ae-410e-99b5-a0e90609e18d
lfujiwara/analise19
P2/l5/matmult.cpp
#include "bits/stdc++.h" using namespace std; long long int arr[100100]; long long int pd[1010][1010]; int main() { int n = 6; int arr[] = {5,10,3,12,5,50,6}; for(int l = 2; l<=n; l++) { for(int i=0; i+l-1 < n; i++){ pd[i][i+l-1] = 1e18; for(int j=i;j<i+l-1;j++) { long long...
ALGO
0.999802
3.493911
68d61891-94ef-416d-a800-6cb6ff4f82ab
subzero1712/Practice-Codes
Farenhiet to Celcius Scale.cpp
#include <iostream> using namespace std; int main () { double farhen; double celcius; cout << "enter temperature in farhenhiet" << endl; cin >> farhen; celcius = 5 * (farhen - 32) / 9; cout << "the temperature in celcius is" << celcius; return 0; }
TOOL
0.95953
3.952387
a6040720-0a1a-471b-b831-054a2a2d80c9
akashkumar23/gaphs
topological_sort_bfs.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define lld long long double #define fi first #define se second #define yes cout<<"YES"<<'\n' #define no cout<<"NO"<<'\n' #define fl(i,a,b) for(ll i=a; i<b; i++) #define fle(a,b) for(ll i=a; i<=b; i++) #define pll pair<ll,ll> #def...
ALGO
0.999934
5.259633
50740e92-944f-4dce-adbd-54214f7299eb
kanish-10/DSA
StriverA2Z/C++/3_ArraysQuestion/3.2_Medium/number_of_sub_arrays_of_sum_k.cpp
#include<bits/stdc++.h> using namespace std; int subarraySum(vector<int> nums, int k) { map<int, int> mpp; mpp[0] = 1; int presum = 0, cnt = 0; for (int num: nums) { presum += num; int remove = presum - k; cnt += mpp[remove]; mpp[presum] += 1; } return cnt; } ...
ALGO
0.999911
5.116705
97158563-acbe-4e2d-b80f-ade46e1bda70
yohanmanohara/warehouse_robot
src/stepermotor/stepfunction.cpp
#include "stepfunction.h" // Initialize motor pins void motorSetup() { pinMode(PUL_PIN, OUTPUT); pinMode(DIR_PIN, OUTPUT); pinMode(ENA_PIN, OUTPUT); digitalWrite(ENA_PIN, LOW); // Enable motor driver (LOW to enable) } // Move motor forward void moveForward(int steps, int delayTime) { digitalWrit...
ALGO
0.956302
5.280065
c7ff09f0-9d69-4683-9a17-2e337f569c46
rgaudette/src
cpp/C++ Templates The Complete Guide/traits/accum3.cpp
#include "accum3.hpp" #include <iostream> int main() { // create array of 5 integer values int num[] = { 1, 2, 3, 4, 5 }; // print average value std::cout << "the average value of the integer values is " << accum(&num[0], &num[5]) / 5 << '\n'; // create array of charac...
ALGO
0.995676
5.797791
29aefd09-d595-4423-91ad-33049d7506d2
MissAashnaa1/DSA-Questions
0076-minimum-window-substring/0076-minimum-window-substring.cpp
class Solution { public: string minWindow(string &s, string &t) { unsigned long long int start=0; unsigned long long int end=0; unsigned long long int minlen=s.length()+1; unsigned long long leaststart=-1; unsigned long long leastend=-1; string ans=""; unordered_map<ch...
ALGO
0.999987
6.3741
5ca840b4-f50a-4794-b585-6fac019f14ac
tudelft3d/PSSNet
step-1/3rd_party/CGAL/examples/Mesh_3/mesh_polyhedral_complex_sm.cpp
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Mesh_triangulation_3.h> #include <CGAL/Mesh_complex_3_in_triangulation_3.h> #include <CGAL/Mesh_criteria_3.h> #include <CGAL/Surface_mesh.h> #include <CGAL/Polyhedral_complex_mesh_domain_3.h> #include <CGAL/make_mesh_3.h> #include <cstdli...
ALGO
0.925839
6.762724
a07b354e-3090-413b-bb1e-64c89a3948d1
coolyuyuyu/leetcode
algorithm_0000-0999/996-Number of Squareful Arrays/main.cpp
class Solution { public: int numSquarefulPerms(vector<int>& nums) { int n = nums.size(); std::sort(nums.begin(), nums.end()); vector<int> graph[n]; for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { if (i == j) { continue; } int ...
ALGO
0.999936
5.821642
5e814f30-d61a-44c4-b8a7-1d153042dbef
chubillkelvin/leetcode
solutions/c++/problems/[1756_Medium] Design Most Recently Used Queue.cpp
class MRUQueue { list<int> q; public: MRUQueue(int n) { for (int i = 1; i <= n; i++) { q.push_back(i); } } int fetch(int k) { auto target = q.begin(); advance(target, k - 1); int item = *target; q.erase(target); q.push_back(item); ...
ALGO
0.998662
6.239298
6e6553ba-ddb2-4b95-9fde-cda3f5ba2481
StavrosChryselis/hackerrank
Implementation/Between Two Sets.cpp
/* **************************************************************** **************************************************************** -> Coded by Stavros Chryselis -> Visit my github for more solved problems over multiple sites -> https://github.com/StavrosChryselis -> Feel free to email me at <EMAIL> ****...
ALGO
0.999932
3.209995
923f99a3-ff07-41fe-a99f-c4631a13a3f7
JJungs-lee/problem-solving
BOJ/1212_8진수 2진수.cpp
#include <iostream> #include <string> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); string eight; string two[8] = {"000", "001", "010", "011", "100", "101", "110", "111"}; cin >> eight; for (int i = 0; i < eight.length(); i++) { int temp = eight[i] - '0'...
ALGO
0.999902
4.225904
6bb6e808-78fe-4f93-b9ec-40a89e351ff0
CozyWool/CodeTopAcademy
C++/2022-2023/January/26jan/26jan.cpp
#include <iostream> //#include <Windows.h> using namespace std; class DynArray { private: int* arr; int size; public: // Модификатор доступа DynArray(int sizeP) : arr{ new int[sizeP] }, size{ sizeP } { cout << "DynArray constructed for " << size << " elements, for " << this << endl; } ...
TOOL
0.985814
3.423651
a8e23518-da35-455c-8a77-14278d2a2b9a
Ujjwlkushwaha/Coding-Streak
Coding-Streak/01 September/04/LaxicographicalNumber.cpp
#include <iostream> #include <vector> #include <string> using namespace std; vector<int> laxicographicalNumbers(int n ) { // laxicographical numbers 1 se hi start hote haii int curr = 1; // for storing numbers vector<int> result; for (int i = 0; i < n; i++) { result.push_back(curr);...
ALGO
0.999773
5.816663
4f2510f0-172d-452f-96bb-0d53e04beacf
ThLentzas/leetcode
226/main.cpp
#include <iostream> /* * 226. Invert Binary Tree Given the root of a binary tree, invert the tree, and return its root. More info from the images on Leetcode Constraints: The number of nodes in the tree is in the range [0, 100]. -100 <= Node.val <= 100 */ int main() { std::cout << "Hello...
ALGO
0.999918
6.746728
f91a283b-867e-448c-a644-6cd6e08c159e
RiyaRoy06/Phitron-XPSC
Week 1/Day 7/Problem 4.cpp
#include<bits/stdc++.h> #define ll long long int using namespace std; class Solution{ public: long maximumSumSubarray(int K, vector<int> &Arr , int N){ // code here int l=0,r=0; long long s=0,a=0; while(r<N) { s+=Arr[r]; if((r-l+1)==K) { ...
ALGO
0.999617
4.523237
b176236d-ddb7-4ae0-8f33-e25db3d7ca6f
sanjeevWeb/latest_gfg
Difficulty: Basic/Sum the common elements/sum-the-common-elements.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; class Array { public: template <class T> static void input(vector<T> &A,int n) { for (int i = 0; i < n; i++) { scanf("%d ",&A[i]); } } template <class T> static void print(vector<T> &A) ...
ALGO
0.999954
6.275607
6cb5147e-df84-4eec-b32a-1f5c66fc07b5
EvolBioInf/Delta24
src/mapNucl.cpp
#include <vector> #include <string> #include <functional> #include <stdexcept> #include "SamFile.h" #include "SamFlag.h" #include "SamValidation.h" #include "mapNucl.hpp" using namespace std; const unsigned char MIN_QUAL = '!'; /** @brief Maps nucleotides to their corresponding position on the * reference sequenc...
TOOL
0.886723
5.789353
4babc030-e7e6-4fad-ab28-e85447766eec
Mehedi259/CodeForces
MishkaandGame.cpp
// Bismillahir Rahmanir Rohim // Author // Mehedi Hasan Mridul #include <bits/stdc++.h> using namespace std; #define nl '\n' #define r0 return 0 #define pb push_back #define all(a) a.begin(), a.end() #define REP(i, n) for (int i = 0; i < n; i++) #define REV(i, n) for (int i = n - 1; i >= 0; i--) #define fast() ...
ALGO
0.999941
3.918309
b89f8217-8e9a-4584-bdc1-c1529909a228
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_5242_6.cpp
#include <bits/stdc++.h> using namespace std; const double PI = 2.0 * acos(0.0); const double EPS = 1e-6; int main() { int x; scanf("%d", &x); if (x == 3) puts("5"); else { for (int i = 1; true; i++) { if (((i * i + 1) >> 1) >= x) { printf("%d\n", i); break; } } } ret...
ALGO
0.999939
3.778254
140a30a6-a9c7-4b3b-bd29-362c797097e0
aurastejeroiu/Basic-C-ALgorithms
Oglinda/main.cpp
#include <iostream> using namespace std; //Sa se dea un subprogram recursiv pentru determinarea numarului oglinda a lui X long Oglinda(long X, long Og) { if(X==0) return Og; return Oglinda(X/10,Og*10+X%10); } int main() { long n; cout<<"da un natural:"; //citire n, fara validare cin >>n; ...
ALGO
0.998519
3.802082
3a1d23d4-1e55-430d-84d8-91519089406e
WithNotebook/WithLaptop
aeri.youn/221014_backjoon1238.cpp
#include <iostream> #include <vector> #include <cstring> #include <queue> #include <algorithm> using namespace std; vector<pair<int, int>> go[1001]; vector<pair<int, int>> back[1001]; int go_min[1001]; int back_min[1001]; int main() { int n, m, x = 0; cin >> n >> m >> x; for (int i = 1; i <= m; i++) { int sou...
ALGO
0.999929
4.243167
c4fdfce9-951c-4bc4-b5dd-b0f886ae3904
akgarhwal/LeetCode-Solutions
Solutions/C++/Runtime-Error/155-min-stack.cpp
/* Problem Title: 155 - Min Stack Lang: C++ Runtime: N/A Memory: N/A Problem Url: https://leetcode.com/problems/min-stack Submission Url: https://leetcode.com/problems/min-stack/submissions/322703575 */ class MinStack { public: /** initialize your data structure here. */ vector<int> stack; int capacity, si...
ALGO
0.999703
6.622633
1ea80981-f896-4718-85b3-ba0fef36937d
CubixPro/Transfer
Aug/Long/dilemma.cpp
#include<iostream> using namespace std; int main() { int testcases; scanf("%d", &testcases); while(testcases-- != 0) { string str; cin >> str; int c1 = 0 ; for(int i = 0 ; i < str.length() ; i++) { char ch = str[i]; if(ch == '1') ...
ALGO
0.999534
3.551435
b0717ee2-4b4d-4d5f-ace8-077f673c3f57
simon7426/Competitive-Programming-AC-Submissions
CodeForces/GNU C++14/609E | Minimum spanning tree for each edge/80634517.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<vi> vvi; typedef vector<vl> vvl; typedef pair<int,int> pii; typedef pair<double, double> pdd; typedef pair<ll, ll> pll; typedef vector<pii> vii; typedef vector<pll> vll; #define pb push_b...
ALGO
0.999987
4.087392
31629e35-54c9-4728-8993-db45903a3eca
764889950/opencv-3.4.5
modules/photo/src/denoise_tvl1.cpp
#include "precomp.hpp" #include <vector> #include <algorithm> #define ABSCLIP(val,threshold) MIN(MAX((val),-(threshold)),(threshold)) namespace cv{ class AddFloatToCharScaled{ public: AddFloatToCharScaled(double scale):_scale(scale){} inline double operator()(double a,uchar b){ ...
ALGO
0.960972
5.730219
61036024-67d2-442d-91bf-09dae960baf4
haderech/libcxx
test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_n.pass.cpp
// <algorithm> // UNSUPPORTED: c++03, c++11, c++14, c++17 // template<input_iterator I, weakly_incrementable O> // requires indirectly_copyable<I, O> // constexpr ranges::copy_n_result<I, O> // ranges::copy_n(I first, iter_difference_t<I> n, O result); #include <algorithm> #include <array> #include <cassert>...
TEST
0.895737
7.626196
f331ce05-63dc-4df9-a55a-ef12ca2df287
amallia/SIGIR2016
UsingSinglesOnly_Ideal_Code/QPtrec06/Maxscore.cpp
/* * Maxscore.cpp * * Created on: May 14, 2012 * Author: constantinos */ #include "Maxscore.h" #include "globals.h" #include "profiling.h" #include "utils.h" #include <vector> inline bool Maxscore::find_smallest_did_in_essential_set(lptrArray& lps, const int& num_of_essential_lists, int& smallest_did) { s...
ALGO
0.999345
6.442748
2801788c-c6fb-4db3-bd12-b64c75b43a5f
nishilam40/quizapp_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.9988
6.76073
5e70021c-fccc-49df-a621-1ca0fa3a9651
SH4MDEL/boj-algorithm
Algorithm/Algorithm/11404 - 플로이드.cpp
#include <iostream> #define endl "\n" #define inf 987'654'321 using namespace std; int graph[105][105]; int n, m; int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); cin >> n >> m; for (int i = 1; i <= n; ++i) { for (int j = 1; j <= n; ++j) { if (i != j) { graph[i][j] = inf; } } ...
ALGO
0.999996
4.078973
7004a68b-c18e-4af3-aa66-ef3d01f25346
RakibHasan106/LeetCode
NeetCode Roadmap/Tree/Maximum_Depth_Of_Binary_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.999828
6.335911
96c16c13-0126-4e01-a4c9-9c8f20c839cf
atrepalin/Types-and-data-structures-RSREU
binary_search/B.cpp
#include <iostream> #include <vector> #include <algorithm> namespace aboba = std; int search(const aboba::vector<int> &K, int q) { int left = 0; int right = K.size() - 1; int ind = -1; while (left <= right) { int mid = left + (right - left) / 2; if (ind == -1 || abs(K[mid] - q) <...
ALGO
0.999999
5.02399
fefa27a8-3381-43dc-a292-d8d503e0832a
ArchitGupta8080/DSA
Day 3/decompress.cpp
/*We are given a list nums of integers representing a list compressed with run-length encoding. Consider each adjacent pair of elements [freq, val] = [nums[2*i], nums[2*i+1]] (with i >= 0). For each such pair, there are freq elements with value val concatenated in a sublist. Concatenate all the sublists from left to ...
ALGO
0.999773
5.374117
dcffbe83-43e1-4785-9254-820b23605994
stefdasca/CompetitiveProgramming
Codeforces/CF1061-D2-C.cpp
#include<bits/stdc++.h> #pragma GCC optimize("O3") using namespace std; long long n, v[100002]; vector<int>divizori[1000002]; long long sum[100002]; long long ans; long long mod = 1000000007; void ciur() { for(int i = 1; i <= n; ++i) for(int j = i; j <= 1000000; j += i) divizori[j].push_back(i);...
ALGO
0.999924
4.772755
3417d9cd-1ee0-4a47-a90b-8be3c1f37323
crbrotea/CPlusPlus_Algorithmic_Techniques
grafos/p16/v2/Pavimentar_City.cpp
#include "Pavimentar_City.h" #include <stdio.h> /* printf */ #include <stdlib.h> /* abs */ #include <cfloat> #include <limits> Pavimentar_City::Pavimentar_City(GrafoValorado<double> const& G) :coste_min (0), edgeTo(G.V()), weight(1), marked(G.V(), false), pq(G.V()), distTo(G.V(), std::numeric_limits<double>::...
ALGO
0.99977
3.811043
9b1fad35-3f2c-4306-86e4-2ac8d4d1f1a2
dldkddkd/Competitive-Programming
Junyoung/기본유형/조합0의개수.cpp
// https://www.acmicpc.net/problem/2004 #include <stdio.h> #include <algorithm> using namespace std; int count_num(int n, int num) { int cnt = 0; while (n >= num) { cnt += (n /= num); } return cnt; } int main() { int N, M; scanf("%d %d", &N, &M); int five_cnt = count_num(N, 5) - count_num(M, 5) - count_n...
ALGO
0.999959
3.984597
bb65cbc1-ec9f-404b-9365-65b776e4e042
arthurvtrr/AA-Problems-Solved
New/Treino 2018/cs/A.cpp
#include <bits/stdc++.h> using namespace std; int primes[4] = {2, 3, 5, 7}; int main() { int x = 1, y; for (int i = 0; i < 4; i++) { printf("Q %d\n", primes[i]); fflush(stdout); scanf("%d", &y); for (int j = 0; j < y; j++) x *= primes[i]; } printf("A %d\n",...
ALGO
0.999813
3.577909
b7bfc94a-e91b-41ad-8a0d-35bcf9e3b062
PrajwalBagekari/-6companies30days
AMAZON/Question10.cpp
#include <bits/stdc++.h> using namespace std; void matchPairs(char nuts[], char bolts[], int n) { // code here sort(nuts,nuts+n); sort(bolts,bolts+n); } int main() { int n; cin >> n; char nuts[n], bolts[n]; for (int i = 0; i < n; i++) { cin >> nuts[i]; ...
ALGO
0.999916
3.379966
9b965a3b-6c5f-44a1-825b-d33c6a0da33c
halfbloodprince16/CODE-FORCE-AND-HACKER-RANK-SOLUTIONS
try_dll.cpp
#include"bits/stdc++.h" using namespace std; struct Node { int data; Node *next; Node *prev; }; Node *insert(Node **head, int data) { Node *temp = new Node(); temp->data = data; temp->next = (*head); temp->prev = NULL; if((*head) != NULL) { (*head)->prev = temp; } (*head) = temp; } void printList(Node*...
ALGO
0.999869
4.641794
d416262b-3a8a-4e13-a2cb-e6cec42324d5
rfabbri/pd-macambira
externals/tb/sc4pd/source/AllpassN.cpp
#include "sc4pd.hpp" #include "DelayUnit.hpp" class AllpassN_ar : public FeedbackDelay_ar { FLEXT_HEADER(AllpassN_ar,FeedbackDelay_ar); AllpassN_ar (int argc, t_atom *argv); ~AllpassN_ar (); protected: virtual void m_signal(int n, t_sample *const *in, t_sample *const *out) { m_signal_fun(n,i...
ALGO
0.981273
4.551251
500cfac8-8a7c-4bd1-94fb-252966af5602
SaiRohithkandula/cprogramming1
sum of individual digits.cpp
#include<stdio.h> int main() { int n,r,sum=0; printf("enter n"); scanf("%d",&n); while(n>0) { r=n%10; sum=sum+r; n=n/10; } printf("%d",sum); }
ALGO
0.999731
3.252607
e39ae504-4f68-4ed4-98f0-009c80c21d84
sugikazu75/atcoder
submissions/atcoder.jp/arc097/arc097_a/Main.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for(ll i = 0; i < n; i++) #define all(v) v.begin(), v.end() typedef long long ll; int main(){ string s; int k; cin >> s >> k; vector <string> ans(0); for(int i=0; i<s.size(); i++){ //最初の文字 int now = 0; string sub...
ALGO
0.999946
3.630431
e3d09285-9591-489f-8e89-0afd159f84ef
jeongopo/DaliyCodeCpp
구현/code2811.cpp
/* 220916 백준 2811 : 상범이의 우울 https://www.acmicpc.net/problem/2811 */ #include <iostream> #include <vector> using namespace std; void AnswerCount(vector<bool> check) { int answer=0; for (int i = 0; i < check.size(); i++) { if (check[i]) answer++; } cout << answer << "\n"; } int main() { ios::sync_with_stdio(fa...
ALGO
0.999959
4.544999
f10dceaa-c102-4d98-81a9-b0192646affc
WenHsuanYu/Leetcode
CandidateSolution/322. Coin Change_bottom_up.cpp
class Solution { public: int coinChange(vector<int>& coins, int amount) { vector<int> dp(amount + 1, 1 << 30); dp[0] = 0; if (amount == 0) return 0; int len = coins.size(); for (int i = 0; i < len; ++i) { for (int j = 0; j + coins[i] <= amount...
ALGO
0.999957
6.002297
5e4e5a46-7b70-47f9-8f7c-871ee1e62227
kkisic/Procon
CPP/Codeforces/1182/b.cpp
#include <cmath> #include <iostream> #include <vector> #include <queue> #include <deque> #include <map> #include <set> #include <stack> #include <tuple> #include <bitset> #include <algorithm> #include <functional> #include <utility> #include <iomanip> #define int long long int #define rep(i, n) for(int i = 0; i < (n);...
ALGO
0.99998
3.686434
42881446-a71f-46cc-adec-0c5cba85c8aa
MikaelVallenet/R-Type
libs/boost/libs/spirit/example/x3/calc/calc9/vm.cpp
#include "vm.hpp" #include <boost/assert.hpp> namespace client { int vmachine::execute( std::vector<int> const& code , std::vector<int>::const_iterator pc , std::vector<int>::iterator frame_ptr ) { std::vector<int>::iterator stack_ptr = frame_ptr; while (pc != code.end(...
TOOL
0.89225
5.723989