uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
4e9be424-eae3-46c7-bf0e-625d3c3b2d9b
patflick/psac
src/psac.cpp
/** * @file ldss.cpp * @author Patrick Flick <<EMAIL>> * @brief Executes and times the suffix array construction using * libdivsufsort. */ // include MPI #include <mpi.h> // C++ includes #include <fstream> #include <iostream> #include <string> // using TCLAP for command line parsing #include <tcl...
ALGO
0.99364
5.770044
9b244253-4d5a-45f4-bab9-e2f759854cfc
Jaiderbr/CompetitiveProgramming
String/Kmp.cpp
//Cuenta las ocurrencias del string p en el string s. vector<int> prefix_function(string& s) { int n = s.size(); vector<int> pf(n); pf[0] = 0; for (int i = 1, j = 0; i < n; i++) { while (j && s[i] != s[j]) j = pf[j - 1]; if (s[i] == s[j]) j++; pf[i] = j; } return pf; } ...
ALGO
0.999732
5.301576
cdda9b79-e277-4b2c-bf2e-e6e92ea38e33
jayesh001j/C-language
day 12/task 9.cpp
#include<stdio.h> int main() { int num, count = 1; printf("Enter a number\n"); scanf("%d", &num); printf("\nMultiplication table for %d is:\n\n", num); while(count <= 10) { printf("%d x %d = %d\n", num, count, (num*count)); count++; } return 0;...
ALGO
0.978138
3.318064
44fc1894-4066-480a-ab2f-2825a1ff8cb9
nhile14112003/Assets
Lập trình trên thiết bị di động/flutter_navigation_demo/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.998378
6.76073
6e85b612-7b88-43bd-ab81-0f68764b12d2
asifs-cse/STL-using-Cpp
upperBound.cpp
#include<iostream> #include<vector> #include<set> #include<iterator> #include<algorithm> using namespace std; int main(){ vector<int> v={20,21,22,48,44}; set<int> s(v.begin(), v.end()); //auto it= upper_bound(v.begin(), v.end(),44); auto it=s.lower_bound(3); //check condition cout<<((it==s.end...
ALGO
0.999742
3.722114
a4f34db3-91c9-4f34-b748-34b379900411
barrystyle/ravencoin-24.x
src/init/common.cpp
#if defined(HAVE_CONFIG_H) #include <config/bitcoin-config.h> #endif #include <clientversion.h> #include <fs.h> #include <logging.h> #include <node/interface_ui.h> #include <tinyformat.h> #include <util/string.h> #include <util/system.h> #include <util/time.h> #include <util/translation.h> #include <algorithm> #inclu...
TOOL
0.875188
7.312501
60f2cf63-d03a-4dfb-97bd-175539513ed5
Sambit57/LeetCode
C++/cracking-the-safe.cpp
// Time: O(k^n) // Space: O(k^n) // https://en.wikipedia.org/wiki/De_Bruijn_sequence // https://en.wikipedia.org/wiki/Lyndon_word class Solution { public: string crackSafe(int n, int k) { const int M = pow(k, n - 1); vector<int> P; for (int i = 0; i < k; ++i) { for (int q = 0; ...
ALGO
0.999915
6.952305
49614928-58ce-4481-8594-c8805642cd53
Gaolious/algorithm
Baekjoon/016000_016999/16455/main.cpp
#include <bits/stdc++.h> template <typename T> inline T min(T a, T b) { return a < b ? a : b ; } int kth(std::vector<int> &a, int k) { const int MaxN = 1000000000; const int MaxDiv = 50000; int radix[MaxDiv]={0,}, order [MaxDiv]={0,}; int i; int idx_radix, idx_order ; for ( i = a.size() ...
ALGO
0.9999
3.64516
d4f218d5-5f7d-441e-b7e1-37422f3e9dfd
amirphl/learning
algorithms/geeks-for-geeks/dynamic-programming/sum-of-all-substrings-of-a-string-representing-a-number.cpp
// https://www.geeksforgeeks.org/sum-of-all-substrings-of-a-string-representing-a-number/ //{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: //Function to find sum of all possible substrings of the given string. // time: O(n), memory: O(1) l...
ALGO
0.999915
6.793925
bb9f157b-57f4-4c97-a6d3-76c984765418
sanketshinde2005/DSA
Sorting/Shell_Sort.cpp
#include <iostream> using namespace std; void Bubble(int A[], int n) { int i, j, temp; for (i = 0; i < n - 1; i++) { for (j = 0; j < n - 1 - i; j++) { if (A[j] > A[j + 1]) { temp = A[j]; A[j] = A[j + 1]; A[j + 1] = temp...
ALGO
0.999961
4.509057
35b64ffa-3d05-4efd-ab61-fa66ea92f310
Shannju/njucser_helphelp
Algorithm算法/Code/5/.history/1.4_20220527202031.cpp
#include <iostream> #include "stdio.h" #include <vector> #include <list> #include <algorithm> #include <map> using namespace std; // DSU data structure // path compression + rank by union #define SIZE 500 #define INT_MAX 2147483647 int n, m, k; int ans1; class DSU { int *parent; int *rank; public: DSU(int n) ...
ALGO
0.999986
3.82165
7aab0b93-9e43-4aa3-882d-bbcea082fd08
dfma-1/denisse-y-compa-ia
miriam.cpp
/*fehcqa 20 de junio nombre miriam alvarez aguilar */ #include <stdio.h> #include <ctype.h> int main() { char resp; /* respuesta del usuario */ printf("Es masculino o femenino (M/F)? "); scanf(" %c", &resp); resp = toupper(resp); switch (resp) { case 'M': puts("Es un enfer...
ALGO
0.987448
3.208018
b8305135-24aa-40de-a019-0475975ee4af
BAPGAP/hanyang
Algorithm/백준/1476/main.cpp
#include <iostream> using namespace std; int main() { int e,s,m; cin >> e >> s >> m; int Answer = (28*19*13*e + 15*19*17*s + 15*28*10*m)%(15*28*19); if(Answer == 0) Answer = 15*28*19; cout << Answer; }
ALGO
0.999886
3.482257
b01f69f2-907e-40b9-803c-a7b705a724cf
rahulpinto19/ds
1972-rotating-the-box/1972-rotating-the-box.cpp
class Solution { public: char getval(int val) { if (val == 0) return '.'; else if (val == 2) return '*'; else return '#'; } vector<vector<char>> rotate90Right(vector<vector<int>>& matrix) { int m = matrix.size(); int n = ma...
ALGO
0.999897
5.965267
c3f0cccb-34bd-42bd-9e1e-351022702a2f
ishandutta2007/codeforces
coderanshu/normal/1106/A.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.999894
4.863185
971022a0-fba5-43a2-9d81-b8d0011b6aed
dangvu2405/1000baicodethieunhi
bai_khang104.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int ngay, thang ,nam; do{ cout<<"nhap ngay:";cin>>ngay; cout<<"nhap Thang:";cin>>thang; cout<<"nhap nam:";cin>>nam; if(ngay>31 || thang >12){ cout<<"ngay khong ton tai, yeu cau nhap lai!"<<endl; } } while(ngay>31 || thang >12); if(nam%4!=0 && nam%...
ALGO
0.99908
3.761948
a10a2dce-6684-451c-9149-8d8ab06704ad
hbthanh5802/CTDL-GT
NGAN_XEP_1.cpp
#include<bits/stdc++.h> using namespace std; int st[205], top = 0; main(){ string s; while(cin >> s){ if(s == "push"){ int x; cin >> x; st[++top] = x; } else if(s == "pop"){ if(top > 0) top--; } else { if(top > 0){ for(int...
ALGO
0.998938
4.174842
cd406fb9-eb96-41a5-92c9-3a0af1abeeb5
masonjacob/xmos-vocal-motion
src/examples/TMCStepper_SPI/eigen-3.4.0/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; int main() { Eigen::MatrixXf mat(2,4); Eigen::VectorXf v(2); mat << 1, 2, 6, 9, 3, 1, 7, 2; v << 0, 1; //add v to each column of m mat.colwise() += v; std::cout << "Broadcasting result: " << std::endl;...
ALGO
0.995647
4.136906
f2aad6a9-36e8-40db-b092-c6ea7b7ec94a
XiaoXiaoLui/CodeForces
10/A.cpp
#include <iostream> using namespace std; #define N 102 int main() { int n, p1, p2, p3, t1, t2, i; int a[N][2]; int interval; int sum = 0; cin >> n >> p1 >> p2 >> p3 >> t1 >> t2; for (i = 0; i < n; i++) { cin >> a[i][0] >> a[i][1]; sum += (a[i][1] - a[i][0]) * p1; } for (i = 1; i < n; i++) { int...
ALGO
0.999265
3.518548
543d34e3-b334-4137-aadb-57353e2312bf
JoydeepMallick/DSA_PRACTICE
tree/BST/bst_search.cpp
#include<bits/stdc++.h> using namespace std; struct node{ int data; struct node *left, *right; }; struct node* Create(int ele){ struct node* newnode = (struct node*)malloc(sizeof(struct node)); newnode->data = ele; newnode->left = NULL; newnode->right = NULL; return newnode; } bool search...
ALGO
0.999951
3.569478
ece9ccb8-ec3e-4eb7-8f02-a53c00714f2f
nikunj-lohia/practice-cpp
btree.cpp
// Deleting a key from a B-tree in C #include <stdio.h> #include <stdlib.h> #define MAX 3 #define MIN 2 struct BTreeNode { int item[MAX + 1], count; struct BTreeNode *linker[MAX + 1]; }; struct BTreeNode *root; // Node creation struct BTreeNode *createNode(int item, struct BTreeNode *child) { struct BTreeNode...
ALGO
0.999982
4.480591
8d47d52f-04b5-497b-a8fd-1d0cc44c665b
vanderkorn/fractals
newton/newton.cpp
//$$---- Form CPP ---- //--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "newton.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; //----------------...
TOOL
0.980557
4.466341
c5c0656f-985f-4305-94b3-e3e49001ef4e
OIMOmzx/MyCode
题目集锦/Leetcode/1.简单/L53. 最大子序和.cpp
#include <bits/stdc++.h> #include <vector> using namespace std; class Solution { public: int maxSubArray(vector<int>& nums) { int ans = -INT_MAX, res = 0, len = nums.size(); for (int i = 0; i < len; i++) { if (res < 0) res = 0; res += nums[i]; ans =...
ALGO
0.999866
5.714848
67469b74-c59c-478e-bd01-3eca97ee3048
finetglazer/finetglazer
giaithua(dequy).cpp
#include<bits/stdc++.h> #define q 1000000007 using namespace std; long long fib(int n) { if(n==0) return 0; if(n==1) return 1; long long fib0=0; long long fib1=1; long long fibn; n--; while(n--) { fibn=(fib0 +fib1)%q; fib0=fib1; fib1=fibn; } retur...
ALGO
0.999938
4.339222
bcaf0041-5c57-43e9-ac15-6e2a07c4d9fa
DMoNex/Baekjoon
1000/2167/main.cpp
#include <iostream> using namespace std; int main() { int N, M, K, ki, kj, kx, ky, sum = 0; int arr[300][300] = { 0 }; cin >> N >> M; for (int i = 0; i < N; ++i) for (int j = 0; j < M; ++j) cin >> arr[i][j]; cin >> K; while (K--) { sum = 0; cin >> ki >> kj >> kx >> ky; for (int i = ki - 1; i < kx...
ALGO
0.998479
3.722608
1d047f59-81ff-420f-a97e-da778cca9dfa
sarvex/leetcode-chicken
solution/1800-1899/1833.Maximum Ice Cream Bars/Solution.cpp
class Solution { public: int maxIceCream(vector<int>& costs, int coins) { sort(costs.begin(), costs.end()); int n = costs.size(); for (int i = 0; i < n; ++i) { if (coins < costs[i]) return i; coins -= costs[i]; } return n; } };
ALGO
0.999834
6.1008
12b6e9ed-20b3-4631-b988-fd9d1d0d8e75
WatanabeChika/Course-Codes
CS2602_Data_Structure/homework/que6.2.cpp
#include <iostream> using namespace std; template<class elemType> void shellSort(elemType *a, int n) { int step, i, j; elemType tmp; for (step = n/2; step > 0; step/=2) { for (i = step; i < n; ++i) { tmp = a[i]; j = i; while (j-step >= 0 && a[j-step] > tmp) { ...
ALGO
0.999991
3.56769
9ec80741-dbee-435d-bff8-6e40db8f8c3b
Prasad-Boddu/competative-coding
codechef/ccjune0.cpp
#include<bits/stdc++.h> using namespace std; #define s(n) scanf("%d",&n) #define sl(n) scanf("%lld",&n) #define sf(n) scanf("%lf",&n) #define ss(n) scanf("%s",n) #define sc(n) scanf("%c",&n) #define PI(n) printf...
ALGO
0.999983
3.886974
845d39a9-11d1-4127-8504-a2b22ef57463
raincross7/code-similarity
codes/train_code/problem301/problem301_33.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int n; // int w[100]; cin >> n; vector<int>w(n); int sum=0; for(int i=0;i<n;i++){ cin >> w[i]; sum += w[i]; } int ans=1e9; int now=0; for(int i=0;i<n;i++){ now += w[i]; ans=min(ans,abs(sum-...
ALGO
0.999986
3.822066
85c3569f-ec5a-4d66-b906-4748008a6e29
Jiapeng-Pei/LeetCode
Code/Q348.cpp
/** * Your TicTacToe object will be instantiated and called as such: * TicTacToe* obj = new TicTacToe(n); * int param_1 = obj->move(row,col,player); */ #include <vector> using namespace std; class TicTacToe { public: int n; vector<int> rows; vector<int> cols; vector<int> diagnols{0, 0}; TicTa...
ALGO
0.999831
6.677554
0431743e-7210-4101-9977-3ca64736577f
HanSeulCoding/Algorithm-C-
HashMap/HashMap/HashMap.cpp
#include<iostream> #include <string> using namespace std; #define HashMapSize 3 template<typename T, typename V> class Node { public: T key; V value; Node<T,V>* next = NULL; Node(T key, V value) :key(key), value(value) {} }; template<typename T, typename V> class LinkedList { private: int size = 0; public: Node<...
ALGO
0.996737
3.543876
86415d4c-7eb3-4296-bfb6-47f41d1d266a
wonghoifung/tips
leetcode/medium_counting_bits.cpp
#include <string> #include <vector> #include <iostream> #include <map> #include <unordered_map> #include <unordered_set> #include <set> #include <queue> #include <deque> #include <stack> #include <array> #include <memory> #include <sstream> #include <functional> #include <algorithm> #include <bitset> #include <tuple> #...
ALGO
0.999809
4.392893
2d3fdce1-9dea-44c1-8ed4-58bfba80cb82
Gilgameshgb-1/AlgorithmsAndDataStructures
PZ1/ZAD 6/samostalan_rad6.cpp
#include <iostream> #include <vector> void MaxMin(std::vector<std::vector<int>> v){ } int main(){ std::vector<std::vector<int>> v; /* for(int i = 0; i<3 ;i++){ std::vector<int> v1; for(int j=0;j<3;j++){ v1.push_back(1); } v.push_back(v1); }*/ }
ALGO
0.99857
3.184311
0aac5c29-859f-4b5e-8b50-a1668b770021
zhuzhuc/Algorithm
入门6/P5743.cpp
#include <bits/stdc++.h> // #pragma GCC optimize("O3,unroll-loops") // #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") using namespace std; #define ll long long #define ff first #define ss second #define pb push_back #define eb emplace_back const int maxn = 2e5 + 2; const int maxm = 62; bool isLeapYear(int year) { ...
ALGO
0.999901
4.26666
6822cddc-ba43-4f1b-9245-6db9c38f13ec
dmehrab06/Time_wasters
uva/contest/K.cpp
/*-------property of the half blood prince-----*/ #include <bits/stdc++.h> #include <dirent.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/detail/standard_policies.hpp> #define MIN(X,Y) X<Y?X:Y #define MAX(X,Y) X>Y?X:Y #define ISNUM(a) ('0'<=(a) && (a)<='9') #defin...
ALGO
0.987389
3.430016
74a4fe35-f1ae-47a6-b401-fc82119d6024
sarvex/leetcode-clojure
solution/1700-1799/1784.Check if Binary String Has at Most One Segment of Ones/Solution.cpp
class Solution { public: bool checkOnesSegment(string s) { return s.find("01") == -1; } };
ALGO
0.999663
5.732506
83edcd54-d296-47e4-a54a-560bc37964d3
NehaDeoreCodes/NEHA_ASSIGHNMENTS-
Neha_Day1_Assignment/Q.16.cpp
/*2.Write a C program to check whether a given number is even or odd. Test Data: 15 Expected Output: 15 is an odd integer.*/ #include <stdio.h> int main() { int number; printf("Enter a number: "); scanf("%d", &number); if (number % 2 == 0) { printf("%d is an even integer.\n", number)...
ALGO
0.951167
4.357392
e795d09b-7d41-492a-bc3c-47ba91f40cc8
pavellevap/code_antiplagiat
test/06/588.cpp
/* User:JeffCsoul Time: No.: Everything will be better. */ #include <cstdio> #include <iostream> #include <cstring> #include <string> #include <map> #include <vector> #include <algorithm> #include <cstdlib> using namespace std; #define rep(a,b,c) for(int a=b;a<=c;++a) #define per(a,b,c) for(int a=b;a>=c;--a) #define ...
ALGO
0.999735
3.217337
dac97865-97d6-4b65-a15c-7b95ef69220f
byrantwithyou/PhysBAM
Public_Library/Deformables/Constitutive_Models/NEO_HOOKEAN.cpp
using namespace PhysBAM; //##################################################################### // Constructor //##################################################################### template<class T,int d> NEO_HOOKEAN<T,d>:: NEO_HOOKEAN(const T youngs_modulus_input,const T poissons_ratio_input,const T Rayleigh_coeffi...
ALGO
0.974674
6.126409
2f9fc005-33a8-4ac2-b7f8-06719c72db47
priyansh2120/CSES_solutions
Sorting and searching/Ferris_Wheel.cpp
// https : // cses.fi/problemset/task/1090 #include <bits/stdc++.h> using namespace std; typedef long long int ll; #define rep(i, a, n) for (int i = a; i < n; i++) #define per(i, a, n) for (int i = n - 1; i >= a; i--) #define pb push_back #define mp make_pair #define eb emplace_back #define all(x) (x).begin(), (x).end(...
ALGO
0.99996
4.742067
69877837-0e14-40d8-a44a-b3e3a8f29709
Bohdan426/OpenSenceGraph
src/osgPlugins/gles/TriangleMeshSmoother.cpp
#include "TriangleMeshSmoother" TriangleMeshSmoother::TriangleMeshSmoother(osg::Geometry& geometry, float creaseAngle, bool comparePosition, int mode): _geometry(geometry), _creaseAngle(creaseAngle), _graph(0), _mode(mode) { if(!_geometry.getVertexArray() || !_geometry.getVertexArray()->getNumEleme...
TOOL
0.932193
7.503861
edd2081f-9851-489b-827c-c2702b4421ac
shubhankar-bt/Love-Babbar-dsa
6th class/4th.cpp
#include<iostream> using namespace std; int main(){ int T; cin>>T; while (T--) { long long N; cin>>N; if (N == 1|| N == 3|| N == 5){ cout<<"no"<<endl; }else{ cout<<"yes"<<endl; } } return 0; }
ALGO
0.999676
4.242946
e31ce507-225e-462c-852d-b2ec27075806
Biggig/C_and_C_plus_test
make_heap.cpp
#include<vector> #include<algorithm> #include<iterator> #include<iostream> using namespace std; bool compare(int t1,int t2) { return t1>t2; } int main() { vector<int> all; int in1; for(in1=2;in1<13;in1++) all.push_back(in1%6); make_heap(all.begin(),all.end(),compare); cout << all.front() << endl; copy(all...
ALGO
0.99968
3.214449
6cbe163f-4e1f-499a-bc5b-a3821965527e
saurabh-pawar07/hacktoberfest2022
c++/pattern4.cpp
// Half pyramid with 180* rotation #include <iostream> using namespace std; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { if (j <= n - i) { cout << " "; } else { ...
ALGO
0.999925
4.104971
ab621c5a-ec8d-4215-a199-6f1534cc997f
ishandutta2007/codeforces
gazelle/normal/660/A.cpp
#include <iostream> #include <vector> #include <map> #include <set> #include <unordered_set> #include <unordered_map> #include <stack> #include <queue> #include <algorithm> #include <cassert> #include <random> #include <iomanip> #include <bitset> #define FOR(i, n, m) for(ll i = (n); i < (ll)(m); i++) #define REP(i, n) ...
ALGO
0.999884
3.650766
e2adb65d-d720-4d0e-9477-37834c3d5e23
SebiiToader/uProcessorsProject
gradle/wrapper/gradle-5.6.2/samples/native-binaries/google-test/src/operators/cpp/minus.cpp
#include "operators.h" int minus(int a, int b) { return a - b; }
ALGO
0.971891
5.257968
7158f201-35eb-4541-8bf0-1fc178883cac
kate-kee/30-days-of-Algorithms
countingsort.cpp
#include<bits/stdc++.h> using namespace std; void printarray(vector<int>& a,int n){ for(int k=0;k<n;k++){ cout<<a[k]<<" "; } } void counting(vector<int>& a){ int max=*max_element(a.begin(),a.end()); int min=*min_element(a.begin(),a.end()); int range=max-min+1; vector<int> count(range),ou...
ALGO
0.999994
4.468939
69ec819c-fe4c-4881-936c-a744fa371e37
noah-ftnx/rpl
sde/12/06_.cpp
#include <unordered_map> #include <vector> using namespace std; class SolutionBF { public: vector<int> topKFrequent(vector<int>& nums, int k) { unordered_map<int, int> mp; for (auto num: nums) { int cnt=1; if (mp.count(num) >0) { cnt=mp[num]+1; } mp[num]=cnt; } vect...
ALGO
0.999993
5.92225
2e00c8b3-375d-4203-b37a-16ae2d3acf1a
LucidVR/opengloves-driver
driver/src/device/pose/pose_calibration.cpp
#include "pose_calibration.h" #include "util/driver_math.h" void PoseCalibration::StartCalibration(const vr::DriverPose_t &maintain_pose, CalibrationMethod method) { calibration_method_ = method; maintain_pose_ = maintain_pose; // make sure our device doesn't have any velocities (so it's fully stationary) m...
TOOL
0.899244
6.830667
c38dd59c-b84e-47cf-98a6-2285fc345c32
javagovindsharma/leetscode
solution/0400-0499/0452.Minimum Number of Arrows to Burst Balloons/Solution.cpp
class Solution { public: int findMinArrowShots(vector<vector<int>>& points) { sort(points.begin(), points.end(), [](vector<int>& a, vector<int>& b) { return a[1] < b[1]; }); int ans = 0; long long last = -(1LL << 60); for (auto& p : points) { int a = p...
ALGO
0.999986
6.163126
5690dc48-ef07-4576-8439-31b88b3bdd02
xlzz520/PathTracer
src/BVH.cpp
#include "BVH.h" // BVH的递归构建过程 // Top-down模式 BVH::BVH(const std::vector<Triangle> &triangles) { // 当前节点的aabb位包络所有子节点的aabb for (const Triangle &triangle : triangles) aabb.combine(triangle.aabb()); //小于BVH节点三角形分裂下限就不再进行分裂 if (triangles.size() <= BVH_LIMIT) { this->triangles = triangles...
ALGO
0.999917
5.599316
041d4c8e-cf13-4a27-9bf3-dc07b4ac04e9
GadzhievFarid/CodeforcesContests
VkCup2017/C2.cpp
#include <iostream> #include <stack> #include <queue> #include <set> using namespace std; void bfs(int** graph, bool* visited){ } void solve(int** graph, int* main, int k, int n, set<int> visited){ stack<int> st; queue<int> q; for (int i = 0; i < k; ++i){ if (visited.find(main[i] - 1) == visited.end()) st....
ALGO
0.999952
3.327859
38ffec04-3944-4277-aee6-0836d16087ac
Werewolflsp/LeetCode
recover_binary_search_tree.cpp
/************************************ Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Note: A solution using O(n) space is pretty straight forward. Could you devise a constant space solution? *************************************/ #include <cstrin...
ALGO
0.999996
6.076841
af7520cb-08bc-46e5-ac3e-5d8dbe2fe227
tomer00/DSA
Trees/bottomVIew.cpp
#include <iostream> #include <queue> #include <vector> #include <map> using namespace std; class Node { public: Node* left, * right; int data; Node(int d) { data = d; left = right = NULL; } void addRight(int data) { if (right == NULL) { right = new Node(data); ...
ALGO
0.999992
5.081725
e51c0092-7f7c-4f92-aecf-bce0e0cf1d6d
FoxAlex98/UniCT
algoritmi/livello 4/MinHeap.cpp
#include <iostream> #include <fstream> #include <sstream> #include <ctime> #include <math.h> using namespace std; template <class H> class MinBinaryHeap{ private: H *A; int heapsize; int len; int chiamateheap; int left(int i) { return i<<1; } int right(int i) { return (i<<1)|1; } int parent(int i) { ret...
ALGO
0.923711
3.980512
0c1f57c6-1ba0-4eda-b8d4-32cd375e3407
sysulic/ABS
eigen-3.4.0/bench/spmv.cpp
//g++-4.4 -DNOMTL -Wl,-rpath /usr/local/lib/oski -L /usr/local/lib/oski/ -l oski -l oski_util -l oski_util_Tid -DOSKI -I ~/Coding/LinearAlgebra/mtl4/ spmv.cpp -I .. -O2 -DNDEBUG -lrt -lm -l oski_mat_CSC_Tid -loskilt && ./a.out r200000 c200000 n100 t1 p1 #define SCALAR double #include <iostream> #include <algor...
ALGO
0.926922
4.293816
8281b6c5-24ab-4a7c-9c5d-0884ed2bbfde
truthspy/LeetCode
Session2/021_Merge_Two_Sorted_Lists.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) { ListNode* dummy = new ListNode(0); ListNode* cur = dummy; ...
ALGO
0.999975
5.975036
863c3a16-a817-4bb3-8b7e-838315fc9662
ishandutta2007/codeforces
thjchph4trjnh/normal/725/E.cpp
#include <bits/stdc++.h> using namespace std; #define ms(s, n) memset(s, n, sizeof(s)) #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define FORd(i, a, b) for (int i = (a) - 1; i >= (b); i--) #define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++) #define sz(a) int((a).size()) ...
ALGO
0.999985
3.780137
a041117c-1d7e-47f3-abcd-4e816fb03657
Kabiirk/advent-of-code-2021-entries
Day15/Day15.cpp
#include <iostream> #include <stdio.h> #include <fstream> #include <string> #include <vector> #include <deque> #include <limits> // for numeric_limits #include "../utils/utils.h" using namespace std; using CAVE = vector<vector<int>>; CAVE readFile(string filename){ string line; CAVE cave; // Read File ...
ALGO
0.999379
4.900071
abae7107-b763-4189-a44e-6eddd032103d
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_7831_11.cpp
#include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; while (n-- > 0) { string s; cin >> s; long long sz = s.size(); long long c_z = 0, c_o = 0; for (long long i = 0; s[i]; i++) { if (s[i] == '0') c_z++; else if (s[i] == '1') c_o++; }...
ALGO
0.999964
4.304338
fca2c7d9-14fd-4067-8745-1ead0fff6b7f
ayushjadia/CP_SOC
final/tbfm.cpp
#include<iostream> #include<vector> using namespace std; int main(){ int n,k; cin>>n>>k; vector<int> a; vector<int> b; int input; for(int i=0;i<n;i++){ cin>>input; a.push_back(input); } b.push_back(a[0]); for(int i=0;i<n-1;i++){ if((b[i]+a[i+1])<=k){ ...
ALGO
0.999994
3.439647
12430e10-ddee-4aaf-87ec-81add2bbc421
Rafiul29/programming-journey
data_structure/week 03 Doubly linked list/Module 10_ STL LIST and cycle detection/10-8 Detect Cycle in Singly Linked List.cpp
#include<bits/stdc++.h> using namespace std; class Node{ public: int val; Node* next; Node* prev; Node(int val){ this->val=val; this->next=NULL; this->next=NULL; } }; int main() { Node *head = new Node(10); Node *a=new Node(20); Node *b=new Node(3...
ALGO
0.999929
4.197676
91a97d9a-80b4-48c2-b416-8a06c5de23de
Dot4diw/MachineLearningWithCpp
Perceptron/eigen-3.4.0/bench/perf_monitoring/trmv_up.cpp
#include "gemv_common.h" EIGEN_DONT_INLINE void trmv(const Mat &A, const Vec &B, Vec &C) { C.noalias() += A.triangularView<Upper>() * B; } int main(int argc, char **argv) { return main_gemv(argc, argv, trmv); }
ALGO
0.974818
4.868302
56d7c780-c4b1-45e5-809e-364406575a51
fairuzzamrody/Tugas-Struktur-Data-Fairuz-056-MIB
Tugas SD Praktikum 8 Guided 2.cpp
#include <iostream> #include <conio.h> #include <stdio.h> #include <windows.h> using namespace std; typedef struct TNode { int data; TNode *next; TNode *prev; }; TNode *head, *baru, *bantu, *hapus; void init() { head=NULL; } int isEmpty() { if(head==NULL) return 1; else return 0; } void insertDepan(int da...
ALGO
0.997638
3.655195
980b043c-4f44-442a-bd56-784f5b7328ad
cww97/OJcww97
codeforces/CodeForces 52C.cpp
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; typedef long long LL; const int N = 6e5 + 10; const LL INF = 0x3f3f3f3f3f3f3f3f; struct segmentTree{ LL tree[N]; int M, n; void build(int n){ this->n = n; M = 1;while (M < n) M <<= 1;if (M!=1...
ALGO
0.999725
3.905134
55452f1d-554c-461c-a124-80cf8db755d0
kittobi1992/cluster_editing
cluster_editing/exact/star_bound.cpp
#include <cluster_editing/exact/star_bound.h> #include <cluster_editing/exact/reductions.h> #include <cluster_editing/exact/lower_bounds.h> #include <cluster_editing/datastructures/adjacency_row.h> #include <cluster_editing/datastructures/robin_hood.h> #include <cassert> #include <utility> #include <vector> #include...
ALGO
0.998068
4.33727
ec348ad2-d771-477b-86a9-e872e267b4de
sunshine2050/CarND-Path-Planning-Project
src/Eigen-3.3/test/denseLM.cpp
#include <iostream> #include <fstream> #include <iomanip> #include "main.h" #include <Eigen/LevenbergMarquardt> using namespace std; using namespace Eigen; template<typename Scalar> struct DenseLM : DenseFunctor<Scalar> { typedef DenseFunctor<Scalar> Base; typedef typename Base::JacobianType JacobianType; typed...
TEST
0.985158
5.862647
7d93185e-4f4d-4a56-945c-2a5f8c68b2a9
SiddhantKumar228/Data-Structures-Algorithms
07. BIT MANIPULATION/2. PROGRAMS/Program06.cpp
// Remove the last set bit #include <iostream> using namespace std; int removeBit(int n) { return (n & (n - 1)); } int main() { int n; cout << "Enter the number: "; cin >> n; cout << "After removing last bit: " << removeBit(n); return 0; }
ALGO
0.99528
6.224799
6fe5fd05-350d-462a-ac5e-9c7dacdea354
M-GIRISH-CHOWDARY/Data-strucures-and-Algorithms
heap.cpp
#include<iostream> using namespace std; class heap { public: void maxheapify(int a[],int n,int i) { int l,r,max; l=2*i; r=2*i+1; max=i; if(l<=n && a[l]>a[max]) { max=l;} if(r<=n && a[r]>a[max]) { max=r;} if(max!=i) {int t=a[i];a[i]=a[max];a[max]=t; maxheapify(a,n,max); ...
ALGO
0.999986
3.961493
3dfe7461-1776-461b-b900-0fcf364419e7
Priya-Thakur25/LeetCode
2764-maximum-number-of-fish-in-a-grid/2764-maximum-number-of-fish-in-a-grid.cpp
class Solution { public: vector<vector<int>> directions = {{0,1}, {0,-1}, {1,0}, {-1,0}}; int findMaxFish(vector<vector<int>>& grid) { int m = grid.size(); int n = grid[0].size(); int maxFish = 0; for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++){ ...
ALGO
0.999965
6.590442
e564ea55-8485-48ad-b144-c968246cd51a
alexandraback/datacollection
solutions_6377668744314880_0/C++/sidky/c-easy.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <string> #include <algorithm> #include <vector> #include <set> #include <map> #include <cstring> using namespace std; #define rep(i,n) for((i)=0;(i)<(n);(i)++) #define rab(i,a,b) for((i)=(a);(i)<=(b);(i)++) #define Fi(n) rep(i,n) #defin...
ALGO
0.999717
4.205085
5d4dc045-10d9-401f-88d5-4edccf68072e
satvik202/CSES-problemSet
dp/remove digits.cpp
#include <bits/stdc++.h> using namespace std; int dp[int(1e6) + 1]; int solve(int n){ if(n==0) return 0; if(dp[n]!=-1) return dp[n]; int x=n; int ans = 1e9; // since n is upto 10^6 // this while loop will run for at max 6 times int i=0; while(x){ int dig = x%10; int a...
ALGO
0.999977
5.146007
74adb24a-52cb-4432-9117-a4b49dd6238b
harshaithireddy/GeeksForGeeks-Codes
Difficulty: Medium/Tree Boundary Traversal/tree-boundary-traversal.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; #define MAX_HEIGHT 100000 // Tree Node class Node { public: int data; Node* left; Node* right; // Constructor to initialize a new node Node(int val) { data = val; left = NULL; right = NULL; } }; // ...
ALGO
0.999768
6.780146
81b2e0ce-d711-492f-bb66-8612b55f8ce0
ShireenAnsari/C---Progarms
tree2.cpp
#include<iostream> using namespace std; struct node { int key; node *left; node *right; }; //return a new node with the given value //struct node *getNode(int val) //{ // struct node *newNode; // // newNode = malloc(sizeof(struct node)); // newNode->key = val; // newNode->left = NULL; // ...
ALGO
0.999945
3.955481
2374bff6-5792-4293-8beb-cf84bcef8915
kipr/opencv
samples/cpp/calibration.cpp
#include "opencv2/core/core.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/calib3d/calib3d.hpp" #include "opencv2/highgui/highgui.hpp" #include <cctype> #include <stdio.h> #include <string.h> #include <time.h> using namespace cv; using namespace std; const char * usage = " \nexample command line for c...
TOOL
0.904257
5.790192
824a2a26-e053-4433-836f-0a56ba246dbd
drreynolds/cello_drreynolds
src/Enzo/enzo_SolveMHDEquations.cpp
/*********************************************************************** / / GRID CLASS (SOLVE THE MHD EQUATIONS (with PPML), SAVING SUBGRID FLUXES) / / written by: Greg Bryan / date: November, 1994 / modified1: Alexei Kritsuk, April 2009 (PPML) / / PURPOSE: / / RETURNS: / ENZO_SUCCESS or ENZO_FAIL / **...
ALGO
0.998758
3.720009
78ca9498-9ca9-4863-aa63-a7a31a58025c
hechengda/Cpp-PPP2E
ch10/temp_stats.cpp
#include "std_lib_facilities.h" struct Reading // a temperature reading { int hour; // hour after midnight [0:23] double temperature; // in Fahrenheit }; istream& operator>>(istream& is, Reading& r); int main() try { ifstream ist{"raw_temps.txt"}; if (!ist) { error("can't open ...
TOOL
0.85365
5.861326
71a03750-7b05-4079-9a41-888dbf6aa048
anejaanmol/GlobalTrend_Programming_Assessment
factorial.cpp
#include <bits/stdc++.h> using namespace std; unsigned long long factorial(int n) { if (n <= 1) { return 1; } else { return n * factorial(n - 1); } } int main(){ int n; cout << "Enter a number: "; cin >> n; if (n < 0) { cout << "Factorial is not defined for negative...
ALGO
0.999879
5.276332
00d17292-5eb0-4c5c-99b0-d20e16a2d2df
Saswati009/HF2022
LeetCodeChallenges/RunningMedian.cpp
// Running Median // Send Feedback // You are given a stream of 'N' integers. For every 'i-th' integer added to the running list of integers, print the resulting median. // Print only the integer part of the median. // Input Format : // The first line of input contains an integer 'N', denoting the number of integers in...
ALGO
0.999989
5.319892
6b2a93cb-211e-4a4c-ab36-e5855f58172c
Mathavaroopan/cp-algorithms
programs/D_Only_one_of_two.cpp
#include "bits/stdc++.h" #define int long long #define uint unsigned long long #define vi vector<int> #define vvi vector<vi > #define vb vector<bool> #define vvb vector<vb > #define fr(i,n) for(int i=0; i<(n); i++) #define rep(i,a,n) for(int i=(a); i<=(n); i++) #define nl cout<<"\n" #define dbg(var) cout<<#var<<"="<<va...
ALGO
0.999891
3.921218
c6c375c3-8dac-4b95-93e7-1c6ec05dda08
wufenglun/Computer-Graphics
ray-tracing/eigen/doc/snippets/Tutorial_AdvancedInitialization_LinSpaced.cpp
ArrayXXf table(10, 4); table.col(0) = ArrayXf::LinSpaced(10, 0, 90); table.col(1) = M_PI / 180 * table.col(0); table.col(2) = table.col(1).sin(); table.col(3) = table.col(1).cos(); std::cout << " Degrees Radians Sine Cosine\n"; std::cout << table << std::endl;
ALGO
0.962337
3.543272
328ccff5-6a49-49d1-8a0f-32f5d6248274
ShivamBajpai04/OOPs_Class
vector_implementation.cpp
#include <iostream> using namespace std; template <typename T> class Vector{ int max_size; T* arr; int i; public: Vector(){ arr=new T[1]; max_size=1; i=0; } Vector(int s){ arr=new T[s]; max_size=s; i=0; ...
TOOL
0.939268
4.162414
880191a6-9c81-4d19-98e7-46296e81e068
Mritunjay1729/Codeforces
Covered_path.cpp
#include <iostream> #include <vector> using namespace std; vector<vector<int>> dp(2000, vector<int>(101, -1)); int maxDistance(int curr, int vf, int t, int d) { if(curr < 0) return -10000; if(t==0 && curr == vf) return vf; else if(t == 0) return -10000; if(dp[curr][t] != -1) return dp[curr][t]; ...
ALGO
0.999872
4.282557
3aa53f3d-959d-451d-bcc7-1ff81e6883cc
3l-d1abl0/DS-Algo
cpp/practise/sol_3_bfs.cpp.cpp
#include<bits/stdc++.h> using namespace std; int arr[102][102][102]; int X,Y,Z; bool isvalid(int i, int j, int k) { if(i < 0 || j < 0 || k<0 || i >=X || j >=Y || k>=Z) return false; else return true; } struct c{ int x,y,z; }; int air(c temp){ if(temp.x ==0 || temp.y==0 || temp.z==0 || temp.x==X-1 || temp....
ALGO
0.999521
3.419876
d64ed394-5eb9-467b-9381-63b0f82e76ce
joydip007x/CompetitiveCodeArchive
CodeForces/59C/23833823_AC_62ms_160kB.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define nl '\n' #define deb(x) cerr<<#x" = "<<x<<nl #define in() ( { int a ; scanf("%d",&a); a; } ) const int N = 5e5 + 9; const int mod = 1e9 + 7; ll n,x,t,y,vis[1100],tot=0; vector<ll>v; string s; map<ll,ll>m,nm; #define q '?' ...
ALGO
0.999979
3.619698
568212f0-e0c7-43e6-8dc8-4518c9f6230e
shangguandanyi/base_c_cpp
base/CPP/STL/set/test7.cpp
/** * @file test7.cpp * @author your name (<EMAIL>) * @brief * @version 0.1 * @date 2022-07-10 * * @copyright Copyright (c) 2022 * * set排序 */ #include<set> #include<iostream> using namespace std; void printSet(const set<int>&s) { for (set<int>::const_iterator it = s.begin(); it != s.end(); it++) ...
TOOL
0.938138
4.644252
657d5dc7-c3a6-41bd-b668-394fb8a1c9e1
woohyunjng/Coding-Practice
PS/Baekjoon/13000/13334.cpp
#include <bits/stdc++.h> #define int long long #define MAX 200100 #define MOD 1000000007 #define INF 0x7f7f7f7f7f7f7f7f #define endl '\n' using namespace std; typedef pair<int, int> pr; typedef array<int, 3> tp; int arr[MAX][2], sm[MAX]; signed main() { ios_base::sync_with_stdio(false); cin.tie(0), cout.tie...
ALGO
0.999963
3.905508
58f6cb74-890b-43ec-85fb-7ad9ba04f4e5
hudakh24/Programming-Practice
Mode_of_array.cpp
#include <iostream> using namespace std; void inputArray(int arr[], int size) { for (int i = 0; i < size; i++) { cin >> arr[i]; } } void displayArray(int arr[], int size) { for (int i = 0; i < size; i++) { cout << arr[i] << " "; } cout << endl; } void findModes(int arr[], int size...
ALGO
0.999871
5.258632
abe225eb-2f72-4c50-a828-a149be970dea
Ashraful-notfOuND/Plane-shooter
Plane Shooter/src/util.cpp
#pragma once #include "common.hpp" #include "util.hpp" int collision(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2) { return (MAX(x1, x2) < MIN(x1 + w1, x2 + w2)) && (MAX(y1, y2) < MIN(y1 + h1, y2 + h2)); } void calcSlope(int x1, int y1, int x2, int y2, float *dx, float *dy) { int steps = MAX(abs...
ALGO
0.995132
5.354332
859fcb83-b129-45d9-b395-2b29a0a678e9
yamini3701/6Companies30days
Day 15-20 [Adobe]/9-NextHigherPalindromicNumberUsingSameSetOfDigits.cpp
//#6Companies30Days Challenge Adobe-9 (Next higher palindromic number using the same set of digits) // { Driver Code Starts //Initial template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function template for C++ class Solution{ public: string nextPalin(string N) { //complete...
ALGO
0.99941
5.725261
7d7aa743-b326-4987-8002-cb3c8f698c48
eigengravy/cs-f211
lab03/DSA_Vector.cpp
#include <iostream> #include <vector> #include <thread> // For this_thread::sleep_for #include <chrono> // For chrono::milliseconds #include <utility> using namespace std; class DSA_Vector { private: vector<int> private_v; public: // Constructor DSA_Vector() { int N, element; cin >> N; ...
ALGO
0.999458
4.889215
5432e945-b272-4da1-b306-b7886a273dbe
ishaofeng/LeetCode
work/back/main.cpp
#include <iostream> #include <vector> #include <set> #include <cctype> #include <map> #include <unordered_map> #include <cmath> #include <cstdlib> #include <limits> #include <algorithm> using namespace std; class Solution { public: string minWindow(string S, string T) { string result; int char...
ALGO
0.999996
6.683043
ff37650d-af9f-4176-919c-1480c8ed713a
ftiasch/mithril
2013-05-06/F.cpp
#include <cstdio> #include <cstring> #include <vector> #define foreach(i, v) for (__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++ i) using std::vector; struct Node { long long delta; Node *left, *right; Node(long long delta, Node *left, Node *right) : delta(delta), left(left), right(right) {} ...
ALGO
0.999993
4.278183
90a064ed-1a18-42de-8fab-93f00461213e
Esimseitm/PP1_2021
Informatics/3labfor1/s.cpp
#include <iostream> using namespace std; int main () { int n; cin >> n; int pos = 0, cur = 1; for ( ; pos < n ; ) { for (int i = 0; i < cur; i++) { printf("%d ", cur); pos++; if (pos == n) break; } cur++; } return 0; }
ALGO
0.99988
3.382079
281770fd-1a34-487f-806b-835e46604fdf
proxmox/ceph
ceph/src/boost/libs/spirit/example/qi/compiler_tutorial/calc7/vm.cpp
#include "vm.hpp" namespace client { void vmachine::execute(std::vector<int> const& code) { std::vector<int>::const_iterator pc = code.begin(); std::vector<int>::iterator locals = stack.begin(); stack_ptr = stack.begin(); while (pc != code.end()) { switch (*...
ALGO
0.895862
5.133121
c9cd4a7c-0a0d-4797-91f4-0d3bf43b739e
tridibsamanta/Codeforces_Solutions
1475E.cpp
/* ~ Author : @tridib_2003 */ #pragma GCC optimize("O3") // #pragma GCC optimize("Ofast") // #pragma GCC target("avx,avx2,fma") #include<bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_orde...
ALGO
0.999879
4.708079
1728f356-d931-4801-b878-7da35570fe50
Therta-Rizky-Syaputra/UTS-alrpo
nomor2.cpp
#include <iostream> using namespace std; int main() { int height; cout << "Masukkan Angka: "; cin >> height; for (int i = 1; i <= height; i++) { for (int j = 1; j <= i ; j++) { cout << "*"; } cout<<endl; } return 0; }
ALGO
0.998031
3.961367
e09b9bca-b64c-40a8-b082-d1d1ffb4be2b
jesuswr/cp-codes-and-problems
ST/ST/E.earthquakes.cpp
#include <iostream> #include <vector> #include <queue> #include <stack> #include <algorithm> #include <math.h> #include <string> #include <cstring> #include <set> #include <map> #include <unordered_map> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<int, pair<int, int>> piii; type...
ALGO
0.999373
3.825388
790114dc-b60c-4551-afd0-1abf4ee3ade1
lacram/study
Programmers/2023_kakao_mobility/1.cpp
#include <iostream> #include <vector> #include <cstring> #include <fstream> #include <algorithm> #include <cmath> #include <queue> #include <stack> #include <map> #include <string> #include <set> #define endl '\n' #define INF 2000000000 using namespace std; int day[366]; int solution(vector<vector<int>> flowers) { ...
ALGO
0.999605
4.383609
d4bb826f-bffc-499c-8d9a-877877286985
Joao-vpf/Algoritmos
segtree/treap(bruno).cpp
#define maxn 100010 #define maxalloc maxn // nº máximo de nós alocados durante toda execução typedef int Int; #define int long long struct no { int pri; // prioridade int size; // qtde de elementos na sub-árvore int val; // valor do nó int sum; // soma do intervalo int lz; // lazy no* l, *r; no() {}...
ALGO
0.999648
3.8635