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
d00f3ec8-394d-414c-a64b-4b833a4236c7
mspeake/CodeSamples
C++/KD Tree & BVH Tree/src/KD_Tree.cpp
#include "KD_Tree.h" KD_Node::KD_Node() { Left = NULL; Right = NULL; MyBox = NULL; Depth = 1; } KD_Node::KD_Node(const AABB& b) { MyBox = new AABB(b.C, b.E); Left = NULL; Right = NULL; Depth = 1; } KD_Node::~KD_Node() { if (MyBox != NULL) delete MyBox; if (Left != NULL) delete Left; if (Right != NULL)...
ALGO
0.995316
4.123427
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2013-09-10T06:50: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": "7d6a1aa5c...
b7b45148-829c-48aa-a4c7-ce4a2cf94130
reddy-lab-code-research/MuST-CoST
data/transcoder_evaluation_gfg/cpp/MINIMUM_TIME_TO_FINISH_TASKS_WITHOUT_SKIPPING_TWO_CONSECUTIVE.cpp
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // #include <iostream> #include <cstdlib> #include <string> #include <vector> #include <fstream> #include <iomanip> #include...
ALGO
0.999803
5.686549
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2022-02-08T19:28:59.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 11, "forks": 5, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "992f2114468...
77c352f2-31b0-453d-b9d4-03ae3424cf99
nysanier/cf
lg/basic/n3/lg_D.cpp
#include <bits/stdc++.h> // #include <bits/extc++.h> #ifndef ONLINE_JUDGE # include "dump.h" #else # define DUMP(args...) # define LINE(e) #endif // abbr #define forn(i, x, n) for (long i = x; i < n+x; ++i) #define fornr(i, x, n) for (long i = n-1+x; i >= x; --i) // must be signed, or 0->~0 #define for0(i, n) forn(i,...
ALGO
0.999893
3.96235
{ "github_metadata": { "branch": "master", "commit_count": 239, "repo_created_at": "2019-11-11T12:11: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": "85bca0b7...
14dd4d13-98e3-46bd-943c-7fd6592ea996
wangliyangleon/leetcode
UniquePaths.cpp
// https://oj.leetcode.com/problems/unique-paths/ class Solution { public: int uniquePaths(int m, int n) { if (0 == m || 0 == n) { return 0; } vector<vector<int> > save_map(n, vector<int>(m, 0)); return _index_path(0, 0, m, n, save_map); } private: int _index_path...
ALGO
0.999897
5.837189
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2014-06-18T13:46: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": "a29437f8a1...
d645ee6e-2afb-49e9-8c6b-0f0f22717a97
WANGWC1996/2024ICDE-Reverse-Regret-Query
Code/Exp/Others/operation.cpp
//#include "stdafx.h" #include <fstream> #include "operation.h" // is x equal to 0 ? int isZero(double x) { return x > -EQN_EPS && x < EQN_EPS; } /* * Calculate the dot product between two points */ double dot_prod(double* v1, double* v2, int dim) { double result = 0; int i; for (i = 0; i < dim; i++) { resu...
ALGO
0.998423
4.03138
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-02-29T12:50:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "04f030bd3c81...
84b60706-fe1f-4932-83f1-505a6186d379
vagrant28/PAT_A
1003.cpp
#include <stdio.h> #include <vector> #include <set> #include <algorithm> using namespace std; const int MAXV = 510; const int INF = (1 << 30) - 1; struct node{ int v, dis; node(int _v, int _dis): v(_v), dis(_dis){} }; int N, M, C1, C2; vector<node> Adj[MAXV]; int d[MAXV], weight[MAXV], w[MAXV], num[MAXV]; set<int> ...
ALGO
0.999938
3.686825
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2021-01-13T12:46: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": "37fba4bc1ceb...
f91593ec-2e90-4e54-b0b6-be7b7c16f3da
FITCommunity/Programiranje-1
Ispiti/NPP - 2014×2015/2017-08-26/Grupa A - Zadatak 01.cpp
#include <iostream> using namespace std; bool isSavrsen(int broj) { int suma = 0; for(int i = 1; i < broj; i++) if(broj % i == 0) suma += i; return suma == broj; } double aritmetickaSredina(int m, int n) { int brojac = 0; int suma = 0; for(int i = m; i <= n; i...
ALGO
0.998787
4.13829
{ "github_metadata": { "branch": "master", "commit_count": 228, "repo_created_at": "2018-05-13T10:46:08.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 10, "forks": 15, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "28c8573...
a224b2ac-7410-4f91-a3ce-2e138286e6b2
RoberttHernan/EDD_1S2020_PY1_201700870
Matriz Dispersa/Matriz.h
#ifndef MATRIZ_H_ #define MATRIZ_H_ #include <string> #include "NodeMatriz.cpp" using namespace std; template <class T> class Matriz { private: NodeMatriz<T> *root = new NodeMatriz<T> ("root",-1,-1) ; public: Matriz(); ~Matriz(); NodeMatriz<T>* getRoot(); void setRoot(NodeMatriz<T>*); NodeMatr...
ALGO
0.974832
4.024889
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2020-03-10T02:52:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "18c6eb0a9...
70255beb-7e2f-4bec-845e-ac754724bd87
wenxiao/LeetcodeCode
5.Longest Palindromic Substring.h
class Solution { //时间,空间复杂度:O(n) public: string longestPalindrome(string s) { //首先在字符串首尾以及任意字符之间加入特殊字符'0',将奇数字符的回文串于偶数字符的回文串一起考虑 int extended_length = s.size() * 2 + 1; //扩展后的字符串 vector<char> ts(extended_length); //每个字符为中心的最长回文串的半径,若以当前字符为中心的回文串长度为2...
ALGO
0.999997
5.75151
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2015-04-01T02:48: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": "1d8957797...
de84732c-74c6-4eb4-9411-a495faf7ddae
rt-net/pico_micro_ros_arduino_examples
uROS_STEP12_micromouse/run.ino
// Copyright 2023 RT Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to ...
ALGO
0.978254
4.097956
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2023-04-05T02:41:20.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5, "forks": 1, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "0577d1f45522...
ecbd126c-2458-41e2-a19e-dc8f25b2e926
damikh13/codewars
5kyu/buddy_pairs.cpp
#include <iostream> #include <string> inline long long sum_of_proper_divs(long long x) // sum of proper divisors of x { int result = 1; // 1 is a proper divisor of every number for (int i = 2; i * i <= x; ++i) // for all i from 2 to sqrt(x) { if (x % i == 0) // if i is a divisor of x { ...
ALGO
0.999339
4.965964
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2022-11-27T17:22: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": "389110e38a2b...
1fb9503b-df74-4f84-b3a2-e8ba6e21482a
loal123/CP
tlx/stackqueue.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define pii pair<int, int> #define pll pair<ll, ll> #define vi vector<int> #define vl vector<ll> #define fi first #define se second #define pb push_back #define mp make_pair #define all(v) v.begin(), v.end() #define SZ(x) ((int)...
ALGO
0.998684
4.733589
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2023-12-23T13:34: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": "0310298b1a1...
ff221e50-7ca8-4024-bf2a-408408e082a2
NazmulHasan7/CSE-225-Data-Structure-Lab
Linked List/Printing Linked List in forward and backward order using Recursion/main.cpp
#include <iostream> using namespace std; struct Node { int info; Node* next; }; void PrintForward(Node* head) { //Base case if(head == NULL) return; //Recursive case else { //Printing before function call cout <<" "<<head->info; PrintForward(head->next); ...
ALGO
0.999939
4.861149
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2022-05-22T18:52: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": "b390b5bbe5d...
1f574909-390d-4760-b378-5879061ad9d7
NatTHboi/WorkY1-2
HW5-A.cpp
/* ผู้ใช้กรอกค่า "คะแนนดิบ" เข้ามาในระบบเพื่อต้องการตรวจสอบเกรดในรายวิชา Programming ซึ่งมีเกณฑ์การให้คะแนนคือ F อยู่ในช่วงคะแนนน้อยกว่า 50 , D อยู่ในช่วงระหว่าง 50 ถึง 55 , D+ อยู่ในช่วงระหว่าง 55 ถึง 60 , C อยู่ในช่วงระหว่าง 60 ถึง 65 , C+ อยู่ในช่วงระหว่าง 65 ถึง 70 , B อยู่ในช่วงระหว่าง 70 ถึง 75 , B...
ALGO
0.993211
3.200083
{ "github_metadata": { "branch": "main", "commit_count": 278, "repo_created_at": "2024-11-19T08:02:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6f8b9401ab...
6ee375c2-965d-43b9-9fe3-6d190d449da5
SHL0915/BOJ_Problem_Solving
백준/Gold/2305. 자리 배치/자리 배치.cc
#include <bits/stdc++.h> using namespace std; int N, K; int table[41][2]; int f[41]; int DP(int n, bool k = false) { int& ret = table[n][k]; if (ret != -1) return ret; if (n == 0) return ret = k; ret = DP(n - 1, k); if (n > 1) ret += DP(n - 2, k); if (!k) { for (int i = n - 1; i >= 0; i--) ret += DP(i, true) ...
ALGO
0.999951
4.099394
{ "github_metadata": { "branch": "main", "commit_count": 2813, "repo_created_at": "2022-08-29T05:15: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": "5c7b3b00f...
ee0bb26a-c7bc-42f6-a315-20d975c8ea07
Userlgz/ds
4-5/4-5-2.cpp
#include <iostream> #include <algorithm> using namespace std; typedef struct Person { int a; int b; // // int s = 0; }Person; bool cmp0(Person a, Person b) { return min(a.a, b.b) < min(a.b, b.a); } bool cmp1(Person a, Person b) { return min(a.b, b.a) < min(a.a, b.b); } int n; Person person0[10...
ALGO
0.999884
3.358652
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2020-11-10T13:47: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": "a1dddb4aabf1...
9561eed7-3784-4673-93b2-6d1eb37f64a7
azaky/alterra-cp-mentoring
practice/solution/graph/jalan_tol_menuju_roma.cpp
#include <bits/stdc++.h> using namespace std; const int infinity = 1000000000; int solve(int n, const vector<pair<int, int>>& roads, const vector<pair<int, int>>& tolls, int source, int target) { // Kita cari jalan terpendek antar tiap pasang kota *tanpa tol* dengan Floyd-Warshall vector<vector<int>> dist(n, vect...
ALGO
0.999857
4.679428
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-10-06T05:28: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": "f67a9a772578...
f31c3e6b-cab5-4207-a59d-5bc027ec8efa
Samyak-ja-in/OPERATING-SYSTEMS-EASY-IMPLEMENTATION
PRIORITY_PRACTICE.cxx
#include<iostream> using namespace std; int main() { int at[20],bt[20],pr[20],ct[20],rt[20],tat[20],flag[20]; int n,i,sum_bt,curt,priority,exec;//exec is index of process to be executed; float sum_rt=0,sum_tat=0,avg_rt,avg_tat=0; sum_bt=0; cout<<"\nEnter number of process "; cin>>n; curt...
ALGO
0.999974
3.746675
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-12-22T16:52:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c94adbae4eaf...
d419d8c5-bb94-4ba3-83dd-31864a63f473
ws19999/codetree-TILs
240421/코드트리 투어/codetree-tour.cpp
#include <iostream> #include <queue> #include <vector> #include <unordered_map> #include <climits> using namespace std; vector<pair<int,int>> road[2001]; int dist[2001]; unordered_map<int,pair<int, int>> items; priority_queue<pair<int, int>> pq; int Q, n, m,start=0; void dijkstra() { for (int i = 0; i < n; i++)dist[i]...
ALGO
0.999933
3.950692
{ "github_metadata": { "branch": "main", "commit_count": 1191, "repo_created_at": "2024-03-10T09:27:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b13689f39...
e8ed439d-61e1-44e6-8484-96f712cc843e
tfhe/experimental-tfhe
parallel/src/spqlios/fft_processor_spqlios.cpp
#include "lagrangehalfc_impl.h" #include "spqlios-fft.h" #include <cassert> #include <cmath> #include <cstdio> using namespace std; int rev(int x, int M) { int reps = 0; for (int j=M; j>1; j/=2) { reps = 2*reps+(x%2); x/=2; } return reps; } FFT_Processor_Spqlios::FFT_Processor_Spqlios(const int...
ALGO
0.997039
4.866852
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2017-05-17T23:29:48.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 21, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "937db76c6...
550f4cb4-1707-40c5-b1e5-145c4faa0eab
Nivedita967/Data-Structure-and-Algorithms
Codechef/Carvans/Carvans.cpp
// A program in C++ count the number of cars which were moving at their maximum speed on the straight segment. #include <iostream> using namespace std; int main() { int t; scanf("%d",&t); // Getting number of test cases. for(int i = 0; i < t;i++) { int n, min = 0; ...
ALGO
0.999767
4.32027
{ "github_metadata": { "branch": "main", "commit_count": 2165, "repo_created_at": "2020-12-27T18:30:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 48, "forks": 77, "issues": 8, "pull_requests": 1 }, "file_meta": { "content_id": "cf1c108...
0e4813ca-3124-457a-9a7e-f9c179ce097f
HyeongJunYeom/VoxelBasedAIPathFind
Engine/Private/Boid.cpp
#include "Boid.h" #include "GameInstance.h" _float CBoid::ms_fRatio_FlowField = { 1.f }; _float CBoid::ms_fRatio_Alignment = { 1.f }; _float CBoid::ms_fRatio_Cohesion = { 1.f }; _float CBoid::ms_fRatio_Sepration = { 1.f }; _float CBoid::ms_fRatio_Avoidence = { 1.f }; _float CBoid::ms_fArriveRangeFromGoal = { 1.f }; ...
ALGO
0.996098
5.365211
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-03-04T04:23: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": "2430c509ebb6...
d1519de9-e9f8-42fc-9985-315ad52cb9b2
rmnjaat/cpp-workspace
DSA/Practice.cpp
// #include <bits/stdc++.h> // using namespace std; // int c(int b,int p) // { // if (p==1) // return b; // return b+c(b,p-1); // } // int main() // { // int base,power; // cin>>base>>power; // cout<<c(base,power); // } // #include<iostream> // using namespace std; // int ind(int *arr,...
ALGO
0.999969
5.01784
{ "github_metadata": { "branch": "main", "commit_count": 45, "repo_created_at": "2023-08-20T14:10: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": "1a41bc4d807...
fb42e1b8-9dfc-4a54-9a4f-e5a5dc31b664
sstar2257/PAT-Sort
common/1078.cpp
#include <iostream> #include <cmath> using namespace std; //1不是质数 int is_prime(int num) { for (int i = 2; i <= sqrt(num); i++) { if (num % i == 0) { return 0; } } return 1; } int find_prime(int num) { if (num <= 1) { num = 2; } while (!is_prime(num)) { num++; } return num; } //我晕。。。完全没看懂题目 //解决冲突的...
ALGO
0.99999
3.606574
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2019-04-05T08:22: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": "ed0b9c7b4...
341e10a7-3fff-4e8c-8244-9b513f76d55e
diego-lanca/lista_exercicios_c
ex11.cpp
//Faça um procedimento que recebe 3 valores inteiros por parâmetro e retorna-os ordenados em ordem crescente. #include <stdio.h> int ordenar(int a, int b, int c, int *n1, int *n2, int *n3){ if (a > b) { if (a > c) { *n1 = a; if (b > c) { *n2 = b; *n...
ALGO
0.999951
4.846776
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2022-09-30T02:42: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": "29f3cb83c5b0...
8c283965-e728-4ee0-ab6a-d9d67f4edd0f
sunggh/Algorithm
Algorithm/BOJ/구간 합 구하기 - 펜윅트리 (2042).cpp
#include <iostream> #include <queue> #include <set> using namespace std; void n2042() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); long long N, M, K; cin >> N >> M >> K; vector<long long> aa(N + 1); vector<long long> tree(N + 1); for (int i = 1;i <= N;i++) { cin...
ALGO
0.999791
4.656357
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2022-01-13T04:27: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": "8ee63ba7c1a8...
3f3882ee-9166-4d17-bda4-21d833b572b1
Yoonsin/CodingTest
이정훈/카카오프렌즈 컬러링북.cpp
#include <vector> #include <stack> #include <memory.h> using namespace std; // 전역 변수를 정의할 경우 함수 내에 초기화 코드를 꼭 작성해주세요. vector<int> solution(int m, int n, vector<vector<int>> picture) { int number_of_area = 0; int max_size_of_one_area = 0; vector<int> answer(2); answer[0] = number_of_area; answe...
ALGO
0.999836
5.484029
{ "github_metadata": { "branch": "main", "commit_count": 210, "repo_created_at": "2024-06-16T04:52:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 8, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "87a3c83d4f...
a85ab7e9-95a4-43b1-a48d-7c0349f96c1c
mgtools/crisprlong
scripts/spacer-toposort.cpp
// A C++ program to print topological sorting of a DAG #include <iostream> #include <fstream> #include <stdio.h> #include <string> #include <cstring> #include <list> #include <stack> using namespace std; // Class to represent a graph class Graph { int V; // No. of vertices' // Pointer to an array containing adjacen...
ALGO
0.999929
4.281931
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2019-02-01T15:30:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d95506d942...
62fb9423-d187-4244-a6d6-03f49bc4c166
fengrenchang86/PKU
3588/3406521_TLE.cpp
#pragma warning (disable:4786) #include <iostream> #include <stdlib.h> #include <queue> #include <string> #include <map> using namespace std; struct ac1 { char name[30]; bool operator()(const ac1&m1, const ac1&m2 ) { if( strcmp(m1.name,m2.name) > 0 ) return true; else return false; } }; struct ac2 { char...
ALGO
0.99913
3.748001
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2016-03-07T13:40: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": "0aa0802a2a...
9bb51b4f-21a7-48ef-bb51-7459ebc043da
Sparsh015/-Dstructures-CF
CF/171 div2/983 div 2/A.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int t; cin >> t ; while(t--){ int n; cin >> n; vector<int> switches(2*n); int n_off = 0, n_on = 0 ; for(int i = 0; i < 2 * n ; i++){ cin >> switches[i]; } for(int i =...
ALGO
0.999978
3.702196
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-03-09T18:34:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6593168c0366...
4b6add07-209c-463e-8457-fba8349c52ac
cryotb/HS-LAUNCHER
overlay/Include/Util.hpp
#pragma once class c_memory_buffer { public: c_memory_buffer(size_t length, bool zero = true) { m_length = length; m_data = malloc(length); if (m_data && m_length) { if (zero) memset(m_data, 0, m_length); } } ~c_memory_buffer() { if (!(m_data == nullptr)) free(m_data); } auto ptr() cons...
TOOL
0.905998
6.258223
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-06-08T02:53:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a780e6ff28aa...
3cc9bc62-e38e-403a-afdf-bc1947c78986
jpdotcom/comp_prog-archive
Auto_Upload_CodeChef/Practice/Geometric Mean Inequality.cpp
#include <bits/stdc++.h> #define pb push_back #define FOR(b) for(int i=0;i<b;i++) typedef std::vector<int> vi; typedef std::pair<int,int> pi; #define mp(a,b) make_pair(a,b) typedef long long ll; typedef std::priority_queue<pi> pq; #define endl '\n' #define F first #define S second # define PI 3.14159265358979323846 #...
ALGO
0.999935
3.85117
{ "github_metadata": { "branch": "main", "commit_count": 3908, "repo_created_at": "2022-09-25T03:06: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": "262d98d4f...
7cada829-fa8c-4f89-bb41-44d0f92b4ead
Navid-089/CSE-204-Data-Structures-and-Algorithms-I-Sessional
Offline 7 Divide and Conquer/2005089.cpp
#include <iostream> #include <fstream> #include <bits/stdc++.h> using namespace std; vector <int> inversions; //// Function to merge two sorted arrays and count the number of inversions int Merge(int *arr, int *temp, int left, int mid_pos, int right) { int m_count = 0 ; int i = left; // divid...
ALGO
0.99987
4.066975
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-03-09T21:20:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "132729bfcf6e...
22674cf4-9c82-4b4a-9c67-95c59b2dfd6a
Sbahuddin1/Data-Structures-And-Algortithms
UC San Diego/Data Structures/brackets check/solution.cpp
#include <iostream> #include <stack> #include <string> // Define a struct for brackets struct Bracket { Bracket(char type, int position) : type(type), position(position) {} // Function to check if the bracket matches with the given character bool Match(char c) { if (type == '['...
ALGO
0.999825
5.689954
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2024-01-21T11:12: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": "0947d1f3b...
7f1d51c4-4025-4151-8dfd-4255fd1b4ab8
harshan-2390/first
A_Packing_Rectangles.cpp
#include <bits/stdc++.h> using namespace std; int binarysearch(vector<int> v, int target) { int n = v.size(); int lo = 0, hi = n - 1; while (hi >= lo) { int mid = lo + (hi - lo) / 2; if (v[mid] == target) return mid; else if (v[mid] > target) hi = mid - 1...
ALGO
0.99994
4.889723
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2022-10-15T09:14: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": "90b1fa8313de...
aef72db0-11ed-4581-957c-f3989bd261e5
dourabbit/NaturalPhenomena
StableFluids/linearSolver.h
#ifndef LINEAR_SOLVER_H #define LINEAR_SOLVER_H #include <math.h> #include <stdio.h> #include <stddef.h> #include <stdlib.h> // Karen's CGD #define MAX_STEPS 100 // Matrix class the solver will accept class implicitMatrix { public: virtual void matVecMult(double x[], double r[]) = 0; }; // Matrix class the sol...
ALGO
0.999493
5.170253
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2011-10-01T21:27:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f714eae9d...
0db190cf-ef1c-4920-855c-6211a1d4b2eb
Gridbug/nsu_machine_learning_2020
Lab1/src/main.cpp
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <set> #include <limits> #include <QDataStream> #include <QFile> #include <QTextStream> using MyDataType = std::vector<std::pair<std::string, std::vector<double>>>; struct WaterPlantDataEntry { std::string day; std::vector<do...
ALGO
0.999426
5.690251
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2020-03-16T14:13: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": "e303e4432...
54f4a3cd-0811-4a07-bc91-6558f974c9ff
saikrishna17394/Code
top_coder/566/PenguinPals.cpp
// BEGIN CUT HERE // END CUT HERE #line 5 "PenguinPals.cpp" #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #inc...
ALGO
0.999986
3.936455
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2014-09-25T23:16: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": "6c6cad34e5...
7e56bf4d-02d8-469d-9344-941710809efe
ishandutta2007/codeforces-e
everule/normal/1404/C.cpp
#include <bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> #define mp make_pair #define pb push_back using namespace std; using namespace __gnu_pbds; template<typename T> using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; using ll =...
ALGO
0.999962
4.186087
{ "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": "10176147d27d...
66a78e85-8d51-4714-91d2-34092afe1661
RickyL-2000/cpp-learning
Algorithm/leetcode/medium/3_lengthOfLongestSubstring.cpp
#include <iostream> #include <vector> #include <map> using namespace std; class Solution { public: int lengthOfLongestSubstring(string s) { if (s == "") return 0; if (s.length() == 1) return 1; int left = 0, right = 0; int maxlen = 1; map<char, int> mp; mp[s[0]] = 0;...
ALGO
0.99983
5.158321
{ "github_metadata": { "branch": "master", "commit_count": 131, "repo_created_at": "2019-06-15T01:55:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "66c4620d...
105d6c0b-cf19-4890-af51-a6a69da2f5b2
Adam-Said/Informatique-UMontpellier
L3/S6/HAI605I - Multimédia/TP9/src/linearSystem.h
#ifndef linearSystem_H #define linearSystem_H #include <Eigen/Core> #include <Eigen/SparseCore> #include <Eigen/SparseCholesky> #include <MatOp/SparseGenMatProd.h> #include <MatOp/SparseSymShiftSolve.h> #include <GenEigsSolver.h> #include <SymEigsShiftSolver.h> #include <SymGEigsSolver.h> #include <MatOp/SparseCho...
ALGO
0.998104
5.315917
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2021-11-22T18:09:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c08b691a0dd...
58bf32a7-fe79-4101-bfc8-5dfff30fc302
Piyushhh786/DSA_with_CPP
Binary Tree/Binary_Tree_1/boundaryOfTreeBySir.cpp
#include<iostream> #include<queue> #include<vector> using namespace std; class TreeNode{ public: int val; TreeNode* left; TreeNode* right; TreeNode(int val){ this->val = val; left = NULL; right = NULL; } }; TreeNode* constructTree(vector<int>&v){ queue<TreeNode*>q; in...
ALGO
0.999989
4.104187
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-06-29T10:56:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4ec731159609...
411a73e7-07c8-4df3-8a32-d88482eccd2f
Sarthak-Kumar-6843/cpp-notes
C++&C/strivers/grade2.cpp
/* a school has following rules for grading system a) below 25 -F b)25-44 -E c) 45 to 49 - D d)50-59 - C e)60 - 79 - B f)80 -100 - A Ask user to enter marks and print corresponding grades */ #include<bits/stdc++.h> using namespace std; int main(){ int marks; cout <<" Enter marks :"; cin >> marks; if (ma...
ALGO
0.99881
3.463135
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2025-01-26T06:09: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": "ab9eb72ff1d...
c9ad0b47-0c6c-4a4d-9659-84ea83f40018
sarthakag99/Coursera-Algorith-Toolbox
week6.2.cpp
#include <bits/stdc++.h> #define MOD (ll)1000000007 #define MOD2 998244353 #define ll long long int #define ull unsigned long long int #define lf double #define ld long double #define MAX LLONG_MAX #define MIN LLONG_MIN #define UMAX ULLONG_MAX #define pb push_back #define endl "\n" using namespace std; int main() { ...
ALGO
0.999974
3.990663
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2020-10-27T16:24: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": "000c70a02035...
7f579bc8-8609-44ee-884d-0fdf1fee8fd5
Sanjay-sundaresan/CSAT
AMBULANCE_ASSIGMENT.cpp
#include <stdio.h> #include <stdlib.h> #include <limits.h> #include<iostream> #include<string> using namespace std; //Module 5 ambulance assignment //We construct a graph consisting of ambulances, patients and hospitals //Then for every patient in need, we consider the shortest path between the //Ambulance and pa...
ALGO
0.999036
3.22313
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2021-03-04T02:54:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "972c53a9406c...
1bd156cf-0429-4ec6-97e6-e7428b978c43
hieupham1103/TINHOC
SCHOOL/Doi Tuyen Tin/THI-2/C.cpp
#include<bits/stdc++.h> #define ii pair <int,int> #define fi first #define se second #define int long long #define double long double #define endl '\n' #define all(x) x.begin(), x.end() using namespace std; const int maxN = 1e3 + 10; const int inf = 1e18; int n, m; vector <ii> adj[maxN]; int vis[maxN]; int dist[maxN]...
ALGO
0.999989
4.088066
{ "github_metadata": { "branch": "main", "commit_count": 406, "repo_created_at": "2021-08-20T03:38: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": "f4940cd43e...
5852cb96-5f50-4887-887c-c882b6d1f184
dawn-flash/CPP_train_code
zheda_algorithm/sort_algorithm/quick_sort.cpp
/* * @Author: xt * @Date: 2020-10-23 16:40:14 * @Last Modified by: xt * @Last Modified time: 2020-10-23 16:58:13 */ //快速排序 #include<iostream> using namespace std; #define MAXSIZE 11 typedef struct { int list[MAXSIZE]; int *plist=NULL; int length; }SqList; //交换i和j位置 void Swap(SqList * l,int i,int ...
ALGO
0.999984
5.085067
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2020-09-23T02:28:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5d7780541...
30ad96ab-ccd8-4bdc-a7e5-3712b979344d
Offliners/C_CPP_Review_for_Interview
writeup/Cpp/min_stack/sol_1/main.cpp
#include<iostream> #include<vector> #include<climits> using namespace std; class MinStack { public: vector<int> s; vector<int> min_s; MinStack() { min_s.push_back(INT_MAX); } void push(int val) { s.push_back(val); if(val <= min_s.back()) min_s.push_back(v...
ALGO
0.999832
4.523428
{ "github_metadata": { "branch": "main", "commit_count": 265, "repo_created_at": "2023-07-26T10:55:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7b183a38d7...
739994ba-54ba-421c-82bb-93eb178c50a1
Lawrence-cell/receiver_search_spectrum_project
QtApplication1/signal_num_detect_v2.cpp
// // Academic License - for use in teaching, academic research, and meeting // course requirements at degree granting institutions only. Not for // government, commercial, or other organizational use. // File: signal_num_detect_v2.cpp // // MATLAB Coder version : 5.1 // C/C++ source code generated on : 28...
ALGO
0.990069
3.793559
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2021-12-11T09:44:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "d5a37fe64656...
579d5b70-bf84-4e8f-90e7-cc2361171e83
PrayushU/coupled_PDE_solver
src/Profiler.cpp
#include "Profiler.h" #include <vector> Profiler::Profiler(int rank, int numP) : rank(rank), numP(numP) {} void Profiler::profile(int N, int M, double x_max, double y_max, bool isPeriodic) { // Define the combinations of parameters runProfile(N, M, x_max, y_max, isPeriodic); if (rank == 0) { writeResults...
ALGO
0.990656
6.110712
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-01-17T14:29: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": "db329172a170...
29841c47-3b1c-4f3a-87e8-e158bb7a0afe
NafisUlAlam/Codeforces
C/Poisoned Dagger 1613/main.cpp
#include <bits/stdc++.h> #define ull unsigned long long using namespace std; ull n, h, sum, current; vector<int> myvec; void reset() { sum = 0; current = 0; } bool check(ull x) { reset(); for (int i = 0; i < n; i++) { if(myvec[i] <= current) { ull tosub = current - myv...
ALGO
0.999961
3.781863
{ "github_metadata": { "branch": "main", "commit_count": 144, "repo_created_at": "2021-11-30T11:30: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": "527d343e5b...
1b3ddc6f-506d-49c8-97c6-d94936ddcc86
PITT-JZ-COOP/XFER_FPGA
HLS/TEST_AURORA.cpp
#include "source.h" void LOAD_WEIGHT_DMA(hls::stream<DMA_DATA> &input_dma_W, hls::stream<AURORA_DATA> &output_aurora_W, FPGA_DATA WEIGHT1[divided_Tm_2][Tn][K][K], int custom_k){ DMA_DATA weight_input_dma; AURORA_DATA weight_output_aurora; for(int i=0;i<divided_Tm_4;i++){ for(int j=0;j<Tn;j++)...
ALGO
0.924843
4.435803
{ "github_metadata": { "branch": "master", "commit_count": 75, "repo_created_at": "2018-10-16T19:11:00.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 8, "forks": 2, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "5296ccd347...
ef57ef4f-cd12-47d0-84a2-b81858cf3543
Capobmb/CP-library
Unused/(AllDirectionTreeDP2).cpp
#include <iostream> #include <vector> using namespace std; template <typename Cost> struct Edge { int src, to; Cost cost; Edge(int s, int t, Cost c = 1) : src(s), to(t), cost(c) {} operator int() const { return to; } }; template <typename Cost> struct Graph : vector<vector<Edge<Cost>>> { Graph(int n) : vecto...
ALGO
0.999988
4.823723
{ "github_metadata": { "branch": "main", "commit_count": 63, "repo_created_at": "2023-06-05T15:40: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": "acd1fe76c3c...
9fcad7c9-2113-4637-8db7-0289dd8e8b02
kamehamehaa0000/Strivers-A2Z-DSA-Sheet-Practice-
Step 6 - Linked List/singlyLL/deletionInLL.cpp
#include <bits/stdc++.h> using namespace std; class Node { public: int data; Node *next; Node(int data1, Node *next1) { data = data1; next = next1; } Node(int data1) { data = data1; next = nullptr; } }; Node *convertArrToLL(vector<int> &arr) { Node *...
ALGO
0.999942
5.173033
{ "github_metadata": { "branch": "main", "commit_count": 143, "repo_created_at": "2024-03-07T15:41:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7e0ef367a9...
7e2ba222-05cc-484e-ab32-9aef6c60199e
ntrntr/leetcode
leetcode_cpp/leetcode/Public Bike Management.cpp
#include <vector> #include <iostream> #include <string.h> #include <algorithm> #include <string> #include <map> #include <stack> #include <unordered_map> using namespace std; int minNeedBikeAdjust = 0x7FFFFFFF; int minNeedReceive = 0x7FFFFFFF; int minsumDis = 0x7FFFFFFF; vector<int> res; int cmax, N, sp, m; vector<int>...
ALGO
0.999987
3.785234
{ "github_metadata": { "branch": "master", "commit_count": 171, "repo_created_at": "2015-09-24T06:54:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2cc25011...
4525f0c5-ab33-4ed2-a41d-34bb7d9072b1
grame-cncm/faust
tools/physicalModeling/mesh2faust/vega/libraries/matrix/matrixProjection.h
/************************************************************************* * * * Vega FEM Simulation Library Version 3.1 * * * * "matrix" library ...
ALGO
0.996923
5.397531
{ "github_metadata": { "branch": "master-dev", "commit_count": 13912, "repo_created_at": "2016-11-05T13:09:11.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2789, "forks": 355, "issues": 204, "pull_requests": 7 }, "file_meta": { "content_id...
aa4644ca-4770-4ec5-974c-71eebba15563
studouglas/GEANT4-GPU
geant4.10.02/source/processes/hadronic/models/rpg/src/G4RPGNeutronInelastic.cc
// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration...
ALGO
0.992309
3.00307
{ "github_metadata": { "branch": "master", "commit_count": 518, "repo_created_at": "2015-09-13T23:36:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 40, "forks": 18, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "12c77a...
e935729f-69ba-4f47-a058-7c00a01d9eaf
Aditya-A-garwal/cses
graph_algo/flight_routes_check.cpp
#pragma GCC optimize("Ofast") #include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; template<typename T> using ordered_set = tree<T, null_type, le...
ALGO
0.999993
3.827659
{ "github_metadata": { "branch": "main", "commit_count": 35, "repo_created_at": "2021-07-02T10:44:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "11a36c9a834...
d463426b-d629-42c9-860a-b537a7057e3a
piano-man/coding
arrays/q4.cpp
//largest number formed #include <iostream> #include <vector> #include <climits> #include <string> #include<algorithm> using namespace std; int compare(int n1,int n2) { string s1 = to_string(n1); string s2 = to_string(n2); string s3 = s1.append(s2); string s4 = s2.append(s1); if(s3.compare(s4)>0) ...
ALGO
0.999943
3.917748
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2018-01-17T19:31:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "131837dd1...
fcebf6ca-ba52-4d81-8507-d397274d04aa
soonmin-kwon/Solved.ac
7576.cpp
#include<iostream> #include<queue> using namespace std; int map[1001][1001]; int sol[1001][1001]; int mx[] = { 0,1,0,-1 }; int my[] = { -1,0,1,0 }; int m, n; int temp = 0; queue<pair<int, int>> q; void bfs() { while (!q.empty()) { int x = q.front().first; int y = q.front().second; q.pop(); for (int i = 0; ...
ALGO
0.999981
3.830357
{ "github_metadata": { "branch": "main", "commit_count": 139, "repo_created_at": "2021-03-03T12:07: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": "d21bdd8020...
2ab9c709-182f-42c2-977c-77b417698636
isHuangXin/leetcode-cpp
02.BinaryTree/99.recoverTree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999998
6.409977
{ "github_metadata": { "branch": "main", "commit_count": 83, "repo_created_at": "2021-01-02T06:18:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "93fbc6f2ad7...
daca110b-22c4-4472-a929-616e3463ef3c
allenanswerzq/byteme
old/vjudge/advance-search/d.cpp
// #include <bits/stdc++.h> #include <algorithm> #include <deque> #include <vector> #include <cstring> #include <iostream> using namespace std; #define fi first #define se second #define pb push_back #define pend cout << '\n' #define pvar(x) cout << #x << ": " #define sz(x) ((int)(x).size()) #define all(x) (x).begin()...
ALGO
0.999692
3.846211
{ "github_metadata": { "branch": "master", "commit_count": 810, "repo_created_at": "2017-06-16T09:27:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fdb7d0b4...
d3c816f9-8adc-4d95-bcf3-25eb5f16dd96
jgreer013/Data_Structures
L10HW10/bstsandbox.cpp
/* Binary Search Tree Sandbox <NAME> October 2015 */ #include <string> #include <iostream> #include "Scapegoat.h" using namespace std; // Returns a negative number if right is greater than right, 0 if equal // and a positive number if left is greater than right. int compare(const int& left, const int& right){ ...
ALGO
0.996031
4.827223
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2016-04-28T21:06: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": "eda305f9b...
17a9771c-33f0-4952-b3c0-97ab4bda2869
tj1023/CodeSolve
BOJ/BOJ_11404.cpp
#include <iostream> #include <vector> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, m, a, b, c; cin >> n >> m; int maxDist = 100000 * (n - 1) + 1; vector<vector<int>> dist(n + 1, vector<int>(n + 1, maxDist)); for (int i = 1; i <= n; i++) dist[i][i] = 0; for ...
ALGO
0.999992
3.931248
{ "github_metadata": { "branch": "main", "commit_count": 44, "repo_created_at": "2024-10-17T16:41: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": "c92b5d7316f...
b430fa98-3748-46a7-96b7-dfdc845f92b7
Morwenn/cpp-sort
benchmarks/benchmarking-tools/distributions.h
/* * Copyright (c) 2015-2024 Morwenn * SPDX-License-Identifier: MIT */ #include <algorithm> #include <cstddef> #include <ctime> #include <random> #include <string> #include <utility> #include <vector> #include <cpp-sort/detail/bitops.h> #include <cpp-sort/detail/type_traits.h> #include <cpp-sort/utility/as_function....
TEST
0.987996
7.435318
{ "github_metadata": { "branch": "1.x.y-develop", "commit_count": 1748, "repo_created_at": "2015-08-01T11:58:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 661, "forks": 61, "issues": 40, "pull_requests": 0 }, "file_meta": { "content_id...
06fdd4fb-597d-4220-9410-04c2698f4026
252228767/readings
c++_prime_plus/股票类stock的实现.cpp
#include <iostream> #include <string> #include <vector> using namespace std; class Stock { private: string company; long shares; double share_val; double total_val; inline void set_tol() { total_val = shares * share_val; } public: Stock(const string &co, long n, double pr); Stock() { company = "no name...
TOOL
0.970534
4.062606
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2022-03-26T01:26: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": "1fc40c0d2...
e6472d63-3e12-4f51-b35f-d0efc4acea48
CaptainSlowWZY/OI-Code
BZOJ/BZOJ1086.cpp
// BZOJ 1086 // SCOI 2005 #include <cstdio> #define forto(_) for (int e = last[_], v = E[e].to; e; v = E[e = E[e].next].to) const int kMaxn = 1010; typedef int IAr[kMaxn]; struct Edge { int to, next; } E[kMaxn << 1]; int N, B, tote, totpr, top; IAr last, blg, capt, S; inline void AddEdge(int u, int v) { E[++tot...
ALGO
0.999969
3.450017
{ "github_metadata": { "branch": "master", "commit_count": 364, "repo_created_at": "2018-07-05T00:46: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": "52c30b8a...
55d68f38-d601-4d4a-a4ee-b739d031cd91
isac322/BOJ
2897/2897.cpp
#include <cstdio> #include <algorithm> using namespace std; char map[51][51]; int main() { int n, m; scanf("%d %d\n", &n, &m); for (int i = 0; i < n; i++) gets(map[i]); int cnt[5] = { 0 }; for (int i = 0; i < n - 1; i++) { for (int j = 0; j < m - 1; j++) { if (map[i][j] != '#' && map[i][j + 1] != '#' &&...
ALGO
0.999964
3.587555
{ "github_metadata": { "branch": "master", "commit_count": 242, "repo_created_at": "2015-10-07T09:32:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e796ab44...
e086eb97-3fd7-454a-9b01-8aea2d919068
yzhangcs/Combo
include/UnionFind.h
/******************************************************************************* * UnionFind.h * * Author: zhangyu * Date: 2017.6.8 ******************************************************************************/ #pragma once /** * 带路径压缩的加权快速合并的并查集. */ class UnionFind { private: int n; // 并查集大小 ...
ALGO
0.994165
5.825431
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2017-07-30T12:10:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c72e4345e...
30bd9e00-d80f-41e4-8f91-e99b14de0356
hphp/Algorithm
Contest/ACM/unknown/sometime/MU Training Host by UESTC/HS BDC/sol_totalfrank.cpp
#include <stdio.h> #include <string.h> #include <iostream> using namespace std; #define MAXN 30 #define MAXM 100000 #define INF 0x3f3f3f3f struct Edge{ int v, e; Edge *link, *reverse; }edge[MAXM], *adj[MAXN], *adj2[MAXN], *curr[MAXN]; int tEdge; int dIn[MAXN], dOut[MAXN]; bool visited[MAXN], used[MAXN]; char str[1...
ALGO
0.999816
3.769444
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2013-10-31T07:05: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": "2a377ba536...
4828778f-4576-49f0-a524-7dd07ef9e10c
munh-orgil/leetcode
2024/08. aug/(02) 2134. Minimum Swaps to Group All 1's Together II.cpp
#include<bits/stdc++.h> using namespace std; class Solution { public: Solution() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } int minSwaps(vector<int>& nums) { int n = nums.size(); int cnt = 0; for (int i = 0; i < n; i++) { ...
ALGO
0.999978
4.470035
{ "github_metadata": { "branch": "main", "commit_count": 430, "repo_created_at": "2024-01-03T02:25: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": "6aa210ee30...
52c0b1a5-cf99-4a0e-930b-6cff72ecf66e
RyanMuellerNIU/Gauss_Elim_JIT_Demo
gauss_elimination_cplus.cpp
/* * Gaussian Elimination Solver, based on a version distributed by Sandhya * Dwarkadas, University of Rochester */ #include <stdio.h> #include <sys/time.h> #include <stdlib.h> #include <assert.h> #include <getopt.h> /* * Helper macro: swap two doubles */ #define DSWAP(a, b) { double tmp; tmp = a; a = b; b = t...
ALGO
0.99999
5.126968
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-06-28T16:48: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": "4471ed373fa2...
e4493317-878a-45ec-957d-cce331289b22
sejal-2001/DSA_practiceProblems
Linked List/DOUBLYLL-INSERTIONATPOSITION.cpp
DOUBLYLINKEDLIST -INSERT AT ANY POSITION #include <iostream> using namespace std; class Node{ public: int data; Node* next; Node* prev; //constructor Node(int data){ this->data = data; this->next = NULL; this->prev = NULL; } }; void insertAthead(Node...
ALGO
0.999821
5.364266
{ "github_metadata": { "branch": "main", "commit_count": 243, "repo_created_at": "2022-07-05T11:36:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5667642b5e...
d1914c4b-58ba-46ca-a099-2a60534ddf2c
abdualla1/CS213
Assignment 2/Abdo/game5.cpp
#include "BoardGame_Classes.h" #include <iostream> #include<limits> #include <vector> #include <numeric> #include <unordered_map> #include <algorithm> #include <set> using namespace std; pair<bool,int> last={0,0}; class NumericalTicTacToeBoard : public Board<int> { public: NumericalTicTacToeBoard() { rows =...
ALGO
0.964571
5.871218
{ "github_metadata": { "branch": "main", "commit_count": 54, "repo_created_at": "2024-09-30T12:58:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a1c853f5528...
245f16db-07db-4e18-86da-c9551ad5a59f
Tarunagg1/competitive_programing
gfg-problemsoftheday/Missing in Array.cpp
// Missing in Array // Difficulty: EasyAccuracy: 29.59%Submissions: 1.2MPoints: 2 // Given an array arr of size n−1 that contains distinct integers in the range of 1 to n (inclusive), find the missing element. The array is a permutation of size n with one element missing. Return the missing element. // Examples: // I...
ALGO
0.999906
4.896117
{ "github_metadata": { "branch": "master", "commit_count": 1108, "repo_created_at": "2021-02-09T15:02:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 1, "pull_requests": 1 }, "file_meta": { "content_id": "d9ec380...
a5967ceb-31fe-49cb-8a4b-9bceb82a7629
SikiHanov/LeetCode
146 LRU Cache.cpp
//146. LRU Cache //实现LRU Cache //利用std::list //利用自制的HashMap template<typename T_Key, typename T_Value> struct HashPair { T_Key key; T_Value value; HashPair() = default; HashPair(T_Key tarKey, T_Value tarValue); bool operator==(const HashPair& rVal); bool operator!=(const HashPair& rVal); const HashPair<T_Key,...
ALGO
0.994102
5.443788
{ "github_metadata": { "branch": "master", "commit_count": 53, "repo_created_at": "2018-02-23T21:08: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": "ea9183d05...
482cdb01-f653-44c2-90c0-0c7e03f9f327
WhereIsYuuka/Leetcode
滑动窗口/3. 无重复字符的最长子串.cpp
class Solution { public: int lengthOfLongestSubstring(string s) { int res = 0; if(!s.length()) return res; unordered_set<char> uset; int l = 0; for(int r = 0; r < s.length(); r++) { char ch = s[r]; while(uset.contains(ch)) ...
ALGO
0.999909
5.778411
{ "github_metadata": { "branch": "main", "commit_count": 147, "repo_created_at": "2024-02-06T09:10: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": "7adaa01a04...
20bf0b56-5a41-498d-acef-13f8a0a76080
iyakushev/leetcodedump
src/p451.cpp
#include "common.h" constexpr int BEGIN_UPPER_CH = 0; constexpr int BEGIN_LOWER_CH = 26; constexpr int BEGIN_NUMBER_CH = 52; constexpr int NUMBER_OF_CH = 62; class Solution { public: std::string frequencySort(std::string s) { std::array<int, NUMBER_OF_CH> freq; freq.fill(0); // fill ...
ALGO
0.99938
6.237593
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-02-06T14:04: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": "cce08568db5d...
65c6b091-a12b-42b7-b28f-45ccbea77904
Devopriya-Tirtho/Weighted_GPUGraphLayout
usr/src/debug/cygwin-3.4.6-1/winsup/cygwin/loadavg.cc
/* loadavg.cc: load average support. This file is part of Cygwin. This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ /* Emulate load average There's a fair amount of approximation done here, so don't try to use th...
TOOL
0.968503
6.124902
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-10-31T20:36:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4feef23e3b5d...
3bc88939-1b3f-43b0-a69e-35612561cc84
navidmafi/OthelloCpp
main.cpp
// <NAME> // Reversi Game (Othello) // Using only iostream and windows.h (just for sleep function) // TESTED ONLY ON WINDOWS x86 WITH GNU GCC g++ (Rev6, Built by MSYS2 project) 11.2.0 // #include <iostream> #include <windows.h> using namespace std;...
ALGO
0.99223
3.100809
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2022-01-09T19:25: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": "13b9b46031...
8d34859b-5d28-4c07-9753-445d59de2cff
sleepyjun/PS
BOJ/15685/15685.cpp
// https://www.acmicpc.net/problem/15685 #include <algorithm> #include <iostream> #include <limits> #include <string> #include <vector> #include <stack> using std::cin; using std::cout; using ull = unsigned long long; using pii = std::pair<int, int>; const int INF = std::numeric_limits<int>::max(); const int MAX = 11...
ALGO
0.999398
5.039089
{ "github_metadata": { "branch": "master", "commit_count": 68, "repo_created_at": "2019-09-16T02:41:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ef15058fc...
a11c480b-6c9a-46a2-a591-f116e6505980
pokaa3a/leetcoding
problems/681. Next Closest Time.cc
#include <iostream> #include <vector> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <string> #include <queue> #include <stack> #include <sstream> #include <cmath> #include <numeric> using namespace std; struct TreeNode { int val; TreeNode* left; TreeNode* right; TreeNode(...
ALGO
0.995351
5.334685
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2020-03-15T08:11: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": "93ca403e2...
0f762328-21fd-466f-80e8-8df9f5048b57
Braj-Kumar/CPP-firstRepo
accenture4.cpp
/* // find the second maximum element in array #include<iostream> #include<bits/stdc++.h> using namespace std; int SecondMaxi(int arr[],int n){ int maxi= INT_MIN; int sMaxi = INT_MIN; if(n==0){ return -1; } if(n<2){ maxi=arr[0]; sMaxi=-1; } for(int i=0;i<n;i++){ if(arr[i] > maxi){ maxi = arr[i]; } } for(int i...
ALGO
0.999841
3.799332
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-11-12T05:48: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": "dfdb8bebb9a1...
7c4f4c80-d696-4adf-8394-d2cb66df669e
ishandutta2007/codeforces-f
frame233/normal/797/E.cpp
// Author -- Frame #include<cstdio> #include<cstring> #include<algorithm> #define Finline __inline__ __attribute__ ((always_inline)) typedef long long ll; typedef unsigned int uint; typedef unsigned long long ull; const int inf=0x3f3f3f3f,Inf=0x7fffffff; const ll INF=0x7ffffffffffffff; template <typename _Tp>_Tp g...
ALGO
0.999799
3.51691
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:43:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4974341d2547...
40a609cd-d1aa-49c7-a251-c0a01ba6eb70
Axel-Naumann/root
roofit/roofitcore/src/RooAbsMinimizerFcn.h
/***************************************************************************** * Project: RooFit * * Package: RooFitCore * * @(#)root/roofitcore:$Id$ * Authors: ...
TOOL
0.913374
7.016289
{ "github_metadata": { "branch": "master", "commit_count": 79359, "repo_created_at": "2013-06-29T14:35:42.000Z", "is_fork": true, "is_org_owned": false, "forked_from": "root-project/root", "stars": 4, "forks": 3, "issues": 0, "pull_requests": 9 }, "file_meta": { "conten...
7ec6a8cc-7a67-43e2-86c4-b1f3b7d975ef
sonaspy/PAT-PTA
dsa_problemset_en/7-1.cpp
// author - <EMAIL> // coding - utf_8 #include <iostream> #define test() freopen("in", "r", stdin) using namespace std; int main(int argc, char const *argv[]) { /* code */ //test(); int k; cin >> k; int a[k], thisSum = 0, maxSum = -1, start_count = 0, firstNum = 0, last = 0; int tmp_1st = 0;...
ALGO
0.999938
3.386413
{ "github_metadata": { "branch": "sonaspy", "commit_count": 525, "repo_created_at": "2018-11-25T17:50: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": "59bede9...
5f1b3fb8-f5ef-4638-ad84-00beaffb2328
rsedak/Shield-B
examples/Shield-B_005/Shield-B_005.ino
/* Control step motor with SW2 and SW3 * * Connect step motor to J6 connector * * Created 2022 by <NAME> * * This example code is in the public domain. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANT...
TOOL
0.955963
7.052336
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-04-02T20:02: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": "6ec777df9cbd...
607cda0f-a20b-46e4-ba96-8577a62b9d84
PolarisZg/test
20200612测试/源.cpp
#include<stdio.h> #include<string.h> #include<stdlib.h> typedef struct Graph { char name[50][50]; int Matrix[50][50]; int Node_num = 0; }Graph; void undiricted_graph_in(Graph* G) { printf("结点个数:"); scanf_s("%d", &G->Node_num); getchar(); for (int i = 0; i < G->Node_num; i++) { printf("第%d个结点名称:", i + 1); ...
ALGO
0.999445
3.440422
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-08-07T02:03:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "56af33eec7...
e1f22534-61ba-49dd-8a11-efc08b855cb1
naruto361/LeetCodeSolutions
UniqueMorseCodeWords.cpp
class Solution { public: string change(char c) { switch(c) { case 'a':return ".-";break; case 'b':return "-...";break; case 'c':return "-.-.";break; case 'd':return "-..";break; case 'e':return ".";break; case 'f':return ".....
ALGO
0.999906
5.363324
{ "github_metadata": { "branch": "master", "commit_count": 996, "repo_created_at": "2020-07-18T17:02: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": "359ad93d...
dbfb5983-6c5b-48cb-9bd8-c751034eab41
syniox/Online_Judge_solutions
XSY/3381.cpp
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> typedef long long lint; const int N=1005; int n; lint cnt_all; struct vec{ lint x,y; friend vec operator - (const vec &a,const vec &b){ return (vec){a.x-b.x,a.y-b.y}; } friend long double crs(const vec &a,const vec &b){ return (long ...
ALGO
0.99953
3.432868
{ "github_metadata": { "branch": "master", "commit_count": 1071, "repo_created_at": "2018-06-07T03:31:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 59, "pull_requests": 0 }, "file_meta": { "content_id": "5dfe91...
08760d26-7369-4faf-b35c-c1afe39c5f15
jyotiranjankalta81/Data-Structure-And-Algorithm-
Codeforces/Codeforces Round/A/SaveMoreMice.cpp
#include <bits/stdc++.h> // #include <iostream> using namespace std; // void solve() // { // int n, k; // // int k; // cin >> n >> k; // int arr[k]; // // cin >> k; // for (int i = 0; i < k; i++) // { // /* code */ // cin >> arr[i]; // } // sort(arr, arr + k); // ...
ALGO
0.999967
4.517702
{ "github_metadata": { "branch": "master", "commit_count": 225, "repo_created_at": "2021-10-29T10:41: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": "e1aa02b5...
89724b41-a48e-4486-947b-4cbd3c14703b
arcanumghost/advent
AdventOfCode2015/Day5/main.cpp
#include <iostream> #include <string> #include <fstream> using namespace std; bool nice1(const string &testWord); bool nice2(const string &testWord); int main() { fstream input{"input.txt", ios::in | ios::binary}; string line; int niceWords = 0; while (getline(input, line)) { if(nice2(line)) niceWords++; }...
ALGO
0.999473
4.132814
{ "github_metadata": { "branch": "master", "commit_count": 55, "repo_created_at": "2015-12-19T00:29:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "72c9a32bf...
0ca63c55-cb38-4b0f-ad90-cff85e358937
Erensu/ignav
improved/src/ins-gnss/ins-gnss-fbsm.cc
/*----------------------------------------------------------------------------- * ins-gnss-fbsm.cc : ins-gnss combine forward and backward filters by * fixed-point smoother * * reference : * [1] P.D.Groves, Principles of GNSS, Intertial, and Multisensor Integrated * Navigation System, Artec...
ALGO
0.999284
3.143528
{ "github_metadata": { "branch": "master", "commit_count": 76, "repo_created_at": "2018-09-01T13:14:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 428, "forks": 214, "issues": 10, "pull_requests": 0 }, "file_meta": { "content_id": "bfa6...
84334d42-cd30-44b5-8fae-5d19983dc0df
IamBorn/TOI-preparation
code/distance_in_tree.cpp
// source : #include <bits/stdc++.h> using namespace std; #define sz(v) ((int)(v).size) #define all(v) (v).begin(), (v).end() using ll = long long; using pii = pair<int, int>; using vi = vector<int>; const long long INF = 2e9+7; const int MOD = 1e9+7; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL)...
ALGO
0.999925
4.427133
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2024-04-22T09:07: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": "69bd3493f...
f4147229-cbe1-481f-8fab-15a0e1cc71e6
NASD-Bulgaria/egt-training
Ivan Zahariev/IvanZahariev_exLists/ex_List4/List.h
// Fig. 3.4: List.h // Template List class definition. #ifndef LIST_H #define LIST_H #include <iostream> #include <algorithm> #include <vector> using namespace std; #include "Listnode.h" // ListNode class definition template< typename NODETYPE > class List { public: List(); // constructor ~List(); // destruct...
TOOL
0.934163
5.66186
{ "github_metadata": { "branch": "master", "commit_count": 230, "repo_created_at": "2014-09-04T12:47:37.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8fea6bebb...
191f60a2-8104-4d71-b32b-b124fa06c375
hokein/algorithm-course-solutions
div_chap/1004.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> using namespace std; typedef unsigned long long ull; typedef long long ll; const int N = 100; const double epos = 10e-7; int month[N]; double money[N]; int n; double ppow(double p, int times) { double ret = 1; while (times) { ret *= ...
ALGO
0.999393
3.47298
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2013-10-13T07:34:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "21cef27b7...
e2a80a43-a2e1-462e-a559-46907cc057d4
caaaden/Algorithm
백준/Gold/2410. 2의 멱수의 합/2의 멱수의 합.cc
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/rope> #define fastio ios::sync_with_stdio(0), cin.tie(0); #define all(v) v.begin(), v.end() #define X first #define Y second #define rep(i, a, b) for (int i = a; i < b; ++i) using namespace std; using ...
ALGO
0.999993
4.53731
{ "github_metadata": { "branch": "main", "commit_count": 506, "repo_created_at": "2024-06-13T04:13:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9b21cb036c...
887170e0-fabb-4ebd-9bc1-fe956cc383c5
EyciaZhou/acm
hdoj/hdu4557/hdu4557/2.cpp
//Treap平衡树解法 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cstdlib> #include<ctime> #include<string> using namespace std; #define N 10010 int sum=0; /**********************************************/ #define nil 0 struct Node{ int k,w,l,r; string s; void init(string str,int v...
ALGO
0.999431
3.356511
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2015-05-04T23: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": "feea7c60b...
9ea28f90-db1c-46ad-a4cd-9338d1f8f6e0
0HardRain0/Algorithm
221124/parsing.cpp
#include<iostream> #include<math.h> using namespace std; char stack[50], polish[50]; double v[50]; int pri[256]; int sp1, sp2; int main() { int i; char* p = "(6+3)/(6-2)+3*2^3-1", * expression = p; for (i = 0; i <= 255; i++) pri[i] = 4; pri['+'] = pri['-'] = 1; pri['*'] = pri['/'] = 2; pri['^'] = 3; pri['('] ...
ALGO
0.999713
3.745409
{ "github_metadata": { "branch": "main", "commit_count": 170, "repo_created_at": "2022-11-01T23:59:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "95104ea022...
b4737ad4-be43-4e54-b910-9cf37948d9b3
dipankardas011/DSA_GeeksforGeeks
DSA/advance/c3.cpp
/*Maximum Occurrence in a Given Range Difficulty Level : Hard Last Updated : 18 Dec, 2019 Given an array of n integers in non-decreasing order. Find the number of occurrences of the most frequent value within a given range. Examples: Input : arr[] = {-5, -5, 2, 2, 2, 2, 3, 7, 7, 7} Query 1: start = 0, end = 9...
ALGO
0.999947
5.966679
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2021-07-24T14:53: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": "f7e65565586...