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
91902ac2-39b5-4e48-8fe9-ce8c33fe531b
DaviMachado/URI-Online-Judge
conversao para binario.cpp
#include <cstdlib> #include <iostream> #include <string> using namespace std; int main(int argc, char *argv[]) { int decimal=0; // declaração das variaveis string bin; // declaraçao de variavel de letras cout<<"Conversao de decimal para Diversas bases\n"; cout<<"Digite um numer...
ALGO
0.968572
3.525834
{ "github_metadata": { "branch": "master", "commit_count": 384, "repo_created_at": "2018-09-26T00:14: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": "081a4359...
c2db9c65-7e80-4074-9edd-00c3b55a4ed6
UCLA-VAST/sisyphus-fpga25-artifact
vitis/sisyphus/2023_float_with_tree_red/symm_MEDIUM_overuse0/csim.cpp
#include <hls_stream.h> #include <cstring> #include <hls_vector.h> #include <ap_int.h> #include "code_generated.h" typedef hls::vector<float,16> float16; typedef hls::vector<float,8> float8; typedef hls::vector<float,4> float4; typedef hls::vector<float,2> float2; typedef hls::vector<float,1> float1; #pragma ACCEL ke...
ALGO
0.998823
4.118248
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2024-12-14T09:54:36.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "de6253220fd3...
9edf9694-4c71-4b68-9bc7-ddd36288c018
buyaojiaoban/Data-Structure-and-Algorithm
project/数据结构与算法/02 链表/02_链表.cpp
#include <iostream> #include <stdlib.h> #include <time.h> using namespace std; // 节点类型 struct Node { Node(int data = 0) : data_(data), next_(nullptr) {} int data_; Node* next_; }; // 单链表代码实现 class Clink { public: Clink() { // 给head_初始化指向头节点 head_ = new Node(); } ~Clink() { // 节点的释放 Node* p = head_; ...
ALGO
0.999896
4.52955
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-02-18T07:47: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": "00f4f5141147...
984fd192-1dc6-453c-99b6-7d6b96f0cdbc
RmZeta2718/Numerical-Calculation
lab4/mainwindow.cpp
#include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) , threshold(30) , expandRate(1.1) { ui->setupUi(this); connect(ui->customPlot,SIGNAL(beforeReplot()),this,SLOT(showPoints())); // give the axes some labe...
ALGO
0.984325
5.198481
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-01-08T02:49: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": "625f2e9fa187...
4a23e250-5dc9-427c-9df6-8092c413c706
AbhijitDoesCoding/Coding
A_Rectangle_Cutting.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define yes cout<<"Yes"<<endl; #define no cout<<"No"<<endl; #define all(x) x.begin(),x.end() #define rall(x) x.rbegin(),x.rend() #define pb push_back #define mp make_pair #define ff first #define ss second #define mod 1000000007 #define inf 1e18 #define...
ALGO
0.999937
4.132712
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2025-03-23T07:28: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": "2d1ad324dbe3...
688e60e0-2da2-449d-8def-4b9531112284
gyubeomim/lockdpwn
cpp/1books/brain_STL/book_codes/06/ex06-45.cpp
#include <iostream> #include <list> using namespace std; void main( ) { list<int> lt1; list<int> lt2; lt1.push_back(50); lt1.push_back(40); lt1.push_back(30); lt1.push_back(20); lt1.push_back(10); //lt2.push_back(25); //lt1과 lt2의 정렬 방식이 다르므로 오류 //lt2.push_back(35); //lt2.p...
ALGO
0.99896
4.897949
{ "github_metadata": { "branch": "master", "commit_count": 1541, "repo_created_at": "2017-11-23T17:43:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "019e485...
4a056a28-954c-48eb-80b5-31104966c6a0
Yanggoo/X-PBD-Cloth-Simulation
source/ClothSolverCPU.h
#pragma once #include <vector> #include "Particle.h" #include "Collider.h" #include <tuple> #include "ClothSolverBase.h" #include "DynamicKDTreeCPU.h" #include <cmath> #include "Grid3D.h" class Cloth; class ClothSolverCPU : public ClothSolverBase { public: ClothSolverCPU(); ~ClothSolverCPU() = default; void Respon...
ALGO
0.996661
3.583619
{ "github_metadata": { "branch": "master", "commit_count": 54, "repo_created_at": "2024-11-12T08:51:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6bb0e7190...
b2287b18-7ffb-40bb-95f9-3a0fd042a642
sam19980301/Parallel-Sudoku-Solver
parallel_nonrecursive_solver.cpp
#include <queue> #include <algorithm> #include "sudoku.h" #include "omp.h" #include "CycleTimer.h" using namespace std; extern int solve(Sudoku *sudoku); int parallel_solve(Sudoku *sudoku_head, int max_branched_sudokus, double *end_times) { queue<Sudoku*> q_sudoku; Sudoku *next_sudoku = sudoku_head + 1; ...
ALGO
0.999884
3.59435
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2022-11-10T16:45:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d4c02dc15f3...
1353b3bd-bf0f-4d8b-b95c-107c40de8228
Dr-axe/ShitMadeForOJ
NEUOJ-数据结构/14.4字符串搜索3.cpp
#include <unordered_map> #include <string> #include<iostream> #include <functional> #include <cstring> #include<unordered_set> #include<vector> #include<set> #include<cmath> using namespace std; unsigned long int MAX=0x7fffffffffffffff; string input; string x; vector<unsigned long int>pos; int charToIndex(char c) { ...
ALGO
0.999003
3.869308
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2025-05-13T15:24:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6ef59a593100...
6a6155e4-7cc1-4462-949d-e31060a166c1
sheikh-arman/workTemp
ICPC2020_practice/codeforces/rifat_bigint.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define all(v) v.begin(),v.end() //The digits are always in reverse order class BigInt{ public: string dgt; bool sign; BigInt(); void trim(); bool isZero(); void read(const string&); BigInt(string); //first dgt is the s...
ALGO
0.999702
3.413693
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2020-02-27T09:17:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "12e87995b...
5a48a884-391b-4f01-b4c7-d2f4f6a96d31
qvinn/Compress_algorithms
CPP_COMPRESS_ALGORITHMS/huffman_adaptive.h
#pragma once #ifndef HUFFMAN_ADAPTIVE_H #define HUFFMAN_ADAPTIVE_H #include "main.h" //Константы, используемые в алгоритме кодирования #define END_OF_STREAM 256 /* Маркер конца потока */ #define ESCAPE 257 /* Маркер начала ESCAPE последовательности */ #define SYMBOL_COUNT 258 /* Максимально во...
ALGO
0.987876
4.215039
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2019-12-19T13:11: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": "4b607a0c6...
f4984a13-3e1b-4a32-8dab-837620ac81e5
Garyxud/melodic-all
src/tuw_marker_detection/tuw_marker_pose_estimation/src/pose_estimation_base.cpp
/* * Copyright (c) 2016, <NAME> <<EMAIL>> * All rights reserved. * * 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 condi...
ALGO
0.906339
6.533028
{ "github_metadata": { "branch": "melodic-all", "commit_count": 1, "repo_created_at": "2020-09-14T02:37:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 8, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "3f094...
1379d09d-d7af-4f70-a4bc-b7fdee07ecb5
jaehyeonha/Study_Algorithm_SWM-practice-
hyunseo/3week/permutation.cpp
#include <bits/stdc++.h> using namespace std; vector<int> v = {1, 2, 3, 4}; vector<bool> s(v.size(), false); void dfs(int idx, int cnt) { if (cnt == 2) { for (int i = 0; i < v.size(); i++) if (s[i]) cout << v[i] << " "; cout << endl; } // bound를 높여가면서 해야 한다...
ALGO
0.999963
4.346014
{ "github_metadata": { "branch": "main", "commit_count": 78, "repo_created_at": "2023-01-06T14:09:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3d039ab8b67...
e1ad9d6b-47ef-4ca3-b999-60fa12df8dc9
DKay7/MIPTREP
contests/graphs/t8.cpp
#include <stdio.h> #include <string.h> #include <limits.h> #include <malloc.h> #define INF 257 // INT_MAX int main() { int n = 0, m = 0; int weights_sum = 0; scanf("%d %d", &n, &m); int **G = (int **) calloc(n, sizeof(*G)); for (int i = 0; i < n; i++) { G[i] = (int *) calloc(n, sizeof(*...
ALGO
0.999972
3.86103
{ "github_metadata": { "branch": "dev", "commit_count": 119, "repo_created_at": "2021-08-24T08:14: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": "bd5ec020247...
9004d3a9-ca31-4959-bc71-1a7812228dc8
lucastarche/aotd
DataStructures/016-Stack.cpp
//Stack //A Last In, First Out (LIFO) data structure. It is used in problems such as bracket matching, or for making calculations in either Polish or Reverse Polish Notation, for example. This implementation uses a Double Linked List, but it can be more space efficient with a Reversed Linked List. //Both push() and pop...
ALGO
0.999916
5.271963
{ "github_metadata": { "branch": "master", "commit_count": 400, "repo_created_at": "2020-09-12T17:06:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "52e5223b...
2addcc21-ed29-4838-98e5-f01587efb060
haiwangcat/ROSE
src/midend/binaryAnalyses/dataflowanalyses/RoseBin_DefUseAnalysis.cpp
/**************************************************** * RoseBin :: Binary Analysis for ROSE * Author : tps * Date : 7Sep07 * Decription : Dataflow analysis ****************************************************/ // tps (01/14/2010) : Switching from rose.h to sage3 #include "sage3basic.h" #include "RoseBin_DefUseAnal...
ALGO
0.956889
4.876915
{ "github_metadata": { "branch": "master", "commit_count": 20462, "repo_created_at": "2012-12-22T20:27:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c1415e...
8f6fd504-a323-425c-be51-86856067fe70
StevenLiuWen/ano_pred_cvpr2018
Codes/flownet2/src/ops/flow_warp/flow_warp.cu.cc
#if GOOGLE_CUDA #define EIGEN_USE_GPU #include <stdio.h> #include <iostream> #include "flow_warp.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/framework/tensor_types.h" #include "tensorflow/core/platform/types.h" #include "tensorflow/c...
ALGO
0.990211
6.586472
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2018-03-13T06:30:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 450, "forks": 124, "issues": 30, "pull_requests": 1 }, "file_meta": { "content_id": "4d97...
e9b34fa9-1635-4592-8b69-ebbeb47a81c7
ShortTailLab/ph-open
Classes/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp
// Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2009-2012 <NAME>, London, UK. // Copyright (c) 2009-2012 <NAME>, Amsterdam, the Netherlands. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. /...
TOOL
0.998684
7.335241
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2014-08-20T03:23:22.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 518, "forks": 332, "issues": 7, "pull_requests": 0 }, "file_meta": { "content_id": "01bd6b...
d037328f-5ebf-4647-b0a1-e867c246bdf2
titsuki/AOJ
Volume_13/1315_Gift_from_the_Goddess_of_Programming.cpp
#define _USE_MATH_DEFINES #define INF 0x3f3f3f3f #include <cstdio> #include <iostream> #include <sstream> #include <cmath> #include <cstdlib> #include <algorithm> #include <queue> #include <stack> #include <limits> #include <map> #include <string> #include <cstring> #include <set> #include <deque> #include <bitset> #in...
ALGO
0.977953
3.873702
{ "github_metadata": { "branch": "master", "commit_count": 1653, "repo_created_at": "2014-12-21T06:24:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d37a2a5...
0e3c1a4d-2cc5-47c7-aebb-ed037d350342
pankhuri-52/Data-Structures-Codes
Graphs/KosarajuAlgorithm.cpp
#include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: // 1.Sort the dfs traversal according to finish time using a stack; // 2.Make a new graph with all the edge directions reversed; // 3.Traverse the elements in stack and count the no. of dfs traversals; void ...
ALGO
0.999857
5.862895
{ "github_metadata": { "branch": "master", "commit_count": 434, "repo_created_at": "2019-10-22T08:29:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6ca9abe4...
9fd069dd-e6b1-4d56-a8fb-2b6e1850b1d9
MrBruceLee/LeetCode
C++/ClosestBinarySearchTreeValue.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ /* * Runtime - O(N) * Space - O(N) */ class Solution { public: int closestValue(TreeNode* root, double target) ...
ALGO
0.999999
6.203814
{ "github_metadata": { "branch": "master", "commit_count": 196, "repo_created_at": "2016-03-30T20:50: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": "680273cd...
896ec5e2-64db-4ea8-9296-e91d10c99da5
abhisheksuman413/A2Z_DSA_Course_Sheet
02_Learn Important Sorting Techniques/Lec_02_02_Sorting 2/Theory_03_Recursive_Insertion_Sort.cpp
#include <bits/stdc++.h> using namespace std; void insertion_sort(int arr[], int i, int n) { // Base Case: i == n. if (i == n-1) return; int j = i+1; while (j > 0 && arr[j - 1] > arr[j]) { swap(arr[j - 1], arr[j]); j--; } insertion_sort(arr, i + 1, n); } int main...
ALGO
0.999975
5.596662
{ "github_metadata": { "branch": "master", "commit_count": 43, "repo_created_at": "2023-08-12T10:12: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": "e4e7b0782...
7fca4e09-85ae-406b-bef0-5043d9931c41
ss-shrishi2000/LeetCoding_All_Around
Map_Of_Highest_Peak.cpp
PROBLEM STATEMENT :- You are given an integer matrix isWater of size m x n that represents a map of land and water cells. If isWater[i][j] == 0, cell (i, j) is a land cell. If isWater[i][j] == 1, cell (i, j) is a water cell. You must assign each cell a height in a way that follows these rules: The height of each cell m...
ALGO
0.999995
6.396814
{ "github_metadata": { "branch": "main", "commit_count": 121, "repo_created_at": "2021-10-02T07:26: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": "3908894d4f...
ddde9c47-1f3f-423b-9ad8-6333b55dfabb
divyansh2212/LeetCode-Problems
Palindromic Array - GFG/palindromic-array.cpp
//{ Driver Code Starts #include<iostream> #include<string.h> using namespace std; // } Driver Code Ends /*Complete the function below*/ #include<bits/stdc++.h> class Solution { public: int PalinArray(int a[], int n) { // code here for(int i = 0; i < n; i++) { vector<int> digits; wh...
ALGO
0.999617
5.354374
{ "github_metadata": { "branch": "main", "commit_count": 1949, "repo_created_at": "2022-12-05T19:22: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": "4d23b127c...
4845552e-7962-490a-acc3-2af23ce3376d
prasadms429/leetcode
imp_questions/8) Implement strStr().cpp
class Solution { public: int strStr(string haystack, string needle) { if(needle.empty()){ // If there is no string in needle to compare with haystack, then return 0 return 0; } int m=haystack.length(); int n=needle.length(); for(int i=0;i<=m-n;i++) // If we co...
ALGO
0.999921
5.185204
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2022-07-08T16:14:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "374c6168326...
4d324213-34d1-438b-a976-5216c014b1e1
H-Shen/My_Code_Collection
Kattis/classpicture.cpp
// https://open.kattis.com/problems/classpicture #include <bits/extc++.h> using namespace std; using namespace __gnu_pbds; using ll = long long; using ld = long double; using int128 = __int128; using ii = pair<int, int>; using vii = vector<pair<int, int>>; using vi = vector<int>; void fast_io() { ios_base::sync_...
ALGO
0.999998
4.680271
{ "github_metadata": { "branch": "master", "commit_count": 1586, "repo_created_at": "2019-04-11T06:48:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5e9a107...
50b3f26c-037d-42aa-9c5c-efed3875d0b2
aslamovamir/codeSignalPractice
makeArrayConsecutive2.cpp
//Ratiorg got statues of different sizes as a present from CodeMaster for his birthday, each statue having an //non-negative integer size. Since he likes to make things perfect, he wants to arrange them from smallest to //largest so that each statue will be bigger than the previous one exactly by 1. He may need some ...
ALGO
0.999741
4.857344
{ "github_metadata": { "branch": "main", "commit_count": 160, "repo_created_at": "2021-10-11T18:07: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": "103b48e719...
67eaefae-c1b0-47ac-909b-fe970484f9b9
shubhamsingh94/SPOJ
spoj/BUGLIFE.cpp
/* Author : <NAME> */ #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<ll,ll> pll; typedef vector<pii> vpii; typedef vector<pll> vpll; typedef vector<vpii> v...
ALGO
0.999873
4.272845
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2016-01-21T17:23:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0d6a886d1c...
7dce9c3b-a5d0-4369-a415-ad1840409b00
abhpd/hacktoberfest2021
C++/Algorithms/Dynamic Programming/MinJumps_DP.cpp
#include <bits/stdc++.h> using namespace std; int minJumps(vector<int>&a, int n) { // jumps[n-1] will hold the result vector<int>jumps(n); int i, j; if (n == 0 || a[0] == 0) return INT_MAX; jumps[0] = 0; // Find the minimum number of jumps to reach arr[i] // from ...
ALGO
0.999925
4.068573
{ "github_metadata": { "branch": "main", "commit_count": 266, "repo_created_at": "2020-10-09T08:07:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 548, "forks": 1571, "issues": 16, "pull_requests": 1341 }, "file_meta": { "content_id": "6...
bed97b58-fa2c-42f8-aed5-2931e1ae4555
thecodermaniac/C---Programming
queen_problem.cpp
#include <iostream> using namespace std; int is_safe(int **arr, int row, int col) { int i, j; for (i = 0; i < col; i++) { if (arr[row][i]) { return 0; } } for (i = row, j = col; i >= 0 && j >= 0; j--, i--) { if (arr[i][j]) { return...
ALGO
0.999772
4.895607
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2022-08-14T17:46: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": "d1e25175e...
9d4f441e-46d4-4631-937f-d06932eb4bb5
TechTycoon-Jitu/LoveBabbarDSA
Lecture14-Binary-search-interview-question/square-root.cpp
#include <iostream> using namespace std; long long int squareroot(int n) { int start = 0; int end = n; int mid = start + (end - start) / 2; int ans = -1; while (start <= end) { long long int square = mid * mid; if (square == n) { return mid; } ...
ALGO
0.999829
3.501867
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2023-05-22T20:05: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": "0bac95c5b3f0...
4dec03f6-a400-4d27-ab98-3a703b64bd11
GodlewskiMariusz/Wild-Animals
Turtle.cpp
#include <iostream> #include "Organism.h" #include "Turtle.h" #include "constants.h" #include "World.h" using namespace std; Turtle::Turtle(int position_X, int position_Y, int age, World* game) :Animal(TURTLE_INITIATIVE, TURTLE_STRENGTH, age, 'T', position_X, position_Y, game) { } Turtle::Turtle(int xy[2], World* g...
ALGO
0.907805
3.672691
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-04-17T10:00:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b0026d211a8f...
8306227e-2adc-44fe-8cb1-f793bf1b8534
leelabsg/SKAT
src/Binary_ComputeExactMC.h
#ifndef COMPUTE_EXACT_MC_001 #define COMPUTE_EXACT_MC_001 #include <vector> using namespace std; class CohortInfo { public: CohortInfo(); ~CohortInfo(); int Init(double * Z0, double *Z1, int k, int m, int total_m, int * marker_idx, int total, int * total_k, double *prob_k, double * p1, int * I...
ALGO
0.956777
4.163476
{ "github_metadata": { "branch": "master", "commit_count": 139, "repo_created_at": "2016-08-29T18:12:41.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 50, "forks": 17, "issues": 10, "pull_requests": 4 }, "file_meta": { "content_id": "5c2fc2...
186f750d-e738-4cd7-bd82-45b5191d1ec7
CaDe27/Coding
ICPC/primeraFecha2022/e.cpp
#include <iostream> #include <algorithm> using namespace std; typedef int64_t ll; #define MOD 1000000007 #define loop(i,a,b) for(int i = a; i < b; ++i) const int maxK = 5000 + 5; int k, m, n; ll fact[maxK], invFact[maxK]; ll binPow(ll base, ll exp){ ll r = 1; while (exp > 0){ if( exp & 1) ...
ALGO
0.99998
4.107007
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2023-02-23T17:53:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cd173473629...
34325b99-6c07-448a-ae5c-8c98795531c3
psaikko/mcts-reversi
uct.h
#pragma once #include <iostream> #include <vector> #include <cmath> #include <cassert> #include "board.h" #include "util.h" #include "basic.h" using namespace std; struct TreeNode { int n_visited; int n_moves; vector<double> T; vector<double> N; vector<Point> valid_moves; vector<TreeNode*> node_chil...
ALGO
0.999624
5.84669
{ "github_metadata": { "branch": "master", "commit_count": 31, "repo_created_at": "2018-06-10T13:25:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "98295689b...
a413ae8e-78d3-4859-8db9-0eab68f07929
emilyju0314/gpt_code_plagiarism
dataset/code_content_classifier/allpro_train/0_0_3293.cpp
#include <iostream> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<pair<int, int>> heroes(m); for(int i = 0; i < m; i++) { cin >> heroes[i].first >> heroes[i].second; } vector<int> board(n); for(int i = 0; i < n; i++) { cin >> ...
ALGO
0.999991
3.777149
{ "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": "d42292cf615...
c2ed648b-1da4-45e9-91fc-145bc3445cc0
manchalaharikesh/CODES-POTDs
GeeksForGeeks/Check if frequencies can be equal.cpp
// DATE: 08-MAR-2024 // Question URL: https://www.geeksforgeeks.org/problems/check-frequencies4211/1 // Question: Check if frequencies can be equal // Description: Given a string s which contains only lower alphabetic characters, check if it is possible to remove at most one character from this string in such a way tha...
ALGO
0.999941
4.847824
{ "github_metadata": { "branch": "main", "commit_count": 389, "repo_created_at": "2023-08-17T10:03: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": "90fb25ae0d...
c1002e2a-f0ba-4c14-9f78-fae1e5084cd3
Tegrlo/bntu_isit
oaip/lab_3/Laba_3.1_sem_1/Laba_3.1_sem_1/main.cpp
// Лабораторная работа №3. Циклические алгоритмы // Задание 1. // Вариант 11. // Студента группы 10702119 <NAME> #include <stdio.h> #include <math.h> #include <windows.h> #include <iostream> using namespace std; const int UNKNOWN = FALSE; void main(){ setlocale(0, ""); int steps; double a,b,c,x1,x2,dx,F; system(...
ALGO
0.999686
4.353453
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-10-13T14:39:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "875cb11477...
0c05dcfa-167d-4078-86cd-d99855325f0b
patrick-kook/Capstone-Design
core/path_planner/path_planner/src/graph_planner/astar_planner.cpp
/** * ********************************************************* * * @file: astar_planner.cpp * @brief: Contains the A* (dijkstra and GBFS) planner class * @author: <NAME> * @date: 2023-12-12 * @version: 1.2 * * Copyright (c) 2024, <NAME>. * All rights reserved. * * ------------------------------------------...
ALGO
0.999375
6.20164
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2025-04-19T14:46:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5fcc4966435b...
1df9bb67-872d-4cff-b4df-1a6d6613e143
MySummertime/leetcode
987.二叉树的垂序遍历.cpp
#include <vector> #include <map> #include <set> using std::vector; using std::map; using std::multiset; /** * 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(nul...
ALGO
0.999997
6.422114
{ "github_metadata": { "branch": "main", "commit_count": 345, "repo_created_at": "2021-07-07T07:24: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": "a155ee9577...
8f5c6582-2c91-4f62-832a-3375aaf0ac1d
ZhangYanrui123/ZhangYanrui123-Parrallel-Programming---Hw3---Pthread
sta2.cpp
#include <iostream> using namespace std; #include <iomanip> #include <stdio.h> #include <time.h> #include <pthread.h> #include <semaphore.h> #include <arm_neon.h> typedef struct { int t_id; // 线程 id }threadParam_t; #define N 996 #define cnt 1 #define NUM_THREAD 5 #define RANDOM_ADD 2 sem_t sem_leader; sem_t sem_Divi...
ALGO
0.999881
3.386797
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2022-05-05T14:43: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": "0ea385521e...
26d8bb11-b83f-434b-ac48-aaedc5e6da1f
Nwhelden/DataStructures
PageRank/main.cpp
#include <iostream> #include <utility> #include <algorithm> #include <iomanip> #include <map> #include <vector> using namespace std; class AdjacencyList { private: //adjacency list representing the graph //map: key represents 'from' vertex, vector value of a key represents the adjacent 'to' verticies //ex...
ALGO
0.999974
5.419933
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-09-26T14:43: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": "b61d3e3b6fe8...
a69424c5-4036-4163-af71-7496d0012aac
tibi-p/steam-roll
infoarena/dotcom/2012/r1-x/x.cpp
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #define MAX_N 1000000 #define MAX_Q 500000 using namespace std; char str[2][MAX_N + 1]; char merge_fw_str[2 * MAX_N + 1]; char merge_bw_str[2 * MAX_N + 1]; int prefix[MAX_N]; int z_fw[2 * MAX_N]; int z_bw[2 * MAX_N]; int queries[MAX_Q][2]; ...
ALGO
0.999896
3.431466
{ "github_metadata": { "branch": "master", "commit_count": 241, "repo_created_at": "2012-10-21T17:41: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": "f18352cd...
da5a231a-5fbd-4735-a0ba-f76d50de36e5
MarcinPiotrowski/MultiBodySystemDynamics
Control/comovementprogram.cpp
/* ******************* * File name : comovementprogram.h * Author : <NAME> * Created : 2015-06-02 20:16 * Brief : See comovementprogram.cpp * ******************* */ #include "comovementprogram.h" vec COMovementProgram::GetSingleTrajectory(double t_c, double t_b, double t_e, ...
ALGO
0.999465
5.402668
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2015-06-02T21:45:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1acde28b8...
a6a4d470-053d-451d-bc6e-140588949270
ulpati/experimental_data_processing_laboratory
lezione7/esercizio7.1/esercizio7.1.cpp
#include <iostream> #include <cmath> #include "integrale.h" #include "assert.h" #include "../fmtlib.h" #include "../../root/include/TApplication.h" #include "../../root/include/TCanvas.h" #include "../../root/include/TGraph.h" #include "../../root/include/TF1.h" #include "../../root/include/TAxis.h" using namespace ...
ALGO
0.971911
5.172563
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-01-07T19:44: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": "5c5bc854a9f9...
f550ee6e-326c-4652-b167-0327fc2cf5a3
simone-fdr/chessAI
ChessAI/Move.cpp
#include "Move.h" U64 get_queen_attacks(int, U64); // TODO I could make this function longer but with fewer branches for efficency void generate_moves(vector<int>& moves) { //init source-target int source_square, target_square, piece; //define bb copy U64 bitboard, attacks; if (side == white) { //White Pawns ...
ALGO
0.99714
5.699783
{ "github_metadata": { "branch": "main", "commit_count": 46, "repo_created_at": "2022-06-21T10:00: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": "e3fdbe7d856...
ebd4832c-4614-4c5d-a49f-dd84609ddcaf
starswap/AdventOfCode2021
Day15Part1.cpp
#include <bits/stdc++.h> using namespace std; const int dr[] = {0,1,0,-1}; const int dc[] = {1,0,-1,0}; const int INF = 1e9; int dijkstra(vector<vector<int>> &grid,int rt,int ct) { vector<vector<int>> upToDateCosts(rt,vector<int>(ct,INF)); priority_queue<tuple<int,int,int>> pq; //-cost,x,y; pq.push(make_tuple(...
ALGO
0.999934
4.405997
{ "github_metadata": { "branch": "main", "commit_count": 44, "repo_created_at": "2021-12-01T07:26: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": "1d67ba41fa6...
dd78946c-f09f-4866-9451-2ee9b8446df8
ksaveljev/UVa-online-judge
10686.cpp
#include <iostream> #include <string> #include <vector> #include <map> #include <sstream> using namespace std; int main(void) { int n, c, w, p; string category, keyword, input; cin >> n; while (n--) { cin >> c; vector<string> categories; map<string,int> needed, result; multimap<string,string...
ALGO
0.998959
3.658568
{ "github_metadata": { "branch": "master", "commit_count": 788, "repo_created_at": "2011-04-04T11:43:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 106, "forks": 69, "issues": 0, "pull_requests": 4 }, "file_meta": { "content_id": "2579d...
24c38048-94c9-435d-8108-27605efbe6a7
alps-jbnu/23ALPStudy
2023-2/Intermediate/highcastle01/Greedy/BOJ_2457.cpp
#include<bits/stdc++.h> using namespace std; #define E first #define S second //끝나는 날 정렬 위해서 pair<int, int> arr[100001]; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int n, i, overCheck = 0, underCheck = 1230; cin >> n; for(i = 0; i < n; i++) { int sm, sd, em, ed; cin >> sm >> sd >> em >> ed;...
ALGO
0.999548
3.286071
{ "github_metadata": { "branch": "main", "commit_count": 2930, "repo_created_at": "2023-02-03T06:11:26.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 12, "forks": 59, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4150ee48...
f0d7c333-e243-4c11-ac9b-b8bb11d6230d
shashank2806/techbairn-cs
array.cpp
#include <iostream> using namespace std; // Function to calculate the sum of elements in an array int calculateSum(int arr[], int size) { int sum = 0; for (int i = 0; i < size; ++i) { sum += arr[i]; } return sum; } // Function to calculate the average of elements in an array double calculateA...
ALGO
0.99914
6.242735
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2024-02-04T12:48: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": "8d6630d9d6...
cf1b6146-5fe0-41eb-9c07-57ae91a7ef58
Karan-Choudhary/DSA
BitManipulations/CountOnesInBinary.cpp
/* Count Ones in Binary Representation Problem - Count the number of ones in binary representation of a number. Example - Input - 5 Output - 2 Input - number Output - number of ones in binary representation of the number Optimized Approach - 1. Given a number n, we can find the n-1 number by flipping the right most ...
ALGO
0.999959
5.616906
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2022-07-08T04:58:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3e0b40ecc1d...
61a09230-ea72-4d40-becb-ca2cb30a92db
JaechanAn/algorithm-study
Jinaria/three problem per day/2020.1/2020.1.8/6549.cpp
#include <cstdio> #include <vector> #include <algorithm> #include <stack> #include <utility> using namespace std; int main() { long long n; scanf("%lld", &n); while (n != 0) { vector<long long> height(n); for (int i = 0; i < n; ++i) scanf("%lld", &height[i]); stack<lo...
ALGO
0.999864
3.081831
{ "github_metadata": { "branch": "master", "commit_count": 137, "repo_created_at": "2019-03-16T05:41:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b7306bc0...
7cf0163d-2e23-414a-96e2-8ba8837f7bc7
15609335417/SINS_LC
INS.cpp
#include"INS.h" /// <summary> /// 单历元初始对准 /// </summary> /// <param name="imu">IMU数据</param> /// <returns>姿态余弦矩阵</returns> EulerAngles initialAlignment(const _IMU& imu, const double* pos) { double phi = deg2rad(pos[0]); double g = _Setgp(phi,pos[2]); double temp[3] = { 0.0,0.0,g }; Vector gn(3); gn = temp; temp[0]...
ALGO
0.971805
4.395513
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2023-06-18T12:45: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": "9fd43d8ce5...
316c1f14-6b94-40be-8449-3a0e39cd8812
Koveror/Sim-City
src/graph.hpp
#ifndef GRAPH_HPP_INCLUDED #define GRAPH_HPP_INCLUDED #include <utility> #include <iostream> #include <list> #include "tools.hpp" #include <algorithm> #include <string> #include <fstream> #include <exception> #include <random> #include <queue> //priority queue #include <limits> //numeric limits #include <utility> //p...
TOOL
0.902002
3.767979
{ "github_metadata": { "branch": "master", "commit_count": 187, "repo_created_at": "2019-04-16T21:17: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": "6df692b2...
5277f118-6b84-4781-af38-b9ed5823c5a6
JoelGunawan/competitive-programming
codeforces/1800-1899/1804/c.cpp
// header file #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> // pragma #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") // macros #define endl "\n" #define ll long long #define mp make_pair #define ins insert #define lb lower_bound #define pb pu...
ALGO
0.999608
4.651251
{ "github_metadata": { "branch": "main", "commit_count": 665, "repo_created_at": "2021-06-06T04:24:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9aa25a41e6...
a98141d5-6c0f-4d48-aae4-fe4b2cc558b2
SimoAngelov/EGT_CPP
STL/CityTemperatures/src/Task.cpp
/* * Task.cpp * * Created on: 11.06.2017 г. * Author: sim4o */ #include <iostream> using namespace std; #include <vector> #include <map> #include "UserDefinedFunctions.h" #include "MapOperations.h" const string g_keyName = "City"; const string g_valName = "Temperature"; void testSort1(cityToTemps& cityTemp...
ALGO
0.995993
4.787053
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2017-05-10T16:50: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": "b6ae7ab22...
cae23f76-1172-46dc-8600-2881a33185b5
ashrali/C-Playground
Tree/AVLtree.cpp
#include <iostream> using namespace std; struct Node { int data; Node *left, *right; int height; Node(int val) { data = val; left = right = nullptr; height = 1; } }; int getHeight(Node *node) { if (node == nullptr) return 0; else return node->he...
ALGO
0.99928
5.715491
{ "github_metadata": { "branch": "main", "commit_count": 43, "repo_created_at": "2025-02-01T13:26: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": "65b51652f50...
38b9e532-4a14-4a66-b620-ad0b059a2a12
arnabs542/LeetCode-26
C++/0777-swap-adjacent-in-lr-string.cpp
// Tags: Brainteaser Google // Time: O(n) // Space: O(n) class Solution { public: bool canTransform(string start, string end) { // we already know start.length() == end.length() // index, char vector<pair<int, char>> pstart, pend; for (int i = 0; i < start.length(); ++i) { ...
ALGO
0.999954
5.919188
{ "github_metadata": { "branch": "master", "commit_count": 465, "repo_created_at": "2021-06-04T06: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": "83ed78df...
5a428665-c059-4a7a-9be4-782377047bf9
Ranjana550/DSA-Practice
Problem-Solving/KoKo.c++
/**** Koko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and will come back in h hours. Koko can decide her bananas-per-hour eating speed of k. Each hour, she chooses some pile of bananas and eats k bananas from that pile. If the pile has less than k bananas...
ALGO
0.999918
4.685204
{ "github_metadata": { "branch": "main", "commit_count": 109, "repo_created_at": "2022-06-03T15:13: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": "edd32dc42b...
7dfe69d9-d116-4ef6-9625-9c9ae6c30b40
Secret0-OchkA/Numerical_Methods_PR5
PR5/Headers/Matrix.h
#pragma once //Пользовательский тип(класс); //Определены методы : // уметь извлекать элементы матрицы; // уметь определять размер матицы // операция вычисления определителя det(); // метод замены столбца; // вычислять норму; // вычислять разность; // вычислять произведение; // копировать матрицы. #include <iostream> #...
TOOL
0.959523
4.458413
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2021-10-14T19:10: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": "3c0f2d4e9...
b9c1d4dc-767e-4735-bbe5-e64f8ba4abfa
alvarorl231/UCO-Practices
PRIMERO/INTRODUCCIÓN A LA PROGRAMACIÓN/practica7/resueltas/ej9.cpp
#include <iostream> using namespace std; int find (string a, string b) { int j = 0; //Counter for string b int start; //Index where b starts in a for (int i = 0; i < a.length(); i++) { //Comprobamos si el caracter que estamos mirando es igual en a y b if (a[i] == b[j]) { //Si ...
ALGO
0.999513
4.982125
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2021-05-21T09:58: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": "5f84dd1ce0b...
930fd5c0-6650-4d85-bf0b-c0fbb12f7278
ishandutta2007/codeforces-nonalphabetic
1.618/normal/1246/B.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <vector> #include <queue> #include <utility> using namespace std; typedef long long ll; const int LEN = 100000; struct fastio{ int it,len; char s[LEN + 5]; fastio(){ it = len = 0; } char get(){ if...
ALGO
0.999945
3.604109
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:49:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0cf4f66c8a00...
9cc1d177-1f9c-45c6-8229-aed087695bee
AnuragPatel1/Codeforces-Problem
E_Interesting_Ratio.cpp
#include <bits/stdc++.h> using namespace std; const int MAX = 1e7 + 5; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); vector<int> omega(MAX, 0); vector<bool> is_prime(MAX, true); is_prime[0] = is_prime[1] = false; for (int i = 2; i < MAX; ++i) { if (is_prime[i])...
ALGO
0.999606
4.294968
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2025-04-12T09:45:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1839dcd32d2...
12b05ff9-f0be-4c2d-b0e5-b6b4283a29f5
Hayato-T-08/atcoder
abc/abc265/c.cpp
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; #include <atcoder/all> using namespace atcoder; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i < (int)(n+1); i++) #define rep3(i, m, n) for (int i = (int)(m); i < (int)(n); i++) using ll = long long; using...
ALGO
0.999942
3.682827
{ "github_metadata": { "branch": "main", "commit_count": 254, "repo_created_at": "2022-09-30T08:13: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": "29281e6a1c...
d8d6aeb4-38ed-4ef1-aa8d-28d88abe26ee
brainy-panda/Algorithms
Graphs/graph.h
#ifndef GRAPH_H #define GRAPH_H #include <list> #include <vector> #include <utility> struct Edge { int to; int weight; }; class Graph { public: Graph(int _vertices); // Creates a graph with _ number of vertices. bool addEdge(int _v1, int _v2, int _weight); // Adds an edge between two vertices. Returns true if i...
ALGO
0.999127
5.90348
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2016-10-19T17:02: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": "f8ee8cd28...
25e79d83-32ae-4b0a-97ed-5957cd0848de
QianMo/GPU-Pro-Books-Source-Code
GPU-Pro-1/06_Handheld Devices/SDK_OGLES2_IPHONE_2.05.25.0804/SDKPackage/Tools/PVRTTrans.cpp
/****************************************************************************** @File PVRTTrans.cpp @Title PVRTTrans @Copyright Copyright (C) Imagination Technologies Limited. @Platform ANSI compatible @Description Set of functions used for 3D transformations and projections. ********...
ALGO
0.998485
6.812905
{ "github_metadata": { "branch": "master", "commit_count": 27, "repo_created_at": "2018-04-25T02:50:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 688, "forks": 349, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "c6247...
a3902e62-44f8-475f-abff-d6c8c5877d15
cuong02n/CodeArena
codeforces/archive/1671/1671B.cpp
#include <bits/stdc++.h> using namespace std; int t=0;//test case const int N = 2e5+10; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cin>>t; while(t--){ int n; cin>>n; int tmp=0; int afirst=0; int alast=0; for(int i=0;i<n;i++){ cin>>tmp; if(i==0){ afirst=tmp; }else if(i==n-1){...
ALGO
0.999372
3.557176
{ "github_metadata": { "branch": "main", "commit_count": 29, "repo_created_at": "2023-02-07T13:48:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1dbfa6e76b4...
37efc81b-3502-4ea9-b853-03e399c62738
ranjeetkumarmrj2005/leetcode-solutions
2469-LongestSubsequenceWithLimitedSum/2469-LongestSubsequenceWithLimitedSum.cpp
// Last updated: 7/4/2025, 1:29:02 PM class Solution { public: vector<int> answerQueries(vector<int>& nums, vector<int>& queries) { int n = nums.size(); int m = queries.size(); // 1 3 7 12 3 10 21 // 2 5 9 14 1 vector<int> v(m); sort(nums.begin(), nums.end());...
ALGO
0.999891
5.863057
{ "github_metadata": { "branch": "main", "commit_count": 139, "repo_created_at": "2025-07-03T13:57: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": "9d4082c39a...
542aacb1-3f1b-4282-823e-9830efedbd43
v0y49e3r/Atcoder
submissions/abc351/b.cpp
#include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<string> A(N), B(N); // Đọc lưới A for (int i = 0; i < N; i++) { cin >> A[i]; } // Đọc lưới B for (int i = 0; i < N; i++) { cin >> B[i]; } // Duyệt qua lướ...
ALGO
0.999903
4.434294
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2025-03-21T09:50: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": "fb26ccfd6821...
d15f2cda-7a28-454d-9189-f5056a086150
alejandratraveria/EstructuraDadesAlgorismes-EDA-FIB
Jutge/ExamenesJutge/ErdosNumber.cc
/* <NAME> was one of the most prolific mathematicians in history. He wrote so many works, and with so many coauthors, that there is the tradition to compute the so called “Erdős number”, defined as follows: Erdős has Erdős number 0. Each of his collaborators has Erdős number 1. Those who collaborated with the direct ...
ALGO
0.999927
4.699782
{ "github_metadata": { "branch": "main", "commit_count": 54, "repo_created_at": "2022-11-26T11:49: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": "aa54a4f99af...
ff110bf9-2b02-415c-a8f0-d7e4fba05738
qmohitsingh/programming-interview-questions
445_AddTwoNumbers_II.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* revers...
ALGO
0.99998
6.258373
{ "github_metadata": { "branch": "master", "commit_count": 75, "repo_created_at": "2020-08-05T15:11:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "90fa8c08a...
693e117a-4a64-40f8-b03d-df59e8556c7d
NirooshKa/CPlusPlus---Project--Circult-Simulator
NodeList(1).cpp
#include "NodeList.h" #include "Node.h" #include <iostream> #include <cmath> #define THRESHOLD_VOLTAGE 0.0001 using namespace std; NodeList::NodeList() : head(NULL) { } NodeList::~NodeList() { /* while (head != NULL) { Node* nodes; nodes = head; head = nodes-> getNext(); ...
ALGO
0.907442
4.437829
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-01-14T04:21:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "37148d2222...
ba15af57-ab91-4030-b4ea-3c5f57050e88
gyu6172/MultimediaProgramming
멀티미디어프로그래밍/기말2022-문제2.cpp
#include <opencv2/opencv.hpp> IplImage* src; IplImage* dst; IplImage* cpy; CvPoint p1, p2; CvPoint lt, rb; void myMouse(int event, int x, int y, int flag, void*) { if (event == CV_EVENT_LBUTTONDOWN) { p1 = cvPoint(x, y); p2 = cvPoint(x, y); cvCopy(dst, cpy); } if (event == CV_EVENT_MOUSEMOVE) { if (flag == ...
ALGO
0.910521
4.902602
{ "github_metadata": { "branch": "master", "commit_count": 165, "repo_created_at": "2023-03-07T06:28:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c88d419d...
adbe997d-9d44-43ab-b7af-9331630328f5
LIMON100/C_plus_plus
all.cpp
#include<iostream> #include<stdio.h> using namespace std; struct node { int data; node* next; }; node* head=NULL; void create(int value) { node* nptr=new node; nptr->data=value; nptr->next=NULL; if(head==NULL) { head=nptr; } else { static node* tptr=head; ...
ALGO
0.999822
3.716997
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-02-01T17:21: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": "69c74d1324...
0f5e155f-5216-4710-8f0a-81b066aa3c10
atfoc/univ-aisp
12_task06/graph.cpp
#include <algorithm> #include <queue> #include "graph.hpp" #include "../util.hpp" namespace with_list_task06 { namespace aisp { graph::graph(int node_number) : edges_(node_number) {} void graph::add_branch(int i, int j) { AISP_ASSERT(i >= 0 && i < number_of_nodes(), "Node is not in range"); AISP_A...
ALGO
0.998247
4.603086
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2018-09-10T11:06: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": "0d81a4bb2...
91d41be8-78fa-4f55-b55e-4607c38b87c0
plantainjuice/leetcode_book
802.find-eventual-safe-states.cpp
/* * @lc app=leetcode id=802 lang=cpp * * [802] Find Eventual Safe States */ // @lc code=start class Solution { public: vector<int> eventualSafeNodes(vector<vector<int>>& graph) { int n = graph.size(); set<int> safe_nodes; // terminal nodes for (int i = 0; i < n; ++i) if (graph[i].size()...
ALGO
0.999931
6.77812
{ "github_metadata": { "branch": "master", "commit_count": 609, "repo_created_at": "2021-02-19T15:08:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "558ac03c...
417c68e0-8686-4268-9fbc-b6a73b246a23
bhavinigoel/Computer-Graphics
LiangBarsky.cpp
#include <graphics.h> #include <stdio.h> // Define clipping window boundaries int x_min = 100, y_min = 100, x_max = 300, y_max = 300; // Liang-Barsky line clipping function void liangBarskyClip(int x1, int y1, int x2, int y2) { float t0 = 0.0, t1 = 1.0; float dx = x2 - x1; float dy = y2 - y1; // P[i]...
ALGO
0.993368
5.302295
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-08-24T08:36: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": "14ee17f3db6d...
a9d54825-1450-4b3c-97e6-5f8a0b11e717
GeorgeBeshay/ProblemSolving
CodeForcesContests/R855_D3/PA_IsItACat.cpp
/* * Created By George on 3/2/23. */ /* * Problem Link: https://codeforces.com/contest/1800/problem/A * Problem Status: Accepted. */ #include <iostream> #include <map> #include <vector> #include <algorithm> #include <cmath> #include <set> using namespace std; typedef long long ll; typedef v...
ALGO
0.999838
5.160685
{ "github_metadata": { "branch": "main", "commit_count": 717, "repo_created_at": "2022-05-17T22:34:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8c96bf54dc...
30f21d1b-910b-4456-8be8-bfbbd8902376
root-project/root
math/mathmore/test/testGSLRootFinder.cxx
#include "Math/Polynomial.h" #include "Math/Functor.h" #include "Math/RootFinder.h" #include "Math/RootFinderAlgorithms.h" #ifdef HAVE_ROOTLIBS #include "TStopwatch.h" #else struct TStopwatch { void Start(){} void Stop(){} void Reset(){} double RealTime() { return 0; } double CpuTime() { return 0; } }; ...
TEST
0.94758
5.567189
{ "github_metadata": { "branch": "master", "commit_count": 93033, "repo_created_at": "2013-06-27T10:46:59.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2899, "forks": 1363, "issues": 467, "pull_requests": 269 }, "file_meta": { "content_id"...
e4ae284f-d3a9-4141-ae35-314a80ce6df4
phoneixcoder/Coding-Practice
OOPs/main.cpp
#include <iostream> using namespace std; //Structure declaration and defination struct Student { int rollNo; char name[40]; int m1, m2, m3; float percentage; char grade; }; typedef struct Student Student; //Prototype or declaration void getData(Student[], int n); void showData(Student[], int n); ...
TOOL
0.916234
3.519623
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2021-08-15T05:21:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e4bbf27f27...
49515589-b845-4b47-8845-a9ee030df6d2
takefekat/Competitive-programming
AtCoder/abc265/B/santo.cc
#include<stdio.h> #include <iostream> #include <vector> using namespace std; int main(void){ long long N,M,j=0; long long T; char FailFlag = 0; // char: 文字、 unsigned char: 1byte符号なし整数、signed char: 1byte 符号あり整数 long long tmp; std::vector<long long> ComsumeTime; std::vector<long long> BonusRoomNu...
ALGO
0.999938
3.224139
{ "github_metadata": { "branch": "master", "commit_count": 69, "repo_created_at": "2020-06-17T12:48:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "af1ab69a9...
8b1d1cd9-93e8-4438-bbd2-d60b2e4aa984
Pokloskaya/Coding-Exercices
cp/Round#666 (Div. 4)/Increasing.cpp
// https://codeforces.com/contest/1742/problem/B #include <bits/stdc++.h> using namespace std; int main() { int t, n1, n2, n3, n4; cin>>t; //test cases -> vec.push_back("YES"); vector<string> vec; while(t--) { vector<int> vecint; cin>>n1; for(int i = 0; i < n1; i++){ cin>>n2; vecint...
ALGO
0.999767
4.062339
{ "github_metadata": { "branch": "main", "commit_count": 83, "repo_created_at": "2022-09-23T03:08: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": "45f9a930eba...
485683c8-ee86-41c4-8367-45ac2c421ce2
ishandutta2007/codeforces-b
brovko/normal/660/A.cpp
#include <bits/stdc++.h> #define int long long #define ld long double #define y1 eohfweoifhew #define y0 wepfjwewpjfef using namespace std; int n, a[1005]; int gcd(int x, int y) { if(x == 0) return y; return gcd(y % x, x); } int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cou...
ALGO
0.99995
3.405909
{ "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": "67dcd8fd21b0...
26c7df60-07f0-41e5-b0fa-446f8aa4764d
amanhex/SDE-Sheet
Binary Search/Matrix Median/Optimal Approach/median(Optimal).cpp
#include <bits/stdc++.h> using namespace std; int upperBound(vector<int>& arr, int x, int m){ int low = 0, high = m - 1; int ans = m; while (low <= high){ int mid = low + (high - low) / 2; if (arr[mid] > x){ ans = mid; high = mid - 1; } else low = mid + 1; } return ans; } ...
ALGO
0.99999
4.385386
{ "github_metadata": { "branch": "main", "commit_count": 222, "repo_created_at": "2023-07-15T11:44: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": "b626a71c4d...
a2e600fb-f05f-4d2e-a190-a7b4ea2a91c4
mclumd/mcl_old
mcl-core-gglue/topSort.cc
#include "topSort.h" #include "mclNode.h" #include "mclExceptions.h" #include "links.h" bool movable(vector<mclNode*>&, int pivot, int index); bool topsort::topSort(vector<mclNode*>& invec) { int pivot=0; mclNode* tmp; while (pivot < invec.size()) { bool prog=false; for (int i=pivot; i < invec.size...
ALGO
0.999611
5.153564
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2018-12-23T18:44:42.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e685fc64498...
8bda8e03-f2ad-4876-a6b7-6da3ca7fe0ee
data61/MP-SPDZ
Tools/MMO.hpp
/* * MMO.cpp * * */ #include "MMO.h" #include "Math/gfp.hpp" #include <unistd.h> inline void MMO::zeroIV() { if (N_KEYS > (1 << 8)) throw not_implemented(); for (int i = 0; i < N_KEYS; i++) { octet key[AES_BLK_SIZE]; memset(key, 0, AES_BLK_SIZE * sizeof(octet)); key[0]...
ALGO
0.968479
4.624145
{ "github_metadata": { "branch": "master", "commit_count": 926, "repo_created_at": "2018-10-11T01:16:16.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1050, "forks": 323, "issues": 10, "pull_requests": 3 }, "file_meta": { "content_id": "a8b...
214146f2-a3d4-4976-85af-6506361d2400
autowarefoundation/autoware_universe
perception/autoware_traffic_light_arbiter/src/signal_match_validator.cpp
// Copyright 2024 The Autoware Contributors // // 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...
TOOL
0.944705
5.039289
{ "github_metadata": { "branch": "main", "commit_count": 8531, "repo_created_at": "2021-11-19T02:59:37.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1208, "forks": 763, "issues": 216, "pull_requests": 161 }, "file_meta": { "content_id": "7...
accbaf21-5cc0-4104-bd7d-b99ea54663ce
BoscoWarhammer/Doutorado
Fluid_profiler_RK4.cpp
/************************************************************************************************** Runge-Kutta of 4th order to solve equations **************************************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <math.h> const double...
ALGO
0.999959
4.027354
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2016-05-12T17:28:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "6bce9109a...
7e139f1b-5d1a-4abd-98ce-a89fd1ee1d01
Vincent-Liu87/CG_labs
parametric_shapes.cpp
#include "parametric_shapes.hpp" #include "core/Log.h" #include <glm/glm.hpp> #include <array> #include <cassert> #include <cmath> #include <iostream> #include <vector> bonobo::mesh_data parametric_shapes::createQuad(float const width, float const height, unsigned int const horizontal_split_count, unsigned int con...
ALGO
0.922238
5.745704
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2021-10-14T09:43: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": "92798f3dbc6...
5ab34d2c-9443-4bfe-a5e0-4d02d0bc2434
rijuyuezhu/XCPC-code
OI-time_Problems/数据结构/可持久化专题/题目/P3567 [POI2014]KUR-Couriers/code.cpp
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; typedef long long ll; char In[1 << 20], *ss = In, *tt = In; #define getchar() (ss == tt && (tt = (ss = In) + fread(In, 1, 1 << 20, stdin), ss == tt) ? EOF : *ss++) ll read() { ll x = 0, f = 1; char ch = getchar(); for(; ch < '0' || ch > '9'; ...
ALGO
0.99999
4.215305
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2023-03-05T03: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": "f8fadc847...
cae3dcfe-a578-4023-9d41-6e493a0597ff
dbarenholz/kattis
src/freefood/freefood.cpp
#include <bits/stdc++.h> using namespace std; template <typename A, typename B> ostream &operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; } template <typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::...
ALGO
0.998961
3.953052
{ "github_metadata": { "branch": "main", "commit_count": 271, "repo_created_at": "2022-02-05T20:45:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8a5d3210ac...
6662e725-6800-42ca-83de-b958d9573550
IRVING-L/JZoffer_code
剑指offer刷题/Chapter-11/code073.cpp
#include <cmath> #include <string> #include <unordered_map> #include <unordered_set> #include <set> #include <map> #include <stack> #include <queue> #include <random> #include <algorithm> using namespace std; class Solution { private: int getHours(vector<int> &piles, int speed) { int h = 0; for...
ALGO
0.999968
5.031954
{ "github_metadata": { "branch": "main", "commit_count": 49, "repo_created_at": "2021-10-15T07:51:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "52f076fe42d...
f09b02d0-d3de-443c-8a2c-90c7451a413e
Segrey1989/C_STEP_tasks
Binary_Tree/Binary_Tree/Tree.cpp
#include "Header.h" #include "Node.cpp" template <class T> class BinTree{ Node<T> *root; size_t size; void del(Node<T> *); Node<T>* add(Node<T> *, const T &); void min_print(Node<T>*); bool min_search(Node<T>*, const T &); Node<T> *getTreeNode(Node<T>* node, const T &); void print...
ALGO
0.999465
3.927953
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-10-06T21:46: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": "77e62a107c...
dbf3bfd1-36e4-4ddc-b3e0-0907612d4915
slam-code/cartographer
mapping_3d/optimizing_local_trajectory_builder.cc
/* * Copyright 2016 The Cartographer 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.995169
5.457017
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2017-07-05T13:18:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 334, "forks": 158, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "35945...
abb31204-031c-44a2-b68c-c8837e507683
thavananh/OnThiCodeCTDL
OnThiCodeCTDL/ctdl_copy_1.h
#include <iostream> using namespace std; int linearSearch_timkiemtuyentinh(int a[], int n, int key) { // for (size_t i = 0; i < n; i++) // { // if (a[i] == key) // { // return i; // } // } // int i = 0; // while (i < n) // { // if (a[i] == key) ...
ALGO
0.999886
3.718095
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2024-01-02T10:44: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": "8e369f66c...
fe5a24cc-9975-4f43-842e-84896c6999d0
ishandutta2007/codeforces-p
plasmatic/normal/1088/E.cpp
// ./e-ehab-and-a-component-choosing-problem.yml #include "bits/stdc++.h" using namespace std; // Defines #define fs first #define sn second #define pb push_back #define eb emplace_back #define mpr make_pair #define mtp make_tuple #define all(x) (x).begin(), (x).end() // Basic type definitions using ll = long long; us...
ALGO
0.999668
3.984232
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:49:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a2a28483c07e...
e32b52b3-797e-4259-92f7-3e25a667cd7b
jorking/acm_backup
src/ZOJ/ZOJ3090 POJ3497 HDU2333 Assemble.cpp
#ifdef _MSC_VER #define DEBUG #define _CRT_SECURE_NO_DEPRECATE #endif #include <fstream> #include <stdio.h> #include <iostream> #include <string.h> #include <string> #include <limits.h> #include <algorithm> #include <math.h> #include <numeric> #include <functional> #include <ctype.h> #define MAX 1010 using namespace s...
ALGO
0.999926
3.528698
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2017-11-11T08:13:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "733d2d7579...
5b0a49b9-819b-4a42-8d37-19dff8b554e8
bodasadallah/problem-solving
codeforces/Xenia and Tree/main.cpp
#include <iostream> #include"bits/stdc++.h" using namespace std; const int N = 1e5+1; int n,m; int depth[N]; vector<int> g[N]; bool red[N]; int dp[N][17]; int cost[N]; vector <int> cur; queue<int>q; void bfs(){ memset(cost,-1,sizeof cost); for(int i=0;i<n;++i){ if(red[i]){ cost[i] = 0...
ALGO
0.999946
3.742404
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2022-06-27T16:43: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": "bece42e461e...
61b5dc10-a9f9-460f-b676-c091f871df79
ESHUshri202/Coding-blocks
35. Aggressive Cows/agg.cpp
#include<bits/stdc++.h> using namespace std; bool isPossible(int arr[],int n,int k,int mid){ int painter = 1; int white = 0; for(int i = 0 ; i<n;i++){ if(white + arr[i] <=mid){ white += arr[i]; } else{ painter++; if(painter>k || arr[i] > mid){ ...
ALGO
0.999985
4.394245
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2023-07-14T07:37: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": "a1a6ad422dc7...
1e3847fc-7a09-4379-810f-90c52f5c3c7c
arush077/dsa_new_notes
graphs/0.IMP/ALL ALGO (IMPORTANT REVISE)/ REVISE/topological sort/course schedule.cpp
https://leetcode.com/problems/course-schedule/solutions/?envType=study-plan-v2&envId=top-interview-150 //! Simplem basic standard Topo Sort lagana he [1,0] matlab 0 comes before 1 so edges wala jo array given he usme [1,0] === 0-->1 so adj[s].push_back(f) matlabm adj[0].push_back(1) or 0-->1 int nodes=numCourses; ...
ALGO
0.999865
5.970092
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2023-09-04T07:36: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": "b39ed17e796...