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
9587fcc2-29f8-4c3a-8f44-4d839edf5b8e
Bull2021/FinancialEngineer
ExactPricingKernal/EuropeanOption.cpp
#include "EuropeanOption.hpp" #include "boost/math/distributions/normal.hpp" #include <cmath> using namespace std; using boost::math::normal; EuropeanOption::EuropeanOption() { //Default Constructor } EuropeanOption::EuropeanOption(const EuropeanOption& source) { //Copy Constructor S = source.S; T = source.T; r ...
ALGO
0.982675
5.931859
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2020-11-03T19:04: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": "c3f37786489...
76c9b4b1-dc53-437a-8816-e3bfe6eef9bd
DeveshS360/Must-do-coding-questions-of-Geeks-for-Geeks
Stacks_and_Queues/Get_minimum_element_from_stack.cpp
/*The structure of the class is as follows class _stack{ stack<int> s; int minEle; public : int getMin(); int pop(); void push(int); }; */ /* This is very difficult question with a solution which is completely non-intuitive*/ /* Approach:1. Define a variable minEle that stores the current minimum element ...
ALGO
0.999934
4.748237
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2020-02-02T15:26:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7f2168446...
0da0eaee-1a11-411a-9e93-072428118941
ParitoshAnilNeelamChaurasia/strings
13_Concatenated Words.cpp
// https://leetcode.com/problems/concatenated-words/description/ class Solution { public: bool is_concatenated(string word , unordered_set<string> &st) { int l = word.size() ; for(int i = 0 ; i < l ; ++i) { string pref = word.substr(0,i) ; string suff = word.s...
ALGO
0.999805
6.348485
{ "github_metadata": { "branch": "main", "commit_count": 39, "repo_created_at": "2024-09-02T07:59: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": "8f9c14a15fa...
ca951f16-6130-4d0c-8164-1be6fcb4d345
corvvs/webserv
src/config/Parser.hpp
#ifndef PARSER_HPP #define PARSER_HPP #include "Config.hpp" #include "Lexer.hpp" #include <iostream> #include <map> #include <stack> #include <string> #include <utility> namespace config { struct Directive { std::string name; int line; std::vector<std::string> args; std::vector<Directive> block; ...
CONFIG
0.971336
5.437629
{ "github_metadata": { "branch": "main", "commit_count": 771, "repo_created_at": "2022-05-19T11:18:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 2, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "367b5d113e...
5a5274bd-54e5-475e-9f3b-2158e7992d1b
ComputerProgrammerStorager/DataStructureAlgorithm
CLRS/Math/CountPrimes.cpp
/* Count the number of prime numbers less than a non-negative number, n. Example 1: Input: n = 10 Output: 4 Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7. Example 2: Input: n = 0 Output: 0 Example 3: Input: n = 1 Output: 0 Constraints: 0 <= n <= 5 * 106 */ // up to n/2 has no factors...
ALGO
0.999955
6.106619
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2021-08-16T03:57:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "81ac08a6e7a...
3bb343e8-4600-4910-8c77-0c2b146c3b9d
util6/cpp-algorithm-code
Acwing1022_PokemonSReception.cpp
// // Created by 95853 on 2021/7/20. // /** * http://ybt.ssoier.cn:8088/problem_show.php?pid=1292 */ #include "bits/stdc++.h" using namespace std; const int N = 1010, M = 505, K = 105; int n, v, m, dp[N][M]; int main() { //v(0<N<1000),m(0<M<500),n(0<K<100),分别代表小智的精灵球数量、皮卡丘初始的体力值、野生小精灵的数量。 //其中花费为精灵球和比卡丘体力值 ...
ALGO
0.999968
3.414596
{ "github_metadata": { "branch": "master", "commit_count": 40, "repo_created_at": "2022-06-05T11:00: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": "15a487f18...
0388b7a1-6ca0-4701-98c1-9f9b1e591169
SnowySparks/BOJ_Algorithm
백준/Gold/2036. 수열의 점수/수열의 점수.cc
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(void) { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); vector<int> minus; vector<int> plus; vector<int> one; long long ans = 0; int one_cnt = 0; int n; cin >> n; int tmp; for (int i ...
ALGO
0.999989
4.016735
{ "github_metadata": { "branch": "main", "commit_count": 411, "repo_created_at": "2024-01-11T05:37: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": "0274940961...
d9f4005c-bbc0-44cb-b24e-a7d882afac7d
Shubham-ncu/FOCP_2_Lab
c++ Assignment/A1_Q12.cpp
//Write a program that solves a quadratic equation (ax^2 + bx + c = 0) using conditional statements to handle all possible cases (real and distinct roots, real and equal roots, complex roots). #include <iostream> #include <cmath> using namespace std; int main() { double a, b, c; cout << "Enter coefficie...
ALGO
0.998824
5.227816
{ "github_metadata": { "branch": "main", "commit_count": 38, "repo_created_at": "2025-01-31T07:03:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "51fa6b454b7...
66cbb058-a398-4126-b2b7-df0719e6f0f7
Sourabh-Kumar04/Data_Structure_and_Algorithm
Tree/02_Level_order_tree_traversal.cpp
#include <iostream> #include <queue> using namespace std; struct Node { int data; Node* left; Node* right; Node(int data) { this->data = data; this->left = nullptr; this->right = nullptr; } }; void levelOrderTraversal(Node* root) { if (root == nullptr) { retur...
ALGO
0.999932
5.755389
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2024-12-14T13:01: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": "887a244dba...
9a7cc920-4e76-46e8-8910-d35080167104
all4one1/FEM
IterativeSolver.h
#pragma once #include <iostream> #include <iomanip> #include <fstream> using std::cout; using std::endl; using std::ofstream; struct IterativeSolver { int k = 0, write_i = 0; double eps_iter = 1e-6; ofstream w; IterativeSolver() { } void solveGS(double* f, double* f0, double* bb, int NN, double** M) { k = 0...
ALGO
0.997362
4.539397
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2024-03-26T19:58: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": "17794783ad...
015ad49a-500e-4839-827a-fa3f5aac1cc9
lis123kr/Baekjoon-Online-Judge
Accept/10026 적록색약.cpp
#include<stdio.h> #include<queue> #include<vector> #include<algorithm> #include<cstring> using namespace std; char G[101][101]; bool visited[101][101]; int dy[4] = { -1,1,0,0 }, dx[4] = { 0,0,-1,1 }, n; void dfs(int y,int x, bool f) { visited[y][x] = true; for (int i = 0; i < 4; i++) { int ny = y + dy[i], nx = x + ...
ALGO
0.999549
3.610993
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2016-11-29T07:54: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": "b3a37c059...
314da9a0-6352-4221-b06b-9a97053420b3
uncle-lu/CSES-Solutions
code/1619.cpp
#include <algorithm> #include <cstdio> using namespace std; const int N = 2e5 + 10; struct node { int t, op; friend bool operator<(const node a, const node b) { return a.t < b.t || (a.t == b.t && a.op < b.op); } }; node line[2 * N]; int main() { int n, a, b, cnt = 0, now = 0, ans = 0; scan...
ALGO
0.999974
3.774159
{ "github_metadata": { "branch": "master", "commit_count": 30, "repo_created_at": "2024-12-22T05:02:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "47814d9ff...
57c44043-bf93-44be-b5b9-446ffd0b5e74
vvvv/vvvv-sdk
vvvv45/addonpack/src/nodes/freeframes/ARTK+Tracker/ARToolKitPlus/src/librpp/rpp_svd.cpp
/* ======================================================================== * PROJECT: ARToolKitPlus * ======================================================================== * * Copyright of the derived and new portions of this work * (C) 2006 Graz University of Technology * * This framework is free softwa...
ALGO
0.999879
4.714678
{ "github_metadata": { "branch": "develop", "commit_count": 9429, "repo_created_at": "2011-10-19T14:20:40.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 241, "forks": 190, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "dc6...
80d6db1a-9c7b-46b5-abff-4948cb4942e3
littlesam95/BaekjoonPractice
구현/Gold 4/Baekjoon15684.cpp
#include <iostream> #include <cstdio> #include <stdlib.h> #include <string.h> #include <string> #include <vector> #include <queue> #include <algorithm> #define MAX 31 #define INF 2e9 using namespace std; int N, M, H; bool visited[11][MAX]; // i번째 세로선과 i+1번째 세로선이 j번째 가로선에서 만남 int answer = INF; inline bool PlayGame() {...
ALGO
0.999907
3.454803
{ "github_metadata": { "branch": "main", "commit_count": 188, "repo_created_at": "2021-05-03T09:23: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": "fb5a97cbb1...
96918fda-342c-4b83-9e8f-5f1bf6eafcb4
santanusen/leetcode
00808_soup_servings.cc
const int da[] = {4, 3, 2, 1}; const int db[] = {0, 1, 2, 3}; class Solution { double dfs(int a, int b, vector<vector<double>>& memo) { if (a <= 0) { if (b <= 0) return 0.5; else return 1.0; } if (b <= 0) return 0; ...
ALGO
0.999775
3.879474
{ "github_metadata": { "branch": "main", "commit_count": 114, "repo_created_at": "2022-10-13T08:18: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": "0d9f56daf7...
4ac106ed-c187-4d29-8dd4-ac07c2873cd6
junsgi/Algorithm
백준/Gold/1074. Z/Z.cc
#include<iostream> #include<vector> #include<algorithm> using namespace std; int n, r, c; int zip(int x, int y, int len, int depth, int ex) { if (len == 1) { if (x == r && y == c) return depth; else if (x == r && y + 1 == c) return depth + 1; else if (x + 1 == r && y == c) return depth +...
ALGO
0.999701
3.299473
{ "github_metadata": { "branch": "main", "commit_count": 723, "repo_created_at": "2023-08-25T08:25:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9437e305e6...
9f640cb0-4685-489c-8c8a-7284d35fd8c6
rhmunna143/competetive-programming
Cpp/code-forces/week-1-practice-day-2/G_Palindrome_Array.cpp
/*** * Context: * * * Constrains: * * * Note: using two pointers technique to solve this problem * * * TODO: * Algorithm | Pseudo-code | Steps -- Write here * * 1. * */ #include <bits/stdc++.h> using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT ...
ALGO
0.999992
4.321007
{ "github_metadata": { "branch": "main", "commit_count": 124, "repo_created_at": "2024-08-28T15:58: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": "65645b498a...
731c9911-e7da-4971-abe2-1e4727720995
AnthonyCxx/Notes-and-Writeups
C++/Data Structures and Algorithms/Leetcode/75. Sort Colors.cpp
/* Given an array of numbers 0, 1, and 2, sort the array in-place without using any library functions. I chose heap sort for this problem because it is the fastest sorting algorithm (O(n log n)) that only uses O(1) memory. Here stability is not relevant. Heap sort implementation adapted from: https://www.gee...
ALGO
0.99998
5.668163
{ "github_metadata": { "branch": "main", "commit_count": 6022, "repo_created_at": "2021-04-10T19:41:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a09a9b725...
8380666a-596b-486e-969a-96e3bcb1ce97
cmu-db/noisepage
src/include/execution/sql/vector_operations/binary_operation_executor.h
#pragma once #include <type_traits> #include <utility> #include "execution/sql/vector.h" #include "execution/sql/vector_operations/traits.h" #include "execution/sql/vector_operations/vector_operations.h" namespace noisepage::execution::sql { /** Static class for operating binary operations. */ class BinaryOperation...
ALGO
0.997319
5.56948
{ "github_metadata": { "branch": "master", "commit_count": 879, "repo_created_at": "2018-07-09T18:22:34.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1752, "forks": 503, "issues": 180, "pull_requests": 10 }, "file_meta": { "content_id": "f...
99c4c481-a941-4307-9e61-b59fe1140821
meltingscales/examples
cpp/ppm-circles/ppm-circles/ppm-circles/ppm-circles.cpp
// ppm-circles.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include "pch.h" #include <iostream> #include <string> #include <fstream> #include <cstddef> #include <filesystem> namespace fs = std::filesystem; class Point { public: double x, y; Point(double x1, double y1) ...
TOOL
0.904918
5.74583
{ "github_metadata": { "branch": "master", "commit_count": 731, "repo_created_at": "2018-06-01T20:25:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 5, "issues": 0, "pull_requests": 46 }, "file_meta": { "content_id": "44c3a3f...
ddde03fd-4043-4548-becd-cc515f5da98e
hxssgaa/PAT
PATA1016/PATA1016/main.cpp
// // main.cpp // PATA1016 // // 属于输入数据很不好弄得题目 // Created by <NAME> on 4/29/14. // Copyright (c) 2014 <NAME>. All rights reserved. // #include <iostream> #include <cstdio> #include <cstring> #include <map> #include <vector> #include <sstream> #define N_MAX 1000 using namespace std; unsigned int rate[24]; type...
ALGO
0.984634
3.859425
{ "github_metadata": { "branch": "master", "commit_count": 72, "repo_created_at": "2014-06-06T10:19: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": "4a73fc815...
4834cf80-1de9-44a3-94ff-fb1f3a69204b
udion/convex_hull.cpp
convex_hull.cpp
#include <bits/stdc++.h> using namespace std; bool hasOnly1ele(vector< pair<float,float> >); bool myComparison(const pair<float,float> , const pair<float,float> ); float distance(pair<float,float>, pair<float,float>); bool is_in_left(pair<float,float>, pair<float,float>, pair<float,float>); vector< pair<int, float> > ...
ALGO
0.999982
4.768939
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-06-02T10:11:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9f7e820d2b...
a83088db-4323-4feb-b1c4-247f5cc27f7a
kirollosatef/problem-solving
SPOJ/BUGLIFE.cpp
#include <bits/stdc++.h> #define vec(type) vector<type> #define sz(x) (int)(x).size() #define all(x) x.begin(), x.end() #define read(file) ifstream cin(file) #define fill(x, i) memset(x, i, sizeof(x)) #define lp(i, srt, end, dir) \ for (int i = srt; (dir ? (i < end) : (i > end)); (dir ? i++ : i--)) #define lpe(i, srt...
ALGO
0.999888
4.337439
{ "github_metadata": { "branch": "master", "commit_count": 121, "repo_created_at": "2022-05-07T15:28: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": "77984eff...
44d74c16-67e5-462b-8461-1e0edeec7090
AdamSandstedt/AdventOfCode
2020/18.cpp
#include <iostream> #include <vector> #include <string> #include <queue> #include <cmath> #include <stack> #include <set> #include <unordered_set> #include <sstream> #include <map> #include <unordered_map> #include <iomanip> #include <cstring> #include "split.h" using namespace std; int main() { long ans1 = 0; ...
ALGO
0.999799
3.802661
{ "github_metadata": { "branch": "main", "commit_count": 48, "repo_created_at": "2020-12-24T20:21: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": "e5fc13b747e...
ce697a0b-d30c-4b53-9ced-22e481c8e98d
BenjaminISART/BaseEngine
BaseEngineMT/src/Engine/Maths/Mat4_utils.cpp
#include "Engine/Maths/Mat4_utils.hpp" #include "Engine/Maths/Mat4.hpp" #include "Engine/Maths/Math.hpp" #include "Engine/Maths/Vec3.hpp" namespace ptm::Mat4_utils { #pragma region Transform [[nodiscard]] Mat4 CreateRotationMatrix(Vec3 const& v, float angle) { Mat4 ret {Mat4::identity}; const float c = ...
TOOL
0.944644
7.237331
{ "github_metadata": { "branch": "dev", "commit_count": 27, "repo_created_at": "2019-06-14T19:36: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": "455ee7fce42c...
ba20224f-bdc3-44e0-931b-170443d1df2a
mosqd/leetcode
887-Super_Egg_Drop/main.cpp
/** You are given K eggs, and you have access to a building with N floors from 1 to N. Each egg is identical in function, and if an egg breaks, you cannot drop it again. You know that there exists a floor F with 0 <= F <= N such that any egg dropped at a floor higher than F will break, and any egg dropped at or belo...
ALGO
0.999909
5.511627
{ "github_metadata": { "branch": "master", "commit_count": 71, "repo_created_at": "2019-12-02T09:10: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": "f4eda8788...
a4ed64e9-73dc-4fce-a297-07785b7f4cbe
Algorithm-bbackgongdan/Almut-3rd
code/SungHo-Ck/week4/boj_14938.cpp
#include <iostream> #include <string> #include <algorithm> using namespace std; int ans, n, m, r; int item[101]; int graph[101][101]; int main(void) { cin >> n >> m >> r; for (int i = 1; i <= n; i++) { cin >> item[i]; } for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { ...
ALGO
0.999795
4.425241
{ "github_metadata": { "branch": "main", "commit_count": 172, "repo_created_at": "2023-10-04T11:04:21.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bd854860a03...
99f49010-3652-4750-83de-120b11f558c1
manya271001/cpp-daily-code
06august/flow.cpp
/*WAP to accept two number from user and check if they are both even and equal if they are accept third number and and check if it is positive or -ve and if -ve make the number +ve and if they are not equla and even print calculation not possible*/ #include<iostream> using namespace std; int main(){ cout << "enter ...
ALGO
0.998604
3.448101
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2024-10-03T07:36: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": "d42646582...
6fda0253-1bd8-4b74-8166-3efab7560067
leejaeseung/Algorithm
BOJ/C++/17400_깃발춤.cpp
/* 문제 매일 코딩만 하던 상헌이는 두뇌가 너무 코드에만 범벅이 되고 있는 것 같아 두뇌를 다른 방면으로 몰입시킬 수 있는 깃발춤 공연을 보러 가기로 했다. 깃발춤 공연은 N명의 공연자들이 일렬로 서서 깃발을 박력 있게 흔들며 진행된다. 깃발을 들고 있는 공연자들은 각각 카리스마의 정도 ci를 지니고 있어, 몇몇 공연자들은 보다 절도 있게 깃발을 흔든다. 상헌이는 깃발춤을 보다가, 문득 깃발춤 공연 중 몇몇 연속된 공연자들이 깃발을 교대로 흔드는 것을 목격했다. 상헌이는 이를 '교대 깃발춤'이라 명명하였다. 교대 깃발춤은 L번째 공연자부터 R번째 공연자까지 깃발을...
ALGO
0.999815
5.114752
{ "github_metadata": { "branch": "master", "commit_count": 210, "repo_created_at": "2020-03-15T09:35:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7c54c600...
4d344f19-1444-4b1a-87b3-34e6d46ed3c9
ji-one/algorithm-study
baekjoon_study_won/dynamic/11066.cpp
#include <iostream> #include <algorithm> using namespace std; // solution // d[a][b] : a부터 b까지 페이지를 합친 최솟값 // sum[a] : 0부터 a까지 페이지를 더한 값 // d[a][a] = cost[a] // d[a][a] = sum[a] - sum[a-1] // d[a][a+1] = sum[a+1] - sum[a-1] // d[a][a+2] = min(d[a][a] + d[a+1][a+2], d[a][a+1] + d[a+2][a+2]) int dp[501][501]; int cost[50...
ALGO
0.99992
4.65741
{ "github_metadata": { "branch": "main", "commit_count": 100, "repo_created_at": "2021-01-03T10:00: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": "d269d172c4...
75750a16-acfd-421f-81e3-c9bb41a69a4e
K3-10e/WordLadder
wordLadderImp.cpp
/*Description: Program finds a word ladder between two words using linked lists, stacks, and queues */ /*Algorithm: 1. Make the construtor and destructor 2. read in the words.dat file with readDictionary using a try/catch block and storing the words in the linked list, adding to the count 3. make findLadde...
ALGO
0.998589
4.550844
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-07-18T02:10:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "90eb9f4881f3...
eaff58b7-e848-4525-8709-c13e7072add0
vmmc2/Competitive-Programming
UVA 01197 - The Suspects.cpp
#include <bits/stdc++.h> using namespace std; int dsu[30100]; int size[30100]; void preprocess(){ for(int i = 0; i < 30100; i++){ dsu[i] = i; size[i] = 1; } } int root(int i){ while(dsu[i] != i){ dsu[i] = dsu[dsu[i]]; //Aqui eu to aplicando o Path Compressing para a travessia fic...
ALGO
0.999739
3.764282
{ "github_metadata": { "branch": "master", "commit_count": 1704, "repo_created_at": "2018-10-09T00:24:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "96f2632...
b42e5913-508a-440f-afd6-44a390a9847d
AlexanderKalistratov/dpnp
dpnp/backend/examples/example_bs.cpp
//***************************************************************************** // Copyright (c) 2016-2023, Intel Corporation // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // - Redistributio...
ALGO
0.961846
5.90431
{ "github_metadata": { "branch": "master", "commit_count": 1600, "repo_created_at": "2023-07-14T22:22:27.000Z", "is_fork": true, "is_org_owned": false, "forked_from": "IntelPython/dpnp", "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_...
a616b516-5e66-4766-97e2-5901034d881e
senanim0620/BOJ
C++/2667.cpp
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <queue> using namespace std; int num; int house_number = 0; int housenum[630] = { 0 }; bool arr[25][25] = { 0 }; // 원본 저장 bool buf[25][25] = { 0 }; // 탐색하면서 방문했던 적 있으면 1로 변환 // 우 하 좌 상 int dx[4] = { 1,0,-1,0 }; int dy[4] = { 0,1...
ALGO
0.999898
3.409416
{ "github_metadata": { "branch": "main", "commit_count": 88, "repo_created_at": "2022-06-23T00:50:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0a5978ce3ff...
3212a281-4293-466e-9aba-30ee4358e119
rini-810/dsasolution
1396-design-underground-system/1396-design-underground-system.cpp
class UndergroundSystem { public: unordered_map<string,pair<long long,int>> station; unordered_map<int,pair<string,int>> transit; UndergroundSystem() { station.clear(); transit.clear(); } void checkIn(int id, string stationName, int t) { //if(transit.find(id)!=transit.en...
ALGO
0.992815
5.936754
{ "github_metadata": { "branch": "main", "commit_count": 908, "repo_created_at": "2022-07-09T10:20:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9cb6ae8f34...
4a2c460e-c49e-40b6-94ca-6bb6dfe3b59a
gunzigun/AlgorithmPracticeByCPlus
棋盘覆盖问题/棋盘覆盖问题/棋盘覆盖问题.cpp
// 棋盘覆盖问题.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> #include <stdio.h> #include <cmath> using namespace std; // 先初始化一个很大的二维数组,把所有值都初始化为0 #define NMAX_ARRAY_NUM 101 int def[NMAX_ARRAY_NUM][NMAX_ARRAY_NUM] = {0}; // 定义骨牌的数值,每次增加一号数值 static int nGuPai = 0; // 棋盘算法的程序 // nBeginX、nBeginY为子棋盘左上角坐标, n...
ALGO
0.992039
3.673937
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-11-07T01:14:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 17, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e10e5cf7b...
7b19e128-7a54-4758-a348-c7386fa3b789
ananyapromi3/CSE-208-Data-Structures-and-Algorithms-II-Sessional
All pair shortest path/online/2005079/Graph1.h
#include <iostream> using namespace std; class Graph1 { int vertex_count, edge_count; public: int adj[100][100]; int apsp[100][100]; Graph1(int n, int m) { vertex_count = n; edge_count = m; for (int i = 0; i < vertex_count; i++) { for (int j = 0; j < ver...
ALGO
0.999637
3.43438
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2023-11-20T14:22: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": "294cba1936...
8c1908d0-0d5d-40c9-9b21-e6bde686d3d4
heppokoyaro/heppocode
ABC/161/maind.cpp
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int,int>; const int INF = 1000000001; ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;} ll lcm(ll a, ll b) { return a/gcd(a,b)*b;} int main() { int k; cin >> k; queue<ll> q; rep(i, 9){...
ALGO
0.999954
3.91607
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2020-03-28T10:14:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "920386821...
7e493d49-42e2-405d-974c-5eacb38cc90e
Shauryacious/competative-programming
CF-Learning/Dynamic-Programming/Learning/Buy-Sell-Stock/Q2-Infinte-Many-Transactions-Allowed/code.cpp
// Author : <NAME> // Linkedin: https://www.linkedin.com/in/shauryacious/ // Codeforces: https://codeforces.com/profile/Shauryacious // Love you mumma <3 #include<iostream> #include<algorithm> #include<vector> #include<set> #include<map> #include<cmath> #include<queue> #include<stack> #include<bitset> #include<unorder...
ALGO
0.999886
5.079134
{ "github_metadata": { "branch": "main", "commit_count": 112, "repo_created_at": "2024-07-18T09:08:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "43907348de...
0bf019c3-39e7-4f3c-b6da-37b04f02b624
jl3937/leetcode
Merge Two Sorted Lists.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) { // Start typing your C/C++ solution below // DO NOT write int main() fu...
ALGO
0.99999
6.012754
{ "github_metadata": { "branch": "master", "commit_count": 56, "repo_created_at": "2013-07-21T22:52:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5a035cb09...
72f563ac-e325-47aa-89f4-bd7d34d1478d
PetraOleum/Ant
slater.cpp
/* * ===================================================================================== * * Filename: slater.cpp * * Description: Code file for slater class * * Version: 1.0 * Created: 26/03/16 13:34:51 * Revision: none * Compiler: gcc * * Author: Petra (...
ALGO
0.99823
3.82206
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2016-04-20T05:41:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "6b6e2b7c09...
f47d80a8-ac06-417e-b694-8692bf2018cc
weizds/LeetCode
medium/1161_Maximum_Level_Sum_of_a_Binary_Tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999969
5.704219
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2023-02-12T20: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": "73c523c8271...
52abc955-92cf-4526-85bd-fe7813583e65
poveryang/MagsacLib
magsac/include/estimators.h
#pragma once #include "estimators/essential_estimator.h" #include "estimators/fundamental_estimator.h" #include "estimators/homography_estimator.h" #include "model.h" namespace estimator {// This is the estimator class for estimating a fundamental matrix between two images. template<class MinimalSolverEngine, //...
ALGO
0.99957
7.068498
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2021-10-28T10:24:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "83f44c1e8...
4e29125e-6c45-42f6-a203-690b34f346e5
KirchmaierDavi/Ex_Cpp
provas antigas/prova 1/TVC1_Projeto/MatrizDistancias.cpp
#include <iostream> #include <cstdlib> #include <cmath> #include "MatrizDistancias.h" using namespace std; // ---------------------------------------------------------------------------- //Q4 MatrizDistancias::MatrizDistancias(int ordem) { vet = new int[(ordem - sqrt(ordem))/2]; n = sqrt(ordem); } MatrizDist...
ALGO
0.997706
3.686503
{ "github_metadata": { "branch": "main", "commit_count": 59, "repo_created_at": "2022-05-20T14:41: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": "e587d592061...
16ad47d1-72e5-4bbe-bb34-564d83a9a257
JongHoooon/Algorithm-Study
BaekJoon/solve/2/4659/4659.cpp
#include <iostream> using namespace std; string input; bool isVowel(char c) { return (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'); } void isAvailable(string& s) { const int n = s.size(); bool c1 = false; bool c2 = true; bool c3 = true; int count_v = 0; int count_c = 0; char prev_c = '...
ALGO
0.99396
4.288573
{ "github_metadata": { "branch": "main", "commit_count": 313, "repo_created_at": "2022-11-30T16:08:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e33a69c1b5...
e8f56786-fbd3-466a-bf4a-4e9a3338d326
PlanarG/Code
Codeforces/101239H.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1010; double x[N]; int main() { int w, h, n; cin >> w >> h >> n; double k = (double)(w * w - h * h) / (2 * w * w); x[1] = 1; for (int i = 2; i <= n + 1; i++) x[i] = x[i - 1] / k - x[i - 2]; double t = 1 / x[n + 1], res = 0; x[n ...
ALGO
0.999948
3.269845
{ "github_metadata": { "branch": "master", "commit_count": 56, "repo_created_at": "2020-04-07T07:52:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "6a43cb08f...
339f0d61-7e7e-4c63-aa22-40e963694f94
ttyang/sandbox
sandbox/SOC/2008/spacial_indexing/geometry/area.hpp
// Geometry Library // // Copyright <NAME>, <NAME>.V. Amsterdam, the Netherlands. // Use, modification and distribution is subject to 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) #ifndef _GEOMETRY_AREA_HPP #define _GEOMETRY_AREA_...
TOOL
0.985258
7.570592
{ "github_metadata": { "branch": "trunk", "commit_count": 20907, "repo_created_at": "2013-10-11T03:08:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "96250b5...
d221c2a3-0be5-4479-acaa-326375519797
alexandraback/datacollection
solutions_2751486_0/C++/xth1/a2.cpp
#include <stdio.h> #include <iostream> #include <string> #include <map> #include <math.h> #define ll long long int using namespace std; int main () { int T; int i, j, k; cin>>T; map<char,bool> vog; vog['a'] = true; vog['e'] = true; vog['i'] = true; vog['o'] = true; vog['u'] = true; for (k = ...
ALGO
0.999731
3.91361
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "642aa7ff7...
3977b81a-49a9-48f6-9c69-27470f66e374
artificial-intelligence-department/ai_programming_playground_2024
ai_13/alina_khodatska/epic_4/code/vns_lab_5_task_1_alina_khodatska.cpp
#include <iostream> #include <vector> using namespace std; // Функція для пошуку максимального елемента в рядку двовимірного масиву int findMaxInRow(const vector<int>& row) { int maxElem = row[0]; for (int i = 1; i < row.size(); i++) { if (row[i] > maxElem) { maxElem = row[i]; } ...
ALGO
0.999952
6.467494
{ "github_metadata": { "branch": "main", "commit_count": 2638, "repo_created_at": "2024-09-22T19:14:24.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 7, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "df695ccba7...
3913a2b6-41de-43da-a718-5cf76aa72a3e
Praashh/DSA
stack_imp_using_array.cpp
#include <iostream> using namespace std; class MyStack { public: int arr[10]; int top = -1; void push(int x) { if (top < 10) { top++; arr[top] = x; } else { cout << "Stack is Full" << endl; } } void peek() { ...
ALGO
0.928945
4.059015
{ "github_metadata": { "branch": "main", "commit_count": 56, "repo_created_at": "2022-09-12T14:37:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f970556b93e...
07fc1010-27d4-4274-8d39-63d185f86ec2
gessfred/Parallel-RePlAce
code/RePlAce/src/argument.cpp
/////////////////////////////////////////////////////////////////////////////// // Authors: <NAME> and <NAME> // (respective Ph.D. advisors: <NAME>, <NAME>), // based on Dr. Jingwei Lu with ePlace and ePlace-MS // // Many subsequent improvements were made by Mingyu Woo // leading up ...
TOOL
0.909
3.585412
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2020-01-20T09:33:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "207d50116...
f37a4865-f30e-47a6-b663-7a20d826d6b5
maheksingh01/gfg_POTD
numberOfDistinctSubsequence.cpp
#include <iostream> #include <string> #include <map> #include <vector> using namespace std; class Solution { public: // Time Complexity: O(n) // Space Complexity: O(n) int distinctSubsequences(string s) { const int MOD = 1000000007; int n = s.length(); vector<long long> dp(n + 1...
ALGO
0.999991
6.180988
{ "github_metadata": { "branch": "main", "commit_count": 67, "repo_created_at": "2023-09-20T14:41: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": "c8155a13fe2...
413bbc07-fe3a-4ea6-9b8f-7926ad86dfaa
mano7onam/algs
SuffixArray.cpp
#pragma GCC optimize ("O3") #pragma GCC target ("sse4") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define mp make_pair void print_vector(string name, vector<int> v) { cout << name << ": "; for (int i = 0; i < v.size(); ++i) { cout << v[i] << ' '; ...
ALGO
0.999599
4.534461
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-11-02T07:57:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7625920acd...
d3304e22-49ed-4a3c-b901-c9ee46d97b95
makoevvv/LeetCode
problem_16__3sum_closest__.cpp
class Solution { public: int threeSumClosest(vector<int>& nums, int target) { int n = nums.size(); sort(nums.begin(), nums.end()); int ans = INT_MAX - abs(target); for (int i = 0; i < n; i++) { int l = i + 1; int r = n - 1; while (l < r) { ...
ALGO
0.999964
5.332595
{ "github_metadata": { "branch": "main", "commit_count": 57, "repo_created_at": "2024-07-26T21:16: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": "2be47f5cc06...
1c3aaaa0-7e5a-4d5e-a4e1-4b554d7e0337
Ayush7614/Daily-Coding-DS-ALGO-Practice
Gfg/C++/TripletswithZeroSum.cpp
/*Problem : Find all triplets with zero sum*/ /*Explanation of problem : Given an array of distinct elements. The task is to find triplets in the array whose sum is zero.*/ /*Approach : a> Sort the array in ascending order and traverse the array from start to end. b> For every index i, create two variables l ...
ALGO
0.999964
6.185525
{ "github_metadata": { "branch": "main", "commit_count": 2968, "repo_created_at": "2020-12-28T05:34:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 322, "forks": 474, "issues": 335, "pull_requests": 20 }, "file_meta": { "content_id": "7e...
57cfc33d-5361-4113-876a-230a5da63aa7
franciscoMerono/TFG
CódigoArduino/ControlMotor.ino
#include <Servo.h> //Control velocidad const int pinMotor = 6; const int pinHall = 3; const float radioRueda = 23; //Marcas de tiempo para saber lo que tarda la rueda en dar una vuelta volatile float tiempo0; volatile float tiempo1; volatile float tiempo2; volatile float tiempo3; volatile float tiempo4; float VE...
TOOL
0.943043
5.082746
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-06-24T21:30:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 20 }, "file_meta": { "content_id": "2c452c68e...
9493ba76-9f0d-40a0-8308-9dde1f10bb3c
NREL/EnergyPlus
third_party/ssc/tcs/sam_csp_util.cpp
/** BSD-3-Clause Copyright 2019 Alliance for Sustainable Energy, LLC Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met : 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the...
ALGO
0.998768
4.17437
{ "github_metadata": { "branch": "develop", "commit_count": 40658, "repo_created_at": "2013-11-22T14:47:34.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1278, "forks": 441, "issues": 908, "pull_requests": 48 }, "file_meta": { "content_id":...
f36c7e4e-8249-4caa-8ba7-f11d943b4e7a
steezera/cpp
1018/1018.cpp
#include <iostream> #include <vector> #include <algorithm> #include <limits.h> // INT_MAX를 사용하기 위한 헤더 using namespace std; string board[50]; string white[8] = { "WBWBWBWB", "BWBWBWBW", "WBWBWBWB", "BWBWBWBW", "WBWBWBWB", "BWBWBWBW", "WBWBWBWB", "BWBWBWBW", }; string black[8] = { "B...
ALGO
0.999946
4.86942
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2023-12-26T07: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": "ef891d65ea53...
dc793a4d-0936-4199-a892-30329e47a923
dreyus95/AVSP_SourceQualityPrediction
CodeJamCrawler/dataset/08_23273_55.cpp
#include <iostream> #include <vector> #include <map> #include <set> #include <queue> #include <stack> #include <cmath> #include <algorithm> #include <string> #include <fstream> using namespace std; int main() { int tests; cin >> tests; for (int k=1; k<=tests; k++) { int turn; int na, nb; int inH, inM, sta...
ALGO
0.999469
3.368634
{ "github_metadata": { "branch": "master", "commit_count": 70, "repo_created_at": "2017-06-08T21:00: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": "9ad55acbc...
a67a7514-4d54-491e-9211-f6dc7f890ff0
akumarg1216/DSA_Sheet
Binary Trees/2_reverseLevelOrderTraversal.cpp
/* * * Question: https://practice.geeksforgeeks.org/problems/reverse-level-order-traversal/1 * * Queue has special property where you can push from one end and pop from another end. Like in level order traversal we * mark nodes visited and pop them, From other end we push the elements to be mark visited, This is what ...
ALGO
0.99998
5.341683
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2022-09-01T06:50: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": "bf11810689...
dea9b633-523b-44e7-93c0-1871fa46ff15
Yarharm/Concurrent-Computing
Parallelization/Quicksort_Hypercube/parallel_quicksort.cpp
#include "mpi.h" #include <stdio.h> #include <stdlib.h> #include <sys/time.h> #include <math.h> #include <sstream> #include <string.h> #include <algorithm> #include <bitset> #include <cstddef> #include <valarray> #include <iterator> #include <vector> using namespace std; void srand(unsigned seed); void generateInput(v...
ALGO
0.999971
4.776597
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2020-09-19T00:37: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": "dc1d44c99...
1e6aa8d2-54d0-4aae-907c-5c5e208486ab
wassimalharaki/Codeforces
1900/BashandaToughMathPuzzle.cpp
#include <bits/stdc++.h> using namespace std; // #define int long long #define nl '\n' #define v vector int op(int a, int b) { while (b) { a %= b; swap(a, b); } return a; } int e() { return 0; } // O(n), O(log(n)) template <class S, S (*op)(S, S), S (*e)()> struct segtree { int n,...
ALGO
0.999945
5.519369
{ "github_metadata": { "branch": "main", "commit_count": 160, "repo_created_at": "2023-09-19T17:56: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": "ad8adb951e...
823639d2-d2d3-4e19-b06b-082b080ecb95
GlassyYang/leetcode-cplusplus
solution1224.cpp
// // Created by zhang on 2021/6/7. // #include "common-header.h" class Solution { public: int maxEqualFreq(vector<int>& nums) { unordered_map<int,int> num_freq; unordered_map<int,int> freq_freq; int res = 1; int species = 0; //数字种类 int max_freq = 0...
ALGO
0.999961
5.021006
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2021-05-10T16:00: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": "7c7e2fea7f0...
c10f438e-0b79-4953-8511-2a9c5af83293
Camithilwen/Code-Cloning-Analysis
src/llm-scripts/testing/Project_CodeNet_experimentation_dataset/data/p03334/s198663643.cpp
#include <iostream> #include <stdio.h> #include <fstream> #include <algorithm> #include <string> #include <map> #include <set> #include <queue> #include <stack> #include <vector> #include <limits.h> #include <math.h> #include <functional> #include <bitset> #include <iomanip> #define repeat(i,n) for (long long i = 0; (...
ALGO
0.999504
3.016427
{ "github_metadata": { "branch": "main", "commit_count": 243, "repo_created_at": "2025-06-06T16:57:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "ee4198208f...
4008a9bb-6176-42d5-8806-d259a31cb77a
tpiasek/algorithms_graphs
include/graphs/adjacency_list_graph.hpp
#ifndef ADJACENCY_LIST_GRAPH_HPP_ #define ADJACENCY_LIST_GRAPH_HPP_ #include <memory> #include <list> #include "graphs/graph.hpp" #include "graphs/node.hpp" class AdjacencyListGraph : public Graph { private: std::vector<Vertex*> vertices; std::vector<std::list<Edge*>> adjacencyList; public: AdjacencyListG...
ALGO
0.929218
6.300664
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-10-28T11:53:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "54d3057de117...
e7825a5a-bddb-4eb8-ba34-f41ae250d4dd
iamdin/leetcode
dynamic-programming-medium/221.最大正方形.cpp
/* * @lc app=leetcode.cn id=221 lang=cpp * * [221] 最大正方形 */ #include <bits/stdc++.h> using namespace std; // @lc code=start class Solution { public: int maximalSquare(vector<vector<char>>& matrix) { int row = matrix.size(), col = matrix.size() > 0 ? matrix[0].size() : 0; vector<vector<int>> dp(row + 1, ...
ALGO
0.999776
5.805113
{ "github_metadata": { "branch": "master", "commit_count": 434, "repo_created_at": "2020-04-13T11:23:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 5, "pull_requests": 0 }, "file_meta": { "content_id": "a5438841...
f77f99b4-7ae9-4efb-bdde-b2c88e8f2205
jiwon1304/Week04
Week04/Engine/Source/Runtime/Engine/Classes/Engine/Quadric.h
#pragma once #include <cmath> #include <DirectXMath.h> using namespace DirectX; class FQuadric { public: // 4x4 대칭행렬 저장 (행렬 전체 저장) float m[4][4]; // 기본 생성자: 0으로 초기화 FQuadric() { for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { m[...
ALGO
0.998569
4.911458
{ "github_metadata": { "branch": "main", "commit_count": 107, "repo_created_at": "2025-03-27T07:56:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fa0d063bed...
cf252331-7388-47eb-ab42-a9506767bb91
TheTryton/AdventOfCode
2017/AOC18.cpp
#include <iostream> #include <vector> #include <map> #include <sstream> using namespace std; enum class op { set, add, mul, mod, rcv, jgz, snd, none }; struct operation { long long* registera = nullptr; long long* registerb = nullptr; op oper = op::none; int evaluate(...
ALGO
0.998916
4.508618
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2017-12-08T17:49:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "76bf9308e...
33ef876d-a74b-46d1-b553-ac286a4d4225
kassonlab/gmxapi
src/gromacs/topology/atomprop.cpp
/* * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. * Copyright (c) 2013,2014,2015,2017,2018 by the GROMACS development team. * Copyright (c) 2019,2020, by the GROMACS de...
TOOL
0.934387
6.239985
{ "github_metadata": { "branch": "master", "commit_count": 19315, "repo_created_at": "2017-05-25T14:05:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 53, "forks": 13, "issues": 93, "pull_requests": 2 }, "file_meta": { "content_id": "2f0e...
e9027605-db54-4f27-9f6b-3434eb174d82
ishandutta2007/codeforces-b
bigbag/normal/737/D.cpp
#include <map> #include <set> #include <stack> #include <cmath> #include <queue> #include <vector> #include <cstdio> #include <string> #include <cstring> #include <cstdlib> #include <iostream> #include <algorithm> using namespace std; const int max_n = 4044, max_x = 68, inf = 1111111111; int n, a[max_n], sum[max_n];...
ALGO
0.998794
3.552486
{ "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": "d07e24084e4b...
5543c458-1d80-4676-9e7d-7b31453c00f0
7bellaa/BaekJoon
백준/Silver/7562. 나이트의 이동/나이트의 이동.cc
#include <bits/stdc++.h> #define X first #define Y second using namespace std; int dist[301][301]; int dx[8] = {-1,1,-1,1,-2,-2,2,2}; int dy[8] = {-2,-2,2,2,-1,1,-1,1}; int main() { ios::sync_with_stdio(0); cin.tie(0); int T; cin >> T; while (T--) { int n, x1, y1, x2, y2; cin >> n >> x1 >>...
ALGO
0.999961
4.812021
{ "github_metadata": { "branch": "main", "commit_count": 315, "repo_created_at": "2022-11-08T04:32:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6f3807ec12...
9f103b66-f890-454d-9a9f-8bc41ea53d86
invincible04/Competitive-Programming
A_Boboniu_Likes_to_Color_Balls.cpp
#include <bits/stdc++.h> #define int long long #define f(i,a,b) for(int i=a;i<b;i++) #define pb push_back #define all(a) a.begin(),a.end() #define arraysort(a) sort(a,a+n) #define endl "\n" #define inputarray(a,n) f(i,0,n){cin >> a[i];} #define printarray(a,n) f(i,...
ALGO
0.999066
3.78129
{ "github_metadata": { "branch": "master", "commit_count": 56, "repo_created_at": "2023-01-28T22:56:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6bd10809c...
5508e698-0f38-495a-b317-876e25d6c23b
l2371792777/leetcode
old/finish/[Medium]leet_869_2021-10-28/main.cpp
//...difficulty:Medium //...leetcode_869_2021-10-28 //...https://leetcode-cn.com/problems/ #include <iostream> #include <vector> #include <algorithm> #include <limits.h> #include <string> #include <set> #include <cmath> using namespace std; class MinStack { set<int> hogo; vector<int> res; public: void te...
ALGO
0.99984
5.362034
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2021-11-01T02:47: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": "15bd84bdb...
50e78b0d-4b66-4f2a-8d5c-2f601b87acee
XjShi/leetcode
BalancedBinaryTree/balancedBinaryTree.cpp
/* Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1. */ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *...
ALGO
0.999892
6.081152
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2016-11-03T09:06:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "750e6c125...
c92268b0-5d72-49e8-82d8-a05dcdf5bfbc
jvillegasd/Codeforces
Codeforces 455A.cpp
#include <stdio.h> #include <algorithm> #include <string.h> using namespace std; int main(){ int n, number; long long int freq[1000000], DP[1000000]; memset(freq, 0, sizeof(freq)); memset(DP, 0, sizeof(DP)); scanf("%d", &n); while(n--){ scanf("%d", &number); freq[number]+=1; ...
ALGO
0.999941
3.885423
{ "github_metadata": { "branch": "master", "commit_count": 193, "repo_created_at": "2017-12-05T01:50:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8319ecaa...
81bf135b-aef3-4128-a783-96287127a8b7
ricardo-ervilha/inteligencia-computacional
include/util.h
#ifndef UTIL_H #define UTIL_H #include <vector> #include <cstring> #include <random> #include <set> #include <omp.h> using namespace std; vector<string> separa_linha(string line, char separator = ' ') { vector<string> v; string s; stringstream ss(line); while (getline(ss, s, separator)) { ...
TOOL
0.955231
5.380769
{ "github_metadata": { "branch": "main", "commit_count": 72, "repo_created_at": "2023-09-30T15: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": "c47435b7f78...
5bd68cd6-2760-4eed-9de2-fdb14377fa0e
AllenAndrew01123/Competitve-Programming
AtCoder/756.cpp
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 typedef long long ll; vector<ll> spf(101); void precal() { for (int i = 1; i <= 100; i++) spf[i] = i; for (int i = 2; i <= 100; i++) { if (spf[i] == i) { for (int j = 2 * i; j <= 100; j += i) ...
ALGO
0.999938
4.190625
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2024-06-26T17:58: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": "d4874d0ec...
19eceb33-8d02-45c7-b4df-3c7cf451973a
yaakovlew/labs_2sem
lab2/LinkedList.h
#pragma once #include <iostream> #include "IndexOutOfRange.h" using namespace std; template <class T> class LinkedList{ public: typedef struct List{ T data_element; struct List* point_to_next_element; }List; void Prepend(T item){ List *element1 = new List; element1->da...
TOOL
0.962067
3.980379
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-06-09T11:14: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": "951e285d476f...
57990004-3093-425f-a2e9-4d3d99705489
sgrumley/AdvancedAlgorithmAssignment
Q6/DisjointSet.cpp
#include <bits/stdc++.h> #include "DisjointSet.h" // DSet::DSet(int n) { // rank = new int[n]; // parent = new int[n]; // this->n = n; // makeSet(); // } // void DSet::makeSet() { // for (int i = 0; i <= n; ++i) { // parent[i] = i; // rank[i] = 1; // } // } // int DSet:...
ALGO
0.99953
4.208928
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2020-03-17T09:50: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": "a8bf07988...
01a087ee-dcdf-4c0c-af3a-dcebb629cfec
akhil14shukla/CP-Files
CF3.cpp
#include <iostream> #include <vector> #include <bits/stdc++.h> #include <math.h> #include <stack> using namespace std; int main() { int n, test,temp; cin >> n; vector<pair<int, int>> v1; vector<pair<int, int>> v2; int i, j; for (i = 0; i < n; i++) { cin >> temp; v1.push_back...
ALGO
0.99999
3.638643
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2020-07-15T20:13:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c0c27d4ee3...
a37ae751-3086-4f58-9f21-09eefb6316d2
Yawn-Sean/Daily_CF_Problems
daily_problems/2024/11/1111/personal_submission/cf846d_yawn_sean.cpp
#include <bits/stdc++.h> #pragma GCC optimize("O3,Ofast,unroll-loops") // #include "atcoder/convolution" // #include "atcoder/dsu" // #include "atcoder/fenwicktree" // #include "atcoder/lazysegtree" // #include "atcoder/math" // #include "atcoder/maxflow" // #include "atcoder/mincostflow" // #include "atcoder/modint" /...
ALGO
0.999883
5.123965
{ "github_metadata": { "branch": "main", "commit_count": 20410, "repo_created_at": "2024-02-26T01:04:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 478, "forks": 302, "issues": 0, "pull_requests": 7 }, "file_meta": { "content_id": "9412...
20e65feb-825d-4cad-9a09-754e5532a14f
kwong22/accelerated-cpp
ch3/quartiles.cpp
#include <iostream> #include <vector> int main() { // ask for integers std::cout << "Please enter a sequence of integers: "; std::vector<int> nums; // read integers into nums int x; // invariant: we have stored all integers read so far into nums while (std::cin >> x) { nums.push_back(x); } // ...
ALGO
0.999862
4.272224
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2017-07-20T23:25:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "459658af2e...
79e64cec-7062-463e-b255-f90c8ef915c9
Waqas82650/CompilerDesign
Natural_Loops.cpp
#include <iostream> #include <fstream> #include <vector> #include <set> #include <sstream> using namespace std; int getJumpTarget(const string &instruction, const vector<string> &tac) { stringstream ss(instruction); string op, arg1, arg2; ss >> op >> arg1; if (op == "goto" || op == "if") { ...
ALGO
0.99878
4.201802
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-05-06T02:38: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": "efa95c4b5cdd...
fe3d8ea6-e160-46ba-b912-b9fd4a914931
numenta/nupic.core-legacy
external/common/include/boost/geometry/algorithms/equals.hpp
// Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2007-2015 <NAME>, Amsterdam, the Netherlands. // Copyright (c) 2008-2015 <NAME>, Paris, France. // Copyright (c) 2009-2015 <NAME>, London, UK. // Copyright (c) 2014-2015 <NAME>, Lodz, Poland. // This file was modified by Oracle on 2014, 2015, 2016...
ALGO
0.989207
6.716186
{ "github_metadata": { "branch": "master", "commit_count": 3514, "repo_created_at": "2014-01-30T02:13:40.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 273, "forks": 278, "issues": 103, "pull_requests": 6 }, "file_meta": { "content_id": "8c...
d09ad601-0118-47a4-a359-b32e72265553
KyleWoodABK/LUU
Week 3/w3d1 pointers refs dynamic memory lesson/w3d1 pointers refs dynamic memory lesson.cpp
#include <iostream> using namespace std; void Swap(int* pNumber1, int* pNumber2); void Swap(int& pNumber1, int& pNumber2); int main() { int variable = 10; int* pointer = &variable; int newVariable = *pointer; // 10 *pointer = 20; // variable == 20 cout << "variable: " << variable << endl; // 20...
ALGO
0.950283
4.557453
{ "github_metadata": { "branch": "main", "commit_count": 46, "repo_created_at": "2022-07-21T18:31:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5f23436c2cb...
b545a0ce-2dd4-4d64-9885-38b1fcb6949c
haozzzzzzzz/osgEarthX
environment/build/3rdParty/geos/include/geos/precision/CommonBits.h
/********************************************************************** * $Id: CommonBits.h 2556 2009-06-06 22:22:28Z strk $ * * GEOS - Geometry Engine Open Source * http://geos.refractions.net * * Copyright (C) 2005-2006 Refractions Research Inc. * * This is free software; you can redistribute and/or modify it...
TOOL
0.995444
6.868074
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2015-09-19T06:19:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 75, "forks": 48, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "077a60d...
54c8df5b-f251-48ad-810a-f316bec7f604
pushkarra/c-coding-questions
Recursion-04 or Lecture-04(Assignment)/Check AB.cpp
// Suppose you have a string, S, made up of only 'a's and 'b's. Write a recursive function that checks if the string was generated using the following rules: // a. The string begins with an 'a' // b. Each 'a' is followed by nothing or an 'a' or "bb" // c. Each "bb" is followed by nothing or an 'a' // If all the rules ...
ALGO
0.998925
3.998058
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2022-02-24T09:16: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": "2c8238bd746...
986b0d0c-08a6-4113-89a6-1c4cd24be450
qianlizhixing12/coding-training
leetcode/919.cpp
#include <cstdlib> #include <vector> #include <queue> #include <algorithm> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; class CBTInserter { private: TreeNode *root = NULL; queue<TreeNode *> last; void bfs(TreeN...
ALGO
0.999949
6.07462
{ "github_metadata": { "branch": "main", "commit_count": 496, "repo_created_at": "2021-02-03T05:53: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": "b1e2c2dce5...
c2e6e338-a492-4565-aa5f-10aebd14aba2
xiaozhuyfk/DeepDriving
torcs-1.3.6/src/drivers/tita/tita.cpp
/*************************************************************************** file : berniw.cpp created : Mon Apr 17 13:51:00 CET 2000 copyright : (C) 2000-2006 by <NAME> email : <EMAIL> version : $Id: tita.cpp,v 1.11.2.2 2013/08/05...
TOOL
0.905275
3.48271
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2016-10-05T20:43:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2b64e61d9e...
f4f54903-bf9a-4226-9bc0-43ab8a5ebf80
EmilianRo/info_algorite_teme
pbinfo_1_suma_3cifre_mari.cpp
#include <iostream> using namespace std; int main() { int a, b, c, d, e, s; int min1, min2; cin >> a >> b >> c >> d >> e; if (a < b) { min1 = a; min2 = b; } else { min1 = b; min2 = a; } if (c < min1) { min2 = min1; min1 = c; ...
ALGO
0.999933
3.881333
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2025-05-30T08:23: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": "19f2d4b08c0a...
3a52d2bc-d418-4e69-94b3-ac450a67e041
muffinnxz/TOI-preparation
TOI16/Camp-3/sudden death/segment tree.cpp
#include<bits/stdc++.h> using namespace std; int arr[100001], tree[200002], n; void build(int idx_node, int start, int endd) { if(start == endd) tree[idx_node] = arr[start]; else { int mid = start + (endd-start)/2; build(2*idx_node, start, mid); build(2*idx_node+1, mid+1, endd); tree[idx_node] = tree[2*idx...
ALGO
0.999945
4.364033
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-08-04T02:01:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6848b7da3965...
e740f975-44d7-47aa-919c-bbab535a7f67
Meghana0109/Cryptography
playfair cipher/decryption.cpp
#include <iostream> #include <string> using namespace std; int main(){ string STR; //getting ciphertext input from the user cout << "Enter the ciphertext string (in uppercase letters):" << endl; getline(cin,STR); string keystr; //getting key input from the user cout << "Enter the keystring:"...
ALGO
0.999979
3.740934
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2021-02-22T16:45: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": "3f59db3845c...
e60f5ef6-928e-49c4-a657-6c5513ebebbd
spencerparkin/Thebe
Engine/Source/Thebe/Math/GJKAlgorithm.cpp
#include "Thebe/Math/GJKAlgorithm.h" #include "Thebe/Math/PolygonMesh.h" #include "Thebe/Math/Polygon.h" #include "Thebe/Math/Function.h" #include "Thebe/Log.h" #include <format> using namespace Thebe; //------------------------------------- GJKShape ------------------------------------- GJKShape::GJKShape() { } /*...
ALGO
0.999627
5.423548
{ "github_metadata": { "branch": "main", "commit_count": 468, "repo_created_at": "2024-11-21T00:16:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "71fe373692...
182ce659-1741-419c-aa61-22012fdd05af
TianpingHsu/drilling
src/pat/src/1063.cpp
#include <set> #include <vector> #include <cstdio> using namespace std; int N, K; vector<set<int>> vs = {set<int>()}; double process_one_case(int x, int y) { set<int> &sx = vs[x], &sy = vs[y]; int size_x = sx.size(), size_y = sy.size(); int sames = 0; for (const auto x : sx) { if (sy.find(x) !=...
ALGO
0.999304
4.30889
{ "github_metadata": { "branch": "master", "commit_count": 79, "repo_created_at": "2022-06-20T07:08: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": "c81f02f6e...
b703d4ce-f6df-4656-932c-b3db649748a6
ciwomuli/NOIP2017exercise
2018-9-17/P3952.cpp
#include <iostream> #include <cstdlib> #include <cstdio> #include <string> #include <stack> using namespace std; bool stat[26]; inline char t(const string& original) { return original[0] - 'a'; } inline bool isInt(const string& str) { return str[0] >= '0' && str[0] <= '9'; } inline int getPV(const string& ...
ALGO
0.999743
4.158074
{ "github_metadata": { "branch": "master", "commit_count": 73, "repo_created_at": "2017-10-24T08:17: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": "f706512ef...
00c1370a-0849-478f-b0fe-bcf52d651e7f
chrisvrose/sem7labs
cg-self/src/07/main.cpp
#include <stdlib.h> #include <algorithm> #include <iostream> #include <GL/glut.h> int m, n; int wx = 500, wy = 500; static float intx[10] = { 0 }; float x[100], y[100]; void drawLine(float x1, float y1, float x2, float y2) { // sleep(1000); glColor3f(0, 0, 1); glBegin(GL_LINES); glVertex2f(x1, y1); glVertex2f(x2...
ALGO
0.999017
4.227469
{ "github_metadata": { "branch": "main", "commit_count": 65, "repo_created_at": "2021-10-04T09:34:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ce3ef809d5a...
dfc5827f-8666-49b2-9fc2-fb23cbfbf837
varunragu23/USACO-CF-Varun
piepie/a.cpp
/* ID: varunra2 LANG: C++ TASK: piepie */ #pragma region Headers, define, typedef #include<bits/stdc++.h> using namespace std; #ifdef DEBUG #include <debug.h> #endif #define EPS 1e-9 #define IN(A, B, C) assert(B <= A && A <= C) #define INF (int)1e9 #define MEM(a, b) memset(a, (b), sizeof(a)) #define MOD 1000000007 #d...
ALGO
0.999986
3.526178
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-11-03T18:59:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "abdbdbdd66...
4d6757e6-54b7-4b5e-9a0c-59145858eefb
JSeokjun/Daily_Algorithm
백준/Gold/2623. 음악프로그램/음악프로그램.cc
#include <iostream> #include <vector> #include <queue> using namespace std; int main() { cin.tie(0)->sync_with_stdio(0); int N, M, cnt=0; cin >> N >> M; vector<int> V[N+1], R; queue<int> Q; int indegree[N+1]{0}; for(int i=0; i<M; i++) { int n; cin >> n; int tmp[n]{0}; ...
ALGO
0.999999
4.527899
{ "github_metadata": { "branch": "main", "commit_count": 450, "repo_created_at": "2023-01-10T14:53: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": "c05f17caa8...
d6fafffb-b0cb-432b-90eb-cc4194ea48f4
fl4shk/FillOurStreets
src/main.cpp
#include "ga_class.hpp" #include <stdlib.h> void tester(const double crossover_rate, const double mutation_rate); int main(int argc, char** argv) { if ((argc < 4) || (argc > 5)) { printerr("Usage 0: ", argv[0], " pop_size crossover_rate ", "mutation_rate\n"); printerr("Usage 1: ", argv[0], " pop_size cross...
ALGO
0.995228
5.628453
{ "github_metadata": { "branch": "master", "commit_count": 45, "repo_created_at": "2017-11-04T13:02: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": "725f66b87...
04b5d2e8-8d4a-41d4-a5a5-dbb3c13f79ab
zm66260/Data_Structure_and_Algorithms
search/backtracking/combination_sum.cpp
// 39 combination sum // Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target. // The same repeated number may be chosen from candidates unlimited number of times. // Note: // All numbers...
ALGO
0.999915
6.284337
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-04-04T08:25: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": "34cc48852c...