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
db19d02f-4a23-453e-bf9d-cccc1497487f
sheenaou/ENGI4892
assignment_3/BSTMap.h
#include <iostream> #include <string> using namespace std; /******************************************* Declaration of Node class *******************************************/ template<class K, class V> class Node{ public: // pre-condition: A valid key and/or value will be passed // post-condition: A node with th...
ALGO
0.996307
3.217297
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-05-16T12:00: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": "f56917206c...
1aaf16d6-6006-451b-bcc1-bafa99a349d5
ohtuna/Algorithm
Algospot/FENCE.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; vector<int>h; int solve(int left, int right) { //base case if(left == right) return h[left]; int mid = (left+right)/2; int ret = max(solve(left, mid), solve(mid+1, right)); int lo = mid, hi = mid+1; int height = min...
ALGO
0.999937
4.37943
{ "github_metadata": { "branch": "master", "commit_count": 342, "repo_created_at": "2019-10-23T07:39: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": "2b2f7e6b...
59175139-73fc-4e35-b83b-4a5d8f839a72
Pierre-Terdiman/BoxPruning
BoxPruning2/IceBoxPruning.cpp
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Contains code for box pruning. * \file IceBoxPruning.cpp * \author <NAME> * \date January, 29, 2000 */ ///...
ALGO
0.999866
5.010451
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2017-02-14T15:57:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 49, "forks": 8, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7cd80769...
1984892d-eb0d-4e61-bea8-019abb3c4efe
jianglab/motioncorr
src/SP++3/include/nleroot.h
/* * Copyright (c) 2008-2011 <NAME> (<NAME>), <EMAIL> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 2 or any later version. * * Redistribution and use in source and bin...
ALGO
0.999966
5.265255
{ "github_metadata": { "branch": "master", "commit_count": 40, "repo_created_at": "2015-07-24T20:50:00.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 14, "forks": 8, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "d32c6d3f7...
00d52094-2d8e-4138-b8e4-2114ab08202c
burns801/Notes
AOAPC-I/Volume 2. Data Structures/Lists/uva_540.cpp
#include<iostream> #include<string> #include<list> #include<vector> #include<deque> #include<queue> #include<cstdio> #include<map> #include<cstdlib> using namespace std; int t; map<int, int> teamId; void solve(){ teamId.clear(); for (int ti = 1; ti <= t; ti++){ int n; cin >> n; while (n--){ int a...
ALGO
0.999483
3.415085
{ "github_metadata": { "branch": "master", "commit_count": 180, "repo_created_at": "2013-09-16T21:50:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3360c63a...
c6d972d5-25ba-4e6f-bef3-6db9859dcf68
MuhammadHasan-04/GIT_LITE
MerkleTree.h
#include <iostream> #include "String.h" #include "Utility_functions.h" #include "queue.h" // #include "Btree.h" #include "Avl.h" #include "RedBlack.h" #include <fstream> #include <openssl/sha.h> #include <iomanip> using namespace std; int curr_hash = 0; String AVL_traverse(String &r) { if (r == "nullptr") { ...
ALGO
0.995228
4.129416
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2025-03-25T19:55: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": "1bc4d3d03990...
283fae1b-55ea-424a-85cd-387dc3d5c24b
j-moralejo-pinas/LeetCode
Easy/1534. Count Good Triplets/countGoodTriplets.cpp
class Solution { public: int countGoodTriplets(vector<int>& arr, int a, int b, int c) { vector<vector<short>> dist(arr.size(), vector<short>(arr.size(),-1)); for (int i = 0; i < arr.size() - 1; ++i) { for (int j = i + 1; j < arr.size(); j++) { if (...
ALGO
0.999852
6.078543
{ "github_metadata": { "branch": "main", "commit_count": 64, "repo_created_at": "2025-02-16T21:09: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": "eaffb8ca818...
8e99d6ce-81c1-4b2c-b986-ecf1f5c172d4
adhiti1/C_repo
EECE2160_AppProgramming/Projects/Program_3_4_11.cpp
// Program3_4_11.cpp // <NAME> // This program was created and debugged in visual studio 2022 and copied to zybooks // This program implements guessing game. #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> int main() { //initial input variables int inpSeed; int inpMinRange, inpMaxRange; ...
ALGO
0.949017
3.967609
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2025-05-26T09:52:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "62da4b82e72...
957b0ad7-ca70-499c-99de-f6888374f729
SovietPower/My-OI-ACM
高级数据结构/线段树/BZOJ.5461.[PKUWC2018]Minimax(DP 线段树合并)2.cpp
//105344kb 4528ms #include <cstdio> #include <cctype> #include <algorithm> //#define gc() getchar() #define MAXIN 300000 #define gc() (SS==TT&&(TT=(SS=IN)+fread(IN,1,MAXIN,stdin),SS==TT)?EOF:*SS++) #define mod 998244353 #define inv 796898467ll//inv(10000) #define Mod(x) x>=mod&&(x-=mod) #define Add(x,v) (x+=v)>=mod&&(x...
ALGO
0.999909
4.164975
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2022-01-03T14:20:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b0887f9963e5...
fbaba4ca-8ae3-4879-b2f1-b6fb36c45dff
taitruong256/Competitive-programming
Tags/bs/bs_Benches1042A.cpp
/*===================================================================================== Nothing is impossible, only you think it is impossible Try, try, try again until you succeed Where is the bug, delete it there ...
ALGO
0.999993
3.326638
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2025-04-14T06:59: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": "63be8a3d90af...
293de328-05d6-4331-a30a-9dbfe5ed77a6
Stuthedian/Univer
C++/C++ CLI/Lab1.2/Main.h
#pragma once namespace Lab11 { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; /// <summary> /// Сводка для Main /// </summary> public ref class Main :...
TOOL
0.977326
4.159076
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2019-10-14T14:02:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "387724dec...
89bccf2f-78b0-463e-bab6-ac2b105770ad
SaqlainAveiro/Competitive-Programming-Solves
CodeForces/Team Olympiad.cpp
#include<bits/stdc++.h> using namespace std; #define FastIO ios_base :: sync_with_stdio(false), cin.tie(0), cout.tie(0) #define read(in) freopen("Input.txt","r",stdin) #define write(out) freopen("Ouput.txt","w",stdout) #define pf printf #define sf scanf #define fr(i,n) for(i=1 ; i<=n ; i++) #define fr1(i,x,n) for(i=x...
ALGO
0.999984
3.212798
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2021-06-04T22:13:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0df99084e4e...
45262dd8-fac7-4480-8a78-d992befb2828
Zhanserkenov/ADS_22B031492
lab_10/d.cpp
//2115 #include <bits/stdc++.h> #define ll long long #define ld long double #define ull unsigned ll #define ioi exit(0); #define inf (int)1e9+7 #define F first #define S second #define pb push_back #define ppb pop_back #define lb(x) lower_bound(x) #define ub(x) upper_bound(x) #define sz(x) x.size() #defin...
ALGO
0.99985
4.203763
{ "github_metadata": { "branch": "main", "commit_count": 142, "repo_created_at": "2023-10-05T08:28: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": "d09de91b29...
d224bb5a-46a4-4874-904e-2a583f87c42a
oriolvelasco/Algorismia
Exàmens/Exàmens 2016-17/Xarxa de carreteres.cc
#include <iostream> #include <vector> #include <algorithm> using namespace std; typedef vector<int> VI; typedef vector<pair<int, pair<int, int> > > VP; int n, m; VI pare; int busca(int i) { if(pare[i] == i) return i; pare[i] = busca(pare[i]); return pare[i]; } int uneix(int i, int j) { pare[busca(i)...
ALGO
0.998623
3.430212
{ "github_metadata": { "branch": "master", "commit_count": 357, "repo_created_at": "2015-09-23T23:27:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4996f42a...
7b7cd60c-1e38-40c8-b84f-885e4cb09707
luqmanarifin/cp
0-unclassified/yachtzee.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; long long a[N]; long long find(long long v) { return 1LL * v * (v + 1) / 2; } long long find(long long l, long long r) { return find(r) - (l? find(l - 1) : 0); } int main() { int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++) { ...
ALGO
0.999655
3.743721
{ "github_metadata": { "branch": "master", "commit_count": 772, "repo_created_at": "2016-02-09T04:26:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "693a41f9...
b2ae46ae-4dd3-4a91-a494-24c66ab4e051
qwaker00/Olymp
RussianCodeCup/2012/Elemenation/B/hax.cpp
#include <iostream> #include <algorithm> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <memory.h> #include <math.h> #include <string> #include <sstream> #include <string.h> #include <queue> #include <vector> #include <set> #include <map> typedef long long LL; typedef unsigned long long ULL; #defin...
ALGO
0.999935
3.524423
{ "github_metadata": { "branch": "master", "commit_count": 53, "repo_created_at": "2012-09-04T15:56:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "a8ba7affb...
c2cd8d61-11b1-41de-a113-94f76617a67e
skylord18/lc-sols
Rod Cutting - Space Optimization - 1D Array.cpp
#include <bits/stdc++.h> using namespace std; int f(int idx, int N, vector<int>&price, vector<vector<int>>&dp) { if (idx == 0)return N * price[0]; if (dp[idx][N] != -1)return dp[idx][N]; int notTake = f(idx - 1, N, price, dp); int take = INT_MIN; int rodLength = idx + 1; if (rodLength <= N)take = price[idx] + f(i...
ALGO
0.999762
4.651353
{ "github_metadata": { "branch": "main", "commit_count": 32, "repo_created_at": "2022-04-18T05:28:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2afb4587296...
e014ef7c-7a29-4834-a1e4-4c78261df439
psyny/ILS_RVND_SP_TEST
Initial-Code-Base/LocalSearch.h
#ifndef LOCALSEARCH_H #define LOCALSEARCH_H #include "Solution.h" struct Node; struct Route { int cour; // Route index int nbNodes; // Number of nodes in the route Node * depot; // Pointer to the depot node double load; // Total load on the route double loadPenalty; // Total load penalty on the r...
ALGO
0.999979
4.757704
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2020-07-02T22:12: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": "15cb26591...
c0705b63-41a7-4803-9e2d-f78cb5cbacdc
jpryan1/kern-interp-dev
kern_interp/boundaries/cubic_spline.cpp
// Copyright 2019 <NAME> #include <cmath> #include <iostream> #include <cassert> #include <vector> #include "kern_interp/boundaries/cubic_spline.h" #define NUM_SPLINE_POINTS 20 namespace kern_interp { void CubicSpline::get_spline_points(std::vector<double>* x0_spline_points, std:...
ALGO
0.997996
5.724661
{ "github_metadata": { "branch": "master", "commit_count": 101, "repo_created_at": "2020-02-06T17:47:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "e635e0e6...
26f97e2b-0ad2-4dec-8a88-87d6f0c9fed5
o-reach/O-Reach
app/query_generator.h
/****************************************************************************** * This file is part of O'Reach and released under MIT License * Authors: * <NAME> *****************************************************************************/ #pragma once #include "lib/reachability/Query.h" #include <vector> ...
TOOL
0.905839
5.284699
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2021-05-12T17:37:42.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5, "forks": 1, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "e9144190387...
e4f4717f-394c-41ef-b944-67bc673d2c8c
Mzhangry/code_MzhangRy
比赛/CF/BR16/E.cpp
// MzhangRy - 张容钰 #include<iostream> #include<iomanip> #include<cmath> #include<string> #include<cstring> #include<algorithm> #include<vector> #include<map> #include<queue> using namespace std; typedef long long ll; const int inf = 1e9; int n; double a[20][20]; double f[1<<20]; int main() { cin >> n; for (int ...
ALGO
0.999873
3.937914
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2022-07-20T00:59: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": "1eadc0887...
eff8a1fa-0420-4d1a-a289-0d61558356a7
jordanolahm/min_max_cpp
main.cpp
#include "MinMax.hpp" #include <iostream> void imprimirTabuleiro(const std::vector<int>& tabuleiro) { for (int i = 0; i < tabuleiro.size(); ++i) { if (i % 3 == 0 && i != 0) { std::cout << std::endl; } if (tabuleiro[i] == 0) { std::cout << " - "; } else if (ta...
ALGO
0.999965
6.308508
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-11-21T01:14: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": "dc83c8cc4352...
cb4b7c72-1ddd-4e71-b1df-6d59051747bc
code-Harsh247/CSES_Solutions
Graph Problems/CourseSchedule.cpp
#include <bits/stdc++.h> using namespace std; #define INF 1000000000 #define MOD 1000000007 typedef long long ll; typedef vector<ll> vll; int main(){ int n, m; cin >> n >> m; vector<vector<int>> adj(n+1); for (int i = 0; i < m; i++) { int u, v; cin >> u >> v; adj[u].push_back...
ALGO
0.999994
4.250636
{ "github_metadata": { "branch": "main", "commit_count": 87, "repo_created_at": "2024-12-01T15:08: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": "3117c8eb749...
f98326e0-7efe-45f0-85aa-e686bb6029e9
shivariyer/traffic-signaling-networks
traffic_sim.hh
#ifndef _TRAFFIC_SIM_HH #define _TRAFFIC_SIM_HH // This is the simulator for Traffic Signaling Networks #include <set> #include <deque> #include <string> #include <vector> #include <utility> #include <ctime> #include <cstdio> #include <cassert> #include <cstdlib> #define MAX_EPOCH 1 #define MAX_LINKS 200 #define MAX...
ALGO
0.998468
4.291982
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2021-07-18T20:56:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "58282e7d32d...
6ff50046-2b39-412d-be12-d68dbb747e7a
Valentin-Guillet/AdventOfCode
2019/Day22/Day22.cpp
#include <iostream> #include <fstream> #include <string> #include <vector> #include <algorithm> #include <unordered_map> const int M = 100007; const __int128 N = 119315717514047; const __int128 N_shuffle = 101741582076661; std::vector<int> increment(std::vector<int> cards, int value) { std::vector<int> new_card...
ALGO
0.99985
4.237295
{ "github_metadata": { "branch": "main", "commit_count": 99, "repo_created_at": "2022-05-23T16:16: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": "7a01567a327...
cddca7ab-77ce-486c-a14f-0070ea3821e3
ShawnZhuang/cpp_utils
combine/dp.cc
#include <iostream> #include <vector> #include <algorithm> #include <functional> #include <set> #include <map> template <typename Tensor, typename TSpec, typename TensorLess, typename TSpecLess> class DpState { private: using VSet = std::set<TSpec, TensorLess>; std::map<Tensor, VSet, TensorLess> state; usin...
ALGO
0.977285
5.060346
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2025-02-17T02:14: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": "45f76087025...
382cf49f-a90c-467e-b539-a477698c464b
chasingegg/Online_Judge
leetcode/079_Word-Search/WordSearch.cpp
#include <iostream> #include <cstdio> #include <vector> #include <string> #include <cstring> #include <algorithm> using namespace std; class Solution { private: int ROW; int COL; vector< vector<bool> > flag; void initial() { flag.resize(ROW); for (int i = 0; i < ROW; ++i) { flag[i].resize(COL); } } voi...
ALGO
0.999578
5.288829
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2017-03-01T06:17:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "366173cec...
f6ae5eff-48fa-466a-9c11-1cf2b976a931
liusiyuxyfx/MyACM
codeforces/codeforces#362div.2/B/2.cpp
/************************************************************************* File Name: 2.cpp ID: Liusiyu BLOG: http://blog.csdn.net/r_o_j LANG: C++ Mail: <EMAIL> Created Time: 2016年07月15日 星期五 19时02分46秒 ************************************************************************/ #include <cst...
ALGO
0.996618
3.11487
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2016-10-10T13:24:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c4ff9d6e4...
5979481a-f888-4955-9149-0a55a1d0237b
BillJJ/DMOJ
dmoj.ca-downloaded-submissions/AC/ac19p5.cpp
#include <bits/stdc++.h> using namespace std; int a[1505][1505]; int dp[1505][1505]; int dirc[4][2] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}}; int dfs(int i, int j){ if(dp[i][j]) return dp[i][j]; int ret = 0; for(auto [x, y] : dirc){ if(a[i+x][j+y] > a[i][j]){ ret = max(ret, 1 + dfs(i+x, j...
ALGO
0.999856
4.133962
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2021-08-09T18:22: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": "974660226...
aead575b-3dbc-4970-a0a2-fd9edcf4c9d1
HughHieuTran/solved-leetcode-question
cppBlind75/Tree/30-BinaryTraversal.cpp
/** * Definition for a binary tree node. */ #include <bits/stdc++.h> using namespace std; 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...
ALGO
0.999933
5.797345
{ "github_metadata": { "branch": "main", "commit_count": 26, "repo_created_at": "2023-06-22T04:01:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "73f3b6ed983...
33b70e4a-aeb3-44e0-8db0-022025c8e375
miti2727/DAA
Week 1/binarySearch.cpp
#include <bits/stdc++.h> using namespace std; void binary(int *arr, int key,int n) { int l = 0, r = n - 1, comp = 0; while (l <= r){ int mid = l + (r - l) / 2; if (++comp && arr[mid] == key){ cout << key << " is present\n"; cout << "Total comparisions = " << comp << endl...
ALGO
0.999788
4.243784
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2021-09-23T15:29: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": "5b901344a77...
97317052-492a-4f0b-ade9-7339f36da999
abhi-yo/DSAlgorithms
Week8/Lec2_Code/quickSort.cpp
#include<iostream> using namespace std; int partition(int arr[],int s,int e){ //step1: Choose pivot element (generally we are taking first element as the pivot element) int pivotIndex=s; int pivotElement=arr[s]; //step2: find position of pivot and place it there int count=0; for(int i=s+1;i<=e;i...
ALGO
0.99999
5.889729
{ "github_metadata": { "branch": "main", "commit_count": 136, "repo_created_at": "2023-02-04T07:45:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 25, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b905bd0dd...
68e65ecf-4791-4b16-b1d9-4e4d41ed046a
urish/tt-microtiles-collection-test
tt_um_nyan/tools/make_bitmaps.cpp
#include <array> #include <cstdint> #include <cstdlib> #include <iomanip> #include <iostream> #include <filesystem> #include <fstream> #include <map> #include <set> #include <span> #include <stdexcept> #include <vector> struct BitmapFileHeader { std::uint32_t size; std::uint32_t reserved; std::uint32_t bit...
TOOL
0.91296
6.388798
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2024-09-24T12:16:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9957bc0fa7...
0201a6be-c357-49d2-9aee-e6d2ac03deb0
ChengHao1110/Leetcode
Leetcode_29_Divided Two Integers/leetcode29.cpp
#include<iostream> #include<vector> #include<fstream> #include<string> #include<sstream> using namespace std; class Solution { public: int divide(int dividend, int divisor) { long long int n = static_cast<long long int>(dividend); long long int d = static_cast<long long int>(divisor); bool...
ALGO
0.999914
4.959359
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-10-30T03:45:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "58f2b8609ef6...
fdb74f33-fd4f-4dd3-948b-5f8f875f89ae
vichua2006/Competitive_Programming_Cpp
CCC/CCC_2013_S3.cpp
// dfs or recursion // compute all remaining games, apply dfs search on remaining games // use 4x4 array to keep track of matches, if not played, play it. #include<bits/stdc++.h> using namespace std; #define ll long long #define ar array int t,n,points[5], ans =0; // m[i][j] denotes whether i has played j bool match...
ALGO
0.999936
4.409612
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2022-06-07T00:43:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "597566512...
75e52652-f92b-4177-afef-f712e6a38289
assia200M/exmple_AG
main.cpp
#include <filesystem> #include <chrono> #include <fstream> #include <iostream> #include <fstream> #include <vector> #include <random> #include <ctime> #include <nlohmann/json.hpp> #include <set> #include <iomanip> #include <numeric> #include <cmath> using namespace std; using json = nlohmann::json; using Chromosome = ...
ALGO
0.998198
4.685092
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2025-04-23T20:28:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "29203b0dbf5b...
11f51007-74ae-4dfc-8617-3be386dd8bd4
Karbust/FoxFS
FoxFSArchiver/main.cc
#include <iomanip> #include <algorithm> #include <iostream> #include <fstream> #include <vector> #include <stack> #if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN64) #include <windows.h> #else #include <dirent.h> #endif #include <boost/property_tree/ptree.hpp> #include <boost/property_tree/xm...
TOOL
0.911036
5.522174
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2019-03-11T23:45:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 7, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "150a863fca...
b4a61351-84c2-4c7e-add3-96f6d8af4c0a
ACE-FASTT-codes-repository/Unsteady-MODES
include/Surrogates/rbf.h
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* ------ Copyright (C) 2017 University of Strathclyde and Authors ------ -------------------- e-mail: <EMAIL> ----...
ALGO
0.903606
6.726199
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2021-07-30T12:53:50.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5de480e2da768...
9b2cdb56-2cdb-451e-9032-e0770d4c7758
wzmw-zr/Code-Archive
2022/12/25/4.LeetCode6271.cpp
/************************************************************************* > File Name: 4.LeetCode6271.cpp > Author: > Mail: > Created Time: 2022年12月25日 星期日 11时08分39秒 ************************************************************************/ #include <iostream> #include <string> #include <vector> #include <queue...
ALGO
0.999718
4.820223
{ "github_metadata": { "branch": "master", "commit_count": 1859, "repo_created_at": "2019-11-28T12:33:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2bc112e...
42538b84-4fd9-4594-a196-7c489fe17607
bkorecic/competitive-programming-solutions
onlinejudge/10855 - Rotated square.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<ii> vii; #define FOR(i, a, b) for (int i=a; i<(b); i++) #define F0R(i, a) for (int i=0; i<(a); i++) #define EPS 1-e6 #define INF 1e6 #define PI acos(-1.0) #...
ALGO
0.99996
3.722694
{ "github_metadata": { "branch": "master", "commit_count": 67, "repo_created_at": "2019-09-28T02:00:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "00826e55c...
7e8d5aa8-65e1-4b16-bfc0-cd834f543687
reiya0104/AtCoder
Practices/RedCoder/1--10/8_Square869120Contest_6_B_AtCoder_Markets.cpp
/** * author: reiya0104 * created: 15.03.2021 18:33:04 **/ #include <bits/stdc++.h> using namespace std; using ll = long long; const int INF = 1001001000; int Time(int s, int g, pair<int, int> ab) { return abs(s - ab.first) + abs(g - ab.second) + abs(ab.second - ab.first); } int main() { int N; cin >>...
ALGO
0.999816
3.590707
{ "github_metadata": { "branch": "master", "commit_count": 66, "repo_created_at": "2021-02-26T09:30:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f35ab8afa...
a315f306-df6d-4479-a9be-47970cba3fd5
wybosys/nnt
contrib/geos/src/geomgraph/EdgeEndStar.cpp
/********************************************************************** * $Id: EdgeEndStar.cpp 2547 2009-06-05 13:41:50Z strk $ * * GEOS - Geometry Engine Open Source * http://geos.refractions.net * * Copyright (C) 2001-2002 Vivid Solutions Inc. * Copyright (C) 2005 Refractions Research Inc. * * This is free s...
ALGO
0.990366
6.155129
{ "github_metadata": { "branch": "master", "commit_count": 559, "repo_created_at": "2013-03-29T03:57:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 10, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2ed061e...
8f965008-c0a3-4e6f-9125-de4c33d9d26b
maartenb/cern-root
interpreter/llvm/src/tools/clang/lib/Frontend/CompilerInvocation.cpp
//===- CompilerInvocation.cpp ---------------------------------------------===// // // 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 // //===---------------------------...
TOOL
0.954129
7.216958
{ "github_metadata": { "branch": "master", "commit_count": 71391, "repo_created_at": "2016-02-15T17:02:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "384ac3...
35a10aed-f265-49de-ad6b-cdc9cb6792a0
brunnomesq/codigosbrunno
projetos compilador devcpp/exercicios laboratorio programacao/exercicios prontos sequencial 1ao20/9 projeto ex15.cpp
//ex15 ////<NAME> 25/03/22 //Criar um algoritmo que, dado o número da conta corrente com três dígitos, retorne o dígito verificador, o qual é calculado da //seguinte maneira: //Exemplo: número da conta: 235; //• Somar o número da conta com seu inverso: 235 + 532 = 767; //• Multiplicar cada dígito pela sua ordem posicio...
ALGO
0.99743
4.076623
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2024-07-10T20:20: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": "130dc90be4...
8b08478b-ee51-42de-8143-95cda9122a38
Marcus-Rost/Lectio
HashCode2020/src/ScanningSolution.cpp
#include "ScanningSolution.h" ScanningSolution::ScanningSolution() { //ctor } string ScanningSolution::toString() { string str; for (map<int, LibrarySchedule>::iterator it = libSchedules.begin(); it != libSchedules.end(); it++) { str += it->second.toString(); } return str; } ScanningSol...
ALGO
0.975609
3.281066
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2020-03-28T18:00: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": "1d1e729fad...
4d496dcb-434b-4439-b444-a950e0d0de96
SysuMadw/DataStructrue
树/avltree.cpp
# include <iostream> # include <algorithm> using namespace std; class TreeNode { public: int val; int height; TreeNode* left; TreeNode* right; TreeNode(int x) : val(x), height(1), left(NULL), right(NULL) {} }; int height(TreeNode* root){ return root==NULL? 0 : root->height; } TreeNode* RR(TreeNode* root){ Tr...
ALGO
0.999918
4.303293
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2019-01-25T12:24: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": "5a707c75d...
f80d06f6-d4fe-44ad-9dd2-bfbe07fe3bb6
VikramKumaresan/algorithms
linkedLists/xorDll.cpp
/* xorAddress of node stores the address as a struct node* datatype. struct node * = Memory location, which can be type casted to a long int. You could store xorAddress as a long int data type too in the struct. For performing ^ operation however, you strictly require long int only. So type cast wherever needed....
ALGO
0.99938
4.3756
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2017-12-12T17:21:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "381e4686f...
e5dc853d-8ad5-413d-92f4-3bae026cf740
CarloWood/cairowindow
intersection_points.h
#include <array> #include <vector> #include <concepts> #include <stdexcept> #include <iostream> namespace intersections { // An n-dimensional vector (a column vector with n elements). template<std::floating_point FloatType, int n> struct Vector { std::array<FloatType, n> v_; // The elements...
ALGO
0.977659
6.717131
{ "github_metadata": { "branch": "master", "commit_count": 343, "repo_created_at": "2023-12-13T16:15:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 18, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e88c33c...
3b776d84-b6db-44c6-9ad6-0ae4bef461f0
Dr-x86/Music-Player
MusicPlayer.cpp
#include <iostream> #include <iomanip> #include <cstring> #include <cstdlib> #include <conio.h> #include <thread> #include <windows.h> #include"MMSystem.h" using namespace std; bool stopFlag=false; void gotoxy(int x, int y) { COORD coord; coord.X = x; coord.Y = y; SetConsoleCursorPosition(GetStdHandle(...
TOOL
0.918132
3.177403
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-06-28T17:44:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3c8c69bb41c7...
03f3725f-5063-4c84-b0ae-734d35fed687
AleksaMilosevic07/BFS-and-DFS
BFSandDFSanimation.cpp
#include <bits/stdc++.h> using namespace std; char matrix[1005][1005]; //The matrix we will play in int N, M; //Size of the matrix (N*M) int x, y; char DrB; //Stands for "DFS or BFS", we will use this to check which of the two algorithms user wants to use //Simple function that will cout-out the matrix at it's curren...
ALGO
0.999935
4.542177
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-10-27T15:38: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": "d88a0f443a4d...
ef7b0a84-c90b-42f3-8fe4-96e5d47f7f3e
TimeDA/TimeDA
dataset/cpp_12_18/gcj2012/logicmachine/1835486_1590487_logicmachine_b.cpp
#include <iostream> #include <vector> #include <map> #include <string> #include <queue> #include <algorithm> #include <cstring> using namespace std; typedef pair<int, int> pii; const int dx[] = { 1, 0, -1, -1, 0, 1 }; const int dy[] = { 1, 1, 0, -1, -1, 0 }; const int COLOR_MASK = 0x0000ffff; const in...
ALGO
0.999885
4.387186
{ "github_metadata": { "branch": "main", "commit_count": 70, "repo_created_at": "2022-10-24T06:47: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": "a52fffec8dd...
c8ba9dd0-fedf-42e6-8ca6-e491543b9d76
Mourad-NOUAILI/advanced-tutorials
Pairwise-Distinct-Summands/sol1.cpp
#include <bits/stdc++.h> typedef unsigned long long int ulli; // Calculate the maximum number (k) such that (n) can be represented // as a sum of k pairwise distinct positive integers. // Time complexity: O(1) void max_k_partition(ulli n, ulli & i, ulli & k) { // Find (i), such as (i) is the largest positive num...
ALGO
0.999938
4.508107
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2019-05-26T23:15: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": "90e55d7d8...
a9525bee-95c0-423f-aacc-17171a8b2638
map-A/TIMU
Leetcode/offer64.cpp
#include "bits/stdc++.h" using namespace std; int Sum_Solution(int n) {// return n * (n + 1) / 2; } int sumNums(int n) { int ret = 0; for (int i = 1; i <= n; i++) ret += i; return ret; } int Sum_Solution(int n) { n && (n += Sum_Solution(n - 1)); return n; } int Sum_Solution(int n) {...
ALGO
0.999759
3.80191
{ "github_metadata": { "branch": "master", "commit_count": 113, "repo_created_at": "2021-06-18T11:25:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ddb329c7...
5159eb35-6da8-4ce3-9780-454b6dd8ee3f
Mr-Tony-Lee/CP_Road
Uva_record/UVA_3_star_question/00122.cpp
#include<bits/stdc++.h> using namespace std; #define int long long bool cmp(pair<string,int> p1 , pair<string,int> p2 ){ return (p1.first.size() == p2.first.size()) ? (p1.first < p2.first) : (p1.first.size() < p2.first.size()); } int32_t main(){ cin.tie(0); cout.tie(0); ios::sync_with_stdio(0); string li...
ALGO
0.999039
3.735396
{ "github_metadata": { "branch": "main", "commit_count": 87, "repo_created_at": "2025-04-10T02:58:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "82cbbc93f4c...
9d11d721-2227-4309-979b-99a1a1910afc
kriskensy/WSB_Cpp
Semestr 2/S2 - C++/S2 - L_03 - 3. dziedziczenie - zadanie (klasa Point)/S2 - L_03 - 3. dziedziczenie - zadanie (klasa Point).cpp
#include <iostream> #include <string> #include <set> #include <algorithm> #include <cmath> #include <functional> //std::greater class Point { public: Point(std::string name_, float x_, float y_) : name(name_), x(x_), y(y_) { std::cout << "create a point with data" << std::endl; ...
ALGO
0.99701
5.369543
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2024-02-23T19:56:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0ecb977fcf...
3b8f6899-bf3a-4b30-bdd1-d5c5751bc622
adityanjr/code-DS-ALGO
InterviewBit/Binary Search/Rotated_array_sorted_search.cpp
// https://www.interviewbit.com/problems/rotated-sorted-array-search/ int pivotFind(const vector<int> &A){ int l = 0; int r = A.size()-1; int n = A.size(); while(l<=r) { int mid = l+(r-l)/2; int next = (mid+1)%n; int prev = (mid-1+n)%n; if(A[l]<=A[r]) ...
ALGO
0.999991
5.826517
{ "github_metadata": { "branch": "master", "commit_count": 589, "repo_created_at": "2019-10-25T15:50:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 32, "forks": 46, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "777fc6...
6657c760-4c16-4a42-b184-216684f1b074
nem0/LumixEngine
external/luau/include/Luau/Config.h
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details #pragma once #include "Luau/LinterConfig.h" #include "Luau/ParseOptions.h" #include <optional> #include <string> #include <unordered_map> #include <vector> namespace Luau { using ModuleName = std::st...
CONFIG
0.908458
7.387142
{ "github_metadata": { "branch": "master", "commit_count": 7072, "repo_created_at": "2013-11-21T14:43:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3636, "forks": 411, "issues": 36, "pull_requests": 1 }, "file_meta": { "content_id": "7...
2e535f48-667b-402b-8fee-1d71c302937e
dunarel/dunphd-thesis
Chapter5/Main/hgt-qfunc.v.0.5.2/deps/simdpp/simd/insert.h
/* libsimdpp Copyright (C) 2011-2013 <NAME> <EMAIL> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, t...
ALGO
0.902209
6.820554
{ "github_metadata": { "branch": "master", "commit_count": 171, "repo_created_at": "2015-05-30T19:37: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": "1219d137...
e1501345-d59e-4a83-b21c-2c85cbf72229
algorithm007-class01/algorithm007-class01
Week_03/G20200343040089/LeetCode_589_0089.cpp
/* * Summary:n-ary-tree-preorder-traversal * Parameters: * root: tree-node * Return: traversal vector */ /* // Definition for a Node. class Node { public: int val; vector<Node*> children; Node() {} Node(int _val) { val = _val; } Node(int _val, vector<Node*> _children) { val ...
ALGO
0.999984
6.329659
{ "github_metadata": { "branch": "master", "commit_count": 1592, "repo_created_at": "2020-03-09T11:32:35.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 28, "forks": 102, "issues": 551, "pull_requests": 1 }, "file_meta": { "content_id": "8ca...
aab025df-b7a8-40a1-ac6b-5f7e27bc157f
Squareless-XD/2023Spring-UCAS-DS-Group-Work
AVL-tree/main.cpp
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<stdlib.h> #include"AVLTree.h" int main() { AVLTree T1; AVLTree T2; int t; int cho; int key; bool taller =0; bool shorter=0; T1 = (AVLTree)malloc(sizeof(AVLTreeNode)); T1 = NULL; T2 = (AVLTree)malloc(sizeof(AVLTreeNode)); T2 = NULL; while (1) { ...
ALGO
0.999439
3.570355
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2023-06-02T10:38:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "5d722496cd7...
98716409-dc55-4c43-be8d-3113b7ffd550
Saif-Ustad/FDS-Assignments
FDS Assignments/Assignment 4/singly_Linked_List.cpp
#include<iostream> using namespace std; struct Node { int data; struct Node * Next; }; struct Node * accept() { struct Node *a; a = new Node; cout<<"Enter Node data : "; cin>>a->data; a->Next = NULL; return a; } struct Node *creat_linked_list(struct Node *Head) { int number_of_no...
ALGO
0.999454
3.981679
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-01-01T16:56:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "da63c49cbb86...
c0ac07c6-4bf5-429e-87f9-bf9e6ddd471a
twinone/upc
fib-pro1/jutge/other/src/InsertionSort.cc
#include <iostream> #include <vector> /** Statement: 15 6 2 8 5 10 9 12 1 15 7 3 13 4 11 14 */ using namespace std; void swap(int& a, int& b) { int tmp = a; a = b; b = tmp; } void insertion_sort(vector<int>& v) { for (int i = 0; i < v.size()-1; ++i) { for (int j = i+1; j > 0 and v[j] < v[j-1]; j--) { /...
ALGO
0.999965
4.198157
{ "github_metadata": { "branch": "master", "commit_count": 318, "repo_created_at": "2018-04-04T18:23:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e26fcdf9...
6b55d922-348e-4695-9401-2949c4f720ad
ICS3U-C-Programming-Remy-S/Unit6-01-CPP
averageCalc.cpp
// Copyright (c) 2023 <NAME> All rights reserved. // // Created by: <NAME> // Date: Dec 6, 2023 // This program will calculate the average of // 10 nums #include <cstdlib> #include <ctime> #include <iomanip> #include <iostream> #include <random> int main() { // Declare userNumStr std::string userGuessStr; ...
ALGO
0.99573
5.304259
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2023-12-13T22:51:50.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "941426e813d5b...
0adb42c5-ba11-4cf4-b124-859a89ad4597
Thedappolice/MAX72XX
examples/Games/2.Joystick_snake/2.Joystick_snake.ino
// this program uses Arduino Nano #include <LEDMatrixChip.h> // Define SPI communication pins #define DATA_PIN 2 #define CHIP_SELECT_PIN 3 #define CLOCK_PIN 4 LEDMatrixChip LM(CHIP_SELECT_PIN, CLOCK_PIN, DATA_PIN, 1, 0); unsigned long interval = 500; // Refresh interval in milliseconds // Snake initial positions a...
TOOL
0.98874
6.096826
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2025-02-26T12:56:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "26ffa9b9b3c2...
3b287ec3-f330-4077-a74f-df4537ac09a4
cppaddiction/1_sprint_final_project
search-server/main.cpp
#include <algorithm> #include <iostream> #include <set> #include <string> #include <utility> #include <vector> #include <map> #include <cmath> using namespace std; const int MAX_RESULT_DOCUMENT_COUNT = 5; string ReadLine() { string s; getline(cin, s); return s; } int ReadLineWithNumber() { int resul...
ALGO
0.999435
5.143933
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-05-09T03:06: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": "4bcf91300453...
751099af-8c03-4f24-bcfe-c18030247660
potakaaa/matrix-calculator
logic samples/rref.cpp
#include <iostream> #include <vector> #include <fstream> // Start a fight club, brad reputation using namespace std; class Position { public: int row; int col; Position(int row, int col) { this->row = row; this->col = col; } int GetValue(vector<vector<double> > matrix) {...
ALGO
0.999715
3.986787
{ "github_metadata": { "branch": "master", "commit_count": 39, "repo_created_at": "2024-06-18T10:34:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "14132ede8...
0806cc18-ead8-4158-b363-8472c4f2b582
grzes5003/AdventOfCodeArchive
aoc-2018/src/days/day02.cpp
#include "day02.hpp" #include <ranges> #include <set> #include <utility> #include <vector> std::map<char, int> Day02::frequencies(const std::vector<char> &vec) { std::map<char, int> freq; for (auto c : vec) { std::map<char, int>::iterator it = freq.find(c); if (it != freq.end()) { it->second += 1; ...
ALGO
0.999383
5.448191
{ "github_metadata": { "branch": "master", "commit_count": 27, "repo_created_at": "2022-01-13T22:32: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": "d044df787...
64b151ee-bd0b-4543-bc72-3f9d96aaa02f
mizzzzzzz/leetcode
code/133. Clone Graph.cpp
#include <algorithm> #include <cassert> #include <vector> #include <string> #include <unordered_map> #include <unordered_set> #include <queue> using std::queue; using std::string; using std::unordered_map; using std::unordered_set; using std::vector; // https://leetcode.com/problems/clone-graph/ class Node { public: ...
ALGO
0.999861
5.971618
{ "github_metadata": { "branch": "main", "commit_count": 38, "repo_created_at": "2021-04-07T05:51: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": "b9d9ebb6745...
468e790a-249e-4c03-819a-f20e41b02f6b
ad1tyaSharma/CPP
DSA/dll.cpp
#include<bits/stdc++.h> using namespace std; class Node{ public : int data; Node* next; Node* prev; Node(int val) { data=val; next=NULL; prev=NULL; } }; void insertAtEnd(Node* &head,int val) { Node* newEl = new Node(val); Node* tmp=head; while (tmp->next!=...
ALGO
0.999862
4.13572
{ "github_metadata": { "branch": "master", "commit_count": 201, "repo_created_at": "2020-12-29T06:18: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": "b77a4fac...
1772e618-be1c-4b97-a250-eb89ca52c887
JKMeen/Algorithms--Data_Structure
C_Code/16-11-03-ArrayStack/ArrayStack.cpp
#include "stack.h" #include <string.h> // 스택 초기화 함수 void init(StackType *s) { //추가 s->top = -1; } // 공백 상태 검출 함수 int is_empty(StackType *s){ return (s->top == -1); } // 포화 상태 검출 함수 int is_full(StackType *s) { return (s->top == MAX_STACK_SIZE - 1); } // 삽입함수 void push(StackType *s, element item) { if (is_full(s...
ALGO
0.998728
4.312589
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2016-05-22T05:03:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e0a701a4d...
b3ee5ba4-90c1-4d42-bf62-40ffed5d189a
BKonopka123/AGH_sem4
metody_numeryczne/lab6/main.cpp
#include <iostream> #include <fstream> #include <cmath> #include "/usr/include/gsl/gsl_math.h" #include "/usr/include/gsl/gsl_linalg.h" #include "/usr/include/gsl/gsl_deriv.h" #define M 101 //g++ main.cpp -lgsl -lgslcblas -lm && ./a.out double my_f1(double x); double my_f2(double x); double my_f3(double x); gsl_vec...
ALGO
0.999368
4.380029
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2023-04-25T16:21:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7e1ac467dcd...
6a684d8f-c07b-4de8-a51d-c25ad8117903
Relintai/pandemonium_engine
scene/resources/shapes_2d/concave_polygon_shape_2d.cpp
/*************************************************************************/ /* concave_polygon_shape_2d.cpp */ /*************************************************************************/ /* This file is part of: */ /* ...
ALGO
0.918553
7.400021
{ "github_metadata": { "branch": "master", "commit_count": 4742, "repo_created_at": "2022-03-15T12:16:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 37, "forks": 12, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0c4a4...
325366bd-f10b-4885-822b-744ca33a663c
sshrik/algo-study
BaekJoon/success/1500 ~ 2000/bk1717.cpp
#include<iostream> #include<algorithm> #include<cstdio> #include<cstdlib> #pragma warning(disable: 4996) #define _CRT_SECURE_NO_WARNINGS #define SIZE_MAX 1000001 using namespace std; // [ 0, 0, 1, 2 ] 는 각 index 별로 속해있는 집합을 의미. 0은 0의 집합에, 1은 1의 index 가 가리키는 0 집합에, 2는 1의 index가 가리키는 0의 집합에, 3은 2->1->0->0 의 집합에 속해있다. in...
ALGO
0.999997
4.818721
{ "github_metadata": { "branch": "master", "commit_count": 136, "repo_created_at": "2018-07-24T02:41:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7ed1ff81...
9d5679a4-22a4-4058-9873-8b900c870666
m2048so3/boilerplate-for-competitive-programming
structure/fenwick_tree.cpp
template <class T> struct AbelianGroup { const T identity; const function<T(T, T)> add; const function<T(T)> inverse; AbelianGroup (const T& ident, const function<T(T, T)>& operation, const function<T(T)>& inv) : identity(ident), add(operation), inverse(inv) {} T sub(const T& a, const T& b) ...
ALGO
0.999843
5.962451
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2019-11-18T16:58: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": "485a6fc755...
8f26f2de-8bac-4edf-a71f-d7635977d650
dayshah/Data-Structuring
twoDynamic.cpp
#include <iostream> using namespace std; int uniquePaths(int m, int n) { unordered_map<int, unordered_map<int, int>> paths {}; paths[m-1][n-1] = 1; for (int ni = 0; ni < n-1; ni++) { paths[m-1][ni] = 1; } for (int mi = 0; mi < m-1; mi++) { paths[mi][n-1] = 1; } for (int mi =...
ALGO
0.999967
5.54934
{ "github_metadata": { "branch": "main", "commit_count": 48, "repo_created_at": "2023-06-04T15:48:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c0d328975be...
e8d6d97b-6130-4fa2-bcb8-591c6ea46050
kushagra7589/Semester4
os/assgnt1/PRIMEDST.cpp
#include <algorithm> #include <iostream> #include <iomanip> #include <cstring> #include <cstdlib> #include <complex> #include <string> #include <vector> #include <cstdio> #include <cmath> //#include <ctime> #include <map> using namespace std; // FFT on complex filed. (You can also use FFT on finite field.) complex <do...
ALGO
0.999402
3.904441
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-10-07T12:41:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "12d4be17b5...
73433f50-3d3f-4bee-aa33-8ab1ab6d0b4e
janmejay25/Computer_Graphics
flood.cpp
#include <graphics.h> #include <stdio.h> void floodFill4(int x, int y, int fillColor, int oldColor) { if (getpixel(x, y) == oldColor) { putpixel(x, y, fillColor); floodFill4(x + 1, y, fillColor, oldColor); floodFill4(x - 1, y, fillColor, oldColor); floodFill4(x, y + 1, fillColor, ol...
ALGO
0.99873
5.372119
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2025-01-26T15:04: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": "66cd786e3bd...
bb6903ba-b28c-4e03-9cb5-8abaab1a1d12
Yatharth007Pathak/Cpp-tutorials
fr.cpp
#include <iostream> using namespace std; int main() { int m; cout << "enter the m : "; cin >> m; for(int i=1; i<=m; i++) { for(int j=1; j<=m-i+1; j++) { cout << " " << " "; } for(int j=1; j<=i; j++) { cout << "*" << " "; } cout << endl;...
ALGO
0.999802
4.171587
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-10-22T04:19: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": "2414c37770db...
fa890220-2a62-4d48-abc4-542f38641747
Raghav-Saboo/Algorithms-and-Data-Structures-for-Competitive-Programming
Advanced String Algorithms/string_hash.cpp
// Problem link // https://www.hackerrank.com/contests/inscription2015/challenges/the-natural-selection/problem #include <bits/stdc++.h> using namespace std; #define ll long long int #define mp make_pair #define pb push_back #define pii pair<int, int> #define pll pair<ll, ll> #define fi first #define se second #define...
ALGO
0.999963
4.171957
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2018-05-30T15:39:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8dbac48d9...
8474c8ab-44bf-4c30-88d1-4c2a88b8e0b7
Dharnesh67/decode-cpp
Sorting_advance/merge/merge_sort.cpp
// #include <iostream> // #include<vector> // using namespace std; // merge twoo sorted array // vector<int> merge(vector<int>&a,vector<int>&b,vector<int>&c){ // int n =a.size(); // int m=b.size(); // int i=0; // int j=0; // int k =0; // while( i <n &&j<m){ // if(a[i]<=b[j]){ // c[k] = a[...
ALGO
0.999996
6.027353
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2023-10-23T10:03: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": "fe20513ff08...
42b78dd3-73f4-4524-89de-1c2515ff83d9
matcher9131/AtCoder-Repo
abc391/b/main.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <iomanip> #include <cmath> #include <climits> #include <cfloat> #include <utility> #include <map> #include <set> #include <stack> #include <queue> #include <unordered_map> #include <unordered_set> #include <cassert> #include <numeric>...
ALGO
0.999985
3.928136
{ "github_metadata": { "branch": "main", "commit_count": 613, "repo_created_at": "2023-07-07T15:00: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": "653f0b38ae...
2137295f-2a5d-40bc-8245-8af0afb3aba5
archit-1997/leetcode
daily_challenge/March_LeetCoding_Challenge_2021/reconstructOriginalDigitsFromEnglish.cpp
class Solution { public: string originalDigits(string s) { unordered_map<char, int> count; int n = s.size(); for (int i = 0; i < n; i++) { count[s[i]]++; } vector<int> ans(10, 0); // we know the count of zero ans[0] = count['z']; ans[2] = count['w']; ans[4] = count['u']; ...
ALGO
0.999142
4.803757
{ "github_metadata": { "branch": "main", "commit_count": 289, "repo_created_at": "2021-01-11T14:38: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": "0ad03245fc...
fa8c8aec-02e5-496a-8f8a-08c2857dffd5
Umwelt32/QuickCode
Algos/CPP/CA/ca_pcg.hpp
#pragma once #include "defs.hpp" #include "array2d.hpp" typedef struct { U8 type; U16 neightborhood_value; U16 floor_value; }ca_node_t; class ca_pcg { public: ca_pcg(); ~ca_pcg(); void init(const U16 &w,const U16 &h); void generate(const U16 &seed,const F32 &r,const U1...
ALGO
0.935654
4.661021
{ "github_metadata": { "branch": "main", "commit_count": 316, "repo_created_at": "2022-08-14T14:12: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": "3ea7bf7080...
b7a1a656-adba-4c7d-850d-f1a5c610ac8b
vfolunin/archives-solutions
CSES/2189.cpp
#include <iostream> #include <algorithm> #include <vector> #include <set> #include <map> #include <string> using namespace std; struct Point { long long x, y; Point() {} Point(const Point &a, const Point &b) : x(b.x - a.x), y(b.y - a.y) {} long long crossProduct(const Point &that) const { ...
ALGO
0.999968
3.690712
{ "github_metadata": { "branch": "master", "commit_count": 2367, "repo_created_at": "2017-11-27T10:19:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 1, "pull_requests": 5 }, "file_meta": { "content_id": "11f85aa...
d751d125-2b59-43b9-830b-eefd2e29c339
Sonjuan/algo-practice
bfs/5427-불/5427.cpp
#include <iostream> #include <queue> #include <string> using namespace std; int T; int N; int M; int dist[1005][1005]; string table[1005]; int dr[4] = {-1, 1, 0, 0}; int dc[4] = {0, 0, -1, 1}; int main(void) { cin >> T; while(T--) { cin >> M >> N; for(int i = 0; i < N; ++i) fill(dist[i], dis...
ALGO
0.999955
4.388941
{ "github_metadata": { "branch": "master", "commit_count": 82, "repo_created_at": "2023-09-13T01:48:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "540588e8c...
50f95128-1b54-4d07-a7ee-6c04d2ddd7b1
player400/Pathfinder
src/Map.h
#pragma once class Map { private: Vector<Town*> towns; MapElement*** map; public: const Coords size; void add_town(Town* town) { towns.push_back(town); } void add_to_map(MapElement* new_element) { map[new_element->position.height][new_element->position.width] = new_element; } //Executes BFS algorithm...
ALGO
0.963502
3.844666
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-06-08T17:50:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bcdc635e5bfc...
a93a9d2d-1893-494b-8359-8460e8782d2a
Ming-J/LeetCode
213_House_Robber_II.cpp
#include <iostream> using namespace std; /* Break the problem into two parts, due to it being a circular array, we are free to choose whether we need to rob house 0 or house n-1. Just note if we rob house zero we can not rob house n-1. If we rob house n-1 we can not rob house n-1. */ class Solution { public: ...
ALGO
0.999982
4.819036
{ "github_metadata": { "branch": "master", "commit_count": 448, "repo_created_at": "2014-11-04T04:34: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": "bd299e81...
dc5716a6-a477-44f5-a67c-ba67e27151c1
alexandraback/datacollection
solutions_5644738749267968_0/C++/zhouwei0422/Deceitful War.cpp
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <fstream> #include <list> #include <map...
ALGO
0.99974
3.353358
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5c37dd4c1...
52d31209-0415-4ee8-8b75-7870223bdcf2
seoyechan/back10711
모래성/main.cpp
#include <iostream> #include <vector> #include <queue> using namespace std; int nfiled[1001][1001]; int nfiled_copy[1001][1001]; int x, y; int dirx[] = { 0, 0, 1, -1, -1, 1, 1, -1 }; int diry[] = { 1, -1, 0, 0, -1, 1, -1, 1 }; typedef struct pos{ int nx, ny; }; vector <pos> vec; queue <pos> que[2]; int changeIn...
ALGO
0.99992
3.783432
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-08-27T16:24: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": "b72d2cac20...
d77adc75-456e-442a-ace7-469e2bd17b54
Isaace19/Past_Class_Notes
s2023/cosc202/HydraCode/HW2_Code/HW2.cpp
#include <iostream> /* Name: <NAME> Implement Single Linked Class Functions: Push_Front, pop_front, const in &front(). */ struct Node { int data; Node *next; // initialize the node so it can hold new data from insert Node(int data = 0) : data(data), next(NULL) {} }; class LinkedList { // implemen...
ALGO
0.991583
5.688279
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-08-20T10:28:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8c916d079483...
7990a0de-a1dc-455a-bf11-29959029ee45
keatshackon/Scaler_DSA
tree/day62_constructBTpost.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long struct TreeNode { int val; TreeNode *left, *right; TreeNode(int x): val(x), left(NULL), right(NULL) {} }; void print(TreeNode *root) { queue<TreeNode*>q; q.push(root); while (!q.empty()) { TreeNode *temp = q.front(); q.pop(); cout << te...
ALGO
0.999984
4.859508
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-10-08T11:42:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "32ec792f7193...
1632cdeb-c353-4f95-ba93-466c2e69b053
anukraticodes/DailyCodeChallenges
0621-task-scheduler/0621-task-scheduler.cpp
class Solution { public: int leastInterval(vector<char>& tasks, int n) { unordered_map<char, int> mp; for (char t : tasks) mp[t]++; // Count frequency of each task // Max heap of task frequencies priority_queue<int> pq; for (auto& it : mp) pq.push(it.second); int steps = 0; while (!p...
ALGO
0.999991
7.376446
{ "github_metadata": { "branch": "main", "commit_count": 2182, "repo_created_at": "2024-06-07T12:54:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "f7fa474a8...
0e00f20c-6e11-4bf6-b27a-a854f2776c1e
wisdompeak/LeetCode
Tree/222.Count-Complete-Tree-Nodes/222.Count-Complete-Tree-Nodes_v1.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: int countNodes(TreeNode* root) { int h = 0; TreeNode* node = root; ...
ALGO
0.999873
5.777883
{ "github_metadata": { "branch": "master", "commit_count": 8912, "repo_created_at": "2017-03-01T10:30:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6018, "forks": 1314, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "8...
f05a0cdf-d926-4389-af7a-a1e1a3efcba8
chucknouri/Stage_5A_Simpulse
calcalpha.h
#ifndef _CALCALPHA_H_ #define _CALCALPHA_H_ #include <math.h> #include <bitset> #include <vector> class Alpha { unsigned int deg;//degrée du polynome (longueur du message) unsigned int nblig; //nb de ligne de notre tableau 2D unsigned int nbpair; //nombre de 1 pair pour éliminer les polynomes de la liste des po...
ALGO
0.996501
3.556033
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2022-11-29T22:15:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ce9896490681...
62bc322c-6cd7-469a-aec1-9e4020ed11c3
ishandutta2007/codeforces-d
dreamoon_love_aa/normal/369/E.cpp
#include<stdio.h> #include<string> #include<math.h> #include<stdlib.h> #include<set> #include<bitset> #include<map> #include<vector> #include<string.h> #include<algorithm> #include<iostream> #include<queue> #define SZ(X) ((int)(X).size()) #define ALL(X) (X).begin(), (X).end() #define REP(I, N) for (int I = 0; I < (N); ...
ALGO
0.999906
3.508163
{ "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": "8de3b9cf92a5...
4f1d3f4f-5744-49f4-9dd0-60d25fc63152
visheshvats/450-DSA
StringOperation.cpp
// { Driver Code Starts // Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ class Solution { public: int flip(int binaryDigit) { return binaryDigit == 0 ? 1 : 0; } int getFlipCountToAlternateString(vector<int> binary...
ALGO
0.999835
5.760167
{ "github_metadata": { "branch": "master", "commit_count": 70, "repo_created_at": "2021-09-03T12:37: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": "c0cac2c02...
324917c2-fe78-4be0-9333-2d51c247b16a
Toufik-Islam/XPSC_Phitron
Week 7/Day 2/Largest_Y.cpp
/*\~~~~~~~~~~~~~~~~~\ \ TOUFIK \ \ ISLAM \ \~~~~~~~~~~~~~~~~~\*/ #include <bits/stdc++.h> using namespace std; #define ll long long #define nl '\n' #define FastIO \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); v...
ALGO
0.999852
4.480141
{ "github_metadata": { "branch": "main", "commit_count": 125, "repo_created_at": "2023-06-16T05:30:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5ab7c2206f...
3c8f2d22-4aac-4663-93b9-1499ec6653da
love2d/love
src/libraries/box2d/dynamics/b2_edge_circle_contact.cpp
// MIT License // Copyright (c) 2019 <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, p...
TOOL
0.992347
7.091506
{ "github_metadata": { "branch": "main", "commit_count": 5566, "repo_created_at": "2019-05-25T18:43:48.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 6881, "forks": 486, "issues": 88, "pull_requests": 6 }, "file_meta": { "content_id": "69e0...
6fe34200-67a5-4adf-8ad5-d8b66cc121df
aman71010/DSA-problems
Dynamic Programming/longestPalindromicSubstring.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: // T-> O(n^3) and S-> O(1) string longestPalindrome(string s) { int l = s.length(); int ans = 1, start = 0; for(int i=0; i<l; i++){ for(int j=i; j<l; j++){ bool isPal = true; ...
ALGO
0.999979
5.508767
{ "github_metadata": { "branch": "master", "commit_count": 312, "repo_created_at": "2021-07-29T12:20: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": "fab85927...
e15d150c-37ad-4406-a101-15e259f8ee97
apache/cloudberry
src/backend/gporca/libgpopt/src/xforms/CXformSimplifySubquery.cpp
//--------------------------------------------------------------------------- // Greenplum Database // Copyright (C) 2012 EMC Corp. // // @filename: // CXformSimplifySubquery.cpp // // @doc: // Simplify existential/quantified subqueries by transforming // into count(*) subqueries //----------------------------------...
TOOL
0.948285
6.252417
{ "github_metadata": { "branch": "main", "commit_count": 71549, "repo_created_at": "2023-05-24T06:58:16.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1000, "forks": 167, "issues": 104, "pull_requests": 50 }, "file_meta": { "content_id": "7...