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
50e2fa12-5a24-478a-8235-366b2f2096fb
ChangminYi/Baekjoon_code
6091_핑크 플로이드/main.cpp
#include <iostream> #include <vector> #include <algorithm> #include <numeric> using namespace std; struct edge { int n1, n2, weight; edge(const int _n1 = 0, const int _n2 = 0, const int _w = 0) : n1(_n1), n2(_n2), weight(_w) {} bool operator<(const edge& other) { return weight < other.weight; ...
ALGO
0.999987
5.232746
{ "github_metadata": { "branch": "master", "commit_count": 725, "repo_created_at": "2021-05-13T06:59: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": "521c0126...
c96bfe2a-e994-4e77-8a0c-3c3a6870fe95
AJSTYLE-lab/Oject-Oriented-Programming
ASSIGNMENT#1/QNO6.cpp
#include<iostream> using namespace std; int* INPUT(int*& p_1, int& size) { cout << "ENTER SIZE="; cin >> size; p_1 = new int[size]; cout << "ENTER " << size << " ELEMENT." << endl; for (int i = 0; i < size; i++) { cin >> p_1[i]; } return p_1; delete[] p_1; } int* GROW(int*& p_2, int& old_size, int& n_size) { ...
TOOL
0.956935
3.54819
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2023-04-19T17:47:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6c76bea45295...
fcfa1db2-00ce-424d-942f-8441d880e57f
SKTT1Ryze/Valhalla
leetcode-cc/BinaryTree.cc
#include "BinaryTree.h" #include <queue> #include <sstream> #include <stack> using namespace std; bool preorderCompBTree(TreeNode* root, const vector<int>& expect) { stack<TreeNode*> s = {}; int i = 0; int n = expect.size(); auto node = root; while (node != nullptr || !s.empty()) { if (node != nullptr...
ALGO
0.998027
4.831642
{ "github_metadata": { "branch": "main", "commit_count": 347, "repo_created_at": "2023-09-25T15:03:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "caadc10bc5...
d1bd9d9c-61af-4095-8051-cb3e70c3a662
mahirlabibdihan/Codeforces-Solution
A_Escape_from_Stones.cpp
#include <iostream> #include <string> #include <vector> #include <set> #include <climits> using namespace std; /* If 'l' next stone's position is smaller than current stone. If 'r' next stone's position is greater than current stone. */ vector<int> solve(string &s) { int n = s.length(); vector<int> resu...
ALGO
0.999938
3.394483
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2020-04-03T18:29: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": "1f918337e...
1ddd36b5-b007-4f4f-a553-8fc165a2983c
LucasGabrielFontes/ProgramacaoCompetitiva
EstudosC++/JogoDaForca/main.cpp
// Autor: <NAME> // Jogo da forca em C++, apenas para treinar o básico da sintaxe da linguagem. #include <iostream> #include <fstream> #include <string> #include <random> #include <ctime> using namespace std; int contaLinhasArquivo(ifstream& arquivo); void preencheVetorPalavras (ifstream& arquivo, string palavras[])...
TOOL
0.92268
3.824915
{ "github_metadata": { "branch": "main", "commit_count": 154, "repo_created_at": "2024-02-06T21:47:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "649c9da2bf...
40bf7692-f16b-429a-bfd4-b2bf71f06d14
chihchianglu/take_that
leetcode/tree/binary-search-tree-iii-delete.cpp
// // Created by <NAME> on 2019-02-19. // // Definition for a binary tree node. struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} }; class Solution { TreeNode *deleteNode(TreeNode *root, int key) { // Base Case: If the tree is empty ...
ALGO
0.999958
5.469436
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-03-30T08:16: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": "90f4928b8e...
67b44ec6-a21e-4b2e-a024-450948ae54d2
FinityFly/cp
P_2_-_A_Boring_Problem.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> pii; typedef pair<ll,ll> pll; #define mp make_pair /* 0 1 3 1 4 1 0 2 */ int n, cnt=0, b[200001], w[200001]; char c[200001]; bool visited[200001]; map<int, vector<int>> adj; int main() { ios::sync_with...
ALGO
0.999904
3.941212
{ "github_metadata": { "branch": "main", "commit_count": 39, "repo_created_at": "2024-02-19T19:39:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "69c33091c63...
d06fd472-025a-4b8e-8fb9-4caa24677a1a
ZeitHaum/CodingPractice
NowCoder/Practice117/2.cpp
#include <bits/stdc++.h> using namespace std; #define int long long void solve(){ int l, r, k; cin>> l >> r >> k; if(k == 0){ cout << (r - l + 1) % 2 << '\n'; return ; } int odd_cnt = 0; if((r - l + 1) & 1) { if(l & 1) odd_cnt = (r - l + 1) / 2 + 1; else odd_cnt =...
ALGO
0.999751
4.285649
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2023-06-06T14:29: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": "e01816d3f...
03107175-5a62-4569-899d-5ed5dbc019e2
taskflow/taskflow
3rd-party/tbb/examples/pipeline/square/square.cpp
/* Copyright (c) 2005-2020 Intel 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 la...
DATA
0.908953
5.227579
{ "github_metadata": { "branch": "master", "commit_count": 2551, "repo_created_at": "2018-04-18T13:45:30.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 11046, "forks": 1291, "issues": 12, "pull_requests": 6 }, "file_meta": { "content_id": "...
fece10fa-d0de-4f6d-8564-ee3df8c9c47b
kyberszittya/SZE-Prog-Gyak
2024/Gyak04/masodfoku_egyenet.cpp
// // Created by keret on 2024. 02. 28.. // /* * Másodfokú egyenlet Olvassunk be `a` `b` és `c` együtthatókat szabvány bemenetről Amennyiben az értékek alapján alkotott másodfokú egyenletnek (ax2+bx+c=0 ) van valós gyöke írja ki az eredményt, különben pedig `Az egyenletenek nincs valos gyoke` szöveget. Megjegyzés: A...
ALGO
0.991453
5.324008
{ "github_metadata": { "branch": "main", "commit_count": 45, "repo_created_at": "2022-03-02T09:44:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bde872718f4...
7862eef8-bf48-41c4-9961-99e95593b499
ddoed/Problems
백준/Silver/1991. 트리 순회/트리 순회.cc
#include <iostream> #include <unordered_map> using namespace std; class Tree { public: struct Node { char node; Node* left; Node* right; Node(char _node) : node(_node), left(nullptr), right(nullptr) {} }; void PreOrder(Node* root) { if (root == nullptr) return; cout << root->node; PreOrder(root->...
ALGO
0.999881
4.266834
{ "github_metadata": { "branch": "main", "commit_count": 221, "repo_created_at": "2024-11-04T03:13: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": "548c94286f...
455b3a8f-2b63-440c-aa7d-7e89183edde7
zixuan-zhang/cracking_the_code_interview
chapter8/ques7.cpp
/******************************************************************************* * @File : ques7.cpp * @Author: <NAME> * @Email : <EMAIL> * @Blog : www.noathinker.com * @Date : 2015年10月26日 星期一 13时01分57秒 ******************************************************************************/ /* * Question: * * ...
ALGO
0.999498
4.326884
{ "github_metadata": { "branch": "master", "commit_count": 52, "repo_created_at": "2015-08-14T08:33: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": "01663bcde...
f1cb4f2f-0fe6-4a53-b6f6-bb943587b2a3
Abdelaziz2811/DSA_LV1
Strings/StringToInteger.cpp
#include <iostream> #include <string> using namespace std; int myAtoi(string s) { if (s[0] > 57 || s[0] < 48 && s[0] != ' ' && s[0] != '-') return 0; string Number; for (short i = 0; i < s.length(); i++) { if ((s[i] <= 57 && s[i] >= 48) || s[i] == 45) Number+= s[i]...
ALGO
0.99714
4.196463
{ "github_metadata": { "branch": "main", "commit_count": 90, "repo_created_at": "2024-12-09T16:00: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": "98d714f6179...
1b668e27-fccc-4ba1-b8fe-3e90550be990
abhishek-ub/code_scraps
task_schedular.h
#include <iostream> #include <cstdint> #include <vector> std::vector<uint64_t> get_topological_order( const std::unordered_map<uint64_t, std::vector<uint64_t>>& tasks, std::unordered_map<uint64_t, uint64_t>& in_orders) { std::vector<uint64_t> topological_order; std::queue<uint64_t> visit; // populate resu...
ALGO
0.999866
6.640019
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2020-12-24T01:28: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": "ed6162b6e...
e1e7dcca-5c21-4d32-9dad-a830144403bb
siahuat0727/acm
UVa/u11987_AlmostFindUnion_FindUnion.cpp
#include <cstdio> #include <cstdlib> #include <string> #include <cstring> #include <algorithm> #include <cmath> #include <vector> #include <stack> #include <queue> #include <map> #include <iostream> using namespace std; #define MAXN 100005 #define PB push_back int p[MAXN]; vector<int> V[MAXN]; int Find(int x){ ret...
ALGO
0.999879
4.100752
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2017-07-13T14:04: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": "fe050d067...
05405e4d-296c-4447-bc9f-1125842002d5
chocono2230/competitive-programming
AtCoder/Problems/abc368/ep_240824_1/abc368_ep_240824_1.cpp
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(ri, n) for (int ri = (int)(n - 1); ri >= 0; ri--) #define rep2(i, x, n) for (int i = (int)(x); i < (int)(n); i++) #define rrep2(ri, x, n) for (int ri = (int)(n - 1); ri >= (int)(x); ri--) #define repit(itr, x) for (auto itr = x.b...
ALGO
0.999932
4.161081
{ "github_metadata": { "branch": "main", "commit_count": 231, "repo_created_at": "2022-10-09T09:59: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": "560b62ebaf...
86a8b4d9-aed6-4d7b-8c77-d55620d1ac6b
Manex195/Competitive_Programming
ITMO_academy(Segment_Tree/1-b.cpp
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "../debugger/debug.h" #else #define debug(...) 420 #endif using int64 = long long; const int INF= (int)1e9 + 7; // for file input/output. // void setIO(string fName) { // freopen((fName + ".in").c_str(), "r", stdin); // freopen((fName + ".out").c_...
ALGO
0.999969
5.341675
{ "github_metadata": { "branch": "main", "commit_count": 64, "repo_created_at": "2023-10-25T08:28: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": "a7263c30298...
76d086ca-d51e-400c-aec6-b0a13d873ec5
jvdcf/da-watersupply
lib/UFDS.cpp
/* * UFDS.cpp * A simple implementation of Union-Find Disjoint Set (UFDS), required by Kruskal's algorithm. * * Created on: 25/01/2022 * Author: <NAME> */ #include "UFDS.h" UFDS::UFDS(unsigned int N) { path.resize(N); rank.resize(N); for (unsigned long i = 0; i < N; i++) { path[i] = i; ...
ALGO
0.999223
5.763154
{ "github_metadata": { "branch": "main", "commit_count": 126, "repo_created_at": "2024-02-29T16:16:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9d6be88c32...
2e05f5ff-2bd6-44ef-b0d9-20083a70c2df
itzraju5/CODEFORCES_SOLUTIONS
Codeforces_Solutions/1807_D.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int t; cin >> t; while(t--){ int n, q; cin >> n >> q; vector<int> v(n); vector<long long> prefix_sum(n); long long total_sum(0); for(i...
ALGO
0.99967
5.029199
{ "github_metadata": { "branch": "main", "commit_count": 313, "repo_created_at": "2024-04-06T21:34: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": "08bfef9821...
1f7d6bcc-e65f-47e2-a531-34a60919f35b
takayg/algorithm
C++/Data Structure/UnionFind.cpp
#include <bits/stdc++.h> using namespace std; struct UnionFind { vector<int> par; UnionFind(int n) : par(n, -1) { } void init(int n) { par.assign(n, -1); } // xの根を求める int root(int x) { if (par[x] < 0) return x; else return par[x] = root(par[x]); } // xとyが同じ集合に属するか bool issame(int x, int y) { ...
ALGO
0.999885
4.176363
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2020-12-21T03:32: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": "794da4e7d9...
162be360-4f7a-4acb-9c69-f0e94b44cfe0
NimishToshniwal/Codeforces-Solved
1500-1999/1661A.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < n; i++) #define rep1(i, n) for (ll i = 1; i <= n; i++) int main() { ios::sync_with_stdio(false); int t; cin >> t; while (t--) { int n; cin >> n; ll a[n], b[n], sum = 0; ...
ALGO
0.999986
3.435268
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-01-17T16:53: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": "2b8fd7994e1a...
c1f2f267-13de-43f2-acf6-41f83c685672
PaShampusik/BSUIR
1-3 sem/C++ 1 sem/Lab 1/task_6/task_6.cpp
#include <iostream> using namespace std; int main() { int h1, h2, m1, m2, h, m; cout << "enter hours(first case): "; cin >> h1; while ((h1 < 0) || (h1 > 23)) { cout << endl << "enter hours(first case): "; cin >> h1; } cout << endl << "enter minutes(first case): "; cin >> m1; while (m1 < 0 || m1 > 59) { ...
ALGO
0.996675
3.611717
{ "github_metadata": { "branch": "main", "commit_count": 199, "repo_created_at": "2022-02-24T05:50:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bc22dafcb7...
a7110b2a-7491-4f47-8252-6550b8cd5aab
iamkanhaiyakumar/Code-Help-C--
Arrays/2nd class/2ndq_sort0_1.cpp
#include<iostream> #include<algorithm> using namespace std; // void sortZeroOne(int arr[], int n){ // int start = 0; // int end = n-1; // while(start<end){ // if(arr[start]==1){ // swap(arr[start], arr[end]); // end--; // } // else{ // ...
ALGO
0.999967
4.15073
{ "github_metadata": { "branch": "main", "commit_count": 86, "repo_created_at": "2024-07-02T15:40:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c56608baf60...
1e1c33fc-138f-4318-8e55-38df1a38a89e
shahsk/stochastic-receding-horizon-control
StochasticController/stoc_controller.h
/* * stoc_controller.h Implementation of Stochastic Controller in Robot Operating System(ROS) to test on various robotic hardware. The details of stochastic controller design can be found in the paper submitted to Transactions of Automatic Control, which is under review. <NAME>, <NAME>, <NAME>,"Stochastic rece...
ALGO
0.91524
3.858037
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2015-03-18T13:10:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4829f90756...
2cc270e2-e8ec-4a7a-ab6d-109ab5b1520d
ishandutta2007/codeforces-f
felerius/normal/380/C.cpp
#include <algorithm> #include <array> #include <cassert> #include <cmath> #include <cstdint> #include <iostream> #include <limits> #include <numeric> #include <optional> #include <string> #include <tuple> #include <vector> // Contest: 21 - Codeforces Rating >= 2200 (https://a2oj.com/ladder?ID=21) // Problem: (23) Sere...
ALGO
0.999456
4.392268
{ "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": "7ea5816db8d2...
13ac8a44-5d42-4a48-beaa-1adc17ca6129
ishandutta2007/codeforces-w
wrong/normal/257/D.cpp
#include <cstdio> #include <cstdlib> #include <algorithm> using namespace std; int n, sign[100050], sign_s[100050], a[100050]; int main() { scanf("%d", &n); for (int i = 0; i < n; ++i) { scanf("%d", &a[i]); } sign[n - 1] = 1; sign_s[0] = 1; for (int i = n - 2; i >= 0; --i) { int plus = abs(a[i] + a[i + 1...
ALGO
0.999971
3.7276
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:34: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": "05a426c2b117...
b193533e-521a-4f3b-99bf-6662e3900a63
Rober11pg/Estructura
Parcial I/Deber Recursividad/PotenciasIgual.cpp
#include <iostream> using namespace std; int main() { int n, num; int leerN(int limInf, int limSup); void leerVector(int v[], int i, int n); void LeerNums(int n); n = leerN(0, 300); LeerNums(n); return 0; } int leerN(int limInf, int limSup) { int x; cout << "Ingresar un numero en el...
ALGO
0.99793
3.774664
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-08-11T02:15: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": "a3e6cfa09676...
0f248b6c-37ef-4899-bef1-3931936ba2f6
amir5200fx/Tonb
Common/Foam/include/base/cubicEqnI.hxx
#pragma once // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // inline tnbLib::cubicEqn::cubicEqn() {} inline tnbLib::cubicEqn::cubicEqn(const tnbLib::zero) : VectorSpace<cubicEqn, scalar, 4>(tnbLib::zero()) {} inline tnbLib::cubicEqn::cubicEqn ( const scalar a, const scalar b, co...
TOOL
0.967001
5.397604
{ "github_metadata": { "branch": "master", "commit_count": 2430, "repo_created_at": "2019-12-25T02:29:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 3, "issues": 29, "pull_requests": 1 }, "file_meta": { "content_id": "52c6a7...
5dc3e27a-d66a-48c5-9fe1-1e12bb74546d
Yunhyuk-Jeong/baekjoon
Solved/2108 통계학.cpp
//* https://www.acmicpc.net/problem/2108 //* Silver 4 #include <algorithm> #include <cmath> #include <iostream> #include <stdlib.h> using namespace std; int num[500001] = {0}; int cnt[8001] = {0}; int cmp(const void *a, const void *b) { if (*(int *)a > *(int *)b) return 1; else if (*(int *)a < *(int...
ALGO
0.9999
3.615123
{ "github_metadata": { "branch": "main", "commit_count": 51, "repo_created_at": "2020-06-27T13:08: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": "0c53f0900c7...
a3036dd4-786a-4fb9-9ded-7699c027ab21
Bruhout/fill-triangle
src/scanline.cpp
#include <iostream> #include <stdlib.h> #include <math.h> #include <chrono> #define STB_IMAGE_IMPLEMENTATION #include "../include/stb_image.h" #define STB_IMAGE_WRITE_IMPLEMENTATION #include "../include/stb_image_write.h" #include "../include/vec3d.h" // This file will help you understand the scanline triangle draw...
ALGO
0.96234
5.384081
{ "github_metadata": { "branch": "main", "commit_count": 33, "repo_created_at": "2024-06-17T03:49: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": "fc3cbe79478...
baede3ce-8b3c-428b-84f0-565b5410bdae
henrychoi/realtime
rtds/llsQ.cpp
#include <stdlib.h> #include "rtds/llsQ.h" void llsQ_dispose(struct llsQ* me) { me->_mask = me->_head = me->_tail = 0; } unsigned char llsQ_init(struct llsQ* me) { me->_head = me->_tail = 0; return 1; } void llsQ_free(struct llsQ* me) { llsQ_dispose(me); free(me->_q); me->_q = NULL; } unsigned char llsQ_allo...
ALGO
0.984745
4.494873
{ "github_metadata": { "branch": "master", "commit_count": 398, "repo_created_at": "2012-04-22T19:28:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4f3bdbe4...
406e3726-e422-49b0-995c-20dedf655014
bewuethr/stroustrup-ppp
code_snippets/Chapter19/chapter.19.2.4.cpp
// // This is example code from Chapter 19.2.4 "Push_back" of // "Programming -- Principles and Practice Using C++" by <NAME> // //------------------------------------------------------------------------------ class vector { int sz; // number of elements double* elem; // address of first element in...
TOOL
0.940484
5.284739
{ "github_metadata": { "branch": "main", "commit_count": 222, "repo_created_at": "2014-08-28T01:21:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 328, "forks": 126, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "5738d0...
73d09efa-1ef6-45f5-8666-baabde4b9ce6
Luodian/Code-contest
UVA/入门经典/part3/chapter9/9.2DAG上的动态规划/9-2online.cpp
//在线提交地址:http://acm.nyist.net/JudgeOnline/problem.php?pid=16 //另附0ms 236kb的DP思路:按边长降序排序,用类似LIS的方法求解,只是比较元素大小的方法变成了比较长和宽 #include<cstdio> #include<cstdlib> #include<cstring> #include<algorithm> #define maxn 1008 using namespace std; int G[maxn][maxn], a[maxn], b[maxn], d[maxn], n; int dp(int i){ int& ans = d[i]; if...
ALGO
0.999983
3.562216
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2017-08-05T02:53: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": "91d99f84b9...
69c8d950-5dee-4a09-a927-10be79b7a5a5
ishandutta2007/codeforces-j
joisino/normal/489/C.cpp
#include <bits/stdc++.h> #define FOR(i,a,b) for( int i = (a); i < (int)(b); i++ ) #define REP(i,n) FOR(i,0,n) #define YYS(x,arr) for(auto& x:arr) #define ALL(x) (x).begin(),(x).end() #define SORT(x) sort( (x).begin(),(x).end() ) #define REVERSE(x) reverse( (x).begin(),(x).end() ) #define UNIQUE(x) (x).erase( unique( ...
ALGO
0.999758
3.10195
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T05:42: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": "97c9cfe3eae6...
64c37021-1d79-433a-afc0-3bfa5e49677f
rockstarrrIsHere/SPOJ_Solutions
for_GIT/spoj_VONNY.cpp
#include<bits/stdc++.h> using namespace std; #define chkf(x,y) flag[x][y]==0 #define setf(x,y) flag[x][y]=flag[y][x]=1 #define clrf(x,y) flag[x][y]=flag[y][x]=0 int tot; int arr[10][10]; int flag[10][10]; int mark[10][10]; void count(int i,int j); int main(){ int t,i,j; scanf("%d",&t); while(t--){ f...
ALGO
0.999688
3.876493
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2015-06-16T05:38:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "efd5108643...
6e44feaf-e510-4f5a-aecf-40e4d636e3e4
manhhung2111/LeetcodeGrind
Day 025/Problem 143. Reorder List.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* reverseList...
ALGO
0.999915
6.177976
{ "github_metadata": { "branch": "main", "commit_count": 91, "repo_created_at": "2025-02-03T14:40: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": "1eb8e75eb8b...
c78c8d07-03a0-42bd-ba1c-51dde050b522
100sarthak100/DataStructures-Algorithms
Code/Graphs/rottenOranges.cpp
struct ret { int x; int y; }; bool isValid(int x, int y, int R, int C, vector<vector<int> > &matrix) { return (x >= 0 && y >= 0 && x < R && y < C && matrix[x][y] == 1); } bool checkAll(vector<vector<int> > &matrix) { for(int i = 0;i<matrix.size();i++) for(int j = 0;j <matrix[0].size();j++) ...
ALGO
0.999879
4.795925
{ "github_metadata": { "branch": "master", "commit_count": 40, "repo_created_at": "2020-05-25T14:43:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 5, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "2bdace704...
292fcc0b-a824-4a45-86b3-e01472e97498
ethz-asl/kalibr
aslam_optimizer/aslam_backend/include/aslam/backend/BlockCholeskyLinearSystemSolver.hpp
#ifndef ASLAM_BACKEND_BLOCK_CHOLESKY_LINEAR_SYSTEM_SOLVER_HPP #define ASLAM_BACKEND_BLOCK_CHOLESKY_LINEAR_SYSTEM_SOLVER_HPP #include "LinearSystemSolver.hpp" #include <sparse_block_matrix/linear_solver.h> #include <boost/shared_ptr.hpp> #include "SparseBlockMatrixWrapper.hpp" #include "aslam/backend/BlockCholeskyLine...
TOOL
0.91441
6.642892
{ "github_metadata": { "branch": "master", "commit_count": 359, "repo_created_at": "2014-05-29T12:31:48.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4839, "forks": 1450, "issues": 101, "pull_requests": 17 }, "file_meta": { "content_id": "...
5336e670-317f-4f60-9709-8f0e9eb88378
alisw/AliRoot
ITS/ITSsim/AliITSetfSDD.cxx
/************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors ...
TOOL
0.936419
4.751161
{ "github_metadata": { "branch": "master", "commit_count": 74535, "repo_created_at": "2016-03-07T09:20:12.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 57, "forks": 256, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "75bd...
e2cc521a-8409-45d4-a033-f1cf1ea1405a
NoirStar/CodingTest_Cpp
2023.11.30/10866_덱.cpp
#include <bits/stdc++.h> using namespace std; class CDeque { public: void ExecuteCommand(string& strCommand); private: void push_front(int n); void push_back(int n); int pop_front(); int pop_back(); int size(); bool empty(); int front(); int back(); private: deque<int> m_dDeque; }; void CDeque::push_fron...
ALGO
0.998986
4.948814
{ "github_metadata": { "branch": "main", "commit_count": 232, "repo_created_at": "2023-10-23T22:56: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": "1b42475692...
407e84cc-fe23-4840-a71a-eebf35dd5045
PhilipJulianBuschmann/laboratorioSimulazioneNumerica
ES_1/1.1/main.cpp
#include <iostream> #include <fstream> #include <string> #include <cmath> #include <algorithm> #include <cstdlib> #include "error.h" using namespace std; int main() { ofstream outC("OutputDataChiSq.txt"); //Output file containing chi squared ifstream in("OutputRNG.txt"); //File containing RNG numbers ofst...
ALGO
0.996115
3.484717
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-11-04T11:12:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0840175fc24a...
0c9c46f5-b4b4-49bd-9663-b59d5d878e5a
ROONEY07/DS-PHI
DS-PH/Assignment 1/Queries.cpp
#include<bits/stdc++.h> using namespace std; // create node class node { public: int val; node* next; // constructor node(int val) { this->val = val; this->next = NULL; } }; // print the node void print_node(node* head) { // cout<<"Linked list is: "; node* tmp = he...
ALGO
0.999711
4.63498
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2024-11-18T19:40: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": "3e55c265093...
638c6c7e-331d-44a3-b8fa-1a3ee53b0ee8
broadinstitute/tango
RankAbundance/src/RankAbundance.cpp
//======================================================================== // Project : RankAbundance // Name : RankAbundance.cpp // Author : <NAME> // Created on : Nov 1, 2013 // Version : 1.0 // Copyright : The Broad Institute // SOFTWARE COPYRIGHT NOTICE AGREEMENT // This software a...
DATA
0.980743
4.141238
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2014-09-25T18:56:37.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "33fbb470969...
fb9e2df7-f779-48ba-8fd4-d16f8eb05b93
azmainadel/nachos
Nachos 3/code/threads/synch.cc
// synch.cc // Routines for synchronizing threads. Three kinds of // synchronization routines are defined here: semaphores, locks // and condition variables (the implementation of the last two // are left to the reader). // // Any implementation of a synchronization routine needs some // primitive atomic operatio...
TOOL
0.910444
5.026446
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-01-26T16:57:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1d2ea015e0...
e8b5c78f-1e9c-46f3-9600-ede6116c74a3
ShravanChandrachud/Lp-V-Repo
hpc_practice/hpc_2.cpp
#include <iostream> #include <omp.h> using namespace std; void bubble(int a[], int n) { for (int i = 0; i < n - 1; i++) { for (int j = 0; j < n - i - 1; j++) { if (a[j] > a[j + 1]) { swap(a[j], a[j + 1]); } } } } void pBubble(int...
ALGO
0.999971
5.234637
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2025-05-04T08:29: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": "b7b5ebc375dd...
17eb4db6-a011-4a57-b778-c62551ae0a0c
ondra2305/BFScircus
dopravaV/main.cpp
#include <sstream> #include <string> #include <list> #include <vector> #include <stack> #include <queue> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <set> #include <algorithm> #include <memory> #include <cassert> using namespace std; class CTransport { public: void AddLine(istream...
ALGO
0.999291
3.93685
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2023-06-20T09:12: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": "adbd34267ed...
ea97a846-20c0-4e6f-8ca0-b31e2ef0e454
JJones30/Apatite-to-Zircon
MountFinder/MountFinder/MountFinder.cpp
// MountFinder.cpp : Defines the entry point for the console application. // #include "stdafx.h" #define EDGE_CONTOUR_AREA_LIMIT .95 //95 percent #define BLUR_THRESH_SIZE 101 //101 pixels #define CORNER_MIN_DISTANCE 1000 #define MIN_SIDE_LENGTH 50 #define PAUSETIME 1 #define MIN_ERROR_FOR_CORNER 3200 #pragma managed...
TOOL
0.951186
4.074847
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2014-10-23T18:26: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": "54a59bbcf...
32aab183-f452-4d63-a881-310123bb5c0f
jeremy3771/Vision_delivery
regulated_pure_pursuit/include/regulated_pure_pursuit/regulated_pure_pursuit.hpp
#ifndef REGULATED_PURE_PURSUIT__REGULATED_PURE_PURSUIT_HPP_ #define REGULATED_PURE_PURSUIT__REGULATED_PURE_PURSUIT_HPP_ #include <string> #include <vector> #include <memory> #include <algorithm> #include <mutex> #include <fstream> #include <yaml-cpp/yaml.h> #include "rclcpp/rclcpp.hpp" #include "std_msgs/msg/float64_...
TOOL
0.948418
6.995502
{ "github_metadata": { "branch": "main", "commit_count": 45, "repo_created_at": "2024-10-02T17:51:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "17f2aaaa94a...
cfbc4308-af2c-4ddf-a3db-2b2a17c28392
MarekHir/AoC_2022
day_3/main.cpp
#include <iostream> #include <fstream> #include <string> #include <list> #include <map> using namespace std; int get_value(char c) { if (c > 'Z') return c - 'a' + 1; return c - 'A' + 27; } int main() { string line, first, second; int sum = 0, sum_badges = 0; size_t length = 0, pos; if...
ALGO
0.998968
3.996008
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2022-12-08T21:18:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dd3cb37bd447...
51e2ca21-6ead-4986-84ce-52aef6b88b58
gustav0leal/MonkeysLIB
solutions/DataStructures/Segtree/wavelet_tree.cpp
/* WAVELET TREE, encontra o kth menor valor numa range [L,R] com queries em O(log n) Espacço e pre-processamento é em O(n log n) referencia: https://www.quora.com/How-can-you-build-a-data-structure-on-an-array-that-returns-kth-order-statistics-on-subarrays-in-logarithmic-time artigo : https://users.dcc.uchile.cl/~jper...
ALGO
0.999995
4.541813
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-11-30T21:57:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "07f54672b467...
022d9b65-291e-4b11-a834-701cf3f60afc
pranayjumde0812/CDAC-MARCH-2024
C++/Day-3/SurpriseTest/Que2SortAscDes.cpp
//Q2.Write a Program to sort the Array , First half in Ascending order and //the Second in Descending order. #include<iostream> using namespace std; int main(){ int arr [6] = {2, 7, 1, 90, 11, 88}; int lengthOfArray = sizeof(arr) / sizeof(int); for(int i= 0; i < lengthOfArray; i++){ for(int j = i+1 ; j...
ALGO
0.999683
4.022796
{ "github_metadata": { "branch": "main", "commit_count": 173, "repo_created_at": "2024-03-07T17:56:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "95e9fe773f...
d7070593-6f4b-4c4d-9493-a9d0bc0084c6
IlFrenk/C-exercises
Alg II/Pila3.Gerace.cpp
#include <stdio.h> int push(int t, int *a, int n){ // t=elemento da inserire nella pila, a=puntatore all'inizio array, n=dimensione array if(a[0]+1 == n) return 0; else{ a[0]++; // la pila sarą lunga 1 in pił a[a[0]] = t; return 1; } } int pop(int *t, int *a, int n){ // *t,*a = passaggio dei parametri per ...
ALGO
0.999402
3.565716
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2017-07-05T14:44: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": "6b6dc8749...
87bdb8f0-f096-4412-8b6d-9002582e3cb5
kimcodingvv/Problem-solving
BOJ/15906_변신 이동 게임.cpp
#include <bits/stdc++.h> #define FIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define FOR(a,b,c) for(int a = (b); a <= (c); a++) #define vi vector <int> #define vvi vector <vi> #define ep emplace #define eb emplace_back using namespace std; struct p { int v, w, x; bool operator < (const p& a) const { retur...
ALGO
0.999954
4.452744
{ "github_metadata": { "branch": "master", "commit_count": 56, "repo_created_at": "2020-01-24T16:29: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": "57bb18efe...
28e632e5-4787-4c86-9e63-7e49c759822b
eunsooLim/BeakJoon_algorithm_problem
queue_bfs/queue_bfs/main.cpp
#include<iostream> #include<cstdio> #include<queue> using namespace std; int tomato_array[1001][1001]; int check[1001][1001]; int m, n; int check_1=0; int dx[5] = { 1,-1,0,0 }; int dy[5] = { 0,0,1,-1 }; int main() { queue<pair<int, int>> q; scanf("%d %d", &m, &n); for (int i = 0; i<n; i++) { for (int j = 0; j<m;...
ALGO
0.999945
3.612597
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2017-02-27T00:56:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7ec208dc25...
f75899f7-a99b-49f9-8525-2cc25f409fc5
yancouto/maratona-sua-mae
Gi/timus/1306_2.cpp
#include <cstdio> using namespace std; int heap[125010]; int n; int max(int a, int b) { if(a > b) return a; return b; } void swap(int &a, int &b) { int aux = a; a = b; b = aux; } void update_heap(int no) { if(no == 1) return ; int pai = no / 2; if(heap[pai] < heap[no]) { swap(heap[pai], heap[no]); upda...
ALGO
0.999939
3.18438
{ "github_metadata": { "branch": "master", "commit_count": 490, "repo_created_at": "2015-06-27T20:54:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dc77bcbc...
57add026-c88d-4b68-897e-cb359183eafa
andersx/ls1-mardyn
src/particleContainer/adapter/VectorizedCellProcessor.cpp
/** * \file * \brief VectorizedCellProcessor.cpp */ #include "VectorizedCellProcessor.h" #include "CellDataSoA.h" #include "molecules/Molecule.h" #include "particleContainer/ParticleCell.h" #include "Domain.h" #include "utils/Logger.h" #include "ensemble/EnsembleBase.h" #include "Simulation.h" #include <algorithm>...
ALGO
0.991847
3.13139
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2014-10-21T16:30:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3ee1e35d89...
37bcd40a-2334-45be-9baf-58170d8e4e77
lionel-git/TestCses
TestCses/pb_min_coins.cpp
#include <iostream> #include <algorithm> #include <string> #include <fstream> #include <vector> #include <set> #include <map> #include <sstream> #include <chrono> #include <cassert> #include <stack> #include <cstdlib> #include <random> #include <functional> #include <queue> #define MY_TEST "c:\\tmp\\my_test.txt" #defi...
ALGO
0.999894
4.363613
{ "github_metadata": { "branch": "master", "commit_count": 53, "repo_created_at": "2020-06-28T13:01:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "53a72b111...
561d4edd-bc4e-4dab-be97-453abd5ec663
chenzhi87v5/LeetcodeOJ
029-DivideTwoIntegers.cpp
//Divide Two Integers 两数相除 /* Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT. */ //int取值范围: -2147483648 ~ 2147483647 //我们不能用乘法,除法和取余操作!所以只有加,减,位运算 class Solution { public: int divide(int dividend, int divisor) { // dividend = INT_MIN时 -dividend 溢出 lon...
ALGO
0.998661
4.908077
{ "github_metadata": { "branch": "master", "commit_count": 111, "repo_created_at": "2016-03-17T11:26:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d3fab55c...
b3e3bbb0-ebd8-4f3b-8d6c-09a3c425f552
lucasscharenbroch/kattis-solutions
lonerook.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for(int i = a; i < (b); i++) #define all(x) begin(x), end(x) #define sz(x) (int) (x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; void init_cin() { cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbi...
ALGO
0.999882
4.492534
{ "github_metadata": { "branch": "master", "commit_count": 147, "repo_created_at": "2023-02-26T14:49: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": "4a5bd7e8...
160ef08a-0bf2-4ca1-bd11-020458fe2043
uxlfoundation/oneDAL
cpp/oneapi/dal/algo/kmeans_init/compute_types.cpp
/******************************************************************************* * Copyright 2020 Intel 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.o...
ALGO
0.989651
7.057431
{ "github_metadata": { "branch": "main", "commit_count": 2361, "repo_created_at": "2016-03-28T22:39:32.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 636, "forks": 224, "issues": 23, "pull_requests": 37 }, "file_meta": { "content_id": "1f53...
218cc531-79de-4532-9fe5-53f4ec0eb88b
DUNE/garsoft
RecoAlg/KNNClusterAlg.h
// // KNNClusterAlg.h // // Created by <NAME> on 17.04.2019 // Based on MarlinReco simple clusetring algo // https://github.com/iLCSoft/MarlinReco/blob/master/Clustering/NNClustering/include/NNClusterProcessor.h // // Modification: Addition of usesTracks, <NAME> 21 Jun2019 // If we have more clustering algor...
ALGO
0.971619
6.442377
{ "github_metadata": { "branch": "develop", "commit_count": 1448, "repo_created_at": "2021-05-24T18:10:32.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "c2a8e77...
67dd9d0b-033f-4a02-a6e8-07a49a2910e7
kaash04/CodeChef
Practice/HOTEL.cpp
#include <bits/stdc++.h> #define nl printf("\n") #define sl(x) scanf("%lld", &x); #define fi(a, b, c) \ for (ll a = b; a < c; a++) #define fd(a, b, c) \ for (ll a = b; a > c; a--) typedef std::vector<long long> vll; typedef long long ll; /* -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
ALGO
0.999853
3.703467
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2023-01-27T09:46:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0e8537f37...
5c716749-ab1b-4c43-b012-729ed9c50c59
yunomeow/UVaPractice
uva318.cpp
#include<stdio.h> #include<stdlib.h> #include<string.h> int matrix[505][505]; int dis[505],vis[505]; int ABS(int a){ if(a < 0)return -a; else return a; } int main (){ int n,m,a,b,c,pos,MIN,x,y,type,ca=0; int i,j; double tmp,ans; while(1){ scanf("%d%d",&n,&m); if(n == 0 && m == 0)...
ALGO
0.999916
3.166846
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2018-09-04T14:12: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": "c15a5e9bae...
f722e3d6-5df6-4116-9c5a-d5842094ccbb
zzalscv2/FFEA
include/PoissonMatrixQuadratic.h
// // This file is part of the FFEA simulation package // // Copyright (c) by the Theory and Development FFEA teams, // as they appear in the README.md file. // // FFEA is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free ...
ALGO
0.936011
5.687209
{ "github_metadata": { "branch": "master", "commit_count": 2443, "repo_created_at": "2021-04-08T11:52:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "001561d...
3d5ca5bb-c566-4773-883e-1662b2b27f5d
VainKane/_Scripts
_Beginner2009/38/38A.cpp
#include <bits/stdc++.h> using namespace std; int const N = 3e5 + 5; int n; int a[N]; int z[N]; int p[N]; void ZFunc() { int l = 0; int r = 0; for (int i = 2; i <= n; i++) { int x = 0; if (i <= r) x = min(z[i - l + 1], r - i + 1); while (i + x <= n && a[i + x] == a[x + 1]) x...
ALGO
0.999988
3.922754
{ "github_metadata": { "branch": "main", "commit_count": 171, "repo_created_at": "2024-10-03T16:34: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": "7d48727830...
c54ee5b6-64bc-4940-856a-d95d5666383c
andriybuday/timus
volume4/1302_2Mar2007_1552325.cpp
//1302_AC_bad #include <cstdio> #include <cmath> void swap(int& a, int &b) { int temp = a; a = b; b = temp; } int dist_from_one(int n) { int curr_n = 1, curr_sum_n = 1, counter_n = 0; while (curr_sum_n <= n) { curr_sum_n += curr_n; curr_n += 2; counter_n++; } curr_n -= 2;// curr_sum_n -= curr_n;//max in...
ALGO
0.999991
3.388898
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2016-05-01T20:44: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": "ee96c4a2d6...
cd453233-01a7-4230-9886-d6b4830694d7
mukel/ProgrammingContests
OldStuff/Baltic/2001/POS.CPP
/* <NAME> 10 - 6 - 2008 BalticOI 2001 "Postman" */ #include <cstdio> #include <algorithm> #include <vector> using namespace std; typedef pair< int, int > par; #define REP( i, n ) \ for ( int i = 0; i < (n); i++ ) const int MAXV = 1000, MAXE = 100000; int V, E; int u, v; int used[MAXE]; vector< par > G[...
ALGO
0.999977
4.103652
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2013-10-16T00:48:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 16, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2cfcdd0...
71bd3961-8e79-47a6-bf0e-8ebeda0a8664
ImriShai/OS-FinalProject
GraphObj/vertex.hpp
#pragma once #include <vector> #include <algorithm> #include <iostream> #include <map> class Edge; class Vertex { private: // ID of the vertex size_t id; // List to store the edges connected to the vertex std::vector<Edge> edges; // <neighbour, weight to the neighbour> std::map<size_t,siz...
ALGO
0.91294
5.881993
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2024-09-01T15:09: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": "c0ad794f8ac...
d1a722ac-6667-45ad-b77c-3c34861c363f
nuclearkevin/doma
include/GCAngularQuadrature.h
#pragma once #include "TransportBase.h" #include "AngularPolynomials.h" #include <vector> #include <array> //------------------------------------------------------------------------------ // Gauss-Legendre-Chebyshev product quadrature here. //--------------------------------------------------------------------------...
ALGO
0.977251
6.530444
{ "github_metadata": { "branch": "main", "commit_count": 53, "repo_created_at": "2023-11-28T19:04: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": "8704129614e...
0f004a6e-5372-4887-97db-31022be2dec5
prohwww/WordCount
word_cnt.cpp
#include<iostream> #include<string> #include<fstream> #include<cstring> #include<algorithm> using namespace std; class Word{ private : string name; int cnt; public : Word(){ this -> name = ""; this -> cnt = 0; } Word(string wordName){ this -> name = wordName; this -> cnt = 1; } void addCnt...
ALGO
0.999028
3.77246
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2020-12-04T08:42: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": "2a8d2b17ad9d...
bdf91768-32d3-4d20-aa3c-05b14c1b3a65
iontorrent/TS
Analysis/BkgModel/Fitters/BkgModSingleFlowFitTMidNuc.h
/* Copyright (C) 2010 Ion Torrent Systems, Inc. All Rights Reserved */ #ifndef BKGMODSINGLEFLOWFITTMIDNUC_H #define BKGMODSINGLEFLOWFITTMIDNUC_H #include "LevMarFitterV2.h" #include "MathOptim.h" #include "DiffEqModel.h" #define BKG_CORRECT_BEFORE_FIT struct BkgModSingleFlowFitTMidNucParams { float Ampl; flo...
ALGO
0.987561
6.980913
{ "github_metadata": { "branch": "master", "commit_count": 49, "repo_created_at": "2012-01-13T15:25:43.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 44, "forks": 14, "issues": 30, "pull_requests": 7 }, "file_meta": { "content_id": "57c2490...
589235c2-507f-44ba-b52b-16c5d535ff1c
imexhausted/snipkeys
Config.hpp
#pragma once #include <fstream> #include <iostream> #include <vector> #include <array> namespace Config{ struct Pair{ std::string key; std::string value; long unsigned int triggerSize; long unsigned int valueSize; }; struct Key{ int code; std::string key; }; class Config { public: ...
CONFIG
0.950543
4.102384
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-03-15T22:57: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": "5e29c299baf0...
23656437-69cd-4ff3-b180-69e174986676
csbalotiya/Data-Structure-And-Algorithms
Dynamic Programming/Sliding Window/Minimum window subsequence substring.cpp
#include <bits/stdc++.h> using namespace std; string minWindow(string s, string t) { int sIndex = 0, tIndex = 0, start = -1; int m = s.length(), n = t.length(), minLength = m; string ss = s, tt = t; while (sIndex < m) { if(ss[sIndex] == tt[tIndex]) { // char match if(++tIndex == n) {...
ALGO
0.999968
5.50995
{ "github_metadata": { "branch": "main", "commit_count": 321, "repo_created_at": "2021-01-24T12:42:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0b888e322a...
d1517231-0a5b-4854-adc6-7469fa9297f2
kautsiitd/Competitive_Programming
CodeChef/Long/September 2017/SUMCUBE.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define rep(i,s,e) for(ll i=s; i<e; i++) #define pb push_back #define mp make_pair #define mod 1000000007 ll powTwo[100005]; vector< vector<ll> > graph(100005); ll edgeFrom[100005]; ll twoLevelEdgeFrom[100005]; unordered_m...
ALGO
0.999951
4.462804
{ "github_metadata": { "branch": "master", "commit_count": 279, "repo_created_at": "2016-05-23T15:56: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": "fb99103b...
8aa5adaf-eab5-460a-82a8-0e6d4ef7f9d0
johnathan79717/competitive-programming
CodeChef/HXOR/main.cc
// Create your own template by modifying this file! #include <string> #include <vector> #include <climits> #include <cstring> #include <map> #include <queue> #include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <set> #include <unordered_set> #include <unordered_map> #include <cassert> #i...
ALGO
0.999972
3.698888
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2016-04-07T07:50:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fb2fc5837...
6bd3ae3f-1851-4f5c-a6af-fbf1bf32bd7e
myunbin/algorithm-BOJ
Code/18784.cpp
#include <bits/stdc++.h> #define fio() ios_base::sync_with_stdio(0); cin.tie(0) #define all(x) (x).begin(), (x).end() #define pb(x) push_back(x) #define ppb(x, y) push_back({x, y}) using namespace std; typedef long long ll; typedef pair<int, int> pii; const int MAX_N = 2e5 + 5; const int MOD = 1e9 + 7; const int OFF = ...
ALGO
0.999933
4.526212
{ "github_metadata": { "branch": "master", "commit_count": 510, "repo_created_at": "2020-03-10T16:50: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": "5c64195a...
372856ce-b473-4443-9e88-f85d80ada6d9
ShujiaHuang/Cpp-Primer-Plus-6th
bookcodes/chapter16/list.cpp
// list.cpp -- using a list #include <iostream> #include <list> #include <iterator> #include <algorithm> void outint(int n) {std::cout << n << " ";} int main() { using namespace std; list<int> one(5, 2); // list of 5 2s int stuff[5] = {1,2,4,8, 6}; list<int> two; two.insert(two.begin(),stuff, stuf...
TOOL
0.976118
5.271485
{ "github_metadata": { "branch": "main", "commit_count": 83, "repo_created_at": "2021-07-15T08:44:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2796, "forks": 576, "issues": 9, "pull_requests": 2 }, "file_meta": { "content_id": "75e1ff...
5eda3c63-cf8c-43ab-805b-7818a1dbcd79
blackcub3s/FIB-PRO1
llista_P5/P89979/lines.cc
#include <iostream> #include <string> using namespace std; bool es_ordenada(int n) { string par1; cin >> par1; int i = 1; bool lexi_ok = true; while (i <= (n-1)) {//ja pillo un caracter al principi (d'aqui -1) string par2; cin >> par2; //comprovo ordre lexico...
ALGO
0.999269
3.83121
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-11-09T15:06: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": "1046d19173a7...
834e39d6-59a4-4268-9829-49bd8235bf1f
exmanka/study_2020-2021_cpp
lab1/Begin_40.cpp
#include <iostream>> using namespace std; int main() { setlocale(LC_ALL, "Rus"); float A1, A2, B1, B2, C1, C2, D, x, y; cout << "Введите A1" << endl; cin >> A1; cout << "Введите A2" << endl; cin >> A2; cout << "Введите B1" << endl; cin >> B1; cout << "Введите B2" << endl; cin >> B2; cout << "Введите C1" << ...
ALGO
0.999861
3.562818
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2020-11-16T22:54: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": "ff9f2ceea4e...
9ff9225c-29b8-4734-b4c2-f59e8d47f6ee
emotionless/Google_interview_question_solution
975_Odd_Even_Jump.cpp
class Solution { public: int oddEvenJumps(vector<int>& A) { int n = A.size(); vector<vector<int>> dp(n, vector<int>(2, 0)); dp[n-1][0] = dp[n-1][1] = 1; map<int, int> container; int ans = 1; container[A[n-1]] = n-1; for(int i = n-2; i >= 0; i--) { ...
ALGO
0.999971
4.697216
{ "github_metadata": { "branch": "master", "commit_count": 132, "repo_created_at": "2020-05-21T20:50:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 23, "forks": 12, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "2e0bf8...
ec8fd8fb-901e-45b1-8d6f-2e8085aadbee
stwc/OJ
LeetCode/cpp/8 - String to Integer (atoi).cpp
class Solution { public: int myAtoi(string str) { bool sign = false; int num = 0, i; // Ignore spaces for (i = 0; i < str.size() && str[i] == ' '; ++i) ; if (str[i] == '-' || str[i] == '+') { if (str[i] == '-') { sign = true; ...
ALGO
0.998275
5.177589
{ "github_metadata": { "branch": "master", "commit_count": 166, "repo_created_at": "2017-09-23T16:35: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": "0e4ac52c...
f0e21cd9-92ec-4d95-a270-dc954ad87deb
VaibhavGaikwad03/Problems-on-Linked-List-in-CPP
Display_Palindrome/Display_Palindrome.cpp
/* Write a program which accepts input from user in linked list and display palindrome numbers. Input Linked List : |11|->|28|->|17|->|414|->|6|->|89| Output : 11 6 414 */ #include<iostream> #include"LinkedList.h" //user defined header file using namespace std; class Solution { p...
ALGO
0.999881
5.372431
{ "github_metadata": { "branch": "main", "commit_count": 71, "repo_created_at": "2022-07-26T10:49:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2cb9c6aa738...
8b16974e-3729-4fe5-b227-23b4f4c2f44c
uttom-akash/Problem-Solving-Second-Phase-2020
leetcode/2001. Number of Pairs of Interchangeable Rectangles.cpp
#include <bits/stdc++.h> #define mx 10000 #define mod 1000007 #define ll long long using namespace std; // fill_n(&a[0][0], ntc * ntc, -100); void optimize() { ios_base::sync_with_stdio(0); cin.tie(0); } void setupFileIO(string fin = "input.txt", string fout = "output.txt") { freopen(fin.c_str(), "r", ...
ALGO
0.999777
4.844521
{ "github_metadata": { "branch": "main", "commit_count": 49, "repo_created_at": "2020-10-26T17:27:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6b7aaf82bfa...
c8b2dc77-b338-4dab-b3aa-8e8a4c99b2f3
jad3sprite/cppFunctionPractice
functionPractice/functionPractice.cpp
// simple addition and multiplication calculator // modular so it can be expanded for multiple different kinds of math! // using if statements to give an options menu :) #include <iostream> // for cin and cout #include <cmath> // for higher level math functions int userData() // function to get user inputs { int us...
TOOL
0.919973
3.889011
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-09-16T19:25: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": "7451c1a775e2...
8bf2ec25-fe13-4622-9085-1428621b7ba4
foruniverse/C-
redbalck.h
#ifndef REDBLACK_H_ #define REDBLAXK_H_ #include"bst.h" /* 黑深度: 从根节点通往任一节点的沿途,经过黑节点的个数(除去根节点本身) 根节点深度为0 黑高度:从任一节点通往任一后代外部节点的黑节点个数(不包括外部节点) 任一外部节点到根节点的沿途,黑节点个数相等 */ #define isblack(p) (!(p)||(RB_BLACK==(p)->color)) #define isred(p) (!isblack(p)) #define blackheightupdated(x) (...
ALGO
0.995145
4.183832
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2020-06-28T13:51:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c247ab05cc...
8e38419e-733c-4555-8da3-3ae11888458e
ytsaurus/ytsaurus
contrib/python/scipy/py3/scipy/_lib/highs/src/ipm/ipx/src/ipx_c.cc
#include "ipx_c.h" #include "ipx_internal.h" #include "lp_solver.h" using namespace ipx; struct ipx_parameters ipx_default_parameters() { ipx_parameters p; p.display = 1; p.logfile = nullptr; p.print_interval = 5.0; p.time_limit = -1.0; p.analyse_basis_data = false; p.dualize = -1; p.s...
TOOL
0.995024
6.26724
{ "github_metadata": { "branch": "main", "commit_count": 83261, "repo_created_at": "2022-12-05T16:32:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2063, "forks": 164, "issues": 335, "pull_requests": 38 }, "file_meta": { "content_id": "4...
1d58a787-6a24-41b5-9977-1e98feeebbd6
LPeter1997/CppCmb
examples/expression.cpp
/** * A simple expression parser and evaluator. Evaluates user-input. * Supports +, -, *, /, ^ and grouping with parenthesis. * Correctly handles precedence associativity. */ #include <cctype> #include <cmath> #include <iostream> #include <string> #include "../cppcmb.hpp" namespace pc = cppcmb; template <char Ch...
ALGO
0.991455
6.900103
{ "github_metadata": { "branch": "master", "commit_count": 190, "repo_created_at": "2018-09-07T08:51:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 121, "forks": 8, "issues": 5, "pull_requests": 0 }, "file_meta": { "content_id": "5bd2e7...
2de808bb-bf20-4232-bcc6-ed306a5e1c75
xiaoyaohfb/PAT-learning
B1005.cpp
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; bool cmp(int a, int b){ return a > b; } int main(){ int n, a[110], t[110]; bool HashTable[1100] = {false}; scanf("%d", &n); for (int i = 0; i < n; i++){ scanf("%d", &a[i]); int temp = a[i]; while (temp != 1){ if (...
ALGO
0.999997
4.444113
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2018-08-06T06:28: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": "039b995c8...
56c3909a-bc08-47e8-916f-3066df3f71a7
vineetyadav2403/Data-Structures
String/KMP.cpp
#include <bits/stdc++.h> void computeLPSArray(char* pat, int M, int* lps); // Prints occurrences of txt[] in pat[] void KMPSearch(char* pat, char* txt) { int M = strlen(pat); int N = strlen(txt); // create lps[] that will hold the longest prefix suffix // values for pattern int lps...
ALGO
0.99998
4.923949
{ "github_metadata": { "branch": "master", "commit_count": 137, "repo_created_at": "2020-09-26T14:45: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": "ad95c893...
d4c0079f-106c-4818-98da-494000907426
SiChiTong/librobotics
librobotics/src/lb_map2_grid.h
/* * lb_map2_grid.h * * Created on: Jan 15, 2009 * Author: mahisorn * * Copyright (c) <2009> <<NAME>> * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restrictio...
TOOL
0.989812
6.467293
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2016-04-11T08:50:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0271d7897...
93d1d84a-2f33-43f7-afb1-6c92b5ba7270
ShailavMalik/DSA
LinkedList/4-ReverseInK.cpp
#include <iostream> //#include "ll.h" using namespace std; class Node { public: int data; Node *next; // Constructor Node(int d) { data = d; next = NULL; } }; void insertAtTail(Node *&tail, int d) { // create new node Node *newNode = new Node(d); // point the pointe...
ALGO
0.999961
4.908103
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2022-08-18T09:46:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3ece14a1203c...
0cd8fc7a-c992-4320-aff3-e641f6ddf15d
ibsson/Program
BKJN/분할 정복/20250204_bkjn_2630(색종이 만들기).cpp
#include <iostream> using namespace std; #define MAX 129 int cnt_0, cnt_1; int paper[MAX][MAX]; bool isSame(int r, int c, int N) { int num = paper[r][c]; for (int i = r; i < (r + N); i++) { for (int j = c; j < (c + N); j++) { if (num != paper[i][j]) return false; } } return true; } void div(int r, int ...
ALGO
0.999871
4.330634
{ "github_metadata": { "branch": "main", "commit_count": 1692, "repo_created_at": "2022-02-17T03:03:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0fdebdd03...
f086d91d-3049-4858-846d-7b51563ccfae
sweeneychris/TheiaSfM
src/theia/sfm/pose/position_from_two_rays.cc
// Copyright (C) 2013 The Regents of the University of California (Regents). // 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...
ALGO
0.997295
6.664919
{ "github_metadata": { "branch": "master", "commit_count": 958, "repo_created_at": "2015-02-11T18:15:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 933, "forks": 280, "issues": 36, "pull_requests": 10 }, "file_meta": { "content_id": "1b...
74525f86-2ba2-4e82-8540-587937c829e8
KennethOng02/NTNU-Algorithm
hw2/pE.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int lcs(vector<int>& seq1, vector<int>& seq2) { vector<vector<int>> index_map(1000001); for(int i = seq1.size() - 1; i >= 0; i--) { index_map[seq1[i]].push...
ALGO
0.999976
4.59848
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2023-03-31T14:35: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": "e0b76c910981...
e87d55b1-77f5-413c-90c5-31a6b789954f
Elysiason/learngit
first/map_block.hpp
// encoding: GB2312 #pragma once #include <iostream> #include <vector> #include <string> using namespace std; struct block_location { char geo[3][3]; int x, y; }; block_location L_locat ={{ {'L','L',' '}, {'L',' ',' '}, {'L',' ',' '}}, 1, 1 }; /* ^ | L ' ' L[2][] | L ' ' L[1][] | L L ' L[0][] --------> ...
ALGO
0.992048
3.275123
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2025-01-12T12:20: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": "349f5275c8...
bbe2cc0f-eeea-460d-8a90-0729a525f8e5
JacobHNU/DataStructure
dsforseu/dsforseu_2_deleteSame.cpp
#include<iostream> #include<set> #include<algorithm> using namespace std; #define MAXSIZE 50 typedef int Elemtype; typedef struct { int len; Elemtype data[MAXSIZE]; }SqList; //有序顺序表采用类似直接插入法思想 //初始时将第一个元素看作非重复的有序表,之后以此判断后面的元素是否与前面非重复的最后一个元素是否相同(所以此处必须为有序顺序表), //如果相同则继续往后找,如果不同则加入非重复有序表的最后一个,直至判断到表尾为止 bool deleteSa...
ALGO
0.999411
4.109925
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2019-07-18T14:18: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": "8706f3576...
696e2aca-ca45-4b11-b6b2-fd34fbe321ba
amumu-dev/nokuno
cc/topcoder/AnagramFree.cpp
#include <cstdio> #include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include <complex> #include <stack> #include...
ALGO
0.99962
4.20226
{ "github_metadata": { "branch": "master", "commit_count": 502, "repo_created_at": "2011-09-23T04:43:26.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a57b026b7...
d066e6dd-cb25-4b07-8b1a-adc83b2c9a36
AndrewZzz24/University-projects
Algorithms-and-Data-Structures/Lab 2/Task 2/main.cpp
#include <iostream> #include <vector> #include <string> using namespace std; struct racer { string country; string name; }; void merge(vector<racer> &a, long long levo, long long sred, long long pravo) { long long d1,d2,x=0,y=0,q=-1; d1=sred-levo+1; d2=pravo-sred; vector<racer> lv(d1+1); v...
ALGO
0.99998
3.471121
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-02-19T17:28:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7080f62c725f...
dc62b845-3d85-4a7d-831e-ca0934f0d793
yingziyu-llt/OI
c/vjudge/DP/树形DP/Luogu P3177(无法通过加强版数据.cpp
#include<stdio.h> #include<algorithm> #include<string.h> using namespace std; #define LL long long struct Edge { int to,nxt,val; }e[4400]; int ehead[2200],ecnt; void addedge(int from,int to,int val) { e[++ecnt] = (Edge){to,ehead[from],val}; ehead[from] = ecnt; return ; } long long f[2200][2200],sum[2200]; int k,n,...
ALGO
0.999793
3.62669
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-04-05T08:41:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0ea8824c8f16...
65bb4617-8201-422b-8c53-609339050e0c
Yeagerist-Nandini/Dsa
graphs/DSU/Union.cpp
// Disjoint Union Set (DSU) // Union -Find //-cycle in an undirected ->kruskal's Algo //tells us if some component belongs to same or other component #include <bits/stdc++.h> using namespace std; // find=>set of the node // union =>merge 2 sets into one class dsu { list<pair<int, int>> l; int n; public: ...
ALGO
0.999659
5.275017
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2022-07-05T17:13: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": "887eb9aa6311...