uuid
stringlengths
36
36
repo_name
stringlengths
5
133
relative_path
stringlengths
3
3.76k
content
stringlengths
282
4.03M
category
stringclasses
6 values
algo_rel_score
float32
0.9
1
quality_score
float32
3
8.13
source_meta
dict
467b3592-6adf-48c3-8f2b-2629f2de3773
AdityaHegde02/Leetcode-Solved
Add Binary Strings - GFG/add-binary-strings.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends //User function template for C++ class Solution{ public: string addBinary(string A, string B) { int m = A.size(); int n = B.size(); string ans; if(m < n){ int diff = n - m; wh...
ALGO
0.999967
6.472314
{ "github_metadata": { "branch": "main", "commit_count": 2633, "repo_created_at": "2022-10-11T10:22:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cdceb9750...
136c2956-eea0-4847-9db6-07c7bf295cc3
khangmoihocit/DSA
C++/c++coban/mang2chieu/1.cpp
#include "bits/stdc++.h" using namespace std; void nhap(int a[][100], int n, int m){ for (int i=0; i<n; ++i){ for (int j=0; j<m; ++j){ cout << "a[" << i << "][" << j << "]="; cin >> a[i][j]; } } } void hien(int a[][100], int n, int m){ for (int i=0; i<n; ++i){ ...
ALGO
0.993443
3.021397
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2024-09-06T01:03:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "223ad15c040...
3c9ece51-3fd9-4a13-8577-de1d710a6195
ManishK-mky/cpp
2lower_to_upper.cpp
#include<iostream> #include<string> #include<algorithm> // for transform() using namespace std; int main(){ string name = "<NAME>"; //Dekho capital 'A' ka ASCII number 65 hai and small 'a' ka ascii number 97 hai . // Iska mtlb agar hum small 'a' se 32 minus karde tab humko capital 'A' mil jayega. ...
ALGO
0.993172
4.135438
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2023-12-21T05:50:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8e7473ac8b...
29fce7f0-11d6-4ae5-9898-82c8bfa512fb
nhut1205/CTDL-GT
DSLKD_SoNguyen.cpp
//#include "DSLK_SoNguyen.h" //SNode *createSNode(ItemType x) //{ // SNode *p = new SNode; // if (p == NULL) // Nếu dữ liệu trống // { // printf("Khong du bo nho de cap phat node"); // getch(); // return NULL; // } // p->Info = x; // p->Next = NULL; // return p; //} //void showSNode(SNode *p) //{ // printf("%4d", p-...
ALGO
0.986111
3.213015
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2022-12-14T00:22:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "976b865d08bc...
3a8daf34-e9d7-4cee-aaa2-70cc391c5a1b
caonann/algorithm_cpp
binary_tree/56.cpp
/* @filename 56.cpp @author caonan @date 2022-04-22 16:32:30 @reference 剑指offer专项 @url https://leetcode-cn.com/problems/opLdQZ/ @brief 给定一个二叉搜索树的 根节点 root 和一个整数 k , 请判断该二叉搜索树中是否存在两个节点它们的值之和等于 k 。假设二叉搜索树中节点的值均唯一 */ #include <assert.h> #include <stdio.h> #include <algorithm> #include <deque> #i...
ALGO
0.999984
6.14022
{ "github_metadata": { "branch": "main", "commit_count": 44, "repo_created_at": "2022-03-20T14:27:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7f3b717678e...
553a7e04-8809-48a3-ad59-65e1df786ee3
Rupert-WLLP-Bai/HK-SG-Interview
perfect_number.cc
#include <cmath> #include <iostream> auto IsPerfect(int num) -> bool { int sum = 1; // Start with 1 as a factor for (int i = 2; i <= sqrt(num); ++i) { if (num % i == 0) { sum += i; if (i != num / i) { sum += num / i; } } } return sum...
ALGO
0.999902
5.357192
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-11-26T11:04:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "61a741a42689...
db4c73c5-2c17-474f-94ec-df70a6950e77
kiddliu/midnight-leetcode
reformat-date.h
#ifndef REFORMAT_DATE_H_ #define REFORMAT_DATE_H_ #include <string> #include <unordered_map> namespace solution { std::string reformatDate(std::string date) { // straight forward // Runtime: 0 ms, faster than 100.00% of C++ online submissions for Reformat Date. // Memory Usage: 6.2 MB, less than 20.86% of C++ ...
TOOL
0.942724
5.695132
{ "github_metadata": { "branch": "main", "commit_count": 432, "repo_created_at": "2021-03-25T16:08:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "871bc2de22...
6a22b15c-a99e-46e1-bd16-cbe0e32a86f0
YNG2020/CodeCraft2023-semi-finals
Path.h
#pragma once #include<vector> #include<iostream> #include <algorithm> #include <cmath> using namespace std; class HWCout; struct Point { Point(double _x,double _y):x(_x),y(_y){} Point():x(0),y(0){} Point(const Point& point) { x = point.x; y = point.y; } double x, y; friend std::ostream& operator<<(std::ostr...
ALGO
0.98957
4.072884
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2023-04-11T11:26:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cb79b700ed62...
14c16b1f-cf55-4693-b904-3c2535c81706
Sweedenmah/ENSC251_Final_Project
list.hpp
//--------------------------------------------------------------------------------------------------------------------------------------------------------------- // <NAME> / <NAME> / <NAME> / <NAME> // 301398265 / 301394066 / 301386235 / 301399922 // // Group 8 //-------------------------------------------------...
TOOL
0.990064
6.083137
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-04-27T17:22:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cbb16e85f410...
09adcda3-55cd-4b1b-b5e7-7c90ee82909b
kamyu104/LeetCode-Solutions
C++/binary-tree-cameras.cpp
// Time: O(n) // Space: O(h) /** * 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: int minCameraCover(TreeNode* root) { int result = 0; ...
ALGO
0.999953
6.73091
{ "github_metadata": { "branch": "master", "commit_count": 19395, "repo_created_at": "2018-10-11T17:38:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4939, "forks": 1616, "issues": 1, "pull_requests": 55 }, "file_meta": { "content_id": ...
19bbee95-53cc-4e19-bc8f-cf9305c9172e
itohdak/Codeforces
Div2/prev/637/D.cpp
#include <bits/stdc++.h> #include "/home/itohdak/Codeforces/000/print.hpp" using namespace std; #define ll long long #define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--) #define rrep(i,n) RREP(i,n-1,0) #define REPL(i,m,n) for(ll i=...
ALGO
0.999916
3.874779
{ "github_metadata": { "branch": "master", "commit_count": 46, "repo_created_at": "2018-05-21T14:37:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a618fe397...
b514d186-1944-4217-8d77-14d713a8cacd
fantasydreams/findwork
bazelProject/leetcode/math/204.CountPrimes.cpp
#include "204.CountPrimes.h" #include <vector> int countPrimes(int n) { if(n <= 2) { return 0; } std::vector<bool> prime(n, true); int ans = 0, cnt = n - 2; for(int i = 2; i < n; ++i) { if(prime[i] == true) { ++ans; for(int j = i + 1; j < n; ++j) { ...
ALGO
0.999929
5.712641
{ "github_metadata": { "branch": "master", "commit_count": 414, "repo_created_at": "2020-09-08T08:30:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f39a92ad...
7f60256e-5089-408d-828e-1ee12d3e430a
Ranj8521Kumar/Solving-DSA-Problems
Split_Linked_List_Alternatingly.cpp
#include <iostream> #include <vector> using namespace std; struct Node { int data; Node* next; Node(int val) : data(val), next(NULL) {} }; class Solution { public: vector<Node*> alternatingSplitList(struct Node* head) { if (head->next == NULL) return {head, NULL}; if (head->next->next ...
ALGO
0.999945
5.863823
{ "github_metadata": { "branch": "main", "commit_count": 86, "repo_created_at": "2024-03-01T18:14:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "024ad3e7ef1...
c98589d2-2ba1-4aca-b33d-40f79f7ab1cd
libgdx/libgdx
extensions/gdx-bullet/jni/src/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.h
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2013 <NAME> http://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to a...
TOOL
0.916646
4.240636
{ "github_metadata": { "branch": "master", "commit_count": 15526, "repo_created_at": "2012-08-10T19:34:38.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 24195, "forks": 6492, "issues": 240, "pull_requests": 81 }, "file_meta": { "content_id"...
9dd1a271-6f35-4400-80c3-ed561a983cde
sunshine-xp/code
比赛/now网络流/1006.cpp
#include<cstdio> #include<cstring> #include<iostream> #include<cmath> using namespace std; const int maxx=0x7fffffff; int n,m,x,y,ans;int tot; struct wakaka{ int to,next,v; }e[40010]; int ha[210],queue[210],head[210],father[210]; void addedge(int u,int v,int w){ tot++;e[tot].to=v;e[tot].v=w;e[tot].next=head[u];...
ALGO
0.999992
3.473383
{ "github_metadata": { "branch": "main", "commit_count": 52, "repo_created_at": "2022-05-15T02:47:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "888c5af7897...
a4985bd6-c503-4e66-ae1b-bca6c1b0d029
justinl0318/Courses-and-Projects
Algorithm-Design-Analysis/10.cpp
#include <bits/stdc++.h> using namespace std; #define lli long long int #define SIZE 1000005 struct pos{ lli x; lli y; }; lli l1, l2, r1, r2; pos temp[SIZE]; pos arr[SIZE]; bool rcmp(pos a, pos b){ if ((-r1*a.x + r2*a.y) > (-r1*b.x + r2*b.y)){ return true; } else if ((-r1*a.x + r2*a.y) ==...
ALGO
0.999818
4.390005
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2024-01-04T09:14:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ecd986bfbb...
c0fe5dd0-44bd-4c15-95f0-981454885b02
nahidakabir1/competitive-programming-25
contest2/con2a.cpp
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; // Input the values of a and b int result = 0; // Initialize result to 0 // Loop to calculate a - b if a >= b for (int i = 0; i < a; ++i) { if (i < b) { continue; // Skip the iteration if i is less...
ALGO
0.999954
4.104461
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2025-05-19T21:00:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7f552712984...
a81aa6ab-ea3a-4ff4-85b1-94d9244c0e44
allwellll/cf_code_jiangly
1689/1689B-B-MysticPermutation.cpp
//url:https://codeforces.com/contest/1689/problem/B //time:2022-06-10 19:43:59 //name:B-MysticPermutation #include <bits/stdc++.h> using i64 = long long; void solve() { int n; std::cin >> n; std::vector<int> p(n); for (int i = 0; i < n; i++) { std::cin >> p[i]; p[i]--; } ...
ALGO
0.999987
4.434942
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2022-10-17T23:31:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 97, "forks": 9, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2446a1940b...
2b60bf03-802f-44ba-9ce2-f4a804c5e9cf
sumit-chandra-trivedi/CPP-Codes
QUEUE/CNQueue.h
#include<iostream> using namespace std; template<typename T> class QueueUsingArray { T *data; int nextIndex; int firstIndex; int size; int capacity; public: QueueUsingArray() { data=new T[4]; nextIndex=0; firstIndex=-1; size=0; capacity=4; } ...
ALGO
0.999812
3.616742
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2025-03-06T13:14:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "55feb968c227...
00a5a75e-0bc0-4a3b-9e2a-0830f1117793
zhangjunCPP/code_new
代码/5 初三下半学期/12 2024.4.20 测试/std/(FZUOJ)#8894. 烧结核凝晶.cpp
#include <iostream> #include <iomanip> #include <algorithm> #include <functional> constexpr int N = 100005; constexpr long double eps = 1e-11; int n, k; int a[N], b[N]; long double c[N]; bool check(long double x) { for (int i = 1; i <= n; ++i) c[i] = a[i] - x * b[i]; std::sort(c + 1, c + n + 1, std::greater<long d...
ALGO
0.999975
4.642056
{ "github_metadata": { "branch": "main", "commit_count": 384, "repo_created_at": "2023-08-10T03:33:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ca5f427564...
c20a0870-0d00-4759-9e7f-eaeefc12bca9
ishandutta2007/codeforces-f
flukehn/normal/1608/B.cpp
#include<bits/stdc++.h> using namespace std; #define For(i,a,b) for(int i=(a),i##_end=(b);i<i##_end;++i) #define fi first #define se second #define pb emplace_back #define SZ(x) ((int)(x).size()) #define ALL(x) (x).begin(),(x).end() using ll=long long; using pa=pair<int,int>; template<class A,class B>inline bool upmx(A...
ALGO
0.999621
3.783841
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:43:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3708c1003a81...
1344f969-5387-47fd-b66a-622ca426411f
tiger-yash/Algo-Lab
matrix_multiplication_strassen.cpp
#include <bits/stdc++.h> using namespace std; // function to add two matrices of same size vector < vector < int > > add( vector < vector < int > > x , vector < vector < int >> y , int n ){ for( int i = 0 ; i < n ; i++ ){ for( int j = 0 ; j < n ; j++ ){ x[i][j] += y[i][j] ; } ...
ALGO
0.999876
4.432882
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2022-04-08T21:11:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3c9eaf3d31...
f3b79c65-5f4f-43be-ac9c-53523ee4e0e5
mie998/purokon
atcoder/AGC044/a.cpp
#include <bits/stdc++.h> using namespace std; //def #define debug(x) cout << #x << ": " << x << '\n' #define out(x) cout << x << '\n' #define repeat(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define revrepeat(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--) #define rep(i, n) for (int i = 0; i < (int)(n);...
ALGO
0.999829
4.302239
{ "github_metadata": { "branch": "master", "commit_count": 96, "repo_created_at": "2019-05-18T09:39:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "71a42e587...
868d9c68-ead4-48ce-a49b-c10151023f10
bryanflowers28/Euchre
p3-euchre/Player.cpp
#include "Player.h" #include "Card.h" #include <iostream> #include <string> #include <array> #include <cassert> #include <algorithm> #include <vector> class Simple : public Player { public: Simple(std::string const simple_name) : name(simple_name) {} const std::string& get_name() const override ...
ALGO
0.983853
5.678524
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2021-03-19T03:12:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c859a34c241e...
538efd6b-31c7-4611-98bd-f6f065b61c84
pritmanvar/DSA-with-CPP
Binary Trees/Nodes at given distance in binary tree.cpp
// Problem Link : https://practice.geeksforgeeks.org/problems/nodes-at-given-distance-in-binary-tree/1# unordered_map<Node*,pair<int,char>> mp; // map to store ancestors of target in formate of<root,<distance,subtree>> vector<int> ans; // to store answer // This function will find ancestors of the...
ALGO
0.999999
5.768607
{ "github_metadata": { "branch": "main", "commit_count": 648, "repo_created_at": "2021-05-22T09:01:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 15, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5ab63cf16...
72b74994-9e08-4a88-aa6e-12697724fafb
ces-silv/ProgramacionEstructurada
Tarea#2/8.18.cpp
#include <iostream> #include <cstring> #define MAX_LENGHT 100 #define MAX_LINES 20 using namespace std; int main() { int cont, aux = 0, contExt = 0; char lineas[MAX_LINES][MAX_LENGHT]; char searchCaracter; cout << "Cuantas lineas de texto desea ingresar?" << endl; cin >> cont; cout << endl; ...
TOOL
0.969154
3.345274
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2023-08-21T04:02:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0b262f55013...
920c99bb-d290-4e9e-9ba1-7b1874bed646
Chomtana/cptraining
practicegrader/lp4power.cpp
#include <bits/stdc++.h> #define for1(a,b,c) for(int (a)=(b);(a)<(c);(a)++) #define for2(i,a,b) for(int (i)=(a);((a)<=(b)?(i)<=(b):(i)>=(b));(i)+=((a)<=(b)?1:-1)) #define all(x) x.begin(),x.end() using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef vector<int> vi; int main() { ios::sync_wi...
ALGO
0.999529
3.48587
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2016-04-15T03:46:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "32a5a39dc...
890581be-fa4b-4e00-ba1a-686061b23751
shedlock987/rrt_graph_builder
graphLib/src/graph.cpp
/** * MIT License * * Copyright (c) 2025 <NAME> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, ...
ALGO
0.993006
4.883579
{ "github_metadata": { "branch": "main", "commit_count": 89, "repo_created_at": "2024-07-25T01:56:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "a9ec0f70357...
7c61a005-d7b7-4414-95f6-01f0159b43af
Tazri/Problem-Solving-By-C-and-C-Plus-Plus
hackerrank/CaesarCipher.cpp
// link : https://www.hackerrank.com/challenges/caesar-cipher-1/problem #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef double dl; #define optimize() \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define fraction() ...
ALGO
0.999909
4.233753
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2024-11-25T23:59:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d118633c1...
20cd343f-2e9a-46e7-80e5-47d310c1aa3f
seung-gwang/game-programming
codes/code_flow/enum.cpp
#include <iostream> using namespace std; #define DEFINE_SCISSORS 1 //#이 붙은 경우는 전처리 지시문 #define DEFINE_TEST cout << "this is define test" << endl; //1)전처리 2)컴파일 3)링크 //1)전처리는 컴파일 전 기초작업 //#include iostream ==> 복붙해달라는 뜻임. int main() { DEFINE_TEST; const int ROCK = 1; const int PAPER = 2; const int SCISSORS = 3; /...
ALGO
0.976676
3.307964
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2022-01-02T14:47:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f8ee4b5c3dc6...
822475f5-d668-49cb-9361-90e9b3ac5fd9
AnswerExplanationAll/AcWing
merge_sort.cpp
#include <iostream> using namespace std; const int N = 1e6 + 10; // 定义一个常量 N,表示数组的最大长度 int arr[N]; // 定义一个全局数组 arr,长度为 N int temp[N]; // 定义一个临时数组用于存储合并后的结果 int n; // 定义一个全局变量 n,表示数组的实际长度 void merge_sort(int arr[], int l, int r) { if (l >= r) return; // 如果左边界大于等于右边界,直接返回 int mid ...
ALGO
0.999999
5.341115
{ "github_metadata": { "branch": "sub_origin", "commit_count": 10, "repo_created_at": "2025-06-07T13:22:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3fe90...
02f3e062-d6ee-4c40-8200-386c00b3b073
SeboCode/ETHZ-AlgoLab-2020
problem_of_the_week_2/deck_of_cards/main.cpp
#include <iostream> #include <vector> #include <algorithm> #include <iterator> void testcase() { int n; std::cin >> n; int k; std::cin >> k; std::vector<int> card_values{}; std::copy_n(std::istream_iterator<int>(std::cin), n, std::back_inserter(card_values)); int left = 0; int right = 1; in...
ALGO
0.999785
5.206055
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2021-01-28T01:12:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "62a46adcb...
ad86b550-b723-4f74-a77f-12712ea854ab
pradeep7G/DSA-CPP
494-target-sum/494-target-sum.cpp
class Solution { public: //TLE O(2^n) time, O(n) space; int bruteforce(int p,vector<int> &nums,int sum){ if(p==nums.size()){ return sum==0; } return bruteforce(p+1,nums,sum+nums[p]) + bruteforce(p+1,nums,sum-nums[p]); } //2 brute with hashmap unordered_map<string,...
ALGO
0.999997
4.934277
{ "github_metadata": { "branch": "master", "commit_count": 1807, "repo_created_at": "2022-05-04T07:19:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "12069e4...
af1d4d60-e0e7-4d09-baf1-ab103f2da182
PrahladMV/DSA
specialstack.cpp
#include <iostream> #include <stack> class SpecialStack { private: std::stack<int> mainStack; // to store elements std::stack<int> minStack; // to keep track of the minimum element public: // Function to push an element onto the stack void push(int value) { mainStack.push(value); // ...
ALGO
0.996053
7.170243
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2023-12-31T04:26:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "677757a4132...
4619c16f-2c76-434c-a26a-a3d3462ddb1b
JonasRzez/jpscore_noise
libcore/src/routing/global_shortest/DTriangulation.h
/** * \file DTriangulation.h * \date Nov 30, 2012 * \version v0.7 * \copyright <2009-2015> Forschungszentrum Jülich GmbH. All rights reserved. * * \section License * This file is part of JuPedSim. * * JuPedSim is free software: you can redistribute it and/or modify * it under the terms of ...
ALGO
0.947798
5.949943
{ "github_metadata": { "branch": "velocity_new", "commit_count": 3745, "repo_created_at": "2020-07-03T10:17:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2...
8be93b38-cec5-4928-8893-d49a9c22417f
yooniversal/SWMaestro-coding-test
yooniversal/15489.cpp
// 15489 #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vector<pair<int, int>> vii; typedef pair<int, int> ii; const int MAX = 100005, INF = 1000000001, MOD = 1000000000; int cache[35][35]; int f(int r, int c) { if ( r <= 1 || c...
ALGO
0.998747
4.633579
{ "github_metadata": { "branch": "main", "commit_count": 198, "repo_created_at": "2023-01-09T07:47:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "80211f314c...
dcff9b22-2ef6-4966-acc8-a8352c1fcea0
majharul-web/Basic-Data-Structures
linked-list/practice/all_in_one.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->prev = NULL; } }; void print_left_to_right(Node *head) { Node *temp = head; while (temp != NULL) { ...
ALGO
0.9999
5.27025
{ "github_metadata": { "branch": "main", "commit_count": 76, "repo_created_at": "2024-12-08T03:45:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "eac80a04631...
dcb3f669-6609-4664-8e67-65c9908e3477
matthewschallenkamp/Red-Team-Code
open_kattis/circularrmq/circularrmq.cpp
// modified from https://sites.google.com/site/indy256/algo/segment_tree_fast #include <iostream> #include <vector> #include <algorithm> #include <cstdlib> #include <sstream> #include <deque> using namespace std; typedef long long ll; typedef ll data; typedef ll lazy; struct segment { lazy noChange = 0; data z...
ALGO
0.99999
5.70395
{ "github_metadata": { "branch": "master", "commit_count": 260, "repo_created_at": "2018-09-02T05:40:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ae22f789...
585c588b-667e-4fee-98f7-346884be1223
tanishqshah/leetcode
Searching in an array where adjacent differ by at most k - GFG/searching-in-an-array-where-adjacent-differ-by-at-most-k.cpp
// { Driver Code Starts // C++ program to search an element in an array // where difference between all elements is 1 #include<bits/stdc++.h> using namespace std; // x is the element to be searched in arr[0..n-1] // such that all elements differ by at-most k. int search(int arr[], int n, int x, int k); // Driver pro...
ALGO
0.999876
5.904594
{ "github_metadata": { "branch": "main", "commit_count": 1807, "repo_created_at": "2021-08-28T14:44:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3e375d325...
ed6685d5-9585-40f5-8b84-4720092a272f
kuony/Algorithm
segment tree/세그먼트트리_3653_영화수집.cpp
#include<stdio.h> int st[1 << 19]; int pivot = 1<<18; int bias = 1 << 17; int map[100001]; void init() { for (int i = 0; i < (1 << 19); i++) st[i] = 0; for (int i = 0; i < 100001; i++) map[i] = 0; } void update(int idx, int val) { st[idx] = val; idx >>= 1; while (idx) { st[idx] = st[idx * 2] + st[idx * 2 + ...
ALGO
0.999878
3.818626
{ "github_metadata": { "branch": "master", "commit_count": 45, "repo_created_at": "2021-09-23T02:11:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0e76839bb...
8dfbb11e-5d76-41fa-a584-84c9ba0c11d7
datakaveri/iudx-MOTION2NX
src/examples/beavy_arithmetic/beavy_arithmetic.cpp
// MIT License // // Copyright (c) 2021 <NAME> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merg...
TOOL
0.991176
6.099617
{ "github_metadata": { "branch": "CNN", "commit_count": 1529, "repo_created_at": "2022-07-26T09:44:02.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3, "forks": 11, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f360e058d3...
be68e27d-182a-4127-9562-6d23d7ffc111
ishandutta2007/codeforces-l
lyc_music/normal/1244/C.cpp
//QwQcOrZ yyds!!! #include<bits/stdc++.h> #define ll long long #define F(i,a,b) for (int i=(a);i<=(b);i++) #define R(i,a,b) for (int i=(a);i<(b);i++) #define D(i,a,b) for (int i=(a);i>=(b);i--) #define go(i,x) for (int i=head[x];i;i=Next[i]) #define mp make_pair #define pb push_back #define pa pair < int,int > #define ...
ALGO
0.999852
3.298501
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:17:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "40bc93c6a0ed...
46438304-c019-46c9-a029-a831bfd32527
davisking/dlib
dlib/image_processing/correlation_tracker.h
// Copyright (C) 2015 <NAME> (<EMAIL>) // License: Boost Software License See LICENSE.txt for the full license. #ifndef DLIB_CORRELATION_TrACKER_H_ #define DLIB_CORRELATION_TrACKER_H_ #include "correlation_tracker_abstract.h" #include "../geometry.h" #include "../matrix.h" #include "../array2d.h" #include "../image...
ALGO
0.939823
6.750121
{ "github_metadata": { "branch": "master", "commit_count": 8325, "repo_created_at": "2014-01-29T00:45:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 14068, "forks": 3436, "issues": 41, "pull_requests": 5 }, "file_meta": { "content_id": ...
7824f5ce-71b2-49eb-b5e2-f0878a3a5238
sssvip/LeetCode_lxw
LeetCode_CPP/num119/num119.cpp
// File: num119.cpp // Author: lxw // Date: 2015-07-10 /* Num num119: Pascal's Triangle II Source: https://leetcode.com/problems/pascals-triangle-ii/ Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Return [1,3,3,1]. Note: Could you optimize your algorithm to use only O(k) e...
ALGO
0.999137
6.279715
{ "github_metadata": { "branch": "master", "commit_count": 474, "repo_created_at": "2017-09-26T08:22:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "db59d0d3...
5a5c9923-10fb-497a-9a77-8a5a6408f1ad
XiaotaoGuo/Leetcode-Solution-In-Cpp
tree/medium/450.DeleteNodeInABst.cpp
/* * @lc app=leetcode id=450 lang=cpp * * [450] Delete Node in a BST * * https://leetcode.com/problems/delete-node-in-a-bst/description/ * * algorithms * Medium (42.98%) * Likes: 2090 * Dislikes: 90 * Total Accepted: 128.4K * Total Submissions: 292.2K * Testcase Example: '[5,3,6,2,4,null,7]\n3' * ...
ALGO
0.999995
6.668858
{ "github_metadata": { "branch": "master", "commit_count": 366, "repo_created_at": "2019-09-23T17:40:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3fe39940...
b4141764-7f0c-4bd2-8649-53acf63bf8c1
Tanmay-s55/DAA-LAB
Week 2/week2_1.cpp
#include<bits/stdc++.h> #include<vector> using namespace std; int bSearch(int arr[], int l, int r, int k) { if (r < l) return -1; int m = l + ((r - l) / 2); if (arr[m] == k) return m; else if (arr[m] < k) return bSearch(arr, m + 1, r, k); else return bSearch(arr, l, m - 1, k); } int countFreq(int arr[...
ALGO
0.999909
5.353021
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2022-03-04T16:31:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "20694fe5d23...
a702b9b9-1e21-45be-be86-08d90556699d
rudemora/FAL
juez38/juez38/juez38.cpp
// juez38.cpp : Este archivo contiene la función "main". La ejecución del programa comienza y termina ahí. // #include <iostream> #include <vector> #include <fstream> int resolver(std::vector<int> v, int inicio, int final, int primero) { if (inicio + 1 >= final) { if (v[inicio] != 1 && primero == v.size()...
ALGO
0.999533
4.666664
{ "github_metadata": { "branch": "master", "commit_count": 30, "repo_created_at": "2023-11-29T08:35:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f83ceaab8...
a8ffae85-41a6-4f05-b9f5-f202016e8016
mschmit6/jpl_ephemeris
jpl_ephemeris/celestial_bodies/ephemeris_tables/earth_from_emb_gcrf_table.hpp
#ifndef JPL_EPHEMERIS_CELESTIAL_BODIES_EPHEMERIS_TABLES_EARTH_FROM_EMB_GCRF_TABLE_HPP #define JPL_EPHEMERIS_CELESTIAL_BODIES_EPHEMERIS_TABLES_EARTH_FROM_EMB_GCRF_TABLE_HPP /*! * \file jpl_ephemeris/celestial_bodies/ephemeris_tables/earth_from_emb_gcrf_table.hpp * \brief Static class containing the CSpice Chebyshev p...
ALGO
0.916566
5.75566
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2024-05-21T01:40:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fccf633135e2...
4ec94ba8-bdbe-4390-8186-8e326d5c82f5
ANA-CNU/ANA-Daily-Algorithm
강정우/Boj2155.cpp
#include <iostream> #include <cmath> using namespace std; pair<long long, long long> getCoordinates(long long n) { long long i = 0; while (true) { if (n > i * i && n <= (i + 1) * (i + 1)) { long long l = n - i * i; if (l % 2 == 0) { return make_pair(i * 2, l / 2);...
ALGO
0.999943
3.968353
{ "github_metadata": { "branch": "main", "commit_count": 3037, "repo_created_at": "2022-03-01T01:05:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 12, "forks": 13, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c704c35a...
908aca58-79aa-407c-a342-1b4d0407cc1e
SubhamAdhikari20/C-plus-plus-Language
16-Inline Functions, Default Arguments and Constant Arguments-C++/main.cpp
#include <iostream> using namespace std; inline int product(int x, int y); // ----> Function prototype float return_on_investment(int money_invested, float interest_rates = 10.5){ return money_invested * interest_rates; }; // default arguments must be given at the extreme right or at the end whereas necessary a...
TOOL
0.935928
5.665905
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-11-05T10:24:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ec2cef6132ef...
f168016c-51bd-456d-8543-cecb69b0d4c7
leandromineti/gbdcd
src/rcpparma-source.cpp
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- // we only include RcppArmadillo.h which pulls Rcpp.h in for us #include "RcppArmadillo.h" // via the depends attribute we tell Rcpp to create hooks for // RcppArmadillo so that the build process will know what to do // // [[Rcpp::depe...
ALGO
0.99969
5.851236
{ "github_metadata": { "branch": "master", "commit_count": 83, "repo_created_at": "2017-09-05T19:20:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "10c038233...
b2e2bcf2-c03c-47f0-949a-14c2bbfaa5d7
songwenas12/csp-drl
or-tools-6.7.2-customized/examples/cpp/jobshop.cc
// Copyright 2010-2017 Google // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in wri...
ALGO
0.956128
6.560458
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2021-12-09T14:20:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7f56e60ff8...
1080a8ce-2fd7-4106-b327-9f527ef749a9
MingZwhy/UCAS-Data_Structure
作业题/pre_post.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct TreeNode { char val; struct TreeNode *left,*right; }Binode,*Bitree; /*根据中序和后续创建二叉树*/ void Traversal(struct TreeNode** root,char* preorder, int preorderSize, char* postorder, int postorderSize) { int i; int rootValue = preorder[0]; ...
ALGO
0.999959
3.924387
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2022-06-27T08:30:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ba85e5d1d...
49eedffd-2c8a-4def-a822-13b52f8bbfe8
biswanaths/competition
cf/999/b.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.999978
3.28644
{ "github_metadata": { "branch": "master", "commit_count": 83, "repo_created_at": "2015-02-26T12:45:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f336c93a1...
3ab783a7-af3d-44ac-a5f0-f0f2c6252a26
BaoTrung37/PTIT_Sources
SPOJ/P166PROC - ROUND 6C.cpp
// // Code By CodeWar :3 #include <bits/stdc++.h> using namespace std; typedef long long i64; const int mod = 1e9+7; #define pb push_back; #define all(x) (x).begin(), (x).end() #define set_vect(a,n); vector<int>a(n); for(auto &z : a)cin>>z; char c[102][102]; int n,res; void solve(){ cin >> n; for(int i = 0 ; i < n ; ...
ALGO
0.999976
4.82221
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2020-06-10T16:51:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8544d0e4d...
167c7b3d-b26a-432d-9aee-b14a1666725f
William-Dorsch/Open-Source-Train-SIm-Controller-v2
scripts/arduino/RSUinterface/RSUinterface.ino
#include <Keyboard.h> const int buzzer = 2; const int sandOn = 6; const int sandMomentary = 5; const int sandOff = 7; const int door = 10; const int bell = 5; const int horn = 4; const int reverser = A4; const int throttle = A3; const int brake = A0; const int debounceDelay = 15; // Increased delay for debouncing unsi...
ALGO
0.903358
4.527131
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2025-07-15T13:07:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2c6bebc5c9c...
bf414d0f-b0f5-4501-9794-6d49d68c91a3
ishandutta2007/codeforces-nonalphabetic
__math/normal/568/A.cpp
#define _USE_MATH_DEFINES #define _CRT_SECURE_NO_DEPRECATE #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <limits> #include <ctime> #include <cassert> #include <map> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include...
ALGO
0.999897
3.666835
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:49:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b2e834c3ea8d...
c5f3a920-d449-401d-b97d-6b97a72dab97
petrocket/spacescape
trunk/Spacescape/lib/QtCore.framework/Versions/5/Headers/qtextboundaryfinder.h
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees...
TOOL
0.94237
6.095374
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2016-09-05T02:58:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 343, "forks": 61, "issues": 8, "pull_requests": 1 }, "file_meta": { "content_id": "d2fc1c...
5cd81556-eb6f-4cbe-ab60-11b885751cab
eecrazy/ACM
图论/hoj1056最小顶点覆盖Machine Schedule.cpp
//DFS找增广路,速度慢。O(nm)二分图最大匹配。等于最小顶点覆盖 #include <iostream> #include<cstdio> #include <string.h> using namespace std; #define maxn 102//顶点个数 bool map[maxn][maxn];//存图 bool mark[maxn];//寻找增广路时的标志数组 int nx,ny,k;//A,B集合中的点数 int cx[maxn],cy[maxn];//匹配到的顶点序号 int findpath(int u) { int i,j; for (int i = 0; i < ny; ++i) ...
ALGO
0.999978
3.942519
{ "github_metadata": { "branch": "master", "commit_count": 27, "repo_created_at": "2013-05-03T06:45:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 385, "forks": 113, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ca1b4...
bf7cc4a0-ac97-433f-812e-c108790bb397
ShahjalalShohag/ProblemSolving
codeforces/938/G.cpp
#include<bits/stdc++.h> using namespace std; const int N = 2e5 + 9; struct Basis { vector<int> a; void insert(int x) { for (auto &i: a) x = min(x, x ^ i); if (!x) return; for (auto &i: a) if ((i ^ x) < i) i ^= x; a.push_back(x); sort(a.begin(), a.end()); } int minxor(int x = 0) { fo...
ALGO
0.999927
5.212188
{ "github_metadata": { "branch": "master", "commit_count": 2261, "repo_created_at": "2020-12-20T21:28:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 37, "forks": 13, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "633c4...
286f8eb4-f0ea-4636-9cf8-80b74b5e54e8
flameshimmer/leet2022
FizzBuzz.cpp
#include "stdafx.h" //Given an integer n, return a string array answer (1-indexed) where: //answer[i] == "FizzBuzz" if i is divisible by 3 and 5. //answer[i] == "Fizz" if i is divisible by 3. //answer[i] == "Buzz" if i is divisible by 5. //answer[i] == i (as a string) if none of the above conditions are true. // // /...
ALGO
0.998637
6.13063
{ "github_metadata": { "branch": "newMain", "commit_count": 113, "repo_created_at": "2022-05-31T18:51:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3f657e0...
4c4db6ca-7da7-41f5-a1fd-905b8665158b
48592385/TP4-ST-SUCHOWOLSKI-BECK-MOSFOVICH-HOROWITZ
Tp_eeprom/Tp_eeprom.ino
// Apellidos: Beck,Suchowolski,Horowitz,Mosfovich, Grupo:5 #include <Preferences.h> #include <DHT.h> #include <U8g2lib.h> Preferences preferences; // botones y sensores #define DHTPIN 23 #define DHTTYPE DHT11 #define BOTON_MAS 35 #define BOTON_MENOS 34 #define LED_ALARMA 25 DHT dht(DHTPIN, DHTTYPE); U8G2_SH1106_128X...
TOOL
0.931848
5.729573
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-07-11T11:49:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2e0cfb156913...
5211ba43-5143-4fb1-af1e-437b830c9d58
pritamnikam/CodingInterviewPreparation
FastAndSlowPointers/LinkedListCycleLength.cpp
using namespace std; #include <iostream> /* We can use the above solution to find the cycle in the LinkedList. Once the fast and slow pointers meet, we can save the slow pointer and iterate the whole cycle with another pointer until we see the slow pointer again to find the length of the cycle. */ class ListNode...
ALGO
0.999988
6.240841
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2022-02-24T04:41:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a5d99cd849c9...
1ae22d4f-b2bb-45f1-b52a-3a00827d6c34
himbisht0000/LeetCode-75
Delete the Middle Node of a Linked List.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* deleteMiddl...
ALGO
0.999141
6.103621
{ "github_metadata": { "branch": "main", "commit_count": 174, "repo_created_at": "2024-03-03T15:58:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0d413f56ce...
9b13e266-fec8-4a72-978d-a1603058b4bf
syohex/leetcode
problems/0290-word-pattern/main.cpp
#include <cassert> #include <string> #include <vector> #include <map> #include <set> bool wordPattern(const std::string &pattern, const std::string &str) { std::vector<std::string> v; std::string tmp; for (size_t i = 0; i < str.size();) { if (str[i] == ' ') { if (!tmp.empty()) { ...
ALGO
0.998091
5.755888
{ "github_metadata": { "branch": "master", "commit_count": 1794, "repo_created_at": "2020-06-01T00:08:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cfd4366...
3a31b638-5218-41fc-bfc3-ce80b8e9c0e6
ZhangL3/haizeix19-8
01programDesignInC/05arrayString/OJ191.cpp
#include <stdio.h> #include <inttypes.h> void markNotPrimeNums(bool *notPrimeNums, int size) { for (int i = 2; i * i < size; i++) { if (notPrimeNums[i]) continue; for (int j = i * i; j <= size; j += i) { notPrimeNums[j] = true; } } } int main() { int l, r; int lFarPrime = 0, rFarPrime = 0, lClosePrime = ...
ALGO
0.999741
4.032072
{ "github_metadata": { "branch": "main", "commit_count": 243, "repo_created_at": "2022-09-22T20:17:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "83c223c57f...
d557830b-b8a1-40bc-9b51-976e38cdcdcd
Sam-Ofiaza/DijkstrasAlgorithmWithAdjacencyList
DijkstraAlgorithm.cpp
// // Created by Sam on 11/26/2021. // #include "DijkstraAlgorithm.h" DijkstraAlgorithm::DijkstraAlgorithm(LinkedList list) : adjacencyList(list), source(nullptr) {} void DijkstraAlgorithm::runAlgorithm(Vertex *v, dataType type) { source = v; // Initialize/reset leastPathData, predecessors, and unrelaxe...
ALGO
0.999644
5.066856
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2022-01-22T02:40:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cbd091f91d...
0ffa485c-94ee-4bf2-90e5-cdd2d5493794
leeyikjiun/cp-algorithms-data-structures
lowest_common_ancestor_binary_lifting.cpp
int l = ceil(log2(n)); int timer = 0; vector<int> tin(n), tout(n); vector<vector<int>> up(n, vector<int>(l+1)); function<void(int, int)> dfs = [&](int u, int p) { tin[u] = ++timer; up[u][0] = p; for (int i = 1; i <= l; ++i) { up[u][i] = up[up[u][i-1]][i-1]; } for (int v : adj[u]) { ...
ALGO
0.999925
4.961362
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2021-08-15T06:24:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d51dd74d9e2...
1dc1e90d-d4bc-4cf2-922d-d1849ff36b9d
CMU-SAFARI/Scrooge
baseline_algorithms/darwin-gpu/align.h
/* Copyright 2018 <NAME>, <NAME> and <NAME> Copyright 2018 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify...
ALGO
0.997277
3.704927
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2022-05-29T12:43:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 38, "forks": 4, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "06f8d23fe5e...
24425712-894a-4c11-9cca-caf82c21acae
Yunme/LeetCodeAlgorithm
heap/1046.cpp
#include <algorithm> #include <array> #include <bitset> #include <climits> #include <deque> #include <fstream> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <tuple> #include <unordered_set> #include <utility> #includ...
ALGO
0.999545
4.61823
{ "github_metadata": { "branch": "main", "commit_count": 297, "repo_created_at": "2024-05-06T14:13:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "41a32f6d37...
73f25d8f-3250-4d44-b42b-6cc9b8ff4ed6
westlicht/performer
src/core/math/Mat4.cpp
#include "Mat4.h" Mat4::Mat4() { a12 = a13 = a14 = 0.f; a21 = a23 = a24 = 0.f; a31 = a32 = a34 = 0.f; a41 = a42 = a43 = 0.f; a11 = a22 = a33 = a44 = 1.f; } Mat4::Mat4( float a11_, float a12_, float a13_, float a14_, float a21_, float a22_, float a23_, float a24_, float a31_, float a32_...
TOOL
0.974554
6.370459
{ "github_metadata": { "branch": "master", "commit_count": 1271, "repo_created_at": "2017-07-25T20:51:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 249, "forks": 76, "issues": 123, "pull_requests": 4 }, "file_meta": { "content_id": "88...
c1f79ada-2039-41e5-a276-967bc1cc8fe6
shahanxali/Competitive-Programming
LeetCode/2416-SumOfPrefixScoresOfStrings.cc
//Question: https://leetcode.com/problems/sum-of-prefix-scores-of-strings/?envType=daily-question&envId=2024-09-25 //Level: Hard struct TrieNode{ unordered_map<char, pair<TrieNode*, int>> children; }; class Solution { public: void add(string s, TrieNode* head){ TrieNode* temp = head; for(aut...
ALGO
0.999986
6.29757
{ "github_metadata": { "branch": "main", "commit_count": 261, "repo_created_at": "2023-09-03T19:27:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "f4beff0254...
0481c42e-4850-4394-b4e6-60c1ab3b67b1
apache/mxnet
src/api/operator/numpy/linalg/np_tensorsolve.cc
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
ALGO
0.980377
7.264853
{ "github_metadata": { "branch": "master", "commit_count": 11896, "repo_created_at": "2015-04-30T16:21:15.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 20806, "forks": 6757, "issues": 1805, "pull_requests": 204 }, "file_meta": { "content_i...
da09dfa3-021a-4377-a222-0d5006be1ebe
VoCongLinh/VoCongLinh_monC
Chapter 03/Program Chanllenges/Challenges_19.cpp
#include <iostream> #include <cmath> #include <iomanip> using namespace std; int main() { double loanAmount, annualInterestRate, monthlyInterestRate, monthlyPayment; int numberOfPayments; // Nhập số tiền vay, lãi suất hàng năm và số lần trả trong năm cout << "Nhap so tien vay (USD): "; cin >> loan...
TOOL
0.988188
4.016815
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-09-24T14:09:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "379b048bced5...
24a861c9-42f7-424e-b9ee-763184d064bb
hugo0aq/ds_C_Cpp
3_queue/array_imple/array_imple.cpp
#include <iostream> using namespace std; #define N 10 class Queue { private: int A[N]; int front, rear; public: //init Queue() { front = -1; rear = -1; } //Check is empty bool IsEmpty() { return (front == -1 && rear == -1); } // heck is empty bool IsFull() { return (rear + 1) % N =...
ALGO
0.981492
3.878249
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2023-03-20T12:07:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0c2f5e2cd...
2021b64b-d67c-4e58-9da2-297b0aa477de
itanini/C-CPP-HUJI
EX4/Matrix.cpp
// // Created by itani on 6/10/2023. // #include <iostream> #include "Matrix.h" #include <cmath> Matrix::Matrix(int rows, int cols) { if(rows<0 || cols<0){ throw std::length_error(ILLEGAL_DIM); } this->rows_ = rows; this->cols_ = cols; matrix_ = new float[rows_*cols_]; leader_index=N...
ALGO
0.994629
4.84102
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-18T08:04:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "936aea465365...
ecd56d60-7f45-4376-8715-c2f1435e1f7f
vmos1/lbann_cosmogan
code/4_cpp_tests/6_3d_spectrum/main.cpp
/* Code to compute spectrum of a batch of 3D images array with multiple channels array dimension is (batch_size, num_channels, xsize,ysize) */ #include <iostream> #include <fstream> #include <sstream> #include <string> #include <cmath> #include <fftw3.h> using namespace std; void f_read_file(string fname, double * im...
DATA
0.973903
4.917911
{ "github_metadata": { "branch": "master", "commit_count": 74, "repo_created_at": "2020-03-06T22:37:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6f1449d99...
7ef5fcfd-908b-42ce-b263-99c73a06a081
Sookmyung-Algos/2021algos
algos_semina/1st_semina/seminar_2/D_11000/honi_11000.cpp
#include <iostream> #include <algorithm> #include <queue> using namespace std; struct classroom{ int s; int e; }c[200000]; bool compare(struct classroom a,struct classroom b){ if (a.s==b.s) return a.e<b.e; return a.s<b.s; } int main(){ cin.tie(0); cout.tie(0); ios_base::sync_with_std...
ALGO
0.999964
4.023519
{ "github_metadata": { "branch": "master", "commit_count": 5558, "repo_created_at": "2021-02-22T06:32:53.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4, "forks": 38, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e845c26...
e65ad00b-26a0-4b4e-b705-70dd7b595ca3
MAZHARMIK/Interview_DS_Algo
Linked List/Reverse Linked List.cpp
/* MY YOUTUBE VIDEO ON THIS Qn : https://www.youtube.com/watch?v=RreHsOfi14w Company Tags : Paytm, VMWare, Zoho, Accolite, Amazon, Microsoft, Samsung, Snapdeal, D-E-Shaw, MakeMyTrip, Teradata, Walmart, Goldman Sachs, Intuit, Adobe, SAP Labs, Tejas Network,...
ALGO
0.999955
5.899189
{ "github_metadata": { "branch": "master", "commit_count": 5946, "repo_created_at": "2020-07-12T13:13:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2586, "forks": 1357, "issues": 7, "pull_requests": 37 }, "file_meta": { "content_id": "...
fde7dcc6-996c-45c7-8bdf-0676adb9d9e9
rmsetty/c-
first_Sem/printNumberTriangle.cpp
/** * Program Name: printNumberTriangle.cpp * Purpose: This program prompts the user to enter a single decimal digit (0-9) * and prints a descending triangular pattern of numbers starting from that digit. * The first row of the triangle displays digits from the input down to 0, and * each subsequent row begins wi...
ALGO
0.998999
7.053331
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-05-22T18:07:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dea47942152f...
89684724-a69b-453b-90bb-4167d4818300
BaiChunhui-9803/ofec_code
instance/problem/continuous/single_objective/constrained/cec2017/c05.cpp
#include "C05.h" #include "../../../../../core/instance_manager.h" #include "../../../../../core/global.h" namespace ofec { namespace CEC2017 { void C05::initialize_() { Function::initialize_(); size_t size_var = std::get<int>(GET_PARAM(m_id_param).at("number of variables")); resizeVariable(size_var); ...
ALGO
0.9988
4.998229
{ "github_metadata": { "branch": "baichunhui", "commit_count": 20, "repo_created_at": "2025-02-19T01:49:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3ff1c...
5d3dc798-849c-421a-8c98-9e2c6beda2f6
Arnob616/Data-Structure-and-algo-basic
linked-list/nodepointer.cpp
#include<bits/stdc++.h> using namespace std; class Node { public: int data; Node *next; Node(int data,Node *n) { this->data = data; this->next = n; } }; int main() { Node *a = new Node(1,NULL); Node *b = new Node(2,NULL); Node *c = new Node(3,NULL); Node *d = new Node(4,N...
ALGO
0.999545
3.099239
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2024-01-25T07:27:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a54b638a6eb...
d1e7e535-b9b0-4648-9732-5362f967fdde
ellman121/SchoolworkArchive
CSC_300_Data_Structures/Program_3_Set_Union_Timing/assignment3.cpp
/*************************************************************************//** * Assignment 3 - List similarities x3 * * <NAME> * * December 2, 2014 * Professor: Dr. <NAME> * Course: CSC 300 - 10:00am * Location: McLaurey 205 * * Program Information * * Details * This program reads in two lists of 32-bit...
ALGO
0.993317
5.088439
{ "github_metadata": { "branch": "master", "commit_count": 55, "repo_created_at": "2015-11-16T19:07:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d8a13ddf2...
a5b495a9-41d3-4e90-813b-5f724685991b
Ansh718/SEM_3_Lab_Work
DSL-Assignments-SPPU-Sem3/dsl(Binary).cpp
#include<iostream> using namespace std; class Node { public: Node *prev,*next; bool n; friend class Binary; Node(){} Node(bool n) { this->n=n; prev=next=NULL; } }; class Binary { public: Node *start; Binary() { start=NULL; } ...
ALGO
0.997377
4.699076
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-05-07T13:10:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6550a71a540a...
0a3ff325-55b7-4554-958b-c1a9167bb8e6
pandanon50/algorithm
c++/study/solve/3_6/1780.cpp
// BOJ 1780 종아의 갯수 // https://www.acmicpc.net/problem/1780 #include <bits/stdc++.h> using namespace std; const int MAX_N = 2200; int N; int answer[3]; int maps[MAX_N][MAX_N]; int check(int s, int e, int len) { int first = maps[s][e]; for (int i = 0; i < len; i++) { for (int j = 0; j < len; j++) { if (...
ALGO
0.999934
4.633315
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2024-03-10T07:01:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f7a63e788...
bb92b62a-11a9-40c6-a010-742fecfbf0b4
bradparks/Restore__3d_model_from_pics_2d_multiple_images
src/rendering/cv_utils.hpp
// Copyright (c) 2015-2016, <NAME> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, ...
ALGO
0.928102
6.24642
{ "github_metadata": { "branch": "master", "commit_count": 107, "repo_created_at": "2016-04-12T16:01:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 30, "forks": 28, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e83a7b...
20fce1c4-d77b-4b8d-b777-0fa28a291b2a
ishandutta2007/codeforces-d
denisson/normal/1615/E.cpp
#include <bits/stdc++.h> #define ll long long #define db long double #define ull unsigned long long #define x first #define y second #define mp make_pair #define pb push_back #define all(a) a.begin(), a.end() using namespace std; #define pper(a) cerr << #a << " = " << a << endl; void per() { cerr << endl; } template...
ALGO
0.99988
3.65462
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:31:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4effc102e270...
131824dc-548a-4938-99f5-b1e78baed85c
unKNOWN-G/Coding-Practise
DSA/Algorithms/Sorting Algorithms/Merge Sort.cpp
/* 21-11-2020 13:42 Merge Sort The is a Divide and Conquer type algo. Divide into sub prolems . solve them and merge them and finally finish the bigger one It contanis 2 parts. Dividing into parts. Megre sort and then merge the sub arrays This needs to happen recurssively Time Complexity : O(nlogn) Worst ca...
ALGO
0.999996
5.440122
{ "github_metadata": { "branch": "master", "commit_count": 349, "repo_created_at": "2020-11-19T04:16:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3c8b7873...
75fd008a-3f2e-4571-9a77-d90770edb2f6
romanasa/olymp_codes
trains/train16/B.cpp
#include <bits/stdc++.h> using namespace std; const int dd = 1007; double need[dd][dd]; int n, w; bool check(int x, vector<int> &b) { if (x * (x + 1) / 2 > n) return false; vector<double> A; for (int it = 1; it <= x; it++) { for (int i = 0; i < it; i++) A.push_back(need[it][i]); } sort...
ALGO
0.999994
3.68396
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2019-04-11T12:03:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e928e54fbf...
b1842c19-1311-4ae0-935f-03d42f1db9be
pacha2880/competitive_programming_codes
Powerful Strings.cpp
#include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // #include <ext/rope> #define int ll #define mp make_pair #define pb push_back #define all(a) (a).begin(), (a).end() #define sz(a) (int)a.size() #define eq(...
ALGO
0.999951
3.551949
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2022-10-18T22:33:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f08a0f06fd9...
62d6a1e7-c4ec-4368-b4a7-036e9555df24
bornil-bd/CodeForces_2
B_Karina_and_Array.cpp
// b0rnil // feel free to ask any doubt @ <EMAIL> #include<bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int ull; #define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define v '\n' #define ii(a) ll a; cin>>a; #define string(a) string a; cin>>a; #de...
ALGO
0.999848
3.437358
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2023-05-20T10:07:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d92af3e06f...
fdfb4828-79b1-45f4-ab87-4b84809626ae
ssy-lbh/LLVM-main
libcxx/include/__algorithm/ranges_equal_range.h
//===----------------------------------------------------------------------===// // // Part of the LLVM __project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===-------------------------...
ALGO
0.989685
7.644186
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2022-11-02T08:33:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "eb7cdd0717...
5472d4cb-d2ac-4014-8986-070b1ac3f4df
ButinVladimir/Training-Algorithms
PlusPlus/balanced_forest.cpp
#pragma comment(linker, "/STACK:64000000") #include <stdlib.h> #include <fstream> #include <iostream> #include <vector> #include <stack> #include <stdlib.h> #include <stdio.h> #include <cstring> #include <map> #include <set> #include <string> #include <deque> #include <algorithm> #define _USE_MATH_DEFINES #include <mat...
ALGO
0.999621
4.029484
{ "github_metadata": { "branch": "master", "commit_count": 140, "repo_created_at": "2016-10-18T19:02:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4313890b...
40fbe57e-e039-4676-b280-9d51ca436e65
NickMRamirez94/RouteFinder
main.cpp
#include <iostream> #include <iomanip> const int SIZE = 5; const int INFINITE = 999999999; using namespace std; /* MST is actually probably not going to work for this problem the way it is because it can visit a node more than once. The traveling salesman states that you only visit a node one time. Look into Christo...
ALGO
0.999987
4.629899
{ "github_metadata": { "branch": "master", "commit_count": 57, "repo_created_at": "2017-10-03T17:06:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "339629072...
004b36b9-988b-4425-93d3-d69deaeadf34
noornabi-noor/Codeforces
sum_subset.cpp
// #include<bits/stdc++.h> // using namespace std; // void printSubsetsRec(int arr[], int i, int sum, int n, int subset[], int subsetSize) { // if (i == n) { // if (sum == 0) { // for (int j = 0; j < subsetSize; j++) { // cout << subset[j] << " "; // } // ...
ALGO
0.999448
5.35206
{ "github_metadata": { "branch": "main", "commit_count": 53, "repo_created_at": "2024-01-03T12:02:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2c19fa68b2f...
aec9d700-06cc-4192-bdc3-f8bfdf2f4b95
mikehung/competitive-programming
codeforces/63/C/sol.cc
#include <bits/stdc++.h> using namespace std; #ifdef DEBUG #define dbg(...) fprintf(stderr, __VA_ARGS__) #else #define dbg(...) #endif const int MAX = 14; string strs[MAX]; int n, a[MAX], b[MAX]; bool visit[MAX]; vector<string> ans, all_strs; void gen_strs(string cur = "") { if (cur.size() == 4) { ...
ALGO
0.999685
4.130869
{ "github_metadata": { "branch": "master", "commit_count": 182, "repo_created_at": "2018-10-18T09:10:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fdd96346...
968d7537-6e69-4c29-b975-20731b8b5697
trilinos/Trilinos
packages/rol/example/PDE-OPT/published/TRSPG_Kouri2021/dualksvm/example_01.cpp
// @HEADER // ***************************************************************************** // Rapid Optimization Library (ROL) Package // // Copyright 2014 NTESS and the ROL contributors. // SPDX-License-Identifier: BSD-3-Clause // *************************************************************************...
ALGO
0.999372
6.139063
{ "github_metadata": { "branch": "master", "commit_count": 104031, "repo_created_at": "2015-11-16T19:39:16.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1299, "forks": 593, "issues": 263, "pull_requests": 61 }, "file_meta": { "content_id":...
1c987304-03bd-400d-ad2f-5d9cb7d0da4c
utilForever/CubbyFlow-v1
Includes/Core/Solver/FDM/FDMMGPCGSolver3.h
/************************************************************************* > File Name: FDMMGPCGSolver3.h > Project Name: CubbyFlow > Author: <NAME> > Purpose: 3-D finite difference-type linear system solver using Multigrid > Preconditioned conjugate gradient (MGPCG). > Created Time: 2017/11/05 > Copyright (c)...
ALGO
0.982789
6.435567
{ "github_metadata": { "branch": "master", "commit_count": 2145, "repo_created_at": "2017-01-19T14:43:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 92, "forks": 11, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a5048...
27b5ab2d-ce20-4e5e-bb2f-ddcf4cbf8466
SLIIT-FacultyOfComputing/tutorial-03b-IT21180484
exercise03.cpp
#include <iostream> using namespace std; struct box{int Heigth, Width, Length;}; int volume(int Heigth, int Width, int Length); int main() { box b1,b2; int totalVolume; cout << "Enter Box 1 Height : "; cin >> b1.Heigth; cout << "Enter Box 1 Width : "; cin >> b1.Width; cout << "Enter...
TOOL
0.987508
3.686596
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2022-03-21T05:37:09.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3f17a185be9ac...
c239de39-a4b0-4040-ae7d-d162bb4662ea
brijrajk/DataStructuresCodeNCodeSeries
GraphTheoryCourse/Part1/L05BipartiteGraph/BipartiteGeeksForGeeks.cpp
// { Driver Code Starts // C++ program to find out whether a given graph is Bipartite or not. // It works for disconnected graph also. #include <bits/stdc++.h> using namespace std; const int MAX = 100; bool isBipartite(int G[][MAX],int V); int main() { int t; cin>>t; int g[MAX][MAX]; while(t--) { ...
ALGO
0.999694
5.996521
{ "github_metadata": { "branch": "master", "commit_count": 44, "repo_created_at": "2020-04-20T03:21:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f99eb8cfe...