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
3c5926b9-6e2e-4369-a9f8-41e6cce775f1
Nishtha-Jain-1119/coding-practice
leetcode/240. Search a 2D Matrix II.cpp
// 240. Search a 2D Matrix II // Write an efficient algorithm that searches for a value target in an m x n integer matrix matrix. This matrix has the following properties: // Integers in each row are sorted in ascending from left to right. // Integers in each column are sorted in ascending from top to bottom class So...
ALGO
0.99994
5.747061
{ "github_metadata": { "branch": "main", "commit_count": 139, "repo_created_at": "2023-06-18T18:21: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": "243f0580ef...
544cd4e3-f4be-4ba0-ade5-d0c6f05c90f6
showmanlee/HowCanISolveThisQuestion
BOJ/14000/14621.cpp
// 나만 안 되는 연애 // https://www.acmicpc.net/problem/14621 #include <iostream> #include <vector> #include <queue> #include <algorithm> using namespace std; typedef pair<int, int> pr; typedef pair<int, pr> prr; int group[1001]; int finding(int p) { if (p == group[p]) return p; group[p] = finding(group[p]); return gro...
ALGO
0.999938
4.196097
{ "github_metadata": { "branch": "master", "commit_count": 1741, "repo_created_at": "2020-09-16T11:55:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bceda50...
997ed009-d712-4cf2-b12a-5cd8b1ac7f96
ahmedyar7/DSA-Problem-Solving
Problem Solving/Binary Search/Binary Search on 1D Arrays/peakElement.cpp
#include <bits-stdc++.h> using namespace std; class Solution { public: // int findPeakElement(vector<int>& arr) { // // array size // int n = arr.size(); // /* // CHECKING FOR EGDGE CASES: // 1. When size is 1 then return arr[0] as peak element // 2. Checking 1st and 2n...
ALGO
0.999974
5.559986
{ "github_metadata": { "branch": "main", "commit_count": 476, "repo_created_at": "2024-03-09T06:34: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": "1be0f14fd7...
59d3df35-5158-461f-86d5-2045ca38389b
eric-austin/SIWOplus
main.cpp
// // main.cpp // SIWO // // Created by <NAME> on 2022-02-25. // #include <iostream> #include <random> #include <vector> #include <queue> #include <chrono> #include <fstream> #include "node.h" #include "edge_data.h" #include "graph.h" #include "siwo.h" int main(int argc, const char * argv[]) { std::string inP...
ALGO
0.996071
4.737269
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-04-14T00:04:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "eed76c87d501...
c1a02532-4313-4c56-b7d8-65f659567a39
rajan596/Assignments
DBMS_Assignments/Tic Tac Toe using MiniMax and Alpha Beta Pruning.cpp
/* * <NAME> * * U13CO050 * * AI Assignment * *************************************. Computer : X You : O ( First your turn ) */ #include<bits/stdc++.h> using namespace std; int filled=0; // Stores no. of filled Boxes void printMatrix(char bo...
ALGO
0.999606
4.358338
{ "github_metadata": { "branch": "master", "commit_count": 50, "repo_created_at": "2015-04-28T12:17:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1a731d7b8...
4681730e-23cd-492e-9b74-8051fd111b1a
open-airlab/VTNMPC-Autonomous-Wind-Turbine-Inspection
WTI_catkin/NMPC_code_generator/ros_acado_bridge/ACADOtoolkit/examples/nlp/rosenbrock_function.cpp
/* * This file is part of ACADO Toolkit. * * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. * Copyright (C) 2008-2014 by <NAME>, <NAME>, * <NAME>, <NAME>, <NAME>. * Developed within the Optimization in Engineering Center (OPTEC) * under supervision of <NAME>. All rig...
ALGO
0.999762
5.87007
{ "github_metadata": { "branch": "main", "commit_count": 64, "repo_created_at": "2022-05-10T08:14:07.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 30, "forks": 4, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "d521cc34692...
bfa47c1d-ed9c-4814-9ceb-b795f6876797
sanchit203/DSA-450-Questions
Theory/Heap.cpp
#include<iostream> #include<stdlib.h> using namespace std; class Heap{ int n; int size; int *a; public: Heap(int x) { size = x+1; a = new int[size]; n=0; a[0] = 0; for(int i=1;i<size;i++) cin>>a[i]; } void insert() { int...
ALGO
0.999873
3.567945
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2021-06-18T09:42: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": "a1a89e7c625...
f41823bf-a7d4-4b0b-8282-6e1693fddf87
cocamware/lass
lass/spat/aabb_tree.inl
/** @file * @author <NAME> (<EMAIL>) * @author <NAME> (<EMAIL>) * * *** BEGIN LICENSE INFORMATION *** * * The contents of this file are subject to the Common Public Attribution License * Version 1.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of t...
ALGO
0.991595
5.84346
{ "github_metadata": { "branch": "master", "commit_count": 1622, "repo_created_at": "2019-01-07T18:24:12.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "1cee0cc8...
ce2a4995-1d8b-48e8-90fd-af0b1c7aed57
vfolunin/archives-solutions
UVa Online Judge/10002.cpp
#include <iostream> #include <algorithm> #include <cmath> #include <vector> #include <set> #include <map> #include <string> using namespace std; struct Point { long long x, y; Point() {} Point(const Point &a, const Point &b) : x(b.x - a.x), y(b.y - a.y) {} bool operator < (const Point &that) const {...
ALGO
0.999925
5.137625
{ "github_metadata": { "branch": "master", "commit_count": 2367, "repo_created_at": "2017-11-27T10:19:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 1, "pull_requests": 5 }, "file_meta": { "content_id": "af6a8fc...
70e92f19-69f8-4598-9473-0ae9403d74ff
intel/torch-xpu-ops
src/ATen/native/xpu/Unique.cpp
#include <ATen/native/xpu/sycl/UniqueKernels.h> namespace at { namespace native { std::tuple<Tensor, Tensor, Tensor> unique_dim_xpu( const Tensor& self, const int64_t dim, const bool sorted, const bool return_inverse, const bool return_counts) { return xpu::unique_dim_kernel(self, dim, return_i...
TOOL
0.919707
7.37851
{ "github_metadata": { "branch": "main", "commit_count": 932, "repo_created_at": "2024-02-05T23:41:22.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 49, "forks": 46, "issues": 166, "pull_requests": 63 }, "file_meta": { "content_id": "f743d2...
d6b2c813-7456-489d-bd7f-2568f302d1f9
UniStuttgart-VISUS/megamol
plugins/molecularmaps/src/Octree.cpp
/* * MapGenerator.cpp * Copyright (C) 2006-2016 by MegaMol Team * Alle Rechte vorbehalten. */ #include "Octree.h" using namespace megamol; using namespace megamol::molecularmaps; /* * Octree::~Octree */ Octree::~Octree() { this->face_bboxs.erase(this->face_bboxs.begin(), this->face_bboxs.end()); this-...
ALGO
0.997627
6.124276
{ "github_metadata": { "branch": "master", "commit_count": 15745, "repo_created_at": "2017-06-16T08:56:41.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 56, "forks": 37, "issues": 40, "pull_requests": 30 }, "file_meta": { "content_id": "9c0...
c0eb2044-3853-4430-bc77-403d26792b78
ishandutta2007/codeforces-t
thienu/normal/1394/C.cpp
#include <bits/stdc++.h> #define u_map unordered_map #define u_set unordered_set #define u_multiset unordered_multiset using ll = long long; using namespace std; void __print(int x) {cerr << x;} void __print(long x) {cerr << x;} void __print(long long x) {cerr << x;} void __print(unsigned x) {cerr << x;} void __pri...
ALGO
0.999969
3.649374
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:27: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": "cafcc3998299...
54abbac5-486a-41d9-b437-4cc66385f53f
MikhailSayapin/ITIB
LR5/Neuron.h
#include <iostream> #include <vector> using namespace std; class Neural_network { private: int m, n; vector<int> f_net_last_2, f_net_last_1; vector<int> s; vector<int> t; vector<vector<int>> W; vector<int> net2; vector<int> net1; public: Neural_network(vector<vector<int>> s, vector<vector<int>> t) { m = s[...
ALGO
0.999686
4.175993
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2020-03-20T00:07: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": "d1bdeac2c...
c5801b9e-2e95-4355-9243-ef4e6e00e069
apache/cloudberry
src/backend/gporca/libgpopt/src/xforms/CXformExpandNAryJoinDPv2.cpp
//--------------------------------------------------------------------------- // Greenplum Database // Copyright (C) 2019 VMware, Inc. or its affiliates. // // @filename: // CXformExpandNAryJoinDPv2.cpp // // @doc: // Implementation of n-ary join expansion using dynamic programming //---------------------------------...
ALGO
0.999369
7.072669
{ "github_metadata": { "branch": "main", "commit_count": 71549, "repo_created_at": "2023-05-24T06:58:16.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1000, "forks": 167, "issues": 104, "pull_requests": 50 }, "file_meta": { "content_id": "8...
1101e90f-4eb8-4c9e-9622-bb17f1aeb374
FazeelUsmani/Scaler-Academy
028 Tries/01 TRIE_best.cpp
#include <bits/stdc++.h> using namespace std; #define ROW 27 #define COL 20 int trie[ROW][COL]; int cnt[ROW][COL]; bool EOW[ROW][COL]; int nextAvailable = 1; bool search (string word){ int ptr = 0; int len = word.length(); for (int i = 0; i < len; i++){ char ch = word[i]; int index = ch ...
ALGO
0.999698
3.65179
{ "github_metadata": { "branch": "master", "commit_count": 795, "repo_created_at": "2020-01-28T18:13:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 252, "forks": 172, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ae8a...
dbd040b4-05ff-4372-bdd8-7966b671711a
DanielTLouis/HackerRank
DataStructures/Prepare_DataStrucutres_Trees_ArrayPairs.cpp
/* Consider an array of n integers, A=[a1,a2,...,an]. Find and print the total number of (i,j) pairs such that ai X aj <= max(ai, a(i+1),...,aj) where i<j. Input Format The first line contains an integer, n, denoting the number of elements in the array. The second line consists of n space-separated integers des...
ALGO
0.999955
4.124107
{ "github_metadata": { "branch": "main", "commit_count": 229, "repo_created_at": "2022-08-24T17:39:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "634047e10d...
8de0b603-4715-4877-9ab7-db06bd8b86ce
Yasin1406/MATH-304
eigen_value.cpp
#include<iostream> #include<cstdlib> #include<time.h> #include<math.h> #include<climits> using namespace std; #define MAX1 100 #define EPS 10e-6 double A[MAX1][MAX1],B[MAX1][MAX1],C[MAX1][MAX1],V[MAX1][MAX1]; double Q[MAX1][MAX1],Qinverse[MAX1][MAX1]; int row,column; void Inputmatrix(){ srand(time(0)); int i,j,k; ...
ALGO
0.999768
3.356272
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2023-08-13T08:26: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": "504f1188874...
a33c786c-409f-471d-b877-ec4d83dd9db2
OfficialMartian/codeforces
Problems/800/1294A.cpp
typedef long long int ll; #define push_back pb #include <bits/stdc++.h> using namespace std; int main() { ll t; cin >> t; while (t--) { ll a, b, c, n, min = 0; cin >> a >> b >> c >> n; if (a >= b && a >= c) min = 2 * a - b - c; else if (b >= a && b >= c) ...
ALGO
0.999746
3.902668
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2021-06-17T16:01:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "182558515...
d3bd7001-5398-4378-9d8a-f3e0e4302697
Garyxud/melodic-all
src/slam_toolbox/slam_toolbox/solvers/deprecated/spa_solver.hpp
/* * Copyright 2010 SRI International * * 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 version 3 of the License, or * (at your option) any later version. * * This program ...
TOOL
0.910868
4.731121
{ "github_metadata": { "branch": "melodic-all", "commit_count": 1, "repo_created_at": "2020-09-14T02:37:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 8, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "967e0...
2195cdc0-bdf2-4556-836c-d302b3bbeeb2
FanindraNayak/LeetCode_Questions
Q4/Solution_Q4.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; class Solution { public: double getMedian(vector<int> &nums1, vector<int> &nums2) { vector<int> arr; int n1 = nums1.size(); int n2 = nums2.size(); for (auto pr : nums1) arr.push_back(pr...
ALGO
0.999988
5.823854
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2023-09-22T09:42: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": "4c06c04db26...
e7a764ba-1924-43f5-8e98-ee5a3b295e96
IdoKapach/News-broadcasting-scenario-simulator
classes.cpp
#include "classes.h" /* * producer creates several strings (reports) in the following format: “producer <i> <type> <j>” <i>: Producer's ID <type>: A random type chosen from SPORTS, NEWS, WEATHER <j>: The number of strings of type <type> this producer has already produced Each producer sends its in...
ALGO
0.981882
5.175831
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2024-08-21T14:54:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "97e21ec9cd...
0de01c7d-82f4-415c-a0aa-ccee2f7d3747
TopAcademyGM/TopAcademy
02_21/arr.cpp
#include <iostream> void full_arr_input(int array[], int size) { for (int i = 0; i < size; ++i) { std::cout << i << ": "; std::cin >> array[i]; // заполнение элементов с клавиатуры // array[i] = rand() % 100; // случайное значение от 0 до 99 } } int main(int argc, char const *argv[]) ...
TOOL
0.907044
3.72735
{ "github_metadata": { "branch": "main", "commit_count": 81, "repo_created_at": "2022-12-28T15:59:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c696c67a2e5...
70ce8631-947e-420d-916a-c855ec39b110
cainiao22/lintcode-cpp
minimum-number-of-arrows-to-burst-balloons.cpp
/** * @projectName lintcode-cpp * @author yanpf * @date 2019-04-23 * @brief 爆破气球的最小箭头数 * @description * * 在二维空间中有许多球形气球。 对于每个气球,提供的输入是水平直径的起点和终点坐标。 * 由于它是水平的,因此y坐标无关紧要,因此直径的起点和终点的x坐标就足够了。 * 起点总是小于终点。 最多将有10^4个气球。 * 可以沿x轴从不同点垂直向上发射箭头。...
ALGO
0.999981
5.528636
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2019-04-05T08:05:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b24b7c1b2...
734129cf-d3b9-4ab0-9eda-99b31b2b3c2f
FranFT/FloydOpenMP
FloydOpenMP/FloydOpenMP_1D.cpp
#include "stdafx.h" #include <omp.h> #include <iostream> #include <fstream> #include <string.h> #include <algorithm> #include "Graph.h" int main(int argc, char* argv[]) { std::cout << "Floyd 1D." << std::endl; int num_threads = 0; int thread_id = 0; int* I; Graph G; // Control de errores de la entrada. if (a...
ALGO
0.999665
4.805613
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2015-06-05T11:25: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": "b16f9824b...
89ebb412-9a26-4ae1-9ca6-3d05b5bfcf59
DanilaKholod/study
2018.11.11.ДЗ-Prime/18.cpp
/*Write a logical function checking is a string palindrome. We can assume that the string consists only of Latin letters.*/ #include <iostream> using namespace std; bool palindrome(char*a, int b) { b--; for (int i = 0; i <= ((b / 2) - 1); i++) { //check the first and last character if (a[i] == a[b - i]) { //and so ...
ALGO
0.99999
4.531695
{ "github_metadata": { "branch": "master", "commit_count": 82, "repo_created_at": "2018-10-14T10:05:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8364d3635...
3d53ca2e-033a-4bbc-b569-17f026832baf
fjnkt98/competitive_cpp
practices/aoj/course/ITP2/topic8/c.cpp
#include <algorithm> #include <iostream> #include <map> #include <string> #include <vector> int main() { int64_t Q; std::cin >> Q; std::map<std::string, int64_t> map; for (int64_t i = 0; i < Q; i++) { int64_t t, x; std::string s, l, r; std::cin >> t; switch (t) { case 0: std::cin...
ALGO
0.998651
4.436804
{ "github_metadata": { "branch": "master", "commit_count": 241, "repo_created_at": "2020-08-13T05:58:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "77a4ada9...
0bc580af-b05c-436b-854c-57d0d778c67e
DQSSSSS/Algorithm-Competition-Code
cccc/J.cpp
#include<bits/stdc++.h> using namespace std; typedef long long LL; const int SZ = 200010; const int INF = 1e9 + 10; const int mod = 1e9 + 7; LL read() { LL n = 0; char a = getchar(); bool flag = 0; while(a > '9' || a < '0') { if(a == '-') flag = 1; a = getchar(); } while(a <= '9' && a >= '0') n = n * 10 + a - '0...
ALGO
0.999851
3.351106
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2020-11-02T16:48: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": "ac90a9e499...
d6ab428e-bd52-4f22-bfb1-915e34e23b60
ICPC-Fayoum-University-Community/2023_archive
Level 1 Training/Week 4 -String-/B - YES or YES?.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define lp1(n) for(ll i = 1; i <= (n); ++i) #define lp(n) for(ll i = 0; i < (n); ++i) #define tc ll testcase; cin>>testcase; while(testcase--) #define all(v) (v).begin(), (v).end() #define allr(v) (v).rbegin(),...
ALGO
0.999678
5.136527
{ "github_metadata": { "branch": "main", "commit_count": 239, "repo_created_at": "2022-11-05T08:07:32.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 10, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ff18e69402...
a6dce211-46d4-4070-9a1a-24d65e65c3ca
emathew1/MPI_3DCompact
src/CurvilinearInterpolator.hpp
#ifndef _CURVILINEARINTEROLATORH_ #define _CURVILINEARINTEROLATORH_ #include "AbstractCSolver.hpp" #include "AbstractSingleBlockMesh.hpp" #include "Macros.hpp" #include "Utils.hpp" #include "Domain.hpp" #include "BC.hpp" #include <vector> class CurvilinearInterpolator{ public: int mpiRank; int pxSize[3], ...
ALGO
0.993936
5.243796
{ "github_metadata": { "branch": "master", "commit_count": 251, "repo_created_at": "2018-04-05T19:48:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7604d735...
2b2e9dbf-5aae-4d76-8b3b-89c013a42b2b
chouchoudiudiu/LeetCode
src/190.Reverse_Bits.cpp
class Solution { public: uint32_t reverseBits(uint32_t n) { uint32_t res = 0; for(int i = 0; i < 32; ++i) { res |= ((n >> i) & 1) << (31 - i); } return res; } }; ============================== class Solution { public: uint32_t swapBits(uint32_t x, int i, int j) {...
ALGO
0.999981
5.763931
{ "github_metadata": { "branch": "master", "commit_count": 1202, "repo_created_at": "2016-11-02T19:56: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": "7154233...
65a0a8df-0af0-4593-b10c-d4cdf9df214c
kiddliu/midnight-leetcode
maximize-distance-to-closest-person.h
#ifndef MAXIMIZE_DISTANCE_TO_CLOSEST_PERSON_H_ #define MAXIMIZE_DISTANCE_TO_CLOSEST_PERSON_H_ #include <vector> namespace solution { int maxDistToClosest(std::vector<int>& seats) { // it should be an easy-level problem // Runtime: 0 ms, faster than 100.00% of C++ online submissions for Maximize Distance to Close...
ALGO
0.999545
6.166176
{ "github_metadata": { "branch": "main", "commit_count": 432, "repo_created_at": "2021-03-25T16:08: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": "c37fc6d59d...
4477869a-43e3-4fc2-adc9-7088d9416056
DComEX/dcomex-framework
korali/source/modules/problem/reaction/reaction.hpp
/** \namespace problem * @brief Namespace declaration for modules of type: problem. */ /** \file * @brief Header file for module: Reaction. */ /** \dir problem/reaction * @brief Contains code, documentation, and scripts for module: Reaction. */ #pragma once #include "auxiliar/reactionParser.hpp" #include "modules/p...
ALGO
0.927252
6.376317
{ "github_metadata": { "branch": "master", "commit_count": 30, "repo_created_at": "2023-05-04T14:10:35.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c8e1ccd972...
88fff5fe-e3c9-4fa9-806e-ba55048cd95b
lvyangdi/CacheChecker
src/CacheSim.cpp
#include "CacheSim.h" CacheSim::CacheSim(int nodeNum , string type, bool showtrace, bool showset): nodeNum_(nodeNum), type_(type), totalActions_(0), showTrace_(showtrace), dumpHashSet_(showset) { // Initialize state as all Is initialState_.assign(nodeNum, 'I'); // Add initialState to visited nodes visited.insert...
ALGO
0.983386
4.612417
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-02-16T15:11: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": "b2e1cefac2...
d27d5e7b-513f-4cac-bcf6-fe99da5de4ef
zyx4843/leetcode
src/Symmetric_Tree.cpp
// Source : https://oj.leetcode.com/problems/symmetric-tree/ // Author : <NAME> // Date : 2014-12-26 /********************************************************************************** * * Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). * For example, this binary tr...
ALGO
0.999946
6.118942
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2014-11-21T05:44:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1f4cd1d90...
c985a9ed-d398-47ae-8355-4cb85b4c3025
liu-jianhao/leetcode
code/222.完全二叉树的节点个数.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: int countNodes(TreeNode* root) { if(root == nullptr) return 0; int ...
ALGO
0.999897
5.991481
{ "github_metadata": { "branch": "master", "commit_count": 72, "repo_created_at": "2019-05-27T14:05: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": "15fbba233...
7b634d0f-8678-40a6-9a76-0a3386278f3f
DesuDeluxe/mcu
facefallower_dc/facefallower_dc.ino
#include <Arduino.h> /* arduino obtains x and y coordinates by serial of center of rectangle produced by opencv on pc then it calculates if these coordinates are off the center of screen if off then it moves servos one desired angle at the time if x servo max range is reached then it starts to move linear drive ser...
ALGO
0.996243
5.047313
{ "github_metadata": { "branch": "Arduino", "commit_count": 1, "repo_created_at": "2018-09-20T19:55: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": "09a503d5e...
82bb12b6-e49d-473b-a630-1d64fb73d06d
ishandutta2007/codeforces-nonalphabetic
.tx/normal/666/A.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <algorithm> #include <vector> #include <map> #include <set> #include <queue> #include <stack> #include <unordered_map> #include <unordered_set> #include <deque> #include <string> #include <memory.h> #include <bitset> #define sci(a) scan...
ALGO
0.998117
3.167951
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:49:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4366ad3109b2...
e24523eb-c798-4007-bbf7-c144762f6fcf
ahammadabdullah/xcpc-b5
week6/day1/B_Mainak_and_Interesting_Sequence.cpp
/** * author: ahammadabdullah * created: 2024-12-02 22:01:50 **/ #include <bits/stdc++.h> using namespace std; #define ll long long #define nl '\n' #define FAST_IO \ ios::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL) #define inp(a) \ for (auto...
ALGO
0.999987
4.08271
{ "github_metadata": { "branch": "main", "commit_count": 80, "repo_created_at": "2024-10-26T17:01: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": "ca25b5b172d...
0488721d-e51b-456c-96b7-c8eab144bb60
ITA-ftuyama/CES-11
CPP/Árvore/Árvore - 04.cpp
/**********************************/ /* CES 11 - Árvores */ /* */ /* Implementação usando */ /* estrutura Lista de Filhos */ /* */ /* by Tuyama */ /**********************************/ #include <stdio.h> #incl...
ALGO
0.999811
3.226567
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2016-09-05T03:52:36.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "576d1330234...
924be081-eafe-4e27-909e-cd563609822e
Koyingtw/CP
CF practice/1553B.cpp
#pragma region #include <bits/stdc++.h> #define Koying ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); #define int long long #define pr pair<int, int> #define fr(i, a, b) for (int i = a; i < b; i++) #define rf(i, a, b) for (int i = a; i >= b; i--) #define F first #define S second #define max(a, b) (a > b ? a : b) #de...
ALGO
0.99998
5.136261
{ "github_metadata": { "branch": "main", "commit_count": 79, "repo_created_at": "2021-07-10T12:46:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "042500fda25...
06c82590-62f4-4950-bfcb-c9be79ff50e4
Xilinx/Vitis_Libraries
codec/L2/demos/pikEnc/host/pik/lehmer_code.h
// Copyright 2017 Google Inc. All Rights Reserved. // // Use of this source code is governed by an MIT-style // license that can be found in the LICENSE file or at // https://opensource.org/licenses/MIT. #ifndef PIK_LEHMER_CODE_H_ #define PIK_LEHMER_CODE_H_ // Library to compute the Lehmer code of a permutation and t...
ALGO
0.999933
7.154273
{ "github_metadata": { "branch": "main", "commit_count": 471, "repo_created_at": "2019-09-23T19:13:46.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 988, "forks": 381, "issues": 0, "pull_requests": 12 }, "file_meta": { "content_id": "a361ac...
d0b989da-3f39-4ce5-a1f4-540efc1a8a90
aman-shrivastava95/DataStructuresAndAlgortihmsJava
CP/maths/1620b.cpp
#include<iostream> #define mp make_pair #define MOD 100000007 #define len(x) x.size() #define min3(a,b,c),min(a, min(b,c)) #define max3(a,b,c), max(a, max(b,c)) #define all(v) v.begin(),v.end() #define alla(n) a,a + n #define ll long long using namespace std ; int main(int argc, char const *argv[]) { #ifndef O...
ALGO
0.999793
3.44294
{ "github_metadata": { "branch": "master", "commit_count": 99, "repo_created_at": "2021-11-10T14:36:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dc5183686...
6283a6e3-17a6-4776-8f87-8b971a895bf4
ishandutta2007/codeforces-b
brovko/normal/1709/D.cpp
#include <bits/stdc++.h> //#define int long long #define ld long double #define f first #define s second #define pb push_back using namespace std; using li = long long; const int N = 2e5 + 13; int st[N][20], mx2[N]; int get(int L, int R) { int d = R - L; return max(st[L][mx2[d]], st[R - (1 << mx2[d])][mx2[...
ALGO
0.999876
4.192508
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-04-11T01:05:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3cd2e48fc9e0...
a03bcb83-c415-40e5-b32d-144574014511
CGAL/cgal
Partition_2/test/Partition_2/monotone_test_polys.h
template <class Polygon_2> void make_monotone_w_collinear_points(Polygon_2& polygon) { typedef typename Polygon_2::Point_2 Point_2; /* polygon.push_back(Point_2(186, 101)); polygon.push_back(Point_2(304, 101)); polygon.push_back(Point_2(351, 101)); polygon.push_back(Point_2(367, 122)); polygon.push_...
ALGO
0.965321
4.318118
{ "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...
c6b6c55a-e5a9-4833-9b1b-922c54a6e4f4
Bachzart/DS_Practices
Leetcode/1290.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ /* method 1 */ class Solution { public: int ge...
ALGO
0.999974
5.54704
{ "github_metadata": { "branch": "main", "commit_count": 242, "repo_created_at": "2022-03-20T13:50: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": "3cdda10687...
5f5faaec-3477-48b4-88f2-ee27d44b28aa
markus-seethaler/tinyml-federated
federated-simulation/include/HPO/HyperParameterOptimizer.h
#ifndef HYPER_PARAMETER_OPTIMIZER_H #define HYPER_PARAMETER_OPTIMIZER_H #include <vector> #include <string> #include <memory> #include <limits> #include "DataPreprocessor/DataPreprocessor.h" #include "FederatedClient/FederatedClient.h" struct HyperParams { std::vector<size_t> topology; float learning_rate; ...
ALGO
0.998767
7.216014
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2025-02-16T16:51:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "efd9b75b7ec...
c1ba995f-d599-4c12-a8a8-f692427c1a2d
masterchef2209/coding-solutions
codes/codeforces/1339D.cpp
/*Read the problem carefully before starting to work on it*/ #include <bits/stdc++.h> //#include <boost/multiprecision/cpp_int.hpp> //using namespace boost::multiprecision; //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> using namespace std; //using namespace __gnu_pbds; typedef lo...
ALGO
0.999893
3.894326
{ "github_metadata": { "branch": "master", "commit_count": 75, "repo_created_at": "2018-04-02T16:05: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": "f59f5b88a...
70f15ba4-b149-49c6-8e7f-2be01fb629c8
owang1/Trie_Dictionary
trie.cpp
// trie.cpp: Trie Map #include "map.h" #include <stdexcept> // Prototypes ------------------------------------------------------------------ Node* findChild(Node *node, char &letter); void dump_r(Node *node, std::ostream &os); // Methods --------------------------------------------------------------------- // ...
ALGO
0.99769
5.568249
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2019-02-17T05:16: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": "db63844c1...
912d51cf-7944-49a5-be0d-e47f7c958a2f
BANGBANGROX/DS-ALGO-solutions
Sort_the_Jumbled_Numbers.cpp
#include<bits/stdc++.h> using namespace std; class Solution { int mapNum(int num, vector<int>& mapping) { if (num == 0) return mapping[0]; string ans(""); while (num > 0) { ans = to_string(mapping[num % 10]) + ans; num /= 10; } cout << ans << endl; return stoi(ans); } public: vector<int> sort...
ALGO
0.999963
5.078093
{ "github_metadata": { "branch": "main", "commit_count": 90, "repo_created_at": "2021-10-04T18:11:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "86db2ef208d...
7d9b019d-9bd7-461b-b491-75a7d6ac5815
NSchmidt48067/ic210
lab12/part4.cpp
/********************************************* Filename: part3.cpp Author: MIDN <NAME> (265646) Pretty *********************************************/ #include <iostream> #include <fstream> #include <string> #include <cmath> #include "struct4.h" using namespace std; int main() { //Reads in the File string file; cout <...
ALGO
0.942724
3.781037
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2023-08-18T00:44:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f5ec7d110ef0...
23352615-2b62-4e84-b7a2-560a7fa9a3fc
intellistream/PECJ
src/Operator/MeanAQPIAWJOperator.cpp
#include <Operator/MeanAQPIAWJOperator.h> #include <JoinAlgos/JoinAlgoTable.h> #include <complex> bool OoOJoin::MeanAQPIAWJOperator::setConfig(INTELLI::ConfigMapPtr cfg) { if (!OoOJoin::AbstractOperator::setConfig(cfg)) { return false; } std::string wmTag = config->tryString("wmTag", "arrival", true); WMT...
ALGO
0.965248
4.373466
{ "github_metadata": { "branch": "main", "commit_count": 266, "repo_created_at": "2022-11-19T08:23:45.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e17d89a81e0...
ff9fa0ef-5526-48dc-8726-acd1a7bd71e8
tatsumack/atcoder
abc149/CNextPrime.cpp
#include <iostream> #include <limits.h> #include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #incl...
ALGO
0.999913
3.901201
{ "github_metadata": { "branch": "master", "commit_count": 527, "repo_created_at": "2018-03-12T23:22:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "42d3c6f5...
550b6c3d-422e-4287-8d28-abcb0c3357e9
yhliu918/Learn-to-Compress
headers/search_blocksize.h
#ifndef SEARCH_BLOCKSIZE_H_ #define SEARCH_BLOCKSIZE_H_ #include "../headers/common.h" #include "../headers/codecfactory.h" #include "../headers/caltime.h" #include "../headers/lr.h" namespace Codecset { class search_bsize { public: int search_block_size(std::string codec_name, std::vector<uint32_...
ALGO
0.998511
5.430925
{ "github_metadata": { "branch": "main", "commit_count": 155, "repo_created_at": "2020-11-05T15:29:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 14, "forks": 2, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "e0e5d474c...
91854558-54dd-45f5-8fc9-d54996d67b6a
sookie233/ASC15-Gridding
Gridding/Benchmark.cc
/// @copyright (c) 2007 CSIRO /// Australia Telescope National Facility (ATNF) /// Commonwealth Scientific and Industrial Research Organisation (CSIRO) /// PO Box 76, Epping NSW 1710, Australia /// /// This file is part of the ASKAP software distribution. /// /// The ASKAP software distribution is free software: you ca...
ALGO
0.979929
5.739767
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-04-14T00:51: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": "3bc104eaf7...
65ea0b3f-1f8c-4d74-a29d-1bbeb8549bdd
marko-nikolic01/DS-A_leetcode
Problems/3333. Find the Original Typed String II/3333_find_the_original_typed_string_ii_cpp/main.cpp
#include <iostream> #include <vector> using namespace std; int possibleStringCount(string word, int k) { int n = word.size(); int cnt = 1; vector<int> freq; for (int i = 1; i < n; ++i) { if (word[i] == word[i - 1]) { ++cnt; } else { freq.push_back(cnt); ...
ALGO
0.999988
5.595748
{ "github_metadata": { "branch": "main", "commit_count": 717, "repo_created_at": "2024-08-06T11:25:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "24a115cc4a...
44a960ac-ed7c-4717-9a67-c0132666ff0a
mamun-akand/Problem-Solving-List-TOPIC-WISE
STL/YouKnowWho Scenario/Scenario-10.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; struct custom_hash { static uint64_t splitmix64(uint64_t x) { x += 0x9e3779b97f4a7c15; x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9; x = (x ^ (x >> 27)) * 0x94d049bb133111eb; return x ^ (x >> 31); } size_t operator()(uint64...
ALGO
0.998512
4.488486
{ "github_metadata": { "branch": "main", "commit_count": 58, "repo_created_at": "2022-03-26T19:55:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ccc6f52ca0c...
b64659c8-95a0-41fb-82fd-89dacdec56d3
srmalkan/Leetcode
MayChallenge/week2/CheckIfItIsaStraightLine.CPP
class Solution { public: bool checkStraightLine(vector<vector<int>>& coordinates) { if(coordinates.size()==2){ return true; } int n=coordinates.size(); int diffx = coordinates[1][0] - coordinates[0][0]; int diffy = coordinates[1][1] - coordinates[0][1]; fl...
ALGO
0.999773
5.690273
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2020-05-04T08:29: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": "f947d2f2d...
a26acef2-d54f-49a2-a363-d6af0f78bcb4
nikolaGeorgiev3000/IP_IS_2022
Week_08_Seminar/task02.cpp
// isSymmetric #include <iostream> using std::cin; using std::cout; using std::endl; const int MAX_ROWS = 100; const int MAX_COLS = 100; bool isSymmetric(int n, int matrix[][MAX_COLS]) { for (int i = 0; i <= n - 1; ++i) { for (int j = 0; j <= n - 1; ++j) { if (matrix[i][j] != matr...
ALGO
0.998997
5.638875
{ "github_metadata": { "branch": "main", "commit_count": 32, "repo_created_at": "2022-10-25T19:14: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": "7c3df570dc0...
b8173a14-4006-498a-9bb8-98ee552f4440
RitikSingh30/DSA--AllCode-Problems-solved-
Integer/1009. Complement of Base 10 Integer.cpp
/* ye wala solution bits ke sath nikala hai bina vector ka use kiye and intresting solution hai iska */ class Solution { public: /*humko 5 diya hai iska binary hota hai 101 and iska 1 ka 0 karna hai and 0 ka 1 then print karna hai to agar humne aise complement kiya to banega 010 = 2 yahi ans hai to ...
ALGO
0.99996
5.474615
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2023-01-03T22:11: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": "6a7b804ca8...
d08163c5-3a97-41d1-b1d9-0ae818f3d691
Bardo91/DepartamentoESI
VisualTrackingUI-QT/VisualTrackingUI-QT/ComputerVisionLibraries/ImageSegmentation/ColorClusterImageSegmentation.cpp
//////////////////////////////////////////////////////////////////////////////// // Visual Tracking UI // Author: <NAME> // Date: 2013/10/23 //////////////////////////////////////////////////////////////////////////////// // Color cluster segmentation algorithm. #include "ColocClusterImageSegmentation.h" #include "...
ALGO
0.993637
5.35611
{ "github_metadata": { "branch": "master", "commit_count": 128, "repo_created_at": "2013-10-23T14:03: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": "85914d53...
f8939c68-9b56-464b-9a13-bff01fd013b0
vermagaurav8/Algo-DS-Notes
AmazonTestSeries/Stack/celebrityProblem.cpp
//{ Driver Code Starts //Initial template for C++ #include<bits/stdc++.h> using namespace std; // } Driver Code Ends //User function template for C++ class Solution { public: //Function to find if there is a celebrity in the party or not. int celebrity(vector<vector<int> >& M, int n) { // c...
ALGO
0.999683
5.479385
{ "github_metadata": { "branch": "master", "commit_count": 137, "repo_created_at": "2020-04-26T10:20:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 7, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f24320e1...
f04251a8-711b-4b03-94e8-c296d7a64529
LuxCoreRender/LuxCore
include/luxrays/utils/utils.h
/*************************************************************************** * Copyright 1998-2020 by authors (see AUTHORS.txt) * * * * This file is part of LuxCoreRender. * * ...
TOOL
0.92432
4.307243
{ "github_metadata": { "branch": "master", "commit_count": 7178, "repo_created_at": "2017-11-22T14:36:32.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1235, "forks": 153, "issues": 93, "pull_requests": 3 }, "file_meta": { "content_id": "0b...
8d8e8fd1-a8da-4924-9b91-4f38b8c7cf3b
AlexLee1999/Leetcode-Practice
algorithm/C++/0576-Out_of_Boundary_Paths.cpp
class Solution { public: int findPaths(int m, int n, int maxMove, int startRow, int startColumn) { int dirs[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}}; int count = 0; int mod = 1e9 + 7; vector<vector<long>> table(m, vector<long>(n, 0)); table[startRow][startColumn] = 1; ...
ALGO
0.999951
5.717641
{ "github_metadata": { "branch": "main", "commit_count": 147, "repo_created_at": "2021-01-21T02:44:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "15f05bb5d2...
8618d862-c178-44da-a50f-54cb231bae70
singlarohan/leetcode_sol
2165-plates-between-candles/2022-09-27 17.43.49 - Time Limit Exceeded - runtime NA - memory NA.cpp
class Solution { public: vector<int> platesBetweenCandles(string s, vector<vector<int>>& queries) { // vector<int> prefix(s.size(), 0); unordered_map<int, int> prefix; int i{}; while(i < s.size() && s[i] == '*') i++; int count{}; while(i < s.size()){ ...
ALGO
0.999699
5.347175
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-08-05T02:14: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": "2aa2108bc908...
98b274e3-fd22-4281-8820-f686fe3ab4b9
GIABAOCTU/CODE
CTDL_GT_DeTai06.cpp
//Ho va ten < <NAME> > - Ma So SV : < B1811918 > #include<stdlib.h> #include<stdio.h> #include<conio.h> void swap(int &a, int &b) { int t = a; a = b; b = t; } int partition(int arr[], int low, int high) { int pivot = arr[high]; int left = low; int right = high - 1; while(true){ ...
ALGO
0.999866
3.67413
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2022-06-02T14:58: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": "77ba5bc16e24...
69fa7f84-b449-4c2b-b849-e41379d53114
Persona99/contest
bintree.cpp
#include <iostream> using namespace std; struct node{ int value; int count = 1; node *right = NULL; node *left = NULL; }; struct tree{ node *head = NULL; int count = 0; int deep = 0, dmax = 0; void add(int value){ deep = 0; if (head == NULL){ dmax = 1; head = new node; hea...
ALGO
0.99998
3.883935
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2020-06-01T09:19: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": "c5e32f9a5...
1dafb694-912c-4e51-bd2a-7e6764723035
hobin01/baekjoon
c++/11403.cpp
#include<iostream> #include<cstdlib> #include<vector> #include<algorithm> #include<queue> using namespace std; int main() { int n; int inf = 987654321; cin >> n; int** arr = (int**)malloc(sizeof(int*) * n); for (int i = 0; i < n; i++) arr[i] = (int*)malloc(sizeof(int) * n); for (int i = 0; i < n; i++) for ...
ALGO
0.999992
3.431309
{ "github_metadata": { "branch": "master", "commit_count": 298, "repo_created_at": "2020-11-07T14:59: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": "9175617b...
b5bc691c-f5ce-45ee-b8ed-d4d5addf156b
kilikilikid/leetcode
0051_NQueens.cpp
#include <iostream> #include <vector> #include <string> using std::string; // using namespace std; std::vector<std::vector<string>> solveNQueens(int n); void bk(int row, std::vector<string>& board, std::vector<int>& cols, std::vector<int>& diag1, std::vector<int>& diag2, std::vector<std::vector<string>>& ans); ...
ALGO
0.999916
5.43358
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-06-23T13:26: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": "fb264d110e8e...
08896216-b013-4ce5-ad59-3d0eaf14bba0
nqhung291/algorithm
divide-conquer/PIE/solve.cpp
/* My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and each of them gets a piece of pie. This should be one piece of one pie, not several small pieces since that looks messy. This ...
ALGO
0.999959
4.600891
{ "github_metadata": { "branch": "master", "commit_count": 56, "repo_created_at": "2020-10-17T04:47: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": "0e085cc76...
9db00ec9-8c18-4c79-87b1-04acf3d816a2
abhishek3432/geeksforgeeks
Quick Sort.cpp
//{ Driver Code Starts #include <stdio.h> #include <bits/stdc++.h> using namespace std; /* Function to print an array */ void printArray(int arr[], int size) { int i; for (i=0; i < size; i++) printf("%d ", arr[i]); printf("\n"); } // } Driver Code Ends class Solution { public: //Function t...
ALGO
0.999968
6.376835
{ "github_metadata": { "branch": "main", "commit_count": 199, "repo_created_at": "2023-11-16T06:42:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5eb57b0c06...
6fa57b79-5344-4404-a04c-dc776bf8121c
wystephen/QuickFusing
include/MYEKF.h
#pragma once // // Created by steve on 17-1-17. // #ifndef QUICKFUSING_MYEKF_H #define QUICKFUSING_MYEKF_H //#include "Sophus/SO3.h" #include "SettingPara.h" #include <deque> class SettingPara; // forward declaration class MyEkf { public: MyEkf(SettingPara para) { // MYCHECK(1); para_ = para; ...
ALGO
0.998658
4.679368
{ "github_metadata": { "branch": "master", "commit_count": 1158, "repo_created_at": "2016-11-23T11:38:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "da4043b...
b1949b37-46a0-4673-9e03-bbf7a9b6ed80
langningchen/Coding
XMOJ/2013.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll N = 55; const ll M = 2005; const ll INF = 0x7FFF'FFFF'FFFF'FFFF; ll n, m, P[N], Cost[N], Limit[N], Temp[M], h[M], f[N][105][M], g[M]; struct EDGE { ll u, v, w, next; } Edge[N * N]; ll Counter = 1, Head[N], in[N]; void AddEdge(ll u, ll v, l...
ALGO
0.999738
3.651701
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2022-05-25T03:10:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9637b3bea46e...
6397fc48-19a1-46b2-b8c8-eee2f70d9b86
njumathdy/code-practice
Leetcode/372_Super Pow/c++/solution.cpp
/******************* Your task is to calculate ab mod 1337 where a is a positive integer and b is an extremely large positive integer given in the form of an array. *******************/ #include <cstdlib> #include <cstdio> #include <exception> #include <vector> #include <algorithm> #include <string> #include <iostream>...
ALGO
0.999787
5.090441
{ "github_metadata": { "branch": "master", "commit_count": 149, "repo_created_at": "2019-03-13T03:39:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7cd02d10...
b18d4e75-fa48-4fae-a1bd-0caba0e8be5e
sunnynote/algorithm
BOJ/1890_점프.cpp
#include <iostream> #include <cstring> using namespace std; int N; int map[105][105]; long long d[105][105]; int dx[2]={0,1}; int dy[2]={1,0}; long long dfs(int x, int y){ if(x==N-1 && y==N-1) return 1; // 종료 조건 if(d[x][y]!=-1) return d[x][y]; // 방문했다면 리턴 if(map[x][y]==0) return 0; // 값이 0일 때 리턴 if...
ALGO
0.999982
4.214286
{ "github_metadata": { "branch": "master", "commit_count": 401, "repo_created_at": "2020-03-04T16:28: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": "1a82857d...
e806c43c-be18-43f1-8024-5642194d9842
Abhi-wolf/All-DSA-Questions
Leetcode/Hard/Trapping-rain-water.cpp
#include <iostream> #include <vector> using namespace std; /* Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. Example 1: Input: height = [0,1,0,2,1,0,1,3,2,1,2,1] Output: 6 Explanation: The above elevation map (black secti...
ALGO
0.999998
6.65147
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-09-16T04:41: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": "609a2425d8cb...
1422ab88-abdd-4d79-a217-2a79926883bf
chano062400/Algorithm
프로그래머스/2/176962. 과제 진행하기/과제 진행하기.cpp
#include <bits/stdc++.h> using namespace std; struct info { string subject; int start, cost; }; struct cmp { bool operator()(const info& i1, const info& i2) { return i1.start > i2.start; } }; vector<string> solution(vector<vector<string>> plans) { vector<string> answer; priority_...
ALGO
0.99975
4.260951
{ "github_metadata": { "branch": "main", "commit_count": 718, "repo_created_at": "2023-10-24T10:32: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": "b123f18e73...
8defa9fd-011d-4f47-89b2-744cc973a0c4
C-2024-4-6/8214230106-jinhao
4.2.1.cpp
#include <iostream> #include <cstring> using namespace std; int indexOf(const char* s1, const char* s2) { int len1 = strlen(s1), len2 = strlen(s2); for (int i = 0; i <= len2 - len1; ++i) { int j; for (j = 0; j < len1; ++j) { if (s2[i + j] != s1[j]) { break; ...
ALGO
0.997168
4.654259
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2024-11-06T16:54:17.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e4102f18fc...
105ecce5-870f-4e62-907a-3b0dffae61a0
pichenettes/eurorack
peaks/pulse_processor/pulse_randomizer.cc
// Copyright 2013 <NAME>. // // Author: <NAME> (<EMAIL>) // // 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 // to use, copy, mo...
ALGO
0.957524
6.902063
{ "github_metadata": { "branch": "master", "commit_count": 191, "repo_created_at": "2013-08-26T15:53:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2769, "forks": 775, "issues": 4, "pull_requests": 3 }, "file_meta": { "content_id": "2f7...
a36b98e4-2073-4232-a063-aea2a347ef26
alextkalinka/linkcomm
src/linkcomm_edgesims_all.cpp
/* Code to calculate edge similarities for hierarchical clustering of edges to produce link communities * when including all edges, not just those that share a node. * For undirected networks Jaccard coefficients will be calculated, for directed and/or weighted networks the Tanimoto coefficient. * * Author: <NAME>...
ALGO
0.999146
4.763189
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2020-03-05T22:14:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 2, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "49096e3fd...
6f82f14e-473f-4a56-9e28-118b6952c172
TaejuPark/OPMB_RTSS_2020
dm.cpp
#include "sys_model.h" #include "common.h" #include <cstdio> #include <unordered_set> #include <stack> // frame with shortest deadline has the highest priority (global priority) bool DM(struct sys_model *model) { unordered_set<string> visitMap; stack<int> chStack; stack<int> idxStack; int selFrameCh; ...
ALGO
0.999081
5.428802
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-09-21T21:50:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "09bf4c9453...
63c1044f-e57d-4cab-9d28-95707957a36d
NikolasEnt/Algorithm-Collection
sorting/insertion_sort.cpp
#include <iostream> #define arraySize(a) (sizeof(a)/sizeof((a)[0])) using namespace std; // Function for an array printing void print_arr(int* a, int N){ for (int i = 0; i < N; i++){ cout << a[i] << " "; } } void insertionSort(int *a, const int N){ int j, tmp; int counter = 0; // Count number of the loop execu...
ALGO
0.999964
5.076102
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2017-06-06T15:35: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": "81ee0e3bc...
a0f0f544-3339-464e-85d7-18e2953c2d78
Avinash0308/Competitive_Programming
001/tilaktest/text.cpp
#include <bits/stdc++.h> using namespace std; bool comp(pair<int, int> a, pair<int, int> b) { if (a.first < b.first) return true; if (a.first == b.first) return a.second > b.second; else return false; } int maxProfitAssignment(vector<int> &difficulty, vector<int> &profit, vector<int>...
ALGO
0.999986
5.11974
{ "github_metadata": { "branch": "main", "commit_count": 53, "repo_created_at": "2023-07-14T21:02:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "44b8f946ca3...
69d60eb6-3caf-42ad-bb7c-7b1468b8854f
JimmyWang0417/Algorithm-Competitive-Codes
Libre Online Judge/#6279 数列分块入门 3.cpp
#include <algorithm> #include <cmath> #include <cstdio> #include <vector> #define re register using namespace std; template <typename T> inline void read(T &x) { x = 0; char s = (char)getchar(); bool f = false; while (!(s >= '0' && s <= '9')) { if (s == '-') f = true; s =...
ALGO
0.999966
4.815689
{ "github_metadata": { "branch": "master", "commit_count": 106, "repo_created_at": "2019-08-30T06:36:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d120f2b1...
edf5b769-ad1a-4072-b501-fe5cd6e8a34c
misaka18931/misaka-cp
extra/NOI2021/celebration/celebration.cpp
#include <algorithm> #include <bitset> #include <cstdio> #include <climits> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; typedef long long i64; typedef unsigned i32; typedef unsigned long long u64; template<typename T> void chkmax(T &a, const T &b) { a = max(a, b); } t...
ALGO
0.999945
3.977108
{ "github_metadata": { "branch": "main", "commit_count": 332, "repo_created_at": "2020-12-30T07:06:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f8719b56e2...
3f4fa589-29a1-4219-adc7-4f24e42e0e8d
mppf/distributed-lsb
mpi/mpi_lsbsort_onesided.cpp
#include <array> #include <chrono> #include <iomanip> #include <iostream> #include <memory> #include <string> #include <vector> #include <cassert> #include <cstdint> #include <unistd.h> #include <mpi.h> #include <pcg_random.hpp> // Note: this code assumes that errors returned by MPI calls do not need to be // handl...
ALGO
0.999266
4.865652
{ "github_metadata": { "branch": "main", "commit_count": 78, "repo_created_at": "2025-02-05T18:17:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4bc1b6bb644...
384bf43e-3524-45b5-ae96-8b07c28b5d64
CarolinaSantejo/MiEI-UMinho
3Ano/CG/Trabalhos/Fase4/src/Motor/MotorUtils/catmullrom.cpp
#include <cmath> #include "../../Utils/headers/pointFigure.hpp" #include "../../Utils/headers/matrixAux.hpp" #include "headers/catmullrom.hpp" void catmull::getCatmullRomPoint(float t, utils::point p[], float* pos, float* deriv) { // catmull-rom matrix float m[4][4] = { {-0.5f, 1.5f, -1.5f, 0.5f}, ...
ALGO
0.995192
4.401252
{ "github_metadata": { "branch": "main", "commit_count": 139, "repo_created_at": "2021-09-28T22:39:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f09bd9dda8...
b3ffa2b1-6a8b-471a-a78d-371766867c52
rashq-01/progress
c-c++/Linked_List/Singly_Linked_List/3_middleLinkedList.cpp
#include<iostream> using namespace std; class Node{ public: int data; Node* next; Node(int value){ data = value; next = NULL; } }; class List{ Node* head; Node* tail; public: List(){ head = tail = NULL; } ...
ALGO
0.995705
5.254897
{ "github_metadata": { "branch": "main", "commit_count": 73, "repo_created_at": "2024-12-15T16:01: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": "23434ed548a...
2247cba3-c50b-4bcb-bfa4-4bf690f93a51
ssungk/study
C++/lab01/lab01_04/lab01_04.cpp
#include <iostream> #include <iomanip> using namespace std; int* topgrade (int*,int*,int*); int main() { int grade1; int grade2; int grade3; int* pgrade1; int* pgrade2; int* pgrade3; cin >> grade1; cin >> grade2; cin >> grade3; pgrade1 = &grade1; pgrade2 = &grade2; pgrade3 = &grade3; int* top; to...
ALGO
0.99841
3.538028
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2022-08-14T05:41: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": "02ee98895516...
cf4f9472-c679-4e34-a88c-00827be97965
ryuat/algorithm
Graph/groupAlocNum.cpp
/* 2667 단지번호붙이기 (1) 그룹번호 출력 */ #include <iostream> using namespace std; int a[25][25]; int group[25][25]; bool check[25][25]; void dfs(int row, int col, int grp, int max_idx){ if (0 <= row && row < max_idx && 0 <= col && col < max_idx ){ // 방(인덱스)이 존재하는데 if(check[row][col] == false && a[row][col]==1){...
ALGO
0.999978
4.374012
{ "github_metadata": { "branch": "master", "commit_count": 174, "repo_created_at": "2018-05-22T14:19:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6b5d1c2a...
3fb96bdb-53e0-4097-b919-57d18e575779
Ddieguin/dynamic_programming
minimum_matriz_multiplication.cpp
#include <bits/stdc++.h> #define ROW 2 #define COL 2 using namespace std; int main(int argc, char *argv[]) { int a [2][2] = {{2, 3}, {4, 5}}; int b [2][2] = {{3, 5}, {6, 7}}; int r[2][2]; memset(r, 0, sizeof(r)); for(int i = 0; i < ROW; i++) { for(int j = 0; j < COL; j++) { ...
ALGO
0.999927
3.941344
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2022-04-24T00:38:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "67410fbc99...
610c27f3-4faa-4f83-9d81-400baeed50c2
t104/atcoder-cpp
joi014/b1.cpp
#include <bits/stdc++.h> using namespace std; int64_t DP[4100][4100]; int64_t A[4100]; int64_t N; int64_t calc(int l, int r, bool joisTurn) { if (DP[l][r] != -1) // メモ化済み return DP[l][r]; if (l == r) { if (joisTurn) return DP[l][r] = A[l]; return DP[l][r] = 0; } if (joisTurn) { return...
ALGO
0.999953
3.898222
{ "github_metadata": { "branch": "master", "commit_count": 657, "repo_created_at": "2021-07-24T09:44: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": "5480f9e9...
7edddc39-a6a8-439f-9f0f-8f0b54f89a77
Abhishek-1337/Competitive-coding-CPP
Graph/Cycle Detection/directed DFS/cycleDetection.cpp
#include<bits/stdc++.h> using namespace std; class Graph{ int V; vector<vector<int>> arr; public: bool looper(); bool checkCycleDfs(vector<int> &visited, int vertex, vector<int> &dfsVisited); Graph(int V); void addEdge(int u, int v); }; Graph::Graph(int V){ ...
ALGO
0.999834
4.430145
{ "github_metadata": { "branch": "main", "commit_count": 58, "repo_created_at": "2022-06-16T11:36: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": "44dbf5ddf5c...
b99aaf22-a93f-4797-b35e-000fd251f90b
Tarunagg1/Ds_Alog_notes
Mo_Algorithm/Mo_Algorithm.cpp
#include <stdio.h> #include <stdlib.h> #include <bits/stdc++.h> using namespace std; int block; struct Query { int start; int end; }; bool compare(Query a, Query b) ; void queryResults(int arr[], int size, Query q[], int no) ; int main() { int size,i; cout<<"Enter the size of the arra...
ALGO
0.999654
4.803091
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2021-01-19T04:18:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dae2bb7a90...
d6cc901a-067c-4443-9146-5ca4918e9e42
barkolorious/cses-solutions
Tree_Algorithms/1133_tree_distances_II.cpp
// barkolorious - 09 October 2024 #include <bits/stdc++.h> using namespace std; #define FIN(x) freopen(x ".in", "r", stdin) #define FOUT(x) freopen(x ".out", "w", stdout) #define int long long #define pb push_back #define fr first #define sc second const int N = 2e5 + 5; vector<int> adj[N]; int n, subt[N], subl[N]...
ALGO
0.999904
4.605796
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-12-03T12:29:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6471070ae30b...
6a1baa9a-5b22-4111-9531-cbea834bef64
emes3ye/Cookbook
Tree Hash.cpp
const long long HMOD = 2078526727; const long long BASE = 1572872831; ll pw[N]; int subtree[N], level[N]; vector<int>adj[N]; //assuming edges are directed void dfs(int root, int lvl = 1){ subtree[root] = 1;level[root] = lvl; for(int i = 0; i < adj[root].size(); i++){ int nxt = adj[root][i]; dfs(...
ALGO
0.999887
3.91084
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2018-08-31T05:15:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8fa148fe0c...
a5213c06-3ad6-4799-88c0-156eee02fca8
2Gily/Samsung-SDS-Algorithm-Lecture
DP1/1915-가장 큰 사각형.cpp
#include <vector> #include <iostream> #include <string> #include <algorithm> #define endl "\n" #define MAX 1001 using namespace std; int n, m; int number[MAX][MAX]; int dp[MAX][MAX]; void init() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); } int main(void) { init(); cin >> n >> m; for (int i = 0; i...
ALGO
0.999936
3.67429
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2021-07-19T02:39: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": "a2018acdb29...
c2a97cc7-20d8-4b9b-bb48-9ef5868ab8b0
Koyingtw/CP
CF practice/1671C.cpp
// Problem: <NAME> // Contest: Codeforces - Educational Codeforces Round 127 (Rated for Div. 2) // URL: https://codeforces.com/contest/1671/problem/C // Memory Limit: 256 MB // Time Limit: 2000 ms // // Powered by CP Editor (https://cpeditor.org) #pragma GCC optimize("O3") #include <bits/stdc++.h> #define Weakoying i...
ALGO
0.999919
4.538737
{ "github_metadata": { "branch": "main", "commit_count": 79, "repo_created_at": "2021-07-10T12:46:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "044d6344ca7...
8dd85fd4-d5e9-44f8-9914-8d77d5a002ce
delcanovega/NeetCode
08_Tries/01_Implement_Trie/main.cpp
#include <cassert> #include <string> #include <unordered_map> using namespace std; class PrefixTree { public: PrefixTree() { word = false; } void insert(string word) { PrefixTree* node = this; for (char c : word) { if (!node->has(c)) { node->insert(c...
ALGO
0.997315
5.732783
{ "github_metadata": { "branch": "main", "commit_count": 91, "repo_created_at": "2024-12-27T18:09: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": "919578ac3a9...
9c4236cb-c93e-4164-85fa-238fed9b173a
sahilbajaj82/my-code-repo
codeforces/contest1265/C.cpp
#include <bits/stdc++.h> using namespace std; using ll =long long; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif int n; cin>>n; while (n--) {...
ALGO
0.999926
3.189725
{ "github_metadata": { "branch": "master", "commit_count": 49, "repo_created_at": "2019-12-04T10:28:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "04c265bf6...
59e442ff-06e5-41b5-9ffc-69a1ba7b6321
Buttiyeeppp/Code
Luogu/P3803.cpp
#include <bits/stdc++.h> #include <cmath> using namespace std; #define clo 1000.*clock()/CLOCKS_PER_SEC #ifndef xxzx #define endl '\n' #endif using ll=long long; using PII=pair<int,int>; const int N=4e6+10; const ll Mod=998244353; bool mem1; ll f[N],g[N]; int n,m,tr[N]; ll Pow(ll x,ll y) { ll res=1; while(y) { ...
ALGO
0.999997
4.052229
{ "github_metadata": { "branch": "master", "commit_count": 386, "repo_created_at": "2023-02-11T04:30:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "276d0e57...