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
ed97908e-56b5-4eb5-87c9-3d26858a558c
hieuhm-0680/dsa_khong_kho
data_structures/binary_search_tree/wecode_solution/07_TaoCayBFS.cpp
#include <iostream> #include <queue> using namespace std; struct TNODE { int key; TNODE *pLeft; TNODE *pRight; }; typedef TNODE *TREE; /* ---------------------------------------------- */ TNODE *CreateNode(int value) { TNODE *newNode = new TNODE; newNode->key = value; newNode->pLeft = newNode-...
ALGO
0.999952
4.273126
{ "github_metadata": { "branch": "main", "commit_count": 61, "repo_created_at": "2023-05-03T10:12: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": "68b328aeb4a...
46e93523-fe6f-4001-b1fe-16670812bd3e
azriirfan/Consultancy-Registration
Consultancy Registration.cpp
#include <iostream> using namespace std; double calcFee(int coursecode, int numPeople) { double totalFee = 0.0; switch(coursecode) { case 1: totalFee = numPeople * 150.0; break; case 2: totalFee = numPeople * 200.0; break; case 3: ...
TOOL
0.98781
4.159529
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-05-08T14:13: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": "fe2d9cee19db...
ae169d3a-d159-4023-a612-6aa6835eac29
prakashsingh46/CodeForces_Questions
B_Find_the_Permutation.cpp
#include<bits/stdc++.h> #define pp pair<int, int> #define ll long long #define sort2D(arr,cmp) sort(arr.begin() , arr.end(),cmp) #define sort(arr) sort(arr.begin() , arr.end()) #define vi vector<int> #define vll vector<long long> #define fori(n) for(int i=0;i<n;i++) #define forl(n) for(long long i=0;i<n;i++) using name...
ALGO
0.999995
4.694555
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-01-20T17:53: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": "c946780b433f...
8eee5549-d9ab-4d85-9b9c-961228ba138c
Wartori54/aoc2024
day14/main.cpp
#include <cmath> #include <iostream> #include <fstream> #include <numeric> #include <vector> using namespace std; void part1() { bool real = true; ifstream input(!real ? "../day14/test.txt" : "../day14/input.txt"); const int width = !real ? 11 : 101; const int height = !real ? 7 : 103; int tlq = 0...
ALGO
0.999833
4.826213
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2025-07-13T15:22: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": "4a9b338712...
490bbb20-74ea-4bde-b59a-974e8b235813
Cabt1995/CompuGrafica
main5 en adelante/practica7.cpp
//Semestre 2017 - 2 //************************************************************// //************************************************************// //************** Alumno (s): <NAME>****// //************* Practica: 7 ******// //************* Version de visual estudio: 2017 ******// //******************...
ALGO
0.947557
4.002151
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2018-08-15T17:22: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": "0c2e28d68...
d344e2ac-9a06-4a83-8f06-dcc4adfd23a4
AmanGarg97/June-LeetCode-Challenge
Day10.cpp
// Question - Search Insert Position /* Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You may assume no duplicates in the array. Example 1: Input: [1,3,5,6], 5 Output: 2 Example 2: Input: [1,3,5,6], 2 Out...
ALGO
0.999995
6.49112
{ "github_metadata": { "branch": "master", "commit_count": 30, "repo_created_at": "2020-06-01T15:07: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": "fc58fc40e...
0ef5790b-b0c1-475a-ab48-fe65b56e4a6f
raishiv/BinaryTree-and-Quad-tree-implementation
BinaryTreeNew/Bst.cpp
// // Bst.cpp // BinaryTreeNew // // Created by <NAME> on 11/8/14. // Copyright (c) 2014 <NAME>. All rights reserved. // #include "Bst.h" #include <stddef.h> #include <iostream> #include <cstring> #include <string> using namespace std; //constructor Bst::Bst(void){ root_node = NULL; } //create a new Internal...
ALGO
0.999744
3.047612
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2015-02-08T06:24: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": "2ea7390371...
2bdf71e3-6cb8-4e80-90c2-c23c5470382e
GATB/gatb-core
gatb-core/src/gatb/tools/math/FastMinimizer.hpp
/***************************************************************************** * GATB : Genome Assembly Tool Box * Copyright (C) 2014 INRIA * Authors: R.Chikhi, G.Rizk, E.Drezen * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public ...
ALGO
0.999834
4.392673
{ "github_metadata": { "branch": "master", "commit_count": 2423, "repo_created_at": "2014-12-25T15:35:42.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 63, "forks": 27, "issues": 11, "pull_requests": 1 }, "file_meta": { "content_id": "8df53...
e0a83f00-fd2e-4b53-b7cc-962d3b249e5e
YatishPachigolla/C-PlusPlus-Practice-Codes
Section6sizeof/main.cpp
#include<iostream> #include<climits> #include<limits.h> using namespace std; int main(){ cout << "######### INT ###########" << endl; cout << INT_MAX << endl; cout << INT_MIN << endl; cout << "The size of int is "<< sizeof(int) << " byte(s)" << endl; cout << "######### UNSIGNED INT #######...
TOOL
0.939503
3.194789
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2023-10-25T15:40: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": "a8e2cd2200...
e45610fa-ac58-4805-8ee4-e303a4b6c995
anushka1853/striverrr
Test questions/testQ.cpp
#include <iostream> #include <vector> #include <cmath> #include <unordered_map> #include <map> #include <stack> #include <string.h> #include <algorithm> using namespace std; int main(){ // string s = "x4z2o5"; // string s = "a1b1c"; // string s = "m10n0p5"; string s = "3x4y5z"; // first lette...
ALGO
0.99561
3.566191
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2024-08-23T16:05:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b02d7aa4bf23...
92228fee-cfad-454b-9995-0afa0c3aebcc
klb3713/aoapc-book
TrainingGuide/bookcodes/ch5/uva11248.cpp
// UVa11248 Frequency Hopping:使用ISAP算法,加优化 // <NAME> #include<cstdio> #include<cstring> #include<queue> #include<vector> #include<algorithm> using namespace std; const int maxn = 100 + 10; const int INF = 1000000000; struct Edge { int from, to, cap, flow; }; bool operator < (const Edge& a, const Edge& b) { retur...
ALGO
0.999928
3.829657
{ "github_metadata": { "branch": "master", "commit_count": 198, "repo_created_at": "2013-09-22T01:26:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 181, "forks": 56, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "be883...
81f3dce4-d8f7-4240-82a4-0172ef3621b0
watashi/AlgoSolution
zoj/27/2709.cpp
#include <utility> // auto fix CE #include <map> #include <utility> // auto fix CE #include <queue> #include <utility> // auto fix CE #include <cstdio> #include <utility> // auto fix CE #include <vector> #include <utility> // auto fix CE #include <numeric> #include <utility> // auto fix CE #include <algorithm> using n...
ALGO
0.999932
3.559405
{ "github_metadata": { "branch": "master", "commit_count": 522, "repo_created_at": "2011-10-06T10:40:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 204, "forks": 61, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3b924...
8d483a38-6d8e-4ea4-8c95-c2cdd8592633
Omar-Hassan-37/Algorithms
Audiophobia/main.cpp
#include <iostream> #include "input_handeller.h" #include "Edge.h" #include "Query.h" template <class T> void printVector(const std::vector<T> &); bool terminateCase(const std::vector<int> &); std::vector<int> solveQueries(const std::vector<int> &, const std::vector<Edge> &, const std::vector<Query> &); int main() { ...
ALGO
0.999632
4.765859
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-06-17T17:08: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": "360ff863d523...
b64ada1d-4444-45d4-9594-fe9da74390d6
nhphucqt/Algorita
libs/graphic/objects/GraphicCircularLinkedList.cpp
#include "GraphicCircularLinkedList.h" GraphicCircularLinkedList::GraphicCircularLinkedList() { pHead = nullptr; _size = 0; } void GraphicCircularLinkedList::resetColorAllNodes() { GraphicSinglyNode* curr = pHead; if (curr != nullptr) do { curr->resetColor(); curr->aNext.resetColor(); ...
TOOL
0.989896
5.586222
{ "github_metadata": { "branch": "main", "commit_count": 396, "repo_created_at": "2023-02-28T15:28:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "15f1814c35...
98847eac-0ad1-4e21-96b0-3fe1b39f5c36
wentingzz/Practices
LeetCode/1319. Number of Operations to Make Network Connected.cpp
class BetterSolution { public: int findParent(int n, int parents[]){ if(parents[n] != n){ parents[n] = findParent(parents[n], parents); } return parents[n]; } int makeConnected(int n, vector<vector<int>>& connections) { int m = connections.size(); ...
ALGO
0.999928
5.377568
{ "github_metadata": { "branch": "master", "commit_count": 484, "repo_created_at": "2019-09-24T18:52:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 5, "pull_requests": 0 }, "file_meta": { "content_id": "ae1a4a74...
63c03586-7769-49b8-b57e-b3974a7fd940
wisdom-yzh/basic-training
src/mean-of-array-after-removing-some-elements.cc
#include <vector> #include <iostream> #include <sstream> #include <algorithm> using namespace std; class Solution { public: double trimMean(vector<int>& arr) { std::sort(arr.begin(), arr.end()); int begin = arr.size() * 0.05; int size = arr.size() * 0.9; int sum = 0; for (i...
ALGO
0.998911
5.52653
{ "github_metadata": { "branch": "master", "commit_count": 424, "repo_created_at": "2018-07-25T15:59:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3d9d18c0...
b4392c45-945b-4278-8165-c9794ffc110b
Nyatl/acm-archive
snws 2018/round 3/a_nyatl.cpp
#define _CRT_SECURE_NO_DEPRECATE #include <string> #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <queue> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <ioman...
ALGO
0.999942
4.226624
{ "github_metadata": { "branch": "master", "commit_count": 125, "repo_created_at": "2017-10-09T20:13:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "99e564dd...
1f71c191-385f-4988-a495-631707762b83
anvvalade/AMS302
Deterministe/fe1D_solver.hpp
#ifndef FE1D_PROBLEM_HEADER #define FE1D_PROBLEM_HEADER #include <Eigen/Eigen> #include <iostream> #include <iomanip> #include "utils.hpp" using namespace Eigen; using namespace std; void my_print(const MatrixXd& A) { for (int i=0; i<A.rows(); i++) { for (int j=0; j<A.cols(); j++) cout << setw(12) << setpre...
ALGO
0.996827
4.490276
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2017-10-16T10:15:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3240097c6...
b38d4912-7419-46fc-8e53-59305d565f2d
vilesport/OOP_lab
Lab4/BT3/BT3.cpp
#include "Cuu.h" #include "Bo.h" #include "De.h" #include "GiaSuc.h" string Con[3] = { "bo", "cuu", "de" }; GiaSuc* TrangTrai[3]; long long Keu[3]; /** * @brief Tinh toan va phat ra tieng keu ngau nhien cua gia suc trong trang trai. * * Chuong trinh se chon ngau nhien cac loai gia suc co so luong lon hon 0 * va p...
ALGO
0.974137
3.900531
{ "github_metadata": { "branch": "main", "commit_count": 54, "repo_created_at": "2024-10-12T10:20: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": "11bbe0bbeed...
a090b73f-f5ae-4c77-9a9a-bfb893a61ae2
MdFaizan7397/Strivers-SDE-Sheet-challenge
169-majority-element/169-majority-element.cpp
//BRUTE FORCE /*class Solution { public: int majorityElement(vector<int>& nums) { int temp = nums.size()/2; for (int i=0;i<nums.size();i++) { int count = 0; for (int j=0;j<nums.size();j++) { if (nums[j] == nums[i]) { count += 1; ...
ALGO
0.999985
5.326786
{ "github_metadata": { "branch": "main", "commit_count": 756, "repo_created_at": "2022-06-09T05:07:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f57941ab4f...
91c203e8-fe2f-4c5a-a44c-54d3c814baab
Aadij724/Dsa
Binary Search Tree/fixBST.cpp
#include<iostream> using namespace std; class Node { public: int key; Node* left; Node* right; Node( int x ) { key=x; left=NULL; right=NULL; } }; void inorderTraversal( Node* root ) { if( root!=NULL ) { inorderTraversal( root->left ); ...
ALGO
0.999967
4.669092
{ "github_metadata": { "branch": "main", "commit_count": 26, "repo_created_at": "2023-01-22T06:56:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c45063ff821...
c0d781eb-c158-420f-bf7d-07d5ea23479e
macf2/project4
sorting-algorithms/radixSort.h
#ifndef RADIXSORT_H #define RADIXSORT_H #include "printVec.h" #include <cmath> // Note: Not a template function vector<int> radixSort(vector<int> vec, int numDigits, unsigned long &reads, unsigned long &allocations) { reads = allocations = 0; int iteration, i, digit, bucket, item...
ALGO
0.999697
5.972189
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-11-04T14:48: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": "605d1f594de9...
46313988-da8d-4932-91ad-8696769fe04d
dlehdwns1011/OOP-Project
2차 Assignment/Assignment2_3/Assignment2_3/Assignment2_3.cpp
#include <iostream> #include <cstring> using namespace std; void biggerIsGreater(char* input, char* output); void Ascending(int *arr, int n, int a); //declare function int main() {//start main char str[10]; //declare for input string char result[10] = "\0";//declare for output string cout << "Input the string : ...
ALGO
0.999858
3.806847
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2021-03-14T04:11: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": "0fb999ac0830...
878bd474-99fb-4ac1-a1ec-2f71994860a4
swapnil2911/OS-Simulator
OS/worstfit_mft.h
//Worst fit memory management in fixed partitioning #include<bits/stdc++.h> using namespace std; int max_frag; void insert_worstfit(struct process p,struct block b[],int m){ max_frag=INT_MIN; int id; for(j=0;j<m;j++){ if(p.p_size <= b[j].b_size && b[j].b_flag == 0 && max_frag < (b[j].b_size - p.p_size)){ max...
ALGO
0.997327
3.587354
{ "github_metadata": { "branch": "main", "commit_count": 43, "repo_created_at": "2021-04-22T05:04:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "31921e6ef19...
1b373534-d702-41fd-bdd8-b022a1a5ddaa
Argus-66/DSA
1_Basics/6_Hashing/4_q2.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int #define test ll t; cin>>t; while(t--) #define ld long double #define tolower(s1) transform(s1.begin(), s1.end(), s1.begin(), ::tolower) #define toupper(s1) tr...
ALGO
0.999876
4.857523
{ "github_metadata": { "branch": "main", "commit_count": 52, "repo_created_at": "2025-02-09T01:38: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": "707bc388faa...
0672f0d6-f732-4d59-8098-b2f849377d53
RoelofBerg/QuantFinCode
Include/MCAmerican.hpp
/** \file MCAmerican.hpp \brief Header file declaring classes for Monte Carlo simulation of options with early exercise features. Copyright 2010 by <NAME> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are ...
ALGO
0.934184
7.025057
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2016-06-26T21:50: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": "24a8fb46a0...
a29d9aad-c175-48b9-934c-38f551002afe
kimbochen/programming_practice
lucky_dip.cpp
#include <algorithm> #include <iostream> #include <sstream> #include <vector> using namespace std; using ull = unsigned long long; double probB(void); double suffixSum(vector<int>&,int,int); int searchMin(vector<int>&,int,int,double); int main(void) { int T; stringstream ss; cin >> T; for (int i...
ALGO
0.999747
4.282578
{ "github_metadata": { "branch": "master", "commit_count": 31, "repo_created_at": "2019-04-05T12:46: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": "e493430c6...
a5c4e11e-d394-4b54-b339-029a50a03ee2
antiphon/Kdirectional
src/directed_geom.cpp
#include <Rcpp.h> #include <vector> #include "helpers.h" using namespace Rcpp; //#define PI (3.141592653589793) //double min(double, double); // [[Rcpp::export]] List c_directed_geom(NumericMatrix x, NumericVector u, double theta, double r, IntegerVector from, IntegerVector to) { int i, j, l, f, t; int n =...
ALGO
0.999505
5.495063
{ "github_metadata": { "branch": "master", "commit_count": 81, "repo_created_at": "2015-06-10T07:59:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b19655619...
dc158a0a-68f0-409c-abd8-ee41d909e0dc
liuyubobobo/Play-Leetcode
2001-2500/2147-Number-of-Ways-to-Divide-a-Long-Corridor/cpp-2147/main.cpp
/// Source : https://leetcode.com/problems/number-of-ways-to-divide-a-long-corridor/ /// Author : liuyubobobo /// Time : 2022-01-22 #include <iostream> #include <vector> using namespace std; /// Mathematics /// Time Complexity: O(nlogn) /// Space Complexity: O(n) class Solution { private: const long long MOD...
ALGO
0.999964
5.317038
{ "github_metadata": { "branch": "master", "commit_count": 2592, "repo_created_at": "2016-12-01T17:08:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2732, "forks": 718, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "29...
20aff89e-2f6b-48f5-aa94-19067c84729d
AlexMaximenko/sem_2
contest2_task_A.cpp
#include<iostream> #include<vector> #include<math.h> #include<algorithm> class SparseTable { public: SparseTable(const std::vector<int>& elements) { int x_size = log(elements.size()) / log(2) + 1; table = std::vector<std::vector<int>>(x_size, std::vector<int>(elements.size())); for (int i = 0; i < elements.size...
ALGO
0.999969
3.477447
{ "github_metadata": { "branch": "master", "commit_count": 155, "repo_created_at": "2019-09-13T16:51: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": "9c964bb3...
f68b653f-0930-487d-bda9-144b06346745
Shivesh-K/CompetitiveCoding
G_Levenshtein_distance.cpp
#include <bits/stdc++.h> using namespace std; #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b)) #define gcd(a, b) __gcd(a, b) #define lcm(a, b) (a * b) / gcd(a, b) #define GOLD ((1 + sqrt(5)) / 2) #define ll long long const double PI = 3.141592653589793238462643383279502884197169399375...
ALGO
0.999987
4.401116
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2021-01-06T14:09:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cf737da67...
8bdbc7c1-6b92-4834-a0df-e4f980df1cc8
Jajajou/CodeLearningProcess
ATCODER_DP/Y/grid2.cpp
/* __ (\_/) ._( .)<(MEOW) (WOOF)('V') \____) (U U) */ #include <bits/stdc++.h> using namespace std; #define name "grid2" //pls dont forget your task's name #define maxn int(2e5) + 25 #define elif else if #define pri_q priority_queue #define pf push_front #define pb push_back #define pop...
ALGO
0.999987
4.440095
{ "github_metadata": { "branch": "master", "commit_count": 157, "repo_created_at": "2021-06-24T17:36:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e3eeeb7b...
59f4f0e8-59ec-442b-8e64-781a6065fca3
Typejunjie/C-Algorithm
Stack/shareStack.h
#include <iostream> #include <stdio.h> using namespace std; // 共享栈 struct shareStack { int data[20]; int S1top, S2top, volume = 20; }; void initalShareStack(shareStack &S) { S.S1top = 0; S.S2top = S.volume - 1; } void pushShareStack(shareStack &S, int diraction, int key) { if (S.S1top > S.S2top)...
ALGO
0.998868
3.303436
{ "github_metadata": { "branch": "main", "commit_count": 44, "repo_created_at": "2022-07-01T11:51: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": "863d19f12a1...
0db9147e-4e72-409e-8835-fca99a367b33
Kiids/OJ_Practice
移动石子直到连续 II.cpp
/* 在一个长度 无限 的数轴上,第 i 颗石子的位置为 stones[i]。如果一颗石子的位置最小/最大,那么该石子被称作 端点石子 。 每个回合,你可以将一颗端点石子拿起并移动到一个未占用的位置,使得该石子不再是一颗端点石子。 值得注意的是,如果石子像 stones = [1,2,5] 这样,你将 无法 移动位于位置 5 的端点石子,因为无论将它移动到任何位置(例如 0 或 3),该石子都仍然会是端点石子。 当你无法进行任何移动时,即,这些石子的位置连续时,游戏结束。 要使游戏结束,你可以执行的最小和最大移动次数分别是多少? 以长度为 2 的数组形式返回答案:answer = [minimum_moves, maximum_mo...
ALGO
0.999902
5.662167
{ "github_metadata": { "branch": "master", "commit_count": 1531, "repo_created_at": "2019-10-23T13:47: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": "fbd3a77...
1f12c79a-5e81-4a2b-a3c3-a556e8b8e302
vNaonLu/leetcode-daily
src/q_2351_2400/q2368.cc
// Copyright 2023 <NAME> // // This file describes the solution of // Reachable Nodes With Restrictions // // https://leetcode.com/problems/reachable-nodes-with-restrictions/ // // Question ID: 2368 // Difficult : Medium // Solve Date : 2022/10/21 21:32 #include <iosfwd> #include <queue> #include <set> #include <unor...
ALGO
0.999688
6.737319
{ "github_metadata": { "branch": "main", "commit_count": 2477, "repo_created_at": "2021-09-06T15:30:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "524dbf068...
b87a8ce9-cee3-4f3c-8dba-dba2ea41f151
AndersonKao/CP_Problems
TimousOJ/1837.cpp
// AC #include <iostream> #include <map> #include <string> #include <vector> #include <queue> #include <algorithm> using namespace std; //#define DB map<string, int> M; vector<vector<int>> Graph; int dis[1005] = {0}; bool visited[1005] = {false}; vector<string> strs; int main(){ int N; cin >> N; Graph.resi...
ALGO
0.999736
3.419842
{ "github_metadata": { "branch": "master", "commit_count": 244, "repo_created_at": "2022-01-23T04:16:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0c7a9c3a...
6dbecaee-63a8-479d-933b-309d2d800eed
gzshawnliang/competitive-programming
myCpps/ferryLoading-II_UVA10440OJ.cpp
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <fstream> #include <iomanip> #include <iostream> #include <set> #include <string> #include <vector> using namespace std; int main() { ios_base::sync_with_stdio(false); std::cin.tie(NULL); int testCase; cin >> testCase; ...
ALGO
0.99997
3.199331
{ "github_metadata": { "branch": "master", "commit_count": 1963, "repo_created_at": "2019-01-17T06:33:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "34961a2...
7c19e34e-6dda-4aae-acc4-081e61d4805c
math715/arts
leetcode/leetcode_355.cc
#include <vector> #include <iostream> using namespace std; int superPow(int a, vector<int>& b) { if (b.size() == 1) { int res = 1; for (int i = 0; i < b[0]; ++i) { res *= a % 1337; res = res % 1337; } return res; } vector<int> left; int r = 0; int frist = 0; for (int i = 0; i < b.size(); ++i) { in...
ALGO
0.999803
5.087718
{ "github_metadata": { "branch": "master", "commit_count": 63, "repo_created_at": "2018-07-24T13:36: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": "9194e6724...
5a893ba4-5e85-4364-ab4a-933aec73cda1
ishandutta2007/codeforces-x
xuanquang1999/normal/766/E.cpp
//84104971101048411497 - Can you guess what does this mean? using namespace std; #include <bits/stdc++.h> #define mapii map<int, int> #define debug(a) cout << #a << ": " << a << endl #define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl #define fdto(i, r, l) for(int i = (r); i >= (l); --i) #define ft...
ALGO
0.999501
4.025079
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:38: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": "a2718f3cb578...
9d388071-bddd-4143-b235-1f5dff80ec7a
google/monster-mash
third_party/miscutils/camera.cpp
// Copyright (c) 2018 <NAME> // Licensed under the MIT License. #include "camera.h" #include "macros.h" #include <igl/frustum.h> #include <igl/ortho.h> using namespace Eigen; static Matrix4d createFrustumMatrix(bool ortho, float width, float height, float near, float far) { float l = -0.5*width; // left float r ...
ALGO
0.996326
6.90411
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2021-01-28T21:04:52.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1312, "forks": 182, "issues": 24, "pull_requests": 0 }, "file_meta": { "content_id": "1b7517...
2bc3db06-4c84-4f81-a261-939b709bc1cd
liuyubobobo/Play-Leetcode
2001-2500/2488-Count-Subarrays-With-Median-K/cpp-2488/main.cpp
/// Source : https://leetcode.com/problems/count-subarrays-with-median-k/ /// Author : liuyubobobo /// Time : 2022-12-18 #include <iostream> #include <vector> #include <map> #include <numeric> using namespace std; /// Median Classic /// Time Complexity: O(n) /// Space Complexity: O(n) class Solution { public: ...
ALGO
0.999987
5.969389
{ "github_metadata": { "branch": "master", "commit_count": 2592, "repo_created_at": "2016-12-01T17:08:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2732, "forks": 718, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "a6...
c3e4df84-b0f2-4064-9977-6a4e8c9b0410
Shakti184/LEETCODE
Medium/Reverse a Linked List in groups of given size/reverse-a-linked-list-in-groups-of-given-size.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; struct node { int data; struct node* next; node(int x){ data = x; next = NULL; } }; /* Function to print linked list */ void printList(struct node *node) { while (node != NULL) { printf("%d "...
ALGO
0.999929
5.575555
{ "github_metadata": { "branch": "main", "commit_count": 846, "repo_created_at": "2022-10-21T04:31: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": "5b120712a0...
2586d936-242b-48e0-a2a9-bba70c6f5efa
ThiagoMassenoMaciel/Projetos_Feitos_Na_Faculdade.github.io
POO TabelaCampeonatoBrasileiro/files/src/More Files Day 16 nov/TabelaCampeonato com Partidas.cpp
#include<stdio.h> #include<stdlib.h> #include<locale.h> #include<string.h> #include<windows.h> #define ColunasTabela 8 /* Colunas GolsPro 4 GolsSofridos 5 Pontuacao 8 Saldo Gols 6 Tabela Campeonato Class V E D GP GS SG Pont -------------------------------------------| Time 1| 1 | |...
ALGO
0.994655
3.683831
{ "github_metadata": { "branch": "main", "commit_count": 45, "repo_created_at": "2023-11-29T20:47: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": "bf70cb4c62c...
214370fc-336c-4fc0-ad1e-30b8b01b2912
QiuhuaL/CarND-Path-Planning-Project
src/main.cpp
#include <fstream> #include <math.h> #include <uWS/uWS.h> #include <chrono> #include <iostream> #include <thread> #include <vector> #include "Eigen-3.3/Eigen/Core" #include "Eigen-3.3/Eigen/QR" #include "json.hpp" #include "spline.h" using namespace std; // for convenience using json = nlohmann::json; // For convert...
WEB
0.966387
3.864257
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2018-05-07T04:09: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": "287783c4a...
8006636c-592b-4ea1-86e0-a016ebf755a8
mostafaahmedemam/ASUMobiCarG63
RC_project.ino
char state=0; ; int motor_A1=5; //motordriver..2 int motor_A2=6; //motordriver ..7 int motor_b1=9; //motordriver..10 int motor_b2=10; //motordriver..14 int velocity =255; int echo=4; int trig=3; float dur,dis; const int pinL=13; const int pinR=2; const int pinC=12; int LS; int RS; int MS; int a,t,value; void Forward(){...
TOOL
0.963818
3.814152
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2018-02-18T18:52: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": "66ac82f8ac...
d38f0bae-93c3-4e21-b9fc-87be77ad8e07
erickgonzalez2/Soluciones-Programacion-Competitiva
Grafos/uva 336.cpp
#include <bits/stdc++.h> using namespace std; vector < vector <int>> grafo; int main(){ int edges; int casos=1; while(cin>>edges && edges){ grafo.assign(30,vector<int>()); map <int,int> conexiones; map <int,int> :: iterator search; map <int,int> :: iterator search2; vector <pair <int,int>> tll; ...
ALGO
0.999732
3.711888
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-01-21T04:23:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "960b55cef970...
b51c57ed-75c2-4413-b9b9-a69215b5d5f4
prasannakroy/CodeWorld
Codeforces/Codeforces Round #648 (Div. 2)/A - Matrix Game/Source.cpp
/***************************** * Author :: <NAME> * *****************************/ /*********************************** * Unus pro omnibus, omnes pro uno * ***********************************/ #include<bits/stdc++.h> using namespace std; #define __AcHiLlEs ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NU...
ALGO
0.999985
4.263287
{ "github_metadata": { "branch": "master", "commit_count": 211, "repo_created_at": "2020-05-31T17:38:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "592fcccd...
7868f3a7-0f74-4f03-94c4-06fd3c889d42
ton-blockchain/ton
tdfec/td/fec/raptorq/Solver.cpp
/* This file is part of TON Blockchain Library. TON Blockchain Library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later ver...
ALGO
0.999877
6.715352
{ "github_metadata": { "branch": "master", "commit_count": 1052, "repo_created_at": "2019-09-07T09:33:40.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3643, "forks": 1279, "issues": 134, "pull_requests": 67 }, "file_meta": { "content_id": ...
56251e60-830b-47f1-9fa7-e90ce695bbcf
jackmott/FastNoise-SIMD
FastNoise/NoiseUtility.cpp
#include "headers/NoiseUtility.h" #include <stdio.h> //Must be called by the caller of noise producing functions void CleanUpNoiseSIMD(float * resultArray) { _aligned_free(resultArray); } //Must be called by the caller of noise producing functions void CleanUpNoise(float * resultArray) { free(resultArray); } /...
ALGO
0.976652
5.212663
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2015-12-09T05:05:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 54, "forks": 8, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "0efbd913...
aa43dafc-1c7e-44e4-ba8b-7f28566e2320
parth1614/DSA_Questions
Placement_Prep/Linked_List/if_LLis_Circular_or_Not.cpp
/************************************************* Following is the structure of class Node: class Node{ public: int data; Node* next; Node(int data){ this->data = data; this->next = NULL; } ...
ALGO
0.99966
5.036457
{ "github_metadata": { "branch": "main", "commit_count": 231, "repo_created_at": "2021-07-08T07:41:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "12e49bc1d0...
beb71928-a5ca-4ffb-bba4-e065d98d346e
nbarkhina/DosWasmX
code/src/libs/mt32/Analog.cpp
/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 <NAME>, <NAME> * Copyright (C) 2011-2022 <NAME>, <NAME>, <NAME> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either versio...
TOOL
0.982071
6.431665
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2024-01-27T15:51:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 102, "forks": 18, "issues": 17, "pull_requests": 2 }, "file_meta": { "content_id": "076a1...
91bf51cb-1129-4b79-a1cf-e299e91eaec5
akhikolla/testpackages
fuzzedpackages/womblR/src/MCMC_Samplers.cpp
#include <RcppArmadillo.h> #include "MCMC_STBDwDM.h" //Function to sample delta using a Gibbs sampler step--------------------------------------------------------------- para SampleDelta(datobj DatObj, para Para, hypara HyPara) { //Set data objects arma::mat ZDelta = DatObj.ZDelta; arma::vec OneNu = DatObj.OneN...
ALGO
0.999883
3.83178
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2021-01-15T17:42:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cc0618fe06...
50742eaa-92e5-46cd-9e7a-01119261ade0
ahamza952/zc1415926-flash-as
OpenGL/SuperBible/Moveing rectangle with bounce detection.cpp
// SuperBible4_Chapter1.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <gl\glut.h> //Initialize square position and size GLfloat x1 = 0.0f; GLfloat y1 = 0.0f; GLfloat rsize = 25; //Step size in x and y directions GLfloat xstep = 1.0f; GLfloat ystep = 1.0f; //Keep track of windows chaning width and height GLfl...
ALGO
0.925305
4.285583
{ "github_metadata": { "branch": "master", "commit_count": 45, "repo_created_at": "2016-01-28T17:50: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": "3f37fc2f2...
33b1fe70-b99f-4f2b-880e-d6068155de98
byhugoleo/Data-Structures
linked_list.cpp
//Implementation of a linked list #include <bits/stdc++.h> using namespace std; struct Data { //Methods void set_Info(int info) { this->info = info; } int get_Info() const{ return info; } private: //Data-Properties int info; }; class node { //Data-Properties Data info; no...
ALGO
0.999833
4.847603
{ "github_metadata": { "branch": "master", "commit_count": 27, "repo_created_at": "2020-03-16T21:07:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d3fd89bac...
5d2d360c-ac67-417f-9979-5132df42dd2e
Kattis-Everyday/KattisSolutions
Changrui/C++/Kattis_Mall_Mania.cpp
// // main.cpp // <NAME> // // Created by mcr on 19/11/2020. // //#pragma GCC optimize(3,"Ofast","inline") //#include <bits/stdc++.h> #include<iostream> #include<sstream> #include<iomanip> #include<cmath> # include <string.h> #include<math.h> #include<string> #include<vector> #include<queue> #include<map> #include...
ALGO
0.999843
3.944984
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2021-05-19T14:27:55.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "16865b56db14...
5b03c306-022a-4f66-a8b5-efdded9e4b8a
euxcet/raytracer
src/engine/pm.cpp
#include "engine/ppm.h" #include <omp.h> namespace Raytracer { void PPMEngine::SpawnReflectionRay(const Ray &ray, Intersection isc, int depth, float index, Vector3 weight, int id) { Normal3 N = isc.n; if (Dot(ray.direction, N) > 0) N = -N; Vector3 D = ray.GetDirection()...
ALGO
0.986795
5.048414
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2018-03-14T08:16: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": "dbf16d586...
2b4f0987-987d-47f6-a937-25ec66589ecf
wisdompeak/LeetCode
Dynamic_Programming/1659.Maximize-Grid-Happiness/1659.Maximize-Grid-Happiness.cpp
class Solution { int dp[6][7][7][243]; int N; int a[6]; int b[6]; public: int getMaxGridHappiness(int m, int n, int introvertsCount, int extrovertsCount) { this->N = n; int MAX_State = pow(3,n); for (int row = 0; row <= m; row++) for (int x = 0; x<=introverts...
ALGO
0.999684
4.097188
{ "github_metadata": { "branch": "master", "commit_count": 8912, "repo_created_at": "2017-03-01T10:30:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6018, "forks": 1314, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "4...
0255cca5-1db8-485b-9859-dcdf7e056e15
Ivana3001/PolynomialCalculator
PolynomialCalculatorIvanaPaleva.cpp
#include <iostream> #include <vector> using namespace std; int Abs(int x) { return x < 0 ? -x : x; } int gcd(int a, int b) { while (b != 0) { int temp = b; b = a % b; a = temp; } return Abs(a); } pair<int, int> SimplFraction(pair<int, int> frac) { int divisor = gcd(frac.first, frac.second); frac.first /=...
ALGO
0.998335
5.284827
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-02-04T19:02: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": "972a5e996747...
757c26c5-beff-4043-af1f-b66c5eef1f7d
Premkumar981/DSA_Daily_Problems
Reema.cpp
#include <stdio.h> int main() { int tableSize = 10; int numKeys; scanf("%d", &numKeys); int keys[numKeys]; for (int i = 0; i < numKeys; i++) { scanf("%d", &keys[i]); } int hashTable[tableSize]; for (int i = 0; i < tableSize; i++) { hashTable[i] = -1; } ...
ALGO
0.999793
5.409467
{ "github_metadata": { "branch": "main", "commit_count": 92, "repo_created_at": "2023-08-24T18:08:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4ebc45f8045...
b2c3b5d2-f0cd-4539-856a-eff601d5b86f
Vishu-Kaushik/Good-DSA-Codes-
Recursion/RopeCutting.cpp
#include <iostream> #include <algorithm> using namespace std; // NOTE--> We can get the idea for the base cases for the recursion problem by checking the leaf node of the recursion tree int maxPeices(int n, int a, int b, int c) // Time Complexity if O(3^n) { if (n == 0) { return 0; } if (n < 0...
ALGO
0.999736
3.923673
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-05-22T08:37:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "92beb4e2b928...
7111821d-0248-438f-8957-a5d1e0567a17
Linzecong/My-ACM-Code
HDU/6437/15926107_AC_452ms_6824kB.cpp
#include <iostream> #include <string.h> #include <math.h> #include <vector> #include <algorithm> #include <stdio.h> #include <queue> using namespace std; const int MAXN = 400010; const int INF = 0x3f3f3f3f; typedef long long ll; struct edge { int u, v, cap, cost, next; } e[4 * MAXN]; int edge_num; int head[MAXN];...
ALGO
0.999938
4.129854
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2018-02-26T08:44:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "40789106a5...
5c7c744c-d0dd-4b12-b58d-9d4a539fbee4
tobytyx/leetcode
5_LongestPalindromicSubstring.cpp
#include<iostream> #include<string> #include<vector> #include<algorithm> using namespace std; class Solution { public: string longestPalindrome(string s) { string x = "&"; for(char c: s) x = x + c + "&"; int max_i = 0, max_len = 0, mx = 0, len = x.size(), cid=0; vector<int> p(len, 0...
ALGO
0.999982
4.721808
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2020-01-30T03:54: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": "fa5229aa5...
4c2b3984-2a9d-40ea-9dee-c84c1e33579d
Joao03Guilherme/ONI
2016/Final/2016B.cpp
# include <bits/stdc++.h> # define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); # define pb push_back # define ll long long int # define vi vector<int> # define pii pair<int, int> using namespace std; const int INF = 1000000009; const long long INFLL = (ll)INF * (ll)INF; const int MX = 900; int l, c, r;...
ALGO
0.999933
4.359375
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2022-03-09T19:54:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7c50057bbb...
194a5f9f-489b-451c-a40a-b1da707efcb0
toufiq-dev/tjip-repo
week06/numberOfIslands.cpp
int dx[] = {+0, +0, +1, -1}; int dy[] = {+1, -1, +0, +0}; class Solution { public: // TC: O(n * m) where n = |columns|, m = |rows| // SC: O(n * m) void dfs(int ux, int uy, vector<vector<char>>& grid) { grid[ux][uy] = '0'; for(int i = 0; i < 4; ++i) { int vx = ux + dx[i]; ...
ALGO
0.999907
6.361011
{ "github_metadata": { "branch": "main", "commit_count": 70, "repo_created_at": "2023-10-13T14:58:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 3 }, "file_meta": { "content_id": "c22901e7d85...
71b51413-6150-4421-8c80-2c265b8a6954
thisisprasad/velotio-coding-assignment
Question1.cpp
/** Question: Write a function takes the time in digital format(9:15, 7:37 etc) and returns the angle b/w the minute and the hour hand. It should return the smaller angle. Solution: Whenever the minute hand changes by a minute, the hour hand changes by 0.5 degrees. This case is also handled....
ALGO
0.999809
5.225878
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2021-07-24T11:51:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d224644cf5...
c4878d23-81d6-43b4-bd79-8e88d00a53ed
KangPuding/Code-Test
프로그래머스/2/77885. 2개 이하로 다른 비트/2개 이하로 다른 비트.cpp
#include <vector> using namespace std; vector<long long> solution(vector<long long> numbers) { vector<long long> answer; for (long long num : numbers) { if (num % 2 == 0) { answer.push_back(num + 1); } else { long long bit = 1; ...
ALGO
0.999965
4.510293
{ "github_metadata": { "branch": "main", "commit_count": 636, "repo_created_at": "2023-09-16T09:06: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": "9cf931eaed...
d46c7ece-e5ee-41dc-b677-6ea265492fa7
Kamisorara/Algorithm_Codeforces
Solutions/1300/1746C - Permutation Operations/main.cpp
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define INF 0x3f3f3f3f #define MOD le9 + 7 #define sd(n) scanf("%d", &n) #define sdd(n, m) scanf("%d %d", &n, &m) #define mem(a, b) memset((a), (b), sizeof(a)) #define rep(i, a, b) for (int i = (a); i <= (b); i++) #define fast_io \ ...
ALGO
0.999984
4.109321
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2022-11-10T15:05:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "124ae9712...
07fdc9dd-de3f-44f5-ba7b-aeb0a28f9ff3
XukiYang/c-learning-examples
Demo-09/09字符串比较cpp.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> //声明-自定义strcmp()-对比字符串大小函数 int my_strcmp(const char* str1, const char* str2); //声明-自定义strcmp()-究极优化版本 int my_strcmpMAX(const char* str1, const char* str2); //声明-自定义strncmp()-字符串比较固定长度函数 int my_strncmp(const char *str1,const char *str2,size_t len); int main00...
ALGO
0.998824
3.236863
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2023-02-09T08:52: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": "5979b0cce192...
c1e0d6d1-a94d-452b-9716-48f54ae050f6
Nhinlee/Leet-Code-Training
contests/Weekly Contest 343 .cpp
#include "../stdc++.h" class Solution { public: int isWinner(vector<int> &player1, vector<int> &player2) { int sum1 = 0, sum2 = 0; int dup = 1, c = 0; for (auto x: player1) { c++; if (c > 2) sum1 += x; else sum1 += x * dup; if (x == 10) { ...
ALGO
0.99984
4.951668
{ "github_metadata": { "branch": "main", "commit_count": 131, "repo_created_at": "2022-06-22T00:46: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": "300c2094a4...
1c97b48d-a99f-4c5a-bb63-027c52d42fb1
khushbooshakya/DSA
Placement/Recursion/SumOfArray.cpp
/* Coding Problem Problem Statement: Sum of array (recursive) Problem Level: EASY Problem Description: Given an array of length N, you need to find and return the sum of all elements of the array. Do this recursively. Input Format : Line 1 : An Integer N i.e. size of array Line 2 : N integers which are elements of the...
ALGO
0.999647
5.840715
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-04-14T15:06: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": "59422adcb222...
c62792f8-9e51-4f17-bef6-1912a43aab84
Kawser-nerd/CLCDSA
Source Codes/CodeJamData/08/93/20.cpp
#define _CRT_SECURE_NO_DEPRECATE #pragma comment(linker, "/STACK:60000000") #include <iostream> #include <sstream> #include <cassert> #include <cmath> #include <ctime> #include <map> #include <set> #include <bitset> #include <queue> using namespace std; typedef long long int64; #define forn(i, n) for(int i = 0; i...
ALGO
0.99997
3.974798
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2019-09-30T05:38:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 22, "forks": 8, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "75c10ac6...
19f12006-de6c-491d-b891-090b347216ca
PJLab-ADG/SensorsCalibration
lidar2camera/joint_calib/3rdparty/ceres/internal/ceres/cxsparse.h
// Ceres Solver - A fast non-linear least squares minimizer // Copyright 2015 Google Inc. All rights reserved. // http://ceres-solver.org/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of so...
TOOL
0.911559
7.697824
{ "github_metadata": { "branch": "master", "commit_count": 119, "repo_created_at": "2021-12-09T08:08:51.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2758, "forks": 641, "issues": 140, "pull_requests": 0 }, "file_meta": { "content_id": "ae...
774e4022-e018-4a14-bb8a-520cbfe51a15
DarkArmy-ctf/MainCTF-challenges
rev/jack2/crackme_smt.cc
#include<stdio.h> #include<string.h> #define EXIT_SUCCESS 0 #define EXIT_FAILURE 1 int SHR(int v, int n) { return (v >> n) & (1 << (32 -n )); } int SHL(int v, int n) { return (v << n) & (1 >> (32 -n )); } void parse_string(int i, int k, char flag[], unsigned int h[]) { h[i] = flag[k] + (flag[k+1] << 8) ...
ALGO
0.991498
3.094548
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2020-08-18T12:56:57.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0359217c27...
b15a8b4d-9ee8-468f-b4c9-d2bf118f037b
DezeZhao/CourseDesignFor-DS
Source Code/算法实现_GraphTraverse/mgraph.cpp
#include "mgraph.h" #include "mainwindow.h" #include "sqqueue.h" #include "sqstack.h" #include <ctime> #include <iostream> using namespace std; int vis[MAX_VERTEX_NUM]; MGraph::MGraph() { for (int i = 0; i < vexnum; i++) for (int j = 0; j < vexnum; j++) arcs[i][j] = 0; // for (int i = 0; ...
ALGO
0.999215
3.72928
{ "github_metadata": { "branch": "master", "commit_count": 46, "repo_created_at": "2019-09-07T13:44:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3b369e5ee...
f213824c-75fc-4ce1-8ddb-bdf7148e9152
FazeelUsmani/Leetcode
2020 Leetcode Challenges/04 April Leetcode Challenge 2020/17 April/noOfIslands.cpp
class Solution { public: int numIslands(vector<vector<char>>& grid) { // This can be solved using BFS, DFS and Find & Union / Disjoint Set Union [a bit slower] // Elegant solution // This solution uses Queue using DFS if (grid.empty() || grid[0].empty()) return 0...
ALGO
0.999987
6.473497
{ "github_metadata": { "branch": "master", "commit_count": 513, "repo_created_at": "2020-04-09T10:39:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 10, "issues": 1, "pull_requests": 115 }, "file_meta": { "content_id": "92b59...
300152c6-eaa9-4a40-af2a-e9dcc8e12e0c
Pranav-Sharma20/Binary-Tree
Right_View.cpp
// HEADER FiLES and DECLARATION #include<bits/stdc++.h> using namespace std; // This is TreeNode Class to define the tree node class TreeNode{ public: int val; TreeNode* left; TreeNode* right; }; // Driver code // This is a function to initialize the new node TreeNode * newNode(int data) { TreeNode ...
ALGO
0.999624
4.702413
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2022-02-26T12:31:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d81eab6f3...
b26191e5-0c05-42d8-a2b9-4fa3cd3d8a64
ishandutta2007/codeforces-a
amshz/normal/501/D.cpp
# include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair <int, int> pii; # define A first # define B ...
ALGO
0.999983
3.520841
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-11T00:51: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": "56716f2440a1...
6485cb2d-a0e0-4d1a-8ca0-9a34756887f9
alexandraback/datacollection
solutions_5644738749267968_0/C++/SergeyRogulenko/D.cpp
#pragma comment(linker, "/STACK:60000000") #define _CRT_SECURE_NO_WARNINGS #include <cstdio> #include <iostream> #include <vector> #include <cmath> #include <algorithm> #include <string> #include <set> #include <map> #include <ctime> #include <cstring> #include <cassert> #include <sstream> #include <iomanip> #include ...
ALGO
0.999953
3.878241
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "831e90dca...
98023dfd-f353-418b-aadf-aa924be3fb28
odelalleau/PLearn
plearn_learners/distributions/DEPRECATED/GaussianContinuumDistribution.cc
// -*- C++ -*- // GaussianContinuumDistribution.cc // // Copyright (C) 2004 <NAME> & <NAME> // // 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...
ALGO
0.996425
6.138297
{ "github_metadata": { "branch": "master", "commit_count": 10214, "repo_created_at": "2011-11-03T15:46:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 15, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "364c7...
1187161f-9212-4589-905b-20ff3c16f8be
saumyap48/cpp
Longest_Consecutive_Sequence_In_An_Array.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n; cout<<"Enter the number of element in the array: "; cin>>n; vector<int>arr(n); cout<<"Enter the elements of the array: "; for(int i=0; i<n; i++){ cin>>arr[i]; } unordered_set<int> s(arr.begin(), arr.end()); //must rememb...
ALGO
0.9999
4.667235
{ "github_metadata": { "branch": "main", "commit_count": 78, "repo_created_at": "2024-09-15T05:35:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b7ecaf8b828...
1b1a5eb3-f163-41f8-8329-4a9f468156b5
hse-spb-2022-cpp/lectures
03-220919/01-array/10-vector-operators.cpp
#include <iostream> #include <vector> int main() { std::vector v1{1, 2, 3}, v2{4, 5}; std::cout << "v2:"; for (int x : v2) { std::cout << ' ' << x; } std::cout << '\n'; std::cout << (v1 == v2) << (v1 < v2) << (v1 > v2) << '\n'; // 010: lexicographical comparison: 1 < 4 v1 = v2; ...
TOOL
0.989064
4.912565
{ "github_metadata": { "branch": "master", "commit_count": 164, "repo_created_at": "2022-09-04T23:40:10.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 23, "forks": 13, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "54baee0...
45c335ad-80cd-4451-9337-154c9937efc5
starrr921/opencv
rasterizer.cpp
// clang-format off // // Created by goksu on 4/6/19. // #include <algorithm> #include <vector> #include "rasterizer.hpp" #include <opencv2/opencv.hpp> #include <math.h> #include <tuple> rst::pos_buf_id rst::rasterizer::load_positions(const std::vector<Eigen::Vector3f> &positions) { auto id = get_next_id(); ...
ALGO
0.941797
6.05474
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2024-09-20T02:40: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": "128d38effd...
73ec67db-2ffa-4308-b5a0-5fe98989e0f6
keshavtomar/Programs
codeforces practice/chess_cheater.cpp
#include <iostream> #include <climits> #include <algorithm> #include <vector> #include <list> #include <cmath> #include <cstring> #include <set> #define FOR(a, b, c) for (int a = b; a < c; a++) #define ll long long int #define pb push_back #define pp pop_back #define vi vector<int> using namespace std; int main() { ...
ALGO
0.999876
3.370666
{ "github_metadata": { "branch": "master", "commit_count": 43, "repo_created_at": "2022-03-28T16:37: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": "d6a817173...
ad4fd35e-edcf-4b66-a201-cd205df3cfc0
sk8erpunk/CrackCode-Solutions
8.5 Recursive Multiply.cpp
/****************************************************************************** Recursive Multiply Write a recursive function to multiply two positive integers without using the * operator (or / operator). You can use addition, subtraction, and bit shifting, but you should minimize the number of those operations. *****...
ALGO
0.99978
5.46172
{ "github_metadata": { "branch": "master", "commit_count": 30, "repo_created_at": "2018-10-24T11:56: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": "434656292...
66501ec8-7dda-4fcf-8442-e16e62179117
MononobenoFuto/SoDoI
大作业/arduino代码.ino
#define Trig 2 //引脚Tring 连接 IO D2 #define Echo 3 //引脚Echo 连接 IO D3 #define LED 4 //LED正极 连接 IO D4 #define Alarm 5 //闹钟正极 连接 IO D5 #define Button 6 //按键开关 连接 IO D6 float cm; //距离变量 float temp; // int state_alarm;//闹钟状态(0:关闭;1:计时;2:响) int state_led;//LED状态(0:熄灭;1:亮;2:延时) int count;//计数器 int remain;//夜灯...
TOOL
0.915292
5.123359
{ "github_metadata": { "branch": "main", "commit_count": 87, "repo_created_at": "2021-03-08T01:11:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "004057b9e5d...
3c49f111-f189-445b-a230-26ffe99167a0
zenna/AlioZoo.jl
src/raytrace/render.hpp
#pragma once #include "boost/math/tools/promotion.hpp" #include <fstream> #include <iostream> #include <tuple> #include <memory> using Eigen::Matrix; using Eigen::Dynamic; namespace RT { // Type aliases using Var = stan::math::var; template <class T> using Vec = Matrix<T, Dynamic, 1>; template <class T> using Poin...
ALGO
0.995399
5.569863
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2017-11-01T00:20:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "fbd2758d3...
be07c735-8956-49f0-ae4a-e0480210df9d
mandosoft/C-Projects
CarCounting.cpp
#include <iostream> #include <cmath> #include <algorithm> #include <string> using namespace std; int main() { int cases; cin >> cases; string apple; int R, G, B, Y, K, W, T = 0; int count; for (int i = 0; i<cases;i++) { cin >> apple; char grape[apple.length()] = {0}; for (int j = 0 ; j<apple.length() ; j++){ gr...
ALGO
0.997343
3.017753
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2018-12-16T18:12:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "98ea6467b...
de215fc7-8f7a-49da-8329-b44ced12aed9
saiprasathgopinathan/DS_Algorithms
bubble.cpp
#include<iostream> using namespace std; void swap(int *i, int *j) { int t = *i; *i = *j; *j = t; } void bubble(int a[], int n) { int flag = 0; for(int i=0;i<n-1;i++) { for(int j = 0; j<n-1-i; j++) { if(a[j] > a[j+1]) { swap(&a[j], &a[j+1]...
ALGO
0.999956
4.810327
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2020-11-22T18:53: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": "9398661589ed...
715b678a-f4f6-433e-848e-75fb81569cf9
markmal90/lp2_2024
c++ comprobacion/ejercicio11.cpp
#include <iostream> #include <cmath> bool esNumeroArmstrong(int numero) { int original = numero; int suma = 0; int n = 0; // Contar el número de dígitos while (original != 0) { original /= 10; ++n; } original = numero; // Calcular la suma de los dígitos elevados a la ...
ALGO
0.999267
4.680143
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2024-08-20T19:05: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": "22258b552b8...
6697f891-edc7-480b-8ba5-0226095c4321
qwuaren/AppliedProgramming2019
Ch5/5_8.cpp
//s 268 #include <cmath> #include <cassert> #include <iostream> double CalcDeterminant(double **matrix, int size) { /* Determinant of square matrix is given by sum (-1)^(i+j) * a_ij * M_ij Where M is the submatrix, a is an nxn matrix. */ double determinant = 0.0; if (size == 1) { determinant = matrix[...
ALGO
0.999988
5.126487
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2020-04-19T00:37: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": "2c6f68fdaa...
7a7ba821-a969-46ba-bc3e-8d9aba3bfdb1
vishu-garg/competetive-programming
practice/1339/5.cpp
#include<bits/stdc++.h> #include<algorithm> using namespace std; #define ll long long #define ld long double #define rep(i,a,b) for(ll i=a;i<b;i++) #define repb(i,a,b) for(ll i=a;i>=b;i--) #define err() cout<<"=================================="<<endl; #define errA(A) for(auto i:A) cout<<i<<" ";cout<<endl; #def...
ALGO
0.999964
3.767174
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2019-05-31T12:42: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": "5efd938398...
c79697b3-71ca-481d-ba4f-2c4bc147905d
arif-r/Hostel-Allotment-System
Hostel-Allotment.cpp
#include<fstream> #include<bits/stdc++.h> using namespace std ; class Data { public: vector<string> header = vector<string> (5, ""); vector<vector<string>> table; Data(int n){ ifstream inFile; inFile.open("sample2(1).csv"); for (int i = 0; i < n-1; i++) getline (inFile, header...
DATA
0.979797
3.218319
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-07-23T04:37:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c674a42054c1...
0d78257b-6089-45a5-8ad3-0b7e962bfe8e
konakarthik12/cp
template/ds/sparse.cpp
#pragma once #include "../base.cpp" template <typename Func> wwi build_sparse(wi arr, Func merge) { int n = arr.sz(); int w = blen(n); wwi table(w, wi(n)); table[0] = arr; for (int h = 1; h < w; h++) { int hw = 1 << (h - 1); for (int i = 1; i <= n; i++) { table[h][i] = merge(table[h - 1][i], tab...
ALGO
0.999562
5.57668
{ "github_metadata": { "branch": "main", "commit_count": 74, "repo_created_at": "2023-05-24T15:41: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": "f9b8b8cf54f...
a58f6597-eb26-4ed9-afe4-9d58783103cc
LLNL/muster
src/par_kmedoids.cpp
////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2010, Lawrence Livermore National Security, LLC. // Produced at the Lawrence Livermore National Laboratory // LLNL-CODE-433662 // All rights reserved. // // This file is part of Muster. For details,...
ALGO
0.999508
6.510826
{ "github_metadata": { "branch": "master", "commit_count": 170, "repo_created_at": "2010-06-08T12:56:12.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 23, "forks": 11, "issues": 1, "pull_requests": 1 }, "file_meta": { "content_id": "bca2efa...
7eb3aa60-674c-4656-acbe-e097c2fd1cbd
logic2333/ZJU-PAT
basic/1040_.cpp
// 1040-分治.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> #include <string> using namespace std; unsigned count_one(const string::iterator& start, const string::iterator& termi, const char c) { unsigned res = 0; for (auto i = start; i != termi; i++) if (*i == c) res++; return res; } unsigned c...
ALGO
0.999928
4.587141
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2018-07-04T05: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": "1c58db07ba...
7a919a98-a436-4ee8-b4ce-094abbefe596
simonnguyen175/cp-repo
tuhoc/baitapcodeforce/1530D.cpp
#include<bits/stdc++.h> using namespace std; const int N = 1e6 + 5; int t, n, a[N], b[N]; void solve(){ unordered_map<int, int> hold; deque<int> dq; int k = 0; for (int i = 1; i <= n; i ++) if ( !hold[a[i]] ) b[i] = a[i], hold[a[i]] = i, k ++; else b[i] = 0; for (int i = 1; i <= n...
ALGO
0.999985
4.062803
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2024-11-16T14: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": "56c02abca6...
094d83ff-1ed7-4cef-b1af-f40ab095f1f3
ConnCaster/informatics.msk
Graphs/Boruvka/Minimal_karkas/minimal_karkas.cpp
#include<bits/stdc++.h> using namespace std; class Graph{ public: explicit Graph(int V, int E) : E(E), V(V) {} void read_graph(){ for (int i = 0; i < E; ++i) { int s, d, w; std::cin >> s >> d >> w; gr.push_back({s,d,w}); } } void boruvka() {...
ALGO
0.999985
4.980985
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2023-02-08T09:07: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": "0afa2f49ca...
35e7de6e-cd08-4f43-b157-9a1954d7f5e9
Bionicsonic/Team5728_Cpp_Class
Cpp_Primer/Chapter-1/1.4/1.4.3.cpp
//1.4.3 #include <iostream> int main(){ int sum = 0, value = 0; //initialize variables to hold values while (std::cin >> value){ //reads the number of inputs and stores them in variable 'value' sum += value; //adds value to the evolving total of sum } std::cout << "Sum is: " << sum << std::endl; //Tells us the...
ALGO
0.985324
3.678738
{ "github_metadata": { "branch": "master", "commit_count": 42, "repo_created_at": "2015-11-02T08:29: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": "c1649feed...
a4b26f38-a397-415d-925b-b70c765d7a8c
alper-io/218lab
lab3postlab.cpp
#include <iostream> #include <stdexcept> #include <cmath> #include <algorithm> using namespace std; class Double_vector { private: double* internal_array; int array_size; int array_capacity; public: // Constructors Double_vector() : internal_array(nullptr), array_size(0), array_capacity(0) {} ...
ALGO
0.981311
6.355567
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2024-02-26T13:17:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c174c3eb007...
fa1119da-e5a5-4658-9bd2-0e2d6fdcdb5b
AmeliaChady/220GroupProject
LinkedList.h
// // Created by <NAME> on 10/30/18. // #ifndef LAB8SOLN_LINKEDLIST_H #define LAB8SOLN_LINKEDLIST_H #include "List.h" #include "LinkedNode.h" template <class T> class LinkedList : public List<T>{ private: LinkedNode<T>* front; LinkedNode<T>* end; int numItems; //Private to disable copying and assig...
TOOL
0.996973
6.152871
{ "github_metadata": { "branch": "master", "commit_count": 126, "repo_created_at": "2018-11-26T16:10:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "806276a8...