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
f73095d9-86b1-4cb3-b079-1b821a8de5bc
Kim-Seongseo/Coding-test
LCA, TRIE, LCS/5052.cpp
#include <stdio.h> #include <string.h> class Node{ public: Node* child[26]; char data[100]; Node(){ for(int i=0; i<26; i++){ child[i] = NULL; } } }; Node root; void add(Node* t, char name[20], char phoneNumber[20]){ for(int i=0; name[i]!=0; i++){ if(t->child[na...
ALGO
0.998362
3.480559
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2020-09-02T07:35: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": "e6f544909...
45bef2c5-9a27-4a0c-9285-bfd958125edd
mofeilu/leetcode
Stack/NextGreaterElement496.hpp
/*496. Next Greater Element I You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1's elements in the corresponding places of nums2. The Next Greater Number of a number x in nums1 is the first greater number to its right ...
ALGO
0.99974
5.754912
{ "github_metadata": { "branch": "master", "commit_count": 114, "repo_created_at": "2018-12-03T01:11: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": "1c8c7a5a...
7f341f96-43e8-45be-974d-769f352e1e2a
panguangze/Ibalance
src/Vertex.cpp
#include <iostream> #include "Vertex.hpp" using namespace std; Vertex::Vertex(int aId, char aDir, Weight * aWeight, double aCredibility) { mId = aId; mDir = aDir; mWeight = aWeight; mIsOrphan = false; mHasCheckedOrphan = false; mShortestPrevEdge = NULL; mSegment = NULL; mEdgesAsSour...
ALGO
0.994244
4.489364
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2021-04-28T09:28:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fcfc51d2214...
0377c5ca-5e5c-46d9-a302-ab38d1862439
khalwsh/Competitive-Programming
technique/first k shortest path .cpp
vector<pair<int,int>> adj[N]; int n , m, k; signed main() { khaled cin >> n >> m >> k; for(int i = 0; i < m; ++i){ int u , v, w; cin >> u >> v >> w; --u, --v; adj[u].emplace_back(v , w); } priority_queue<pair<int,int>,vector<pair<int,int>>,greater<>> q; vector<int...
ALGO
0.999998
4.709398
{ "github_metadata": { "branch": "main", "commit_count": 112, "repo_created_at": "2023-10-30T13:22:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 14, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "69e2e5897...
0e80d806-0113-421e-898d-fefd8ed12562
Ma-jia/LC
19.cpp
// // Created by m'j'x on 2023/11/13. // #include <iostream> #include <cstdlib> struct ListNode { int val; ListNode *next; explicit ListNode(int x) : val(x), next(nullptr) {} }; class Solution { public: static ListNode *removeNthFromEnd(ListNode *head, int n) { ListNode *dummy = new ListNode...
ALGO
0.999937
6.178583
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2024-04-06T12:16:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f7b980056...
5a13ebd1-810e-47a6-944e-c9e73e3d4933
atatomir/work
_Codeforces/Round 406/A/main.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <vector> #include <algorithm> #include <cmath> #include <queue> using namespace std; #define mp make_pair #define pb push_back #define ll long long #define maxN 15011 int n, k, i, x; vector<int> s[maxN]; int gr[maxN]; int ans[maxN]; queue<int> Q; in...
ALGO
0.999957
3.087852
{ "github_metadata": { "branch": "master", "commit_count": 302, "repo_created_at": "2015-03-29T18:54: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": "67110cfa...
e7df84e6-1d9e-4fe1-ba66-74a4dfc630d2
matlyszkiewicz/poker
Poker/poker_hand.hpp
/** Getting best hand from player's card stack. @author <NAME> @version 1.0 @since 2020 - 02 - 05 */ #ifndef _poker_hand #define _poker_hand #include <vector> #include "card.hpp" /** This class provides best hand from player and table cards. Class require manual update result by calling member function. ...
ALGO
0.989099
5.820592
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-05-13T18:34: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": "df1c6127a2...
d7561043-0963-4db8-8a3d-dcd2aaac4871
LakshyaDuhoonISU/Lakshya46_23-27_Sem-II_DSA
1arrayoperations.cpp
// menu driven array operations program - 1.display array 2.insert at beginning 3.insert at end 4.insert before an element 5.insert after an element 6.delete at beginning 7.delete at end 8.delete before an element 9.delete after an element 10.search an element 11.number of elements #include <iostream> #include <algorit...
TOOL
0.995543
5.167287
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-03-27T13:54:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4c662c77cad2...
2b4c98a9-d2d0-4655-8511-73abe1f851b8
billpaps/cpp_data_structures
HashTable.h
#include <vector> #include <string> #include <iostream> /* Κλαση για το HashTable οπου εχει μια μεταβλητη hashEntriesCount για το ποσο στοιχεια υπαρχουν στον Πινακα μια hashConstant οπου χρησιμοποιειτε για την συναρτηση κατακερματισμου, το struct hashEntry το οποιο το χρησιμοποιω για να αναπαραστησω τ...
ALGO
0.981191
4.037718
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2019-05-25T13:24: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": "3ef392032...
2e207867-e369-4447-97c0-422b0bae1e04
shakibamoshiri/1000_examples_with_cpp
std/04_Algorithm_library/044_algorithm_swap.cpp
/* Algorithm Library C++ The algorithm library defines functions for a variety of purposes. (e.g. searching, sorting, counting, manipulating ) that operate on range of elements. Note that a range is defined as [ first, last ) where last refers to the element past the last element to inspect or modify. -----------------...
ALGO
0.998334
5.958844
{ "github_metadata": { "branch": "master", "commit_count": 123, "repo_created_at": "2016-09-13T13:24:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a3968505...
1c91e553-7216-4286-8b9e-f63aac8e99b4
kenzhegaliyevn/Competitive-programming
acmp/0854/main.cpp
#include <iostream> #include <cstdio> #include <cmath> #include <string> #include <vector> #include <deque> #include <queue> #include <stack> #include <set> #include <map> #include <algorithm> #include <sstream> #include <bitset> #include <cstdlib> #define sqr(x) (x) * (x) #define F first #define S second ...
ALGO
0.999255
3.268224
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-02-17T03:51: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": "0b0e78420b18...
ccded3be-283b-4f36-b5dd-5d44cf961970
aydindemircioglu/RcppShark
inst/include/shark/Algorithms/Trainers/RankingSvmTrainer.h
//=========================================================================== /*! * * * \brief Support Vector Machine Trainer for the ranking-SVM * * * \author <NAME> * \date 2016 * * * \par Copyright 1995-2017 Shark Development Team * * <BR><HR> * This file is part of Shark. * <http:...
ALGO
0.997994
7.186492
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2015-08-14T01:11:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "2ced98244...
2584b065-81e3-4680-a28c-1bc201dc388f
mit-biomimetics/Cheetah-Software
common/include/Math/FirstOrderIIRFilter.h
/*! @file FirstOrderIIRFilter.h * @brief A simple first order filter * * */ #ifndef PROJECT_FIRSTORDERIIRFILTER_H #define PROJECT_FIRSTORDERIIRFILTER_H #include <cmath> /*! * First Order Filter * @tparam T : type of the data to be filtered * @tparam T2 : floating point type for the cutoff/sample frequencies,...
ALGO
0.998872
6.468503
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2019-06-17T20:27:11.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2931, "forks": 985, "issues": 55, "pull_requests": 5 }, "file_meta": { "content_id": "19eee...
15cf2cea-936a-4edb-8805-c91031190b86
shihyu/learn_c
細談資料結構/ch7/cpp/7-2-1Bubble.cpp
/*========================================================= 7-2-1節 氣泡排序法 Bubble_Sort() 氣泡排序法函式 a[ARR_NUM] 欲排序之資料 ARR_NUM 欲排序之資料數目(陣列大小) ========================================================= */ #include <iostream.h> #define ARR_NUM 9 void B...
ALGO
0.999775
4.133434
{ "github_metadata": { "branch": "master", "commit_count": 181, "repo_created_at": "2013-10-24T16:56:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 37, "forks": 23, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "693d68...
74336009-3018-4ee8-86b4-cc9e37492854
Takahiro3D/AtCoder
src/abc407/abc407_c/main.cpp
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; (i) < (int)(n); ++(i)) #define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++(i)) #define REP_R(i, n) for (int i = (int)(n) - 1; (i) >= 0; --(i)) #define REP3R(i, m, n) for (int i = (int)(n) - 1; (i) >= (int)(m); --(i)) #define ALL(x) ::std::begin(x), ::std...
ALGO
0.998545
4.228298
{ "github_metadata": { "branch": "archive/v3.x", "commit_count": 64, "repo_created_at": "2024-03-17T13:04:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "eb6...
280fa127-4b23-4cbb-bb63-e6a421693cfa
Manan-jn/CoDing-Problems
LinkedList/insert_list.cpp
#include <iostream> using namespace std; class Node { public: int data; Node *next; }; void pushFront(Node **head, int data) { //Need to add the node at the front //Allocating a new node Node *new_node = new Node(); //Adding data new_node->data = data; //Changing the pointers new_no...
ALGO
0.999195
4.804866
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2021-08-14T17:03:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "13b4112b6b8...
fe441de2-dd9f-49c8-a483-5f6dc391b43a
love-searcher/Compiling-principle
LR(K).cpp
#include <iostream> #include <iomanip> #include <map> #include <vector> #include <string> #include <queue> using namespace std ; void read_grammar(char& start, vector<char>& N, vector<char>&T, vector<pair<char,string> >& productions); // here void read_LR_table( vector<vector<pair<char,int> >>& table ); void LR_a...
ALGO
0.999076
3.502075
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2019-03-21T15:20: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": "2bf0fedc9...
e2820edb-c402-491d-bd8d-95c93b30b851
ishandutta2007/codeforces-a
arbuzick/normal/1696/F.cpp
#include <bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; vector<vector<string>> a(n); for (int i = 0; i + 1 < n; ++i) { a[i].resize(n - i - 1); for (int j = 0; j < n - i - 1; ++j) { cin >> a[i][j]; } } for (int i = 1; i < n; ++i) { ...
ALGO
0.999979
5.0291
{ "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": "291adc0e48e1...
7ecf5a62-83ac-41ef-90d8-aae242d4336d
HUSTERGS/HUSTCS
汇编/code_3/bc31/DISK_C/BORLANDC/TVISION/DOCDEMOS/TVGUID19.CPP
/*---------------------------------------------------------*/ /* */ /* Turbo Vision 1.0 */ /* TVGUID19.CPP Demo Source File */ /* Copyright (c) 1991 by Borland International */ /* ...
ALGO
0.998171
5.992498
{ "github_metadata": { "branch": "master", "commit_count": 85, "repo_created_at": "2018-11-11T01:48:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 161, "forks": 34, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1674c9...
8d1a074f-0e79-4556-ad58-ca7408e587c2
FeiZhan/Algo-Collection
answers/leetcode/Lowest Common Ancestor of a Binary Tree/Lowest Common Ancestor of a Binary Tree.cpp
//@type Tree //@time complexity O(n) //@space complexity O(log(n)) //@result 31 / 31 test cases passed. Status: Accepted Runtime: 24 ms Submitted: 0 minutes ago You are here! Your runtime beats 27.36% of cpp submissions. /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *le...
ALGO
0.999996
6.230731
{ "github_metadata": { "branch": "master", "commit_count": 350, "repo_created_at": "2012-03-19T10:51:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 13 }, "file_meta": { "content_id": "43d3b12...
e96f3cf7-08e1-479f-8f31-bfee26fa4f6d
ChristopherAbram/Numerical-Methods
5. Dekompozycja LU i Eliminacja Gaussa/ProgramExtra/ProgramExtra/LUDecomposition.h
#ifndef __LUDECOMPOSITION #define __LUDECOMPOSITION #include<vector> #include "Matrix.h" #define BASIC_GAUSSIAN 1 #define PARTIAL_SELECTION 2 #define SCALABLE_CHOICE 3 #define FULL_SELECTION 4 /* LU - decomposes matrix U to LU representation. * Matrix L has ones on its diagonal (L[i][i] = 1 for each i = 0...
ALGO
0.998911
6.066353
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2017-02-01T19:32:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "acf928b96...
bce8b382-ce4d-4904-8f3f-3577bf758aae
AghlaAbdo/42_CPP
CPP_09/ex02/PmergeMe.cpp
#include "PmergeMe.hpp" // std::vector container void ParseArgs(std::vector<std::string> args) { std::vector<std::string>::iterator it; for (it = args.begin(); it != args.end(); it++) { for (size_t i = 0; i < it->size(); i++) { if (!(it->at(i) >= '0' && it->at(i) <= '9')) throw std::runtime_error("Error");...
ALGO
0.998446
4.767648
{ "github_metadata": { "branch": "master", "commit_count": 55, "repo_created_at": "2024-12-26T21: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": "be308c100...
ea4a46c7-3da6-4151-a070-1ea4e4565a0f
TomoyoSang/Online-Judge
Code/4025俞勇第三次作业/4025俞勇第三次作业/4025.cpp
#include <iostream> #include <cstdio> using namespace std; int M, N; int Height[250002]; double High = 0; long long V; double Vi = 0; int counter; int g = 0; void Quicksort(int left, int right) { if (left == right)return; else if (left - right == 1)return; else { int key = Height[left]; int tmp1 = left; int...
ALGO
0.999992
3.426419
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2019-06-04T05:14:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a33c63e60b...
904da155-7b16-4c66-ba9e-c4f0378d44b7
ToolTech/CSWUnreal
Plugins/CSWPlugin/Source/ThirdParty/CSW/GizmoBase/include/gzHammingSort.h
//***************************************************************************** // // Copyright (C) SAAB AB // // All rights, including the copyright, to the computer program(s) // herein belong to SAAB AB. The program(s) may be used and/or // copied only with the written permission of SAAB AB, or in // accordance with...
ALGO
0.999905
4.697293
{ "github_metadata": { "branch": "main", "commit_count": 116, "repo_created_at": "2024-11-22T09:55:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "243fd86feb...
c0c244a3-cd61-4764-a3b6-e387888bb585
Amitsengupta332/Basic-Data-Structures
Module 7/delete_at_tail.cpp
// #include <bits/stdc++.h> // using namespace std; // class Node // { // public: // int val; // Node *next; // Node(int val) // { // this->val = val; // this->next = NULL; // } // }; // void insert_a_tail(Node *&head, Node *&tail, int val) // Notice the & for reference // { // ...
ALGO
0.999738
5.348131
{ "github_metadata": { "branch": "main", "commit_count": 141, "repo_created_at": "2025-06-15T17:02: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": "eacfb63484...
0e5a41df-f35f-4070-985a-4b203a37586e
SergioFernandez55/Proyecto-Paralela-1
main.cpp
#include <iostream> #include <omp.h> #include <string> #include "Simulador.h" using namespace std; int main() { int numPersonas; float potenciaVirus; float probRecuperacion; float probMuerte; float porcentajeIntectados; int tamano; int duracion; std::vector <std::string> salidas; cout << "Ingrese la cantid...
ALGO
0.996614
4.059741
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2018-09-24T21:46: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": "b367dbce21...
aef27461-7f7f-49c8-b955-3d37e9df5ab4
thegamer1907/Code_Analysis
contest/1542581292.cpp
#define DEBUG 0 #include <algorithm> #include <functional> #include <numeric> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <complex> #include <cstdlib> #include <ctime> #include <cstring> #include <cassert> #include <string> #include <vector> #include <list> #incl...
ALGO
0.999919
3.783637
{ "github_metadata": { "branch": "master", "commit_count": 73, "repo_created_at": "2019-05-24T10:35:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "adff16881...
f57755d0-897d-4583-8412-06d54bee185b
Aris12122/HSEC-HW
tasks/archiver/src/Huffman/huffman.cpp
// // Created by aris on 10/21/22. // #include "huffman.h" #include "iostream" void Huffman::BuildTrie(std::vector<std::pair<Symbol, Symbol>> symbol_code) { root = std::make_unique<Trie>(); for (const auto &[symbol, code] : symbol_code) { TrieAddSymbol(root, code, symbol); } } void Huffman::TrieAdd...
ALGO
0.999734
4.657636
{ "github_metadata": { "branch": "main", "commit_count": 249, "repo_created_at": "2022-10-25T10:33: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": "46377a35f1...
6282ee78-2090-40da-89fc-89f6b813813b
Yarramneni-vasavi/MissionRnD-C-LinkedLists2-Worksheet
src/insertAtEveryKthNode.cpp
/* OVERVIEW: Given a single linked list insert a new node at every Kth node with value K. E.g.: 1->2->3->4->5, k = 2, 1->2->2->3->4->2->5 INPUTS: A linked list and Value of K. OUTPUT: Insert a new node at every Kth node with value K. ERROR CASES: Return NULL for error cases. NOTES: */ #include <stdio.h> #include <...
ALGO
0.990475
4.146017
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2016-03-23T17:38: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": "e2fcef594f...
a5119ea5-1ced-4ec3-b9e0-aab9758775cd
ishandutta2007/codeforces-n
nigus/normal/1284/D.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for(int i = a; i < (b); ++i) #define per(i, b, a) for(int i = b - 1; i >= a; i--) #define trav(a, x) for(auto& a : x) #define all(x) x.begin(), x.end() #define sz(x) (int)(x).size() #define hash dhsjakhd typedef long long ll; typedef pair<int, int> pii...
ALGO
0.999846
4.396075
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:35: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": "39f2020da37f...
79f6ae39-8294-4070-bcb0-f63d3469a3d7
seipan1213/AtCoder
ABC145/c.cpp
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int,int>; int dy[]={1,0,-1,0}; int dx[]={0,1,0,-1}; const int INF=1e10; int xy[10][2]; double dist(int i, int j) { double dx = xy[i][0] - xy[j][0]; double dy = xy[i][1] - xy[j][1];...
ALGO
0.999652
3.512931
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2022-04-04T01:28: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": "d8f096eab...
de301d6c-aad8-4d68-a90f-6e88b9c7d8dd
feiran-l/Static-SLAM-With-PSPnet
src/ICslam.cpp
#include "ICnet.h" cv::Mat imgSegAndDynamicRemove(cv::Mat& img, caffe::Net<float>* _net); int main(int argc, char *argv[]) { int keyframe_count = 0; int new_pcl_count = 0; ParameterReader pd; int startIndex = atoi(pd.getData("start_index").c_str()); int endIndex = atoi(pd.getData("end_index").c_st...
ALGO
0.985864
3.82252
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2017-12-21T01:10:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 5, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "257d747da...
e47a80f5-9422-4d81-ad16-e3339deaa34e
weiyeli/interview-by-richard
Offer/offer-68-2/main.cpp
#include <iostream> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} }; class Solution1 { public: TreeNode* ans; // 递归方法 TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) { ...
ALGO
0.999993
5.751383
{ "github_metadata": { "branch": "master", "commit_count": 45, "repo_created_at": "2020-04-27T16:00: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": "3f683f2bf...
80a1e4d8-c187-415f-a75b-30279e1ca4f3
Aditya-A-garwal/cses
sorting_searching/subarray_sums_2.cpp
#pragma GCC optimize("Ofast") #include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; template<typename T> using ordered_set = tree<T, null_type,...
ALGO
0.999951
4.134824
{ "github_metadata": { "branch": "main", "commit_count": 35, "repo_created_at": "2021-07-02T10:44:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e63a02d7d73...
7cb5877a-55af-462f-a114-e9ca349c1137
Twelvecat/C-
2.1/2.1/2.1.cpp
#include <iostream> using namespace std; int main() { int r(0); const double pi = 3.1415926; auto area = 0., sum = 0.; area = pi * r * r; sum += area; cout << "The area is" << area << "\n The sum srea is \t" << sum << endl; ++r; area = pi * static_cast<double>(r * r); sum += area; cout << "The area is " << ...
TOOL
0.977222
3.524069
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-12-16T16:11:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "75c06d8e05...
f40c5278-2f8a-4158-807e-207bdb99bdad
ZJLi2013/ck_tile_light
example/ck_tile/99_toy_example/03_flash_attention_fwd/flash_attention_fwd_debug.hpp
// SPDX-License-Identifier: MIT // Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved. #pragma once #include "ck_tile/core.hpp" #include "ck_tile/ops/common.hpp" #include "ck_tile/ops/gemm/warp/warp_gemm.hpp" #include "ck_tile/core/tensor/tile_distribution.hpp" #include "../../../example/ck_ti...
ALGO
0.999019
5.758819
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2025-05-22T03:25:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b57c8506226f...
fbedfcb0-97a6-43ee-a407-9fd557e20b44
objectnotfound/OJ
9Du/9du-1431-sort/9du-1431-sort/9du-1431-sort.cpp
//数据量并不是问题啊,用sort和qsort都是OK的 #define _CRT_SECURE_NO_WARNINGS #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; int num[1000000]; int cmp(const void* a, const void* b){//返回1的时候,表示a排在b【后面】 return *(int*)a > *(int*)b; //升序 } //对于qsort而言: ①形参形式很重要,这里都是两个空指针 ②返回值只能是int bool...
ALGO
0.999995
3.09352
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2016-04-28T06:47: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": "abed49b042...
13080135-c282-4186-bc5b-34cafb8212cf
bbanerjee/ParSim
Vaango/src/testprograms/Regridders/GBRv2Regridder.cc
/* * The MIT License * * Copyright (c) 2013-2014 <NAME>, New Zealand * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights t...
ALGO
0.955467
5.836685
{ "github_metadata": { "branch": "master", "commit_count": 1630, "repo_created_at": "2013-10-16T03:15:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 21, "forks": 5, "issues": 5, "pull_requests": 0 }, "file_meta": { "content_id": "4f8d65...
3636f8f6-25d1-42a1-b58f-94c4cd28b74c
TreverWagenhals/private
School/Data Structures/Fall 2017/Program 9/Heap_T.h
/************************/ /* <NAME> */ /* PROGRAM 9 */ /* December 6, 2017 */ /************************/ #ifndef HEAP_H #define HEAP_H #include <iostream> #include <climits> #include <cassert> #include "CursorCntl.h" template <typename ElemData, unsigned Capacity> class Heap { public: // Construc...
ALGO
0.998987
5.020555
{ "github_metadata": { "branch": "master", "commit_count": 113, "repo_created_at": "2016-11-15T08:32:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "03ca2d85...
24fd5dcd-c62e-4430-a9a6-0da432085590
x-team/community-coding-challenges
leetcode/1 - twosum/two_sum.cpp
// Time complexity: O(N) - linear (tamanho do vetor) // A estrutura de dados map pode ser implementada de duas formas, utilizando o conceito de árvore rubro-negra // ou Hash table. cada estrutura possui vatangens/desvantagens. No exercício em questão a implementação baseada // em Hash table faz muito mais sentido, vis...
ALGO
0.999978
6.154359
{ "github_metadata": { "branch": "main", "commit_count": 44, "repo_created_at": "2021-08-06T03:17:50.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 127, "forks": 33, "issues": 0, "pull_requests": 18 }, "file_meta": { "content_id": "ab3f0b12...
22f251a5-0917-4986-b463-8838c02e60ec
onvungocminh/The-Dahu-distance
mln/core/algorithm/accumulate.hpp
#ifndef MLN_CORE_ALGORITHM_ACCUMULATE_HPP # define MLN_CORE_ALGORITHM_ACCUMULATE_HPP # include <mln/core/image/image.hpp> # include <mln/accu/accumulator.hpp> namespace mln { template <typename I, class AccuLike, class Extractor = accu::default_extractor> typename accu::result_of<AccuLike, mln_value(I), Extracto...
TOOL
0.976045
6.885396
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2018-09-21T11:12: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": "e06dbed7d4...
93919b4c-e1d1-47ce-9718-41716e7139b7
ductoris/Sensor
Boloc.ino
#include <Wire.h> // === Biến cảm biến === float RateRoll, RatePitch, RateYaw; float AccX, AccY, AccZ; float AngleRoll, AnglePitch; // === Bộ lọc: Trung bình === #define MA_SIZE 10 float ma_buffer[MA_SIZE]; int ma_index = 0; float ma_sum = 0; // === Bộ lọc: Trung vị === float median_buffer[MA_SIZE]; // === Bộ lọc: ...
ALGO
0.991536
4.329415
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-04-10T13:00:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "05a6d94c0fc5...
1b066aea-a4b3-4afe-b36a-5df7d11bbfa6
4coder-community/4cc
non-source/test_data/lots_of_files/app_color.cpp
/* * 4tech experiments * by <NAME> * 20.08.2015 (dd.mm.yyyy) * */ // TOP global Vec4 black = {0.f, 0.f, 0.f, 1.f}; global Vec4 white = {1.f, 1.f, 1.f, 1.f}; global Vec4 gray = {0.5f, 0.5f, 0.5f, 1.f}; global Vec4 red = {1.f, 0.f, 0.f, 1.f}; struct real32_Rect{ real32 x0,y0,x1,y1; }; inline real32_Rect re...
TOOL
0.927206
3.823075
{ "github_metadata": { "branch": "master", "commit_count": 2339, "repo_created_at": "2022-10-18T10:28:01.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 67, "forks": 29, "issues": 3, "pull_requests": 10 }, "file_meta": { "content_id": "6d485...
f6dc26b9-f695-4436-b3bd-37fc986ad341
ritika-saha/DSA-Archive
Phone Number letter combination.cpp
/** Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. A mapping of digits to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters. Example 1: Input: digits =...
ALGO
0.999957
6.528781
{ "github_metadata": { "branch": "main", "commit_count": 116, "repo_created_at": "2022-03-10T16:34:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b1a1f0b593...
9020b2eb-72e5-4847-aaaa-dadea4cd6090
tiqwab/atcoder
keyence2019/d/main.cpp
#include <algorithm> #include <iostream> #include <vector> #include <limits.h> using namespace std; typedef long long ll; template<class T> inline bool chmax(T &a, T b) { if(a < b) { a = b; return true; } return false; } template<class T> inline bool chmin(T &a, T b) { if(a > b) { ...
ALGO
0.999997
4.331739
{ "github_metadata": { "branch": "master", "commit_count": 236, "repo_created_at": "2019-10-21T04:57: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": "4e4c6ffe...
78f95cc1-4af5-4a87-9738-2d52132ace17
UniiiX/year-2
semester 2/Lab1/part2/FinalState/BinarySearchTree.h
#ifndef BINARYTREE_H #define BINARYTREE_H #include <iostream> template <typename K, typename V> class BinarySearchTree { protected: struct Node { Node* left; Node* right; Node* parent; K key; V value; Node(const K & key, const V & value): key(key), ...
ALGO
0.999562
5.886143
{ "github_metadata": { "branch": "master", "commit_count": 304, "repo_created_at": "2018-10-02T20:24: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": "d008df28...
65ca1ca7-3adb-49f2-aca9-2f8ed0f6ef5f
pomelo925/nthu-IDS-2024-spring
2. Assignments/2-1/Game/stupid.cpp
//https://acm.cs.nthu.edu.tw/contest/2971/ #include <bits/stdc++.h> using namespace std; int N; // 總人數 unordered_map<int,bool> penguin; void game(const int T, const int A, const int B){ vector<int> tmp; // A 不存在 if(!penguin[A]) { cout << "Penguin07 QQ\n"; return; } // 殺後面的 ...
ALGO
0.999586
3.971111
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2024-03-12T05:49: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": "0e48d7f65c1...
3e99c025-b58d-40bd-a3d4-5d739b664f16
OSCC-Project/iEDA
src/operation/iSTA/source/module/sta/StaLevelization.hh
// *************************************************************************************** // Copyright (c) 2023-2025 Peng Cheng Laboratory // Copyright (c) 2023-2025 Institute of Computing Technology, Chinese Academy of // Sciences Copyright (c) 2023-2025 Beijing Institute of Open Source Chip // // iEDA is licensed un...
ALGO
0.966134
4.843606
{ "github_metadata": { "branch": "master", "commit_count": 3908, "repo_created_at": "2022-08-28T06:18:01.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 396, "forks": 44, "issues": 8, "pull_requests": 1 }, "file_meta": { "content_id": "d6661...
6cc1c9da-ac34-4252-a869-976c917d0475
ZLDL/Anakin
saber/funcs/softmax.h
/* Copyright (c) 2018 Baidu, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicabl...
ALGO
0.949037
6.890793
{ "github_metadata": { "branch": "master", "commit_count": 59, "repo_created_at": "2018-07-17T03:37:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5ed6d4e92...
701b81be-9eac-4246-8719-be1ee9d2470f
rcppmlpack/RcppMLPACK1
inst/include/mlpack/methods/range_search/range_search_impl.hpp
/** * @file range_search_impl.hpp * @author <NAME> * * Implementation of the RangeSearch class. * * This file is part of MLPACK 1.0.10. * * MLPACK 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 Foundatio...
ALGO
0.997343
7.088503
{ "github_metadata": { "branch": "master", "commit_count": 102, "repo_created_at": "2014-06-09T23:40:32.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 60, "forks": 14, "issues": 7, "pull_requests": 0 }, "file_meta": { "content_id": "3f04098...
ba81fa40-a9b3-4556-a257-29187b36d698
Robxley/Biohazard
biohazardmod/src/BHM_ImProc.cpp
#include "BHM_ImProc.h" #include "BHM_ExceptionTracking.h" namespace bhd::imgproc { void Hysteresis(const cv::Mat& base, const cv::Mat& marker, cv::Mat& dst, int connectivity) { BEGIN_EXCEPTION_TRACKER; std::vector<std::vector<cv::Point>> vContours; cv::findContours(marker, vContours, cv::RETR_CCOMP, cv::CHAIN...
ALGO
0.948596
4.309763
{ "github_metadata": { "branch": "master", "commit_count": 69, "repo_created_at": "2020-11-22T18:23: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": "facc096e2...
4eb80b97-eed8-4a9f-852e-d22d7d613d4b
systy257/mmmf
starshaya-pseudo-3d.cpp
#include <iostream> #include <cmath> #include <windows.h> #include <vector> using namespace std; const int SCREEN_WIDTH = 500; // ширина экрана в символах. берем ее из свойств окошка консоли const int SCREEN_HEIGHT = 120; // высота экрана в символах. Аналогично const double SPEED = 0.02; // ...
TOOL
0.957994
4.149945
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2025-01-05T06:51: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": "33225e556231...
d1be01d5-6c57-4c59-87e8-cf2232eb0eaa
sswTarget/BowlingScore
bowling_score.cpp
#include <iostream> #include <vector> std::vector<int> parse_input(int argc, char *argv[]) { /* Check to see if the number of throws are within the limits of a * valid game before we bother to parse it. */ if(argc < 13) throw std::invalid_argument("too few throws entered"); if(argc > 22) throw st...
ALGO
0.986056
6.775257
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2018-09-27T23:45: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": "647c2ecdc1...
59e6ac18-c23a-4b4e-839c-c969ac32375a
GilbertKrantz/Coding-Webe-Kuliah
Catatan/Semester-2/Personal/Single-Linked-List.cpp
#include <stdio.h> #include <stdlib.h> struct node { int number; node *next; } *head = NULL, *tail = NULL; node *create_node(int n) { node *new_node = (node*) malloc(sizeof(node)); new_node->number = n; new_node->next = NULL; return new_node; } void push_head(node *create_node) { node *...
ALGO
0.999871
4.449832
{ "github_metadata": { "branch": "main", "commit_count": 76, "repo_created_at": "2022-11-28T05:36: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": "be1cb6a0252...
2cd4e8af-b523-4e35-94c2-35b21cd9e7fe
NguyenManhPhuoc/OOP
canbocongnhan.cpp
#include<bits/stdc++.h> #include<string> using namespace std; class Canbo{ private: string mcb,ht; bool gt; public: Canbo(){ mcb=ht=""; gt=0; } Canbo(string mcb,string ht,bool gt){ this->mcb=mcb; this->ht=ht; this->gt=gt; } void nhap(){ cout<<"Nhap ma can bo: "; cin>>this->mcb; cin....
TOOL
0.993095
3.313168
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-11-11T00: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": "d2435e3140a6...
a54be290-04f5-4483-a88f-94ef193640ae
ubarba18/UCM-CSE-30
Lab09/LinkedList.cpp
#include <iostream> #include "LinkedList.h" using namespace std; //Exercise 1 LinkedList::LinkedList() { //Constructor, Starts off null first = NULL; //Head last = NULL; //Tail } LinkedList::~LinkedList() { //Destructor Node* temp = first; Node* nextNode = first; while(temp != last) { temp = nextNode; de...
TOOL
0.946018
3.793613
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-10-05T18:34: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": "37efb9411c54...
58e59f4d-483b-4f58-aeab-b2c46ec93f18
dorian-404/game-rock-paper-scissors
Jeu du pierre papier ciseaux.cpp
#include <iostream> #include <cstdlib> #include <ctime> #include <string> using namespace std; int main() { // Déclaration des variables int nombreDeTours = 0; const string ROCHE = "Roche"; const string PAPIER = "Papier"; const string CISEAUX = "Ciseaux"; string userInput = " "; string user...
TOOL
0.955695
4.305244
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-02-18T14:34: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": "f9efcd967dc7...
0be959bd-33cd-4209-829a-238fe51371d9
Mahak008/Data-Structures-and-Algorithms
Sorting/Bubble Sort.cpp
// Push largest element at the end int arr[] = {13, 46, 24, 52, 20, 9}; for(int i = n-1; i >= 0; i--) { int sw = 0; for(int j = 0; j <= i-1; j++) { if(arr[j] > arr[j+1]) { swap(arr[j], arr[j+1]); sw = 1; } } if(sw == 0) { break; } } // Recursion void bubbleSort(int arr[], int n) { ...
ALGO
0.999914
5.624025
{ "github_metadata": { "branch": "main", "commit_count": 1194, "repo_created_at": "2023-07-14T04:18: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": "964de7f04...
be827315-25e1-4d06-bba6-52d41feef8cb
rainlee/leetcode-jecklee
SimplifyPath.cpp
/*** * 分割字符串 分割符 '/',模拟栈 * 一个'.' 忽略 * 两个'.' 回退 * 多个'/' 只保留一个 * "/.." * "/" * "/..." 输出 "/..."? * "/..hidden" 输出 "/..hidden" * 重新梳理一下规则: * 检查两个'/'中间的字符串,如果为空或者"."则忽略 * 是".."则回退,其他的均保留(包括多个'.')! * 为方便处理,在path末尾添加一个'/' ***/ /* class Solution { public: string simplifyPath(string path) { vector<stri...
ALGO
0.999539
4.651207
{ "github_metadata": { "branch": "master", "commit_count": 184, "repo_created_at": "2014-05-27T16:30:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8055850e...
1fa03f34-bf0f-492d-aa39-7d2e2bbcd3dc
ZYBO-o/Skill-Accumulation
秋招经历/算法手撕/Tree/二插搜索树/7 验证二插搜索树.h
#include "BSTree.h" #include <stack> using TreeNode = BSTreeNode; class Solution2 { public: TreeNode* pre = NULL; // 用来记录前一个节点 bool isValidBST(TreeNode* root) { if (root == NULL) return true; bool left = isValidBST(root->left); if (pre != NULL && pre->val >= root->val)...
ALGO
0.999996
5.558342
{ "github_metadata": { "branch": "main", "commit_count": 184, "repo_created_at": "2021-03-03T11:01:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8cad1fa0e3...
7d17203f-2fa6-4cec-a826-991e64269818
igorodinskiy/Laboratory_work_SN-11
Laboratory_work_7.cpp
#include <iostream> #include <cstdlib> using namespace std; int main() { cout << "PROGRAM ONE" << endl; int counter = 0, m = 5, n = 4, b[m][n], i = 0, j = 0; for ( i = 0; i < m; i++ ) for ( j = 0; j < n; j++ ) b[i][j] = rand()%100-50; cout << "Massif B:" << endl; for ( i = 0; i < m; i++ ) { for ( j = 0; j < ...
ALGO
0.918812
3.203888
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2015-10-02T07:24: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": "f5c074c2f4...
754f0806-fb77-4441-940a-98f5b87ff958
micheeeeell/AtCoder
dif_cites/yukicoder/243/C.cpp
#define _GLIBCXX_DEBUG #include<bits/stdc++.h> using namespace std; #define rep(i,x) for(ll i = 0; i < (ll)(x); i++) #define rrep(i,x) for(ll i = (ll)(x)-1;0 <= i; i--) #define reps(i,x) for(ll i = 1; i < (ll)(x)+1; i++) #define rreps(i,x) for(ll i = (ll)(x); 1 <= i; i--) #define debug(x) cerr << #x << ": " << (x) << "...
ALGO
0.999475
4.04989
{ "github_metadata": { "branch": "master", "commit_count": 237, "repo_created_at": "2019-06-21T04:33: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": "5c321492...
2997b502-8573-4e30-8582-6a3867742616
Ahmedabdelalem61/data-structures
section 10 : Binary search Tree/06 Homework 2 - 3 Medim Challenges/p2-p3.cpp
#include <iostream> #include <cassert> #include <vector> #include <queue> #include <stack> #include <algorithm> using namespace std; class BinarySearchTree { private: int data { }; BinarySearchTree* left { }; BinarySearchTree* right { }; public: BinarySearchTree(int data, BinarySearchTree* left = nullptr, Binary...
ALGO
0.999972
5.147939
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2022-03-02T16:38: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": "0b020c0678f...
f21e2e81-4d57-4a57-8f15-32eac2fdded4
r00tDada/competitive_programming
snippet/lazy_tree.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (__typeof((b)) i = (a); i < (b); i++) #define nrep(i, a, b) for (__typeof((b)) i = (a); i > (b); i--) #define all(a) (a).begin(), (a).end() #define F first #define S second #define ppi pair<int, int> #define pppi pair<ppi, int> #define vi vector<int...
ALGO
0.999737
5.495286
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-12-20T07:59:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b02b6367e43d...
ea797645-507a-418a-babc-8984ec11aa9d
nxhhoang/MarisaOJ-roadmap-solution
Roadmap/level 2/Meet in the middle/Introduction to meet in the middle/Maximum sum subset/code.cpp
// nxxhoang - the dreamer #include <bits/stdc++.h> #define FOR(i, a, b) for (int i = a; i < (int)b; i++) #define endl '\n' #define ub upper_bound // find X < min(x) #define lb lower_bound // find X <= min(x) #define all(a) (a).begin(), (a).end() #define pii pair<int, int> #define pll pair<ll, ll> #define vi vector<int...
ALGO
0.999979
4.04378
{ "github_metadata": { "branch": "main", "commit_count": 627, "repo_created_at": "2024-12-31T10:12:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cbd73d3b99...
ce31c47b-f379-471c-be79-cd256278c491
Camithilwen/Code-Cloning-Analysis
src/llm-scripts/testing/Project_CodeNet_experimentation_dataset/data/p03312/s988541893.cpp
#pragma target("avx") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll, ll> P; typedef vector<ll> V; typedef unordered_map<ll, ll> U_MAP; typedef priority_queue<ll> pq; typedef priority_queue<ll, vector<ll>, greater<ll>> rpq; const int INF = 1e9, MOD = 1e9 + ...
ALGO
0.999923
3.609837
{ "github_metadata": { "branch": "main", "commit_count": 243, "repo_created_at": "2025-06-06T16:57:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "a6f2c3a74e...
e0970b93-cd1c-4d04-b92e-39e8e154310b
ArchaeaSoftware/cudahandbook
nbody/nbody_CPU_SSE_openmp.cpp
/* * * nbody_CPU_SSE_openmp.cpp * * Multithreaded SSE CPU implementation of the O(N^2) N-body calculation. * Uses SOA (structure of arrays) representation because it is a much * better fit for SSE. * * Copyright (c) 2011-2012, Archaea Software, LLC. * All rights reserved. * * Redistribution and use in source...
ALGO
0.99974
5.635337
{ "github_metadata": { "branch": "master", "commit_count": 447, "repo_created_at": "2012-06-15T08:24:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 529, "forks": 192, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "8740...
43dbb76f-5b5a-4eb2-a954-a6c5b77f15ae
reddy-lab-code-research/MuST-CoST
data/transcoder_evaluation_gfg/cpp/WRITE_A_C_PROGRAM_TO_FIND_THE_PARITY_OF_AN_UNSIGNED_INTEGER.cpp
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // #include <iostream> #include <cstdlib> #include <string> #include <vector> #include <fstream> #include <iomanip> #include...
TEST
0.989775
5.503995
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2022-02-08T19:28:59.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 11, "forks": 5, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "2daa683cc6d...
5c9f13d0-ce60-49f7-8c4b-63f474420d80
HarudaySharma/DSA
Trees/leetcode/235.cc
#include<bits/stdc++.h> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode() : val(0), left(nullptr), right(nullptr) {} TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(...
ALGO
0.999996
6.406458
{ "github_metadata": { "branch": "main", "commit_count": 33, "repo_created_at": "2024-02-17T01:01: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": "123838276db...
88275b62-fe27-41a5-a46d-59256a0ae530
truongcongthanh2000/TrainACM-ICPC-OLP
2019 ICPC East-Central NA Regional Contest/I.cpp
#pragma GCC diagnostic ignored "-Wunused-parameter" #include <bits/stdc++.h> using namespace std; #define INP "solve" #define OUT "solve" const long long INF_LL = 1e17; const int INF = 1e9 + 100; const int MOD = 1e9 + 7; const int Base = 30; const double EPS = 1e-9; const int BLOCK = 1000; const int dx[4] = {-1, 0,...
ALGO
0.999724
3.863659
{ "github_metadata": { "branch": "master", "commit_count": 261, "repo_created_at": "2020-01-13T11:13:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 94, "forks": 22, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "260005...
676b1914-ac94-4e1b-b8fb-52de69257a36
divyanshu29jha/DSA
Arrays/Pascal's-Triangle.cpp
// M-1) Brute force --> T.C: O(n^2), S.C: O(n) for temp vector /* class Solution { public: vector<vector<int>> generate(int numRows) { vector<vector<int>> ans; if(numRows >= 1){ ans.push_back({1}); } if(numRows >= 2){ ans.push_back({1,1}); } ...
ALGO
0.99999
6.749301
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2023-08-18T03:35: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": "8e478810c0...
983a3af9-5b9c-408b-bec2-c2a59f010df8
jalotra/Codeforces_Submissions
codeforces/1450/B.cpp
#include <bits/stdc++.h> using namespace std; #define sim template < class c #define ris return * this #define dor > debug & operator << #define eni(x) sim > typename \ enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) { sim > struct rge { c b, e; }; sim > rge<c> range(c i, c j) { return rge<c>{i, j}; } s...
ALGO
0.999945
4.43609
{ "github_metadata": { "branch": "master", "commit_count": 165, "repo_created_at": "2021-01-21T12:44: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": "4414fad9...
3b8f4b4e-5657-4058-8f0a-07eccd3b504f
alexandraback/datacollection
solutions_2463486_1/C++/nakari1124/C-large1-0.cpp
#include <iostream> #include <string> #include <cstdio> #include <vector> #include <algorithm> #include <functional> #include <map> #include <cmath> #include <set> using namespace std; typedef long long i64; typedef int int_t; typedef vector<int_t> vi; typedef vector<vi> vvi; typedef pair<int_t, int_t> pi; #define ...
ALGO
0.999237
4.125165
{ "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": "4b889cf58...
02e9dfa6-60db-414e-85d4-e8f46b9629e3
mostafa-saad/MyCompetitiveProgramming
Olympiad/POI/official/2015/code/odw/prog/odw2.cpp
/****************************************************************************** * * * XXII Olimpiada Informatyczna * * * ...
ALGO
0.999945
3.522111
{ "github_metadata": { "branch": "master", "commit_count": 439, "repo_created_at": "2017-02-05T22:26:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 415, "forks": 85, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bc392...
e4382d5c-3811-4ea5-b83f-ae812d90fc4a
cambyse/tamp
apps/lgp-tree-po-blocks-explo-franka/main.cpp
#include <functional> #include <list> #include <chrono> #include <boost/filesystem.hpp> #include <boost/accumulators/accumulators.hpp> #include <boost/accumulators/statistics/stats.hpp> #include <boost/accumulators/statistics/mean.hpp> #include <boost/accumulators/statistics/min.hpp> #include <boost/accumulators/stati...
ALGO
0.996104
5.69253
{ "github_metadata": { "branch": "master", "commit_count": 204, "repo_created_at": "2024-12-13T13:58: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": "1231c4e5...
c992fcbe-c771-40b6-bebb-563bcbef6295
AbdelrahmanMohamedd/DataStructure-Assig1
A1_P1_20170148_20170301_20170379_Big Decimal int/main.cpp
// Faculty of Computers and Information /// CS214 - Data Structure - Assignment 1 - Task 1 : Big Decimal Int // Date: 8/3/2019 /// Student 1: <NAME> ID:20170148 G:10 /// Student 2: <NAME> ID:20170301 G:10 /// Student 3: <NAME> ID:20170379 G:10 ///==============================================...
ALGO
0.919095
4.383412
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-07-06T16:40: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": "f01d3a6ba3...
19e2310a-b214-46f8-acd5-f6122a23efb1
tipsyfermion/ESO207
PA_1/triangle_migration_power.cpp
/* ######################################### # Solution by <NAME> # # Roll No: 190254 # # Email-id: <EMAIL> # # Hackkerrank-id: @debbh922 # ######################################### */ #include <iostream> using namespace std; void matrix_mul(long...
ALGO
0.999978
4.038233
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2021-01-14T13:05: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": "c7e67acf1...
27017902-52c0-4456-adea-470879d9d745
Sunliangtai/CS241_Assignment
assignment6_LiangtaiSun_Windows/Assignment_6.cpp
#include <iostream> #include <limits> #include <ctime> #include <vector> #include <cstdlib> using namespace std; typedef float T; // Change the type here template<typename T> int Partition(vector<T> &A,int j,int left,int right) { vector<T> save_left,save_right; T save = A[j]; for(int i=left;i<right;i++) ...
ALGO
0.998799
4.18778
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2019-09-20T01:04: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": "645a29669...
41a900aa-0936-431e-880c-c401b7d24f0e
MukulKumar05/C-C-DSA-Programs-Of-Ineuron
Assignment-27 (Operator Overloading and Friend Function)/8_MatrixClassAndOperatorOverloadToNegateMatrixElements.cpp
/* 8. Consider a class Matrix Class Matrix { int a[3][3]; Public: //methods; }; Overload the - (Unary) should negate the numbers stored in the object. (done) */ #include<iostream> using namespace std; class Matrix { private: int a[3][3]; public: void inputMatrixData() { cou...
ALGO
0.995576
4.068614
{ "github_metadata": { "branch": "main", "commit_count": 37, "repo_created_at": "2022-07-10T14:59: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": "f534ff922fa...
b68a9617-1f8c-419f-a399-38fb6e4f6470
RebekahKoon/Dice-Game
Game.cpp
/********************************************************************* ** Program name: lab3 ** Author: <NAME> ** Date: 7/9/19 ** Description: Implementation file for the Game class, which has ** functions to find the number of rounds to be played ** in the dice game and the ...
TOOL
0.974503
3.135518
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-03-24T05:20: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": "9431a5dd9c...
4ea67682-f894-426b-ae9d-3a3fe38b7ff7
ren082215/LeetCode
src/cpp/0654-maximumBinaryTree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: TreeNode* constructMaximumBinaryTree(vector<int>& nums) { if (nums.empty()) return NULL...
ALGO
0.999989
6.34937
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2018-11-28T23:47:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "983e10cbc...
06555b31-eaa0-4c59-84e6-d41650d3de2b
ShreiderWalter/Diploma
Plugin/Private/Maps/Moisture/DistributorOfMoistures.cpp
#include "PolygonalMapGeneratorPrivatePCH.h" #include "MapDataHelper.h" #include "MoistureDistributor.h" void DistributorOfMoistures::SetGraph(UPolygonMap* Graph, int32 Size) { MapGraph = Graph; MapSize = Size; } void DistributorOfMoistures::AssignOceanCoastAndLand() { TQueue<int32> centerQueue; for (int32 i = 0;...
ALGO
0.99714
3.848706
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-05-31T18:22:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "79932fbf65...
eaeec7ea-bf18-434b-962a-b39cb3c8bcb3
pd-101e/dsa
Binary Trees/34) Find all Duplicate subtrees in a Binary tree [ IMP ].cpp
/* Structure of the node of the binary tree is as struct Node { int data; struct Node* left, *right; }; */ // you are required to complete this function // the function and return an vector of Node // which contains all the duplicate sub-tree unordered_map<string,int>mp; vector<Node*>ans; string solve(Node* root) { ...
ALGO
0.999643
5.950093
{ "github_metadata": { "branch": "main", "commit_count": 362, "repo_created_at": "2021-09-16T16:50: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": "5f8ad98285...
5aa5f0eb-a3a6-4e3d-be10-330ea3381c36
eyasir2047/Data-Structure-Algorithm
Dp/ 1143. Longest Common Subsequence.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int #define lll long long #define fo(i,n) for(ll i=0;i<n;i++) #define po(i,n) for(ll i=1;i<=n;i++) #define all(x) sort(x.begin(),x.end()) #define rall(x) sort(x.rbegin(),x.rend()) #define pb push_back #define rep(i,a,b) for(ll i=a;i<=b;i++) #define eya...
ALGO
0.999989
4.269318
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2022-09-08T19:21: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": "7899ce3aa7d4...
c0a57fde-6352-4dfb-b986-858d0ed4a637
CGAL/cgal
Triangulation_2/examples/Triangulation_2/low_dimensional.cpp
#include <iostream> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Triangulation_2.h> typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Triangulation_2<K> Triangulation; typedef Triangulation::Vertex_handle Vertex_handle; typedef Triangulation::...
ALGO
0.983923
4.959831
{ "github_metadata": { "branch": "master", "commit_count": 113659, "repo_created_at": "2014-10-01T12:22:47.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5443, "forks": 1475, "issues": 511, "pull_requests": 136 }, "file_meta": { "content_id...
9cb7cee9-a9f4-4e68-9e57-5628c5a8e3a3
ivanychev/learning
C/Onegin/main.cpp
/** @file main.c @mainpage @author <NAME>, DCAM MIPT, 376 group @version 1.01 @par Changelog V 1.01 - There are lots of improvements in this version ...
TOOL
0.911384
3.071691
{ "github_metadata": { "branch": "master", "commit_count": 238, "repo_created_at": "2013-11-16T09:42:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dd45712d...
827fa866-4a45-420d-834e-2fd491a86319
NREL/EnergyPlus
third_party/ssc/solarpilot/IOUtil.cpp
/** BSD-3-Clause Copyright 2019 Alliance for Sustainable Energy, LLC Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met : 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the...
TOOL
0.940218
4.216451
{ "github_metadata": { "branch": "develop", "commit_count": 40658, "repo_created_at": "2013-11-22T14:47:34.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1278, "forks": 441, "issues": 908, "pull_requests": 48 }, "file_meta": { "content_id":...
bd45a426-b43e-4fd6-8a7f-bd8af3a17a9a
Apricityh/Leetcode-master
C++_Leetcode/leetcode/editor/cn/PathSumIii .cpp
//给定一个二叉树的根节点 root ,和一个整数 targetSum ,求该二叉树里节点值之和等于 targetSum 的 路径 的数目。 // // 路径 不需要从根节点开始,也不需要在叶子节点结束,但是路径方向必须是向下的(只能从父节点到子节点)。 // // // // 示例 1: // // // // //输入:root = [10,5,-3,3,2,null,11,3,-2,null,1], targetSum = 8 //输出:3 //解释:和等于 8 的路径有 3 条,如图所示。 // // // 示例 2: // // //输入:root = [5,4,8,11,null,13,4,7...
ALGO
0.999992
5.843605
{ "github_metadata": { "branch": "main", "commit_count": 136, "repo_created_at": "2022-10-28T15:56: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": "b654c2ea63...
fa303f98-e8f9-4b41-b35b-9fdf62b0d166
jizai945/leetcode
example/1725_easy_可以形成最大正方形的矩形数目.cpp
// 1725. 可以形成最大正方形的矩形数目 // 给你一个数组 rectangles ,其中 rectangles[i] = [li, wi] 表示第 i 个矩形的长度为 li 、宽度为 wi 。 // 如果存在 k 同时满足 k <= li 和 k <= wi ,就可以将第 i 个矩形切成边长为 k 的正方形。例如,矩形 [4,6] 可以切成边长最大为 4 的正方形。 // 设 maxLen 为可以从矩形数组 rectangles 切分得到的 最大正方形 的边长。 // 请你统计有多少个矩形能够切出边长为 maxLen 的正方形,并返回矩形 数目 。 // 示例 1: // 输入:rectangles = [[...
ALGO
0.999916
5.893229
{ "github_metadata": { "branch": "main", "commit_count": 421, "repo_created_at": "2021-02-19T02:13:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4e60a748d8...
eb88fc0c-358d-4630-a360-ac6302ec4d98
johnathan79717/competitive-programming
HackerRank/101hack32/binary-string-game/main.cc
#include <list> #include <string> #include <vector> #include <climits> #include <cstring> #include <map> #include <queue> #include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <set> #include <deque> #include <stack> #include <cassert> using namespace std; #define FOR(i,c) for(__typeof((c)...
ALGO
0.999986
3.800983
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2016-04-07T07:50:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "75d80abc8...
747371a0-dd26-4697-a36c-55c66ff56af5
rajtulluri/Data-Structures-Codes
PrefixEvaluation.cpp
#include <iostream> #include <string.h> using namespace std; #define MAX 20 class PrefixClass{ private: int top; char Prefix[MAX]; int Stack[MAX]; public: PrefixClass(){ top = -1; } void Push(int item){ Stack[++top] = item; } int Pop(){ return Stack[top--]; ...
ALGO
0.999921
4.02196
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2020-02-26T18:04:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "065f2d8e47...
5889540e-8ed9-4932-aaa4-b6aaa2afbc95
sky7658/Acmipc
백준/Gold/14503. 로봇 청소기/로봇 청소기.cc
#include <iostream> using namespace std; int n, m, r, c, d, count = 1; int place[50][50]; bool clear[50][50]; int direction[4][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}}; int main(void) { cin >> n >> m >> r >> c >> d; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) cin >> place[i][j]; } ...
ALGO
0.999769
4.135789
{ "github_metadata": { "branch": "main", "commit_count": 230, "repo_created_at": "2022-08-23T11:05: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": "188c9bce12...
39279b19-2c52-4e01-a858-bb4223beac33
om-1980/CPC_TASKS
Week1/sorting/heap_sort.cpp
#include<bits/stdc++.h> using namespace std; void heapify(int arr[], int n, int i) { int index = i; int left = 2*i + 1; int right = 2*i + 2; int largest = index; if(left < n && arr[left] > arr[largest]){ largest = left; } if(right < n && arr[right] > arr[largest]){ largest ...
ALGO
0.999954
4.879421
{ "github_metadata": { "branch": "main", "commit_count": 38, "repo_created_at": "2023-12-27T17:08: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": "7099e9ec0b3...
d5ac0b60-1210-481c-83b6-9723672b7a44
rioyokotalab/FRANK
examples/h_lu.cpp
#include "FRANK/FRANK.h" #include <cassert> #include <cstdint> #include <tuple> #include <vector> using namespace FRANK; int main(int argc, char** argv) { timing::start("Overall"); FRANK::initialize(); const int64_t N = argc > 1 ? atoi(argv[1]) : 256; const int64_t nleaf = argc > 2 ? atoi(argv[2]) : 16; c...
ALGO
0.980962
5.660179
{ "github_metadata": { "branch": "master", "commit_count": 1230, "repo_created_at": "2018-02-28T06:00:21.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 2, "issues": 11, "pull_requests": 0 }, "file_meta": { "content_id": "8dd5d6f...
8a30100c-c0ed-4b19-bd94-1ce78eb79d05
Kanav-Arora/DSA-Guide
Dynamic Programming/Questions/DP on Stocks/Best Time to B and S II/memoization.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: int solver(vector<int> &p, int ind, bool av, vector<vector<int>> &dp) { if (ind == p.size()) return 0; if (dp[ind][av] != -1) return dp[ind][av]; int val = 0; if (av) ...
ALGO
0.999874
4.725532
{ "github_metadata": { "branch": "main", "commit_count": 462, "repo_created_at": "2021-10-04T06:11:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 59, "forks": 15, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "37c5a37b...
2fd71bee-04b9-464c-900f-725f4aed47c5
thq80/Particle-MCMC
include/apf_filter.h
#ifndef APF_H #define APF_H #include <vector> #include <functional> #include <Eigen/Dense> #include <cmath> #include "mn_resampler.h" /** typedef for linear algebra stuff */ typedef Eigen::Matrix< double, Eigen::Dynamic, 1 > Vec; /** typedef for linear algebra stuff */ typedef Eigen::Matrix< double, Ei...
ALGO
0.977978
5.308144
{ "github_metadata": { "branch": "master", "commit_count": 64, "repo_created_at": "2018-03-14T12:32:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8a429fa59...
be028ced-2684-4c6b-a08d-ade446cd02fb
rolandjansky/athena
LArCalorimeter/LArRawConditions/LArRawConditions/LArWaveHelper.h
/* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef LARWAVEHELPER_H #define LARWAVEHELPER_H #include "LArWave.h" #include "LArWaveCumul.h" #include "LArWaveDerivedQuantitiesP.h" #include <math.h> class LArWaveHelper { public: LArWave translate (const LArWave& theWave, ...
TOOL
0.941478
6.579203
{ "github_metadata": { "branch": "master", "commit_count": 100549, "repo_created_at": "2022-08-07T05:54:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "08c75...
698a7c4e-14cc-495d-8955-b2c1db583f94
itohdak/AtCoder
ABC/old/unsolved/11-/111/C.cpp
#include <iostream> #include <cstdlib> #include <algorithm> #include <cmath> #include <vector> #include <numeric> // accumulate(v.begin(), v.end(), 0) using namespace std; #define ll long long int v[100000]; int A[100000]; int B[100000]; int main(){ int n; cin >> n; for(int i=0; i<n; i++) { cin >> v[i]; ...
ALGO
0.999967
3.527931
{ "github_metadata": { "branch": "master", "commit_count": 172, "repo_created_at": "2018-05-20T09:26:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "f1864f23...
35449adc-9833-4111-a42c-8380dd4afe5e
ArinaKhrom/practice
2_4/2_4.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; int space = n / 2; int star = 1; for (int i = 0; i < (n + 1) / 2; ++i) { for (int j = 0; j < space; ++j) { cout << ' '; } space--; for (int j = 0; j < star; ++j) { cout << ...
ALGO
0.99997
4.260588
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2020-11-30T16:13: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": "6f271ab5ad...
68176a24-8d9a-4463-b787-9c1f5bffdbac
michalwrpo/algorithms
BinarySearch/C++/binarySearch.cpp
#include <iostream> #include <vector> #include "binarySearch.hpp" // Minimalizes number of comparisons template <typename T> long BinarySearch(T *arr, long start, long end, T value) { if (end - start < 2) { if (arr[start] == value) { return start; } return -1; } lo...
ALGO
0.999985
5.827553
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2025-05-06T07:56:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "50cfeff525...