uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
e53e62c9-4107-4c8b-b5dd-02c4a0ee5f9b
samikshamodi/CompetitiveProgramming
385B-BearAndStrings.cpp
/* samikshamodi - Samiksha Modi */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define endl '\n' #define pb push_back #define mp make_pair #define f first #define s second #define sync ios_base::sync_with_stdio(false);cin.tie(NULL); #define out1d(arr,size) {for(int ...
ALGO
0.999441
3.854291
bf5f3f66-5a72-4776-ae6d-2da3b982d3b6
sfu-dis/pibench
src/key_generator.cpp
#include "key_generator.hpp" #include "utils.hpp" namespace PiBench { thread_local std::default_random_engine key_generator_t::generator_; thread_local uint32_t key_generator_t::seed_; thread_local char key_generator_t::buf_[KEY_MAX]; thread_local uint64_t key_generator_t::current_id_ = 1; key_generator_t::key_gener...
TOOL
0.853395
6.396796
f5c403b5-945f-4f5b-9517-319bf8dd7424
Bachhsunkid/Leetcode-daily
medium/find-and-replace-pattern.cpp
class Solution { public: string key(string& word) { char start = 'a'; vector<char> map(26); string res; for(auto& c : word) { if(map[c - 'a'] == 0) map[c - 'a'] = start++; res.push_back(map[c - 'a']); } return ...
ALGO
0.999967
6.322459
de8bbc1b-350d-4367-b04a-4e4da2c4e311
sand6174/boost-doc-zh
libs/graph/example/planar_face_traversal.cpp
#include <boost/graph/planar_face_traversal.hpp> #include <boost/graph/boyer_myrvold_planar_test.hpp> using namespace boost; // Some planar face traversal visitors that will // print the vertices and edges on the faces struct output_visitor : public planar_face_traversal_visitor { void begin_face() { std::cout <<...
ALGO
0.999715
7.371651
bcdf7775-4be4-4c1b-abed-8119ab5f839c
vaibhavbichave/Leetcode
0191-number-of-1-bits/0191-number-of-1-bits.cpp
class Solution { public: int hammingWeight(int n) { int count = 0; while (n) { count += n & 1; n >>= 1; } return count; } };
ALGO
0.999949
6.481758
59eb23e5-35c4-4f23-b9db-17f919cc686e
Nidheeshkrishna/hive_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.998667
6.789978
e4ee6e26-2f8f-41e5-9ac0-71b9f8f48e1f
xyz24110189/Qt_SecUnionClient
src/comm/tools.cpp
#include "tools.h" #include <time.h> #include <stdlib.h> #include <sys/stat.h> #include <string.h> #include <stdio.h> #ifdef _WIN32 #include<Windows.h> #include <direct.h> #include <ShlObj.h> #include <io.h> #else #include <sys/types.h> #include <dirent.h> #include <sys/sysinfo.h> #include <sys/time.h> #define MAX_PAT...
TOOL
0.899366
4.63809
2043818a-6326-406b-b397-2e967ca164ec
akashmodanwal/Algorithms
0-1 KnapSack/0-1_knapsack_recursive_memoization.cpp
#include<iostream> #include<cstring> using namespace std; int dp[50][50]; int max(int a,int b){ if(a>=b) return a; else return b; } int knapsack(int wt[], int val[], int w, int n) { if(n==0 || w==0) return 0; if(dp[w][n]!= -1){ return dp[w][n]; } if(wt[n-1]<=w){ r...
ALGO
0.999946
3.976956
032a7159-1154-4f4a-984f-21e1c9f8632b
manikanta2901/ubuntu
.history/codingChallenges/cpp/Codechef/longChallenges/july/dr_20200708202900.cpp
#include<bits/stdc++.h> #include<vector> #include<iostream> #include<cmath> #include<algorithm> #include<iterator> #include<string> #include<map> #include<unordered_map> #define F first #define S second #define MP make_pair #define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define ...
ALGO
0.999969
3.751771
44e1bebb-29de-47d9-8031-c2cff5450f64
adarshgiri125/practiceQuestion_CPP
Easy/Max Sum without Adjacents/max-sum-without-adjacents.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function template for C++ class Solution{ public: int solve(int *arr, int ind,vector<int> &dp){ if(ind < 0){ return 0; } if(dp[ind] != -1) return dp[ind]; int value = arr[...
ALGO
0.999769
6.369464
60a3b71f-7f09-435e-aa4a-a66cbcd35aa2
MdShazidAlHasan/Workspace
Problem Solving/CodeForces/Contest/832-div2/a.cpp
#include<bits/stdc++.h> #define ll long long using namespace std; int main(){ ll t; cin>>t; while(t--){ ll n; cin>>n; ll a; ll sum=0; for(ll i=0;i<n;i++){ cin>>a; sum+=a; } cout<<abs(sum)<<endl; } return 0; }
ALGO
0.999283
3.363748
695a9d92-deb6-4e8a-80a6-f47794f3af4f
myeyesareblind/opencv-ml
samples/cpp/stereo_calib.cpp
#include "opencv2/calib3d/calib3d.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <vector> #include <string> #include <algorithm> #include <iostream> #include <iterator> #include <stdio.h> #include <stdlib.h> #include <ctype.h> using namespace cv; using namespace std; stat...
TOOL
0.969203
6.395285
6fcc5e13-2cd7-42eb-a25c-8faef2e0319b
KomalBairwa/Codeforces
Petya_and_strings.cpp
#include<iostream> using namespace std; int main(){ string str1, str2; cin>>str1>>str2; int n = str1.length()-1; for(int i=0;i<=n;i++) { str1[i] = toupper(str1[i]); str2[i] = toupper(str2[i]); } //cout<<str1<<" "<<str2; if(str1.compare(str2)>0) cout<<1; else if(str1.compare(str2)<0) cout<<-1; ...
ALGO
0.999997
3.149812
c217156b-5e2c-4806-a828-a8812c97530f
linhmonkaist/Algorithm
DP_tree/lqdxeui.cpp
#include <bits/stdc++.h> using namespace std; int n, x, sum_weight, max_per; typedef pair<int, int> pii; vector<vector<pii>> tree; vector<int> f; void dfs(int u, int par){ if (tree[u].size() == 1 && u != x){ f[u]= 0; return; } int sz= tree[u].size(); for (int i= 0; i< sz; i++){ ...
ALGO
0.999876
4.740978
cc9755f0-29d1-46f3-96d6-31ff0077cb48
FelipeOFF/AulasOpenCV
libs/opencv_contrib-master/contrib/face/src/eigen_faces.cpp
#include "precomp.hpp" #include <opencv2/face.hpp> #include "face_utils.hpp" #include <set> #include <limits> #include <iostream> namespace cv { namespace face { // Turk, M., and Pentland, A. "Eigenfaces for recognition.". Journal of // Cognitive Neuroscience 3 (1991), 71–86. class Eigenfaces : public EigenFaceRecogn...
ALGO
0.901913
5.899614
c0ed3663-886a-4968-8f38-12e959c8a81d
pratikraj21/DSA_Level_1
Generic_Tree/linearize_generic_tree.cpp
#include<iostream> #include<vector> #include<string> #include<stack> #include<queue> #include<algorithm> #include<climits> using namespace std; struct Node{ int data; vector <Node*> child; }; Node *root = NULL; Node* getNode(int data) { Node *temp = new Node(); temp->data = data; return temp; } v...
ALGO
0.999943
5.191514
27ca471c-655d-441e-9698-8f1e520f97b5
ishandutta2007/codeforces
777777777plus/normal/1601/A.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2e5+5; int T; int n,a[N]; int main(){ cin>>T; while(T--){ cin>>n; for(int i=1;i<=n;++i)scanf("%d",&a[i]); int t=0; for(int j=0;j<30;++j){ int c=0; for(int i=1;i<=n;++i)if(a[i]&1<<j)++c; t=__gcd(t,c); } vector<int> ...
ALGO
0.999923
4.086858
cf41f418-5226-44fe-bf01-01231782639c
octavcosmin/programming-projects
CPP/Admitere UAIC/2017-SII-3-b/main.cpp
#include <iostream> #include <cstring> using namespace std; int m, n; char A[26]; string s[101]; bool letters[26]; int sameLetters(string a, string b) { int freq_a[26] = {}, freq_b[26] = {}; for(int i = 0; i < max(a.size(), b.size()); ++i) { if(i < a.size()) ++freq_a[a[i] - 'a']; if(i < b.siz...
ALGO
0.998991
4.894015
dbd3a0e6-aa6f-4ae6-bf06-21832e06c41e
ishandutta2007/codeforces
tsukiko_tsutsukakushi/normal/1354/C1.cpp
/** * author: otera **/ #include<iostream> #include<string> #include<cstdio> #include<cstring> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<deque> #include<ciso646> #include<random> #include<map> #include<set> #include<complex> #include<...
ALGO
0.997109
3.915372
a89d5b99-c668-4ce6-b64b-40d35eb52ceb
harshit-jain52/CP_DSA
codeforces/1352C.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; while (t--) { ll n, k, ans, prev; cin >> n >> k; prev = k; ans = k + k / n; while (prev / n < ans / n) ...
ALGO
0.999968
3.680947
64035925-0e27-47cb-8051-1275364b01fd
svetlanasieber/Programming-Basics-with-Cpp
15_Yard Greening.cpp
#include <iostream> using namespace std; int main() { double sqareMeters; cin >> sqareMeters; double areaPrice = sqareMeters * 7.61; cout.setf(ios::fixed); cout.precision(2); cout << "The final price is: " << areaPrice - (areaPrice * 0.18) << " lv." << endl; cout << "The discount is: " << areaPrice * 0.18 ...
TOOL
0.978228
4.663335
bc94db77-60f9-437c-aa7b-01a431ed9e20
OmarHafez1/Competitive_Programming_Solutions
codeforces.com/387337_I.cpp
/* ** ** author: Omar_Hafez ** created: 30 June 2022 (Thursday) 6:39:41 PM ** */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace chrono; using namespace __gnu_pbds; typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexe...
ALGO
0.999812
3.505823
ce823230-acc2-4d38-9620-e6c049095a65
Katinon/Baekjoon-Online-Judge
Unclassified/BOJ-05522.cpp
#include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int sum = 0; for (int i = 0; i < 5; i++) { int temp; cin >> temp; sum += temp; } cout << sum; }
ALGO
0.996135
3.00275
662e5278-60e9-42a7-9ced-7f9a18c8a2c6
hcodename47/imguix
cocos2d/cocos/2d/CCTextFieldTTF.cpp
#include "2d/CCTextFieldTTF.h" #include "base/CCDirector.h" #include "platform/CCFileUtils.h" #include "base/ccUTF8.h" #include "2d/CCSprite.h" NS_CC_BEGIN #define CURSOR_TIME_SHOW_HIDE 0.5f #define CURSOR_DEFAULT_CHAR '|' #define PASSWORD_STYLE_TEXT_DEFAULT "\xe2\x80\xa2" static std::size_t _calcCharCount(const cha...
TOOL
0.895383
7.022669
b5b289ca-f8a8-41e9-84e7-0a23d89c3310
p-molnar/cpp_modules
module_09/ex02/src/main.cpp
#include "PmergeMe.hpp" #include <cstdlib> #include <iostream> #include "Parser.hpp" #include "Timer.hpp" template <typename C> void print_container_content(const C &container) { for (size_t i = 0; i < container.size(); i++) { std::cout << container[i] << " "; if (i == 9) { std::cout << "[...]"; break; ...
ALGO
0.989048
5.544703
faf70035-2141-46a7-8239-8bd4ed51b65e
tsa87/qvina_docking
boost_1_60_0/libs/log/src/settings_parser.cpp
/*! * \file settings_parser.cpp * \author Andrey Semashev * \date 20.07.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_WITHOUT_SETTINGS_PARSERS #include...
TOOL
0.892
7.543175
593419e8-a641-41c9-b6c2-e5630bffe20e
ishandutta2007/codeforces
user202729_/normal/1214/H.cpp
#ifndef LOCAL #define NDEBUG #endif #include<queue> #include<cassert> #include<algorithm> #include<iostream> #include<vector> std::vector<std::vector<int>> ad; std::vector<int> dt; // depth std::vector<int> parof; // parent of void fs(int node,int par){ // dfs parof[node]=par; for(int x:ad[node])if(x!=par){ dt[x...
ALGO
0.999985
4.143777
4f533a44-8eb8-44ad-863e-e02d4c9fd153
raincross7/code-similarity
codes/train_code/problem254/problem254_132.cpp
#include<iostream> #include<algorithm> #include<vector> using ll = long long; using namespace std; constexpr ll INFI = 1e18; ll calc(int n, int k, vector<int> v, int* a); int main() { int n, k; ll lcost; ll cost; cin >> n >> k; int* a = new int[n]; for (int i = 0;i < n;i++) { cin >> a[i]; } vector<int> v; ...
ALGO
0.999948
4.047046
ed3714aa-01a2-4942-bdbb-95437905efe7
lkmtue/cp
cf/369-div2/d.cpp
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define FORN(i, a, b) for (int i = (a); i < (b); ...
ALGO
0.999948
3.809147
c8ebdf4a-1946-407d-9567-c94e7f5c5586
chongin12/Problem_Solving
acmicpc.net/old/2261.cpp
#include <iostream> #include <vector> #include <algorithm> #include <set> #include <cmath> using namespace std; struct point { int x, y; point() {} point(int x, int y) : x(x), y(y) {} bool operator<(const point &a) const { if(y==a.y) return x < a.x; else return y < a.y; // y기준 정렬 } }...
ALGO
0.999972
4.40249
f4bcdb2d-5514-4798-b9c0-83c97ab512e9
8ORUZ7/data-structure-and-advance-algorithm
Hashing/Hash Implementation/hash-implementation-cpp.cpp
#include <vector> #include <string> #include <utility> #include <iostream> using std::vector; using std::string; using std::pair; using std::cout; using std::endl; class HashMap { public: int size_ = 0; int capacity_ = 2; vector<pair<string, string>*> map_; HashMap() { map_ = *(new vector<pai...
TOOL
0.980156
5.449148
3605cb47-8160-41db-81be-0b4099e49747
Vinay-Rastogi/CrackYourPlacement
Day8/20-Valid_Parentheses.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; class Solution { public: bool isValid(string s) { if(s.length() < 2) return false; int n=s.length(); stack<char>stk; for(int i=0;i<n;i++){ if(s[i]=='{'...
ALGO
0.998983
5.747478
b2a3fda4-df43-4e9e-90a6-8b10cc7976d7
suyufeng/Spear-of-Longinus
template/template_limited/source/miscellany/dancing-links.cpp
const int N = , M = , G = ; struct node { int col, row, left, right, up, down; void clear() { col = row = left = right = up = down = 0; } } grid[G]; int n, m, tot; int cnt[M], head[N], tail[N]; void remove(int x) { grid[grid[x].right].left = grid[x].left; grid[grid[x].left].right = grid[x...
ALGO
0.999812
3.51242
4c01b086-ca9f-44e0-ab9d-dc2bd939335a
ishandutta2007/codeforces
-is-this-fft-/normal/763/B.cpp
#include <iostream> #include <algorithm> using namespace std; int main () { int rectcnt; cin >> rectcnt; cout << "YES" << '\n'; for (int i = 0; i < rectcnt; i++) { int ux, uy, lx, ly; cin >> ux >> uy >> lx >> ly; int ans = 0; if (abs(ux) % 2) { ans++; } if (abs(uy) % 2) { ...
ALGO
0.999148
3.305327
3e12f436-7f74-4d8c-ad25-c9f0a69ae1fb
GrootTheDeveloper/CompetitiveProgramming
Codeforces/CodeforcesRound/round_928 (div4)/b.cpp
#include <bits/stdc++.h> #include <unordered_map> #include "debug.h" #define int long long #define yes cout << "yes" #define no cout << "no" #define endl '\n'; using namespace std; const int oo = LLONG_MAX; const int MOD = 1e9 + 7; signed main() { int t; cin >> t; while (t--) { int n; cin >> n; ...
ALGO
0.999063
4.840125
035db5c1-c330-47c7-b568-bc103db05c99
wells-wei-wei/smplify-x_in_docker
opencv-4.2.0/3rdparty/carotene/src/meanstddev.cpp
#include "common.hpp" #include <cmath> namespace CAROTENE_NS { void meanStdDev(const Size2D &size, const u8 * srcBase, ptrdiff_t srcStride, f32 * pMean, f32 * pStdDev) { internal::assertSupportedConfiguration(); #ifdef CAROTENE_NEON f64 fsum = 0.0f, fsqsum = 0.0f; sqsum(si...
ALGO
0.994941
6.121099
4cadb193-78d1-4a68-a687-a277c7e1ebf4
almasluffy/Algorithm-and-data-structures
Projects/Week1/a.cpp
#include <iostream> #include <cmath> #include <algorithm> using namespace std; int t; struct Stack { int a[100000]; void push(int x) { a[t] = x; t++; } int pop() { t--; return a[t]; } int back() { return a[t-1]; } int size() { return t; } void clea...
ALGO
0.977571
3.808896
61c0e7b7-a4f5-4b22-bd4c-dc816f6b0ae1
abdulrehmanjaved-1/DSA
Practice/insertionSort.cpp
#include <iostream> using namespace std; int main() { int array[5]; cout<<"Enter elements of Array which are too be sorted\n"; for (int i = 0; i < 5; i++) { cin>>array[i]; } for (int i = 1; i < 5; i++) { int temp=array[i]; int j=i-1; while (j>=0 && array[...
ALGO
0.999935
3.449462
5cd73334-e3be-4400-a13b-d5869c0c82d2
gebrial/seam-carving
CImg/examples/pde_TschumperleDeriche2d.cpp
#include "CImg.h" using namespace cimg_library; #ifndef cimg_imagepath #define cimg_imagepath "img/" #endif #undef min #undef max // Main procedure //---------------- int main(int argc,char **argv) { // Read command line arguments //----------------------------- cimg_usage("Tschumperle-Deriche's flow for 2D Ima...
ALGO
0.99955
4.797349
901878c2-34b1-44ea-9187-fcd902fbe293
verif/leetcode
uniqPath/t2.cpp
/* Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacle and empty space is marked as 1 and 0 respectively in the grid. For example, There is one obstacle in the middle of a 3x3 grid as illustrated below. [ [0,0,...
ALGO
0.99991
6.096419
a3de8529-f895-4de7-8b65-677902edad4c
nandinicodes1/My-DSA
Tree/delete nodes in BST.cpp
#include<bits/stdc++.h> using namespace std; class node{ public: int data; node *left; node *right; node(int d) { this->data=d; left=NULL; right=NULL; } }; node* bstfromsortedArray(int *arr,int s,int e) { if(s>e) { return NULL; } int mid=(s+e)/2; node *root=new node(arr[mid]); root->left=...
ALGO
0.999992
4.335681
803aabd6-34d4-436b-bc67-5d46ce766b43
awa-Orz-Ljy/LJYCODE-VSCODE
算法模板分类总结/-StarryCoding/4单调栈、单调队列/61滑动窗口最大最小值优先队列.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; const int N = 2e5+9; ll a[N],l[N],r[N]; int stk[N],top; void solve() { int n,k;cin>>n>>k; for(int i = 1;i <= n; ++i)cin>>a[i]; deque<int> dq;//存放下标 //求最大 for(int i = 1;i <= n;++ i) { //以i为右端点,大小为k的区间,[i-k+1,i] //队列头的合法性 while(dq.s...
ALGO
0.999995
3.539505
4eef5d1b-6a98-48c1-8283-05c9f9927b59
rayperkins/HelloXR
openxr_loader/include/common/filesystem_utils.cpp
#include "filesystem_utils.hpp" #include "platform_utils.hpp" #include <cstring> #if defined DISABLE_STD_FILESYSTEM #define USE_EXPERIMENTAL_FS 0 #define USE_FINAL_FS 0 #else // If the C++ macro is set to the version containing C++17, it must support // the final C++17 package #if __cplusplus >= 201703L #define USE...
TOOL
0.971192
7.609098
ad74169d-d527-47fb-922d-5a708ff4a243
MarkKim1/Leetcode
1971-find-if-path-exists-in-graph/1971-find-if-path-exists-in-graph.cpp
class unionFind{ public: vector<int> root; unionFind(int x){ for(int i = 0; i < x; i++){ root.push_back(i); } } void makeUnion(int a, int b){ int rootx = find(a); int rooty = find(b); if(rootx != rooty){ root[rooty] = rootx; } ...
ALGO
0.999991
6.165877
b6c25279-92de-4c09-adc0-651791eb777f
Imran4424/LeetCode-Solutions
DynamicProgramming/Medium/91.DecodeWays_BU_2.cpp
class Solution { public: int numDecodings(string code) { // invalid ways if ('0' == code[0]) { return 0; } // empty set int secondPrev = 1; // first character which is not zero, so it will must be one // forward consideration int prev = 1; // starting from second index of code for (int i = 1...
ALGO
0.99986
5.77668
13a1b449-8d58-4616-b941-b8bc083800b3
PriDhingra/Tree
smallestRangeFromKSortedList.cpp
#include<queue> class Node { public: int data; int row; int column; Node(int data, int row, int column) { this -> data = data; this -> row = row; this -> column = column; } }; class compare { public: bool operator()(Node* a, Node* b) { return a -> data > b -> data; } }; int kSorted(vector<ve...
ALGO
0.999887
4.80631
06bcc604-0382-4793-9fbb-8c4b4442c4c7
ThisIsATest369/SensorsCalibration
online_calib/radar2carcenter/eigen3/doc/examples/make_circulant2.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; // [circulant_func] template<class ArgType> class circulant_functor { const ArgType &m_vec; public: circulant_functor(const ArgType& arg) : m_vec(arg) {} const typename ArgType::Scalar& operator() (Index row, Index col) const { Index index = ...
ALGO
0.999637
5.538595
4428ff23-8e1a-4862-a457-971cda357b04
BobPiterson/InfEge
Tip27/27424.cpp
// // 18.05.2024 #include <iostream> using namespace std; #define int long long constexpr int k = 3; constexpr int MAXN = 100'000; pair<int, int> arr[MAXN]; signed main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); freopen("/mnt/d/Users/Matvei/Developer/Projects/InfEge/Tip27/inputs/27424/27-B...
ALGO
0.999924
4.080493
1ab837e5-3cae-4a5f-9fdd-b3503e0ab155
vinayd001/Daily-Interview-Pro
27 July 2019/Two_Sum.cpp
#include<iostream> #include<vector> #include<map> using namespace std; bool find_target (vector<int> arr, int target) { map<int, int> hash_map; for(int i=0; i<arr.size(); i++) { int complement = target - arr[i]; if(hash_map[complement]) return true; hash_map[arr[i]] = i; ...
ALGO
0.999902
5.57529
9fe22ab0-bf51-4026-af5e-c35c3db0ecbb
geekpradd/CompetitiveCoding
Random Questions/Manthan IITBHU\/190050089_lab6/Q7.cpp
#include <iostream> using namespace std; int a, b, c, d; int f(int x){ return a*x*x*x + b*x*x + c*x + d; } int main(){ cin >> a >> b >> c >> d; for (int i=0; i<=100; ++i){ if (f(i) == f(i+1)){ cout << i << endl; return 0; } } cout << -1 << endl; return 0; }
ALGO
0.999874
3.558575
44ac4d01-18f2-4f86-a2e7-4f5009f3391c
wpn-zju/LeetCode-Dump
dump-cn/655.print-binary-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: void traversalPrint(TreeNode* root, vector<vector<string>>& result, int height, int position, int&...
ALGO
0.999925
6.142587
4100b594-3ed7-4096-bda0-d6d4051583e0
suankun/cpp_snippets
Codewars/7kyu/06.String/Simple fibonacci strings.cpp
// https://www.codewars.com/kata/5aa39ba75084d7cf45000008/train/cpp #include <string> std::string solve(int n) { if (n == 0) return "0"; if (n == 1) return "01"; std::string f0 = "0"; std::string f1 = "01"; std::string fn; for (int i = 2; i <= n; i++) { fn = f1 + f0; f...
ALGO
0.999992
6.851386
d7a893d5-dd46-4c12-a952-364386a4f03b
vianho/flutter-todolist
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998693
6.797273
3965b47b-02de-41c4-98d1-37fe756acaf8
sarvex/leetcode-tsh
solution/0600-0699/0653.Two Sum IV - Input is a BST/Solution.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999994
6.449394
ff9c9416-3ac2-4169-a727-665d9d2a2449
woodcoding/HUAS_ACM
2016_summer_acmcode/5/J - Max Sum.cpp
#include <iostream> #include <cstdio> using namespace std; const int maxn=100000+2; int org[maxn], sum[maxn], b[maxn]; int cas, n, i, j , imax, iflag; int main() { scanf("%d", &cas); for(int k=1;k<=cas;k++) { scanf("%d", &n); for(i=1;i<=n;i++)scanf("%d", &org[i]); for(i=1;i<=n;i++) ...
ALGO
0.999601
3.226088
9eaafd7e-85c6-41a5-b599-3c2d2a7ef72c
tuduweb/LeetCode
programming/28.实现str-str.cpp
/* * @lc app=leetcode.cn id=28 lang=cpp * * [28] 实现strStr() */ class Solution { public: int strStr(string haystack, string needle) { #if 0 if(needle.empty() || (haystack.length() < needle.length())) return - (haystack.length() < needle.length()); int pos = 0,//当前位置 ...
ALGO
0.999927
5.471097
7e59e820-aaf4-493f-9e32-07567ba8b44e
Asik8/My-Codeforces
Old Codes/C_Mark_and_His_Unfinished_Essay.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define pbs insert #define pi pair<ll,ll> #define py cout<<"YES\n"; #define pys cout<<"Yes\n"; #define pn cout<<"NO\n"; #define pns cout<<"No\n"; #define co(x1) cout<<x1<<"\n"; #define ct(x1) cout<<x1<<" "; #define elc cout<<"\n"; #...
ALGO
0.999932
3.640046
b45872d1-88fd-4b4d-b371-79ea24507ff1
ismail-yilmaz/Bobcat
Bobcat/Finder.cpp
#include "Bobcat.h" #define LLOG(x) // RLOG(x) #define LDUMP(x) // RDUMP(x) #define LTIMING(x) // RTIMING(x) namespace Upp { #define KEYGROUPNAME "Finder" #define KEYNAMESPACE FinderKeys #define KEYFILE <Bobcat/Finder.key> #include <CtrlLib/key_source.h> using namespace FinderKeys; constexpr const int SEARCH_MAX ...
TOOL
0.911621
3.648528
c1f3e497-231e-4a2d-a94f-b16e1fdd5fe9
hidog/http_server
boost_1_63_0_source/libs/flyweight/example/serialization.cpp
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */ #include <algorithm> #include <boost/archive/text_iarchive.hpp> #include <boost/archive/text_oarchive.hpp> #include <boost/flyweight.hpp> #include <boost/flyweight/serialize.hpp> #include <boost/serialization/vector.hpp> #include <boost/toke...
TOOL
0.892147
7.610458
82a40f4a-b737-41d9-9307-54cf39f8bef4
BUAAHugeGun/LeetCode
src/1431.cpp
class Solution { public: vector<bool> kidsWithCandies(vector<int>& candies, int extraCandies) { int Max=0; vector<bool> ret; for(auto &x: candies)Max=max(Max,x); for(int i=0;i<candies.size();i++) { ret.push_back(candies[i]+extraCandies>=Max?1:0); } ...
ALGO
0.999931
5.966325
90d009bd-bd4f-4800-8004-8eb259cb56b7
fpolica91/geekforgeekscourses
cp35/cpp/bike_racing.cpp
#include<bits/stdc++.h> using namespace std; int checkSpeedOverSpeedLimitAtGivenTime(int speedLimit, vector<int> accelerations, vector<int> initialSpeeds, int atGivenTime){ int speedsExceedingMaxAllowed = 0; for(int i = 0; i < accelerations.size(); i++){ int currentSpeed = atGivenTime * accelerations[i] + init...
ALGO
0.999746
5.064914
5ad91dbf-49e7-4c86-97e3-27fc39a47341
aryansingh10/DSA_ARYAN_SINGH
Heaps/HeapsImplementaionAndHeapify.cpp
#include<iostream> using namespace std; class heap{ public: int arr[100]; int size=0; heap(){ arr[0]=-1; size=0; } void insert(int val){ //Insertion size=size+1; int index=size; arr[index]=val; //Check Conditon is satisfied or not ...
ALGO
0.99998
4.06093
72f24bd5-8a18-412a-89f9-62874fb85ecd
JonathonMacleod/Distributed-Game-Architecture
libs/BOOST1.82.0/libs/iterator/example/shared_iterator_example1.cpp
#include "boost/shared_container_iterator.hpp" #include "boost/shared_ptr.hpp" #include <algorithm> #include <iostream> #include <vector> typedef boost::shared_container_iterator< std::vector<int> > iterator; void set_range(iterator& i, iterator& end) { boost::shared_ptr< std::vector<int> > ints(new std::vector<i...
TOOL
0.96847
3.438638
0ca0f2cc-47ac-4bca-afb2-5c84b05624c6
mikeerosss/node_typescript
samples/cpp/convexhull.cpp
#include "opencv2/imgproc.hpp" #include "opencv2/highgui.hpp" #include <iostream> using namespace cv; using namespace std; static void help(char** argv) { cout << "\nThis sample program demonstrates the use of the convexHull() function\n" << "Call:\n" << argv[0] << endl; } int main( int argc, c...
ALGO
0.98846
6.028976
36ec0fef-0f65-4ae3-97e4-76fce292464e
rohitg1010/Coding-Questions
42-trapping-rain-water/trapping-rain-water.cpp
class Solution { public: int trap(vector<int>& height) { int n = height.size(); int left = 0, right = n - 1; int left_max = 0, right_max = 0; int water_stored = 0; while (left < right) { if (height[left] < height[right]) { left_max = max(left_max,...
ALGO
0.999986
6.870215
a24367b4-b8f8-4ddf-b110-d3a419c00356
Kunwo-sim/baekjoon
Brute Force/2309(B2).cpp
#include<iostream> #include<algorithm> #include<vector> using namespace std; vector<int> v; vector<int> result; int heigth; int heigthSum = 0; void Solution() { for (int i = 0; i < 8; i++) { for (int j = i + 1; j < 9; j++) { int sum = heigthSum - v[i] - v[j]; if (sum == 100) { for (int k = 0; k < ...
ALGO
0.99983
3.323425
66fc28c7-7174-4e6b-b00e-deb7c5c31b30
Lqs66/boost_1_74_0
libs/sort/example/mostlysorted.cpp
// See http://www.boost.org/libs/sort for library home page. #include <boost/sort/spreadsort/spreadsort.hpp> #include <time.h> #include <stdio.h> #include <stdlib.h> #include <algorithm> #include <vector> #include <string> #include <fstream> #include <sstream> #include <iostream> using namespace boost::sort::spreadso...
ALGO
0.997546
4.811204
1124e5ad-ce40-43b2-9225-f4211946fe0d
rupav/cp
competitive_coding/contests/tags/trees/binaryTree_sumOfDepthsOfAllNodes.cpp
#include<bits/stdc++.h> using namespace std; #define watch(x) cout << (#x) << " is " << (x) << endl #define fr(i,n) for(int i=0; i<n; i++) #define rep(i, st, en) for(int i=st; i<=en; i++) #define repn(i, st, en) for(int i=st; i>=en; i--) #define sq(a) (a*a) typedef long long ll; typedef pair<int, int> pii; typedef pai...
ALGO
0.999929
4.406116
967b06cb-fef3-4f04-8271-714b57279090
Cobb-Yoo/Algorithms
BOJ/2163 초콜릿 자르기/2163 초콜릿 자르기.cpp
#include <iostream> using namespace std; int cnt=0; void f(int n,int m){ if(n > m) n^=m^=n^=m; if(m==1) return; else cnt++; if(m&1){ f(n,m/2); f(n,m/2+1); }else{ f(n,m/2); f(n,m/2); } } int main(){ int n,m; cin >> n >> m; f(n,m); cout << cnt << endl; }
ALGO
0.99999
3.902615
64acacf1-f771-4d63-b348-530931c9eae7
rhsehfm33/algorithm-practice
c++/codeforces/1685/a/sol.cpp
#include <bits/stdc++.h> using namespace std; void solve(int _ti) { int n; cin >> n; vector<int> a(n); for (auto& ai : a) { cin >> ai; } if (n % 2) { cout << "NO\n"; return; } vector<int> ans(n); sort(a.begin(), a.end()); for (int i = 0, l = 0, r = n /...
ALGO
0.999983
4.395697
d532432b-1674-438a-84a7-dc2f943052af
neerajsandal/Data-Structures-of-Cpp
Sorting Algorithms/4.BUBBLE SORT OPTIMIZED.cpp
#include<iostream> using namespace std; int main() { int size; cout << "Enter the size of an array: "; cin>>size; int *arr = new int[size]; for(int i = 0; i < size; i++) { cin >> arr[i]; } for(int i = 1; i < size; i++) { int flag = 0; for(int j = 0; j < size-i; j++) { if(arr[j] > arr[j+1]) { ...
ALGO
0.998563
3.738739
b602332a-0fdc-4a9e-a317-f502d676bf77
Ishitav03/100-days-of-code-challenge
Day071.cpp
// 23. Merge k Sorted Lists // You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. // Merge all the linked-lists into one sorted linked-list and return it. // Constraints: // k == lists.length // 0 <= k <= 104 // 0 <= lists[i].length <= 500 // -104 <= lists[i][j] <= 104 //...
ALGO
0.999853
5.788829
a1689419-9431-49e7-9d77-6c9db6fb8c20
JubairAnjumRony/CandCPlus
IBecometheguy.CPP
#include<iostream> using namespace std; int main(){ int n; cin>>n; int p,q,i,j,f=0; cin>>p; int a[p]; for(int i=0;i<p;i++) cin>>a[i]; cin>>q; int b[q]; for(int i=0;i<q;i++) cin>>b[i]; for(i=1;i<=n;i++){ for(j=0;j<p;j++){ if(i==a[j]){ f=1; ...
ALGO
0.998987
3.058558
30170e0f-3523-4b6c-b698-0edf96120726
minhlam2102002/competitive-programming
Template/Graph/SCC.Kosaraju.cpp
// Verified: https://cses.fi/problemset/task/1682/ #include<bits/stdc++.h> using namespace std; vector<vector<int>> adj, revAdj, compList; vector<bool> visited; vector<int> order, comp; void dfs1(int u) { visited[u] = true; for (int v : adj[u]) if (!visited[v]) dfs1(v); order.push_ba...
ALGO
0.99999
5.31884
0dbe339c-5944-4af9-abbe-f1686d3f0bc0
brikr/advent-of-code
src/cpp/2023/day12/day12.cpp
#include <file.h> #include <mathextras.h> #include <stringextras.h> #include <algorithm> #include <chrono> #include <iostream> #include <map> #include <stack> #include <string> #include <vector> struct Row { std::string springs; std::vector<int> groups; }; // true if the first group in groups can be made in spri...
ALGO
0.999896
6.479491
02fafb19-5db1-4184-9bb2-b4843e52e246
wizleysw/backjoon
1316/solve.cpp
// https://www.acmicpc.net/problem/1316 // 그룹 단어 체커 // Written in C++ langs // 2020. 08. 07. // Wizley #include <iostream> #include <algorithm> #include <vector> using namespace std; int N; int main(){ ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> N; int tot...
ALGO
0.999917
5.065478
f31e0921-ba06-4cf2-8b74-d8609aa5fc57
ckarouzos/scc
code/create3.cpp
// STL #include <iostream> // for std::cout #include <stdlib.h> #include <algorithm> #include <ctime> #include <vector> #include <fstream> #include <string> // Boost #include <boost/graph/adjacency_list.hpp> // for customizable graphs #include <boost/graph/directed_graph.hpp> // A subclass to provid...
ALGO
0.99894
4.483574
289ac5ad-7d7b-42a8-b3e6-1df2637c12d9
isavita/advent_generated
cpp/day9_part2_2023.cpp
#include <iostream> #include <fstream> #include <vector> #include <sstream> #include <string> std::vector<std::vector<int> > parseInput(std::vector<std::string> input) { std::vector<std::vector<int> > histories; for (const std::string& line : input) { std::vector<int> numbers; std::istringstre...
ALGO
0.999548
6.312986
586d8f99-43b6-45a6-b72d-4bfbda5d2119
zyin422/CPGrind
X_Camp/401H/Week4/G_HamiltonianFlights.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define endl "\n" #define f first #define s second int n, m; ll MOD = 1e9 + 7; vector<vector<ll>> adj(21, vector<ll>(21, 0)); vector<vector<ll>> dp((1 << 20), vector<ll> (21, 0)); s...
ALGO
0.999988
4.813381
f1890e51-ef95-498e-9a7f-d2cc6e89dbb3
metalfs/aggregate
hls_operator_aggregate.cpp
#include <metal/stream.h> //#define LIMIT(LO,VAL,HI) ( ((VAL)>(LO))? (((VAL)<(HI))?(VAL):(HI)) : (LO) ) #define VALUE_BYTES 8 #define VALUE_BITS (VALUE_BYTES*8) #define VALUE_COUNT (STREAM_BYTES/VALUE_BYTES) //#define VUP(IDX) LIMIT(0, (VALUE_BITS * (IDX) + VALUE_BITS - 1), (STREAM_BYTES*8)) //#define VLO(IDX) LIMIT(...
ALGO
0.981238
4.697446
b9280112-ec0e-4387-a13f-c2563da97252
kaili302/Leetcode-CPP-exercises
1. StringArray/13) Longest Valid Parentheses.cpp
/* Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the longest valid parentheses substring is "()", which has length = 2. Another example is ")()())", where the longest valid parentheses substring is "()()", which has leng...
ALGO
0.999964
5.419017
2b0089fd-e801-4029-842c-0557d0ee658d
DOSP-Project/platform_packages_apps_DesiOTA
jni/boost_1_57_0/libs/graph/test/dfs_cc.cpp
#include <boost/concept_archetype.hpp> #include <boost/graph/depth_first_search.hpp> #include <boost/graph/graph_archetypes.hpp> int main() { using namespace boost; typedef default_constructible_archetype< sgi_assignable_archetype< equality_comparable_archetype<> > > vertex_t; { typedef incidence_gr...
ALGO
0.919957
5.270398
2fde0a07-62d9-448e-bb36-ad5f1dd6658e
raincross7/code-similarity
codes/train_code/problem309/problem309_402.cpp
#include <bits/stdc++.h> using namespace std; #define INF (1 << 30) #define EPS 1e-10 #define MOD 1000000007 #define rep(i, n) FOR(i, 0, n) #define FOR(i, x, n) for (int i = (x); i < (n); ++i) #define all(v) (v).begin(), (v).end() using ll = long long; template<class T> void chmax(T& a, T b){ if (a < b) { a = b; }...
ALGO
0.983383
3.554251
a74b609d-9576-4d38-a11c-5df41c1033e9
codeplaysoftware/llvm-leg
lib/CodeGen/AggressiveAntiDepBreaker.cpp
#include "AggressiveAntiDepBreaker.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/RegisterClassInfo.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #i...
ALGO
0.970054
5.923888
583f75eb-0a29-480e-9563-48e0fb682200
Rishabh8122004/DSA
498-diagonal-traverse/diagonal-traverse.cpp
class Solution { public: vector<int> findDiagonalOrder(vector<vector<int>>& mat) { int n = mat.size(),m = mat[0].size(); vector<int>ans; int i = 0,j = 0; bool f1 = true,f2 = true; while(true){ while(i>=0 && j<m){ ans.push_back(mat[i][j]); ...
ALGO
0.999992
6.042158
e9402dc8-3154-4b5e-bf7f-0402d5ad3ec4
Aleenakrish/firebase
blooddonation/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.998734
6.76775
a4681290-0b46-4f3d-93a7-4e1df6290723
raincross7/code-similarity
codes/train_code/problem084/problem084_35.cpp
#include <bits/stdc++.h> using namespace std; int main(){ long long int n; cin>>n; long long int a=2; long long int b=1; long long int c=0; for(int i=0;i<n-1;i++){ c=a+b; a=b; b=c; } if(n==1) cout<<"1"<<endl; else cout<<c<<endl; }
ALGO
0.999998
3.513965
cd2633d5-de6c-4251-a030-ca72854c3756
alexandraback/datacollection
solutions_5648941810974720_1/C++/satyamcs12/prob1.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i,n) for(i=0;i<n;i++) #define sd(n) scanf("%d",&n); #define sl(n) scanf("%lld",&n); #define pd(n) printf("%d ",n); #define pl(n) printf("%lld ",n); #define pln printf("\n"); #define pb push_back int ar2[50],ar1[50]; char ar[3000]; int main(...
ALGO
0.999812
3.227223
1a4723f6-8a4d-4662-bbcb-9201c28d51d1
nguyentuss/Competitive-Programming
CP/OnlineJudge/Atcoder/abc356_c.cpp
//#pragma GCC optimize("Ofast") //#pragma GCC target("avx,avx2,fma,popcnt") #include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, a, b) for(int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vecto...
ALGO
0.999541
4.040745
1c93aa73-90dc-4453-b840-16da517acd41
ywonchae1/algo
프로그래머스/1/340213. [PCCP 기출문제] 1번 / 동영상 재생기/[PCCP 기출문제] 1번 / 동영상 재생기.cpp
#include <string> #include <vector> #include <string.h> using namespace std; void convert(string len, int &len_i) { string m = len.substr(0, 2); string s = len.substr(3, 2); int mi = stoi(m); int si = stoi(s); len_i = mi * 60 + si; } string prefix(string t) { if(t.length() < 2) return '0...
ALGO
0.983914
5.119088
1d653193-3188-4306-b68e-c15f5a82637b
bbaah123/CPlusPlus
files/SOWC++EO9 Programming Challenge Solutions/Chapter03/3_14.cpp
// Chapter 3 - Programming Challege 14, Celsius to Fahrenheit // This program converts a Celsius temperature to Fahrenheit. #include <iostream> #include <iomanip> using namespace std; int main() { double tempCelsius, // Temperature in Celsius tempFahrenheit; // Temperature in Fahrenheit //...
TOOL
0.880442
5.551652
3fd26bd0-2357-4908-b058-b33f94ab4a95
raincross7/code-similarity
codes/train_code/problem110/problem110_214.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1000000007; int main(){ ll N, M; cin >> N >> M; ll K; cin >> K; for(int i = 0; i <= N; i++){ for(int j = 0; j <= M; j++){ ll tag = i*M + j*N - 2*(i*j); if(tag == K){ cout << ...
ALGO
0.99998
3.923082
530e7fcf-b0ff-4afb-8833-2c612e1ebfc7
VampireZX/oaip
2 semester/lab5/lab5/lab5.cpp
#include <iostream> using namespace std; struct Stack { int info; Stack *next; }; Stack *push(Stack *p, int chislo); void view(Stack *p); void checker(int m); void individual(Stack *p, int num); void sort_p(Stack** p); void sort_info(Stack* p); void del(Stack** p); int main() { setlocale(LC_ALL, "rus")...
ALGO
0.999739
3.935369
2a154c71-1da9-4739-9151-457e5dc4c942
amirov-m/AlgorithmsAndDataStructuresUrfu
HW1/AlternatingOtherTrash.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> struct sequence_element { int index; int value; sequence_element() { index = 0; value = 0; }/* sequence_element(sequence_element & other) { index = other.index; value = other.value; }...
ALGO
0.999964
3.420308
d8b930ac-45d6-4885-9c57-5cdb80815db9
roeas/GAMES101-Premake
Frame/Source/ThirdParty/opencv/modules/ml/src/inner_functions.cpp
#include "precomp.hpp" namespace cv { namespace ml { ParamGrid::ParamGrid() { minVal = maxVal = 0.; logStep = 1; } ParamGrid::ParamGrid(double _minVal, double _maxVal, double _logStep) { CV_TRACE_FUNCTION(); minVal = std::min(_minVal, _maxVal); maxVal = std::max(_minVal, _maxVal); logStep = std::max(_...
ALGO
0.995164
6.896045
91d4d935-8bcb-42a5-a0bb-9257c14af8f0
KashifAhmad1789/20-Days-100-questions-DSA
zeroSum.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long 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(...
ALGO
0.999909
4.151793
07193831-1f35-4f28-ae7f-4d4de2608b7f
cheng109/JunGravLens_clean
lib/eigen_include/doc/examples/TutorialLinAlgSVDSolve.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { MatrixXf A = MatrixXf::Random(3, 2); cout << "Here is the matrix A:\n" << A << endl; VectorXf b = VectorXf::Random(3); cout << "Here is the right hand side b:\n" << b << endl; cout << "The least-squares ...
ALGO
0.999775
3.908823
55ff3143-b346-461b-a526-597a312edd75
hashiryo/Library
test/aoj/GRL_2_A.kruskal.test.cpp
// competitive-verifier: PROBLEM https://onlinejudge.u-aizu.ac.jp/courses/library/5/GRL/2/GRL_2_A // competitive-verifier: TLE 0.5 // competitive-verifier: MLE 64 #include <iostream> #include <algorithm> #include <numeric> #include "src/DataStructure/UnionFind.hpp" using namespace std; signed main() { cin.tie(0); ios...
ALGO
0.999948
4.80279
73d286e7-1be7-4af7-9495-f1fb5bdb83dc
alexandraback/datacollection
solutions_5631572862566400_1/C++/Zyr17/temp.cpp
#include <bits/stdc++.h> #define N 11111 #define Init freopen("t.in","r",stdin);freopen("t.out","w",stdout); int n,a[N],d[N],c_len,pos[N],fa[N][11],depth[N],done[N]; std::vector<int> point,son[N]; void clear(){ memset(a, 0, sizeof a); memset(d, 0, sizeof d); memset(pos, 0, sizeof pos); memset(fa, 0, sizeof fa); me...
ALGO
0.999256
4.002129
71b8d96d-5c12-4053-b057-d6be95ba1e46
freedomDR/coding
leetcode/300.最长递增子序列.cpp
/* * @lc app=leetcode.cn id=300 lang=cpp * * [300] 最长递增子序列 */ // @lc code=start #include <bits/stdc++.h> #include <algorithm> using namespace std; class Solution { public: int lengthOfLIS(vector<int>& nums) { int n = nums.size(); // vector<int> dp(n, 1); // for (int i = 0; i < n; i++) ...
ALGO
0.999979
6.220795