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
bd78ae79-5eb6-452e-9870-6f1f14585504
Zienab297/AlgorithmAnalysis
mway.cpp
#include<iostream> using namespace std; class mBST { struct node { int data1; int data2; int data3; node* left; node* mid1; node* mid2; node* right; }; node* root; node* insert(int x, node* t) { if (t == NULL) { ...
ALGO
0.999936
3.921383
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2022-10-28T08:11:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6bdf07cafd78...
1f9bc808-e0f3-4217-8030-59a4a020b10f
MagicalSheep/Daily
pratice/CF1659B.cpp
#include <bits/stdc++.h> using namespace std; const int MAXN = 2e5 + 10; int t, n, k; char str[MAXN]; void solve() { vector<int> f(n + 1), ones(n + 1); int zeros = k; for (int i = 1; i <= n; i++) { ones[i] = (str[i] == '0') ? 0 : 1; if (((k + ones[i]) & 1) || zeros <= 0) { ...
ALGO
0.999954
3.5724
{ "github_metadata": { "branch": "main", "commit_count": 488, "repo_created_at": "2021-07-12T09:23:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a6385f5b57...
8710461d-b4df-448a-8f72-b483fb8ff116
LroseC/Algorithm-Competition
nowcoder/57362/J/brute.cpp
#include <cctype> #include <cstdio> #include <cstdint> #include <iostream> #include <algorithm> using i32 = int32_t; using i64 = int64_t; #define read std::cin const int N = 1e5 + 10; i32 n; bool vis[N]; i32 ans[N]; i32 prime[N], v[N], idx; void init(void) { i32 n = 1e5; for (i32 i = 2; i <= n; ++i) { if (!v[i...
ALGO
0.99966
4.087113
{ "github_metadata": { "branch": "main", "commit_count": 45, "repo_created_at": "2023-06-14T15:21: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": "4521557e722...
a7895f04-72ae-4b06-b222-415376b47768
ICRA-2019/srrg_bench
src/matchers/bruteforce_matcher.cpp
#include "bruteforce_matcher.h" namespace srrg_bench { BruteforceMatcher::BruteforceMatcher(const uint32_t& minimum_distance_between_closure_images_, const int32_t& norm_type_): _matcher(new cv::BFMatcher(norm_type_, true)), ...
ALGO
0.986916
6.152663
{ "github_metadata": { "branch": "master", "commit_count": 121, "repo_created_at": "2022-02-09T11:27:56.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1462e8b25...
cf56e2e7-d6b8-4d2e-b428-5e6244a1f09f
Sunwinds/3D-Geometric-Features
ddtt/ddtt-plugin/ContourMappingDistance.h
#pragma once #include <vector> template<class T> static inline std::vector<T> mycalloc(int count){ return std::vector<T>(count, 0); } /* Contour Mapping Measure http://www.elderlab.yorku.ca/~vida/CM/index.html */ //Pre-Assumption: first curve is the longer one (n1>n2) static inline void _optMapMae(double *ia, doubl...
ALGO
0.999417
4.229729
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2015-04-09T23:12:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "51005c4cab...
997effd5-f50f-4916-a1dd-5abdbad245d4
coderaviverma/Interview-Preparation-Package
src/codingsites/leetcode/0018.4Sum/Solution.cpp
class Solution { public: vector<vector<int>> fourSum(vector<int>& nums, int target) { int len = nums.size(); vector<vector<int>> ans; if(len < 4)return ans; sort(nums.begin(),nums.end()); int left; int right; int sum; for(int i = 0;i<len;i++){...
ALGO
0.99998
5.987712
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2021-01-13T18:05:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8df517c825e...
bb71da25-22c1-40fc-845d-aa83bdf8c8c4
gesandru/Taller-Proyecto-2025
src/Accel.cpp
#include "../include/Accel.hpp" Matrix& Accel(double x, Matrix Y){ tuple<double, double, double, double, double, double, double, double, double> result = IERS(eopdata,AuxParam.Mjd_UTC + x/86400.0,'l'); double x_pole = get<0>(result); double y_pole = get<1>(result); double UT1_UTC = get<2>(result); double LOD = get...
ALGO
0.951643
4.526818
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2025-03-28T08:51:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "dd0e361134f...
5b3813cb-f16a-4c02-b8aa-e8c696c64c66
shakilaust/Light-Oj-Solve
1188 - FAST QUERIES.cpp
//BISMILLAHIRRAHMANIRRAHIM /* manus tar shopner soman boro Author :: <NAME> .............AUST_CSE27......... prob :: Type :: verdict:: */ #include <bits/stdc++.h> #define pf(a) printf("%d\n",a) #define pf2(a,b) printf("%d %d\n",a,b) #define pfcs(cs,a) printf("Case %d: %d\n",cs,a) #define sc(a) scanf("%d",&...
ALGO
0.999406
3.771134
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2015-02-05T15:52:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 26, "forks": 23, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "398309b...
c6028534-9e87-4f6f-b261-4ca3b3646e7a
AdriaPriego/AoC
day9/part1.cpp
#include <iostream> #include <fstream> #include <vector> unsigned long search_last(std::vector<unsigned long> &disc) { while (disc.back() == -1) disc.pop_back(); unsigned long num = disc.back(); disc.pop_back(); return num; } void compact_disc(std::vector<unsigned long> &disc) { for (size_...
ALGO
0.999965
4.741269
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2024-12-01T10:22: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": "1cf43f07e1a...
7a9cb2c9-b9fb-4171-ba55-f4dce6830b6f
vutuanhai237/CourseMaterials
IT002-OOP/Đề thi thực hành/Love is war/Code.cpp
#include<iostream> #include<string> #include <vector> using namespace std; static int num_friends = 0; class Friend { public: string name; string loai; int age; virtual void Input() { cin >> name >> age; } virtual void Output() { cout << "Ten: " << name << ", tuoi: " << age; ...
ALGO
0.971088
3.197861
{ "github_metadata": { "branch": "master", "commit_count": 94, "repo_created_at": "2021-10-23T15:35:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 87, "forks": 46, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d3a4104...
1f227eab-595f-40a9-a9f4-4e3b23692683
saur1sh/leetcode-solutions
0932-monotonic-array/0932-monotonic-array.cpp
static const int fast_io = []() { std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); return 0; }(); class Solution { public: bool isMonotonic(vector<int>& nums) { bool inc = false; bool dec = false; int prev = nums[0]; for(int i = 1; i < nums.size(); i+...
ALGO
0.999987
5.887793
{ "github_metadata": { "branch": "main", "commit_count": 852, "repo_created_at": "2022-06-28T09:12: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": "27c85ce6a3...
06048a46-6426-41bd-887b-6bbbd70daecc
jopa1015161/DSA
DSA NOTES/SEARCHING.cpp
//binary search iterative method: #include <bits/stdc++.h> using namespace std; int shazam(int arr[],int n,int x) { int low =0,high = n-1; while(low<=high){ int mid = (low+high)/2; if(arr[mid]==x) { return mid; } else if(arr[mid]<x){ ...
ALGO
0.999965
5.298864
{ "github_metadata": { "branch": "main", "commit_count": 26, "repo_created_at": "2023-07-01T19:29: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": "9e31bf9d1b4...
e0707563-e6d0-48e0-8cd2-b970e2731d40
MohammadNizalMlna/2311102150_Mohammad_Nizal_Maulana
pertemuan2/unguided/unguided1.cpp
/* <NAME> - 2311102150 */ #include <iostream> using namespace std; int main(){ int panjangArray_150; // masukkan panjang array cout << "Masukkan panjang array: "; cin >> panjangArray_150; // Masukkan elemen-elemen array int Elemen_150[panjangArray_150]; for(int i=0; i<panjangArray_150; i+...
ALGO
0.9909
4.326116
{ "github_metadata": { "branch": "main", "commit_count": 33, "repo_created_at": "2024-03-06T07:47: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": "b5a507a2a8e...
19f7df2c-095c-4622-a50d-0077689e88df
VYCode-4065/DSA-CPP-Question
Array/RemoveDuplicateInSortedArray.cpp
/* Problem statement You are given a sorted integer array 'arr' of size 'n'. You need to remove the duplicates from the array such that each element appears only once. Return the length of this new array. Note: Do not allocate extra space for another array. You need to do this by modifying the given input arr...
ALGO
0.999872
5.77074
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2024-08-27T02:36: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": "9aa18326798...
be5cbefe-94df-4e21-9315-792e8412afec
Raemerrr/AlgorithmProblemsSolved
src/BOJ/22/09/BOJ_9934_완전 이진 트리_220902.cpp
#include <iostream> #include <vector> #include <cmath> using namespace std; int N; vector<int> v; vector<vector<int>> answer; void dfs(const int level, const vector<int> &arr) { if (level == N) { answer[level - 1].insert(answer[level - 1].end(), arr.begin(), arr.end()); return; } vector<i...
ALGO
0.999961
4.713392
{ "github_metadata": { "branch": "main", "commit_count": 174, "repo_created_at": "2021-12-03T15: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": "b04a1a8657...
9c119b69-a675-45c4-9ed3-68f7e36c3c0c
Bia103/Facultate
Anul2/Semestrul 1/Tehnici avansate de programare/Tema 3/Exercitiul 3/main.cpp
#include <bits/stdc++.h> using namespace std; int merge1(int a[], int v[], int s, int d); int merge(int a[], int v[], int s, int mij, int d); int mergeSort(int a[], int m) { int v[m]; return merge1(a, v, 0, m - 1); } int merge1(int a[], int v[], int s, int d) { int mij, contor = 0; if (d > s) { mij = (d + s) / ...
ALGO
0.999951
3.764888
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-03-25T22:43:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2a3dffe9f51b...
f8b80f9e-7703-4fca-ba56-fb565e683ae4
manasgupta15/DSA-C-
Binary Search/The Painter's Partition Problem-II.cpp
// Dilpreet wants to paint his dog's home that has n boards with different lengths. The length of ith board is given by arr[i] where arr[] is an array of n integers. He hired k painters for this work and each painter takes 1 unit time to paint 1 unit of the board. // Return the minimum time to get this job done if all...
ALGO
0.999963
6.344274
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2025-07-15T13:23: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": "b753cf1025f...
833fa5a0-967b-4a46-8c59-f0eedcf6255f
maciejKrasny/Saper
Saper/rules.h
#include <vector> #ifndef RULES #define RULES struct Field { bool ifBomb; bool ifFlagged; bool ifShowed; int nextBombAmount; }; struct GameOptions { int bombAmount, Height, Width; }; struct Game { GameOptions options; std::vector<std::vector<Field>> board; int shownAmount; int flagsAmount; }; struct XY { ...
TOOL
0.921833
4.156538
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-03-11T20:27: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": "f5e00334d5...
48ec6979-794c-4757-887a-25bb155f7ad5
namnh97/CCode
Algorithm_Training/Blue/Lecture14/7/main.cpp
//https://www.codechef.com/problems/BANKPASS #include<bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair #define pii pair<int, int> using namespace std; const int MAX = 26; struct Node { Node *child[MAX]; int countWord; }; Node* createNode() { Node *temp = new Node(); temp...
ALGO
0.999355
4.212825
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2019-01-15T07:28: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": "24e4eefbc2...
f5179650-7b8b-4497-8aac-88758644509c
dfsp-spirit/cpp_geodesics
src/meshneigh_edge/main_meshneigh_edge.cpp
// The main for the meshneigh_edge program. This main file uses the VCGLIB algorithm. // The program computes neighborhoods of vertices on meshes and saves them to files. // The neighborhood is defined by edge distance in the mesh (aka graph distance). #define APPTAG "[cpp_edge] " #define CPP_GEOD_DEBUG_LEVEL 5 // 2=...
ALGO
0.994763
3.859891
{ "github_metadata": { "branch": "main", "commit_count": 393, "repo_created_at": "2021-07-09T14:28:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9ec98a2bc1...
b53d9fc0-e5bd-4d6d-ba41-13b3ddb3ea23
jylin34/Introduction-to-Computer-Science-
Fall/Final/110403518/E1-110403518.cpp
#include<iostream> #include<vector> #include<array> #include<set> #include<map> #define vt vector #define pb push_back #define IO cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false) using namespace std; int n,t; void ducci(int u,int a[]) { for(int i=1;i<=u;i++) { int b[n]; for(int j=0;j<n;j...
ALGO
0.999943
3.309298
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2022-09-22T13:36:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d44db574ace...
9856809c-4bd9-445d-874e-9a2140753c5b
devos50/programmingchallenges
USACO/BrokenNecklace/main.cpp
/* ID: mdmarti1 PROG: beads LANG: C++ */ #include <iostream> #include <fstream> #include <string> using namespace std; int main() { ofstream fout ("beads.out"); ifstream fin ("beads.in"); int beads; fin >> beads; string s; fin >> s; s = s + s + s; cout << s << endl; /...
ALGO
0.999849
3.795114
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2015-01-19T18:27: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": "988228870f...
4928ca42-9100-452e-a856-b04a04fc440b
agraef/purr-data
externals/pix_opencv/pix_opencv_contours_convexhull.cc
//////////////////////////////////////////////////////// // // GEM - Graphics Environment for Multimedia // // <EMAIL> // // Implementation file // // Copyright (c) 1997-2000 <NAME>. // Copyright (c) <NAME>. // Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::für::umläute. IEM // Copyright (c) 2002 <NAME...
ALGO
0.991441
4.719033
{ "github_metadata": { "branch": "master", "commit_count": 5334, "repo_created_at": "2017-03-14T07:50:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 676, "forks": 88, "issues": 10, "pull_requests": 0 }, "file_meta": { "content_id": "ba2...
7c300192-be53-466e-aacf-c95de0ee1eaf
im2sh/BaekjoonCode
백준/Gold/32374. 선물 고르기/선물 고르기.cc
#include <iostream> #include <map> #include <vector> #include <algorithm> using namespace std; int N, K; vector<int> giftSize; vector<int> boxSize; void FastIO() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); } bool cmp(int a, int b) { return a > b; } void Init() { cin...
ALGO
0.999988
4.162662
{ "github_metadata": { "branch": "main", "commit_count": 1215, "repo_created_at": "2022-08-02T11:47:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5972cdf5f...
f5740529-0ac5-4369-8911-ff368cf33668
qdbgw3ihnjw/dnsProxy
inc/filter.h
#pragma once #ifndef __DNS_FILTER_H__ #define __DNS_FILTER_H__ #include "socketlite.h" #include <list> #include <algorithm> #include "json/json.h" #include "json/json-forwards.h" using namespace std; using namespace cpputility; typedef enum { clnd_protocol_inhiert = 0, clnd_protocol_tcp = 0x01, ...
TOOL
0.932015
4.256587
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-01-18T12:20:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2dfaaa33e7...
ac2c451c-c195-4b89-8fcd-efbabaa71303
OpenXRay/xray
SDK/boost_1_30_0/libs/graph/example/remove_edge_if_bidir.cpp
//======================================================================= // Copyright 1997, 1998, 1999, 2000 University of Notre Dame. // Authors: <NAME>, <NAME>, <NAME> // // This file is part of the Boost Graph Library // // You should have received a copy of the License Agreement for the // Boost Graph Library alon...
ALGO
0.998836
5.66926
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2019-03-21T12:57:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 104, "forks": 25, "issues": 0, "pull_requests": 3 }, "file_meta": { "content_id": "ecb4cf0a...
ec33919c-6101-48d5-8dda-3543e780c0be
Anthony-Christen/Labo08_Galton_Board
main.cpp
/* ------------------------------------------------------------------------------------- Fichier : main.cpp Nom du labo : Labo08_Galton_Board Auteur(s) : <NAME> & <NAME> Date : 13.01.2021 But : Demande à l'utilisateur une hauteur et un nombre de billes afin de simuler un plateau de Ga...
ALGO
0.978585
4.167401
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2022-01-11T14:38: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": "864633a34...
3e77da79-c84c-4453-b5b9-588e388d99c6
kelseykern/CodingQuestions
meta/answers/Meta_Test_Questions/Sorting/BalancedSplit.cpp
/*Balanced Split Given an array of integers (which may include repeated integers), determine if there's a way to split the array into two subsequences A and B such that the sum of the integers in both arrays is the same, and all of the integers in A are strictly smaller than all of the integers in B. Note: Strictly sma...
ALGO
0.999973
5.899677
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2024-02-21T22:37: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": "29c651845814...
3d90a97c-a70a-489f-a208-9ed230a30973
notjedi/cp
codeforces/longjumps.cc
#include<iostream> #include<vector> using namespace std; using ll = int64_t; vector<ll> DP; ll n = 0; ll solve(ll a[], ll i) { if (i >= n) return 0; if (DP[i] != -1) return DP[i]; DP[i] = a[i]; DP[i] += solve(a, i+a[i]); return DP[i]; } int main() { int t; cin >> t; ...
ALGO
0.999778
3.78688
{ "github_metadata": { "branch": "master", "commit_count": 67, "repo_created_at": "2021-03-18T08:21:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2d9aed8a8...
eba040c8-fbdc-416b-9b56-f00eb6c9f16b
Usstasikus/Algorithms_2017-18
MergeSort/main.cpp
#include "ReadWriter.h" #include "MergeSort.h" using namespace std; int main() { ReadWriter rw; int *brr = nullptr; int length; //Read length from file length = rw.readInt(); brr = new int[length]; rw.readArray(brr, length); //Start sorting MergeSort s; s.sort(brr, length)...
ALGO
0.999882
4.329766
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-06-07T08:42: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": "3e8973cb34...
afcd8915-9c97-4bc8-a2fa-57886c86b109
Vishal-Agarwal12/cp
DSU.cpp
// if vertices are labeled from 1 to N, then we make following changes DSU(int N) { father = vector<int>(N+1); size = vector<int>(N+1, 1); components = N; maxComponentSize = 1; for (int i = 1; i <= N; i++) { father[i] = i; } } ----...
ALGO
0.999833
4.888799
{ "github_metadata": { "branch": "main", "commit_count": 170, "repo_created_at": "2023-03-14T04:58: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": "2289e3d92f...
88fbf54e-8898-4f64-9114-79d7f0fb0125
Anubhav-Ghosh1/CodeChef
Till 1000/Genes.cpp
Problem Statement ------> Genes https://www.codechef.com/submit/GENE01?tab=statement #include <iostream> using namespace std; int main() { // your code goes here // r brown b blue g green char r,b; cin >> r >> b; if(r == 'R' && b == 'R') { cout << "R"; } else if(r == 'B' && b == 'R') { cout << "R"...
ALGO
0.999664
3.498465
{ "github_metadata": { "branch": "main", "commit_count": 39, "repo_created_at": "2022-07-19T10:21:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "22abe583c82...
1b383bd5-ae4a-4e13-9504-04e5b54b82a0
kalimero76/geocam
Geometry/Vertex/curvature_partial.cpp
#include "curvature_partial.h" #include "math/miscmath.h" #include <utility> #include <cstdio> //static const double PI = 3.1415926; typedef map<TriPosition, CurvaturePartial*, TriPositionCompare> CurvaturePartialIndex; static CurvaturePartialIndex* Index = NULL; CurvaturePartial::CurvaturePartial( Vertex& v, Vert...
ALGO
0.990279
6.248107
{ "github_metadata": { "branch": "master", "commit_count": 637, "repo_created_at": "2015-03-14T01:07:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "a0aabd94...
8a57d4ad-edc2-4df5-b978-3868aa3c45f7
leisheyoufu/study_exercise
algorithm/leetcode/2_Add_Two_Numbers/main3.cpp
/* 2. Add Two Numbers You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. You may assume the two numbers do not contain any leading zero, except the n...
ALGO
0.999989
5.58089
{ "github_metadata": { "branch": "master", "commit_count": 738, "repo_created_at": "2013-10-13T11:13:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 8 }, "file_meta": { "content_id": "e2978e24...
cfdc157f-d0e6-4147-b63b-3477ad5a3438
renanNun/Laboratorio-ED2
renan/ordenacao_1/main.cpp
#include <iostream> #include <fstream> #include <string> #include <sstream> #include <vector> #include "QuickSort.h" #include "ordenacaoParImpar.h" using namespace std; void imprime(int* vet, int tam){ for(int i=0; i<tam;i++){ cout << vet[i] << " "; } cout << endl; } int main(int argc, char *arg...
ALGO
0.999696
4.665925
{ "github_metadata": { "branch": "master", "commit_count": 55, "repo_created_at": "2019-08-07T17:10:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bbec6ad79...
ad99aa4d-f016-4acf-8ab2-f16275416689
Electro003/OOP-Anul-1
Lab3ex2/ConsoleApplication1/Main.cpp
// ConsoleApplication1.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> using namespace std; bool isodd(int x) { if (x % 2 == 0) return 0; return 1; } bool isprime(int x) { if (x == 2 || x % 2 == 0) return 0; for (int i = 3; i...
ALGO
0.99515
3.670642
{ "github_metadata": { "branch": "main", "commit_count": 29, "repo_created_at": "2022-02-24T06:22:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "14bc1acd222...
53ddd5fc-a58e-45c9-ac7a-d40dbded40aa
Muhammad-Shahroz-Siddiqui/Priority-Queue-Hashing
Q1.cpp
#include<iostream> #include<vector> #include<cmath> #include<string> using namespace std; template<typename k,typename i,typename o> struct Node { k key; i id; o op_type; public: Node() { } Node(k ky,i d,o type) { key = ky; id = d; op_type = type; } }; template<typename k,typename i,typ...
ALGO
0.986679
3.688762
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-05-18T16:21: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": "4802e13b633d...
a5fcbf94-2e40-4652-8780-4c6f4be3cabc
ericabuchanan/Merge
mergeAssignment.cpp
/************************************************* * <NAME> Merge Assignment * * ICS4U * * 21/04/2021 * * * * This program will read in ordered lists from * * two files, combine t...
ALGO
0.98663
4.95867
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2021-10-13T05:57: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": "23a12f5523bd...
79b726bc-fb02-4eb0-8f8b-393b6653ff9d
AkshatAggarwal14/Competitive-Programming
CSES/1669.cpp
#ifdef LOCAL #include "Akshat.hpp" #else #include "bits/stdc++.h" using namespace std; #define dbg(...) #endif using ll = long long; auto sz = [](const auto &container) { return int(container.size()); }; #define all(x) begin(x), end(x) const ll INF = 1e18; const ll N = 1e5 + 5; const ll MOD = 1e9 + 7; // 998244353 v...
ALGO
0.999965
4.670929
{ "github_metadata": { "branch": "master", "commit_count": 850, "repo_created_at": "2021-08-16T13:49:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "08105c7f...
72ce9ff8-f0b3-4503-a63f-afb8fd43d763
MinJunKKang/algorithm
백준/Silver/16401. 과자 나눠주기/과자 나눠주기.cc
#include <iostream> #include <vector> #include <algorithm> typedef long long ll; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ll M, N; cin >> M >> N; vector<ll> L(N); for (int i = 0; i < N; i++) cin >> L[i]; sort(L.begin(), L.end(...
ALGO
0.999998
4.210278
{ "github_metadata": { "branch": "main", "commit_count": 230, "repo_created_at": "2024-05-24T08:45:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2a19ea0453...
b991f00e-6dab-41d0-a2c8-cdf8b8955eaf
quanglm1998/competitive-programming
codeforces/1340/d.cpp
#include <bits/stdc++.h> using namespace std; const int N = 100010; int n; vector<int> adj[N]; vector<pair<int, int>> ans; void dfs(int u, int p, int val) { ans.push_back({u, val}); for (int i = 0; i < adj[u].size(); i++) { if (adj[u][i] == p) { adj[u].erase(adj[u].begin() + i); ...
ALGO
0.999939
4.074698
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2022-04-23T08:04:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d4d579805b...
be709912-8db9-486f-8947-fdaa4a28541d
imicola/Questions-and-Impressions
main/newcow牛客/other/小红的_01_串_四.cpp
//#pragma GCC optimize(3) #include <bits/stdc++.h> //#define int LL #define endl '\n' #define size_t int #define all(v) v.begin(), v.end() using namespace std; typedef long long LL; typedef vector<int> vint; typedef vector<vint> vvint; typedef vector<string> vstr; typedef pair<int, int> pii; typedef vector<pii> vpii; ...
ALGO
0.999909
3.62413
{ "github_metadata": { "branch": "LuoGutest/main", "commit_count": 160, "repo_created_at": "2024-09-08T11:43:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "...
1aade633-123a-4dfa-b1a8-9515de585302
projeto-de-algoritmos/GrafosII_Kruskei
Flights_csv/kruskal_flights.cpp
#include <iostream> #include <fstream> #include <string> #include <utility> #include <map> #include <set> #include <vector> #include <algorithm> std::map<std::string, int> dict; std::map<int, std::string> access; class UnionFind { private: std::vector<int> parent, rank; public: UnionFind(int N) { rank.assign(N+1...
ALGO
0.999547
4.654738
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2019-09-16T00:48:21.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "aef28b26373...
91d3ca34-02b7-4d95-afda-3527e6ab874e
colemickens/platform2-sommelier
kerberos/config_validator.cc
// Copyright 2019 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "kerberos/config_validator.h" #include <vector> #include <base/stl_util.h> #include <base/strings/string_split.h> namespace kerberos { name...
CONFIG
0.92999
7.646567
{ "github_metadata": { "branch": "master", "commit_count": 27139, "repo_created_at": "2019-02-17T05:44:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 6, "issues": 2, "pull_requests": 2 }, "file_meta": { "content_id": "407b34...
7f02886c-c641-4789-bbc4-50a57770f02d
crispy-coffee/Coding-with-babbar-DSA
94 Shotest path in DAG.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long class Graph { public: unordered_map<int, vector<pair<int, int>>> adj; void addEdge(int u, int v, int weight) { adj[u].push_back({v, weight}); } void printing() { for (auto i : adj) { cout <...
ALGO
0.99998
4.840319
{ "github_metadata": { "branch": "master", "commit_count": 108, "repo_created_at": "2022-08-10T15:00:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "e3afa414...
86333378-1e5b-4001-b2c3-7e4b4e33d8a7
squaresLab/BatFix
results/transcoder/translations/py/FIND_BITONIC_POINT_GIVEN_BITONIC_SEQUENCE.cpp
int binarySearch ( int arr [ ] , int left , int right ) { if ( ( left <= right ) && ( left <= right ) ) { int mid = ( left + right ) / 2 ; ; if ( ( arr [ mid - 1 ] < arr [ mid ] && arr [ mid ] > arr [ mid + 1 ] ) || ( arr [ mid ] < arr [ mid + 1 ] ) ) returnmid ; if ( ( arr [ mid ] < arr [ mid + 1 ] )...
ALGO
0.99995
4.593741
{ "github_metadata": { "branch": "main", "commit_count": 26, "repo_created_at": "2023-05-21T15:21:59.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7176c1d2b749...
1cf9f29f-815c-49cf-8f20-59524d3e065e
llvm/llvm-project
clang/include/clang/Tooling/JSONCompilationDatabase.h
//===- JSONCompilationDatabase.h --------------------------------*- C++ -*-===// // // 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.915671
7.504323
{ "github_metadata": { "branch": "main", "commit_count": 545188, "repo_created_at": "2016-12-07T09:39:33.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 33545, "forks": 14484, "issues": 5000, "pull_requests": 5000 }, "file_meta": { "content_...
0c75cca2-117c-46f3-bc65-209ffcc9e74a
pushrsp/Algorithm
백준/Gold/2170. 선 긋기/선 긋기.cc
#include <iostream> #include <algorithm> #include <vector> using namespace std; int N; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> N; vector<pair<int, int>> lines(N); for (int n = 0; n < N; ++n) { cin >> lines[n].first >> lines[n].second; ...
ALGO
0.999984
4.577663
{ "github_metadata": { "branch": "main", "commit_count": 1110, "repo_created_at": "2022-05-23T09:32: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": "0b9d6dc33...
1dcc40f9-0b71-4410-9f89-044835ffd914
VAR-solutions/Algorithms
Dynamic Programming/common sub sequence/cpp/CommonSubSeq.cpp
/* Implementation of LCS problem using Dynamic Programming*/ #include <bits/stdc++.h> using namespace std; void lcs(string X, string Y){ int m = X.length(); int n = Y.length(); int L[m+1][n+1]; for (int i=0; i<=m; i++){ for (int j=0; j<=n; j++){ if (i == 0 || j == 0) L[i][j] = 0; else...
ALGO
0.999997
4.750319
{ "github_metadata": { "branch": "dev", "commit_count": 1862, "repo_created_at": "2018-10-01T20:50:24.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 777, "forks": 1006, "issues": 12, "pull_requests": 603 }, "file_meta": { "content_id": "df6...
2b4178c7-3311-4228-88b5-c634cbbc8b6e
yuhrtz5183/CS303-Assignment1
CS303 Assignment 1/CS303 Assignment 1.cpp
#include <iostream> #include <fstream> #include "functions.h" using namespace std; int main() { ifstream myFile("data.txt"); // opens the file "data.txt" to read int array[999]; // array max of 999 int arrMaxIndex = 100; // current array has an index of 100 int count = 0; int nu...
ALGO
0.914068
3.740483
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2023-09-12T04:45: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": "9680fda852...
f01fa63b-85bc-476e-8b30-88e7988742e8
cholandy/algorithms
Algorithm and Data Structure/Baekjoon/3000번대/03000번대/03023번 마술사 이민혁/boj3023_crocus.cc
#include <iostream> #include <cstdio> #include <string> #include <algorithm> using namespace std; string str[105]; int main() { int n, m; scanf("%d %d", &n, &m); int nn = n * 2 - 1; for (int i = 0; i < n; i++) { cin >> str[i]; string tmp = str[i]; reverse(tmp.begin(...
ALGO
0.999947
3.417862
{ "github_metadata": { "branch": "master", "commit_count": 276, "repo_created_at": "2021-08-06T01:17:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7ca56ee2...
71da0a8a-072e-465e-974a-de9676cfd6f0
cyscgzx33/Leetcode-Practice
Others/Leetcode_Contest/maximum_performace_of_a_team.cpp
#include <utility> // pair #include <vector> // vector #include <algorithm> // sort() #include <queue> // priority_queue, greater() #include <cmath> // pow() using namespace std; /* Method 1: TLE (because of repeatedly initializing the min_heap) */ class Solution { public: static bool ...
ALGO
0.999923
6.087293
{ "github_metadata": { "branch": "master", "commit_count": 266, "repo_created_at": "2018-08-31T18:59:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3557affd...
64ac5cbc-802b-4049-8574-d70251d544b1
hahaXD/psdd
include/htd/HypertreeDecompositionAlgorithm.hpp
/* * File: HypertreeDecompositionAlgorithm.hpp * * Author: <NAME> (<EMAIL>) * * Copyright 2015-2017, <NAME> * E-Mail: <<EMAIL>> * * This file is part of htd. * * htd is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Fr...
ALGO
0.90136
6.614201
{ "github_metadata": { "branch": "master", "commit_count": 56, "repo_created_at": "2018-04-06T04:34:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 7, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "e57b45e2b...
badc021c-a720-4f45-aad4-d6d9a486db2c
AyushSri19-777/Coding-2020
Data Structures/Trees/binary_tree.cpp
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; class node { char info; node *lcl,*rcl; public: node *createbt(node *); void inorder_rec(node *); void preorder_rec(node *); void postorder_rec(node *); void display(node *,int); int cnleaf(node *,int); b...
ALGO
0.999725
3.833997
{ "github_metadata": { "branch": "master", "commit_count": 127, "repo_created_at": "2020-04-29T09:02:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1cf95bc2...
82385d5a-1864-44a2-ab97-42a25b9475c6
raghuvanshraj/Competitive-Programming-Archive
Coding Ninjas/even_odd.cpp
#include <bits/stdc++.h> using namespace std; struct Count { int evenCount = 0; int oddCount = 0; }; void buildTree(int *arr, Count *tree, int node, int start, int end) { if (start == end) { if (arr[start] % 2 == 0) { tree[node].evenCount = 1; } else { tree[node].oddCount = 1; } return; } ...
ALGO
0.999876
5.141502
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2020-09-15T07:44:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2cfcbaf53...
39821e2b-e26a-4c44-8e5e-d765478d5ccd
susantabiswas/epi-solutions
BST/check_if_BST.cpp
/* Given a binary tree, check if it is a BST. Solution: There are multiple ways of doing this: 1. Do inorder traversal of the tree, check if each element is greater than its previous element or not. Inorder traversal of a BST is a sorted array. 2. For each root, there...
ALGO
0.999984
6.545306
{ "github_metadata": { "branch": "master", "commit_count": 344, "repo_created_at": "2018-08-04T13:45:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 21, "forks": 7, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "17f899d...
e212755e-af06-49fa-b6e0-2967ec852ab6
nenoganchev/advent-of-code-2021
day17/part1.cpp
#include <iostream> #include <fstream> #include <iomanip> #include <vector> #include "string_utils.h" using namespace std; const int target_x_min = 282; const int target_x_max = 314; const int target_y_min = -80; const int target_y_max = -45; vector<int> test_y_velocity(int y_velocity); bool can_hit_x_in_steps(const...
ALGO
0.998701
4.546054
{ "github_metadata": { "branch": "main", "commit_count": 31, "repo_created_at": "2021-12-01T21:45: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": "5c38745027e...
8e113516-d1f5-4255-9e2a-fb455aa4648a
TaoSama/ICPC-Code-Library
2015 Training/Training Contest/Training Contest 4 - Old Pros/I.cpp
// // // // Created by TaoSama on 2015-03-29 // Copyright (c) 2015 TaoSama. All rights reserved. // #include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <string> #include <set> #i...
ALGO
0.999839
3.94619
{ "github_metadata": { "branch": "master", "commit_count": 191, "repo_created_at": "2016-03-24T05:56:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "458ec2bf...
306eca76-f261-4623-8c92-6c13c6eb1cd7
mkazhdan/ShapeSPH
SignalProcessing/Fourier.h
/* Copyright (c) 2013, <NAME> 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, this list of conditions and the following disclaimer....
ALGO
0.993701
6.158645
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2016-01-05T14:18:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 77, "forks": 27, "issues": 8, "pull_requests": 0 }, "file_meta": { "content_id": "bf9886b...
ec2c31c9-531c-43bd-9047-adc78d89115f
luisontaneda/option_pricing_pybind11
pricing_algorithms/COS_method/American/cos_bermudan.cpp
#include <Eigen/Dense> #include <boost/math/tools/roots.hpp> #include <cmath> #include <complex> #include <iostream> #include <random> // #include "asian_cos_pricing.h" #include "../../helper_functions/h_f_1.h" using namespace std; Eigen::VectorXcd circularConvolution(const Eigen::VectorXcd& m, ...
ALGO
0.999969
5.385018
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2024-06-23T17:47:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a84287a438a...
6be15075-7049-4602-816a-2a79f4e2a328
chivalry123/otkpp
otkpp/linalg/LBFGSUpdater.cpp
#include "cholesky.hpp" #include "LBFGSUpdater.h" #include <boost/numeric/ublas/io.hpp> LBFGSUpdater::LBFGSUpdater(int n, int m) : n_(n), m_(m), invD_(zero_matrix< double >(m, m)), I_(identity_matrix< double >(n)), L_(zero_matrix< double >(m)), S_(zero_matrix< double >(n, m)), sqrtD_(zero_matrix< double...
ALGO
0.999878
5.733808
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2015-05-07T15:59:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e0c0ec278...
8b065c95-0f80-4826-8bb4-605a773368b1
pbialon/asd
egzaminy/kon.cc
#include <cstdio> #include <iostream> #include <numeric> #include <algorithm> #include <utility> #include <string> #include <vector> #include <map> #include <set> #include <queue> #include <stack> using namespace std; typedef vector<int> VI; typedef vector<VI> VVI; typedef long long LL; typedef pair<int, int> PI; typed...
ALGO
0.999872
4.002706
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2017-03-07T23:12:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8fe161f9a6...
8e984431-e888-4e51-ba54-42b96713fe8e
axelacu/ppc-projet
Composant3/Block_old.cpp
#include <iostream> #include <string> #define HEADER_BLOC 50 #define TRANSACTIONS 500 #define PREV_BLOCK_HASH 250 class Block{ private : char header[ HEADER_BLOC ]; private : char transactions[ TRANSACTIONS ]; private : char prev_block_hash[ PREV_BLOCK_HASH ]; private : int nonce; public : char * getHeader(); pub...
ALGO
0.992589
4.320575
{ "github_metadata": { "branch": "master", "commit_count": 85, "repo_created_at": "2020-05-21T10:53:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e0a7f2299...
43e258b9-89b7-4e51-877f-5e52762553c4
rambabuwhy/cpp-problems
LeetCode/235. Lowest Common Ancestor of a Binary Search Tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) { //...
ALGO
0.999989
6.754281
{ "github_metadata": { "branch": "master", "commit_count": 904, "repo_created_at": "2017-01-30T11:23:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7761245f...
0cc1cba0-4ce9-439a-b36c-e6553152a122
profornnan/Problem-Solving
BOJ/시뮬레이션/3190-뱀.cpp
#include <iostream> #include <map> #define sws ios::sync_with_stdio(false), cin.tie(NULL) using namespace std; int dx[] = { 1, 0, -1, 0 }; // R, U, L, D int dy[] = { 0, -1, 0, 1 }; int n, k, l; int board[102][102]; struct Snake { int y, x, dir, time; Snake(int y, int x) { this->y = y, this->x = x, this->dir = 0,...
ALGO
0.999946
3.877254
{ "github_metadata": { "branch": "master", "commit_count": 725, "repo_created_at": "2020-04-01T03:12: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": "3a747087...
c938806f-5071-4a4d-bcbf-8475145c59f7
jclayton7/Department-of-Defense-AGILE-Project---Triangle-Counting
graph.cpp
// File: graph.cpp // Author: Dr. <NAME>, <NAME>, <NAME>, <NAME>, <NAME> // Date: 1/31/22 // Pupose: This program will recieve a graph and will create a list of all the vertices // and will list all the vertices adjacent to each vertex. // The both the list and the lists of adjacent vertices will be dynamically allocat...
ALGO
0.999236
4.482434
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2023-12-31T00:40: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": "4d108a61e10...
23f68522-d660-4f94-8f10-5d9f00d45ca0
alok-96/CodeForces
Word_Game.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; map<string, int> mp; string s1[n]; for (int j = 0; j < n; j++) { cin >> s1[j]; mp[s1[j]]++; } string s2[n]...
ALGO
0.999448
3.905193
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2022-08-11T12:46: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": "e00e771aa0f...
4fb39347-c33d-41e1-8792-2bc7ab76d7ab
loressa/LArContent-1
larpandoracontent/LArTrackShowerId/BranchGrowingAlgorithm.cc
/** * @file larpandoracontent/LArTrackShowerId/BranchGrowingAlgorithm.cc * * @brief Implementation of the branch growing algorithm base class. * * $Log: $ */ #include "Pandora/AlgorithmHeaders.h" #include "larpandoracontent/LArHelpers/LArClusterHelper.h" #include "larpandoracontent/LArTrackShowerId/Bra...
ALGO
0.97317
6.588799
{ "github_metadata": { "branch": "EnergyKickVertexSelectionFix", "commit_count": 1302, "repo_created_at": "2017-04-25T15:36:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { ...
29defd86-68c9-41a7-95a8-a0689f4d863a
JoraXD/TOP-P22-C
04_28/easy.cpp
#include <iostream> #include <random> #include <vector> void first(int arr[],int size){ int summ=0; for(int i=0;i<size;i++){ summ=arr[i]+summ; } std::cout<<summ<<"\n"; } void second(int arr[],int size){ int max=-999; for(int i=0;i<size;i++){ if(arr[i]>max){ max=arr[i]...
ALGO
0.986425
3.195537
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2023-01-29T18:47: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": "b99d13b1e00...
6a92599b-b1e3-428b-9226-20acc66682b2
dev-mirzabicer/cc-simpler
MainController/src/PathPlanning/GlobalPathPlanner.cpp
#include "GlobalPathPlanner.h" #include <algorithm> #include <cmath> // Constructor GlobalPathPlanner::GlobalPathPlanner() { // Initialize occupancy grid with free space // Initially empty; will be updated from remote computer } // Initialize Global Path Planner void GlobalPathPlanner::init() { // Any add...
ALGO
0.995012
5.415684
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2024-12-03T00:28:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2ca32902e13...
19637620-d9ba-41be-9cd4-6ffd1cfbee3d
ishandutta2007/codeforces-m
mip182/normal/1499/E.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define mii map <int, int> #define mll map <ll, ll> #define pii pair <int, int> #define pll pair <ll, ll> #define vi vector <int> #define vd vector <double> #define vll vector <ll> #define fi first #define se second #define si set...
ALGO
0.999974
4.55768
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-06-06T01:03:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bd217dfbb893...
a1ca2cb7-6c13-4e3b-9d09-897507ab5d30
liv1n9/competitive-programing
codeforces/1228/d.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 8; int color[N]; int p[N]; bool changed[N]; vector<int> G[N]; bool ok = true; void bfs(int u) { color[u] = 1; queue<int> q; q.push(u); while (!q.empty()) { u = q.front(); q.pop(); for (int v: G[u]) { ...
ALGO
0.999971
4.675283
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-10-20T00: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": "391cf86757...
a879cb0c-843a-432f-bc38-5f27bf89a695
ishandutta2007/codeforces-a
amethyst0/normal/804/D.cpp
/*AMETHYSTS*/ #pragma comment(linker, "/STACK:1000000000") #include <cstdio> #include <iostream> #include <ctime> #include <string> #include <vector> #include <cmath> #include <algorithm> #include <cstring> #include <set> #include <cstdlib> #include <ctime> #include <cassert> #include <bitset> #include <fstream> #inclu...
ALGO
0.999752
3.608625
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-11T00:51: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": "442537b0bfba...
14636f5a-8809-42a4-93d2-0dfb965f0adb
alexandraback/datacollection
solutions_2645486_0/C++/JohnySebb/energy.cc
/* * ===================================================================================== * * Filename: energy.cc * * Description: Energy * * Version: 1.0 * Created: 04/27/2013 04:12:11 AM * Revision: none * Compiler: gcc * * Author: <NAME> (), <EMAIL> * ...
ALGO
0.999757
3.682325
{ "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": "5a479021a...
060ce15b-8079-4b97-8011-97f2d89b3610
humbertodias/challenges
uri/7 - Graphs/1956/Main.cpp
#include <cstdio> #include <cstring> #include <map> #include <queue> #include <vector> #include <iostream> #include <set> #include <algorithm> //sort #define D(x) cout << #x " = " << (x) << endl #define endl '\n' using namespace std; const int MN = 10001; int p[MN]; struct edge { int from, to, w; edge() {} ed...
ALGO
0.999652
3.851583
{ "github_metadata": { "branch": "master", "commit_count": 44, "repo_created_at": "2017-06-19T07:37:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a1f99cb8c...
2bb16eac-cd1b-4b9d-9dca-07dac401cb73
jtlap/nt2
modules/boost/simd/sdk/include/boost/simd/sdk/simd/details/max_value.hpp
//============================================================================== // Copyright 2003 - 2012 LASMEA UMR 6602 CNRS/Univ. Clermont II // Copyright 2009 - 2012 LRI UMR 8623 CNRS/Univ Paris Sud XI // Copyright 2012 - 2014 MetaScale SAS // // Distributed under the Boost...
ALGO
0.994588
7.051474
{ "github_metadata": { "branch": "master", "commit_count": 14374, "repo_created_at": "2010-11-02T16:07:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 40, "forks": 39, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9aac...
4de0efd0-10df-4f47-8816-d8a9ecf4d4a0
morisgomez/ECC_CSCI_2_Week_10_Lab_Static_Queue
ECC_CSCI_2_Week_10_Lab_Static_Queue/ECC_CSCI_2_Week_10_Lab_Static_Queue/Static_Queue.cpp
/* Program Name: Static_Queue.cpp Programmer: <NAME> Date: Tuesday 04/14/2024 Version Control: 6.0 About: Week 10, CSCI 2, Lab. Description: Write a program that reads 2 sentences & reads them into 2 separate queues. The program should then determine whether the sentences are identical by comparing the charac...
ALGO
0.997392
4.939686
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-04-19T03:37:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0a5cae4178fc...
e185fc8f-ccec-453f-afbb-551bdab7a8d2
KurtBoehm/stado
include/stado/vector/native/operations/u32x08.hpp
#ifndef INCLUDE_STADO_VECTOR_NATIVE_OPERATIONS_U32X08_HPP #define INCLUDE_STADO_VECTOR_NATIVE_OPERATIONS_U32X08_HPP #include "stado/defs.hpp" #include "stado/instruction-set.hpp" #include "stado/mask/base.hpp" #include "stado/vector/native/operations/i32x08.hpp" #include "stado/vector/native/types/base-256.hpp" #inclu...
TOOL
0.905423
7.302539
{ "github_metadata": { "branch": "main", "commit_count": 33, "repo_created_at": "2025-05-22T05:20: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": "f28d42dd707...
ea9c5e9b-bdbb-4d21-8133-5e028dd770b9
ideepankarsharma2003/PrepCode
CompetetiveProgramming/2022/Practice/Nancy/LastOccurance.cpp
#include<iostream> using namespace std; int FirstOccurrence(int arr[] , int n, int ele) // arr ----> array // n ----> number of elements in arr // ele -----> element to be rearched { int l=0, u=n-1; int mid=(l+u)/2; int ans=-1; // by default !! while(l<=u) { if(arr[mid]==ele) { ...
ALGO
0.99983
4.954667
{ "github_metadata": { "branch": "cp", "commit_count": 198, "repo_created_at": "2022-02-02T11:54:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5c3733730a64...
7675be6a-76c0-4c96-aa2a-5125040cccc2
llynv/CP-files
1638E.cpp
/* Code by: linvg Created: 07.11.2024 05:00:20 */ #include <bits/stdc++.h> using namespace std; #define int long long #define all(x) (x).begin(), (x).end() #define sz(x) ((int)(x).size()) string to_upper(string a) { for (int i = 0;i < (int)a.size();++i) if (a[i] >= 'a' && a[i] <= 'z') a[i] -= 'a' - 'A'; return a...
ALGO
0.992439
5.796085
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2023-05-26T04:12: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": "5070cd5ce9a...
70648b8f-aaa5-49d2-ac7c-b452a3492bbd
jjaehwi/Algorithm_Test
백준/DFS&BFS/2206.cpp
// 벽 부수고 이동하기 G3 // 그래프 탐색, bfs #include <iostream> #include <cstring> #include <algorithm> #include <queue> using namespace std; #define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define MAX_SIZE 1001 int N, M, ans; char map[MAX_SIZE][MAX_SIZE]; int visited[MAX_SIZE][MAX_SIZE][2]; struct p...
ALGO
0.999978
3.998599
{ "github_metadata": { "branch": "main", "commit_count": 443, "repo_created_at": "2022-12-14T16:48:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4dec54ca6c...
6f21df0e-eadd-42c8-91b8-a5ed6d1b0d1b
ishandutta2007/codeforces-e
ecnerwala/normal/1192/C.cpp
#include<bits/stdc++.h> using namespace std; template <int MOD_> struct modnum { static constexpr int MOD = MOD_; static_assert(MOD_ > 0, "MOD must be positive"); private: using ll = long long; int v; static int minv(int a, int m) { a %= m; assert(a); return a == 1 ? 1 : int(m - ll(minv(m, a)) * ll(m) / ...
ALGO
0.999775
4.389483
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:34:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8f0f1af18cc0...
874f34b8-8e76-466f-b3ce-cc21ee95cffe
hokein/leetcode
src/LRU_Cache.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <vector> #include <algorithm> #include <map> using namespace std; typedef unsigned long long ull; typedef long long ll; // LRU Cache implementation // // stl::map + double_linked_list // O(log(n)) class LRUCache{ public: struct No...
ALGO
0.998495
3.69115
{ "github_metadata": { "branch": "master", "commit_count": 117, "repo_created_at": "2014-01-21T14:34:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9b52255b...
94e0e3a9-fee1-4491-9096-eb36f2862e4d
cv-rmvl/rmvl
extra/feature/src/anchor/square.cpp
/** * @file square.cpp * @author zhaoxi (<EMAIL>) * @brief 矩形轮廓特征点检测 * @version 1.0 * @date 2025-02-06 * * @copyright Copyright 2025 (c), zhaoxi * */ #include <opencv2/imgproc.hpp> #include "rmvl/algorithm/math.hpp" #include "rmvlpara/feature/anchor.h" #include "anchor_def.hpp" namespace rm { /** * @brie...
ALGO
0.997615
6.119571
{ "github_metadata": { "branch": "2.x", "commit_count": 356, "repo_created_at": "2023-08-16T17:14:53.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 88, "forks": 16, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "16450798bc...
76be0e2c-c82e-4929-bdf0-f1474de0df46
den3yb/Aisd-2.1
TreeSearch.cpp
#pragma once #include <iostream> #include <random> using namespace std; namespace spisok { struct node { int _val; node* _left; node* _right; node(int val) { _val = val; _left = nullptr; _right = nullptr; } node(int val, node* left, node* right) { _val = val; _left = left; _right = right; } ~node() {} }...
ALGO
0.999347
3.955234
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-04-16T12:29:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cb4e960a4ab0...
359c260d-bea6-4466-a51c-2250b97802af
irajatpandey/Practice
BinaryTree_new/Type-5/ToSumTree.cpp
#include <bits/stdc++.h> using namespace std; template<typename T> class BinaryTree{ public: int data; BinaryTree<T> *left, * right, *rightNext; BinaryTree(T data){ this -> data = data; left = NULL; right = NULL; rightNext = NULL; } }; BinaryTree<int> *takeInput(){...
ALGO
0.999984
4.651996
{ "github_metadata": { "branch": "master", "commit_count": 42, "repo_created_at": "2020-04-26T10:15: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": "dea35f853...
8681dda7-ab5e-46e8-b7d7-ec53eaec02e7
sgovil5/competitive-programming
CodeForces/1700/1474C.cpp
#include<iostream> #include <set> #include <algorithm> using namespace std; int t; multiset<int> m; bool check(int start){ multiset<int> temp; for(auto elem: m) temp.insert(elem); bool possible = true; while(temp.size()>0){ int currMax = *prev(temp.end()); temp.erase(prev(temp.end())...
ALGO
0.99998
3.421191
{ "github_metadata": { "branch": "main", "commit_count": 257, "repo_created_at": "2020-11-26T20:37:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7205977813...
56f2afa7-48fc-4f9c-ae12-fd47b11550e0
neal2018/oj_env
codeforces/805/g.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); int n; cin >> n; vector<vector<int>> g(n); for (int i = 0, u, v; i < n - 1; i++) { cin >> u >> v, u--, v--; g[u].push_back(v), g[v].push_back(u); } int root = 0, cur = 0; v...
ALGO
0.999843
5.1461
{ "github_metadata": { "branch": "master", "commit_count": 175, "repo_created_at": "2021-08-18T06:24:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bbb25bda...
661ffbe8-3efb-4c17-aebf-835e3152354a
Johnson-Wang/RayTracePhononC
object.cpp
#include <iostream> #include "object.h" #include <vector> #include <cmath> #include <cstdlib> #include<ctime> #include "matrix.h" using namespace std; void swap(double& i, double& j){ double tmp = i; i = j; j = tmp; } double randomNumber(){ return (double) rand() / RAND_MAX; } Vec3 randomEmitSpace(){ double th...
ALGO
0.943728
3.487574
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2017-07-14T07:31:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "69be7740b2...
1476e1a2-b213-4ebc-ba89-1eabbd944d96
Quiji18/Proyecto_De_Logicas
funProyect.h
#include <iostream> using namespace std; namespace funPro{ bool pq(int q, int prop){ bool val = false; if(prop==2&&(q==1||q==3)){ val = true; }else if(prop==3&&(q==2||q==3||q==6||q==7)){ val = true; }else if(prop==4&&(q==4||q==5||q==6||q==7||q==12||q==13||q==14||q==15)){ val = t...
ALGO
0.965546
3.318576
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2023-05-06T18:19: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": "7508423373b...
7e1105cf-6666-49c0-ad2d-cc29be20387f
maa-zzz/LeetCode-Solutions-CPP-
662-maximum-width-of-binary-tree/662-maximum-width-of-binary-tree.cpp
#define ull unsigned long long class Solution { public: int widthOfBinaryTree(TreeNode* root) { ull maxWidth = 0; // queue's element will be pair<TreeNode*, int> // first attribute will be storing TreeNode* and int will be the index of the node at particular level queue<pair<TreeNode*, int>> q; ...
ALGO
0.999906
5.810907
{ "github_metadata": { "branch": "main", "commit_count": 2518, "repo_created_at": "2022-06-15T17:35:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "278e4c50d...
e023d5dc-d20b-4fdd-86e5-6cd750e13881
jonatas57/maratona
lib/strings/suffixAutomaton2.cpp
struct sufAuto { struct state { int id = 0, len = 0, link = -1; bool end = false; map<char, int> next; int& operator[](char c) { return next[c]; } }; vector<state> ss; int size; sufAuto() : ss(1), size(1) {} void addString(string& s) { int at = 0; each(c, s) { a...
ALGO
0.99988
4.376677
{ "github_metadata": { "branch": "master", "commit_count": 225, "repo_created_at": "2019-02-13T13:09:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "948a8f85...
0d57a57d-3d99-43a3-95a1-927c587f9c66
wfnuser/leetcode
466.getMaxRepetitions.cpp
class Solution { public: int getMaxRepetitions(string s1, int n1, string s2, int n2) { vector<int> repeatCnt(n1 + 1, 0); vector<int> nextIdx(n1 + 1, 0); int j = 0, cnt = 0; //k表示段数,i表示s1的下标,j表示s2的下标 for(int k = 1; k <= n1; k ++){ for(int i = 0; i < s1.size(); i ++...
ALGO
0.999972
5.062178
{ "github_metadata": { "branch": "master", "commit_count": 795, "repo_created_at": "2018-07-31T03:15:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 45, "forks": 14, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "5e41fd...
ffbcbed9-038c-4104-9107-1c4f3aa8ba25
anmolahuja03/Data-Structures-Algorithms
5-Searching/SquareRoot.cpp
class Solution { public: int mySqrt(int x) { //Approach 1 - Inbuilt function // int ans = sqrt(x); // return ans; //Approach 2 - Naive solution , TC = O(sqrtx) // long long i = 1; // long long sqrt = i * i; // while(sqrt <= x){ // i++; ...
ALGO
0.99999
5.328651
{ "github_metadata": { "branch": "main", "commit_count": 56, "repo_created_at": "2021-05-14T19:10:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5c04593c57a...
83dd793d-9328-452d-8a46-ce7757816672
HenriqueBS0/OpenMP-02
multipicacao-matriz.cpp
#include <stdio.h> #include <omp.h> #define N 4 // Dimensão das matrizes void print_matrix(int matriz[N][N]) { for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { printf("%d ", matriz[i][j]); } printf("\n"); } } int main() { int matriz_a[N][N], matriz_b[N][N],...
ALGO
0.999974
4.896163
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-08-05T14:23: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": "042a378f4a62...
4939ee65-91f9-4ff6-ad71-a2676771772c
apache/doris
be/src/vec/exprs/vin_predicate.cpp
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may...
TOOL
0.94036
7.773411
{ "github_metadata": { "branch": "master", "commit_count": 26499, "repo_created_at": "2017-08-10T12:13:30.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 13962, "forks": 3497, "issues": 2697, "pull_requests": 616 }, "file_meta": { "content_i...
f85e08b9-672b-4feb-b33e-2dd4805142b1
syc0415/2021_NCTU_OOP
lab7.cpp
#include <iostream> using namespace std; struct Node { int val; Node *next; Node() : val(0), next(nullptr) {} Node(int x) : val(x), next(nullptr) {} }; class LinkedList { public: Node *root; int len; LinkedList() : root(nullptr), len(0) {} void push(int); void insert(int, int); ...
ALGO
0.999769
3.95231
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2023-02-05T11:28: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": "a0a54935752d...
7358d57b-a6cf-4e56-a83c-c4bbf38a8a80
lyccrius/OI-Solution
UOJ/#327. 【UTR #3】去月球 36.cpp
#include "mythological.h" #include <stack> typedef std::stack<int> sic; const int maxN = 1e5; const int logN = 17; namespace ns { int n; int t; int a[maxN + 10]; } namespace subtask { namespace _1 { void init() { return; } int query(int l, int r) { si...
ALGO
0.999868
4.510071
{ "github_metadata": { "branch": "main", "commit_count": 653, "repo_created_at": "2022-09-28T05:47:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "debcd93445...
d0fa6338-1d59-40cb-acd4-2a3d95b4e1f0
victbr/Helloworld
cpu/code/pid.cpp
#include <iostream> #include <ctime> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include "BOBHash32.h" #include "detect.h" #include "packet.h" static const int N = 200, M = 800; /* enum ErrorType { NO_ERROR, PROC_ID_CONFLICT, HASH_COLLISION }; */ inline bool fake(){ int u = rand()%100; return ...
ALGO
0.98517
3.688049
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2020-09-05T14:19: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": "37dc4b6af2...
a83bff8f-2387-424d-bd8e-b25e741dd9d7
M7-TROJAN/c_Examples
Comparison_Operators.cpp
/* Operators & Operands "Symbols To Operate On Data" - Comparison Operators "For Comparing Values" --- == Equal --- != Not Equal --- > Greater Than --- < Less Than --- >= Greater Than Or Equal --- <= Less Than Or Equal */ #include <iostream> using namespace std; int main() { cout << (10 == 10)...
ALGO
0.992525
4.512874
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2023-10-01T08:10:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e27fb9940f2...