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
bddb6193-c328-4a1c-886a-056e30288da0
yury-fedorov/AoC
AoC22/cpp/day17.cpp
#include "absl/container/flat_hash_map.h" #include "common.h" namespace day17 { using Long = long long; using Point = std::pair<int, Long>; using Chamber = std::deque<std::string>; // as we insert in the beginning using Rock = std::vector<Point>; constexpr int kChamberWidth = 7; using Profile = uint64_t; struct JetP...
ALGO
0.99672
5.592069
{ "github_metadata": { "branch": "master", "commit_count": 1762, "repo_created_at": "2018-12-03T20:21:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 3, "issues": 1, "pull_requests": 2 }, "file_meta": { "content_id": "b301079...
2cca8a9e-d540-4a8b-b821-139cde97751c
samarth-bhargav/Competitive_Programming
Codeforces/Problems/B/875B.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while (t--){ int n; cin >> n; vector<int> a(n), b(n); map<int,int> mp, mp1; for (int i = 0; i < n; i++){ cin >> a[i]; } for...
ALGO
0.999967
3.93603
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2022-04-07T15:40: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": "e08060cef13...
703fd4d6-6f51-4ee8-b858-abcb9ce61621
srinathmkce/Project-Euler
prob41.cpp
#include <iostream> #include <vector> #include <cmath> #include <stack> using namespace std; int findLargestIndexK(vector<int> perm); int findLargestIndexL(int k, vector<int> perm); void reverseSequence(int start, int end, vector<int> &perm); bool binarySearch(vector<int> &primes, int key, int min, int max); void gen...
ALGO
0.999838
4.280315
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2015-06-30T00:04:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "91496afad1...
ba850df4-60e8-4b07-90bb-17a121fdf4cb
srmacario/competitive-programming
examples/homework/1/little_pony.cpp
#include <bits/stdc++.h> using namespace std; #define st first #define nd second #define pb push_back #define cl(x,v) memset((x), (v), sizeof(x)) #define db(x) cerr << #x << " == " << x << endl #define dbs(x) cerr << x << endl #define _ << ", " << typedef long long ll; typedef long double ld; typedef pair<int,int> p...
ALGO
0.999765
3.767761
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2020-03-20T13:55:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9d7fdee89...
6242a2db-c98f-4295-bbf4-24df821da2d0
dothegee/c-
ch10_템플릿과표준템플릿라이브러리(STL)/ch10_템플릿과표준템플릿라이브러리(STL)/10_12.cpp
// map은 '키'와'값'의 쌍을 원소로 저장하고 '키'를 이용하여 값을 검색하는 제네릭 컨테이너 // 키나 값은 기본 타입(int, double 등), 클래스 타입 모두 가능하지만, // 동일한 키를 가지는 원소가 중복 저장되면 오류가 발생 // map을 이용하기 위해서는 다음과 같이 <map>헤더 파일과 using 지시어가 필요 // map<string, string> dic; // 키는 영어 단어, 값은 한글 단어 // map의 insert() 멤버 함수나 []연산자를 사용하여 다음과 같이 원소를 저장 // dic.insert(make_pair("love","...
TOOL
0.920509
3.864569
{ "github_metadata": { "branch": "master", "commit_count": 67, "repo_created_at": "2023-04-24T07:15:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f87367572...
42a3745f-a313-414b-8dbe-0f2e05f2463f
HandIeNeeded/Retired
Timus/1021.cc
/************************************************************************* > File: 1021.cc > Author: <NAME> > Mail: <EMAIL> > Created Time: Thu Jan 5 19:00:09 2017 *************************************************************************/ #include <vector> #include <cstdio> #include <bits...
ALGO
0.99997
4.089132
{ "github_metadata": { "branch": "master", "commit_count": 121, "repo_created_at": "2015-12-20T14:09: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": "082f7f1f...
1efe284b-91ea-4f55-a2e5-757bef5d8ffd
sanket-telunagi/solid-lang-bridge
QUESTIONS/Recurrsion-Backtracking/permutaions.cpp
/* Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order. Input: nums = [1,2,3] Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]] */ #include <bits/stdc++.h> #include <iostream> using namespace std ; void genPermutaions(vector<...
ALGO
0.999957
5.62809
{ "github_metadata": { "branch": "main", "commit_count": 51, "repo_created_at": "2025-01-11T05:09:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d6e46be6676...
b7b8162f-0387-4193-b2e8-85bdfd64a619
KuriyamaMiraiQcy/c-
jq.cpp
#include <iostream> #include <unordered_set> #include <set> #include <string> #include <cmath> #include <unordered_map> const int directions[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}}; int unique_string(std::string str) { ...
ALGO
0.999912
4.885376
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2023-01-23T19:52: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": "26539137562...
1584389e-6408-4481-b2a7-c4802a00b749
durgirajesh/Leetcode
Implement Stack using Queues.cpp
class MyStack { public: /** Initialize your data structure here. */ queue<int> q1; queue<int> q2; MyStack() { queue<int> q1; queue<int> q2; } /** Push element x onto stack. */ void push(int x) { q1.push(x); } /** Removes th...
ALGO
0.999783
5.635219
{ "github_metadata": { "branch": "master", "commit_count": 55, "repo_created_at": "2021-07-06T06:31: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": "8e9c0d109...
16ef6e9b-ff3c-4949-8db7-de394a3512c4
drlongle/leetcode
algorithms/problem_1242/solution.cpp
/* 1242. Web Crawler Multithreaded Medium Given a url startUrl and an interface HtmlParser, implement a Multi-threaded web crawler to crawl all links that are under the same hostname as startUrl. Return all urls obtained by your web crawler in any order. Your crawler should: Start from the page: startUrl Call HtmlPa...
ALGO
0.998099
6.330423
{ "github_metadata": { "branch": "master", "commit_count": 1430, "repo_created_at": "2017-02-08T14: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": "948a3db...
2108213e-1ad2-4601-bcc0-36a6d3d81156
Tagore22/algorithmSolve
algorithmSolve/백준/1261_1.cpp
#include <iostream> #include <deque> using namespace std; //힌트에 있던 0-1BFS를 찾아서 대입한 풀이. //기존 BFS와 크게 다르지는 않으나, 정렬을 위해 컨테이너에 앞뒤로 원소를 삽입해야하기에 queue대신 deque가 사용되었다. //풀이 //기존 풀이와 풀이 자체는 같다. 다만 0-1BFS와 deque의 특성에 따라 다음 정점으로 나아가는 과정에서 가중치가 추가된다면 //최소 가중치에서 멀어지기에 deque의 앞이 아닌 뒤에 두어 결과적으로 연산량을 줄이기에 최적화되었다. //그러므로 시간복잡도도 구하...
ALGO
0.999978
4.349514
{ "github_metadata": { "branch": "master", "commit_count": 1452, "repo_created_at": "2022-04-27T10:40: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": "3a52da1...
1ea90ddc-fb87-4d77-940f-11c661e6f51c
tron2003/DSA
test143.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; // st. void dfs(vector<vector<int>> arr, int i, vector<int> &vis, stack<int> &st) { vis[i] = true; int n = arr.size(); for (auto x : arr[i]) { if (!vis[x]) { dfs(arr, x, vis, st); } } st.push(...
ALGO
0.999965
6.318442
{ "github_metadata": { "branch": "main", "commit_count": 152, "repo_created_at": "2024-03-10T14:17: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": "145ea4498c...
018a313e-6729-4db5-a146-72910d29269f
KOSAQ/tessoku-book
b09/main.cpp
#include <iostream> using namespace std; int N; int A[100009], B[100009], C[100009], D[100009]; int T[1509][1509]; int main() { cin >> N; for (int i = 1; i <= N; i++) cin >> A[i] >> B[i] >> C[i] >> D[i]; for (int i = 0; i <= 1500; i++) { for (int j = 0; j <= 1500; j++) T[i][j] = 0; } for (int i = 1; i <= N; ...
ALGO
0.999826
3.925227
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2023-06-20T04:46: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": "af1487e15df...
41cbb81a-693c-469d-9296-8d3d1bc021f6
Hangjun/CPPLeetCode
317. Shortest Distance from All Buildings.cpp
/* You want to build a house on an empty land which reaches all buildings in the shortest amount of distance. You can only move up, down, left and right. You are given a 2D grid of values 0, 1 or 2, where: Each 0 marks an empty land which you can pass by freely. Each 1 marks a building which you cannot pass through. E...
ALGO
0.999986
5.124113
{ "github_metadata": { "branch": "master", "commit_count": 852, "repo_created_at": "2013-11-06T14:49:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e9beb6c8...
fe482868-5f8d-45a9-98e5-125848255292
aldew5/Competitive-Programming
Algorithms and Data Structures/Long_Multiplication.cpp
using namespace std; /* Arguments are vectors with each index representing an integer and its place in a number. Designed to multiply integers too big to be stored by an unsigned long long. */ vector<int> LongMulti(vector<int> x, vector<int> y){ vector<vector<int> > rows; vector<int> ans = {0}; vector<int...
ALGO
0.999936
4.540035
{ "github_metadata": { "branch": "master", "commit_count": 457, "repo_created_at": "2020-04-13T14:58:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f338ebcb...
637e230c-a344-40d3-95b3-dac1bfb2aa0a
mehulbakhshi02/HDG_ML_Git
HDG/prolongateorder.h
template <int D, int COMP, class Model> void UnifyingFramework<D, COMP, Model> ::ProlongateOrder(const Solution & sol_old, Solution & sol_new, const int delta_order) { ProlongateOrder(sol_old, sol_new, delta_order, fadata, eldata); } template <int D, int COMP, class Model> void UnifyingFramework<D, COMP, Model> :...
ALGO
0.996765
4.970325
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2024-11-01T12:56: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": "1c75ea155df...
5d75d5d3-7c3c-4325-b6bb-5a2d6dd7b1ff
AnkithReddy02/fast-recompression
tools/bm-text-to-lz77/include/utils/bm_compression.hpp
#ifndef BM_COMPRESSION_HPP #define BM_COMPRESSION_HPP #include "hash_table.hpp" #include "space_efficient_vector.hpp" #include "packed_pair.hpp" #include "utils.hpp" #include "../typedefs.hpp" #include "karp_rabin_hashing.hpp" using namespace std; using namespace karp_rabin_hashing; using namespace utils; template<>...
ALGO
0.999647
5.588719
{ "github_metadata": { "branch": "main", "commit_count": 153, "repo_created_at": "2025-06-07T06:56:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "484524a345...
1a909409-4394-479c-9f3b-044fc95fcc03
jul17/project1.2
сode_of_lab4(II).cpp
#include <iostream> #include "math.h" #include"iomanip" #include"conio.h" #define R 5 using namespace std; class Matrix { private: double M[R][R]; public: void InputMatrix(); void OutputMatrix(); void Sort(); void AverageArihmetic(); void MuitiplicationOfAverageArihmetic(double *); }; void Matrix::InputMatrix...
ALGO
0.999516
3.500297
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2017-10-22T10:03: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": "19b649082f...
46289cd8-00e8-4a5b-a8d9-d7f4be83d19c
aig-hagen/algorithms_for_acceptable_arguments
lib/cryptominisat-5.11.21/src/clausecleaner.cpp
/****************************************** Copyright (C) 2009-2020 Authors of CryptoMiniSat, see AUTHORS file Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including withou...
ALGO
0.997555
6.285233
{ "github_metadata": { "branch": "main", "commit_count": 116, "repo_created_at": "2024-03-13T14:13:15.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2723b6fa8d5...
f3f8a945-e58a-4153-b604-2bbb25504c56
muye5/muye5code
kinds_of_trees/SegementTree/min_inversion_num_segment_tree.cc
// Copyright (c) 2012 Tencent Inc. // Author: Muye (<EMAIL>) // http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=484 // Minimum Inversion Number // 4N的空间,让我汗了好久好久 // 因为它是一种平衡树,而非完全树,其最后一层的节点并不是连续的从左到右分布的 #include <iostream> using namespace std; struct Node { int left, right; int num; }; const int M...
ALGO
0.999911
3.794708
{ "github_metadata": { "branch": "master", "commit_count": 159, "repo_created_at": "2012-09-26T11:52:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c17d4718...
925aa551-67dd-4a52-acf1-0c791ed36fc6
Aaditya-Kumar-Mittal/Striver-DSA-Course
C++ Animations/donut.cpp
#include <iostream> #include <cmath> #include <cstring> #include <chrono> #include <thread> // Include the thread library #include <windows.h> #include <winbase.h> using namespace std; // Use the entire std namespace const int width = 80; // Console width const int height = 22; // Console height const float pi = 3.1...
ALGO
0.973046
6.007221
{ "github_metadata": { "branch": "master", "commit_count": 308, "repo_created_at": "2023-12-18T18:09:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "64dab6c9...
d8303c19-ab3e-4158-8e7a-42106ce8a341
Thasin-Sheikh/Codeforces-Solutions
1250L .cpp
///*<NAME>***/// /***Stay_Home_Stay_Safe***/ ///**Author <NAME>**/// #include<bits/stdc++.h> using namespace std; #define MAX 1e6+10 #define MOD 1000000007 #define PI 3.14159265359 #define makefast__ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); using ll=long long int ; using dl =double; using ull=unsigned...
ALGO
0.999957
4.089989
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2023-03-27T10:45:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d340ba9b9...
9e9b652a-670d-4bca-a7f6-3a06d0909765
flioink/sampleCode
wordTransformationProgram12.cpp
#include <iostream> #include <vector> #include <map> #include <fstream> #include <sstream> using namespace std; map<string, string> buildMap(ifstream& ifs) { map<string, string> m; for(string key, value; ifs >> key, getline(ifs, value);) { m[key] = value.substr(1).substr(0, value.find_last_not_of...
TOOL
0.949019
4.450158
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2019-08-23T17:32: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": "3a805bd13...
20e11ea5-dbe0-4dd8-b517-8d883ac613ec
tiankonguse/leetcode-solutions
problemset-new/008/00875-koko-eating-bananas/202505-875.cpp
#ifdef USACO_LOCAL_JUDGE #include <bits/stdc++.h> #include "base.h" using namespace std; #endif int debug = 1; #define MyPrintf(...) \ do { \ if (debug) printf(__VA_ARGS__); \ } while (0) typedef long long ll; class Solution { public: int minEatingSpeed(vector<i...
ALGO
0.999906
5.086668
{ "github_metadata": { "branch": "master", "commit_count": 1037, "repo_created_at": "2015-04-11T09:31:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 81, "forks": 26, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "20b99...
e4c69c65-5353-4f47-9250-a7bbc0342c59
ishandutta2007/codeforces-e
eecs/normal/1146/G.cpp
#include <bits/stdc++.h> using namespace std; const int maxn = 52; int n, h, m, f[maxn][maxn][maxn]; struct node { int l, r, x, c; } a[maxn]; int main() { scanf("%d %d %d", &n, &h, &m); for (int i = 1; i <= m; i++) { scanf("%d %d %d %d", &a[i].l, &a[i].r, &a[i].x, &a[i].c); } memset(f, -1, siz...
ALGO
0.999723
4.103155
{ "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": "89b48d2f7d05...
98c18708-1ae6-496e-bcc5-2440dabb2e1a
cga57/C-Projects
challenge9.cpp
#include "cmpt_error.h" #include <cassert> #include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; int evaluate(int num1, char c1, int num2){ cout << num1 <<" " << num2 << endl; int result = 0; switch(c1) { case '*' : result = num1*num2;; // prints "1" br...
ALGO
0.988108
3.521106
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2020-03-11T06:05:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5046e4b93d...
ff7522e3-86b4-41d8-a36e-02e672a146c3
ZCXu1/HUST-CSE-Experiments
算法设计与分析/并查集/村村通.cpp
#include<iostream> #include<queue> #include<vector> #include<algorithm> #define rep(i,l,r) for(ll i=(l);i<=(r);++i) #define rpe(i,r,l) for(ll i=(r);i>=(l);--i) typedef long long ll; using namespace std; inline ll max(ll x,ll y){return x>y?x:y;} inline ll read(){ ll x=0,f=1;char ch=' '; while(ch<'0' || ch>'9'){i...
ALGO
0.999809
3.806167
{ "github_metadata": { "branch": "main", "commit_count": 57, "repo_created_at": "2022-06-18T14:15:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 355, "forks": 60, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "1842e162...
4e9b9b62-735a-49ea-8c94-44b5a1d5bd3f
andremmvgabriel/advent-of-code-2021
day_10/main.cpp
#include <fstream> #include <string> #include <vector> #include <stdexcept> #include <unordered_map> #include <algorithm> #include <cstdint> #include "../common/utils.hpp" std::vector<std::string> parse_inputs(int argc, char* argv[]) { // Makes sure a input file is specified if (argc <= 1) throw std::invali...
ALGO
0.992602
6.014587
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2023-01-28T21:54:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "108151a9c83...
a403453b-1446-4c14-beb6-22e69efa0705
Cube219/PS
BOJ/18000~19000/18782 - Delegation (Gold).cpp
#define _CRT_SECURE_NO_WARNINGS 1 #define _CRT_DECLARE_NONSTDC_NAMES 0 // for using y1 as variable name #include <iostream> #include <cstdio> #include <utility> #include <algorithm> #include <vector> using namespace std; using ll = long long int; int n; vector<int> g[100001]; bool res[100001]; vector<int> dp[100001]...
ALGO
0.999969
3.909161
{ "github_metadata": { "branch": "main", "commit_count": 1172, "repo_created_at": "2021-01-20T03:42: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": "c7d06421a...
f14c59dd-5eb8-4ac2-891e-8f1380d874cf
dejanpan/mapping-private
realtime_perception/realtime_segmentation/src/realtime_segmentation.cpp
/* * Software License Agreement (BSD License) * * Copyright (c) 2010, <NAME>, Inc. * 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 reta...
ALGO
0.979358
5.471941
{ "github_metadata": { "branch": "master", "commit_count": 1499, "repo_created_at": "2013-07-17T03:37:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "035b0c4...
a018fde0-e6e3-4ea6-8821-9e859c836069
algoridam61/Competitive-Programming
Problems/C_Division_and_Union.cpp
#include <bits/stdc++.h> #include <algorithm> #include <cmath> #include <bitset> #include <string> #include <cstring> #include <cstdio> #include <cstdlib> #include <ctime> #include <iomanip> #include <cassert> #include <climits> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll...
ALGO
0.999863
3.88671
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2025-07-11T11:14: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": "247927e7727f...
50429d34-ad3b-4117-9f76-406e4abee2bf
Unsigned-Long/River
include/factor/radar_factor.hpp
// River: A Tightly-Coupled Radar-Inertial Velocity Estimator Based on Continuous-Time Optimization // Copyright 2024, the School of Geodesy and Geomatics (SGG), Wuhan University, China // https://github.com/Unsigned-Long/River.git // // Author: <NAME> (<EMAIL>) // GitHub: https://github.com/Unsigned-Long // ORCID: 00...
ALGO
0.998016
6.853302
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2024-04-05T05:32:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 91, "forks": 9, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d76712a9...
f1bc8c53-1524-42c1-bd46-7bac8a0c2e9d
Pranshu-Tripathi/Programming
C++/CodeForces/C2_Guessing_the_Greatest_hard_version_.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define fast ios::sync_with_stdio(false); \ cin.tie(NULL),\ cout.tie(NULL) #define cy cout << "YES" << endl #define cn cout << "NO" << endl #define ld long double #define mod 1000000009 int query(int l , int r) { ...
ALGO
0.999986
3.052825
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2019-12-09T18:10:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5825a4cef...
e742faf4-639e-4f68-9083-df0fa0f73036
wenischlab/MicroSuite
src/SetAlgebra/intersection_service/service/intersection_server.cc
/* Author: <NAME> Ph.D. Candidate at the University of Michigan - Ann Arbor*/ #include <iostream> #include <memory> #include <omp.h> #include <string> #include <sys/time.h> #include <grpc++/grpc++.h> #include "intersection_service/src/intersection.h" #include "intersection_service/service/helper_files/server_helpe...
DATA
0.952554
6.456179
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2018-08-29T20:13:55.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 43, "forks": 19, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "5d9ab60f...
f0cdb821-7a0a-4636-a1f9-fbc7bf56747f
doswellf/combinator-uvm
uvm_ml/1.3/UVM_ML-1.3/ml/frameworks/uvm/sc/packages/boost/include/preprocessor/arithmetic/add.hpp
# /* Copyright (C) 2001 # * <NAME> # * http://www.housemarque.com # * # * Distributed under the Boost Software License, Version 1.0. (See # * accompanying file LICENSE_1_0.txt or copy at # * http://www.boost.org/LICENSE_1_0.txt) # */ # # /* Revised by <NAME> (2002) */ # # /* See http://www.boost.org for most rec...
TOOL
0.976386
6.199969
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2014-04-12T01:37:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 55, "forks": 40, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "555c0fc6...
518d0ce4-eab6-4953-9a99-aa54130f74c8
AkashdeepGarg/DSA-and-SQL
Add two numbers represented by linked lists - GFG/add-two-numbers-represented-by-linked-lists.cpp
// { Driver Code Starts // driver #include <bits/stdc++.h> using namespace std; /* Linked list Node */ struct Node { int data; struct Node* next; Node(int x) { data = x; next = NULL; } }; struct Node* buildList(int size) { int val; cin>> val; Node* head = new Node(val...
ALGO
0.999763
5.705757
{ "github_metadata": { "branch": "main", "commit_count": 1300, "repo_created_at": "2021-08-20T10:51: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": "001b78dc5...
99e5a673-2382-4c92-af9f-05ba0e0d6c64
hjsjhn/Algorithms
数据结构/数学/高斯消元/bzoj1013/1013.cpp
#include <cstdio> #include <iostream> #include <algorithm> #include <cmath> #define MAX_N 13 using namespace std; int N; double A[MAX_N][MAX_N], B[MAX_N]; double x[MAX_N][MAX_N]; //x[i][j]第i个元素的第j个值 double res[MAX_N]; void gauss () { for(int i = 1;i <= N; ++i) { int k = i; for(int j = i + 1;j <= N; ++j) ...
ALGO
0.999757
3.441489
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2018-03-14T12:21: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": "7af13d3bc4...
6acde3b3-8fde-47da-8ffa-cb791869c1a3
TateHouse/AlgorithmsDataStructures
Core/Include/Algorithms/Searching/BinarySearchPredicate.hpp
#pragma once #include "SearchPredicateResult.hpp" namespace Core::Algorithms::Searching { /** * @class BinarySearchPredicate * @brief A predicate used to LinearSearch for an element using the binary BinarySearch algorithm. * @tparam ElementType The type of the elements to LinearSearch for. */ template<typename El...
ALGO
0.997028
7.090955
{ "github_metadata": { "branch": "Master", "commit_count": 405, "repo_created_at": "2023-10-10T18:14: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": "64a7f234...
3e693203-1b3e-4b15-9d25-4103724c94d4
azbyn/fundamentele
src/base.cpp
#include <iostream> #include <algorithm> int main() { int n; std::cout << "Please enter a number: "; if (!(std::cin >> n)) { std::cerr << "That was not a number!\n"; return -1; } std::cout << n << " is '"; if (n == 0) { std::cout << "0' in base 2 and '0' in base 16 \n"; ...
ALGO
0.971806
5.116513
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2018-10-06T15:51: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": "40ca6bc7b...
da364e53-aea4-43de-a7a5-035df975e002
sxs-collaboration/spectre
src/Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/DampedHarmonic.hpp
// Distributed under the MIT License. // See LICENSE.txt for details. #pragma once #include <cstddef> #include <limits> #include "DataStructures/DataBox/Tag.hpp" #include "DataStructures/Tensor/TypeAliases.hpp" #include "Domain/Tags.hpp" #include "Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/Gauges.hpp...
ALGO
0.993288
7.271219
{ "github_metadata": { "branch": "develop", "commit_count": 17103, "repo_created_at": "2017-04-07T17:28:20.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 168, "forks": 202, "issues": 530, "pull_requests": 57 }, "file_meta": { "content_id": ...
e7f92d2c-e1fe-4020-966e-5570c1949f83
Bereket234/competitive-programming
week1/SelectionSort.cpp
class Solution { public: int select(int arr[], int i, int n) { int min=i; int temp; for(int j=i;j<n;j++){ if(arr[j] < arr[min]){ min= j; } } return min; // code here such that selectionSort() sorts arr[] } ...
ALGO
0.999942
6.293219
{ "github_metadata": { "branch": "main", "commit_count": 1053, "repo_created_at": "2021-12-09T14:29:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "70b11338f...
680c95f5-c5f8-4d27-acf4-304e1b33e077
543877815/algorithm
nowcoder/面试必刷Top101/BM82 买卖股票的最好时机(三).cpp
// 动态规划 // 时间复杂度:O(n) // 空间复杂度:O(1) class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * 两次交易所能获得的最大收益 * @param prices int整型vector 股票每一天的价格 * @return int整型 */ int maxProfit(vector<int> &prices) { // write code here // dp[i][0]表示到第i天为止没有买过股票的最大收益 ...
ALGO
0.999954
5.41938
{ "github_metadata": { "branch": "master", "commit_count": 283, "repo_created_at": "2019-05-26T12:35:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f185ec25...
09f7c2ac-cf15-48b3-b57c-bc7ac68f37ec
david-perez/competitive-programming
UVa/000615.cpp
#include <iostream> #include <vector> #include <map> #include <queue> #include <climits> using namespace std; typedef vector<int> vi; typedef vector<vi> vvi; bool bfs(vvi &adjList, int u) { vi d(adjList.size(), INT_MAX); d[u] = 0; queue<int> q; q.push(u); while (!q.empty()) { u = q.front(...
ALGO
0.999779
4.707784
{ "github_metadata": { "branch": "master", "commit_count": 707, "repo_created_at": "2015-10-28T23:24:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 14, "forks": 6, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "6c94dc8...
531d7387-bf8e-46c4-ad95-87e26e920c73
Schlagmt/Parallel-COVID-Computations
data_analysis.cpp
#include <iostream> #include <cmath> #include <algorithm> #include <vector> using namespace std; void find_range(float x[], int length, int num_classes, float centroids[]){ float* min = min_element(x,x+length); float* max = max_element(x,x+length); float range = *max - *min; float group_size = range /...
ALGO
0.999762
4.813781
{ "github_metadata": { "branch": "main", "commit_count": 46, "repo_created_at": "2021-11-04T19:16:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "891433ba18b...
0fcf5342-939f-4321-992a-11f23125dc16
zsp20093481/Algorithms
Algorithms/search.cpp
#include "search.h" using namespace std; int intArray[MAX] = { 1,2,3,4,6,7,9,11,12,14,15,16,17,19,33,34,43,45,55,66 }; search::search() { } search::~search() { } int search::lineSearch(int data) { int comparisons = 0; int index = -1; for (int i = 0; i < MAX; i++) { comparisons++; if (data == intArray[i]) ...
ALGO
0.995542
3.412031
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2016-07-15T02:10:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "beeaa08cb...
b60ed7e6-c4f9-4d9a-ac01-d1b2aaf305b4
dendibakh/Algorithm-Tasks
Codility/MaxCounters.cpp
#include <vector> #include <numeric> using namespace std; #include <algorithm> class Counter { public: Counter(vector<int>& count) : count(count) , base(0), max (0) , N(count.size()) {} ~Counter() { } void operator() (int i) { if (N + 1 == i) { ...
ALGO
0.999895
5.375104
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2015-06-21T13:05:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f9f11c14d...
4620d4e2-a946-4db1-ad07-6892da473d85
Edu175/Competitive_Programming
codeforces/think-cell/C.cpp
#include <bits/stdc++.h> #define pb push_back #define fst first #define snd second #define fore(i,a,b) for(ll i=a,ggdem=b;i<ggdem;++i) #define SZ(x) ((int)x.size()) #define ALL(x) x.begin(),x.end() #define mset(a,v) memset((a),(v),sizeof(a)) #define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0) #define imp(v) for(...
ALGO
0.999907
3.873176
{ "github_metadata": { "branch": "master", "commit_count": 66, "repo_created_at": "2022-09-14T03:09:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b48ae12ea...
aeda36b2-6aa8-415e-87cb-7004804670fb
priyanka30012/omsai
HPC/HPC/3_parallel_reduction.cpp
#include<iostream> #include<omp.h> using namespace std; int minval(int arr[], int n){ int minval = arr[0]; #pragma omp parallel for reduction(min : minval) for(int i = 0; i < n; i++){ if(arr[i] < minval) minval = arr[i]; } return minval; } int maxval(int arr[], int n){ int maxval = arr[0]; #p...
ALGO
0.999928
6.010344
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2024-04-18T14:19:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "aa4853b3ced1...
c29e6397-eaaa-4c37-b271-5412de7e3861
jeffmm/mdsim
src/mdsim/vicsek_simulation.cpp
#include "vicsek_simulation.h" void VicsekSimulation::CreateParticles() { for (int i=0; i<params_->n_particles; ++i) { particles_.push_back(new VicsekParticle); } } void VicsekSimulation::CalculateForces() { /* For now, do all-pair interactions */ for (int i=0; i<n_particles_-1; ++i) { for (int j=i+1;...
ALGO
0.999637
5.192607
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2018-12-19T23:47: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": "29151872f...
17ae7926-c8e2-401a-b321-2ec7f97521b9
yuiparrk/school
1학기/reverseArray.cpp
/* Write a program that reverses the sequence of elements in an array. For example, suppose you have an array containing: [1 4 9 16 9 7 4 9 11] Then the array should be changed to: [11 9 4 7 9 16 9 4 1] Suppose the a...
ALGO
0.999682
4.787138
{ "github_metadata": { "branch": "main", "commit_count": 134, "repo_created_at": "2024-01-31T01: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": "97d019e1af...
b0cdb63e-5198-433f-9fc3-77a277c14780
Ferox98/CS487-Competitive-Programming-Lab-Exercises
Take 1/D6/relative-sort-array.cpp
class Solution(object): def partition(self, arr, p, r): pivot = arr[r] i = p - 1 for j in range(p, r): if arr[j] <= pivot: i += 1 arr[j], arr[i] = arr[i], arr[j] arr[i + 1], arr[r] = arr[r], arr[i + 1] return i + 1 def quic...
ALGO
0.999948
5.20742
{ "github_metadata": { "branch": "master", "commit_count": 66, "repo_created_at": "2019-11-19T06:15:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dfff028c4...
59fd8996-79bb-4625-9392-9ef7e46d6934
Pradeep17Jadhav/LeetCode-Questions
128-longest-consecutive-sequence/128-longest-consecutive-sequence.cpp
class Solution { public: int longestConsecutive(vector<int>& nums) { if(nums.empty()) return 0; unordered_set<int> s(nums.begin(),nums.end()); int res = 0; for(int i = 0; i < nums.size(); i++) { //skip finding the consecutive elements if previous number i...
ALGO
0.999977
6.148012
{ "github_metadata": { "branch": "main", "commit_count": 1607, "repo_created_at": "2021-12-25T13:53: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": "db997a31d...
d4a02d9a-abf2-4880-9f6f-570b21a54c69
wusu5545/SIWIR2
Seminar/seminar_Ang_Wang/solveMG.cpp
#include <math.h> #include <iostream> #include <fstream> #include "FUNCTIONS.h" #include <vector> #include <iomanip> #include <stdlib.h> void solveMG(int l, std::vector<std::vector<double > >& u, std::vector<std::vector<double > >& f){ //DEFINITION OF PARAMETERS int v1 = 3; int v2 = 2; int gamma =1; ...
ALGO
0.99988
3.576318
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2015-07-05T23:43:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3225559a3e...
96e47988-cc54-4b2b-bd53-9c6e2a5e8cf6
Heart-Under-Blade/Beam-Splitting-concave
src/geometry/Polygon.cpp
#include "Polygon.h" #include <math.h> #define EPS_NORMAL 0.1 Polygon::Polygon() { } Polygon::Polygon(int size) : nVertices(size) {} Polygon::Polygon(const Polygon &other) { nVertices = other.nVertices; for (int i = 0; i < other.nVertices; ++i) { arr[i] = other.arr[i]; } } Polygon::Polygon(Polygon &&other)...
ALGO
0.991424
5.932423
{ "github_metadata": { "branch": "develop", "commit_count": 329, "repo_created_at": "2016-09-13T03:42:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "30012e5...
4240057b-1bf3-477a-b635-6b20fabf14fd
fredowo20/SUKP
KP_Methods/C++/Brute_Force.cpp
#include <iostream> #include <vector> using namespace std; int get_weight(vector<int> item, vector<int> elements) { int weight = 0; for (int i = 0; i < elements.size(); i++) { if (item[i] == 1) { weight += elements[i]; } } return weight; } vector<vector<int>> subsets(vector...
ALGO
0.99993
6.089132
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2023-02-17T07:15: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": "d48e048a0c4...
4889b09c-930d-4409-ab57-adc31e45af06
Basasuya/ACM
CodeForces/CF560/C.cpp
#include <iostream> #include <fstream> #include <vector> #include <set> #include <map> #include <bitset> #include <algorithm> #include <iomanip> #include <cmath> #include <ctime> #include <functional> #include <unordered_set> #include <unordered_map> #include <queue> #include <deque> #include <stack> #include <complex>...
ALGO
0.999999
3.562384
{ "github_metadata": { "branch": "master", "commit_count": 204, "repo_created_at": "2018-01-10T03:13:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "914f6f69...
21a4e292-0739-4026-81a9-b4368b3db4b0
RCC-MRU/Hacktoberfest2022new
Add Code Here/C++/Rotate Array.cpp
// { Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution{ public: //Function to rotate an array by d elements in counter-clockwise direction. void arrreverse(int arr[], int s, int e) { while (s < e) { int temp = arr[s]; ar...
ALGO
0.999923
5.646744
{ "github_metadata": { "branch": "main", "commit_count": 3682, "repo_created_at": "2022-10-07T17:16:53.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ad95cf192e...
5ed5cd78-7a6f-46df-968c-2fd0d559dbb3
Sylar009/Scaler-Academy-Modules
Introduction to Problem Solving (Intermediate) 2/Intermediate DSA - Hashing - 2/Homework/Q6. Is Dictionary.cpp
/* Problem Description Surprisingly, in an alien language, they also use English lowercase letters, but possibly in a different order. The order of the alphabet is some permutation of lowercase letters. Given an array of words A of size N written in the alien language, and the order of the alphabet denoted by string B...
ALGO
0.999985
5.003895
{ "github_metadata": { "branch": "main", "commit_count": 181, "repo_created_at": "2024-06-09T11:02:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d14af9dd7c...
5c568038-4db6-4806-b869-093e642fe328
andyj0927/Baekjoon
백준/Gold/3665. 최종 순위/최종 순위.cc
#include <bits/stdc++.h> using namespace std; #define endl '\n' typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; vector <int> adj[501]; int deg[501]; int past[501]; int ans[501]; ll n,m; queue <int> q; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int re...
ALGO
0.999999
4.311572
{ "github_metadata": { "branch": "main", "commit_count": 348, "repo_created_at": "2023-10-09T19:02: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": "4b7eae6cdd...
47b9af7a-7c1e-4b68-868a-1ea75592c611
MrJeremyKhoo/competitive-programing
E. Enemy is weak/main2.cpp
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e6 + 5; struct FenwickTree { vector<int> BIT; int size; FenwickTree(int n) : size(n) { BIT.assign(n+1,0); } void update(int index, int val) { while(index <= size) { BIT[index] += val; index += index & -index; } } ...
ALGO
0.999991
4.153336
{ "github_metadata": { "branch": "main", "commit_count": 40, "repo_created_at": "2021-02-06T09:24:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "db9c58680ce...
d1904385-c0cd-4559-9d7f-2c25fc306d99
NVIDIA/thrust
thrust/system/detail/generic/unique_by_key.inl
/* * Copyright 2008-2013 NVIDIA 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...
ALGO
0.99976
7.28239
{ "github_metadata": { "branch": "main", "commit_count": 4758, "repo_created_at": "2012-03-06T01:01:29.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4980, "forks": 764, "issues": 0, "pull_requests": 8 }, "file_meta": { "content_id": "07c4e...
87b1755d-708e-45ca-ac1a-8e733e7bb1d8
vickyguptaa7/LeetCode-Problems
707-design-linked-list/707-design-linked-list.cpp
class MyLinkedList { 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) {} }; ListNode *head = NULL; int l=0; public: MyLinkedList() { } int get(int index) { if(head==NULL || index...
ALGO
0.99986
5.079965
{ "github_metadata": { "branch": "main", "commit_count": 4940, "repo_created_at": "2022-01-18T15:05:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6b8993a8f...
3a57e837-17ac-48ec-8fa6-965f45b98a31
VoidDerivatives/Cpp
01_DataStructUsingC++/03_DoublyLinkedList/DoublyServer.cpp
#include<iostream> #include "DoublyServerh.h" using std :: cout; using std :: endl; list :: list() { first = NULL; } list :: ~list() { if(first != NULL) { delete first; first = NULL; } } node :: node() { data = 0; next = NULL; } node :: ~node() { data = 0; if(next != NULL) { delete next; next = NULL...
ALGO
0.959741
3.29707
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-05-13T11:29: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": "5ac5ed146953...
d1c8afb2-05c3-41a1-9775-2e417e0606d5
Jacob-git1994/OdeSolver
OdeSolver/OdeSolver.h
#pragma once #include <algorithm> #include <chrono> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <memory> #include <mutex> #include <stdexcept> #include <thread> #include <vector> #include "MethodWrapperBase.h" #include "OdeSolverParams.h" #include "OdeFunIF.h" #include "StateVector...
ALGO
0.962474
6.822045
{ "github_metadata": { "branch": "master", "commit_count": 98, "repo_created_at": "2020-12-27T21:10: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": "b4f0bd195...
ef8d55ba-b13f-4bbb-bb64-77ddfcc5fd87
annav1asova/irregular-apap
MatchDetector.cpp
#include "MatchDetector.h" void MatchDetector::detectSiftMatch(const char* img1_path, const char* img2_path) { Mat img1 = imread(img1_path); Mat img2 = imread(img2_path); Ptr<cv::xfeatures2d::SiftFeatureDetector> detector = cv::xfeatures2d::SiftFeatureDetector::create(); Ptr<cv::xfeatures2d::SiftDescr...
ALGO
0.991229
4.732737
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2019-04-20T20:17:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8fddca44cb...
2d69707d-b545-4311-a846-23b438d9be51
magnusEA/RC_CSCI40
Lab 12/Lab 12/Lab 12/Lab 12.cpp
//Csci 40 // Lab 12 - Two Dimensional Array // <NAME> #include <iostream> #include <iomanip> #include <cmath> using namespace std; // Global Constants const int ROW = 3; const int COL = 5; // Function Prototype void Sum_Rows(const int numbers[][COL], int row); void Sum_Col(const int numbers[][COL], int row); int ma...
ALGO
0.99895
4.759014
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-04-23T15:05: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": "8e34aa221b...
18d7daa1-85f9-4765-b9ad-ea481dc0d2b4
mariamafonso/tcc_arduino
Controlador/LibRodas.ino
/************************************************************************ * Funções para movimentação do robô * * (interação com os servos das rodas). * * * * <NAME> (<EMAIL>) - ...
ALGO
0.970315
5.055905
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2016-01-20T01:18: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": "5dc5329c2...
839ae81b-5677-46d2-8d0a-8ebc37021ddc
karan221/cp
graphs/Edges_on_a_path.cpp
#include <bits/stdc++.h> using namespace std; struct Graph { typedef int item; vector<vector<item>> adj; vector<int> tin, low; vector<bool> vis; int V, E, a, b, c, tiktok; Graph(int v, int e) : V(v), E(e) { cin >> a >> b; --a, --b; adj.resize(v); tin.resize(v); ...
ALGO
0.999754
3.558914
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2021-03-27T14:54: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": "80ba93806aa...
f5dfc952-e9eb-4f47-90fc-a6f06e28c8a6
veronikawilliams1/UG_course
1_sortings_search/contest/D.cpp
#include <bits/stdc++.h> using namespace std; #define id get<2>(a[i]) #define region get<1>(a[i]) #define score get<0>(a[i]) int n, M, r, parts = 0; vector<tuple<int,int,int>> a; vector<int> regs(100005, 0); int count(int ball) { int i = 0; vector<bool> regions(r+1, false); while (i < a.size() && score >...
ALGO
0.999934
4.663873
{ "github_metadata": { "branch": "master", "commit_count": 76, "repo_created_at": "2022-03-15T15:19:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bb7efebf2...
0487a1ff-9cec-441a-84d1-79348ede0dfa
wonda-tea-coffee/kyo_pro
math_puzzle/q01.cpp
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <ctime> #include <cstring> #include <functional> #include <iostream> #include <iomanip> #include <limits> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <regex> #include <vecto...
ALGO
0.997476
4.142822
{ "github_metadata": { "branch": "master", "commit_count": 54, "repo_created_at": "2020-03-03T10:16: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": "df17118b5...
901bb7c4-931c-4efe-97a9-d72525edda71
bfosterscripps/learning
cs140/web.eecs.utk.edu/~plank/plank/classes/cs140/Labs/Lab5/bitmatrix_start.cpp
#include <fstream> #include <sstream> #include <cstdlib> #include <cstdio> #include <algorithm> #include "bitmatrix.h" Bitmatrix::Bitmatrix(int rows, int cols) { } int Bitmatrix::Rows() { return 0; } int Bitmatrix::Cols() { return 0; } void Bitmatrix::Set(int row, int col, char val) { } char Bitmatrix::Val(i...
TOOL
0.973797
4.332134
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2015-06-26T21:45: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": "006cee621...
cbb23c87-6647-43e8-8003-916e0e500e2c
suryansh-sinha/DSA-CPP
Week_1/l4_3.cpp
#include <iostream> using namespace std; int main(){ // Square int SIDE = 5; for(int i=0;i<SIDE;i++){ for(int j=0; j<SIDE; j++){ cout << "* "; } cout << endl; } // Hollow Rectangle cout << endl << endl << endl; int ROWS = 5, COLS = 10; for(int row=0...
ALGO
0.97478
3.775692
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2024-02-13T10:57: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": "77dfe878ee7...
b8c909e6-37b3-4bc9-b2a6-52616d02d45f
ahmed-dardery/CompetitiveProgramming
UVa/10360 - Rat Attack.cpp
#include <bits/stdc++.h> #include <random> using namespace std; typedef long long ll; typedef pair<int, int> pii; const int N = 1e5 + 7, M = 1025 + 7; const double OO = 2e18; int n, m; ll pre[M][M]; int arr[M][M]; void precalc() { for (int i = 1; i <= n; ++i) for (int j = 1; j <= m; ++j) pr...
ALGO
0.999975
3.892892
{ "github_metadata": { "branch": "master", "commit_count": 88, "repo_created_at": "2019-10-07T11:13:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "75385ee33...
68db61ac-cd0d-4e59-808c-1fab69ee12a2
da-shika/TUM_2023
ros_main_pc/tomm_base_ws_local/src/utilities/control_core/include/control_core/math/shortest_path.h
/*! \file * * \author <NAME> * * \copyright Copyright 2020 Institute for Cognitive Systems (ICS), * Technical University of Munich (TUM) * * #### Licence * 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 ...
ALGO
0.998889
6.706852
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2023-11-24T17:26: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": "83f33d2d1aa...
9abcc77f-6e10-4f05-8693-b3415c7c3ad0
rladp127/PPS
박인수_third_week/A049_박인수_20230726.cpp
#include <iostream> #include <unordered_set> using namespace std; bool isVowel(char c) { return (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'); } int main() { string s; while (cin >> s && s != "end") { unordered_set<char> vowels = {'a', 'e', 'i', 'o', 'u'}; int consecutiveVowe...
ALGO
0.997916
4.946409
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2023-07-17T16:42: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": "f893f87a9251...
90e65209-5540-4b28-8d81-c87975e29d1e
kaldi-asr/kaldi
src/fstext/factor.h
// fstext/factor.h // Copyright 2009-2011 Microsoft Corporation // See ../../COPYING for clarification regarding multiple authors // // 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 // // ...
ALGO
0.995499
7.249208
{ "github_metadata": { "branch": "master", "commit_count": 9405, "repo_created_at": "2015-04-20T17:23:16.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 14986, "forks": 5368, "issues": 189, "pull_requests": 63 }, "file_meta": { "content_id":...
16657dca-e033-4dbb-9159-44d5e73441e9
Arvin-Samuel-A/Cpp-and-C-Programmes
Threading.cpp
#include <iostream> #include <thread> #include <vector> using namespace std; void Threading(long long int Terms); void Add(long long int Num1, long long int Num2); unsigned long long int Sum = 0; int main() { long long int Terms; cout << "We are going to calculate the sum of Natural Numbers till the user-ent...
ALGO
0.999418
4.006289
{ "github_metadata": { "branch": "main", "commit_count": 48, "repo_created_at": "2023-08-04T18:14:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f79f788c29e...
51e19786-a29e-402c-a2e7-38c48a009eb9
ngthvan1612/Codeforces
1255D.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e2 + 5; vector<char> w; char a[N][N], ans[N][N]; int r, c, k; int main() { ios::sync_with_stdio(0); cin.tie(0); ////Init for (char s = 'a'; s <= 'z'; ++s) w.push_back(s); for (char s = 'A'; s <= 'Z'; ++s) w.push_back(s); for (char s = '...
ALGO
0.999734
3.660407
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-02-01T06:14: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": "ef2cdc84b1...
e4e91221-8c71-4107-abdb-e70d8816c52f
agul/algolib
cpplib/data_structures/sparse_table.hpp
#pragma once #include <functional> #include <numeric> #include <vector> template<typename T, typename Cmp = std::less<T>> class SparseTableCmp { public: using value_type = T; using size_type = std::size_t; using comparator_type = Cmp; using container_type = std::vector<value_type>; explicit Sparse...
ALGO
0.998858
6.601171
{ "github_metadata": { "branch": "master", "commit_count": 343, "repo_created_at": "2015-07-01T21:15: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": "d44daf1a...
0567f7d6-283c-49f9-a105-6b1848e70d3b
kvi1/CPP
Lab 7/indent.cpp
/* Author: <NAME> Course: CSCI-135 Instructor: <NAME> Assignment: LAB 7B Description: This program takes in an input of a string and outputs the string that was original before the shifts */ #include <iostream> #include <string> #include <cctype> using namespace std; int countChar(string line, char c){ int z = 0; ...
ALGO
0.972675
3.643942
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2023-12-08T19:50: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": "89b61296e2c...
914d7396-9e53-4760-80d0-cc14003173e5
tomasbrogueira/Computational-Physics
mini_proj_3/main/main.cpp
#include "EqSolver.hpp" #include "FCmatrixAlgo.hpp" #include <iostream> int main() { double R1 = 30; double R2 = 50; double R3 = 5; double R4 = 10; double R5 = 15; double R6 = 20; double R7 = 25; double R8 = 55; double V0 = 20; // define matrix equations: Ax = b Matrix<do...
ALGO
0.999955
3.984793
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-11-14T18:15: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": "e56bff0060a5...
1ee97353-3e4f-4f72-b8b1-294c04b9a2b2
karandesai24/LeetCode
61-rotate-list/61-rotate-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* rotateRight...
ALGO
0.999938
5.822179
{ "github_metadata": { "branch": "main", "commit_count": 1253, "repo_created_at": "2022-06-23T08:48: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": "f445b35a7...
aeeed2d2-9a47-4a9c-bb21-caba6571fe2c
doesitworkornot/NSU-OS-22931
a.adonin/laba5/main.cpp
#include <iostream> #include <vector> #include <fstream> using namespace std; class TableCell{ public: int offset; int length; TableCell(int of, int len) { this->offset = of; this->length = len; } TableCell() { this->offset = 0; ...
TOOL
0.936867
3.454958
{ "github_metadata": { "branch": "main", "commit_count": 252, "repo_created_at": "2023-09-22T05:56:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 10, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1993b29ec...
51b3935b-7aef-49c3-b9ca-cda473ce5dbf
EvanGertis/system_software
homework/assignment_04/A4p2.cpp
#include <iostream> #include <cstdlib> class A4p2{ protected: int var; public: A4p2(int Var){ var = Var; } void play() { std::cout << var << " "; int length = 1; while(var > 1) { if(var % 2){ var = (3*var+2)/2; } else{ var = var/2; } std::cout << var ...
ALGO
0.991061
3.964851
{ "github_metadata": { "branch": "master", "commit_count": 55, "repo_created_at": "2020-01-26T15:32:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "11e16ac8f...
5662d88c-c2a5-49d9-b55c-df91e2c633d6
fredbr/algorithm-implementations
data_structures/minqueue_sum.cpp
#include <bits/stdc++.h> #define ff first #define ss second using namespace std; typedef pair<int, int> ii; struct minqueue { deque<ii> dq; int l, r, sum; void clear() { l = r = sum = 0; dq.clear(); } void push(int x) { while (!dq.empty() and dq.back().ff > x-sum) dq.pop_back(); dq.push_back({x-su...
ALGO
0.999965
3.414252
{ "github_metadata": { "branch": "master", "commit_count": 108, "repo_created_at": "2018-08-22T18:33:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "df4225d...
85203902-2a63-44bd-a0f5-ecaba204044e
liftchampion/Coursera-Cpp
White_belt_approx/Yandex 2/src/Yandex 2.cpp
#include <string> #include <iostream> #include <vector> #include <sstream> #include <set> using namespace std; /*struct IP { int p1; int p2; int p3; int p4; }; istream& operator>> (istream&, IP& new_ip) { }*/ void CheckNextSymbol_N (stringstream& ss) { if (ss.peek() < '0' || ss.peek() > '9' ) { //cout << "1"...
ALGO
0.985585
3.418103
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2019-05-13T15:06:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8a58ba0988...
6ab4aea7-dcfb-4483-a0b0-c4ddf0d23ad3
AbdeltwabMF/oj-solutions
CodeForces/c.bertown-subway.cpp
// https://codeforces.com/contest/884/problem/C #pragma GCC optimize ("Ofast") #include <bits/stdc++.h> #define endl '\n' #define Min(a, b) (((a) < (b)) ? (a) : (b)) #define Max(a, b) (((a) > (b)) ? (a) : (b)) using namespace std; typedef int64_t ll; void Fast() { cin.sync_with_stdio(0); cin.t...
ALGO
0.999936
4.014019
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2022-09-27T02:41: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": "896215ff44a...
101b803f-7f0d-4ae5-a2b2-e3967593db0b
emerencia/topcoder
SRMs/A-M/EllysChessboard_working_dp.cpp
#include <string> #include <iostream> #include <sstream> #include <algorithm> #include <vector> #include <map> #include <set> #include <queue> #include <cmath> #include <utility> #include <climits> #include <cstring> using namespace std; typedef pair<int,int> PII; int dp[15][15][16][16]; int srs[] = {-1,0,0,0}; int n...
ALGO
0.999385
5.056303
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-12-03T23:20:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1fc2e94ce264...
458cac22-ff66-4a1d-b923-6d10a3f0e016
BLUECARVIN/PAT
SECOND_LEVEL/1083.cpp
#include <cstdio> #include <iostream> #include <algorithm> #include <cstring> using namespace std; const int maxn = 100010; struct Node { char name[15]; char id[15]; int grade; }List[maxn]; bool cmp (Node a, Node b) { return a.grade >= b.grade; } int main() { int n; scanf("%d", &n); for...
ALGO
0.999915
3.631928
{ "github_metadata": { "branch": "master", "commit_count": 40, "repo_created_at": "2019-03-09T15:26: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": "970aea2d5...
768a2fc7-dc73-46da-88f4-3cb09740c6df
Sogang-Pocha/Practice
boj/JunSeongPark/2931.cpp
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <queue> #include <stack> #include <string> #include <map> #include <set> #include <deque> using namespace std; #define all(v) (v).begin(),(v).end() using pii = pair<int, int>; using lint = long long; const int MOD = 1e9 + 7, INF = 9...
ALGO
0.999792
3.545872
{ "github_metadata": { "branch": "main", "commit_count": 77, "repo_created_at": "2021-01-03T13:11:40.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2a394a1288c4...
b0446f88-fd87-429a-9b07-7d6f2c987411
punithgs/Design-and-Analysis-of-Algorithm-main
Design-and-Analysis-of-Algorithm-main/Design-and-Analysis-of-Algorithm-main/8. Dijkstra's.cpp
#include<iostream> using namespace std; void dij(int cost[10][10],int source,int n,int visited[10],int dis[10]){ int i,j,min,u,w; for(i=1;i<=n;i++){ visited[i]=0; dis[i]=cost[source][i]; } visited[source]=1; dis[source]=0; for(j=2;j<=n;j++){ min=999; for(i=1;...
ALGO
0.999981
4.343717
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-05-24T16:07:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "52b49862a2d2...
621e6b3e-075e-40fa-ae89-42dbcd29b771
pratham-kashyap/DSA
Code Testcase Test Result Test Result 2515. Shortest Distance to Target String in a Circular Array.cpp
// You are given a 0-indexed circular string array words and a string target. A circular array means that the array's end connects to the array's beginning. // Formally, the next element of words[i] is words[(i + 1) % n] and the previous element of words[i] is words[(i - 1 + n) % n], where n is the length of words. //...
ALGO
0.999975
5.927978
{ "github_metadata": { "branch": "main", "commit_count": 33, "repo_created_at": "2024-03-01T17:44:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9df18103b5c...
f96679e5-efa0-4e73-825b-680ab459575f
Wolokin/Fractals
src/Logic/generators.cpp
#include "generators.h" void Generator::resetIntervals(double &x1, double &x2, double &y1, double &y2) { x1 = sx1; x2 = sx2; y1 = sy1; y2 = sy2; maxiter = default_maxiter; miniter = default_miniter; } void Generator::increaseMaxIter() { maxiter += iter_change_step; palette.resize(minit...
ALGO
0.979437
4.889896
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2021-06-02T11:41:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bbd6eb599ed...
85bfe193-fdd3-4acd-a087-4f12b8410b81
klb3713/aoapc-book
TrainingGuide/exercises/ch4/02-GeometricComputations2D/UVa11928.cpp
// UVa11928 The Busy Dog // <NAME> #include<cstdio> #include<cmath> #include<vector> #include<algorithm> using namespace std; struct Point { int x, y; Point(int x=0, int y=0):x(x),y(y) { } }; typedef Point Vector; typedef vector<Point> Polygon; Vector operator - (Point A, Point B) { return Vector(A.x-B.x, A....
ALGO
0.999682
3.7034
{ "github_metadata": { "branch": "master", "commit_count": 198, "repo_created_at": "2013-09-22T01:26:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 181, "forks": 56, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "4c1d0...
9123c36c-b876-4c0a-9ec9-6d8a6371dd67
Gfans/UnifiedParticleFrameworkCUDA
src/headers/cuda7.0_include/include/thrust/system/cuda/detail/bulk/algorithm/adjacent_difference.hpp
/* * Copyright 2008-2013 NVIDIA 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...
ALGO
0.992548
7.427408
{ "github_metadata": { "branch": "master", "commit_count": 44, "repo_created_at": "2015-05-06T12:58:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 132, "forks": 15, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "0a6c22...
ee117dbf-0f28-4357-bdb2-e0600b037f31
rustcean/learn-cc
homework1/h10_3file.cpp
#include <iostream> #include <fstream> using namespace std; /** * @brief 加密函数 * * @param p 输入的数组名 * @param n 数组大小 * @return ** void */ void encryption(char *p,int n) { for(int i=0;i<n;i++) { if((p[i]>='A'&&p[i]<='Z'||(p[i]>='a'&&p[i]<='z'))) { p[i]+=4; if(p[i]>'Z'||(p[i]>...
ALGO
0.998968
3.382193
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2021-10-04T08:10:42.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ec6dce3b89...
dc5b40bf-37b0-4ad2-acca-5653d7157240
miracl/MIRACL
source/pk-demo.cpp
/* * Example program demonstrates 1024 bit Diffie-Hellman, El Gamal and RSA * and 168 bit Elliptic Curve Diffie-Hellman * * Requires: big.cpp ecn.cpp */ #include <iostream> #include "ecn.h" #include "big.h" #include <ctime> //using namespace std; /* large 1024 bit prime p for which (p-1)/2 is also prime ...
ALGO
0.997856
4.584915
{ "github_metadata": { "branch": "master", "commit_count": 45, "repo_created_at": "2012-11-06T01:20:49.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 683, "forks": 243, "issues": 67, "pull_requests": 12 }, "file_meta": { "content_id": "7158...
ebdd879d-8af3-4107-b4f1-a86c4702a186
manhtung001/Datastructure-Algorithm-PTIT
50_Q_ToHopC(n,k).cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mod = 1e9 + 7; void tohop(ll n, ll k) { // tinh theo cthuc c(n,k) = n!/(n-r)!*r! if (k == 1) cout << n; else if (k == n) cout << 1; else { if (n - k < k) k = n - k; //C(n,k) = C(n,n-k) ll p = 1, r = 1; while (k) { p *= n,...
ALGO
0.999959
4.754275
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2021-03-06T03:06:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2ea90a031...
a7800531-487c-4c73-ad57-a17761661057
Muktadirul675/data_structures
stack/browser_back_forward/main.cpp
#include<iostream> using namespace std; #define MAX 20 #define test 0 typedef struct Stack { int top; char stack[MAX]; Stack() : top(0){} void display(){ if(top == 0){ cout << "Stack is empty!\n"; return; } for(int i=0;i<top;i++){ cout << stack[i] << ' '; } cout << endl; cout << "-----" << e...
ALGO
0.996817
3.46532
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-09-14T17:40: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": "05a0b3ced78f...
5e6c15f9-a7a0-4de8-ae3a-186b18ebfc6a
Kekich64/Laboratory-works
22/Lab22_main.cpp
// <NAME>, лаб. 22, Перегрузка операций #include "Money.h" #include <iostream> using namespace std; void main() { setlocale(LC_ALL, "rus"); cout << "Вводим переменную A:\n"; Money a; cin >> a; cout << "Вводим переменную B:\n"; Money b; cin >> b; cout << "Вычитаем из A одну копейку(префиксная операция дикримент...
ALGO
0.946821
3.423551
{ "github_metadata": { "branch": "master", "commit_count": 139, "repo_created_at": "2021-12-12T18:27:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9ce18400...