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
b27852fe-6f35-4235-b054-c9ae0cbeb06d
manny118/Assembly-Programming
Insertion Sort/Insertion.cpp
//Author: <NAME> //Date: 22/11/2019 //This is a cpp program that interfaces with an assembly program to //sort characters entered by the user #include "stdafx.h" extern "C" { void sort (char input[] , int n ); } int getSize(char b[] ); int _tmain(int argc, _TCHAR* argv[]) { char buffer[256]; //declares an array ...
ALGO
0.99755
3.622869
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-01-20T14:42: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": "13072d978f...
a239c16d-1d76-43c1-9248-ca579573e859
Jeffrin2005/Dynamic_Programming
(RECUR + MEMO)Pascal's Triangle.cpp
#include <vector> using namespace std; class Solution { private: int check(int row, int col, vector<vector<int>>& dp) { if (row == 0 || col == row) return 1; if (dp[row][col] != -1) return dp[row][col]; int left = (col > 0) ? check(row - 1, col - 1, dp) : 0; int right = (...
ALGO
0.999985
5.776203
{ "github_metadata": { "branch": "main", "commit_count": 204, "repo_created_at": "2023-11-24T06:26:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1a7f912ba4...
65c67e41-1f93-444e-b355-0deee9e56213
dev-khalid/Journey-Towards-Something-Big
codeforces/Rating wise solve/800 - 1000/Div 2 B(812).cpp
#include<bits/stdc++.h> using namespace std; bool compare(int &a,int &b) { return a>b; } int main() { int t; cin >> t; while(t--) { int n; cin >> n; vector<int> v(n); vector<int> cpy(n); for(int i = 0 ; i < n; i++) { cin >> v[i]; ...
ALGO
0.999991
4.062697
{ "github_metadata": { "branch": "main", "commit_count": 447, "repo_created_at": "2022-03-02T14:22: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": "0a6e740679...
d5c54f9c-8be4-4c19-b1f0-eac8d20672c3
tbrown122387/pf
examples/svol_sisr.h
#ifndef SVOL_SISR_H #define SVOL_SISR_H #include <pf/rv_eval.h> // for evaluating densities and pmfs #include <pf/rv_samp.h> // for sampling random numbers #include <pf/sisr_filter.h> // inherit the right particle filter using namespace pf; using namespace pf::filters; template <size_t nparts, size_t dimx, s...
ALGO
0.933989
6.500127
{ "github_metadata": { "branch": "master", "commit_count": 216, "repo_created_at": "2018-04-19T15:37:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 60, "forks": 17, "issues": 11, "pull_requests": 0 }, "file_meta": { "content_id": "c58c2...
a8cbdbee-cb02-4f2f-806f-836324ecb572
Hilbertmf/competitive-programming-problems
contests/atcoder/beginner-330/C.cpp
// accepted // https://atcoder.jp/contests/abc330/tasks/abc330_c #include <bits/stdc++.h> using namespace std; #define DEBUG(x) cout << #x << " >>>> " << x << endl #define MID(l, r) (l + (r - l) / 2) #define CEILDIVISION(x, y) ((x + y - 1) / y) #define INF (long long)1e18 #define FASTIO ios_base::sync_with_stdio(0);cin...
ALGO
0.999928
3.72338
{ "github_metadata": { "branch": "main", "commit_count": 217, "repo_created_at": "2021-07-20T20:40:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7d9a01c6a2...
7520d647-9d18-4b67-8e36-405408a94b25
Qiti0/codeforces
World_Finals.cpp
#include <bits/stdc++.h> using namespace std; const int mod = 1e9+7; const double pi = acos(-1.0); const int N = 2e5 + 10; typedef long long ll; typedef pair<int,int> pii; inline int lowbit(int x) {return x & (- x);} struct bs{ string s; int pm; int time; }; bool cmp(bs x,bs y){ if(x.pm == y.pm) retu...
ALGO
0.99962
3.759081
{ "github_metadata": { "branch": "codeforces", "commit_count": 8, "repo_created_at": "2024-07-24T02:13: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": "e1fc5e...
07a08019-f3c0-4570-9b1b-6ab76f3dd1ea
QM117/leetcode
150. Evaluate Reverse Polish Notation/150. Evaluate Reverse Polish Notation2.cpp
class Solution { public: int largestRectangleArea(vector<int>& heights) { if(heights.empty()) return 0; if(heights.size() == 1) return heights[0]; stack <int> stk; int max = 0; int rect = 0; int min = 0; int last = 0; int top = 0; int k = 0; ...
ALGO
0.999992
5.874195
{ "github_metadata": { "branch": "master", "commit_count": 50, "repo_created_at": "2018-03-12T09:02: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": "a75f271f1...
495e8688-cd2b-4510-a475-584694fbde1c
yuvcodes/cpp-dsa-handbook
07_Sets/1_orderedSet.cpp
#include <iostream> #include <set> using namespace std; /* 1. insert(x): Adds element x to the set. If x is already present, it will be ignored (no duplicates in a set). 2. erase(x): Removes element x from the set if it exists. 3. find(x): Searches for element x. If found, returns an iterator to the element; otherwi...
TOOL
0.985533
6.273411
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2025-04-20T17:02: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": "16ae59c5f04d...
f2ad127f-336f-4d8e-9dfe-fd042155bd9d
sayan112/RoadToFullTimeServiceBased
CodingProblems/Accenture_Coding_Question_1.cpp
// Accenture Coding Question 1 // The function def differenceofSum(n. m) accepts two integers n, m as arguments Find the sum of all numbers in range from 1 to m(both inclusive) that are not divisible by n. Return difference between sum of integers not divisible by n with sum of numbers divisible by n. // Assumption: /...
ALGO
0.999983
4.614685
{ "github_metadata": { "branch": "main", "commit_count": 44, "repo_created_at": "2023-07-19T13:22:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e2f54c3a7a2...
ad041f0f-3d93-4fe8-8156-99d0500f31a3
vi-mcw196/max3set-genetic-algorithm-cpp
Max3SetProblem/Source Files/CGAIndividual.cpp
#include "../Header Files/CGAIndividual.h" CGAIndividual::CGAIndividual(int genLength, SmartPointer<CMax3SatProblem>& smartPointerToProblem) { i_genLength = genLength; pi_genes = new int[i_genLength + 1]; for (int i = 0; i < i_genLength; i++) { pi_genes[i] = iBinaryRandom(); } this->smartP...
ALGO
0.99907
4.963256
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-02-08T13:44:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fe99d6f7765c...
2a4e0a44-6f33-492b-aee1-e469225372b5
JeongWoo9906626/CodingTest
백준/Silver/10866. 덱/덱.cc
#include <iostream> #include <string> #include <queue> int main() { std::deque<int> Deque; int InputNumber = 0; std::cin >> InputNumber; for (int i = 0; i < InputNumber; ++i) { std::string Order; std::cin >> Order; if ("push_front" == Order) { int Number = 0; std::cin >> Number; Deque.push_fron...
ALGO
0.999406
4.821693
{ "github_metadata": { "branch": "main", "commit_count": 333, "repo_created_at": "2024-09-04T18:14: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": "5044153245...
49614708-1089-499b-9eb2-1c13597d6ea8
google/vpn-libraries
krypton/datapath/ipsec/ipsec_encryptor.cc
// Copyright 2021 Google LLC // // 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
TOOL
0.969615
7.665246
{ "github_metadata": { "branch": "main", "commit_count": 402, "repo_created_at": "2020-10-15T20:05:04.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 552, "forks": 48, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4ae9d817...
50866d88-f693-4858-84d5-055d0e4b52a7
0-0Jay/algorithm
탐욕법(greedy)/deliverySugar.cpp
// 백준 2839 설탕 배달 : https://www.acmicpc.net/problem/2839 #include <stdio.h> #include <algorithm> using namespace std; int cnt[5001]; int main() { int n; scanf("%d", &n); cnt[3] = 1; // 3kg와 5kg에 미리 1을 저장 cnt[5] = 1; for (int i = 6; i <= n; i++) { int min = 5000; if (cnt[i - 3] != 0 && cnt[i - 3] < min) min ...
ALGO
0.999968
4.171418
{ "github_metadata": { "branch": "master", "commit_count": 603, "repo_created_at": "2023-04-04T08:47:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8cd97097...
730ca0c3-93be-46aa-a7c8-87c207212ad2
mahirlabibdihan/Codeforces-Solution
C_Little_Girl_and_Maximum_Sum.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; //Compiler version g++ 6.3.0 // C++ program to show segment tree operations like construction, query // and update #include <bits/stdc++.h> using namespace std; int tree[200000 + 200000 - 1]; // A utility function to get the middle index ...
ALGO
0.999959
5.280212
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2020-04-03T18:29:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3820c7cf1...
fd2eefbc-04e8-4a25-8ce0-840913105970
Romu-ua/Atcoder
dynamic_programming_F/18.cpp
#include <bits/stdc++.h> using namespace std; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } // グラフはDFSでも参照で渡しているから違和感ないけど、dpも参照で渡しているとめんどくさいのでグローバルに書いてしまう。 vector<int> dp; int rec(vector<vector<int>>& G, int v) { // すでに更新済みなら、その時の深さを返す。 if (dp[v] != -1) re...
ALGO
0.999041
3.867809
{ "github_metadata": { "branch": "main", "commit_count": 29, "repo_created_at": "2024-04-27T06:39: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": "b586fe739de...
a7a8bf57-077c-423b-aaff-a3de574db43a
filipeabelha/gym-solutions
imepp/h7/f.cpp
#include <bits/stdc++.h> using namespace std; #define st first #define nd second #define mp make_pair #define pb push_back #define cl(x, v) memset((x), (v), sizeof(x)) #define db(x) cerr << #x << " == " << x << endl #define dbs(x) cerr << x << endl #define _ << ", " << #define gcd(x, y) __gcd((x), (y)) typedef long l...
ALGO
0.999974
3.849225
{ "github_metadata": { "branch": "master", "commit_count": 1023, "repo_created_at": "2017-03-27T00:56: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": "6686cbf...
83777a70-4eea-429c-855c-16695c5b5dcb
Kenshin2438/CP-Code-Collection
Contest/2023牛客寒假算法基础集训营1/G.cpp
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "debug.hpp" #else #define debug(...) 42 #endif using ll = long long; #define all(a) begin(a), end(a) #define sz(x) (int)((x).size()) #define ld nd << 1 | 0 #define rd nd << 1 | 1 const int N = 1e6 + 10; long long tr[N]; bool ok[N]; void merge(int...
ALGO
0.999459
5.130967
{ "github_metadata": { "branch": "master", "commit_count": 95, "repo_created_at": "2022-04-15T06:16:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a1e16d5d0...
a8162234-6ad9-4372-bda3-da440ada62ab
Milias/ModellingSimulation
Week7/header/shared.h
#pragma once #include "part.hpp" double LJPotential(double r, double cut, double e_cut) { if (r > cut*cut) { return 0.0; } else { double r6 = 1.0 / (r * r * r); return 4.0 * (r6 * (r6 - 1.0)) - e_cut; } } double LJVirial(double r, double cut) { if (r > cut*cut) { return 0.0; } else { dou...
ALGO
0.98175
5.995094
{ "github_metadata": { "branch": "master", "commit_count": 99, "repo_created_at": "2016-02-18T22:02:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e425c478d...
a960806b-a2ba-434d-9aec-a1889c527621
lakshmendraB95/CPpractice
B_Chess_Tournament.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll MOD = 998244353; #define rep(i,e) for(ll i = 0; i < e; i++) #define endl "\n" #define dbg(x) cout<<#x<<" = "<<x<<endl #define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL) #define mod 1000000007 #define...
ALGO
0.999897
4.423827
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2021-06-28T15:05: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": "6f4914ab54aa...
e8a2bd58-2c32-4151-a8de-2f25237e7072
lukaszlew/MiMHex
implementation/mcts_node.cpp
#include "mcts_node.h" #include "inverse_sqrt.h" #include "conditional_assert.h" #include <cmath> #include <vector> #include <map> namespace Hex { MCTSNode* MCTSNode::FindChildToSelect(uint children_number) { ASSERT(children_number > 0); MCTSNode* best = &(children[0]); float best_val = best->Eval(); for (uint i ...
ALGO
0.999426
6.337843
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2009-12-17T23:08:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d58ea4434b...
fff896c2-b33c-4c8d-96fe-93cee8523b98
nemnogobread/MIPT-C-CPP-studying
cpp/studying/hometasks/oop1/02.cpp
#include <iostream> using namespace std; const float R = 8.31; class GasHolder { private: float pressure, capacity, temperature; public: GasHolder(float v) { capacity = v; temperature = 273; pressure = 0; } ~GasHolder(){} void inject(floa...
ALGO
0.992688
3.633072
{ "github_metadata": { "branch": "master", "commit_count": 49, "repo_created_at": "2023-02-15T15:34: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": "e108c7f8e...
a0d29745-53ff-4299-9c96-0569e41f4037
KnightWXW/Algo-C
UN/MaxAbsoluteSum.cpp
#include "../Mybasic/mybasic.h" // LeetCode 1749. 任意子数组和的绝对值的最大值 // 链接:https://leetcode.cn/problems/maximum-absolute-sum-of-any-subarray/ // 给你一个整数数组 nums。 // 一个子数组 [numsl, numsl+1, ..., numsr-1, numsr] 的 和的绝对值 为 // abs(numsl + numsl+1 + ... + numsr-1 + numsr) 。 // 请你找出 nums 中 和的绝对值 最大的...
ALGO
0.998217
4.722875
{ "github_metadata": { "branch": "main", "commit_count": 136, "repo_created_at": "2024-07-26T13:30: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": "89a0976cf8...
1e8cd326-ed28-4632-b8c4-8df49db77b80
lighttransport/tinyusdz
examples/common/bvh/include/bvh/parallel_reinsertion_optimizer.hpp
#ifndef BVH_PARALLEL_REINSERTION_OPTIMIZER_HPP #define BVH_PARALLEL_REINSERTION_OPTIMIZER_HPP #include <cassert> #include "bvh/bvh.hpp" #include "bvh/sah_based_algorithm.hpp" #include "bvh/hierarchy_refitter.hpp" namespace bvh { /// Optimization that tries to re-insert BVH nodes in such a way that the /// SAH cost ...
ALGO
0.999785
7.098732
{ "github_metadata": { "branch": "release", "commit_count": 2534, "repo_created_at": "2020-04-14T15:36:33.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 610, "forks": 57, "issues": 17, "pull_requests": 1 }, "file_meta": { "content_id": "cdd...
b4b9ccae-9b83-4a6c-a33b-bbb1346a30c9
yanpierrsf10/Bluetooth-Low-Energy
BLE_WiFi-MQTT/BLE_WiFi-MQTT.ino
// This code detects the nearest BLE of an ESP32-LilyGO-T-ETH-POE and sends it to a database through MQTT using an WiFi connection. #include <BLEDevice.h> #include <BLEUtils.h> #include <BLEScan.h> #include <math.h> #include <map> #include <PubSubClient.h> #include <WiFi.h> #include <Wire.h> #define MEASURED_POWER -79...
TOOL
0.992798
5.976755
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-07-03T18:11:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a3e889dfc823...
e3d7b359-5a0b-4550-8062-1d5483a16336
mcroitor/quick_dive_cpp
samples/22/find_sample.cpp
#include <iostream> #include <algorithm> #include <vector> template<typename InputIterator, typename Predicate> InputIterator find_if(InputIterator begin, InputIterator end, Predicate predicate) { while(begin != end) { if(predicate(*begin)) { return begin; } ++begin; } ...
ALGO
0.998776
5.485034
{ "github_metadata": { "branch": "main", "commit_count": 121, "repo_created_at": "2023-09-14T06:58:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "12d17d777d...
25129dd8-5943-46e9-8301-b4ba43f53743
CastleFlag/learn_opencv4
chap9_edge/9_edge.cpp
#include "opencv2/opencv.hpp" #include <iostream> using namespace std; using namespace cv; void sobel_edge(){ Mat src = imread("lena.bmp", IMREAD_GRAYSCALE); Mat dx, dy; Sobel(src, dx, CV_32FC1, 1, 0); Sobel(src, dy, CV_32FC1, 0, 1); Mat fmag, mag; magnitude(dx, dy, fmag); fmag.convertTo(...
ALGO
0.992926
4.158932
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-09-01T13:25:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "395dced48ec9...
f28c20e1-5862-4911-bf61-fac8e26c43a8
leechangyeol/BaekJoon
1753.cpp
#include <iostream> #include <vector> #include <queue> #include <cstring> using namespace std; const int MAX = 20001; vector<pair<int,int>> edge[MAX]; priority_queue<pair<int,int>, vector<pair<int, int>>, greater<pair<int, int>>> pq; int dist[MAX]; int V, E, start; void dijkstra(int startNode) { int node, value; dis...
ALGO
0.999958
4.057732
{ "github_metadata": { "branch": "main", "commit_count": 166, "repo_created_at": "2020-12-04T08:17: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": "a8c6dec331...
67143d5b-47cf-4d0c-a9b4-8c0670ce9163
DonaldTrump-coder/Image-processing-projects
图像二值化.cpp
#include<opencv2/opencv.hpp> #include<iostream> using namespace std; int average(int a, int b)//求平均值 { return (a + b) / 2; } cv::Mat Bernsen(cv::Mat input)//Bernsen算法 { int length = input.cols; int height = input.rows; cv::Mat threshold = input.clone(); cv::Mat result = input.clone(); cv::Mat model = cv::Mat(3...
ALGO
0.999779
4.568594
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2025-03-07T10:04:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3195da847f6c...
12ed7a0f-09b4-4d8b-99ce-c2d791e79417
arvinemadi/Sensor-Fusion
Algorithms/Clustering/cluster.cpp
//This is originally from Udacity - author mentioned below // /* \author <NAME> */ //This file is part of a sensor fusion project //This file task is creating sample data and visuallization // Also a function for clustering algorithm is implemented using the binary tree structure that is implemented in kdtree.h // This...
ALGO
0.999092
4.790065
{ "github_metadata": { "branch": "main", "commit_count": 49, "repo_created_at": "2022-06-05T06:43:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "558d43711d4...
e861711a-6b6d-4b6f-a0e2-ce3f06011f49
norishigefukushima/OpenCP
include/x86simdsort/xss-pivot-selection.hpp
template <typename vtype, typename mm_t> X86_SIMD_SORT_INLINE void COEX(mm_t &a, mm_t &b); template <typename vtype, typename type_t> X86_SIMD_SORT_INLINE type_t get_pivot(type_t *arr, const arrsize_t left, const arrsize_t right) { using r...
ALGO
0.999969
6.021536
{ "github_metadata": { "branch": "master", "commit_count": 808, "repo_created_at": "2014-04-12T04:41:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 165, "forks": 40, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "a3502...
9ed19541-9560-4c4f-b991-033176ff61f0
TurtleShip/ProgrammingContests
Solutions/TopCoder/SRM_DIV2/SRM504_DIV2/Try1/MathContest.cpp
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <string> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cm...
ALGO
0.99999
4.118633
{ "github_metadata": { "branch": "master", "commit_count": 106, "repo_created_at": "2014-04-19T08:12:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "23bc5d92...
7547bf79-dadb-400c-bc55-073c9e69e013
lassetta/tutorials_etc
cpp_basics/avl/aux.h
using namespace std; /* Extremely basic node * data structure */ struct node{ int val; struct node* left; struct node* right; int height; }; /* initialize a node * the left node gets null * the right node gets null * the values gets whatever value is input * return pointer * */ struct node* init_node(in...
ALGO
0.999992
4.913209
{ "github_metadata": { "branch": "new_branch", "commit_count": 12, "repo_created_at": "2022-02-06T02:45:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fb136...
eb46236a-f47b-4043-a6e3-a850f4799d43
yeeevip/yeee-memo
learn-example/algorithm/coding/PAT/1043.cpp
1043 Is It a Binary Search Tree (25)(25 分) A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes with keys less than the node's key. The right subtree of a node contains only nodes with keys greater than or equal to the nod...
ALGO
0.999997
4.023319
{ "github_metadata": { "branch": "master", "commit_count": 389, "repo_created_at": "2022-07-11T02:51:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 46, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0354383...
5e3da9a2-5772-4731-8ba0-2d3fe53c97bb
protickcse22/Uva_problem
10038_Jolly Jumpers.cpp
/***************************************************************** * * * <NAME> * * JU-CSE-22 perseus_cilix * * * ********...
ALGO
0.9998
3.182755
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2018-08-29T08:13: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": "d764c90b70...
1f424187-a67a-4467-a09b-26d5d3ef4f46
euny0ung/CodingTest
백준/Silver/1431. 시리얼 번호/시리얼 번호.cc
#include <iostream> #include <string> #include <algorithm> using namespace std; bool cmp(string a, string b) { if (a.size() != b.size()) { return a.size() < b.size(); } else { int result_a = 0; int result_b = 0; for (int i = 0; i < a.size(); i++) { if (a[i] >= '0' && a[i] <= '9') { result_a += a[i]...
ALGO
0.999905
4.936195
{ "github_metadata": { "branch": "main", "commit_count": 440, "repo_created_at": "2022-01-05T12:58: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": "7a4a1a83d7...
0f491382-3177-4d99-a0ef-2eeea0150e94
bigstupidx/acm_problem_code
poj/1603/7340361_AC_0MS_140K.cpp
#include <cstdio> #include <cstring> int dis[22][22], n, m; int main() { //freopen("in.txt", "r", stdin); int nca = 1; while (scanf("%d", &n) != EOF) { for (int i = 1; i < 21; i++) { for (int j = 1; j < 21; j++) { dis[i][j] = 1000; } dis[i][i] = 0; } for (int i = 0; i < n; i++) { scanf("%d", ...
ALGO
0.999115
3.718488
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2013-09-06T08:43:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6652a3f9b...
a3660ea4-ea07-4ce2-94b6-05c6b7f62609
tobiastoft/ArduinoEasing
Easing.h
/******************************************************************************************* Easing equations for Arduino v0.1 These functions were quickly mashed together and the code could probably need some tidying up e.g. in terms of memory management (all variables are floats). All functions are put...
ALGO
0.962054
4.142024
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2014-07-04T02:43:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 20, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "24f79d501...
cc0fcd0d-2b61-4a71-9e93-97218b1e704c
macabdul9/ds-algo
bitmasking/uniquenumber1.cpp
/* * @author : macab (<EMAIL>) * @file : uniquenumber1 * @created : Saturday Mar 23, 2019 19:51:05 IST */ #include<bits/stdc++.h> #define endl "\n" #define merge(a, b) a##b #define loop(i,a,b) for(int i=(int)a;i<(int)b;++i) #define rloop(i,a,b) for(int i=(int)a...
ALGO
0.999994
4.057326
{ "github_metadata": { "branch": "master", "commit_count": 203, "repo_created_at": "2018-08-07T17:33: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": "d94350b1...
787a101e-a901-45d7-bf9d-3c1b6821716c
yuweichen1008/LeetCode
Practice/Stack/856_Score_of_Parentheses.cpp
/* "()" has score 1. AB has score A + B, where A and B are balanced parentheses strings. (A) has score 2 * A, where A is a balanced parentheses string. Input: s = "(())" Output: 2 Input: s = "(()(()))" Output: 6 */ class Solution { public: // Stack TimeComplexity O(n) Space O(n) int scoreOfParentheses(string s...
ALGO
0.999351
5.528454
{ "github_metadata": { "branch": "master", "commit_count": 202, "repo_created_at": "2017-02-02T05:40: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": "0a34b92c...
19585e28-55d4-4140-8db1-51738829e91d
anak1st/Contests
src/XCPC/ICPC/2023/online1/G.cpp
/** * @author: XiaFan * @date: 2023-09-18 20:16 */ #include <bits/stdc++.h> using i64 = long long; template <typename T> T power(T a, int b) { T res = 1; for (; b; b /= 2, a *= a) { if (b % 2) res *= a; } return res; } template <int P> struct MintBase { int v; int norm(int x) const ...
ALGO
0.99964
5.11598
{ "github_metadata": { "branch": "master", "commit_count": 107, "repo_created_at": "2022-08-13T01:53:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "81b2d00b...
89963fbd-5479-411d-8277-494728d529c8
SuperYe1/LearnCpp
leetcode/220.cpp
#include "oftenUse.hpp" #include <iostream> #include <math.h> #include <vector> #include <unordered_map> using namespace std; int getID(int x, long w) { return x < 0 ? (x + 1ll) / w - 1 : x / w; } bool containsNearbyAlmostDuplicate(vector<int> &nums, int k, int t) { unordered_map<int, int> mp; int n = nums...
ALGO
0.994607
4.051344
{ "github_metadata": { "branch": "master", "commit_count": 27, "repo_created_at": "2021-06-20T13:11: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": "4b579fdcc...
4b15bd3d-67b9-4d3a-a025-5874d5132f5b
Mariam-Mohsen/Data-Structures-and-Algorithms
Knapsack.cpp
// GROUP: DS2 // ID: 20227023 // Assign: 09 // Assign: Knapsack // UVA: 10130 // Name: <NAME> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; //////////////////////////////////////////////////////////////////////////////////////////////////////////// s...
ALGO
0.999974
3.920547
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2025-05-08T18:05: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": "ace8330fc42...
b1054266-f389-43fa-918f-392c1012149f
Usofl/Programmers_practice
Programmers_practice/FailureRate/FailureRate.cpp
#include <string> #include <vector> #include <map> using namespace std; vector<int> solution(int N, vector<int> stages) { vector<int> answer(N, 0); map<int, double> m; for (int i = 1; i <= N; ++i) { int challenger = 0; int failed = 0; for (int j = 0; j < stages.size(); ++j) ...
ALGO
0.999957
4.436727
{ "github_metadata": { "branch": "main", "commit_count": 31, "repo_created_at": "2021-12-26T13:38: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": "cec99a97453...
58aa98df-e8d6-45be-90ca-0a9de8707d3e
Yawn-Sean/Daily_CF_Problems
daily_problems/2024/09/0918/personal_submission/cf340e_lengli.cpp
/* lengli_QAQ Hope there are no bugs!!! */ #include <bits/stdc++.h> #define fastio std::ios::sync_with_stdio(0); std::cin.tie(0); std::cout.tie(0) #define all(x) x.begin(),x.end() #define pb push_back template <unsigned M_> struct ModInt { static constexpr unsigned M = M_; unsigned x; constexpr ModInt() : x(0U) ...
ALGO
0.999792
3.787936
{ "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": "2f53...
4a15b5a6-6b03-4818-9c0f-a9f7a48861d6
devedu-AI/Data-Structures-and-Algorithms-in-Cpp-Mayank-Arora
024 - Tries/CountDistRowinBinaryMatrix.cpp
// Count Disnct Row in Binary Matrix // Time Complexity O(mn) and Aux Space O(mn) #include <iostream> using namespace std; #define ROW 4 #define COL 3 bool matrix[ROW][COL] = {{1,0,0}, {1,1,1}, {1,0,0}, {0,1,0} }; ...
ALGO
0.999905
4.884683
{ "github_metadata": { "branch": "main", "commit_count": 308, "repo_created_at": "2023-04-06T21:21:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a67606abe69...
36f8a936-ed00-41d1-b095-d85fd982ed83
cthbst/Competitive-Programming
contest/題單/2016 寒假中興/Day5/pF_POJ3321.cpp
#include<stdio.h> #include<string.h> //#include<vector> //using namespace std ; const int maxn = 100001 ; int n ; //vector<int> G[maxn] ; int G[maxn][100] ,sz[maxn] ; int I[maxn] ,O[maxn] ,time_tag=0 ; void dfs(int u ,int fa ){ I[u] = time_tag++ ; for (int i=sz[u]/*G[u].size()*/-1 ;i>=0 ;i-- ) if (G[u...
ALGO
0.999703
3.892842
{ "github_metadata": { "branch": "master", "commit_count": 177, "repo_created_at": "2015-12-05T09:00:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 23, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b203aaf...
9b886c2a-d1de-44e7-98b1-183d3eab4d87
ishandutta2007/codeforces-e
emiso/normal/939/F.cpp
#include <bits/stdc++.h> using namespace std; int n, k, l[110], r[110], dp[2][100010], ndp[2][100010]; vector<int> gmin[2]; vector<int> get_min(int n, int sz, int id) { vector<int> tmp, ret; int cont = 0; for(int i = 0; i <= n; i++) { int x = dp[id][i]; while(cont < tmp.size() && x < dp[i...
ALGO
0.999726
3.37784
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:34:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9113f9af6ffe...
5daf3c84-edc6-4d9c-8ce0-c2685b60619d
Mach3tryhard/FMI-CTI
Anul1/Utilizarea Sistemelor de Operare/S1USO Curs/DDD_sem1_2024_2025/ddd_lectii_ma10feb2015/oop_s22feb2014/lab/1c.cpp
// supraincarcare operatori #include <stdio.h> struct complex{double re; double im;}; void citeste(complex &a){ scanf("%lf%lf",&a.re,&a.im); } void scrie(complex a){ printf("%lf+i*%lf",a.re,a.im); } complex operator+(complex a, complex b){ complex c; c.re=a.re+b.re; c.im=a.im+b.im; return c; } complex op...
TOOL
0.940064
3.855256
{ "github_metadata": { "branch": "main", "commit_count": 210, "repo_created_at": "2024-11-25T14:48:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "739e1675ce...
ca80c85c-7ea5-486d-9eeb-d895c8c7b53f
devraghav14/DSA
AdditionalTopics/Recursion/GenerateParentheses.cpp
// Leetcode Problem No 22 : Generate Parentheses (Medium) /* Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Example 1: Input: n = 3 Output: ["((()))","(()())","(())()","()(())","()()()"] Example 2: Input: n = 1 Output: ["()"] Constraints: 1 <= n <= 8 */ ...
ALGO
0.999667
5.993887
{ "github_metadata": { "branch": "main", "commit_count": 131, "repo_created_at": "2025-02-18T05:32: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": "2adadd259c...
2b819d26-03a7-4477-b388-417cdbfdc301
henrybrausen/revello
ABPlayer.h
#ifndef __AB_PLAYER_H__ #define __AB_PLAYER_H__ #include "Player.h" #include "Board.h" #include "TranspositionTable.h" /* An AI player based on the Alpha-Beta search algorithm. * Enhanced with a transposition table and iterative deepening search. */ class ABPlayer : public Player { public: ABPlayer(Boa...
ALGO
0.981006
6.745528
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2016-03-24T23:36:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "207ed8b0b7...
092810c5-bcf6-4e1f-8581-10b63b97eb05
KijanDaniel/schoolWork
cs302/LabA/dond.cpp
//<NAME> //5/10/22 //Dr. Plank //This plays the dond game #include <string> #include <iostream> #include <ostream> #include <cstdlib> #include <vector> using namespace std; class dondc { public: double recursive(double t, double last, double s); vector<vector<double> > cache; }; double dondc::recursive(double t...
ALGO
0.991232
3.738174
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2022-07-12T15:17: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": "0ff14f6ead0...
d2900e32-7391-46b2-b6ef-99100c1dfced
BelfordZ/cpsc3200
set4/10026.cpp
#include <iostream> #include <vector> #include <utility> #include <algorithm> using namespace std; bool comparison(pair<double,int> left, pair<double,int> right) { if (left.first == right.first) return (left.second > right.second); return (left.first < right.first); } int main() { int numOfCases; ...
ALGO
0.999632
3.091467
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2013-04-10T05:34: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": "4ad2ad4184...
6f3500a0-8e43-4ff1-8859-f263bb9a861e
hriturajofficial/SUDOKU_SOLVER
SUDOKU_SOLVER.cpp
#include <iostream> #include <set> #include <iterator> #include <bitset> #include <bits/stdc++.h> using namespace std; typedef long long int ll; ll mod=1000000007; int N; int mat[9][9]; int ans[9][9]; vector <set<int>> tru(9); int arr [] = {0,3,6}; vector <pair<int,int>> v; void f(int level){ //BASE ...
ALGO
0.999929
4.07004
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-07-07T14:43: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": "e90cb12a1eb1...
37ee4f5d-4d7a-41ee-a1b6-d5f68817b51c
Marialean1985/AxBench
axbench/applications/inversek2j/src/inversek2j.cpp
/* * inversek2j.cpp * * Created on: Sep. 10 2013 * Author: <NAME> <<EMAIL>> */ #include <iostream> #include <cstdlib> #include "kinematics.hpp" #include <fstream> #include <time.h> #include <iomanip> #include <string> #define PI 3.141592653589 #include <boost/math/special_functions/fpclassify.hpp> int ...
DATA
0.975042
3.708033
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-01-20T02:55:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d80596498f...
de12527a-c810-4c73-b98f-03059f13bc0a
adityajn105/College-Codes
SE-2/OOMPL/Posix_Threads/Main.cpp
#include <iostream> #include <pthread.h> #include <stdlib.h> using namespace std; void* add_task(void *arg) { int a = (int) (long) arg; int n1, n2; cout << "Enter numbers to add: "; cin >> n1 >> n2; cout << n1 << " + " << n2 << " = " << n1 + n2 << endl; // cout << "Work from...
TOOL
0.937005
4.402579
{ "github_metadata": { "branch": "master", "commit_count": 89, "repo_created_at": "2016-12-12T20:11:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0bc38e5b6...
7f139c9b-1bda-4fff-bc88-54b1cb04e42f
cppascalinux/jinanjixun
day4/source/djh123/game.cpp
#include <iostream> #include <cmath> #include <cstdio> #include <cstring> #include <algorithm> #define rep(x, a, b) for(int x = (a); x <= (b); ++x) #define per(x, a, b) for(int x = (a); x >= (b); --x) #define rop(x, a, b) for(int x = (a); x < (b); ++x) using namespace std; typedef long long LL; typedef unsigned int ui;...
ALGO
0.999885
3.454037
{ "github_metadata": { "branch": "master", "commit_count": 31, "repo_created_at": "2019-05-29T09:22:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "67ebec6e1...
c3725ad8-e915-4a61-92dc-0db31f29b42e
jdtorressv/ECS175p4
main.cpp
#include <GL/glut.h> #include <stdio.h> #include <stdlib.h> #include <math.h> #include <fstream> #include <iostream> #include <vector> #include <string> #include <iomanip> #include <cmath> using namespace std; #define ERROR 1 #define NORM 500.0 /************************************************************************...
ALGO
0.99303
3.588243
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2018-12-11T02:28: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": "dfcd075c2...
012e7ad8-c1ab-4a33-8af3-147a0e4778f3
Piyush13-ambure/DSA
merge without an extra space.cpp
//Given two sorted arrays a[] and b[] of size n and m respectively, the task is to merge them in sorted order without using any extra space. Modify a[] so that it contains the first n elements and modify b[] so that it contains the last m elements. #include <iostream> #include <vector> #include <cmath> // For ceil func...
ALGO
0.999993
5.52179
{ "github_metadata": { "branch": "main", "commit_count": 607, "repo_created_at": "2025-01-02T17:15:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bdbd3a9dc2...
9832664c-5506-4c59-92c9-9203b4ed7a32
Shikhar-S/Analysis-of-Competitive-Codebase
Data/Contest1245/Standings3/29617643_64030926.cpp
//#include <bits/stdc++.h> #include <iostream> #include <vector> #include <algorithm> using namespace std; int parent[2000]; int rankk[2000]; int el[2000]; long long place[2000]; void make_set(int v) { el[v] = v; parent[v] = v; rankk[v] = 0; } int find_set(int v) { if (v == parent[v]) return v; return parent[v]...
ALGO
0.999974
3.65189
{ "github_metadata": { "branch": "master", "commit_count": 74, "repo_created_at": "2019-11-22T14:40:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "be9b94afb...
e906b654-da51-4033-96ba-fcf787d73e7a
a920604a/leetcode
C_plus/513_FindBottomLeftTreeValue.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.999961
5.116602
{ "github_metadata": { "branch": "main", "commit_count": 327, "repo_created_at": "2021-06-15T12:27:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "9b1d45b797...
1857d75a-4411-46d4-9ab2-d99bc8e58cf8
mirtaba/ACMICPC-INOI_Archive
CodeCup2/Q2/C.cpp
#include <bits/stdc++.h> #define X first #define Y second #define bitAt(a,b) (a & (1<<b)) using namespace std; typedef long long LL; typedef pair <int, int> PII; typedef pair <LL, LL> PLL; const int Maxn = 5*1000 + 250; const int Mod = 1000 * 1000 * 1000 + 7; const int abMax = 1 << 29 ; const double EPS = 1e-9; cons...
ALGO
0.999891
4.309091
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-03-16T09:07:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "be04c7c666...
b5441055-03b3-4388-b78b-e52297d85e14
HPC-Fortran2CPP/Fortran2Cpp
data/readable_format/cpp/file2277.cpp
#include <iostream> #include <cstdlib> int edg(int l, int k, int e[3][/* appropriate size */]) { for (int i = 0; i < 3; ++i) { if (e[i][l] == k) { return i + 1; // Fortran arrays are 1-based, C++ arrays are 0-based } } std::cerr << "0***error in function edg***" << std::endl; ...
ALGO
0.999134
5.778409
{ "github_metadata": { "branch": "main", "commit_count": 95, "repo_created_at": "2024-04-05T20:02:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 13, "forks": 5, "issues": 55, "pull_requests": 0 }, "file_meta": { "content_id": "5ad66c69ac...
2998feb9-9c0e-4210-8f53-140bb45bc83a
ShauryaBajpai2711/MissionDSA
leetcode/621_Task_Scheduler.cpp
#include <iostream> #include <vector> #include <unordered_map> #include <queue> using namespace std; class Solution { public: int leastInterval(vector<char>& tasks, int n) { unordered_map<char, int> freq; for (char i : tasks) { freq[i]++; } priority_queue<int> maxHeap;...
ALGO
0.999997
6.899455
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2025-04-11T10:25: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": "6cecd606acfa...
789c7dfd-5d04-4e24-b4fb-9fa7cb4f182e
SR-Sunny-Raj/Hacktoberfest2021-DSA
08. Hashing/Triplet Sum in Array.cpp
#include <bits/stdc++.h> using namespace std; class Solution{ public: //Function to find if there exists a triplet in the //array A[] which sums up to X. bool find3Numbers(int nums[], int n, int X) { //Your Code Here sort(nums, nums+n); int ans = false; //stores the v...
ALGO
0.999791
5.367402
{ "github_metadata": { "branch": "master", "commit_count": 2783, "repo_created_at": "2020-05-08T05:36:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 236, "forks": 982, "issues": 3, "pull_requests": 161 }, "file_meta": { "content_id": "a...
a1c4b701-b438-481a-bd39-4414c278b973
caiwaifung/algo
tc/src/SemiPerfectPower.cpp
#include <iostream> #include <sstream> #include <algorithm> #include <set> #include <map> #include <cstdio> #include <cstdlib> #include <cstring> #include <string> #include <vector> using namespace std; typedef long long LL; typedef pair<int,int> PII; typedef vector<int> VI; #define PB push_back #define MP make_pair #...
TEST
0.999374
4.356005
{ "github_metadata": { "branch": "master", "commit_count": 608, "repo_created_at": "2015-05-10T11:28:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bafb8d73...
558d9bed-1cd9-4697-8221-d0c15c9449e9
Mahoganyrc/XCamp
23SP 201C/Week7/week7a_NQueensProblem.cpp
//#include <iostream> // // //int maze[20][20]; //int size; //int solutions = 0; //const int SEEN = 2; //const int QUEEN = 1; //const int OUTOFBOUNDS = -1; //const int EMPTY = 0; // //void markAllSeenLocations (int x, int y); //void findAllPossibleSolutions (int i); //void checkValidSolution (); // //void placeQueen (i...
ALGO
0.999909
4.426649
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2023-05-27T06:34:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5a2ce25ae...
7f455ad3-3a73-41bd-9af4-e8287714bafb
OneZeroAndTwoZero/own-cppfile
程序/实验舱/CodePower/Code Power C3.5_2024.6.29/#E、 加条边.cpp
#include<bits/stdc++.h> using namespace std; struct edge{ int u, v, nxt; }; struct node{ int idx, val; bool operator < (const node &a) const{ return val > a.val; } }; int n1, n2, m, u, v, cid = 0; int dis[300005]; edge e[1000006]; int head[300005]; bool vis[300005]; void add(int u, int v){ ...
ALGO
0.999854
3.331676
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-10-20T03:01: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": "d549daee60a3...
3021bc1c-6b53-4714-a76e-ee93013b95c3
SahajV/computervision-2019
lab3/lab3_test1.cpp
#include <iostream> #include <fstream> #include <cstdlib> #include <ctime> #include <cmath> #include <list> #include <iterator> #include <vector> using namespace std; const int width = 800, height = 800; //We define the resolution fo the image that we are making int pic[width][height] = {0}; //Make a Matrix th...
ALGO
0.9995
4.636068
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-09-15T18:04: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": "b7c4fc35ac...
3f466615-eb49-4df6-9251-db92e73707a4
Mosharrof8413/Codeforces-problem-solution
Problems-B/B. Love Song.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<vi> vvi; typedef vector<vl> vvl; typedef pair<int,int> pii; typedef pair<double, double> pdd; typedef pair<ll, ll> pll; typedef vector<pii> vii; typedef vector<pll> vll; typedef double dl; ...
ALGO
0.999822
3.898018
{ "github_metadata": { "branch": "main", "commit_count": 192, "repo_created_at": "2021-03-24T09:59: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": "d1e67d9e55...
51d768f9-8afb-49f2-a92f-58f6559a09cf
samtudor0112/MCTS-TicTacToe-Parallel
include/search/Node.hpp
#ifndef SERIAL_NODE_HPP #define SERIAL_NODE_HPP #include <vector> #include "../gameboard/State.hpp" // A single node in the MCTS search tree. The whole tree can be represented simply by the root node, and the remaining // nodes accessed through the childNodes vector. class Node { private: // parentNode is a nullp...
ALGO
0.948347
6.363914
{ "github_metadata": { "branch": "master", "commit_count": 40, "repo_created_at": "2020-11-01T05:05: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": "6e075ea85...
5fa71e9b-8d97-4855-839b-8e64558a6ab9
Lang-Dat/dev
chuyen_de/3_MANG_B7_15/mang3/BSET.cpp
/** * author: <NAME> * create: 24-12-2022 03:59:20 **/ #include <iostream> #include <algorithm> using namespace std; static const int OFF_SET = 1e5 + 5; static const int LIM = 2e5 + 5; static bool freq_a[LIM], freq_b[LIM]; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); #ifnde...
ALGO
0.99996
3.737953
{ "github_metadata": { "branch": "main", "commit_count": 259, "repo_created_at": "2022-09-03T14:10:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f1a84541cc...
89145728-3005-4417-a739-543eedca7be2
jks-prv/Beagle_SDR_GPS
extensions/DRM/dream/chanest/TimeWiener.h
/******************************************************************************\ * Technische Universitaet Darmstadt, Institut fuer Nachrichtentechnik * Copyright (c) 2001 * * Author(s): * <NAME> * * Description: * See TimeWiener.cpp * **************************************************************************...
ALGO
0.99927
6.915494
{ "github_metadata": { "branch": "master", "commit_count": 5299, "repo_created_at": "2015-05-24T21:02:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 503, "forks": 168, "issues": 57, "pull_requests": 4 }, "file_meta": { "content_id": "a2...
9a280d30-c285-4e2e-8a01-be8783b78fc4
chfeng-cs/CPU2017
benchspec/CPU/510.parest_r/build/build_base_mytest-64.0000/source/libparest/slave/stationary/slave.cc
/* $Id: slave.cc 2721 2006-06-07 20:08:56Z wolf $ */ #include <libparest/slave/stationary/slave.h> #include <libparest/slave/stationary/global_matrix.h> #include <libparest/utilities.h> namespace libparest { namespace Slave { namespace Stationary { /* ------------------ Slave ----------------- */ ...
ALGO
0.994478
6.307068
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2021-04-19T12:20:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2fec4c6a7...
564c71c6-6e42-47d6-8490-603a0d799e5f
kskisb/atcoder_submissions
abc/084/d.cpp
#include <iostream> #include <map> #include <string> #include <vector> #include <climits> #include <queue> #include <algorithm> #include <math.h> using namespace std; using ll = long long; ll INF = 1LL << 60; int prime_factorization(int N) { int res = 0; for(int i=2; i*i<=N; i++) { while(N%i == 0) { N /=...
ALGO
0.999584
4.484357
{ "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": "d723dfcc61...
728ecea8-32a3-475a-a7b7-d7a1ad0a0d68
emilyju0314/gpt_code_plagiarism
dataset/code_content_classifier/allpro_train/1_4748_176.cpp
#include <iostream> #include <algorithm> #include <string> #include <cstring> #include <cstdio> #include <cstdlib> #include <cmath> #include <climits> #define MEMZERO(x) memset(x, 0, sizeof(x)); using namespace std; int main ( void ) { const int dx[] = { 0, 0, 0, -1, 1, -1, 1, -1, 1, 0, 0, -2, 2 }; const int dy[] ...
ALGO
0.999126
3.493608
{ "github_metadata": { "branch": "main", "commit_count": 50, "repo_created_at": "2024-04-28T03:59:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "895b06f80a3...
7e3f07f2-5d74-4d08-8ea5-e981d31f800c
nawaraing/problem_solve
baekjoon/p6086.cpp
#include <stdio.h> #include <vector> #include <utility> using namespace std; int graph[53][53]; int n; int visit[53]; int ft_dfs(int node, int capacity) { if (node == 51) return (capacity); int flag = 0; int idx = -1; visit[node] = 1; for (int i = 0; i < 52; i++) { if (visit[i]) continue ; ...
ALGO
0.999532
3.447605
{ "github_metadata": { "branch": "master", "commit_count": 207, "repo_created_at": "2020-03-03T04:03: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": "9558ef2c...
4de6654e-64de-4a0b-994e-1a625b908cfa
partho-das/CompetitiveProgrmming
CP_CODE/Codeforces/Codeforces Round #660 (Div. 2)/c.cpp
#include <bits/stdc++.h> using namespace std; //____________________________________________________________________________________________________________________________________ #define PI 2*acos(0.0) #define pf printf #define sc scanf #define ff first #define ss second #define mp make_pair #define pb pus...
ALGO
0.999995
3.859712
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-03-30T08:21: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": "66419d532753...
19847161-8790-4771-8119-85c0a94e548e
BazkieBumpercar/GameplayFootball
src/onthepitch/proceduralpitch.cpp
// written by <NAME> 2008 - 2015 // this work is public domain. the code is undocumented, scruffy, untested, and should generally not be used for anything important. // i do not offer support, so don't ask. to be used for inspiration :) #include "proceduralpitch.hpp" #include "../misc/perlin.h" #include "../gamedefi...
TOOL
0.940393
4.330734
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2017-11-02T15:29:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 219, "forks": 73, "issues": 7, "pull_requests": 0 }, "file_meta": { "content_id": "ecc1f9...
c7add66d-b414-4558-9907-f6f1b2db7447
haozzzzzzzz/osgEarthX
environment/build/3rdParty/include/geos/geos/geomgraph/index/MonotoneChain.h
/********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.osgeo.org * * Copyright (C) 2005-2006 Refractions Research Inc. * Copyright (C) 2001-2002 Vivid Solutions Inc. * * This is free software; you can redistribute and/or modify it under * th...
ALGO
0.964049
6.107
{ "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": "eb02167...
5662f19a-4be6-487b-a0b4-f8910b4fa250
mansi05041/Love_babbar_DSA_sheet
array/3.Kth smallest element/quickSelect.cpp
#include<iostream> #include<vector> using namespace std; int partition(vector<int> &v,int left,int right){ int temp = v[right]; int i=left; // keep track of pivotIndex for(int j=left;j<right;j++){ if(v[j]<=temp){ swap(v[i],v[j]); i++; } } swap(v[i],v[right])...
ALGO
0.999988
6.00566
{ "github_metadata": { "branch": "main", "commit_count": 271, "repo_created_at": "2022-12-14T17:30: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": "ea0d2e2f4f...
de662e26-f47a-4618-9f7a-07137920a885
UniMelbHumanRoboticsLab/CANOpenRobotController
src/hardware/platforms/M3/SignalProcessing.cpp
#include "SignalProcessing.h" using namespace Eigen; Filter::Filter(unsigned int order_, Eigen::VectorXd init_element_) { order=order_; //Initialise elements for(unsigned int i=0; i<order+1; i++) { x.push_back(init_element_); y.push_back(init_element_); } //not ready yet ini...
ALGO
0.990657
4.813654
{ "github_metadata": { "branch": "master", "commit_count": 583, "repo_created_at": "2020-05-11T07:05:41.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 34, "forks": 38, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "cd2d91f...
609bd188-8a23-4e4a-9c1a-5e204af1af13
mcseyyy/String-matching-in-a-stream
Stream_Match.h
/* Implemntation of the O(log n) algorithm for string-matching in a stream by <NAME>, <NAME> paper: Real-time streaming string-matching authors: <NAME>, <NAME> link to paper (ACM): http://dl.acm.org/citation.cfm?id=2635814 link to paper (Google Scholar): https://scholar.google.com/citations?view_op=view_citation&...
ALGO
0.999677
6.52897
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2016-02-26T12:31: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": "c3ef65d2cd...
c0fc0062-ec0f-45b6-8c6b-90bd76f81ba8
TuGraph-family/tugraph-db
procedures/algo_cpp/sybilrank_core.cpp
/** * Copyright 2022 AntGroup CO., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
ALGO
0.999955
4.280531
{ "github_metadata": { "branch": "master", "commit_count": 710, "repo_created_at": "2022-08-25T08:46:43.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1596, "forks": 207, "issues": 125, "pull_requests": 15 }, "file_meta": { "content_id": "6...
ecd1ad0c-cd99-45bd-a6dd-ec7d01caa908
Zveroth/BinaryTree
BinaryTree/Tree.h
#pragma once //#include "vector" //std::vector<int> DeletedNumbers;//Basic memory leak detection template <typename T> struct TreeNode { //Creation constructor TreeNode(const T& NData) : LeftNode(nullptr), RightNode(nullptr), Data(NData) {} ~TreeNode() { //DeletedNumbers.push_back(Data);//Rmove this when using...
ALGO
0.998663
4.056324
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-11-17T17:07:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "91e9ec9ed8...
2b697d8a-3c97-4f0d-89e0-053bd5e53126
Izabelawenda/AISD
list_hash.cpp
#include <iostream> #include <string> #include <cstdlib> #include <ctime> using namespace std; // Definicja elementu listy //------------------------- struct slistEl { slistEl* next; string tytul; string autor; string wydawnictwo; int rok_wydania; int strony; }; // Funkcja haszująca //-------...
ALGO
0.988074
3.156727
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-02-24T12:32: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": "98164184df7d...
817204c5-079e-43cd-b0cd-2ff0d1985473
OpenFOAM/OpenFOAM-dev
src/meshTools/patchDist/WallLocation/wallPointI.H
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\...
TOOL
0.998087
7.014055
{ "github_metadata": { "branch": "master", "commit_count": 8589, "repo_created_at": "2014-12-10T15:47:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1770, "forks": 642, "issues": 0, "pull_requests": 3 }, "file_meta": { "content_id": "be...
af87751a-417d-4edf-88b2-5988e050076a
davixiao/advent-of-code
10b.cc
/** * Not very clean. * expand each pixel to 3x3. * .|. * | = .|. * .|. * I reused dist array alot. -2 for outside, -3 for inside loop * then, just count the number of original "." that have dist = -3 * * spent a lot of time debugging --> writing messy code. Need to * revisit. */ #include <iostream...
ALGO
0.999308
4.462809
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2023-12-05T20:15:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6d334257a56...
0a7547dc-c589-4645-8acd-f07e81787bb9
AyGeeEm/knapsack01-analysis
algorithm.cpp
#include <iostream> #include <algorithm> #include "algorithm.h" Knapsack::Knapsack() {} int Knapsack::compute(const vector<int>& weights, const vector<int>& values, int capacity) { int n = weights.size(); //Store weights for later use (getSelectedItems) weightsArr = weights; //Initialize DP ...
ALGO
0.999987
6.182088
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2025-04-21T08:22: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": "35bd65f46d24...
fbf5abe7-ee18-4625-9b34-05703fbc20be
google-research/google-research
fully_dynamic_facility_location/nice_clustering_algorithm.h
// Copyright 2025 The Google Research Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law...
ALGO
0.998611
7.549022
{ "github_metadata": { "branch": "master", "commit_count": 4832, "repo_created_at": "2018-10-04T18:42:48.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 36026, "forks": 8143, "issues": 1061, "pull_requests": 576 }, "file_meta": { "content_id...
d2da4214-4b2c-490d-bf6e-38710fa93240
Vaishnavisr001/Lunar
assessments/cppbasics/cppbasics/prg17.cpp
#include <iostream> #include <string> #include <algorithm> using namespace std; bool isStringPalindrome(const string& str) { string reversedStr = str; reverse(reversedStr.begin(), reversedStr.end()); return str == reversedStr; } bool isNumberPalindrome(int number) { int originalNumber = number; ...
ALGO
0.991509
5.453525
{ "github_metadata": { "branch": "master", "commit_count": 49, "repo_created_at": "2025-04-23T04:39: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": "dfedad59d...
c4dc8fc3-a126-488a-aca8-8a22279689b4
NafiHasan/HabiJabi
C++/Codeforces Contests/GLOBAL/Global Round 16/c.cpp
#include <bits/stdc++.h> using namespace std; #define fast_io() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL) int main() { fast_io(); int tc; cin >> tc; while (tc--) { int n; cin >> n; string r1, r2; cin >> r1 >> r2; int ans = 0; for (int i = 0; i < n ; i++) { if (r1[i] == '0' && ...
ALGO
0.999914
4.167779
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2023-03-17T09:29:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5f7dc6d90c6...
8dffc841-6a8a-4091-b58b-b3cf108d90f2
kentakom1213/kyopro
contests/abc253/src/bin/E.cpp
// 累積和をとってDP? // 時間があれば行けたな #include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define ALL(A) A.begin(), A.end() using ll = long long; template <typename T> inline bool chmax(T &a, const T b) { if (a < b) { a = b; return true; } return false; } template <typen...
ALGO
0.999948
4.287015
{ "github_metadata": { "branch": "main", "commit_count": 1421, "repo_created_at": "2021-08-22T05:51:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "260404362...
4b4515e7-6a74-464f-aeb9-7bcb6a70c00d
yosupo06/library-checker-problems
geo/euclidean_mst/gen/near_circle.cpp
#include <cstdio> #include <cstdlib> #include <utility> #include "random.h" #include "../params.h" using namespace std; using P = pair<int, int>; P random_point(Random& gen) { long long R = X_AND_Y_ABS_MAX; long long x = gen.uniform(-R, R); long long ok = 0, ng = R + 1; while (ok + 1 < ng) { ...
TOOL
0.966203
3.99845
{ "github_metadata": { "branch": "master", "commit_count": 3115, "repo_created_at": "2019-05-30T20:49:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 589, "forks": 137, "issues": 98, "pull_requests": 3 }, "file_meta": { "content_id": "70...
4eaef97e-9e30-4ab7-b114-7b19317e9775
AshvinBa/CPP_Programs-2
String's/Reverse_string_using_stack.cpp
/* Reverse a string using Stack You are given a string S, the task is to reverse the string using stack. Example 1: Input: S="GeeksforGeeks" Output: skeeGrofskeeG */ #include <bits/stdc++.h> using namespace std; char *reverse(char *str, int len); int main() { cout << "Enter the string: "; char str[10000]; ...
ALGO
0.999683
4.877225
{ "github_metadata": { "branch": "main", "commit_count": 335, "repo_created_at": "2023-03-12T14:35: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": "e1324f4325...
3bb7d1b1-316b-4a66-abb5-6bba2115b6f7
zhjiang22/code
vijos/P1779.cpp
/* 很明显是贪心 但是看到最大金币最小我竟然有种二分的冲动23333 然后仔细想想这怎么分啊666 怎么贪? 我们把左右手乘积更小的人排在前面 证明的博客很多,找了一个写的比较好的贴出来 { 看到这道题的使得获得奖赏最多的大臣,所获奖赏尽可能的少,我的第一想法是二分答案。但是又仔细想了想,答案不具有单调性,二分是行不通的。 再看看这道题,我感觉可以用贪心来做。也就是说先用贪心确定一种最优的方案,再在这个排列队伍中求得答案。 可以这样思考,相邻两个的人交换对于前面的人答案没影响(这不是废话么),而且对于后面的人答案也没有影响(这里很关键)。也就是说相邻两人的位置交换只会对这两个人产生影响。那么我们就先考虑这两个人。 设这两个人分别为...
ALGO
0.999974
3.695598
{ "github_metadata": { "branch": "master", "commit_count": 64, "repo_created_at": "2018-12-21T06:22:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 18, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8e4ba863...
d8bb77a8-3813-48d4-88b4-476471f3b019
lukinma/ESCA
src/SMT/BinarySMT.h
#ifndef EQUALSMT_H #define EQUALSMT_H #include "FormulaSMT.h" enum OperatorSMT { EqualSMT, LessSMT, GreaterSMT }; class BinarySMT : public FormulaSMT { public: // BinarySMT() : FormulaSMT() {} BinarySMT( const VersionedVariable &l, const VersionedVariable &r, OperatorSMT o, bool n ); std::string...
ALGO
0.951293
7.153109
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2018-04-23T00:02:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "62a578d86...
6f27763d-f14c-4fb7-8fb3-c8a267ea4c42
ATRI17Z/adventofcode18
Day20/Day20.cpp
#include <iostream> #include <iomanip> #include <fstream> #include <sstream> #include <string> #include <vector> #include <list> #include <algorithm> #include <map> #include <tuple> // LOC: [x,y] // ROOM: [x,y,dist] using loc = std::tuple<int, int>; using room = std::tuple<int, int, int>; int main(); room getNewRoo...
ALGO
0.999908
4.452445
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2018-12-03T19:04: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": "3a6b13f3d...
0029bfff-98cb-4064-b214-0cbabb9ac2f9
kamrulashraf/Lightoj
1240.cpp
#include <bits/stdc++.h> using namespace std; #define EPS 1e-12 struct point { double a , b ,c; point(double x, double y , double z){ a = x, b = y, c = z; } }; point x(0,0,0) , y(0,0,0) , z(0,0,0), ss(0,0,0); double fun(double m){ point temp(x.a+m*ss.a , x.b+m*ss.b , x.c+m*ss.c); double aa...
ALGO
0.999746
4.932914
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-10-03T10:14: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": "2db16675e6...
35619a44-5e03-4ff1-819b-579eef5d08f1
Math-O5/competitive-programming
ACM_IPC/regional-2021/b.cpp
#include <bits/stdc++.h> using namespace std; struct LenghtSort { bool operator () (const string &a, const string &b) { return (a.size() < b.size()) ; } }; int n, m; int checkScore(int beg, vector<char> a, string sub){ for(int i = 0; i < (int)sub.size(); i++){ if(sub[i] != a[beg]) re...
ALGO
0.999989
3.937502
{ "github_metadata": { "branch": "master", "commit_count": 146, "repo_created_at": "2018-05-30T12:57:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bb67e144...
329b8e73-41cd-48ac-bd76-4b5ea1307f50
SamarNegm/acm
Periodic Strings3.cpp
#include<bits/stdc++.h> using namespace std ; #define ll long long int t ; string s ; bool ok( string a ){ if( s.length()%a.length()!=0 ) return false ; string d = "" ; while( d.length() < s.length() ){ d += a ; if( d == s ) return true ; } return false ; } int main(){ scanf("%d" ,&...
ALGO
0.999596
3.231004
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-05-30T00:48: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": "5f0384e06f...