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
3aa24207-b1ab-4740-81fd-0978e0ceeabb
jarrodmillman/scipy
scipy/optimize/_highs/src/presolve/PresolveAnalysis.h
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* This file is part of the HiGHS linear optimization suite */ /* */ /* Written an...
ALGO
0.994559
4.669257
{ "github_metadata": { "branch": "main", "commit_count": 26552, "repo_created_at": "2011-03-15T01:52:39.000Z", "is_fork": true, "is_org_owned": false, "forked_from": "scipy/scipy", "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "...
d2882a57-fe46-4564-8b36-3f1176702ba7
MacJim/LeetCode-C
1498 (permutations, overflow protection).cpp
/* * 1498. Number of Subsequences That Satisfy the Given Sum Condition * https://leetcode.com/problems/number-of-subsequences-that-satisfy-the-given-sum-condition/ */ #include <iostream> #include <vector> #include <cmath> #include "helpers/Operators.hpp" #include "helpers/terminal_format.h" #pragma mark - 1. 2 p...
ALGO
0.999954
6.349233
{ "github_metadata": { "branch": "master", "commit_count": 372, "repo_created_at": "2019-07-25T14:49: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": "c58787da...
06b2179d-d697-4cdc-99d5-d87d3d4f36f3
wangweisunying/learning
Cplusplus/tree/429. N-ary Tree Level Order Traversal.cpp
// 429. N-ary Tree Level Order Traversal // Easy // 172 // 22 // Favorite // Share // Given an n-ary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). // For example, given a 3-ary tree: // We should return its level order traversal: // [ // [1], ...
ALGO
0.999947
6.468649
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2018-10-02T22:50: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": "095ca9c61c...
94e7a90e-0a8a-4e0e-b14c-b1fe8533e810
nathansttt/hog2
deprecated/coprobber/DSDijkstra_MemOptim.h
#include <vector> #include <queue> #include <set> #include <ext/hash_set> #include "MultiAgentEnvironment.h" #include "DSCREnvironment.h" #include "GraphEnvironment.h" #ifndef DSDIJKSTRA_MEMOPTIM_H #define DSDIJKSTRA_MEMOPTIM_H /* Dijkstra implementation for one cop and one robber possibly faster cop (using DSCREnv...
ALGO
0.999893
3.236844
{ "github_metadata": { "branch": "PDB-refactor", "commit_count": 2251, "repo_created_at": "2015-08-19T21:02:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 117, "forks": 62, "issues": 9, "pull_requests": 1 }, "file_meta": { "content_id":...
b9ae6456-4789-4f64-9a04-f484043414b0
iliyian/CompetitiveProgramming
luogu.com.cn/P5431/main.cpp
// date: 2024-03-24 16:19:54 // tag: 乘法逆元,前后缀积 #include <bits/stdc++.h> #define int long long using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); freopen("main.in", "r", stdin); freopen("main.out", "w", stdout); int n, p, k; cin >> n >> p >> k; vector<int> a(n + 1), l(n...
ALGO
0.999991
4.860976
{ "github_metadata": { "branch": "main", "commit_count": 354, "repo_created_at": "2024-04-21T10:50:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c6575e914a...
1dc7d9f2-e4c1-4540-b2e7-957a40642edc
moozeh/boj-solution
solutions/boj12100.cpp
//boj 12100 #include<bits/stdc++.h> using namespace std; typedef pair<int, int> pii; typedef vector<vector<pii>> board; int N; int dir[][2] = { {0, -1}, {1, 0}, {0, 1}, {-1, 0} }; void moveBoard(int x, int y, board& bd, int d) { int dx = x + dir[d][0], dy = y + dir[d][1]; if(dx < 1 || dx > N ...
ALGO
0.999946
3.317746
{ "github_metadata": { "branch": "main", "commit_count": 111, "repo_created_at": "2023-08-31T04:18:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a6f68d61ca...
9d15fd8a-a0aa-48c9-9049-cc1c78842841
Eduardofig/Competitive-Programming-Solutions
codeforces/codeforces-802/A.cpp
#include <bits/stdc++.h> using namespace std; using l = long; using ul = unsigned long; using ll = long long; using ull = unsigned long long; const int MXN = 1e4 + 3, INF = 0x3f3f3f3f; ul n, m; //ul dp[MXN][MXN]; ll a(ll i, ll j) { return ((i - 1) * m) + j; } void solve() { //memset(dp, INF, sizeof dp); ...
ALGO
0.999933
3.528254
{ "github_metadata": { "branch": "master", "commit_count": 114, "repo_created_at": "2021-02-21T04:11:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "664c939d...
46b528e8-8df5-49d5-8d26-032d9ec5cb13
Manish-Sgh/InterviewPrep
20. Valid Parentheses.cpp
#include <iostream> #include<vector> #include<queue> #include<unordered_map> #include<stack> using namespace std; typedef pair<int, int> ipair; class Solution { public: bool isValid(string s) { stack<char> stk; int n = s.length(); // base case // if (n == 0) return true; ...
ALGO
0.993083
5.802137
{ "github_metadata": { "branch": "main", "commit_count": 392, "repo_created_at": "2024-10-06T17:30: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": "f404644a89...
bc86ad94-9c83-4a54-97e9-26dbafbd6f09
Codensity30/Strivers-A2Z-DSA-Sheet
04.Linked List/2.Doubly Linked List/01.Introduction_to_Double_LL.cpp
/* QUESTION:- Given a doubly linked list of n elements. The task is to reverse the doubly linked list. Example 1: Input: LinkedList: 3 <--> 4 <--> 5 Output: 5 4 3 Example 2: Input: LinkedList: 75 <--> 122 <--> 59 <--> 196 Output: 196 59 122 75 APPROACH:- 1. Initialize two pointers `curr` and `nxt` to traverse the l...
ALGO
0.99997
6.544454
{ "github_metadata": { "branch": "main", "commit_count": 88, "repo_created_at": "2023-05-29T13:38:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 213, "forks": 70, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "11251ba2...
e0786015-dcb4-43bd-b8b4-1d92949f6bc9
MZalejko/Suggested_Solutions_for_Programming_Exercises
Chapter_6_Branching_Statments_and_Logical_Operators/pe_2.cpp
#include <iostream> constexpr int size{10}; constexpr int decrease_or_increase{1}; double fill_array(double* array); double count_sum(const double* array, const double& arr_size); double count_average(const double& sum, const double& arr_size); void show_greater_average(const double* array, int& g_average, const doub...
TOOL
0.998729
4.019497
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2023-06-13T19:23:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "efcb60134be9...
248b77c3-02ee-4a62-963c-c7dbbe6946f4
nealwu/competitive-programming
graph_theory/check_bipartite.cc
struct check_bipartite { int V; vector<vector<int>> adj; vector<int> depth; vector<bool> visited; check_bipartite(int v = -1) { if (v >= 0) init(v); } void init(int v) { V = v; adj.assign(V, {}); } void add_edge(int a, int b) { adj[a].p...
ALGO
0.999428
5.358128
{ "github_metadata": { "branch": "master", "commit_count": 81, "repo_created_at": "2021-08-09T18:52:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 348, "forks": 73, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "fd1545...
0ea4c7cc-9261-4a3e-a243-f6a4b12267f5
Mufafa98/KnightmareNetwork_Engine
include/Engine.hpp
#pragma once #include <SFML/Graphics.hpp> #include <cmath> #include "Board.hpp" #include "DigitalTree.hpp" class Engine{ bool game_running; bool turn_swapped; unsigned short game_result;// 1-draw 2-white won 3-black won unsigned short pawn_needs_promotion; unsigned short black_castling_rights; ...
TOOL
0.930889
5.75722
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-11-29T16:01:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "12318f77274e...
e30495e6-b397-4588-8b64-1e17e70a7609
liyunghao/My-LeetCode
Problems/0967/solution.cpp
/* * Author: liyunghao<<EMAIL>> * Problem Link: https://leetcode.com/problems/numbers-with-same-consecutive-differences/ * Runtime: 11ms * language: C++ */ class Solution { public: vector<int> numsSameConsecDiff(int n, int k) { vector<int> res; queue<string> q; for (int i = 1; i <= 9; i+...
ALGO
0.999786
6.125002
{ "github_metadata": { "branch": "master", "commit_count": 93, "repo_created_at": "2022-05-17T07:02:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f44c6f1e1...
6ad1eb21-2f17-4efc-9874-a2f5dc5b0116
PaddlePaddle/Paddle
paddle/phi/kernels/funcs/math/cos_sim_functor.h
// Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved. // // 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...
ALGO
0.998829
7.090634
{ "github_metadata": { "branch": "develop", "commit_count": 54743, "repo_created_at": "2016-08-15T06:59:08.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 23037, "forks": 5770, "issues": 1009, "pull_requests": 823 }, "file_meta": { "content_...
7e32a5dc-747f-4bb3-baf7-6af7d84a8a35
nabobery/PROJECT-MADS
LeetCode/1001 - 1100/1072.cpp
// 1072. Flip Columns For Maximum Number of Equal Rows // Solution 1: Using Hash Table and Greedy Bit Manipulation // Time complexity: O(n*m) // Space complexity: O(n) class Solution { public: int maxEqualRowsAfterFlips(vector<vector<int>>& matrix) { int m = matrix.size(), n = matrix[0].size(); map...
ALGO
0.999976
6.114361
{ "github_metadata": { "branch": "main", "commit_count": 182, "repo_created_at": "2022-03-04T16:30: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": "0b297e3b8a...
55c5a390-132d-4346-b1ad-7604f1effa43
gottben/EC602
HW3/w3a_polyops.cpp
// AUTHOR BrianAppleton <EMAIL> // AUTHOR AlexBennett <EMAIL> // AUTHOR CathrynCallahan <EMAIL> // AUTHOR PreranaHaridoss <EMAIL> // git repository https://github.com/gottben/EC602 #include<vector> typedef vector<double> Poly; Poly add_poly(const Poly &a,const Poly &b); Poly multiply_poly(const Poly &a,const Poly &...
ALGO
0.988855
4.362844
{ "github_metadata": { "branch": "master", "commit_count": 90, "repo_created_at": "2016-09-15T12:25:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "88d221431...
06f3fe06-2da4-42dd-a5ca-010ca3a70d75
bubyrevdmitriy/BubyrevWorks
ITMO.C++.Course2020/ITMO.C++.Course2020.Labs.Lab08/ITMO.C++.Course2020.Labs.Lab08/ITMO.C++.Course2020.Labs.Lab08/TriangleComposition_main.cpp
#include <iostream> #include <string> using namespace std; class TriangleComposition { public: TriangleComposition(double x1, double y1, double x2, double y2, double x3, double y3) { this->DotPrivate1 = new DotPrivate(x1, y1); this->DotPrivate2 = new DotPrivate(x2, y2); this->DotPrivate3 = new DotPrivate(x3, y3...
ALGO
0.996247
5.147197
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2020-09-14T15:37: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": "184f92683...
d5f21366-f923-4052-87db-1b23a0620d9b
KaizynX/Code
HDU/dingba2020day41006.cpp
#include <bits/stdc++.h> // #define DEBUG using namespace std; const int N = 1e2+7; int n, m, k; vector<int> v[3]; int main() { while (cin >> n >> m >> k) { for (int i = 0; i < 3; ++i) vector<int>().swap(v[i]); for (int i = 1, ai, si; i <= n; ++i) { cin >> ai >> si; if (...
ALGO
0.999959
4.059284
{ "github_metadata": { "branch": "master", "commit_count": 351, "repo_created_at": "2018-02-19T10:48:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3654810d...
b4abe69e-09e7-43ef-9574-cd84b02cb58b
mmasabalvi/Object-Oriented-Programming
Triangle-Point Relationship/main.cpp
#include "header.h" double sqRoot(double num) { double x = num / 2.0; for (int i = 0; i < 10; ++i) { x = 0.5 * (x + num / x); } return x; } point::point() { x = 0; y = 0; } point::point(int x, int y) { this->x = x; this->y = y; } int point::getx() const { return x; } int point::gety() const { return...
ALGO
0.992129
4.517179
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2023-09-30T17:37:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e27a967c733...
6c0e40e9-8f25-494d-a454-d06340f75ce2
samad-yar-khan/dsa-problemset
Recursion/printSubsets.cpp
/* Print Subsets of Array Send Feedback Given an integer array (of length n), find and print all the subsets of input array. Subsets are of length varying from 0 to n, that contain elements of the array. But the order of elements should remain same as in the input array. Note : The order of subsets are not important. ...
ALGO
0.999539
5.32788
{ "github_metadata": { "branch": "master", "commit_count": 429, "repo_created_at": "2021-04-23T13:05:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "b7f7f083...
bdf54f69-fdb3-496a-bd00-e9d8d8a9d46f
jigyasaG18/Data-Structures-And-Algorithms
Recursion/21)Valid Sudoku.cpp
Valid Sudoku Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules: Each row must contain the digits 1-9 without repetition. Each column must contain the digits 1-9 without repetition. Each of the nine 3 x 3 sub-boxes of the grid must contain the digits ...
ALGO
0.999511
6.848397
{ "github_metadata": { "branch": "main", "commit_count": 255, "repo_created_at": "2024-12-24T05:09: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": "3a268e1472...
c9514d8a-6588-4cf9-8426-1ac08b0fa4ba
GeorgeLyon/SwiftHDL
mlir/llvm/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
///===- SimpleLoopUnswitch.cpp - Hoist loop-invariant control flow ---------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===--------------------------...
ALGO
0.947693
5.394622
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2023-10-24T15:25:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "910f968ca4f0...
184ec467-d2c2-4ec5-8a10-ae04b5ab83f9
kwierman/ORCAnalysis
Core/Math/MathFunctions.cc
#include "ORCA/Math/MathFunctions.hh" namespace ORCA{ namespace Math{ /* template<typename T> T factorial(T x) */ long double one_over_factorial(unsigned long i){ unsigned temp = factorial(i+1); if(temp>2.2204460492503131e9) return 1./(double(factorial<unsigned long>(i)) ); return 1./(double...
ALGO
0.998857
5.173387
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2015-01-29T16:18:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3693e2e32...
22fba232-6fca-4ef7-bb89-e1dcdbc722b5
ankur-kayal/Competitive
Contests/Codeforces/duels/1337A.cpp
#include <bits/stdc++.h> using namespace std; //----------------------------------- DEBUG ----------------------------------- #define sim template < class c #define ris return * this #define dor > debug & operator << #define eni(x) sim > typename \ enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) { sim > ...
ALGO
0.999995
3.490173
{ "github_metadata": { "branch": "main", "commit_count": 84, "repo_created_at": "2020-12-29T03:32:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d7340012bc1...
510f9c03-319b-4f3f-833c-050c76e7c6b6
Waqar-107/CSE-204-Data-Structure-and-Algorithm-1
week1/2.Balanced Parenthesis Problem.cpp
/*Balanced Parenthesis Problem*/ /*1505107*/ #include<iostream> #include<string> #include<cstdio> #include<cstring> using namespace std; #define dbg printf("in"); int Size=10; class ArrayList { int i,j,k; int n,len; int *a,*temp; Malloc() { Size*=2; temp=new int[Size]; ...
ALGO
0.999699
3.951102
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2017-03-04T13:44: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": "6da073441...
0563eabd-85dc-44a7-bff4-ff690c5ef893
qqricky/XCPC_Tranning
CF1632E1.cpp
#include <bits/stdc++.h> #define ll long long #define INF 0x3f3f3f3f //#pragma GCC optimise(2) const int N=6e3+10; using namespace std; template<typename t>void read(t &x){ char ch=getchar();x=0;int f=1; while(ch<'0' || ch>'9') {if(ch=='-')f=-1;ch=getchar();} while(ch>='0' && ch<='9'){x=x*10+ch-'0';ch=getchar();}...
ALGO
0.999825
4.410852
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2022-11-23T06:42:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d8d33ec387...
192965d8-2073-48b4-8155-7991411e83e8
Yangyunhui454545/CodingTest
kakaoCodingTest/yuni_방금그곡.cpp
#include <string> #include <vector> #include <unordered_map> #include <algorithm> using namespace std; /* 악보에 사용되는 음 C, C#, D, D#, E, F, F#, G, G#, A, A#, B --12개 음은 1분에 1개씩 음악 길이보다 재생된 시간이 짧을 때는 처음부터 재생 시간만큼 재생된다. m --기억한 멜로디를 담은 문자열, musicInfo -- 방송된 곡들 음악이 시작한 시간, 끝난 시간, 음악 제목, 악보 정보 */ struct Node { int index; ...
ALGO
0.998502
4.853941
{ "github_metadata": { "branch": "main", "commit_count": 101, "repo_created_at": "2021-04-14T10:55: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": "53bc867392...
6296cb03-aca5-4d7b-a24d-551b5e044b2d
Mohit-Jain-git/DSA-Practice
Binary Trees/distof2nodes.cpp
#include <bits/stdc++.h> using namespace std; struct node { int data; struct node *left; struct node *right; node(int val) { data = val; left = NULL; right = NULL; } }; node *LCA(node *root, int n1, int n2) { if (root == NULL) return NULL; if (root->data == n1 || root->data == n2) re...
ALGO
0.999985
4.906388
{ "github_metadata": { "branch": "main", "commit_count": 166, "repo_created_at": "2021-05-15T10:35: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": "4a7c3185ae...
18b87fd6-dd6d-4a88-8782-0c12e582a629
rajat2004/programming
codechef/mar21_div3_long/E.cpp
#pragma GCC optimize ("-O3") #include<bits/stdc++.h> using namespace std; typedef long long int ll; typedef long long unsigned lluu; typedef long double ld; typedef pair<int,int> p32; typedef pair<ll,ll> p64; typedef pair<double,double> pdd; typedef vector<ll> v64; typedef vector<int> v32; typedef vector<vector<int> >...
ALGO
0.999851
3.945652
{ "github_metadata": { "branch": "master", "commit_count": 99, "repo_created_at": "2020-01-15T18:38: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": "a37a9a93c...
bf54fd45-1e4b-45a1-8953-bd4cbe8cb2b7
lon5948/Intro-to-Algorithm
Lab3/PPAP.cpp
#include <iostream> #include <string> #include <map> #include <set> #include <vector> #include <bits/stdc++.h> #include <math.h> using namespace std; int main(){ cin.tie(0); cin.sync_with_stdio(0); int num,n,count=0,bit,size,many; string str,word; cin >> n; map<string,int> m; map<string,int>::iterator it; ...
ALGO
0.999047
3.979758
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-03-22T18:15:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9a452ea1b4cb...
43dd9e67-1e68-49ce-a630-a6ba0835a86e
wulc2021/C-pulsplus-primerplus
7/7.9_strgfun.cpp
// strgfun.cpp -- functions with a string argument #include<iostream> unsigned int c_in_str(const char * str, char ch); int main() { using namespace std; char mmm[15] = "minnimum"; // string in an array char *wail = "ululate"; // wail points to string unsigned int ms = c_in_str(mmm, 'm'); ...
TOOL
0.982102
4.11144
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2020-03-25T13:40: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": "1ff899ba0...
940d6cbe-d7e5-4a4b-a444-754b1bcf929f
chandan9369/Striver-SDE-Sheet-Challenges
DAY 13/path_in_tree.cpp
/* template <typename T = int> class TreeNode { public: T data; TreeNode<T> *left; TreeNode<T> *right; TreeNode(T data) { this->data = data; left = NULL; right = NULL; } ~TreeNode() { if...
ALGO
0.999994
5.357394
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2022-06-05T13:16: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": "3e722a3681a...
2ebc4db1-880d-47ee-8a1c-c9b503f05f47
igshrey01/PlacewitRevisionCode
28-06-2023/Kth Ancestor.cpp
//Link - https://leetcode.com/problems/kth-ancestor-of-a-tree-node/ class TreeAncestor { vector<vector<int>> dp; int maxL = 0; public: void preCompute(int node, int par, vector<int> adj[], int l){ dp[node][0] = par; for(int i=1;i<=l;i++) dp[node][i] = dp[...
ALGO
0.999999
5.91121
{ "github_metadata": { "branch": "main", "commit_count": 97, "repo_created_at": "2023-06-17T07:24:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "71b457de528...
9a9cefb2-0fe7-4c20-80d1-393e9a338489
zwimer/Memory-Management-Simulator
src/HardDrive.cpp
/* Operating Systems Project 2 * <NAME>ki, <NAME>, <NAME> */ #include "HardDrive.hpp" #include "main.hpp" #include <stdio.h> #include <set> //Declare namespace namespace Contiguous { //The size of the HardDrive const int HardDrive::MemoryWidth = 32; const int HardDrive::MemoryHeight = 8; //Constructor HardDrive:...
TOOL
0.920965
4.426531
{ "github_metadata": { "branch": "master", "commit_count": 45, "repo_created_at": "2016-11-30T05:20:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "28e0bb972...
eff726fb-f232-471e-a1f4-860a56509924
AntKourk/Project2024-25
executables/flipEdges.cpp
#include <CGAL/Exact_predicates_exact_constructions_kernel.h> #include <CGAL/Delaunay_triangulation_2.h> #include <CGAL/draw_triangulation_2.h> #include <cmath> #include "output.h" typedef CGAL::Exact_predicates_exact_constructions_kernel K; typedef CGAL::Constrained_Delaunay_triangulation_2<K> DT; typedef DT::Point ...
ALGO
0.999837
6.170415
{ "github_metadata": { "branch": "main", "commit_count": 75, "repo_created_at": "2024-10-08T15:25: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": "638ccb5f10d...
e0dc8c89-846b-4f57-9f35-c0bf2f387d9d
zaraamerr/CSCI135
hw/middle.cpp
//Name: <NAME> //Date: 2/25/23 //csci135 //HW e5.6: Write a function string middle (string str) that returns //the middle character in a str if the length of the string is odd //or the 2 middle characters if the string is even. #include <iostream> #include <string> using namespace std; string middle (string str){ ...
ALGO
0.917002
5.287312
{ "github_metadata": { "branch": "master", "commit_count": 88, "repo_created_at": "2023-01-25T02:03: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": "1b0290ed8...
6d26dc27-552d-474e-8c2b-f5a5fb852aec
prabowo02/toki-regular-open-contest
troc-17/troc-17-permutation/solution-n2.cpp
#include <cstdio> const int MAXN = 2005; const int MOD = 998244353; int n, k; bool fixed[MAXN]; int dp[MAXN][MAXN]; int main() { scanf("%d %d", &n, &k); for (int i = 0; i < k; ++i) { int a; scanf("%*d %d", &a); fixed[a] = true; } for (int delta = 0; delta <= n; ++delta) dp[0][delta] = 1; fo...
ALGO
0.99997
4.691329
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2020-12-08T03:58:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d9caa3310...
1a874f22-4991-4218-a6b8-b7737d90f989
amalbekd/ADS_22B030510
lab10/f.cpp
#include <bits/stdc++.h> using namespace std; void dfs(int ver, vector<bool>& vis, const vector<vector<int>>& a) { vis[ver] = true; for (int neighbor : a[ver]) { if (!vis[neighbor]) { dfs(neighbor, vis, a); } } } bool areInSameComponent(int s, int f, const vector<vector<int>>&...
ALGO
0.999991
5.26132
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-10-30T10:03: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": "f6be106a6b62...
8e2694b2-d0eb-4d25-9c88-97ec73e17f16
WuyangPeng/ProgrammingBooksCode
游戏设计/物理学/游戏编程中的数理应用/BookFiles/Chapter05/Basic Matrix/MatrixDriver.cpp
///////////////////////////////////////////////////////////////////////// // MatrixDriver.cpp // by <NAME> 1/16/04 // // Purpose: This program demonstrates several math usages of matrices. // ////////////////////////////////////////////////////////////////////////// #include "MatrixLib.h" void showSelection(); void ...
TOOL
0.971011
4.564032
{ "github_metadata": { "branch": "main", "commit_count": 50, "repo_created_at": "2022-08-02T03:48:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fcef4fc9e9d...
276c3cbf-74e5-4a0b-bed2-2310ee9b1500
OU-CLDT-BTL/B-i-T-p-nh-m-8
BT nhóm CTDL GK/CodeC2/BTH2_BT12.cpp
#include <iostream> #include <stdio.h> #include <conio.h> #define MAX 10000 using namespace std; //Khai bao cau trc danh sach struct Node { int value; Node* next, *previous; }; struct DoubleLinkedList { Node* head; Node* tail; }; Node* createNode(int x) { Node* p = new Node; p->value = x; p->next = NULL; p->pr...
ALGO
0.998608
3.590031
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-08-29T14:16:01.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e188d08d2cb1c...
85c63322-6360-4549-8758-1ce8a61e508f
Insoft-UK/PrimeSDK
Xprime/Tools/PrimePlus/src/calc.cpp
// The MIT License (MIT) // // Copyright (c) 2023-2025 Insoft. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the...
TOOL
0.995005
6.54224
{ "github_metadata": { "branch": "main", "commit_count": 417, "repo_created_at": "2025-02-12T21:44:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "880d93d769...
577a722e-01e2-43ba-839c-fb465286f1ec
gdistasi/LNSim
SinglePathSolver.cpp
/* * SinglePathSolver.cpp * * Created on: 23/feb/2018 * Author: giovanni */ #include "MultipathHeuristic.h" #include "SinglePathSolver.h" #include <limits> #include <cassert> #include <cmath> #include <algorithm> #include <cstring> using namespace std; SinglePathSolver::SinglePathSolver(const MultipathH...
ALGO
0.999629
4.232539
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-09-20T15:24:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 13, "forks": 4, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "cacdb1ab...
b9970a28-4256-4ed0-a4a3-c2d98729a6c9
luca-miniati/0x47544f
src/solver/preflop/preflop_solver.h
// // Created by <NAME> on 12/24/24. // #ifndef SOLVER_H #define SOLVER_H #include <vector> #include "preflop_action/preflop_action.h" #include "range/range.h" /** * Represents a GTO preflop solver for No-Limit Texas Hold'Em. A PreflopSolver can train for a set * number of iterations, and can return the solution as...
ALGO
0.999172
7.236328
{ "github_metadata": { "branch": "main", "commit_count": 59, "repo_created_at": "2024-11-25T03:14:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 2, "pull_requests": 1 }, "file_meta": { "content_id": "2bf1236de15...
3f53be2f-360b-44b1-9c04-0d2bc19f9078
seiichiinoue/cstm-pwe
cstm/model.cpp
#include <boost/serialization/serialization.hpp> #include <boost/serialization/base_object.hpp> #include <boost/archive/binary_iarchive.hpp> #include <boost/archive/binary_oarchive.hpp> #include <boost/serialization/vector.hpp> #include <boost/serialization/unordered_set.hpp> #include <boost/serialization/unordered_map...
DATA
0.938708
5.577549
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2020-12-18T03:20:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9631b925b5c...
26d56d57-1bab-4819-8241-dccd0c5d1719
Caesar-Victory/ACWing
高精度减法/main.cpp
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <vector> using namespace std; bool cmp(vector<int> &A, vector<int> &B) { // 先根据数组长度判断大小 if (A.size() != B.size()) return A.size() > B.size(); int i; // 逐位比较是从高位到低位,在两数位数的个数相同的情况下,从高位开始比较,也就是最右边,因为存储是对原数字从右到左读取的 for (int i = A.size() - 1; i >= 0; i--) {...
ALGO
0.999988
3.94788
{ "github_metadata": { "branch": "master", "commit_count": 82, "repo_created_at": "2022-08-16T00:42:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6b74798ef...
ad13c44d-c2aa-48a3-9b8d-72f332ef4aa4
SalDev1/leetcode_contest
monotonic_stack/sum_of_subarr_ranges.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; long long subArrayRanges(vector<int> &nums) { int n = nums.size(); vector<int> minPrev(n, -1); // NSE from the left; vector<int> minNext(n, n); // NSE from the right; vector<int> maxPrev(n, -1); // NGE from the left; vector<int> max...
ALGO
0.99995
5.100218
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-11-22T12:52: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": "e520925d5d2a...
5062ba08-11ab-4dea-8172-2278f887272c
JatinDholakia/Competitive-Programming
Codeforces/Contests/1692/c/main.cpp
#include<bits/stdc++.h> using namespace std; #define deb(x) cout << #x << "=" << x << endl #define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl #define print(vec) For(i,0,vec.size()) {cout<<vec[i]<<" ";} cout<<'\n'; #define set(x) cout.precision(x);cout << fixed; const int mod = 1000000007; const ...
ALGO
0.999809
4.062108
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2020-11-05T03:57: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": "d9a64249e...
62e46e0e-a714-43b2-8fe6-32226bf21962
kunyavskiy/competitive-programming-archive
opencup/20-21/210509/sol2.cpp
/** * author: tourist * created: 09.05.2021 11:47:14 **/ #undef _GLIBCXX_DEBUG //#define LOCAL #include <bits/stdc++.h> using namespace std; template <typename A, typename B> string to_string(pair<A, B> p); template <typename A, typename B, typename C> string to_string(tuple<A, B, C> p); template <...
ALGO
0.998988
4.172746
{ "github_metadata": { "branch": "main", "commit_count": 53, "repo_created_at": "2022-10-08T20:56:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c46bab47d21...
7dfa2fa7-6a64-479d-b0eb-042297ae2cec
joshch100/EECS-402
Arrays.cpp
using namespace std; #include <iostream> #include <iomanip> int main() { int i0, i1, i2; int sum; cout << "Enter int #1: "; cin >> i0; cout << "Enter int #2: "; cin >> i1; cout << "Enter int #3: "; cin >> i2; cout.setf(ios::right); cout << " " << setw(4) << i0 << endl; ...
ALGO
0.997254
4.018857
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-02-06T03:54: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": "3930b3a5d1ae...
4b054a3f-fcd4-4da8-93dd-fc97cf63bfd0
EricLu1218/Advanced_Logic_Synthesis
Technology_Mapping/include/LEDA/incl/LEDA/core/quicksort.h
/******************************************************************************* + + LEDA 5.2 + + + quicksort.t + + + Copyright (c) 1995-2007 + by Algorithmic Solutions Software GmbH + All rights reserved. + *******************************************************************************/ // $Revision: 1.5 $ $...
ALGO
0.999743
5.446793
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2022-06-16T16:40:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "723f7a32cbe...
a7cea922-245d-4605-9e2a-50feaa3d160a
destinyson7/All-Codes
Codeforces/TEAM/101652/W.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef long double ld; typedef pair <ll, ll> pll; typedef pair <int, int> pii; typedef tree <ll, null...
ALGO
0.999928
3.616283
{ "github_metadata": { "branch": "master", "commit_count": 213, "repo_created_at": "2019-12-02T11:53: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": "260e06e8...
3f239303-109f-456b-9e6a-62a31faab93b
kskisb/atcoder_submissions
abc/263/C.cpp
#include <iostream> #include <string> #include <vector> #include <cmath> #include <limits.h> #include <algorithm> #include <map> #include <queue> #include <set> #include <stack> using namespace std; using ll = long long; using veci = vector<int>; using vecll = vector<ll>; using vecd = vector<double>; using vveci = vect...
ALGO
0.999942
3.722524
{ "github_metadata": { "branch": "main", "commit_count": 195, "repo_created_at": "2024-03-25T11:44: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": "8a791cda41...
725b0b09-9bb7-4b23-8c16-b8e3371a9c2a
LouisEmulator/Main5.2
Source MuServer Update 15/GameServer/GameServer/MapPath.cpp
// MapPath.cpp: implementation of the CMapPath class. // ////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "MapPath.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction //////////////////////////////////////////////////...
ALGO
0.995412
4.01153
{ "github_metadata": { "branch": "main", "commit_count": 78, "repo_created_at": "2021-07-23T19:14:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 86, "forks": 103, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "27dd06aa...
009ca872-f0f2-42c5-949f-1da739a9c60c
chaowang15/RGBDPlaneDetection
RGBDPlaneDetection/include/MRF2.2/ICM.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include "ICM.h" #define m_D(pix,l) m_D[(pix)*m_nLabels+(l)] #define m_V(l1,l2) m_V[(l1)*m_nLabels+(l2)] ICM::ICM(int width, int height, int nLabels,EnergyFunction *eng):MRF(width,height,nLabels,eng) { m_needToFreeV = 0; ...
ALGO
0.999196
5.094902
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2017-12-19T04:55:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 234, "forks": 57, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "7f4d4f...
76a3361c-4d5c-4505-a3c9-7e0c9b745337
shreyjain711/LC-Practice
Graphs/pacific_atlantic_water_flow.cpp
// ***Problem Desc***: given a grid, from which cell can rainwater reach both sides (left & top and right & bottom) // ***from left and right edge do dfs, mark cells where pacific gets flow, same (right and bottom) for atlantic, ans is where both flows possible [O(m.n) time | O(m.n) space]***: void dfs(int i, int j, v...
ALGO
0.999983
6.450814
{ "github_metadata": { "branch": "main", "commit_count": 984, "repo_created_at": "2024-02-02T18:09: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": "eb3389e456...
6ef83004-4ccf-4aec-a3ee-7450ad7587ca
ustcyyw/algorithm
luogu/math/xor_basis/P3857.cpp
/** * @Time : 2025/3/17-7:49 PM * @Author : <EMAIL> * @E-mail : <EMAIL> * @Github : https://github.com/ustcyyw * @desc : P3857 线性基 */ /* * 某个开关按两次 等于这个开关没有按 * 因此最终能得到多少个灯状态 其实就是转化为选择一些开关(可以一个都不选) * 选出来的开关按一次即可 * 对于某一个灯 会有多个选出来的开关控制它 都按一次 就看是奇数个还是偶数个 * 这些行为和异或一致 * 因此灯的状态就是选出的开关的异或值 要从集合a中选出一些元素得到其异或值 ...
ALGO
0.999986
4.257289
{ "github_metadata": { "branch": "main", "commit_count": 162, "repo_created_at": "2024-11-11T07:09:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d68d34f710...
58da43e3-9b0b-4135-bef3-bc151e8f13c5
alirezafour/ChaCha20
ChaCha20/main.cpp
#include <iostream> #include <string> #include <iomanip> #include <cassert> #include "ChaCha20.h" std::vector<uint8_t> string_to_vector_u8(const std::string& s) { std::vector<uint8_t> result; result.reserve(s.size()); for(const auto each : s) { result.push_back(static_cast<uint8_t>(each)); } return result; } ...
TOOL
0.997662
6.092763
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2023-04-13T14:00: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": "4af585d932...
24bf1978-c09c-4c6f-9b90-07fbabbea16e
jiveshanand007/Strivers-SDE-Sheet-Challenge
160.Cycle Detection In Undirected Graph.cpp
bool checkCycle(int node, int parent, vector<bool> &vis, vector<bool> &pathVis, vector<vector<int>> &adj) { vis[node] = true; // pathVis[node] = true; for (auto adjNode : adj[node]) { if (!vis[adjNode]) { if (checkCycle(adjNode, node, vis, pathVis, adj)) retur...
ALGO
0.999998
6.26689
{ "github_metadata": { "branch": "main", "commit_count": 170, "repo_created_at": "2023-06-04T07:01: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": "76ca9c291c...
113a3268-4344-4a1e-8059-4c3fb552fec7
NVIDIAGameWorks/PhysX
physx/source/lowlevel/common/src/pipeline/PxcContactMethodImpl.cpp
// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in bin...
TOOL
0.940466
5.494956
{ "github_metadata": { "branch": "4.1", "commit_count": 12, "repo_created_at": "2018-12-05T14:30:22.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3397, "forks": 824, "issues": 311, "pull_requests": 18 }, "file_meta": { "content_id": "04d80...
0953b73f-5160-4146-8238-851943b90483
tokbaev-a/auca-alg-2021
project-01/uva-10145/main.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; int c = 0; while (t--) { if (c > 0) { printf("\n"); } char m; int trid, item; unordered_map<int, int> x; unordered_map<int, set<int>> s; set<int...
ALGO
0.99853
3.994976
{ "github_metadata": { "branch": "main", "commit_count": 122, "repo_created_at": "2021-01-11T05:10: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": "763b76af9c...
f22cbded-6807-48cc-90d3-387815614417
dae00a/BOJ_COTEST
백준/Gold/16940. BFS 스페셜 저지/BFS 스페셜 저지.cc
#include <bits/stdc++.h> using namespace std; int N; vector<vector<int>> G(100001); vector<int> A; void bfs(); int main(void) { cin.tie(nullptr); cin.sync_with_stdio(false); cin >> N; for(int i = 0; i < N - 1; i++) { int a, b; cin >> a >> b; G[a].push_back(b); G[b].p...
ALGO
0.999973
3.887757
{ "github_metadata": { "branch": "main", "commit_count": 123, "repo_created_at": "2022-09-24T00:55: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": "b237015277...
3389adc6-737f-4bc0-8fe1-1107b5da2c62
vpursuit/AlgorithmsCPlusPlus
Graphs/ShortestPath.h
// // ShortestPath.h // Homework2 // // Created by <NAME> on 02.11.13. // Copyright (c) 2013 <NAME>. All rights reserved. // #ifndef __Homework1__ShortestPath__ #define __Homework1__ShortestPath__ #include <iostream> #include <vector> #include <stack> #include "PriorityQueue.h" #include "Graph.h" using namespace...
ALGO
0.999757
5.01028
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2019-08-14T10:28: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": "578423a2a2...
1c2d8726-2f8c-4b80-a95e-99ce6d8b72f1
TenFifteen/SummerCamp
lbc_lintcode/050-product-of-array-exclude-itself.cc
/* 题目:25 % 数组剔除元素后的乘积 容易 题目大意: 给定一个数组A,求数组B,B[i] 等于所有除了A[i] 之外的元素的乘积; 不能使用除法; 解题思路: 分别从两端计算子段的乘积 遇到的问题: 没有太大问题,只不过把--i写成了++i */ class Solution { public: /** * @param A: Given an integers array A * @return: A long long array B and B[i]= A[0] * ... * A[i-1] * A[i+1] * ... * A[n-1] */ vector<long...
ALGO
0.999986
5.065702
{ "github_metadata": { "branch": "master", "commit_count": 2242, "repo_created_at": "2015-07-06T03:15:55.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 8, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "31329504...
0c3dec07-e18b-438f-8ced-8473a11f0509
public-domain/muscle
bwdprobcons.cpp
#include "myutils.h" #include "sumlog.h" #include "pcparams.h" #include "mx.h" #include "seqdb.h" #define m(x) static Mx<float> g_Bwd##x; m(M) m(D) m(I) m(X) m(Y) #undef m void BwdProbcons(SeqDB &DB, unsigned IdA, unsigned IdB) { const byte *A = DB.GetSeq(IdA); const byte *B = DB.GetSeq(IdB); unsigned LA =...
ALGO
0.99955
4.45009
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-03-01T20:48:01.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2d61c549ef2...
c60e7902-57bb-40db-b581-f4e7f05ee612
maitbayev/algorithms
DecardTree/kthmax/sol_vector.cpp
#include <cstdio> #include <vector> #include <ctime> #include <cstdlib> using namespace std; struct Node { int l,r; int c,x,y; Node() { l=r=c=x=y=0; } }; vector< Node > root; int n,rt; void Norm(int v) { if (v) root[v].c=root[root[v].l].c+root[root[v].r].c+1; } void Split(int v,int x,int &l,int &r) { if...
ALGO
0.999981
3.693392
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2014-05-27T04:21:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5f5ea557d...
0885d99a-463e-44df-9e1a-d38c737fd9a2
satyav7/MissionRnD-C-LinkedLists-Worksheet
src/removeEveryKthNode.cpp
/* OVERVIEW: Given a single linked list, remove every Kth node in the linked list. E.g.: 1->2->3->4->5 and K 2, output is 1->3->5. INPUTS: A linked list and Value of K. OUTPUT: Remove every Kth node in the linked list. ERROR CASES: Return NULL for error cases. NOTES: */ #include <stdio.h> struct node { int num; ...
ALGO
0.990975
3.9355
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2016-03-18T05:28: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": "d232770882...
ed8a3acb-74bf-43e5-85a1-1e1d12211a58
thisisrajat/competitive-programming
Codeforces/279B.cpp
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <vector> #include <list> #include <string> #include <map> #include <set> #include <bitset> #include <deque> #include <sstream> #include <utility> #include <functional> #include <numeric> #include <stack> #include <queue> #include <cm...
ALGO
0.999955
3.733904
{ "github_metadata": { "branch": "master", "commit_count": 86, "repo_created_at": "2014-03-12T14:04: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": "dcea8b66c...
466f8c82-b03b-4a88-8467-a6d339f86228
simongog/sdsl-lite
examples/sd_vector_benchmark.cpp
#include <sdsl/bit_vectors.hpp> #include <random> #include <iostream> #include <chrono> using namespace sdsl; using namespace std; using namespace std::chrono; using timer = std::chrono::high_resolution_clock; template<class t_vec> uint64_t test_inv_random_access(const t_vec& v, const int_vector<64>& rands, uint64_...
TEST
0.953288
5.011681
{ "github_metadata": { "branch": "master", "commit_count": 1969, "repo_created_at": "2013-02-28T22:34:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2269, "forks": 354, "issues": 71, "pull_requests": 25 }, "file_meta": { "content_id": "...
78c305da-7f6c-4009-bbcc-ade5e96d8c0f
IHR57/Competitive-Programming
CodeForces/CodeForces - 242C.cpp
//<NAME> #include <iostream> #include <cstdio> #include <cmath> #include <cstring> #include <cstdlib> #include <climits> #include <string> #include <stack> #include <queue> #include <deque> #include <set> #include <map> #include <vector> #include <algorithm> #include <sstream> #include <iomanip> #include <list> #define...
ALGO
0.999961
3.514813
{ "github_metadata": { "branch": "master", "commit_count": 80, "repo_created_at": "2018-12-28T07:37:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fa027746b...
bc8284ad-dd68-464d-b263-9604c66af925
shendrew/contest-archive
USACO/2020-21/Dec_s3/stuckInARut.cpp
#include <iostream> #include <vector> #include <map> #include <algorithm> using namespace std; #define f first #define s second int n; vector<pair<int,int>> east, north; map<pair<int,int>, int> ind; int stopCow[1001], ans[1001]; bool stop[1001]; bool compareSecond(const pair<int,int> &a,const pair<int,int> &b) { ...
ALGO
0.999962
3.938222
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2021-12-06T20:26: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": "56fef9acad10...
3f7509a8-1521-4cd3-85df-35d1e87e5f17
smgarner229/dgemm_primer
src/main.cpp
#include <iostream> #include <iomanip> #include "Accelerate/Accelerate.h" // Definitions to make editting easier #define matsize 4 void call_dgemm(); void print_square_matrix(int n, double * mat); int main(int argc, char * argv[]) { call_dgemm(); return 0; } void call_dgemm() { double * A = new double[m...
ALGO
0.998942
5.159314
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2024-02-27T23:28: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": "d116adfbb2...
e229cfb6-91ca-4b5f-81ff-20e2d27d880f
dofo-eat/Code_Learned
1.代码/7.LEETCODE/102.二叉树的层次遍历.cpp
/************************************************************************* > File Name: 102.二叉树的层次遍历.cpp > Author: dofo-eat > Mail:<EMAIL> > Created Time: 2020年02月29日 星期六 15时11分55秒 ************************************************************************/ /** * Definition for a binary tree node. * struct TreeNod...
ALGO
0.99995
5.453991
{ "github_metadata": { "branch": "master", "commit_count": 150, "repo_created_at": "2019-11-26T12:54:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4ac5830f...
7e4add17-bbc8-4ccc-b25e-f3acaf8930f1
mmaffeo/mmaffeo
sources/cancipher.cpp
#include "cancipher.h" #define XTEA_ROUNDS 32 #define XTEA_HASH_ROUNDS 17 #define XTEA_KEY_ELEMENTS (sizeof(key) / sizeof(key[0])) #define XTEA_DELTA 0x9E3779B9 #define DEFAULT_KEY_0 <KEY> #define DEFAULT_KEY_1 0x285ecede #define DEFAULT_KEY_2 <KEY> #define DEFAULT_KEY_3 <KEY> #define HASH_KEY_0 <KEY> #define HASH_K...
ALGO
0.943142
5.625099
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-09-18T05:47:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "97160d922e...
1cffa29c-1862-485f-8539-bebf6f77d480
Xiaoying-Huang/cpp-Exercise
letter_pyramid.cpp
#include <iostream> #include <string> using namespace std; int main() { cout << "\nEnter your string to build a letter pyramid:" << endl; string input_str{}; getline(cin, input_str); size_t str_length = input_str.size(); string line_str{}; for (int i = 0; i < str_length; i++) { // ...
TOOL
0.999207
4.912803
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2023-06-16T09:56: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": "d000696c35d6...
f50658a0-5ab7-4467-a0b6-bc72915e5f0e
dudals4824/algorithm_study
BOJ_1759_crypto.cpp
#include<iostream> #include<algorithm> using namespace std; int L, C; char * ch; int * com; void combination(int arr[], int index, int n, int r, int target); void print(int arr[], int length); int main(void) { cin >> L >> C; ch = new char[C]; com = new int[C]; for (int i = 0; i < C; i++) { cin >> ch[i]; com[i]...
ALGO
0.999947
3.045359
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2017-10-24T04:07: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": "86a0dc9b9...
5d1f1fad-303a-4c7a-b3a4-1e50ebf91ec8
101AoiKoori/C_language_snack
Computer graphics/doughnut.cpp
#include <cstdio> #include <conio.h> #include <cmath> #include <vector> #include <cstring> #include <iostream> using namespace std; const double Pi = 3.1415926; const int A_DIV = 20; const int B_DIV = 80; const double DA = 2 * Pi / A_DIV; const double DB = 2 * Pi / B_DIV; const int a1_DIV = 25; const int a2_DIV = 2...
ALGO
0.995925
3.214825
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2024-06-06T16:53: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": "d4236937c66...
6f07ace7-b075-42d5-b638-9714d8887870
myduyen14125/basic-OOP
Chuong4_Operator/Poly.cpp
#include <iostream> #include <math.h> #include "Poly.h" using namespace std; Poly::Poly(int size) { this->size = size; this->data = new int[size + 1]; int i; for (i = 0; i <= size; i++) { this->data[i] = 0; } } Poly::Poly(int Init[], int n) { this->size = n; data = new int[n + 1...
ALGO
0.996841
3.829284
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-02-10T01:28:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "68a51ca15a19...
961780e7-5786-448e-9803-5760dd939a1a
Algorithm-Artisan-Sandip/LeetCode_Solved_Questions
21-merge-two-sorted-lists/merge-two-sorted-lists.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* mergeTwoLis...
ALGO
0.999946
6.078873
{ "github_metadata": { "branch": "main", "commit_count": 985, "repo_created_at": "2024-03-31T12:51: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": "c0a90852b1...
121938e5-1264-4b0c-9628-7ef932625baf
meiyoumingzile/ICPC_AlgorithmTemplete
ICPC_AlgorithmTemplete/数据结构/平衡二叉搜索树/rot_treap/treap(旋转).cpp
#include<bits/stdc++.h> //#include<windows.h> using namespace std; #define ll long long #define inf 1e-5 const int inv2=500000004; const int INF=2147483647; const int MAX=1000010; const int mod=1e9+7; struct Data{ int k;//key int rnd;//堆优先级,随机取 int cnt=1;//该节点出现次数 int sumcnt=0;//自己节点数的个数,会把相同的算进去 }; s...
ALGO
0.999936
4.244764
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2018-11-29T13:30:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4be2b46b1...
1ed504c5-4ac3-40ee-aaf6-6892641b7b91
rishisankar/icpc
algorithms/datastructures/lazy_segtree.cpp
/* Lazy segtree (can work implicitly? not tested) ; based on kactl Example: cses/range_queries/range_updates_and_sums Initialization: Node tree(v, 0, n); O(nlogn) build, O(logn) set/add/query */ struct Node { typedef ll T; const T unit = 0; const T inf = LLONG_MIN; // value that is not present in segtree ...
ALGO
0.999535
5.946921
{ "github_metadata": { "branch": "main", "commit_count": 324, "repo_created_at": "2021-01-08T15:36: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": "ba11f711f3...
e37959d3-3d1b-4235-b793-2430992defc0
suraj-20/DSA
Arrays/MinMax.cpp
#include <iostream> using namespace std; int getMin(int num[], int n) { int minimum = INT_MAX; for (int i = 0; i < n; i++) { // minimum = min(minimum, num[i]); if (num[i] < minimum) { minimum = num[i]; } } // Returning minimum value. return minimum; } int getMax(int num[], int n) { ...
ALGO
0.999259
4.693284
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2022-09-20T05:19: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": "e4b1a83fb70...
27f6aefc-a862-46a1-be4b-5e1efa306f31
archerixx/StudyRepository
PassTheStreet- Game/Source.cpp
#include <iostream> #include <conio.h> #include <Windows.h> #include <ctime> using namespace std; const int width(30), height(16); int x = width / 2; int y = height; bool gameOver = false; const int maxH = height - 4; const int maxW = width/10; bool gameWon = false; void gui(int cars[][width]) //int &carA, int& ca...
ALGO
0.998034
3.452508
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2021-01-18T22:54:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "47b624d7c...
3518a4d5-66ec-4162-b822-d89e17aff9ff
ishandutta2007/codeforces-b
bohun/normal/1427/B.cpp
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fi first #define se second #define sz(x) (int) x.size() #define cat(x) cerr << #x << " = " << x << endl #define all(x) x.begin(), x.end() #define rep(i, j, n) for (int i = j; i <= n; ++i) #define per(i, j, n) for (int i = n; j <= i; --i) using...
ALGO
0.999844
3.469334
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-04-11T01:05:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "eb1885093dcc...
fde5d4b3-c69f-45a5-93b6-03e5d98a35fc
chamara84/whiteBoardCodePractice
ConsoleApplication1/ConsoleApplication1.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { int n, q, k; int** varArray; cin >> n >> q; varArray = new int* [n]; int **qArray=new int *[q]; for (int j = 0; j < n; j++) { cin >> k; int *array = new int [k]; varArray[j] = a...
ALGO
0.999601
3.712474
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-05-27T14:27: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": "8c10e566dc...
a82235ab-3fd0-4cc1-a1fb-ecea60d9e3b0
praveengupta1701/Data-Structures-and-Algorithm
Linked List/reverse list.cpp
// Created by ... /* Author -<NAME>*/ #include <bits/stdc++.h> #include <thread> #include <mutex> #include <chrono> #include <memory> #include <condition_variable> using namespace std; using namespace std::chrono; struct ListNode { int val; ListNode *next; ListNode() : val(0), next(nullptr) {} ...
ALGO
0.999658
5.542855
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2022-10-01T02: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": "915bdb1e2f5...
a6e9a782-149b-41ee-9c26-337460571ff3
kirti22agg/DSA-practice
quicksort.cpp
#include <iostream> #include <ctime> using namespace std; int partitionhelper(int *arr,int s,int e){ //jis se hm mid ka index return krenge int i=s-1; int pivot = arr[e]; for(int j=s;j<=e-1;j++){ if(arr[j]<=pivot){ i++; swap(arr[i],arr[j]); } } swap(arr[i+1],...
ALGO
0.999983
5.592388
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-08-17T06:48: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": "43da98dc9816...
772a890d-4965-477b-bf2b-2303d8ad02fa
TortCode/TortUSACO
PastUSACO(2018-2019)/OpenSilver/leftout.cpp
#include <fstream> #include <bitset> #include <string> using namespace std; bitset<1000> grid[1000]; int n; void vert_flip(int col) { for (int i = 0; i < n; i++) grid[i][col] = !grid[i][col]; } int main() { ifstream input("leftout.in"); ofstream output("leftout.out"); input >> n; string s; for (int i = 0; i <...
ALGO
0.999937
3.446913
{ "github_metadata": { "branch": "master", "commit_count": 230, "repo_created_at": "2018-11-21T00: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": "c9c9083a...
99284616-183a-451d-ad7f-724eea9459e7
Fengdalu/acm-icpc
Poj/2996.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <string> #include <sstream> #include <algorithm> #include <vector> #include <map> using namespace std; struct node { char c; int x, y; node(){} node(char c, int x, int y) : c(c), x(x), y(y) {} }; vector<node>black, white; map<char, int>order; char ...
ALGO
0.996005
3.627192
{ "github_metadata": { "branch": "master", "commit_count": 772, "repo_created_at": "2014-12-24T15:25:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f84871a5...
b5987d2c-aba0-4a33-b7e9-d6b80fba9ab3
tamanna6/level-1-term-2
friend function.cpp
#include <iostream> using namespace std; class Car; class Truck { private: int weight; public: Truck(int w) : weight(w) {} friend void compareWeight(Truck t, Car c); }; class Car { private: int weight; public: Car(int w) : weight(w) {} friend void compareWeight(Truck t, Car c); };...
ALGO
0.998498
5.257712
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2023-01-26T12:28: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": "39f5938b9df...
acb16c85-b631-4804-991c-23fe65af3cda
rajuuu1992/algoPart1
samples/Heap.cpp
template <class T> class MyHeap { public: MyHeap(vector<T> input_arr, int max_length) : arr(input_arr), max_len(max_length), len(input_arr.size()) { } ~MyHeap() { arr.clear();} void Insert(T elem) { if (arr.size() > max_len) { Remove(); return; } ...
ALGO
0.999914
5.084254
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2022-12-31T05:34: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": "5852a86c484...
92cd3100-aaa5-48dc-8916-04f4b9f9cd4e
FranklineMisango/ENGG1340
Module_6/replace.cpp
#include <iostream> using namespace std; bool match(string& str, string& pattern, int pos) { for (int i = 0; i < pattern.length(); i++) { if (pos + i >= str.length() || str[pos + i] != pattern[i]) { return false; } } return true; } int main() { string input1, input2, input...
ALGO
0.999839
4.232893
{ "github_metadata": { "branch": "main", "commit_count": 31, "repo_created_at": "2023-01-17T10:03:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "800b3f5cf43...
b9b5987f-4189-4dde-bcf3-9cf6c6bd2e52
Cipher-Schools/Competitive_Coding_Cpp
searching&sorting/search-in-sorted-rotated-array.cpp
// https://leetcode.com/problems/search-in-rotated-sorted-array/ #include <bits/stdc++.h> using namespace std; class Solution { public: int search(vector<int> &nums, int start, int end, int target) { if (start > end) { return -1; } int mid = start + (end ...
ALGO
0.999987
6.127731
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2022-01-24T17:35:57.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 11, "forks": 38, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "438a41de82...
8a2bb6ca-272f-4c39-9a2b-d6d872449ae1
SungJaeShin/Delaunay_triangulation
src/richard/triangle.cpp
/*****************************************************************************/ /* */ /* 888888888 ,o, / 888 */ /* 888 88o88o " o8888o 88o8888o o88888o 888 o88888o */ ...
ALGO
0.998302
3.636904
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2023-07-15T14:49:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bd5830dc811...
6297bdf7-d309-4bbc-a669-8f60cfa4cece
raidenblackout/CP-2
parvez.cpp
#include <iostream> void sort(int *x, int *y); int partition(int arr[], int low, int high); void QUICKSORT(int arr[], int low, int high); void printarray(int arr[], int n); using namespace std; int main() { int arr[] = {7, 6, 10, 5, 9, 2, 1, 15, 7}; int length = sizeof(arr) / sizeof(arr[0]); QUICKSORT(arr...
ALGO
0.999921
5.413171
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2021-11-25T21:27: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": "672cedb0f9...
b04155e7-0f2f-429c-9ac4-b4f14b14242b
roor48/Algorithm
백준/Gold/1577. 도로의 개수/도로의 개수.cc
#include <iostream> using namespace std; int N, M, K; long long dp[101][101] = {0}; bool paths[101][101][4] = {0}; int dirX[2] = {0, 1}; int dirY[2] = {1, 0}; void f() { dp[0][0] = 1; for (int y = 0; y <= M; y++) { for (int x = 0; x <= N; x++) { for (int i = 0; i < 2; i++)...
ALGO
0.999944
4.690293
{ "github_metadata": { "branch": "master", "commit_count": 149, "repo_created_at": "2023-10-05T09:48:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a0637d98...
e0a27a05-90c8-4027-bc9b-8514562128bd
fricai/competitive-programming
atcoder/abc232/F.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i, a, b) for (auto i = (a); i < (b); ++i) #define per(i, a, b) for (auto i = (b); i-- > (a); ) #define all(x) begin(x), end(x) #define rall(x) (x).rbegin(), (x).rend() #define sz(x) int((x).size()) template<class ...
ALGO
0.999951
4.196497
{ "github_metadata": { "branch": "master", "commit_count": 2301, "repo_created_at": "2021-09-29T18:57:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d4f081a...
bffa2a1f-fe85-4673-9626-eb028dc31fd8
Iamshankhadeep/100DaysOfCP
Day6/weirdo.cpp
#include<bits/stdc++.h> using namespace std; bool check(string s){ int a=0,b=0; for (int i = 0; i < s.size(); i++) { if(s[i]=='a' || s[i]=='e' || s[i]=='i' || s[i]=='o' || s[i]=='u'){ a++; } else { b++; } } return a>=b; } int main(){ ...
ALGO
0.999749
3.883739
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2019-10-26T05:40:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d86ea0e96...
1271224c-8176-41a8-b184-5e0568fb2096
habanero-rice/hclib
test/performance-regression/full-apps/qmcpack/src/Numerics/determinant_operators.h
////////////////////////////////////////////////////////////////// // (c) Copyright 2008- by <NAME> ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// // National Center for Supercomputing Applications & // Materials Computation Cen...
TOOL
0.995179
6.230047
{ "github_metadata": { "branch": "master", "commit_count": 705, "repo_created_at": "2014-08-11T16:15:45.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 71, "forks": 36, "issues": 11, "pull_requests": 0 }, "file_meta": { "content_id": "b9c5e5...
03128257-b886-4876-b20c-2dc4d9cf4b95
gabfani/ALPRO-4212
binary/main.cpp
#include <iostream> #include <chrono> using namespace std; using namespace std::chrono; // Fungsi binary search rekursif int binarySearchRekursif(const vector<int>& arr, int target, int kiri, int kanan) { if (kiri <= kanan) { int tengah = kiri + (kanan - kiri) / 2; // Jika target ditemukan, kemba...
ALGO
0.999892
4.668393
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2023-03-14T06:42: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": "6ea363bf3cf...
19d0682e-4399-4678-8fb7-b20b20199377
kishan62435/LeetCode-Questions
Find Index - GFG/find-index.cpp
//{ Driver Code Starts #include <iostream> #include <bits/stdc++.h> #include <vector> using namespace std; // } Driver Code Ends class Solution { public: vector<int> findIndex(int a[], int n, int key) { //code here. int l=0, r=n-1; vector<int>vec = {-1, -1}; while(...
ALGO
0.999899
6.067787
{ "github_metadata": { "branch": "main", "commit_count": 147, "repo_created_at": "2023-01-19T12:39:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "29314b4ac4...