uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
521e6127-d972-45b1-8add-e5ea02d8933b
exeventien/NMmatrixLib
MatrixMethods.cpp
#include <cstdlib> #include <cstdio> #include <cmath> #include <ctime> #include <Nvector.h> #include <NMmatrix.h> #include <MatrixMethods.h> void MatrixMethods::jacobiMethod(const NMmatrix& mat, const Nvector& b, Nvector& x1){ NMmatrix d(mat), r(mat); mat.print(); Nvector x0(b.getSize()); d.diagonalInverse(); d.p...
ALGO
0.999979
4.41892
db28f2b5-2ea7-4e78-b2cf-2aae42e150e1
Iftekhar-Ahamed/Code
B_Permutation_Value.cpp
/*** ** Bismillahir Rahmanir Rahim ** ALLAHU AKBAR ** ** Author: Iftekhar Ahamed Siddiquee ** Bangladesh University of Business and Technology, ** Dept. of CSE. ***/ #include <bits/stdc++.h> using namespace std; #define FIO cin.tie(NULL), ios_base::sync_with_stdio(false) #define read freo...
ALGO
0.999739
3.89035
626c3512-e34c-4c89-b0b1-a4c3db1f02cb
MikaelVallenet/R-Type
libs/boost/libs/mpi/example/in_place_global_min.cpp
// An example using Boost.MPI's all_reduce() that compute the minimum // of each process's value and broadcast the result to all the processes. #include <boost/mpi.hpp> #include <iostream> #include <cstdlib> namespace mpi = boost::mpi; int main(int argc, char* argv[]) { mpi::environment env(argc, argv); mpi::commu...
ALGO
0.999452
4.314044
3f0342f9-4daf-4fed-a7ff-d88f9a8c0fc6
yashsf08/competitive-programming
DSA/patterns/pattern-22.cpp
#include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { int n; cin >> n; int i = 1; int count = 1; while (i <= n) { int space; space = n - i; while(space) { cout<<" "; space--; } int j = 1; while (j <= i) { cout<<count<<" "; j++; ...
ALGO
0.999968
3.633094
377a07ea-de11-4c82-9677-1e02ed38f3ed
delwar03/CF
The_Great_Ninja_War.cpp
#include <bits/stdc++.h> #define int long long #define endl '\n' using namespace std; const int mod = 2520; const int N = 2e5 + 10; const int INF = 1e18 + 10; int dp[14][2520][512][2]; // (ind, rem, mask, tight) int pwr[10][10]; void solve() { int l, r; cin>>l>>r; string s; function<int(int, int, int, in...
ALGO
0.999302
5.013132
68b9d0d6-b1a7-496c-929c-5b75718a61b9
swathisnayak14/Interview_Prep
Strings/ParenthesisChecker.cpp
// Input: exp = “[()]{}{[()()]()}” // Output: Balanced // Explanation: all the brackets are well-formed // Input: exp = “[(])” // Output: Not Balanced // Explanation: 1 and 4 brackets are not well formed #include <bits/stdc++.h> using namespace std; bool parenthesisChecker(string exp) { stack<char> s; char a...
ALGO
0.99349
5.880389
25c24dad-b6a1-4494-b202-331a36ea90b1
kmjp/procon
2017-2021/2018/qupc/d.cpp
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZER...
ALGO
0.999943
3.619875
20a99bd0-df2a-4ff2-bf89-33f8d3bb02ac
champmaniac/LeetCode
2551-put-marbles-in-bags/2551-put-marbles-in-bags.cpp
class Solution { public: long long int putMarbles(vector<int>& v, int limit) { if(limit == 1 || limit == v.size()) return 0; long long int ans1 = 0, ans2 = 0; limit--; vector<long long int> sums; for(int i = 0; i < v.size() - 1; i++) { sums.push_back(v[i] + v[i + ...
ALGO
0.999967
5.433182
4c1d629d-b8c7-4a1b-8e75-1d6b8213cfcf
wilmer05/lakebolt
benchmarks/c++/dp.cpp
#include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<set> #include<map> #include<vector> #include<utility> #include<queue> #include<stack> #include<string> #include<algorithm> #include<cmath> #define ri(X) scanf("%d",&X) #define rii(X,Y) scanf("%d %d",&X,&Y) #define rf(X) scanf("%lf",&X) #d...
ALGO
0.999944
4.27573
d7173ba5-f795-4efc-b684-383f5d062353
ascheufele/scrabblesolver
main.cpp
#include <iostream> #include "Solver.hpp" using namespace std; int main(void) { char letters[] = { 'e', 'c', 'c', 'i', 'h', 't'}; Solver test; test.all_words(letters, 6, 5); return 0; }
ALGO
0.953353
4.164871
59f99d5a-58b8-4965-9749-6d233c174776
mramospe/Isis
general/src/LorentzVector.cpp
/////////////////////////////////////////////////////////////////////////// // // General package // // ------------------------------------------------------------------------ // // AUTHOR: Miguel Ramos Pernas // e-mail: <EMAIL> // // Last update: 29/06/2017 // // --------------------------------------------------...
TOOL
0.978975
5.370532
85ecdcc4-1be9-4ec3-aeb6-deea05e585f6
MiguelABatista/icpc-training
codeforces/105925/l.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> p64; typedef vector<ll> v64; #define forn(i, s, e) for(ll i = (s); i < (e); i++) #define ln "\n" #if defined(DEBUG) #define _ (void)0 #define debug(x) cout << __LINE__ << ": " << #x << " = " << x << ln #else #define...
ALGO
0.998343
4.397291
766cc07d-a5a9-46aa-9416-bf7fdbce1fd6
Divesh1602/Leetcode
2486-append-characters-to-string-to-make-subsequence/2486-append-characters-to-string-to-make-subsequence.cpp
class Solution { public: int appendCharacters(string s, string t) { int i=0; int ct=0; for(int j=0;j<s.length();j++){ if(s[j]==t[i]){ i++; ct++; } } return (t.length()-ct); } };
ALGO
0.99995
5.953562
ad38983b-3d75-4891-b07e-fd719bd6916d
kmk0105-S2/OSP
image 처리/hist_eq_YUV.cpp
#include "hist_func.h" void hist_eq(Mat &input, Mat &equalized, G *trans_func, float *CDF); int main() { Mat input = imread("input.jpg", IMREAD_COLOR); Mat equalized_YUV; cvtColor(input, equalized_YUV, COLOR_BGR2YUV); // RGB -> YUV // split each channel(Y, U, V) Mat channels[3]; split(equalized_YUV, channel...
ALGO
0.964757
4.1846
b9be8998-a5be-42f4-a784-7747bc1b9e4e
rendiap100/git-crypt
util-unix.cpp
#include <sys/stat.h> #include <sys/types.h> #include <sys/wait.h> #include <sys/time.h> #include <errno.h> #include <utime.h> #include <unistd.h> #include <stdio.h> #include <limits.h> #include <fcntl.h> #include <stdlib.h> #include <dirent.h> #include <vector> #include <string> #include <cstring> #include <cstddef> #...
TOOL
0.904655
6.353211
74bf882c-e8c9-42fd-b2f2-a06472e182d9
Henrik-Yao/NEUQ-ACM-Solution
winter-day1/0.题目/吴艺超/t1.cpp
#include<bits/stdc++.h> #define int long long using namespace std; int a[1000005],n,q; int lowbit(int x) { return x&-x; } void add(int x,int y) { while(x<=n) a[x]+=y,x+=lowbit(x); } int query(int x) { int ans=0; while(x!=0) ans+=a[x],x-=lowbit(x); return ans; } signed main() { cin>>n>>q; for(int i=1;i<=n;i++) ...
ALGO
0.99982
4.195006
e3e83a1d-a5b3-4570-9948-bba522181266
Haribala-09/hyprdots
User/History/-6ef7e4b5/nkFV.cpp
#include <iostream> #include <vector> #include <queue> #include <algorithm> using namespace std; #define int long long void solve() { int n; cin >> n; vector<pair<int, int>> haystacks(n); priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq; int totalHaybale...
ALGO
0.99994
5.180676
e6e325aa-622a-4403-ad23-4ebf87018629
Prathamesh-Patil-GitHub/practice-programs
PRO Leetcode/swap-nodes-in-pairs/Accepted/5-4-2023, 11_00_14 AM/Solution.cpp
// https://leetcode.com/problems/swap-nodes-in-pairs /** * 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) {} * }; ...
ALGO
0.999994
6.303827
4b0f6c1a-196b-4f18-92b8-bd9563fd4ab2
karankap00r/Algorithmic-Programming
Important-Problems-on-Online-Judges/hamiltonianCycle.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long bool vis[1000]; bool solve(ll g[100][100],ll cur,ll tot,ll v,ll path[]) { if(tot==v) { if(g[path[tot-1]][0]==1) { for(ll i=0;i<tot;i++) { cout<<path[i]<<" "; } cout<<...
ALGO
0.999961
4.457547
fe87dbcd-8ab7-4fb2-a7f1-bcb7f2d9bf90
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/Phi/top0-100/maximum-deletions-on-a-string-Solution3.deleteString/177833_DoS_Overflow.cpp
static void reds_handle_ticket(void *opaque) { RedLinkInfo *link = (RedLinkInfo *)opaque; char password[SPICE_MAX_PASSWORD_LENGTH]; time_t ltime; time(&ltime); RSA_private_decrypt(link->tiTicketing.rsa_size, link->tiTicketing.encrypted_ticket.encrypted_data, ...
ALGO
0.996265
4.417579
5f38d5f2-5ba1-4ef8-94dc-3feec26d2080
shivam-droid/DSA
Binary Search/07_KOKO_Eating_Banana.cpp
class Solution { public: int totalHours(vector<int>& arr,int mid,int h) { int totalhour = 0; for(int i=0;i<arr.size();i++) { totalhour += (ceil)((double)(arr[i])/(double)(mid)); if(totalhour>h){ return false; ...
ALGO
0.999785
5.440682
dc352af5-066f-4c49-b0b4-b6447b99fcfd
ankita0335/January2024
0859-buddy-strings/0859-buddy-strings.cpp
class Solution { public: bool checkFreq(string &s) { int arr[26] = {0}; for(char &ch : s) { arr[ch-'a']++; if(arr[ch-'a'] > 1) { return true; } } return false; } bool buddyStrings(string s...
ALGO
0.999993
5.795887
f7d1b481-23ee-400f-88d8-b26ee35215ac
ampl/coin
Ipopt/Ipopt/examples/ScalableProblems/MittelmannBndryCntrlDiri.cpp
#include "MittelmannBndryCntrlDiri.hpp" #ifdef HAVE_CASSERT # include <cassert> #else # ifdef HAVE_ASSERT_H # include <assert.h> # else # error "don't have header file for assert" # endif #endif using namespace Ipopt; /* Constructor. */ MittelmannBndryCntrlDiriBase::MittelmannBndryCntrlDiriBase() : y_d_(NU...
ALGO
0.999276
6.23673
679a9f8d-5890-4a87-ac0a-bc73bf36a760
kanishka-p1/DSA_Codes
Greedy/Striver/fractional_knapsack.cpp
/**************************************************************************** QUESTION ********************************************************************************/ /* Given weights and values of N items, we need to put these items in a knapsack of capacity W to get the maximum total value in the knapsack. Note: U...
ALGO
0.999972
5.615307
53b68604-392f-4fdd-b894-a49c220d3568
krydyh/Algorithm
Programmers/Lv.2/[12973]짝지어_제거하기.cpp
#include <string> #include <vector> using namespace std; int solution(string s) { vector<char> v; for(int i = 0; i < s.size(); ++i) { if(!v.empty() && v.back() == s[i]) v.pop_back(); else v.push_back(s[i]); } if(v.empty()) return 1; else return 0; }
ALGO
0.999943
4.933582
bc587a4f-e3b2-4eec-8142-f025d5797111
manojborugadda/Leetcode-questions
2570. Merge Two 2D Arrays by Summing Values/TWO_POINTER.cpp
class Solution { public: vector<vector<int>> mergeArrays(vector<vector<int>>& nums1, vector<vector<int>>& nums2) { vector<vector<int >> res; int i=0; int j=0; int n = nums1.size(); int m = nums2.size(); while(i < n && j < m) { int id1...
ALGO
0.999948
5.69722
b928af89-b433-4ac1-94a6-8f84e86eb91c
vfolunin/archives-solutions
EOlymp/11605.cpp
#include <iostream> #include <algorithm> #include <vector> #include <set> #include <map> #include <string> #include <numeric> using namespace std; int sum(const string &s) { if (s == "ADAUniversity") return 0; return accumulate(s.begin(), s.end(), 0); } int main() { freopen("input.txt", "r", stdin...
ALGO
0.999174
4.750095
443fb717-4daf-4d4d-9599-4ea18db9b479
artem-barsov/CP
opencup/XXII/XiAn/P.cpp
#include <bits/stdc++.h> using namespace std; int main () { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n; while (cin >> n){ vector<int> a(n+1); for (auto &it : a) cin >> it; vector<int> b(n+1, -1); int m = 0; for (;1 << m <= n; m++...
ALGO
0.999955
3.477997
07442e2e-15cd-451e-8abf-35044d9eee91
ApoorvaRaj123/codingProblems
41. reverseString.cpp
class Solution { public: void reverseString(vector<char>& s) { int start = 0; int end = s.size() - 1; while(start<=end){ swap(s[start++], s[end--]); } } };
ALGO
0.999436
6.27844
8889cc82-54c7-4d60-a6e7-a24e109e2be5
Daztok/CS300
CourseList/CourseInfo.cpp
/**Joel Hays *Project 2 *CS-300 */ #include <iostream> #include <regex> #include "CourseInfo.h" /** * Default constructor */ CourseInfo::CourseInfo() { //set root to nullptr root = nullptr; } /** * Destructor */ CourseInfo::~CourseInfo() { //recurse from root deleting every node destroyAll(root); } //Trave...
TOOL
0.99188
4.169352
fae87845-6ae9-4439-8a58-4415a7f9f9c5
pranavajith/CP-Practice
A_Game_23.cpp
#include <bits/stdc++.h> #include <iostream> #include <set> #include <cmath> #include <map> #include <sstream> #include <deque> #include <queue> #include <stack> #include <algorithm> #include <limits> #include <iomanip> using namespace std; #define ll long long ll mod = 1e9 + 7; // #define TxtIO freopen("input.txt","...
ALGO
0.999984
3.9159
dc87d0a7-d5df-42fe-aac6-d20cf2fb4c4e
erorPES/-
c++/labs+/lab 1+/1.cpp
#include <iostream> #include <cmath> using namespace std; int main() { short a = 1000; float b = 0.0001, c, d, e, f, g; c = pow((a - b), 3); d = pow(a, 3); e = pow(a, 2); f = pow(b, 3); g = pow(b, 2); cout << (c - (d - 3 * e * b)) / (f - 3 * a * g) << endl; return 0; }
ALGO
0.979753
3.095994
7743c85e-7f5e-4b98-9f4b-65e2efecc8b0
o-leolleo/RoadToCompete
codepit/H.cpp
#include <bits/stdc++.h> using namespace std; int T, sdk[4][4]; int row[4], col[4], sqr[2][2]; bool backtrack(int pos) { if (pos == 16) return true; int i = pos/4, j = pos%4; if (sdk[i][j]) return backtrack(pos+1); for (int c = 0; c < 4; ++c) { if (!(row[i] & (1 << c)) && !(col[j] & (1 << c)) && !(sqr[i/2][j...
ALGO
0.999793
4.247943
74f0b55a-f472-42ea-af3d-611e80a75575
TCGBench/TCGBench
data/human_performance_code/human_performance_code_canonical/P3384/ac_1.cpp
#include <bits/stdc++.h> const int N = 1e5 + 10; int n, m, rt, p[N], a[N]; long long mod, cnt = 0, dfn[N], siz[N], son[N], fa[N], top[N], dep[N]; std::vector<int> E[N]; class Tree { public: long long l[N << 2], r[N << 2], sum[N << 2], lazy[N << 2]; #define ls (p << 1) #define rs (p << 1 | 1) void bu...
ALGO
0.999987
4.597592
65626ea5-539a-4005-b1fc-f175d605d5ab
Kano-Hiroki/ESCAP-ERUINS
SDK/Physics/Box2D/include/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp
#include <Box2D/Dynamics/Joints/b2RevoluteJoint.h> #include <Box2D/Dynamics/b2Body.h> #include <Box2D/Dynamics/b2TimeStep.h> // Point-to-point constraint // C = p2 - p1 // Cdot = v2 - v1 // = v2 + cross(w2, r2) - v1 - cross(w1, r1) // J = [-I -r1_skew I r2_skew ] // Identity used: // w k % (rx i + ry j) = w * (-r...
ALGO
0.988855
7.730262
9cb8a855-c14a-44ff-a79b-39338fdb4922
n0l3r/competitive-programming
leetcode/zigzag-conversion.cpp
#include <bits/stdc++.h> using namespace std; string convert(string s, int numRows) { if (numRows == 1) return s; string result = ""; int idx = 2 * (numRows - 1); for(int i = 0; i < numRows; i++){ for(int j = i; j < s.length(); j += idx){ result += s[j]; int connector = ...
ALGO
0.999997
4.897709
274b93ad-3b90-4eb7-90f8-feea43629b1b
AY20201/Zen-Ascent
engine_source/CollisionObject.cpp
#include"../engine_headers/CollisionObject.h" #include"../engine_headers/CollisionSolver.h" /* CollisionObject::CollisionObject(glm::vec3 colliderRadius, glm::vec3 position, glm::vec3 velocity) { CollisionObject::position = position; CollisionObject::velocity = velocity; CollisionObject::colliderRadius = colliderRa...
TOOL
0.96499
6.020987
76e9c952-74b1-48c5-b356-5e662eeb5305
MaheshSharan/LeetCode_Automation
solutions/2700-2799/2792.Count Nodes That Are Great Enough/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.99998
6.068315
d38c24aa-79bb-4f4f-a387-40cc35208b99
SI-Abid/Hello-world
Codeforces/1864B.cpp
#include <bits/stdc++.h> using namespace std; #define nl "\n" #define ll long long void solve() { int n, k; cin >> n >> k; string s; cin >> s; if(k%2==0){ sort(s.begin(),s.end()); cout<<s<<nl; return; } string odd, even; odd = even = ""; for (size_t i = 0; i ...
ALGO
0.999994
4.138913
ca763b51-52d4-40d5-8991-92df0b4b7e85
OpenDigitalTwin-Dev/FENGSim
toolkit/Geometry/cgal/examples/Triangulation/triangulation_data_structure_static.cpp
#include <CGAL/Triangulation_data_structure.h> #include <CGAL/assertions.h> #include <vector> int main() { typedef CGAL::Triangulation_data_structure<CGAL::Dimension_tag<7> > TDS; TDS S; CGAL_assertion( 7 == S.maximal_dimension() ); CGAL_assertion( -2 == S.current_dimension() ); CGAL_assertion( S.is_valid(...
ALGO
0.94952
6.793275
cea01267-af61-4782-b9d9-7d983bf02060
wol101/GaitSym5
MuJoCo/mujoco-3.3.0/dependencies/eigen3-src/bench/perf_monitoring/trmv_upt.cpp
#include "gemv_common.h" EIGEN_DONT_INLINE void trmv(const Mat &A, Vec &B, const Vec &C) { B.noalias() += A.transpose().triangularView<Upper>() * C; } int main(int argc, char **argv) { return main_gemv(argc, argv, trmv); }
ALGO
0.969083
4.916329
8ccf8ce9-0297-4b75-9dcb-5ef7fa66453c
a1774281/UndergraduateCode
Object Orientated Programming(c++)/practical-02/function-1-2.cpp
#include <iostream> //function to... int identity(int array[10][10]){ int total = 0; for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++){ if (array[i][j] == 0 && array[i][j] != array[i][i]){ total++; } else if (array[i][j] == 1 && array[i][j] == array[i][i]){ total...
ALGO
0.997927
3.078291
ae513b86-1f80-4b19-9c00-9a95efa356f7
minsik-choi126/ggml-hexagon
examples/speculative-simple/speculative-simple.cpp
#include "arg.h" #include "common.h" #include "sampling.h" #include "speculative.h" #include "log.h" #include "llama.h" #include <cstdio> #include <cstring> #include <string> #include <vector> int main(int argc, char ** argv) { common_params params; if (!common_params_parse(argc, argv, params, LLAMA_EXAMPLE_...
TOOL
0.940691
7.270119
761217b6-a2c2-44c9-a5b0-00a5ce326b2c
Leerw/ProgrammingPractice4ZJU
pat-a-practise/src/1021.cpp
#include <cstdio> #include <vector> #include <set> #include <algorithm> using namespace std; int n, u, v; bool visit[10010]; vector<vector<int> > G; int maxheight = 0; vector<int> temp; set<int> s; void dfs(int node, int height) { visit[node] = true; if (height > maxheight) { maxheight = height; ...
ALGO
0.999852
4.69325
bd1e410e-ce5f-4128-8fd3-92a5fa8f6874
mealsOrder/SW
baekJoon/01374_강의실.cpp
#include<iostream> #include<vector> #include<algorithm> #include<climits> #include<queue> using namespace std; const int MX = 100001; int N; vector<pair<int,int>> v; priority_queue<int,vector<int>,greater<int>>pq; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cin >> N; for(int i=0;i<N;i++){ ...
ALGO
0.999958
4.317364
b796d17d-7856-47e8-9e3c-6ca26a094da4
Aak172003/DSA_Prep
My-Prep-main/Level-UP/MyCode/11 - Char Array & String/Pending Revision ( Coding Assignments )/6 ( IMP ) - Reorganise String .cpp
/* LeetCode Link - https://leetcode.com/problems/reorganize-string/description/ ye Question me hum queue ke terms ke kaam krenge , means (FIFO -> First In First Out) a | b so for this top1 = a, top2 = b dono string me add hone ke bdd remove from queue , then elements hum phr se daalna start krenge ex = a | b | *...
ALGO
0.999991
6.329977
0472fa8d-7d99-4d84-93d9-d8400d5d4a37
mkltaneja/Leetcode
Weekly_Contest_#341/2646. Minimize the Total Price of the Trips.cpp
class Solution { public: vector<vector<int>> gp; vector<int> mp; vector<int> pr; int dfs(int p, int u, int dest) { if(u == dest) { mp[u]++; return 1; } for(int v : gp[u]) { if(v != p) { ...
ALGO
0.999646
5.289412
b26444bc-2767-4586-b1f7-2e64ff1ef619
ADITYA-0208/Leetcode-er
1942-the-number-of-the-smallest-unoccupied-chair/1942-the-number-of-the-smallest-unoccupied-chair.cpp
class Solution { public: int smallestChair(vector<vector<int>>& times, int targetFriend) { for(int i=0;i<times.size();i++){ times[i].push_back(i); } int targetArrival = times[targetFriend][0]; sort(times.begin(),times.end()); priority_queue<pair<int,int>, vector<p...
ALGO
0.999992
5.663064
5b65d005-a968-44c0-a531-32ddbaa90f5a
projeshroy/lammps_cpp_plugin
include/Eigen_3.3.1/doc/examples/tut_arithmetic_scalar_mul_div.cpp
#include <iostream> #include <Eigen/Dense> using namespace Eigen; int main() { Matrix2d a; a << 1, 2, 3, 4; Vector3d v(1,2,3); std::cout << "a * 2.5 =\n" << a * 2.5 << std::endl; std::cout << "0.1 * v =\n" << 0.1 * v << std::endl; std::cout << "Doing v *= 2;" << std::endl; v *= 2; std::cout << ...
ALGO
0.994537
3.669638
443b8992-28f7-41cb-bf02-5eec7fbe257f
theneuronarc/LeetCodeAlgorithms
src/reverse_k_nodes.cpp
/* https://leetcode.com/problems/reverse-nodes-in-k-group/ Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is. You may not alter the values in the nodes, only nodes itself ...
ALGO
0.999925
5.27959
01ded66a-f441-48c9-9d1a-217938ed6601
ddl1997/PTA-Test
PTA/PTA/A1025.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; const int N = 100, K = 300; struct Node { long long id; int score, localRank; Node(long long _id, int _score) { id = _id; score = _score; } }; vector<Node> locations[N]; int pos[N]; bool cmp(Node a, Node b) { return (a.score > b....
ALGO
0.999772
3.660172
abca791a-8865-47eb-923f-9b53bcc3b7e2
thevikramseervi/cpp
sparseMatrix.cpp
#include <iostream> using namespace std; struct sparse { int row; int col; int val; } s[10]; void readSparseMatrix() { int r, c, ele, pos = 0; cout << "Enter r & c: "; cin >> r >> c; cout << "Enter ele: " << endl; for (int i = 0; i < r; i++) { for (int j = 0; j < c; j++) { cin >> ele; ...
ALGO
0.993693
3.459471
936f8f64-38b4-4045-9d2d-9284f7cf41b4
JingyuanZhou/Issac_Quadruped_Simulation
extern/eigen3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Eigen::MatrixXf m(2,4); Eigen::VectorXf v(2); m << 1, 23, 6, 9, 3, 11, 7, 2; v << 2, 3; MatrixXf::Index index; // find nearest neighbour (m.colwise() - v).colwise().squaredNorm()...
ALGO
0.999956
4.138078
a06d4d45-73ef-49ed-aa67-4faa4b9dc36e
mikaelsouza/Trabalhos-Disciplinas
BTree/btree2.cpp
#include <fstream> #include "btree2.hpp" Btree2::Btree2() { root_pointer = -1; int i; num_nodes = 0; index_file = fopen("index_file2", "wb+"); for (i = 0; i < MAX_KEYS_2; i++) { this->current_node.node_pointers[i] = -1; strcpy(this->current_node.keys[i].key, "-1"); } this->c...
ALGO
0.996543
3.765242
3ba2543f-4bee-41ce-b7b3-becf15a63356
pamellaccar/gromacs_with_packmol
install/gromacs-2022.1/src/gromacs/linearalgebra/gmx_lapack/sormqr.cpp
#include "../gmx_lapack.h" #include "lapack_limits.h" void F77_FUNC(sormqr,SORMQR)(const char *side, const char *trans, int *m, int *n, int *k, float *a, int *lda, float *tau, float *c__, int *ldc, float *work, int *lwork, int *info) { int a_dim1, a_offset, c_dim1, c_offset, i__1, i__2, i__...
ALGO
0.996858
5.972853
72779f67-b02c-4109-95f3-ff16d928777f
Tiphereth-A/CP-lib
test/aizu-dsl/dsl_4_a.test.cpp
#define PROBLEM "https://onlinejudge.u-aizu.ac.jp/courses/library/3/DSL/all/DSL_4_A" #include "../../include/geo2d/aunion_pos.hpp" using namespace tifa_libs; using point = geo::point<f128>; using polygon = geo::polygon<f128>; int main() { std::cin.tie(nullptr)->std::ios::sync_with_stdio(false); std::cout << std:...
ALGO
0.998558
4.388709
86920bfe-f847-4aa9-a83f-958104ceacdf
MukeshKumarS/Swift
lib/AST/NameLookup.cpp
#include "NameLookupImpl.h" #include "swift/AST/NameLookup.h" #include "swift/AST/AST.h" #include "swift/AST/ASTVisitor.h" #include "swift/AST/DebuggerClient.h" #include "swift/AST/LazyResolver.h" #include "swift/AST/ReferencedNameTracker.h" #include "swift/Basic/Fallthrough.h" #include "swift/Basic/SourceManager.h" #i...
TOOL
0.936395
3.902629
899e6cc0-24d4-4380-9518-cc895e04562d
ishandutta2007/codeforces
icecuber/normal/1328/A.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while (t--) { int a, b; cin >> a >> b; cout << (b-a%b)%b << endl; } }
ALGO
0.999665
4.25141
04fdedd9-30fd-4f4f-8b4d-f80d7dc30b01
MrYanMYN/ArtsionicFront
dev/integration_tests/windows_startup_test/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.998806
6.76073
81c707c9-1491-4a50-8f73-2c5cc51a6406
TiagoMLucio/Competitive-Programming
codeforces/Problems/B_Chess_Tournament.cpp
#include "bits/stdc++.h" #include <chrono> using namespace std; using ll = long long; using ld = long double; using str = string; #define sz(x) static_cast<int>((x).size()) #define endl '\n' #define int ll using ii = pair<int, int>; #define mp make_pair #define f first #define s second using iii = tuple<int, int, i...
ALGO
0.999511
4.299356
97832e67-4957-4da8-9615-7bb39f5c5ff1
DhruvinXDev/CPP_Language
Recursion/recursion_with_chrono.cpp
#include <iostream> #include <vector> #include<chrono> using namespace std; using namespace chrono; int addition(vector<int>& number) { int total=0; for(int num : number) { total+=num; } return total; } int recusion_total =0; int recursion(int length,vector<int>& r_number) { if(length==0...
ALGO
0.999477
4.891755
ed5cf421-f6a4-4c43-975e-9e327e5675f1
dustingarner/LeetcodeProblems
Leetcode112.cpp
class Solution { public: bool hasPathSum(TreeNode* root, int targetSum, int currentSum=0) { if(root == nullptr){ return false; } currentSum += root->val; if(root->left == nullptr && root->right == nullptr){ return targetSum == currentSum; } boo...
ALGO
0.999924
6.527253
5d113e58-a4e9-4840-a754-26f1f00f9820
aanu2021/Leetcode-Solutions
0115-distinct-subsequences/0115-distinct-subsequences.cpp
class Solution { public: int numDistinct(string s, string t) { int m = s.length(); int n = t.length(); vector<vector<unsigned int>>dp(m+1, vector<unsigned int>(n+1, 0)); for(int i=0;i<=m;i++){ dp[i][0] = 1; } for(int i=1;i<=m;i++){ for(int j=1;...
ALGO
0.999992
6.51692
b0b6ee55-fd70-435e-8ca7-e46530491c4c
Datguyprasham/CompetitiveProgramming
Codeforces sol/107/A.cpp
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long int lli; typedef vector<int> vi; typedef vector<long long int> vlli; #define pb push_back #define pi 3.1415 const lli MOD= 1e9+7; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); ll...
ALGO
0.999805
4.784256
329524dc-7df1-4bb6-913f-b75e26d253d9
fractal-bitcoin/fractal
src/test/util/mining.cpp
#include <test/util/mining.h> #include <chainparams.h> #include <consensus/merkle.h> #include <key_io.h> #include <node/context.h> #include <node/miner.h> #include <pow.h> #include <script/standard.h> #include <test/util/script.h> #include <util/check.h> #include <validation.h> #include <versionbits.h> using node::Bl...
ALGO
0.984369
7.260663
d8546d0f-ba94-435e-a9c9-982b932bbf6e
danila77member/ncnn
src/layer/convolutiondepthwise.cpp
#include "convolutiondepthwise.h" #include "layer_type.h" #include "fused_activation.h" namespace ncnn { ConvolutionDepthWise::ConvolutionDepthWise() { one_blob_only = true; support_inplace = false; } int ConvolutionDepthWise::load_param(const ParamDict& pd) { num_output = pd.get(0, 0); kernel_w = ...
ALGO
0.967737
6.050324
c45ab6b2-9c76-464e-bfb7-762f8faaec69
xiecookie/vulkan-toy
nvpro_core/third_party/tinygltf/examples/common/glm/test/core/core_func_integer_find_lsb.cpp
// This has the programs for computing the number of trailing zeros // in a word. // Max line length is 57, to fit in hacker.book. #include <cstdio> #include <cstdlib> //To define "exit", req'd by XLC. #include <ctime> int nlz(unsigned x) { int pop(unsigned x); x = x | (x >> 1); x = x | (x >> 2); x = ...
ALGO
0.999184
5.25303
d60a13c6-8b89-4587-9d16-2119759da2d1
clarac/tti
test/SimpleDriver.cpp
#include "SimpleDriver.h" /* Gear Changing Constants*/ const int SimpleDriver::gearUp[6]= { 5000,6000,6000,6500,7000,0 }; const int SimpleDriver::gearDown[6]= { 0,2500,3000,3000,3500,3500 }; /* Stuck constants*/ const int SimpleDriver::stuckTime = 25; const float SimpleDriver::stuckAng...
TOOL
0.89014
4.829602
26a29273-91ae-4f38-8a5c-bd9efce74651
Zhenghao-Liu/LeetCode_problem-and-solution
0017.电话号码的字母组合/solution.cpp
static const auto SpeedUp = []{ ios::sync_with_stdio(false); cin.tie(NULL); return 0; }(); class Solution { public: vector<string> letterCombinations(string digits) { vector<string> map={"abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"}; vector<string> answer; int digits_size=di...
ALGO
0.999988
6.360933
3689ae41-9849-496d-894c-0c1815a59f6a
kirant1008/EECE7205_Assignments
Assignment2/assignment2_mergesort_alternate.cpp
#include <iostream> #include <random> using namespace std; void Merge(int A[], int min1, int mid1, int max1) { int nL = mid1 - min1+1; int nR = max1 - mid1; int L[nL]; int R[nR]; for (int i=1 ;i<=nL ;i++) { L[i] = A[min1+i-1]; } for (int j=1;j<=nR ;j++){ R[j] = A[m...
ALGO
0.999793
4.473184
6f23247b-a059-42e8-9527-b7c96dca1a27
SuperCl4sh/Competitive-Programming
DMOJ/Mock CCC/nccc5j1.cpp
//https://dmoj.ca/problem/nccc5j1 #include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); string s; cin >> s; for (int i=0;i<s.length();i++) { if (s[i]=='C' && s[i+1]=='C' && s[i+2]=='C') { cout <<"NO" << e...
ALGO
0.999964
3.541862
7ee5e8f0-3ac6-4fe5-b7c8-b076d7d2d0bc
namduong93/Code
codeforces/normal/1691/C.cpp
/** * author: namduong93 * created: unknown * complexity: unknown **/ #include<bits/stdc++.h> using namespace std; //#define int long long #define fto(i,a,b) for(int i=a;i<=b;++i) #define fdo(i,a,b) for(int i=a;i>=b;--i) #define mp make_pair #define fi first #define se second #define pb push_back #define ...
ALGO
0.999966
4.298119
a209f1d3-699e-4354-80e9-5e6c1dc87525
sofikulsk02/DSA_in_c-
Array1/minArrrayElemnet.cpp
#include<iostream> using namespace std; int main(){ int n; cout<<"Enter size of array: "; cin>>n; int arr[n]; for(int i=0; i<n; i++){ cin>>arr[i]; } int min=INT16_MAX; for(int i=1; i<n; i++){ if(min>arr[i]){ min=arr[i]; } } cout<<min; }
ALGO
0.998229
3.276911
098d9cbb-925e-4795-bf57-a39606d62b0a
maxrobic/SFERA
Calibration/src/step_three_omnicalibration.cpp
#include <opencv2/ccalib/omnidir.hpp> #include <opencv2/core.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/calib3d.hpp> #include <opencv2/highgui.hpp> #include <vector> #include <iostream> #include <string> #include <time.h> using namespace cv; using namespace std; static void calcChessboardCorners(const Size...
TOOL
0.973042
5.692322
73eabc9d-08ee-40a2-9c78-a6fa12f9ffd4
Arush0104/C-Assignments-Binary-search-2-Week-10
C++ Assignments Binary search - 2 Week 10/Q1.cpp
#include <iostream> #include <vector> using namespace std; int binarySearch(vector<int> &v, int n) { int lo =0, hi = v.size()-1,mid=0; while (lo <= hi) { mid = (lo + hi) / 2; if (mid == n) return mid; else if (mid < n) hi = mid - 1; else if(mid > n) lo = mid + 1; else...
ALGO
0.999683
5.164656
6fe09802-1a54-460b-9d5e-d25c95060136
kmjp/procon
leetcode/biweekly/121-160/129/3130.cpp
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define FORR2(x,y,arr) for(auto& [x,y]:arr) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)...
ALGO
0.99995
4.377276
d42196a9-10c6-4df1-b42b-0878caa5ba10
jackeylovely-hub/2021_algorithm_camp
week1/class01/数组/Leetcode_26_删除有序数组中的重复项.cpp
class Solution { public: int removeDuplicates(vector<int>& nums) { int n = 0; for (int i = 0; i < nums.size(); i++) { if (i == 0 || nums[i - 1] != nums[i]) { nums[n] = nums[i]; n++; } } return n; } };
ALGO
0.999961
6.583453
5cf741cb-0c41-43f3-9637-14d04232fcef
Jarlene/eigen
bench/bench_norm.cpp
#include <typeinfo> #include <iostream> #include <Eigen/Core> #include "BenchTimer.h" using namespace Eigen; using namespace std; template<typename T> EIGEN_DONT_INLINE typename T::Scalar sqsumNorm(T& v) { return v.norm(); } template<typename T> EIGEN_DONT_INLINE typename T::Scalar stableNorm(T& v) { return v.sta...
TEST
0.987487
6.681669
8cedf6e1-75dd-432e-9484-5c1ac8b0e6f4
AAKASH-YADAV-CODER/gfg-DSA
1Mathematics/10sieveEratosthenes.cpp
#include<bits/stdc++.h> #include<iostream> using namespace std; //In this we are printing all prime number which are comes to 1 to n-the given num bool prime(int n){ if(n==1){ return false; } if(n==2 || n==3){ return true; } if(n%2==0 || n%3==0){ return false; } for(i...
ALGO
0.99984
4.924144
80816193-1df2-405b-8880-0446aff316a2
Yuvraj02/Competetive_Programs
q6.cpp
#include <iostream> using namespace std; int main(){ int n; cin>>n; int arr[n]; for (size_t i = 0; i < n; i++) { cin>>arr[i]; } // for (auto i : arr) // { // cout<<i; // } return 0; } void linearSort(int arr[], int n){ int temp; for (size_t i = 0; i <...
ALGO
0.999685
4.437801
884f0ffa-b92a-4fb3-8f02-e4a6d0da1e19
sourabh59-coder/StriverA-Z_Sheet
Step 16: Dynamic Programming/Lec 05: DP on substring/07. Shortest Common Superstring/Approach1.cpp
class Solution { public: vector<vector<int>> LongestCommon(string s1,string s2) { int n = s1.size(); int m = s2.size(); vector<vector<int>> dp(n+1, vector<int> (m+1,0)); for(int i=1;i<=n;i++) { for(int j=1;j<=m;j++) { if(s1[i-1]==...
ALGO
0.999976
5.49144
2e11008d-cafb-4ef7-9632-c46fa9ab87a3
TurboMiki/ecg_app
src/Model/Baseline/libbutterworth/biquad.cpp
#include <libbutterworth/biquad.h> biquad::biquad(double b0, double b1, double b2, double a1, double a2) : m_b0(b0), m_b1(b1), m_b2(b2), m_a1(a1), m_a2(a2), m_xn1(0), m_xn2(0), m_yn1(0), m_yn2(0) { } biquad::biquad() : m_b0(0), m_b1(0), m_b2(0), m_a1(0), m_a2(0), m_xn1(0), m_xn2(0), m_yn1(0), m_yn2(0) { } bi...
ALGO
0.956522
5.679027
4ff11bfc-fbf4-4f22-9361-6ba0e5ffa0dc
Keshav1707/Submissions
Collecting_Numbers.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define di(x) \ ll x; \ cin >> x #define vecll vector<ll> #define pb push_back #define po pop_back #define all(x) x.begin(), x.end() #define el << endl; #define PI 3.14159265359 #define MOD int(1e9 + 7) typedef pair<ll,...
ALGO
0.999948
3.575757
8879d0c2-2c17-4bc5-b76a-c451cba43aa9
Samya-S/Design-and-Analysis-of-Algorithms-Lab
DAA Lab Test 1 (11-09-24)/q2-find-single-element.cpp
#include <bits/stdc++.h> using namespace std; int singleElement(vector<int> &a) { int n = a.size(); int low = 0, high = n - 1; while (low <= high) { int mid = (low + high) / 2; if (mid & 1) { if (mid + 1 < n && a[mid] == a[mid + 1]) { high = mid - 1; ...
ALGO
0.999918
4.08838
dc7b222c-4f7f-4f64-af72-d826bdac9d6d
ishandutta2007/codeforces
mohamedabookail/normal/1186/A.cpp
/** * author: Mohamed.Abo_Okail * created: 30/10/2019 **/ #include <bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" int main() { std::ios_base::sync_with_stdio(0); //freopen("distinct.in", "r", stdin); //freopen("out.out", "w", stdout); int a, b, c; cin >> a >> b >> c; if(...
ALGO
0.999937
3.628712
b8c49ac5-a9af-4b14-bd9e-bab1c1cf9382
AdrianGCS/c-programs
Proyectos/Tres.E1/TER.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #define Num 4 #define total 3 #define Num2 2 int main(){ int lugar[total][total]= { {0,0,0}, {0,0,0}, {0,0,0} }; int jugador = 0; int temporal = 0;//temporal guarda la posicion donde va a jugar int contador=0; ...
ALGO
0.995661
3.230651
c126c4d9-c626-4eed-aa4e-4e6ca96a1c3d
Yangchengshuai/Map2DFusion
PIL/Thirdparty/eigen3/doc/examples/QuickStart_example.cpp
#include <iostream> #include <Eigen/Dense> using Eigen::MatrixXd; int main() { MatrixXd m(2,2); m(0,0) = 3; m(1,0) = 2.5; m(0,1) = -1; m(1,1) = m(1,0) + m(0,1); std::cout << m << std::endl; }
ALGO
0.997031
3.474624
61803131-b7a3-4abb-98cb-39c77e428dbb
abdelrehman99/codeforces-solutions
Given Length and Sum of Digits....cpp
#include <bits/stdc++.h> using namespace std; #define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define F first #define FOR(i, n) for(int i = 0; i < (int) n; i++) #define cin(v) for (auto &i : v) cin >> i; #define cout(v) for (auto &i : v) cout >> i; #define WL(t) while(t --) #define S second #define PB push...
ALGO
0.99989
3.408218
a5257175-a997-406b-a982-87011f569657
gouarin/hpx_test
2d_stencil/2d_stencil_3.cpp
#include <vector> #include <hpx/hpx_init.hpp> #include <hpx/hpx.hpp> #include <hpx/include/compute.hpp> #include <hpx/include/util.hpp> #include "iterator.hpp" #include "update.hpp" /////////////////////////////////////////////////////////////////////////////// // Command-line variables bool header = true; // print ...
ALGO
0.950729
5.118123
c0f5b5f9-620e-49c4-890a-0eb6c298b9a4
ishandutta2007/codeforces
cchao/normal/610/A.cpp
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < int(n); ++i) #define REPE(i, a, b) for (int i = (a); i <= int(b); ++i) #define SZ(x) ((int)(x).size()) #define ALL(x) x.begin(), x.end() #define PB push_back #define EB emplace_back using LL = long long; using PII = pair<int, int>; #def...
ALGO
0.999929
3.948424
5caeb36d-798f-4e0d-a088-bca1e35a600e
15anil/c-files
StringDuplicates.cpp
#include <iostream> std::string removeDuplicates(const std::string& input) { std::string result; for (size_t i = 0; i < input.size(); ++i) { // Check if the current character is already in the result string bool duplicate = false; for (size_t j = 0; j < result.size(); ++j) { ...
ALGO
0.98195
6.851631
257a81c1-714f-4c77-a472-02e9126fa003
raincross7/code-similarity
codes/train_code/problem019/problem019_440.cpp
#include <iostream> #include <queue> #include <stdio.h> using namespace std; void shuffle(char* array){ std::queue<char> card; for(int i=0; array[i]!='\0'; i++) card.push(array[i]); int m,n; cin >> m; while(m--){ cin >> n; for(int i=0;i<n;i++){ int a=ca...
ALGO
0.998777
3.809641
c112c3b5-d123-4fff-83e3-9a73404a91bf
delverdl/dscomps
qwt/src/qwt_spline_local.cpp
#include "qwt_spline_local.h" #include "qwt_spline_parametrization.h" #include "qwt_spline_polynomial.h" #include <qpainterpath.h> static inline bool qwtIsStrictlyMonotonic( double dy1, double dy2 ) { if ( dy1 == 0.0 || dy2 == 0.0 ) return false; return ( dy1 > 0.0 ) == ( dy2 > 0.0 ); } static inlin...
ALGO
0.999167
7.653553
65334567-a069-470d-a390-05b3a7f9ee10
sagpant/swiftshader
third_party/llvm-10.0/llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
#define DEBUG_TYPE "gisel-known-bits" using namespace llvm; char llvm::GISelKnownBitsAnalysis::ID = 0; INITIALIZE_PASS_BEGIN(GISelKnownBitsAnalysis, DEBUG_TYPE, "Analysis for ComputingKnownBits", false, true) INITIALIZE_PASS_END(GISelKnownBitsAnalysis, DEBUG_TYPE, "Analysis ...
ALGO
0.94666
7.860216
525e531d-eb4e-4145-9563-5cc1348f0b6d
muskan300600/DSA
Array/38.total_count.cpp
#include <iostream> #include <vector> using namespace std; int main(){ int arr[] = {10, 2, 3, 4, 7}; int n = sizeof(arr)/sizeof(arr[0]); int k; cout<<"Enter threshold: "<<endl; cin>>k; int x; int count = 1; vector<int> v; for(int i=0;i<n;i++){ while(arr[i]>k){ ar...
ALGO
0.999753
3.555764
c9f542ed-46f5-4436-b8d1-0770ee77cf21
m3tac1ph4r/striver_sde_sheet
DAY_24(Graph-II)/Shortest Path in Graph/Count_number_of_shortest_path_from_src.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long const int M = 1e9 + 7; vector<int> countShortestDistance(vector<vector<int>> edges, int n, int m, int src) { unordered_map<int, list<pair<int, int>>> adj; for (int i = 0; i < m; i++) { int u = edges[i][0]; int v = edges[i][1...
ALGO
0.999984
4.587781
dec8e356-6a28-4d0e-ac12-897316bb10e5
ria-garg17/Leetcode_Solutions
0530-minimum-absolute-difference-in-bst/0530-minimum-absolute-difference-in-bst.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.999967
6.564352
2048662e-7819-4a63-9e6b-79dcb27829b0
eshohag/leetcode
solution/2500-2599/2574.Left and Right Sum Differences/Solution.cpp
class Solution { public: vector<int> leftRigthDifference(vector<int>& nums) { int left = 0, right = accumulate(nums.begin(), nums.end(), 0); vector<int> ans; for (int& x : nums) { right -= x; ans.push_back(abs(left - right)); left += x; } r...
ALGO
0.999954
5.980414
227c4dcc-3e9a-4df9-9550-4d31e763a784
XinShuo-ph/KAdath_Frontera
src/Domain/Oned/domain_oned_inf_systems.cpp
#include "headcpp.hpp" #include "oned.hpp" #include "array.hpp" #include "val_domain.hpp" namespace Kadath { void Domain_oned_inf::find_other_dom (int dom, int bound, int& other_dom, int& other_bound) const { switch (bound) { case INNER_BC: other_dom = dom -1 ; other_bound = OUTER_BC ; break ; default: ...
ALGO
0.998153
3.846723
a5d939c3-2296-4a8a-bcaf-3a7d3822c8a1
chengguixing/iArt
ISTL/STLDequeOne/main.cpp
#include <deque> #include <iostream> #include <algorithm> using namespace std; int main(void) { /* deque<int, alloc, 8> ideq(20, 9); cout << "size = " << ideq.size() << endl; for (int i = 0; i < ideq.size(); ++i) { ideq[i] = i; } for (int i = 0; i < ideq.size(); ++i) { cout << ideq[i] << ' '; } cout <<...
TOOL
0.892295
3.569683