uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
2287a71f-e09d-4d3f-8037-39295601c009
AkashdeepGarg/DSA-and-SQL
0547-number-of-provinces/0547-number-of-provinces.cpp
class DisjointSet{ public: vector<int> parent,size; DisjointSet(int n){ parent.resize(n+1); size.resize(n+1,1); for(int i=0;i<=n;i++){ parent[i]=i; } } int findParent(int v){ if(parent[v]==v){ return v; } return pare...
ALGO
0.999995
6.082682
a97d92bd-6d07-46b8-ba9e-3d4726158b55
RudoRoemer/pdb2movie
FIRST-190916-SAW/src/mt19937ar.cpp
#include <stdio.h> #include "mt19937ar.h" /* Period parameters */ #define N 624 #define M 397 #define MATRIX_A 0x9908b0dfUL /* constant vector a */ #define UPPER_MASK 0x80000000UL /* most significant w-r bits */ #define LOWER_MASK 0x7fffffffUL /* least significant r bits */ static unsigned long mt[N]; /* the arra...
ALGO
0.999752
6.108038
e3f1c4b9-1008-44ef-895d-4fa1b8b283b8
ishandutta2007/codeforces
yashchandnani/normal/799/A.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n,t,k,d,x; cin>>n>>t>>k>>d; x=n/k; if (n%k!=0) { x++; } x=x*t; if (d+t<x) { cout<<"YES"; } else{ cout<<"NO"; } return 0; }
ALGO
0.999752
3.398737
86509543-76a1-4d0b-b3db-c2cf5fd0187d
VladoVPA/SoftUni-ProramingBasics-CPlusPlus
012-FirstStepsInCodingExercise/SuppliesForSchool/SuppliesForSchool.cpp
#include <iostream> using namespace std; int main() { int pens; int markers; int detergent; int DiscountPersentage; const double penPrice = 5.80; const double markerPrice = 7.20; const double detergentPrice = 1.20; cin >> pens >> markers >> detergent >> DiscountPersentage; doubl...
ALGO
0.998971
3.847981
db5641e3-cfe1-41ae-b008-3fb7cbf11c21
maharshi6864/college_programs
Sem3/OOPs/cpp_class_assignmnets(80programs)/with_return_no_argument/nested_if_else.cpp
#include <iostream> using namespace std; class NestedIfElse { public: int num; int checkEnteredInteger() { if (num != 0) { if (num > 0) { return 1; } else { return 2; } } else { return 3; } } }; int main() { NestedIfElse nes...
ALGO
0.997013
4.346632
899e41b3-1ce3-4d80-ba17-32b3bc2acefc
JJW0220-gif/CPP_practice
12257_112062117.cpp
#include "12257_112062117.h" #include <iostream> using namespace std; Animal::Animal(Zoo *zoo, string name){ belong=zoo; belong->born(name); species=name; } Dog::Dog(Zoo *zoo): Animal(zoo, "Dog") {} Dog::~Dog(){} Cat::Cat(Zoo *zoo): Animal(zoo, "Cat"){} Cat::~Cat(){} Caog::Caog(Zoo *zoo): Animal(zoo...
TOOL
0.970816
4.841232
9a29b887-efb7-4f18-bbcc-e81aa578a75d
edge555/Online-Judge-Solves
Codeforces/810-A.cpp
#include <bits/stdc++.h> #define FAST ios_base::sync_with_stdio(false); cin.tie(NULL) #define pf printf #define sf(num) scanf("%d",&num) #define sff(num1,num2) scanf("%d %d",&num1,&num2) #define rep(i,n) for(i=1;i<=n;i++) #define rep0(i,n) for(i=0;i<n;i++) #define reps(i,a,n) for(i=a;i<=n;i++) #define pb push_back #de...
ALGO
0.999899
3.401528
a37b2f43-0081-4db5-ae2e-a6059982fbc7
metarutaiga/xxGLSLCompiler
src/compiler/glsl/opt_array_splitting.cpp
/** * \file opt_array_splitting.cpp * * If an array is always dereferenced with a constant index, then * split it apart into its elements, making it more amenable to other * optimization passes. * * This skips uniform/varying arrays, which would need careful * handling due to their ir->location fields tying the...
ALGO
0.862488
8.023693
a9399c14-a299-4df3-8e21-2703adacb66a
TechWithChhotu/Assignment-_23cpp
3.cpp
//Write a C++ program to calculate the sum of two numbers. #include<iostream> using namespace std; int main(){ int a, b; cout << "Enter two number: "; cin >> a >> b; cout << "sum of two number is " << a + b; }
TOOL
0.936567
4.138023
2c937268-2125-4546-a701-92ecce8df58a
18616378431/SRP6ClientForQt6
libsrp6.cpp
#include <algorithm> #include <utility> #include "libsrp6.h" #include <openssl/evp.h> #include <vector> #include <cstring> #include <iostream> extern "C" std::pair<unsigned char*, unsigned char*> test_srp6( const char* N_str, const char* g_str, const char* B_str, const char* s_str, ...
ALGO
0.985202
3.476004
8fdc4352-d347-404c-a662-b6b5467bc9ad
Kiran-naregal/100_Code_Library
Sort_Character_By_String.cpp
#include<bits/stdc++.h> using namespace std; string frequencySort(string s) { string temp = ""; string t = ""; int flag = 0; for(int i = 0; i < s.size(); i++) { flag = 0; for(int j = 0; j < temp.size(); j++) { if(s[i] == temp[j]) { fla...
ALGO
0.999995
5.336919
cdf156ca-7ef9-40a4-a9c1-1706e9c481a1
adni03/DSA-Program-Files
Linked List/LL_Queue.cpp
//QUEUE AS A LINKED LIST #include<iostream> using namespace std; struct node { int data; struct node *next; }; struct Queue { struct node *F; struct node *R; }; typedef struct node* QPTR; void L_enq(Queue &A, int x) { QPTR T=NULL, TEMP=A.F; T=new(node); T->data=x; if(A.F == NULL) { A.F=T; A.R=T; T->...
ALGO
0.999385
4.125802
668bced9-4de3-4399-b5bb-c7f641c1cd1a
keepnext/SmartVehicle
CodeXycarDeviceCode/DeviceCamera/camera/sample/9_findroad.cpp
#include <opencv2/opencv.hpp> #include <opencv2/imgproc.hpp> using namespace cv; using namespace std; int main() { Mat img_color; VideoCapture cap(0); double fps = cap.set(CV_CAP_PROP_FPS, 1);//set the fps of video cout << "fps:" << fps << endl; if (!cap.isOpened()) { cerr << "error cam"; return -1; } w...
ALGO
0.91464
3.53417
256966d5-f303-4a95-b86f-bed840d2508f
zfa07/Killyouss
Engine/Plugins/AI/HTNPlanner/Source/HTNPlanner/Private/HTNPlanner.cpp
#include "HTNPlanner.h" DECLARE_CYCLE_STAT(TEXT("HTN: Planning"), STAT_HTN_Planning, STATGROUP_AI); // // Extensions/missing features: // - PrimitiveTasks do not support conditions // - no planning progress logging // - max iterations limit //----------------------------------------------------------------------// /...
ALGO
0.944615
5.911118
fc3c91a3-3949-4a0c-aadd-ce4945266cfd
sr4saurabh/CSESsolutions
CSES-GRAPHS/CSESbuildingteams.cpp
/*--ILRS-- sr4saurabh */ #include <bits/stdc++.h> using namespace std; typedef long long int ll; #define pb push_back #define popb pop_back #define mp make_pair #define ve vector #define vii vector < int > #define vll vector < ll > #define pii pair < int , int > #define pll pair < ll , ll > #define vpl vector < pll...
ALGO
0.99997
4.85904
c02dc977-588a-4443-90df-960c06a64ad2
adarshdbg/LeetCode
Array/maximum-ice-cream-bars.cpp
class Solution { public: int maxIceCream(vector<int>& costs, int coins) { sort(costs.begin(),costs.end()); int sum=0; for(int i=0;i<costs.size();i++) { sum+=costs[i]; if(sum>coins) return i; } return costs.size(); } };
ALGO
0.999412
5.996219
07b3a00a-7de5-4671-90ad-7ef68aeb61ea
aprgproject/aprg
AprgAlgebra/AprgAlgebra/src/Algebra/Solution/Solver/NewtonMethod.cpp
#include "NewtonMethod.hpp" #include <Common/Math/Helpers/SignRelatedHelpers.hpp> using namespace alba::mathHelper; using namespace std; namespace alba::algebra { // In numerical analysis, Newton's method, also known as the Newton–Raphson method, named after Isaac Newton and Joseph // Raphson, is a root-finding alg...
ALGO
0.999952
6.897177
8f6ca703-8e26-4804-b23b-57ef9ba036ae
emrahuzucar355/Uzucar-
libcudacxx/libcxx/test/libcxx/containers/sequences/vector/asan.pass.cpp
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5 // <vector> // reference operator[](size_type n); #include <vector> #include <cassert> #include <cstdlib> #include "asan_testing.h" #include "min_allocator.h" #include "test_iterators.h" #include "test_macros.h" #ifndef _LIBCUDACXX_HAS_NO_ASAN extern "C" void __sanit...
TEST
0.909672
6.04951
035643e1-29ef-4644-9d9d-168df2020f15
Salonishrma/Leetcode
Majority Element leetcode/code.cpp
class Solution { public: vector<int> majorityElement(vector<int>& nums) { vector<int>v1; int n=nums.size(); int mini=int(n/3)+1; map<int,int>m1; for(int i=0;i<n;i++){ m1[nums[i]]++; if(m1[nums[i]]==mini){ v1.push_back(nums[i]); } ...
ALGO
0.999955
5.657122
c8ca4a2d-9fb4-4c67-8a7d-f1b2bd0cbd2e
vinamrajain19/Placement_Preparation
Graph/Print_adjacency_list.cpp
class Solution { public: // Function to return the adjacency list for each vertex. vector<vector<int>> printGraph(int V, vector<int> adj[]) { // Code here vector<vector<int>> ans; for(int i = 0;i<V;i++){ vector<int> t; t.push_back(i); for(au...
ALGO
0.999915
5.873805
d3c060d9-f23c-465b-b622-a5029f8b8f4f
VibhuDixit-2215001940/All_About_C-Language-
Functions/2.SumUsingFn.cpp
//Printing Sum Of Two No. using functions #include<stdio.h> void sum(){ int a=10,b=10; printf("%d",a+b); } int main(){ sum(); return 0; }
TOOL
0.993861
4.244422
6ceba533-9042-4681-95d1-fdea558271ef
iarav/MobileUnicamp
Atividades/aula5/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.99821
6.786404
a0531e30-4a4d-4349-b1ab-5f5dfc2a634d
ishandutta2007/codeforces
zhoushang2003/normal/486/D.cpp
#include<bits/stdc++.h> using namespace std; const int N=2e3+1,D=1e9+7; bool v[N]; long long d,n,m,x,y,w[N],f[N],A; vector<int>a[N]; void S(int k) { v[k]=true,f[k]=1; for(int i=0;i<a[k].size();i++) if(!v[a[k][i]]&&w[x]<=w[a[k][i]]&&w[a[k][i]]<=w[x]+d&&(w[a[k][i]]!=w[x]||a[k][i]<x)) S(a[k][i]),(f[k]*=f[a[k][i]]+1...
ALGO
0.999794
3.872226
465bfd47-14b3-49ae-8892-2d9ee085cfdd
theSreeRam/CPP-Practice-Problems
1count.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n, k; cin>>n>>k; int arr[n]; for(int i=0; i<n; i++){ cin>>arr[i]; } int left = 0, right = 0, countZero = 0; int res = 0, window = 0, window_start = 0; while(right<n){ if(arr[right]==0){ countZero++; } while(countZero>k){ if(arr[left]...
ALGO
0.999981
3.521578
2e2d8e29-e2d4-41c8-9036-14f66368e1de
22388o/test
src/test/settings_tests.cpp
#include <util/settings.h> #include <test/util/setup_common.h> #include <test/util/str.h> #include <boost/test/unit_test.hpp> #include <univalue.h> #include <util/strencodings.h> #include <util/string.h> #include <util/system.h> #include <vector> inline bool operator==(const util::SettingsValue& a, const util::Setti...
TEST
0.933108
6.484684
fc80a353-addf-494c-b8c0-871d3366f802
jordan-comlinee/algorithm_study
5th/250136.cpp
#include <string> #include <vector> #include <queue> #include <unordered_map> #include <unordered_set> using namespace std; vector<vector<int>> MAP; int N, M; queue<pair<int, int>> q; vector<int> dr = {-1, 0, 1, 0}; vector<int> dc = {0, 1, 0, -1}; bool isIn(int r, int c) { return 0 <= r && r < N && 0 <= c && c < ...
ALGO
0.999745
5.430066
6f5dc817-9447-45d5-ab2e-7a69159dffc5
NOOYOUNG/Algorithms
프로그래머스/1/12918. 문자열 다루기 기본/문자열 다루기 기본.cpp
#include <string> #include <vector> using namespace std; bool solution(string s) { bool answer = true; if(s.size()==4 || s.size()==6){ for(int i=0; i<s.length(); i++){ if((s[i]>='a'&&s[i]<='z') || (s[i]>='A'&&s[i]<='Z')){ answer=false; } } } ...
ALGO
0.99908
5.381208
586ef1bc-9338-46f1-84cf-5db6d7cc12d6
pid011-study-archive/oop-study
examples/9-6-selection_sort.cpp
/* rand()Լ ̿Ͽ 100̸ 10 迭 , ϴ α׷ ۼϽÿ. */ #include <iostream> #include <stdlib.h> #include<time.h> using namespace std; void SelectionSort(int arr[], int len); int main() { const int len = 100; int arr[len]; srand((unsigned)time(NULL)); for (int i = 0; i < 100; i++) { arr[i] = rand() %...
ALGO
0.998656
3.977404
871a6477-7575-46a0-9fb8-f3b12bc57c39
code0100fun/llvm-xtensa
lib/Support/SmallPtrSet.cpp
#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/DenseMapInfo.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/ErrorHandling.h" #include <algorithm> #include <cassert> #include <cstdlib> using namespace llvm; void SmallPtrSetImplBase::shrink_and_clear() { assert(!isSmall() && "Can't shrink a small...
ALGO
0.933803
7.813443
1085d396-aaa1-46a4-893e-10edf395c332
nxplatform/nx-mobile
thirdparty-cpp/boost_1_62_0/libs/spirit/classic/example/fundamental/more_calculators/vmachine_calc.cpp
//////////////////////////////////////////////////////////////////////////// // // The calculator using a simple virtual machine and compiler. // // Ported to v1.5 from the original v1.0 code by JDG // [ JDG 9/18/2002 ] // //////////////////////////////////////////////////////////////////////////// #include <boost/s...
ALGO
0.998464
6.031153
073c5318-df4b-4adc-b4b2-0ef7f05c2ce8
SURYASSACHINP22/practice-
c&cpp/practice/obj_passing_returning.cpp
#include<iostream> using namespace std; class complex { private: int real,imag; public: complex(int x,int y) { real=x; imag=y; } complex(complex &c) //copy constuctor our own { real=c.real; imag=c.imag; } /* when you cant creat any constructo...
TOOL
0.932137
4.675169
6bc843eb-03c6-44a3-bc45-936aa48798e8
little0brother/DataStructure
DataStructureSolution/LinkList/双向链表实现字母表移位.cpp
// ͨ˫ʵĸ˳ĸı // ƶ ƶ #include <iostream> using namespace std; struct Node { char data; Node* prior; Node* next; }; Node* CreateLoopList() { Node* head = new Node; head->data = 0; head->prior = NULL; head->next = NULL; Node* pCur = head; for (char ch = 'A'; ch <= 'Z'; ch++) { Node* pNew = new Node; pNew-...
ALGO
0.999307
3.655883
ef291318-8a76-4827-a088-0c0554b65144
kyokey/MIPT
010.cpp
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cst...
ALGO
0.999973
3.583407
7e480791-72ea-4c1f-952a-2c70baf9ab9a
InwooLeeme/Algorithm
프로그래머스/문자열 내 마음대로 정렬하기.cpp
#pragma GCC target("avx,avx2,fma") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #include <ext/rope> #define fastio ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) using namespace std; vector<string> solution(vector<string> strings, int n) { vector<string> answer; ...
ALGO
0.999823
4.997739
a884caa4-c58c-48f3-8c5a-f3b41e3612fb
victors3136/Data-Structures-and-Algorithms-1-Dynamic-Array
SortedBag.cpp
#include "SortedBag.h" #include "SortedBagIterator.h" #define RESIZE_BOUNDARY 1024 #define default_quantity 1 SortedBag::SortedBag(Relation r) { elements = new TComp[4]; frequencies = new int[4]; capacity = 4; this->count = 0; relation = r; } void SortedBag::resizeUp() { /// T(count) = Theta(count); /// S...
ALGO
0.998612
5.274231
f96275ef-2cec-4e14-b1e1-5644182952bd
gf234/baekjoon-code
11048번 이동하기.cpp
#include <iostream> #include <algorithm> #include <vector> #include <cstdio> #include <cstring> #include <cmath> using namespace std; int n, m; int map[1001][1001]; // solve(r, c) : r,c ؼ ִ ִ int cache[1001][1001]; int solve(int r, int c) { // Ѿ if (r == n || c == m) return 0; int& ret = cache[r][c]; ...
ALGO
0.999869
4.056777
5a045544-d3dd-4561-9d51-8fabf6dc9b41
GAINS-ASEN23/Ground-Software
boost/libs/compute/perf/perf_discrete_distribution.cpp
#include <algorithm> #include <iostream> #include <vector> #include <boost/compute/system.hpp> #include <boost/compute/container/vector.hpp> #include <boost/compute/random/default_random_engine.hpp> #include <boost/compute/random/discrete_distribution.hpp> #include "perf.hpp" namespace compute = boost::compute; int...
TOOL
0.972244
3.96554
f864f7e6-d93a-45b4-b26a-7bc6c7ce7e17
seaurchinss/atcoder_problem
maze_challenge_with_lack_of_sleep.cpp
//拡張ダイクストラ:方向i //最小コストが同じでも方向が違うかもしれないので方向も記録する必要あり #include<iostream> #include<algorithm> #include<vector> #include<cmath> #include<string> #include<map> #include<set> #include<queue> #include<deque> #include<utility> #define rep(i,s,e) for(int i=s;i<e;i++) #define mod 998244353 #define inf 1LL<<60 #define P pair<i...
ALGO
0.999887
4.390392
190752b6-e043-433a-8161-22612a44e2cb
alternateAyush/DSA
01_removeNthNode.cpp
// A singly linked list is given // Input: pointer to a node // delete that node. #include <iostream> using namespace std; struct Node { int data; Node *next; Node(int x) { data = x; next = NULL; } }; void print(Node *head) { if (head == NULL) { return; } N...
ALGO
0.999345
5.612552
4058eca8-93f6-4862-b32a-213aca0a86f8
manhduydl/BigO_Blue09-19
BigO_110919_C++/BFS_L05/ShortestReach_P01.cpp
#include <stdio.h> #include <iostream> #include <vector> #include <queue> using namespace std; #define MAX 1001 #define length 6 int main() { int Q; cin >> Q; while (Q--) { int N, M; cin >> N >> M; // init graph vector<int> graph[MAX]; int u, v; ...
ALGO
0.999912
3.88221
7d9587a2-69d6-4100-8c01-f4143bd1b40d
liehendi11/cpsource
uva_bar_codes.cpp
#include <stdio.h> #include <stdlib.h> #include <vector> #include <cstring> using namespace std; long long dp[52][52][52]; int n,k,m; long long find(int a, int b, int c) { if (dp[a][b][c] == -1) { if ((a==n) && (b == k) && (c<=m)) return 1; int temp=0; if ((a<n) && (c<m) && (b<k)) temp += find(a+1, b...
ALGO
0.999913
3.534358
73e60712-2e81-4b42-885a-99e58f00d7cb
ihays/LeetCode
C++/IslandPerimeter.cpp
//Ian Hays //07-07-2020 //https://leetcode.com/problems/island-perimeter/ //SC: O(1) TC: O(N^2) class Solution { public: int islandPerimeter(vector<vector<int>>& grid) { int count = 0; for(int i = 0; i < grid.size(); i++){ for(int j = 0; j < grid[i].size(); j++){ if(grid...
ALGO
0.999852
5.940854
bc93fea7-f76d-4f9e-b39b-eb1370fac3c7
KiranKaravaev/kattis
ladder.cpp
#include <iostream> #include <math.h> #include <vector> #include <algorithm> #include <map> #include <set> #include <deque> #include <climits> using namespace std; int main() { double h, v; cin >> h >> v; cout << ceil(h / sin(v * 3.14159265 / 180)) << endl; return 0; }
ALGO
0.999726
3.086833
863b6842-4d93-4fb5-97ec-3270186ad0b6
tangxiaotao/navigationExperimen2.0
fuzzy.cpp
#include "fuzzy.h" double fuzzy::Lds[5] = {0, 1.0/4, 2.0/4, 3.0/4, 4.0/4}; /*the fuzzy rules *Z is the 1 ×S is the 2 *M is the 3 *L is the 4 */ int fuzzy::rule[5][3] = {{0,1,2},{0,2,3},{0,3,4},{0,2,3},{0,1,2}}; fuzzy::fuzzy() { wd = 1.0; wv = 1.0/1.5; wLd = 6.0; } double fuzzy::fuzzyOutput(double d...
ALGO
0.999677
4.786498
b2b0af4d-dc87-41c9-b93f-9fab7f6f1ac3
anoobzg/qi
src/opencv/src/modules/photo/src/align.cpp
#include "precomp.hpp" #include "opencv2/photo.hpp" #include "opencv2/imgproc.hpp" #include "hdr_common.hpp" namespace cv { class AlignMTBImpl CV_FINAL : public AlignMTB { public: AlignMTBImpl(int _max_bits, int _exclude_range, bool _cut) : name("AlignMTB"), max_bits(_max_bits), exclude_ra...
TOOL
0.984981
5.323123
618e23ed-1d79-4a9b-a540-384cdcb01a85
SuperSlot0613/leetcodeProblem
119-pascals-triangle-ii/119-pascals-triangle-ii.cpp
class Solution { public: vector<int> getRow(int rowIndex) { vector<vector<int>> v; for (int line = 1; line <= rowIndex+1; line++) { vector<int> row; long C = 1; for (int i = 1; i <= line; i++) { row.push_back(C); ...
ALGO
0.999883
5.797642
c7c53b04-5f22-413c-8665-d9f8a7a087da
vlabakje/aoc2024
day13/one.cpp
#include <deque> #include <iostream> #include <fstream> #include <vector> #include <set> #include <regex> struct Machine { int ax, ay, bx, by, px, py; }; std::vector<Machine> machines_from_string(std::string& contents) { std::vector<Machine> out; std::regex pattern(R"(Button A: X\+(\d+), Y\+(\d+)\nButton ...
ALGO
0.985889
4.889583
c1aa3bb0-3a89-4bfc-b3fc-8ac141a991b7
kunalvaswani123/Codeforces
Problems/998A.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; const ll mod=1e9+7; #define american_pie 3.1415926535 #define pii pair<int,int> #define pll pair<ll,ll> #define pb push_back #define mp make_pair #define fi first #define se second #define qq queue #define pqq priority_queue ll p...
ALGO
0.999696
3.699636
95bd9244-1c89-46a0-966a-1f6484445636
X-czh/Algorithms-LeetCode
700-799/708-Insert-into-a-Sorted-Circular-Linked-List.cpp
// Time complexity: O(n). // Space complexity: O(1). /* // Definition for a Node. class Node { public: int val; Node* next; Node() {} Node(int _val) { val = _val; next = NULL; } Node(int _val, Node* _next) { val = _val; next = _next; } }; */ class Solutio...
ALGO
0.999987
6.223542
cf9c6995-ccc4-495d-b73d-8974ea0112a9
QbitQuantum/Basics
Исходники/PPCReduceCRLogicals.cpp
/// Splits a MachineBasicBlock to branch before \p SplitBefore. The original /// branch is \p OrigBranch. The target of the new branch can either be the same /// as the target of the original branch or the fallthrough successor of the /// original block as determined by \p BranchToFallThrough. The branch /// conditions...
ALGO
0.997968
7.735708
dfd25453-ae23-43ec-8334-852abbf83071
idrizarmin/GymFit
SeminarskiGymFit/UI/gymfit_mobile/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.99762
6.785645
7e18a8d2-69e3-4c2e-ac9d-22646d907e44
ChalozMe/Trabajo-2-Lab
ejercicio05.cpp
#include <iostream> using namespace std; int longitudI(string cadena){ int i=0; while (cadena[i]!='\0'){ i++; } return i; } void unir(char cadena1[], char cadena2[]){ int i = 0; int j = longitudI(cadena2)+1; while (cadena1[i] != '\0') { cadena2[j] = cadena1[i]; j...
TOOL
0.993389
3.534315
059cfdca-3d79-4ae9-9686-12ada3677805
gcp-vais-team1/lammps
src/CG-DNA/pair_oxdna2_dh.cpp
// clang-format off /* ---------------------------------------------------------------------- Contributing author: Oliver Henrich (University of Strathclyde, Glasgow) ------------------------------------------------------------------------- */ #include "pair_oxdna2_dh.h" #include "atom.h" #include "comm.h" #inclu...
ALGO
0.995698
6.135375
cbd2a7bd-7369-4967-b70d-f37cf78cfd52
cisordeng/acmer
src/leetcode/1_two_sum.cpp
// // Created by cisor on 1/30/21. // #include "1_two_sum.h" //int main() { // vector<int> nums = {3, 3}; // int target = 6; // vector<int> result = Solution().twoSum(nums, target); // cout<<"["<<result[0]<<","<<result[1]<<"]"<<endl; // return 0; //}
ALGO
0.97143
5.969221
dd6a4ae0-e681-48ce-a527-c3b70926cf44
Arpit957/DSA-Problem-Solving
LC/Daily challenge 27March.cpp
class Solution { int solve(vector<vector<int>> &grid,int row, int col, int i, int j,vector<vector<int>> &dp){ //base case if(i==row-1 && j==col-1){ return grid[i][j]; } if(i>=row || j>=col){ return INT_MAX; } if(dp[i][j]!=-1){ ...
ALGO
0.999996
6.044122
0bf2baf6-b72f-49e1-9a58-9c0a2b6d0c57
casveen/Enigma
src/configuration_tracker.cpp
//#include "bombe.hpp" #include "configuration_tracker.hpp" using namespace std; //typedef int shint; /* vector<vector<shint>> permutations(int upto, int n) { cout<<"im in"; vector<vector<shint>> out; vector<vector<shint>> result; //out.reserve(pow(n,upto)); XXX put back??? cout<<"n = "<<n; i...
ALGO
0.996989
5.199716
e60ca9bc-ecb6-42f1-8d73-19e8b319e921
ishandutta2007/codeforces
turmax/normal/1249/F.cpp
#include <bits/stdc++.h> using namespace std; #define int long long vector <int> b; vector <vector<int> > a; vector <vector <int> > d; vector <bool> used; vector <int> corn; int n,k; void dfs(int x) { used[x]=true; for(int i=0;i<a[x].size();++i) { if(!used[a[x][i]]) { corn[a[x][...
ALGO
0.999942
4.040523
11f72db0-0ad8-4226-a748-37a989812613
HemangTheHuman/hacktoberfest-2022
DP-patterns/Bitmask-DP/minimum-xor-between-two-arrays.cpp
// TOP DOWN APPROACH class Solution { int val[14][14], n; int dp[14][(1 << 14) - 1]; int solve(int c, int mask) { if (c == n) return 0; if (dp[c][mask] != -1) return dp[c][mask]; int ans = INT_MAX / 2; for (int i = 0; i < n; ++i) { ...
ALGO
0.999997
5.874966
c75d1449-e92a-4356-b060-ccb7ce92f36b
alexandraback/datacollection
solutions_5690574640250880_0/C++/JeffreyHui/GoogleCodeJam2014_Q3.cpp
#include <cstdio> #include <cstdlib> bool YN,YN_2; char s[50][50]; int T,M,R,C,i,j,k,l,m,x,y; int main (){ freopen("C-small-attempt1.in","r",stdin); freopen("GCJ14_Q_Q3_output.out","w",stdout); scanf("%d",&T); for (i=1;i<=T;i++){ scanf("%d %d %d",&R,&C,&M); YN=1; for (j=0;j<R;j++) for (k=0;k<C;k++) s[j][k]='....
ALGO
0.99794
3.422458
c8b7adfd-794d-457e-b9da-227173d3f1e0
abrhamkg/point2mesh
Manifold/Manifold/3rd/igl/parallel_transport_angles.cpp
template <typename DerivedV, typename DerivedF, typename DerivedK> IGL_INLINE void igl::parallel_transport_angles( const Eigen::PlainObjectBase<DerivedV>& V, const Eigen::PlainObjectBase<DerivedF>& F, const Eigen::PlainObjectBase<DerivedV>& FN, const Eigen::MatrixXi &E2F, const Eigen::MatrixXi &F2E, Eigen::PlainObjectB...
ALGO
0.999327
6.137058
dcd224d3-1624-4e71-a3d8-de05f9998748
pedroctag/Exercicios-CPP
entrega8/circulo/circulo.cpp
#include <iostream> #include "circulo.h" using namespace std; istream &operator>>(istream &input, Circulo &x){ input>>x.x>>x.y;} ostream &operator<<(ostream &output, const Circulo &x){ output<<x.raio<<" "; output<<x.x<<" "<<x.y; } Circulo::Circulo(){ raio=1; x=1; y=1; } double Circulo::Area(){ ret...
TOOL
0.92429
4.479642
cd8a4790-df96-493c-8e4a-9ae4db93ce3d
qq82850696/Learning-Note
code/leetcode/top-interview-questions-easy_linked-list_43.cpp
/* data-time 2019-09-22 09:52:56 题目描述: 反转链表 反转一个单链表。 示例: 输入: 1->2->3->4->5->NULL 输出: 5->4->3->2->1->NULL 进阶: 你可以迭代或递归地反转链表。你能否用两种方法解决这道题? 链接:https://leetcode-cn.com/explore/interview/card/top-interview-questions-easy/6/linked-list/43/ /* 主要思路:直接使用指针翻转,将首尾指针相连,接着将下一个和上一个指针的指向相反。直到遇到最后一个尾部指针。 */ #include <iostre...
ALGO
0.999945
5.36641
09b27782-5999-46f1-88be-6b53b2f04cee
OpenXiangShan/GEM5
src/systemc/tests/systemc/misc/v1.0/dash5/pulse.cpp
/***************************************************************************** pulse.cpp -- Implementation of the pulse generator. Original Author: Ali Dasdan, Synopsys, Inc. *****************************************************************************/ /*****************************************************...
TOOL
0.952855
6.238477
2b133a48-c63b-488d-9b76-4b76c5fba9a0
Just-CAF/platform_frameworks_av
media/libstagefright/codecs/amrwb/src/pit_shrp.cpp
/* ------------------------------------------------------------------------------ Filename: pit_shrp.cpp Date: 05/08/2007 ------------------------------------------------------------------------------ REVISION HISTORY Description: ----------------------------------------------------------------------------...
ALGO
0.999254
6.073815
a324c77f-e9e0-41ae-a55a-a23163f70da7
ken8787/CH5_HW2
p13/source/main.cpp
#include <stdio.h> #include<stdlib.h> void cubeby(int &nptr); int main(void) { int num = 5; printf("\nThe new value of number is %d\n", num); cubeby(num); printf("\nThenew value of number is %d\n", num); system("pause"); return 0; } void cubeby(int &nptr) { nptr = nptr * nptr*nptr; }
TOOL
0.981412
3.713724
04f8038b-257a-4cbf-98c0-8bd5fee740df
ammarGamal123/Codeforces-Solutions
CodeForces/GNU C++14/1840A | Cipher Shifer/208771459.cpp
#include <bits/stdc++.h> using namespace std; using int64 = int64_t; #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define int long long #define lll __int128 #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> #define Ceil(n, m) (((n) / (...
ALGO
0.999983
4.415515
4c83f301-7203-4e6f-bc42-09823217d940
Yashwantoo7/dsac-
algo/optimalBST.cpp
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. ******************************************...
ALGO
0.999964
4.115819
ef5a76c1-9ff0-40a9-90d6-99f0278fd5df
DennisTjeerdsma/cpp
chapter 3/3.2/3_17.cpp
#include <iostream> #include <vector> #include <string> #include <cctype> using namespace std; int main() { string s; vector<string> v; while (cin >> s){ v.push_back(s); } for (auto &i : v){ for (auto &k : i){ k = toupper(k); } } for (auto i : v){ cout << i; } cout << endl <...
ALGO
0.993012
4.540681
0dceb3ab-1b04-4c0f-87a7-c5febf98410f
PixelOS-Fourteen/frameworks_av
media/module/codecs/amrnb/common/src/q_plsf_5.cpp
/* Pathname: ./audio/gsm-amr/c/src/q_plsf_5.c Funtions: ------------------------------------------------------------------------------ REVISION HISTORY Description: Placed code in the PV standard template format. Updated to accept new parameter, Flag *pOverflow. Description: Eliminated unused inc...
ALGO
0.999855
3.731525
175bfe6f-f500-42d0-9421-55021ae547f9
muhimin30/Codeforces_Practice
1735B - Tea with Tangerines.cpp
//Muhimin #include <bits/stdc++.h> using namespace std; #define ll long long #define endl '\n' int main() { ios_base::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while(t--){ int n; cin >> n; vector<int> num(n); int mn = 1e8; for(int i = 0; i < n; i++){ cin >> num[i]; mn = min(mn, num[i]); ...
ALGO
0.999757
4.746145
327e2916-2fd9-4b11-8403-a134593d9c5e
youlive789/AlgorithmStudy
BackJoon/string/10822.cpp
#include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; vector<string> split(string input, char delimiter) { vector<string> answer; stringstream ss(input); string temp; while (getline(ss, temp, delimiter)) { answer.push_back(temp); } return a...
ALGO
0.98934
5.501556
e9b1b0e3-a171-40e7-b85e-dc1ece2443d4
rgoerv/Yandex
Past/sprint12/TransportCatalogue 12/domain.cpp
#include "domain.h" #include "geo.h" namespace domain { bool Bus::CheckStop(const Stop* stop) const { return std::count(route_.begin(), route_.end(), stop) > 0; } size_t HacherPair::operator()(const std::pair<const Stop*, const Stop*>& stops) const { return std::hash<const void*> {}(stops.first) ...
ALGO
0.967551
5.660533
d80a8aed-186f-43cf-9f36-5ca12945e000
LinCY0202/Program-collection_tame
C_C++/other/實作題練習10503-1.cpp
#include<stdio.h> #include <algorithm> using namespace std; //Usortqjƨp //int aa(int b,int c){ //return b>c;} int main(){ int a[100]; int b=0,c=-1,d=101; int i; scanf("%d",&b); for(i=0;i<b;i++){ scanf("%d",&a[i]); } a[i]=101; sort(a,a+b); //ƧǨ禡 // printf("%d",i); for(i=0;i<b;i++){ if(a[i]<60&&a[i...
ALGO
0.999481
3.565665
e135c68c-12ee-4cd1-82ca-27a15c6d9b82
SEU-ACAL/reproduce-MEEK-DAC-25
Software/parsec/pkgs/apps/facesim/src/Public_Library/Matrices_And_Vectors/SYMMETRIC_MATRIX_3X3.cpp
using namespace PhysBAM; //##################################################################### // Function Fast_Eigenvalues_Double //##################################################################### // lambda_x > lambda_y > lambda_z template<class T> DIAGONAL_MATRIX_3X3<double> SYMMETRIC_MATRIX_3X3<T>:: Fast_Eige...
ALGO
0.999968
5.205302
fe5d53bd-e708-4be8-ba7d-6b1bf02dce46
hiepkhach7488/BeingThere
beingthere_v3d/GL/v3d_gpuundistort.cpp
#include "v3d_gpuundistort.h" #include <GL/glew.h> #if defined(V3DLIB_GPGPU_ENABLE_CG) using namespace V3D_GPU; namespace { Cg_FragmentProgram * parametricShader = 0; Cg_FragmentProgram * radialLUTShader = 0; } namespace V3D_GPU { void ParametricUndistortionFilter::allocate(int w, int h) { ...
TOOL
0.865542
5.603412
41b81308-1cc2-4cb7-9d96-6304b9a03f1b
taewoocode/cppalgorithm
codeup/100solve/array/1410.cpp
#include<bits/stdc++.h> using namespace std; int main(){ string s; getline(cin, s); int openCnt = 0; int closeCnt = 0; for(int i = 0; i < s.size(); i++){ if(s[i] == '(') openCnt++; if(s[i] == ')') closeCnt++; } cout << openCnt << " " << closeCnt << '\n'; return 0;...
ALGO
0.998402
5.280072
52548eed-cb33-4ac1-ad6d-f9c674b73087
breadream/Algorithms
find_prime/find_prime_better_version.cpp
/** In order to find prime numbers using Sieve of Eratosthenes, there's no need to divide the input number N by the all multiple of numbers If there is a composite number m, m is composed of a * b At that point, at least one of them is less than or equal to sqrt(N) */ #include <iostream> #include <cma...
ALGO
0.999882
4.346362
36786d27-4397-4408-8686-b6d5a61b0bcc
samuelpmish/LBVH
tests/bvh_performance_test.cpp
#include "BVH.hpp" #define ANKERL_NANOBENCH_IMPLEMENT #include "nanobench.h" #include <array> #include <random> #include <iostream> template < int dim > using AABB = fm::AABB<dim>; float random_real() { static std::default_random_engine generator; static std::uniform_real_distribution<float> distribution(-1.0,1...
TEST
0.981223
6.904685
b639c0d8-6ce9-4b14-a8b6-a790e015d165
jewelrana77/OS
fcfs.cpp
#include<bits/stdc++.h> using namespace std; int main() { int i,n,at,bt; cout<<"Enter Number of Process"<<endl; cin>>n; multimap<int,pair<int,int>>m; int ct=0; vector<int>vec[n+1]; for(i=0;i<n;i++) { cout<<"Enter arrival time of process "<<i+1<<" "; cin>>at; co...
ALGO
0.999575
3.332151
e0e9f5e8-1485-4a42-92b9-b1650c705b37
NikhilSaxena-890/DSA_Nikhil
BinarySearchTree/Insert.cpp
#include <iostream> #include <vector> #include <queue> using namespace std; // 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) {} TreeNod...
ALGO
0.999983
7.213614
8e9ee9c4-b492-4d49-8f1b-5adfff3df610
Md-Tanvir2034/Vector
prac1.cpp
#include<iostream> #include<vector> using namespace std; int main(){ vector<int> v = {1,2,1,4,4}; int x = 0 ; for( int i : v){ x ^= i ; } cout<< x <<endl; return 0; }
ALGO
0.999924
4.592671
90da332e-8a5f-47ea-97aa-49df29bdb3c3
davidtuan02/DOAN_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.998733
6.76775
cf34c8e8-a7cb-4228-983f-4c614394f500
ishandutta2007/codeforces
akim/normal/771/A.cpp
#include <iostream> #include <cstdio> #include <algorithm> #include <cmath> #include <string> #include <vector> #include <stack> #include <queue> #include <set> #include <cstring> #include <map> #include <cstdlib> #include <ctime> #include <cassert> #include <bitset> #define f first #define s second #define ll long lon...
ALGO
0.999988
4.401153
015015ae-55cd-4e00-b534-391f8d9109ba
meyira/OIDA
code/opaque/nr-oprf/PQ-MPC/extern/SEAL/src/seal/util/polyarithsmallmod.cpp
#include "seal/util/common.h" #include "seal/util/uintcore.h" #include "seal/util/uintarithsmallmod.h" #include "seal/util/uintarith.h" #include "seal/util/polycore.h" #include "seal/util/polyarith.h" #include "seal/util/polyarithsmallmod.h" #include "seal/util/defines.h" using namespace std; namespace seal { nam...
ALGO
0.99629
5.901409
9b57bbaa-ae16-4ff9-9033-3a71826c2aad
ariolandi/SDP-2023
03. Стек и опашка - упражнение/task-03.cpp
#include <iostream> #include <string> template <typename T> struct Node { T value; // стойност на полето Node<T>* next; // връзка към следващото поле }; // създаване на елемент template <typename T> Node<T>* create(const T& value, Node<T>* next=nullptr) { return new Node<T>{value, next}; } // ...
ALGO
0.999514
5.424273
91b8777a-6208-40c0-a210-9a928fd9c608
phidiaLam/GAMES
GAMES101_Homework_S2021/Homework7/Assignment7/BVH.cpp
#include <algorithm> #include <cassert> #include "BVH.hpp" BVHAccel::BVHAccel(std::vector<Object*> p, int maxPrimsInNode, SplitMethod splitMethod) : maxPrimsInNode(std::min(255, maxPrimsInNode)), splitMethod(splitMethod), primitives(std::move(p)) { time_t start, stop; time(&start);...
ALGO
0.99831
6.027721
b87d8b33-1d8b-4532-b86b-4bbf42fa69f9
raincross7/code-similarity
codes/train_code/problem110/problem110_61.cpp
#include <iostream> #include <iomanip> #include <algorithm> #include <utility> #include <cmath> #include <string> #include <vector> #include <set> #include <map> #include <queue> #include <stack> #include <deque> #include <utility> using namespace std; using ll = long long; using P = pair<int, int>; #define rep(i, n...
ALGO
0.999968
3.777862
7e1998f1-c3e6-4886-93c4-4a48530f49fb
LucasGualtieri/CC-PUC
PAA/IterativeQuicksort/iterativeQuicksort.cpp
#include <algorithm> #include <iostream> #include <random> #include <utility> #include <fstream> #include <iomanip> // for setprecision #include "../../../PAA-TP01/include/timer.hpp" #include "../../../PAA-TP01/DataStructures/utils/Pair.hpp" #include "../../../PAA-TP01/DataStructures/include/list/linearList.hpp" #incl...
TEST
0.999596
6.061534
e0d4912f-527d-4e1a-b0be-f42e6d1a7375
iamrakesh28/Competitve-Programming
emaxx/Scheme.cpp
#include <bits/stdc++.h> using namespace std; list <int> *adj; int *deg; bool *visit; void addEdge(int u,int v) { adj[u].push_back(v); } int DFS(int u) { visit[u] = true; int next = u; for(auto it = adj[u].begin();it != adj[u].end(); ++it) { if(visit[*it] == false) { next = DFS(*it); } else next = *i...
ALGO
0.999865
3.765177
f2738482-6b26-473d-9994-0442cedce6cf
ishandutta2007/codeforces
alexandr_ts/normal/667/B.cpp
#include <bits/stdc++.h> #define fr(i, n) for (int i = 0; i < n; i++) #define frab(i, a, b) for (int i = a; i < b; i++) #define pb push_back #define mp make_pair using namespace std; typedef long long ll; typedef long double ld; const int N = 1e6 + 3; const ll MOD = 10000*10000; const ll INF = 2e9 + 10; ll a[N]; i...
ALGO
0.993486
3.515942
c84abe17-6bde-4c5e-b2e7-42b47971f77f
tatajack/coding_interview_practices
leetcode/113.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.99997
6.456069
0899d5a7-6f86-49aa-b23f-ef100c86c654
ishandutta2007/codeforces
generic_placeholder_name/normal/1305/G.cpp
#pragma GCC optimize("Ofast") #pragma GCC optimization("unroll-loops, no-stack-protector") #pragma GCC target("avx,avx2,fma") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/trie_policy.hpp> #include <ext/rope> using namespace std; using namespace __gnu_pbds; using namespace __gn...
ALGO
0.99997
4.040159
2cca589e-04ba-4c53-81c2-9353c379ed81
pingjuiliao/softbound
llvm-project-13.0.0.src/llvm/lib/CodeGen/MachineSink.cpp
#include "llvm/ADT/DenseSet.h" #include "llvm/ADT/MapVector.h" #include "llvm/ADT/PointerIntPair.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SparseBitVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/AliasAnalysis.h" #include "ll...
ALGO
0.999006
3.681091
622b467a-d9cd-43da-b79c-72f637434bf5
vfolunin/archives-solutions
UVa Online Judge/12238.cpp
#include <iostream> #include <algorithm> #include <vector> #include <set> #include <map> #include <string> using namespace std; struct Graph { vector<map<int, int>> graph; vector<vector<int>> ancestor; vector<vector<long long>> sumWeight; vector<int> l, r; int timer; Graph(int vertexCount) : ...
ALGO
0.999695
4.406123
8f01cdfa-887e-4356-be07-b5e69f7da3c7
BigSecret1/leetcode
2024/Jul/Intersection of Two Arrays II.cpp
class Solution { public: vector<int> intersect(vector<int>& nums1, vector<int>& nums2) { int mx = 1005; int arr1[mx], arr2[mx]; memset(arr1, 0, sizeof(arr1)); memset(arr2, 0, sizeof(arr2)); int n = nums1.size(), m = nums2.size(); for(int i = 0; i < n; ++i) { int number = nums1[i...
ALGO
0.999988
5.224505
f30480c9-307a-4495-b6c6-b736494ca058
kazi-nayeem/Programming-Problems-Solutions
lightoj/1117 - Helping Cicada.cpp
#include<cstdio> #include<cstring> #include<iostream> using namespace std; #define lli long long int lli res, n, m; lli arr[16]; void backtrack(lli lcm, lli pos, lli tak); lli LCM(lli a, lli b); lli GCD(lli a, lli b); int main() { int te, ti; scanf("%d", &ti); for(te = 1; te <= ti; te++) { s...
ALGO
0.999864
3.597335
a694ff92-a629-450a-a0dc-d9d58194b8c7
imanashev/yandex-taxi
calculator/main.cpp
#include <iostream> #include <map> #include <sstream> #include <fstream> #include <string> #include <stack> using Variables = std::map<char, int>; bool isDigit(char c) { return c >= '0' && c <= '9'; } bool isAlpha(char c) { return c >= 'a' && c <= 'z'; } void initVariables(Variables &variables, const std::s...
ALGO
0.999727
5.291276
f68a1ddf-8b34-4df4-8978-59c830a2cfb1
Adi1222/Coding-Interview-Preparation
Greedy/InterviewBit/Queue Reconstruction by height.cpp
/* Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in front of this person who have a height greater than or equal to h. Write an algorithm to reconstruct the queue. */ class Solut...
ALGO
0.999984
5.449615
09cbcc5d-ac66-47e4-8840-678fa4194732
MijaTola/Codeforce
864B.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; string s; cin >> s; string cur = ""; int ans = 0; for (int i = 0; i < (int)s.size(); ++i){ if(s[i] >= 'a' and s[i] <= 'z') cur += s[i]; else{ set<char> st; ...
ALGO
0.999555
4.010969
00f4f0b5-6e05-4c78-afae-f208d243907a
Haar-you/kyopro-lib
test/aoj/DSL_5_A/main.test.cpp
#define PROBLEM "http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_5_A" #include <algorithm> #include <iostream> #include "Mylib/Algorithm/imos_1d.cpp" #include "Mylib/IO/input_tuples.cpp" namespace hl = haar_lib; int main() { int N, T; std::cin >> N >> T; hl::imos_1d<int> imos(T + 1); for (auto ...
ALGO
0.999856
4.912364