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
764beac4-d852-4fe4-91fb-498c11bd59fa
ishandutta2007/codeforces-b
bidzilya/normal/616/A.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; int Compare(const string& a, const string& b) { if (a.length() < b.length()) { return -1; } if (a.length() > b.length()) { return 1; } for (int i = 0; i < (int) a.length(); ++i) { ...
ALGO
0.999973
4.198894
{ "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": "8f44a9ae0f9c...
42d58884-e029-4126-9125-2a105d4f65ce
SkaRkaL/Cpp_Modules
Cpp_09/ex02/PmergeMe.hpp
#pragma once #include <iostream> #include <vector> #include <deque> #include <algorithm> #include <iterator> using std::cout; using std::deque; using std::endl; using std::lower_bound; using std::make_pair; using std::pair; using std::vector; template <typename T> void binarySearchSort(T &left, T &right) { typename...
ALGO
0.99995
5.385951
{ "github_metadata": { "branch": "main", "commit_count": 121, "repo_created_at": "2023-09-17T10:47: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": "42efc9e6cf...
14ce6d6c-4506-410a-b1ba-8155c67f4ac2
eshoguli/openvino
ngraph/core/src/op/mvn.cpp
// Copyright (C) 2018-2021 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // #include <algorithm> #include "itt.hpp" #include "ngraph/builder/autobroadcast.hpp" #include "ngraph/builder/reduce_ops.hpp" #include "ngraph/op/add.hpp" #include "ngraph/op/broadcast.hpp" #include "ngraph/op/constant.hpp" #include...
ALGO
0.966812
6.927108
{ "github_metadata": { "branch": "master", "commit_count": 3977, "repo_created_at": "2020-05-23T16:50:34.000Z", "is_fork": true, "is_org_owned": false, "forked_from": "openvinotoolkit/openvino", "stars": 0, "forks": 0, "issues": 0, "pull_requests": 9 }, "file_meta": { "...
0e02a9e0-d65a-4f03-afc3-3d6e0be6f36b
Hilbertmf/competitive-programming-problems
contests/google/code-jam/2022/qualification-round-2022-1/punched-cards.cpp
#include <bits/stdc++.h> using namespace std; #define DEBUG(x) cout << #x << " >>>> " << x << endl #define MID(l, r) (l + (r - l) / 2) #define CEILDIVISION(x, y) ((x + y - 1) / y) #define INF (int)1e9 #define LONGINF (long long)1e18 #define MEM(arr, val) memset(arr, (val), sizeof(arr)) #define FASTIO ios_base::...
ALGO
0.999757
3.698887
{ "github_metadata": { "branch": "main", "commit_count": 217, "repo_created_at": "2021-07-20T20:40:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3ac2d2d495...
56397644-4ed2-4c5d-8b0d-e7d9432c32cf
dougshidong/PHiLiP
src/ode_solver/ode_solver_base.cpp
#include "ode_solver_base.h" #include "limiter/bound_preserving_limiter_factory.hpp" namespace PHiLiP { namespace ODE{ template <int dim, typename real, typename MeshType> ODESolverBase<dim,real,MeshType>::ODESolverBase(std::shared_ptr< DGBase<dim, real, MeshType> > dg_input) : dg(dg_input) , limiter(...
ALGO
0.999776
6.39602
{ "github_metadata": { "branch": "master", "commit_count": 1502, "repo_created_at": "2018-12-17T20:30:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 49, "forks": 40, "issues": 80, "pull_requests": 14 }, "file_meta": { "content_id": "3b8...
2bd57773-65b4-47ad-af3a-2a1e9a4a75eb
sayanbose-0000/Codes
practice/mergesort.cpp
#include <iostream> using namespace std; void merge (int arr[], int low, int mid, int high) { int i = low, j = mid+1, k = low; int x[100]; while (i <= mid && j <=high) { if (arr[j] < arr[i]) { x[k++] = arr[j++]; } else { x[k++] = arr[i++]; } } while (i <= mid) x[k++] = arr[i++];...
ALGO
0.999975
5.241328
{ "github_metadata": { "branch": "main", "commit_count": 97, "repo_created_at": "2024-04-15T07:56: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": "6fa3edb5644...
793629e3-3dcf-4737-88fc-47f94f71c843
MiaoDX/pose_estimation
AlglibCluster/src/statistics.cpp
/************************************************************************* ALGLIB 3.12.0 (source code generated 2017-08-22) Copyright (c) <NAME> (ALGLIB project). >>> SOURCE LICENSE >>> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as publishe...
ALGO
0.997717
3.405634
{ "github_metadata": { "branch": "master", "commit_count": 76, "repo_created_at": "2017-08-18T16:32:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f92d883bd...
0af0a74b-af37-49e0-b43e-7f13a54d6ef1
supertuxkart/stk-code
lib/bullet/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 <NAME> http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is ...
ALGO
0.998102
7.420366
{ "github_metadata": { "branch": "master", "commit_count": 23677, "repo_created_at": "2014-01-15T00:28:54.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4811, "forks": 1110, "issues": 463, "pull_requests": 8 }, "file_meta": { "content_id": ...
3bd9dd29-f036-4f4d-9e81-7f9ff036dd0f
Sheane-mario/Numerical-Computing
Newton_Method.cpp
#include <bits/stdc++.h> #define EPS 1e-6 #define DELTA 1e-5 using namespace std; typedef long long ll; // function for which we approximate root long double f(long double x) { // x^3 - 2x^2 + x - 3 long double exp = ((x - 2)*x + 1)*x - 3; return exp; } // derivative of the function f long double df(long ...
ALGO
0.999494
4.018859
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-07-03T11:15: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": "b9e6f80ed54a...
c9a0874f-db4c-4c3b-97af-02fd54efa2f2
karygauss03/Leetcode-Solutions
2051-longest-common-subpath/2051-longest-common-subpath.cpp
class Solution { private: int BASE = 100001; int MOD = 1e9 + 7; bool check(int mid, vector<vector<int>>& paths, int n) { unordered_map<int, vector<int>> prevPathsHashes; for (int i = 0; i < paths.size() && (i == 0 || !prevPathsHashes.empty()); ++i) { long long hashPath = 0, pow ...
ALGO
0.999972
5.855111
{ "github_metadata": { "branch": "main", "commit_count": 3023, "repo_created_at": "2022-05-07T10:16:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 16, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "52ebb5e4...
f5cdd7aa-857e-4793-a838-791875ff744e
lays03/algorithm
排序算法/插入排序.cpp
#include <iostream> using namespace std; #include <vector> #include <algorithm> #include <time.h> #include <stdlib.h> void InsertSort(vector<int>&v, int len) { for(int i = 1; i < len; ++i) { int val = v[i]; int j = i - 1; for(; j >=0; --j) { if(v[j] <= val) ...
ALGO
0.99984
5.336476
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2024-10-30T06:09: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": "306f527d6e0...
30b671c6-3808-4d88-bdfe-d247cbe2a61e
phooten/working_knowledge
leetcode/arrays/stocks_ii_7-13-2023/main.cpp
#include<stdio.h> #include<vector> #include<set> #include<iostream> using namespace std; class Solution { public: int maxProfit(vector<int>& prices) { int c_profit = 0; // current // Alorithm 1: buy and sell as soon as you can auto curr = prices.begin(); bool found = false; ...
ALGO
0.999866
4.817671
{ "github_metadata": { "branch": "master", "commit_count": 323, "repo_created_at": "2019-12-30T01:41: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": "b0dbbf3a...
ef86d186-d31b-40cc-ba50-9036814d709a
DEWETRON/otfft
src/otfft_base.h
// Copyright (c) 2015, OK おじさん(岡久卓也) // Copyright (c) 2015, <NAME>(Takuya OKAHISA) // Copyright (c) 2017 to the present, DEWETRON GmbH // OTFFT Implementation Version 9.5 // based on Stockham FFT algorithm // from OK Ojisan(Takuya OKAHISA), source: http://www.moon.sannet.ne.jp/okahisa/stockham/stockham.html using name...
ALGO
0.998153
7.116265
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2018-01-10T09:19:57.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 23, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ebf28f59e...
db6526f9-9ebf-48a8-bd0b-430dec1e9a57
emilyju0314/gpt_code_plagiarism
dataset/code_content_classifier/allpro_train/1_2903_24.cpp
#include <bits/stdc++.h> using namespace std; template <class _T> inline void rd(_T &_a) { int _f = 0, _ch = getchar(); _a = 0; while (_ch < '0' || _ch > '9') { if (_ch == '-') _f = 1; _ch = getchar(); } while (_ch >= '0' && _ch <= '9') _a = _a * 10 + _ch - '0', _ch = getchar(); if (_f) _a = -_a; } ...
ALGO
0.999885
4.13596
{ "github_metadata": { "branch": "main", "commit_count": 50, "repo_created_at": "2024-04-28T03:59:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0bbf75d9628...
eaaca4a1-aa72-4444-a34a-0a4cb1307f16
Tgotp/Rectangling-Panoramic-Images-via-Warping
aaa/seam_carving.cpp
#include "seam_carving.h" using namespace cv; using namespace std; int A[6] = {1,1,1,-1,-1,-1}; int B[6] = {-1,0,1,-1,0,1}; int W[6] = {1,2,1,-1,-2,-1}; Mat rimg,img,cimg,mask,maskx,masky; int n,m; bool cshow; vector<vector<double > > G,E,C; vector<vector<point > > U; // 位移场 Mat SeamC::get_seam_carving() { retu...
ALGO
0.992513
3.805485
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2024-04-14T02:12:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 22, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c16868e333...
fa479c16-e54b-40fa-aa21-f9c9226d8187
IzaYam/Programacion-Estructurada
Punteros/Hoja 4.2.h
#pragma once #include<iostream> #include<conio.h> #include<time.h> using namespace std; void generarDatos(int* v1) { for (int i = 0; i < 40; i++) { v1[i] = rand() % 101; } } void MostrarDatos(int* v1) { for (int i = 0; i < 40; i++) { cout << "Puntaje alumno " << i + 1 << " :"; cout << v1[i] << endl; } } voi...
ALGO
0.996526
3.651099
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2021-11-12T15:12: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": "24afec2d527...
dc4e1453-7ea4-4e8f-93b2-17b5e785bec4
magnoazneto/IFPI_Algoritmos
URI/uri_1068_leds.cpp
#include <iostream> using namespace std; int filtro(char numero){ if (numero == 1){ return 2; } else if ((numero == 2) || (numero == 3) || (numero == 5)){ return 5; } else if (numero == 4){ return 4; } else if ((numero == 6) || (numero == 9) || (numero == 0)){ ...
ALGO
0.999013
3.767797
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-05-15T16:54: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": "519eb54f6f...
0b6988f2-4eb6-4c75-ab3a-0540838ead88
GitZzw/sdx_aruco
cat/src/cat/src/fisheyeCali.cpp
#include "stdio.h" #include <iostream> #include <fstream> #include "opencv2/opencv.hpp" #include <opencv2/core/core.hpp> #include "opencv2/calib3d/calib3d.hpp" #include <opencv2/highgui/highgui.hpp> using namespace std; using namespace cv; int main(int argc, char** argv) { vector<string> files; for(auto cou...
TOOL
0.97505
3.799615
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2020-11-21T15:05:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d68911b65...
d716cc59-b9c5-4899-8fbb-613fcc6f12d8
Meinersbur/rosetta
benchmarks/suites/polybench/gemm/gemm.omp_parallel.cxx
// BUILD: add_benchmark(ppm=omp_parallel) #include <rosetta.h> static void kernel(pbsize_t ni, pbsize_t nj, pbsize_t nk, real alpha, real beta, multarray<real, 2> C, multarray<real, 2> A, multarray<real, 2> B) { #pragma omp parallel default(none) firstprivate(...
ALGO
0.978216
4.29291
{ "github_metadata": { "branch": "master", "commit_count": 437, "repo_created_at": "2022-12-01T22:53:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c7376d13...
59affaa7-0f4c-4f82-b3ea-c1483c428983
wisehead/Lintcode
001.fizz_buzz/fizz_buzz.cpp
/******************************************************************************* * file name: fizz_buzz.cpp * author: <NAME>. (c) 17 * mail: <EMAIL> * created time: 17/10/16-1...
ALGO
0.998968
5.384267
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-10-16T10:30: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": "617aafc191...
6edff1ee-99dc-4470-b395-e1826f18dd2b
kmjp/procon
srm/771-810/810/JoinAClub.cpp
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<to;x++) #define FORR(x,arr) for(auto& x:arr) #define FORR2(x,y,arr) for(auto& [x,y]:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #defin...
ALGO
0.999981
4.478003
{ "github_metadata": { "branch": "master", "commit_count": 3966, "repo_created_at": "2015-02-15T11:25:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 2, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "8d44cc...
714ea84a-bf5d-4f94-95d3-f1929fc0bf31
ByteCraft-9/Operating-System
Operating-System.cpp
#include <iostream> #include <vector> #include <unistd.h> #include <sys/types.h> #include <sys/wait.h> #include <fstream> using namespace std; struct Process { pid_t pid; string name; string state; int priority; int burstTime; int waitTime; int taTime; bool memoryallucation; }; void Crea...
ALGO
0.998798
3.498681
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-07-20T17:17: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": "bedaacb6ea45...
14321d62-50f2-42d3-bcc3-ab133ad13a92
Accelerator404/Algorithm-Practice
PKU C&C++ MOOC/C-Advanced-PKU Mooc/放苹果.cpp
#include <iostream> using namespace std; //放苹果 //把n个同样的苹果放在m个同样的盘子里,问在允许空盘的情况下共有多少种不同的分法? //如5,1,1和1,5,1是同一种分法。 int comb1(int n, int m){ //专门在无空盘子情况下进行统计 int count = 0; if (m == 1) count = 1; else if (m == 2) count = n / 2; else if (m > 2){ for (int i = n - m + 1; i > n / m;i--...
ALGO
0.999977
4.521791
{ "github_metadata": { "branch": "master", "commit_count": 383, "repo_created_at": "2017-12-20T05:33:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cb95f774...
1fc83f7c-4e11-4b8b-8b46-fb8ab051f21c
MartinPiloni/CompetitiveProgramming
Codeforces/TC2023/I1/G.cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back #define fst first #define snd second #define sz(x) ((int)x.size()) #define all(x) x.begin(),x.end() using ll = long long; using str = string; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, m; cin >> n >> m; ...
ALGO
0.999974
3.860024
{ "github_metadata": { "branch": "main", "commit_count": 357, "repo_created_at": "2023-01-03T01:54: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": "feb8808a05...
c059b78e-6145-436f-b359-d1a67b8f36c0
ans4572/algorithm_study
kim/9주차/ACM_Craft.cpp
#include<iostream> #include<cmath> #include<vector> #include<queue> #include<algorithm> using namespace std; int t, n, k, w; // t : 테스트케이스 , n : 건물개수 , k : 건설순서 규칙 갯수 int D[1010]; // 건물 타임 int resultCost[1010]; vector<int> building[1010]; int degree[1010]; void start() { queue<int> q; for (int i = 1; i <= n; i++)...
ALGO
0.999949
4.261011
{ "github_metadata": { "branch": "main", "commit_count": 128, "repo_created_at": "2022-05-12T08:38: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": "96ac7e9a58...
b597eb9b-6fda-4abb-b133-e8034bf06e5f
LJFYC007/code
test/2020-10/2020-10-22/source/X503-D07/b/b.cpp
/*************************************************************** File name: b.cpp Author: ljfcnyali Create time: 2020年10月22日 星期四 15时55分25秒 ***************************************************************/ #include<bits/stdc++.h> using namespace std; #define REP(i, a, b) for ( int i = (a), _end_ = (b); i <= _end_; +...
ALGO
0.999984
4.257406
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2018-08-02T05:42:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f933ec5f1...
104ae8b2-4dc7-490e-9caf-0615365a5eba
YangSeungYeol/TIL
SWexpert/D5/금속막대.cpp
#include<iostream> #include<vector> using namespace std; int tc, T, N; vector <pair<int, int>> vec; vector <pair<int, int>> ans; pair <int, int> p; int main(int argc, char** argv) { cin >> T; for (tc = 1; tc <= T; ++tc) { vec.clear(); ans.clear(); cin >> N; for (int i = 0; i < N; i++) { cin >> p.first >...
ALGO
0.999813
4.017125
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2020-07-10T11:26: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": "a66ccba2c...
e6662a5e-01ca-429c-87dc-4dddd3b4cbcf
Deepanshus98/leetcode_mag
988. Smallest String Starting From Leaf.c++
/* Medium 1161 181 Add to List Share You are given the root of a binary tree where each node has a value in the range [0, 25] representing the letters 'a' to 'z'. Return the lexicographically smallest string that starts at a leaf of this tree and ends at the root. As a reminder, any shorter prefix of a string is...
ALGO
0.999975
5.829967
{ "github_metadata": { "branch": "main", "commit_count": 45, "repo_created_at": "2022-07-14T07:54: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": "437b33dbc91...
96c7d462-4897-4e2b-a788-7dc2bb5c0b61
odol0503/InterviewBit
ib/level3/BinarySearch/MedianOfArray.cpp
/************************************************************************************************* Median of Array There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays ( The median of the array formed by merging both the arrays ). The overall run time complexity ...
ALGO
0.999994
5.233665
{ "github_metadata": { "branch": "master", "commit_count": 278, "repo_created_at": "2018-01-03T01:15:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "23fe5bc6...
a9e66a90-bfaa-4a5f-8ef8-d27383c39159
paranumal/libparanumal
libs/mesh/meshMultiRateHaloTraceSetup.cpp
/* The MIT License (MIT) Copyright (c) 2017-2022 <NAME>, <NAME>, <NAME>, <NAME> 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 us...
ALGO
0.941885
5.830794
{ "github_metadata": { "branch": "main", "commit_count": 2920, "repo_created_at": "2018-07-29T18:48:19.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 159, "forks": 43, "issues": 9, "pull_requests": 3 }, "file_meta": { "content_id": "7e6c7a7...
20d15b23-807f-48e1-a5b9-243b78863450
Ezz-Eldeen/Competetive-Prog-journey
ACM Sheet 3rd sesh/abc312_B_Tak_Code/abc312_B_Tak_Code.cpp
#include <iostream> #include <map> #include <vector> int main() { int n; scanf("%d", &n); int m; scanf("%d", &m); std::vector<std::string> input; std::vector<std::pair<int, int>> first_half; //first half of the TakCode std::vector<std::pair<int, int>> second_half; for (int i =...
ALGO
0.999919
3.361403
{ "github_metadata": { "branch": "main", "commit_count": 51, "repo_created_at": "2025-03-04T12:31: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": "d191d4bc929...
60099532-988a-4553-aaf5-962e139cbfd3
akbarmridho/leetcode
csif-problemset/1-introductory/Number_Spiral.cpp
#include <bits/stdc++.h> #include <cstdio> #include <iostream> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); uint64_t n; uint64_t row; uint64_t col; cin >> n; for (uint64_t i = 0; i < n; i++) { cin >> row; cin >> col; uint64_t diagon...
ALGO
0.99995
3.532121
{ "github_metadata": { "branch": "main", "commit_count": 190, "repo_created_at": "2024-12-23T03:27: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": "5b06834891...
da55d8b5-b6d0-44a3-9f3e-af2c16a3162b
manisha-27/Tecca_the_Robo
0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divmicrosoft-divdiv-classcompanytagscontainer-tagoccurence26-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgb...
class Solution { public: vector<int> spiralOrder(vector<vector<int>>& matrix) { int row=matrix.size(); int col=matrix[0].size(); int top=0, bottom=row-1; int left=0, right=col-1; vector<int> arr; while(top<=bottom && left<=right){ for(int i=left;i<=right;i...
ALGO
1
6.21111
{ "github_metadata": { "branch": "main", "commit_count": 1031, "repo_created_at": "2021-12-09T05:24:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e7f885d50...
2abe0271-0fe8-4a7a-bd91-04172bd34e28
tanmayck1201/DSACppSection
Interview Practice/LL/LLAll.cpp
#include<iostream> using namespace std; class Node{ public: int data; Node* next; }; class LinkedList{ private: Node *first, *last; public: LinkedList() { first = nullptr; last = nullptr; } // ~LinkedList(); void CreateLL(int*A, int n); void DisplayLL(...
ALGO
0.999101
4.509183
{ "github_metadata": { "branch": "main", "commit_count": 59, "repo_created_at": "2021-09-12T05:34:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0bba1a2f92f...
76f26338-ccf6-45c7-bbd9-58f74b9d32cf
seoo2001/data-structure
원형연결리스트.cpp
#include <stdio.h> #include <stdlib.h> typedef int element; typedef struct ListNode { element data; struct ListNode *link; } ListNode; typedef struct ListType { ListNode *tail; int size; } ListType; void init(ListType *L) { L->tail = NULL; L->size = 0; } int isEmpty(ListType *L) { return L->size == 0; } vo...
ALGO
0.999453
4.010609
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-11-26T02:15: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": "85c6f6d7b55e...
f76e7ef7-3165-470c-821c-c93788e83caa
ishandutta2007/codeforces-k
kostaskostil/normal/1156/E.cpp
#include <bits/stdc++.h> #define pb push_back #define fi first #define se second using namespace std; typedef long long ll; #define int ll const int nmax = 2e5+100; int p[nmax]; int q[nmax]; main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin>>n; for (int i=1; i<=n; ...
ALGO
0.999723
3.273628
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:06: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": "b452cfd38ab9...
575822d5-4eb5-4dd1-bb11-8521347c9482
raincross7/code-similarity
codes/train_code/problem469/problem469_155.cpp
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define sz(x) int(x.size()) #define show(x) {for(auto i: x){cout << i << " ";} cout << endl;} using namespace std; using ll = long long; using P = pair<int, int>; int main() { int N; cin >> N; vector<int> A(N); rep(i, N) cin >> A[...
ALGO
0.999889
3.704707
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-03-06T05:07: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": "a8a1f611acca...
23e640ab-2276-4f10-b23d-af369c9bb54f
abdulsamie10/Library-Management-System
main.cpp
#include <iostream> #include <cstring> #include <iomanip> using namespace std; // Constants const int MAX_STUDENTS = 20; const int MAX_BOOKS = 15; const int MAX_NAME_LENGTH = 50; // Global variables int student_count = 0; int book_count = 0; double student_balance[MAX_STUDENTS]; int student_roll[MAX_STUDENTS]; char ...
TOOL
0.985871
4.637866
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2023-04-29T14:22:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c152c8d244...
f9c1368d-80c8-410e-a197-085018d962b2
tendstofortytwo/aoc23
day7/part1.cpp
#include <fmt/core.h> #include <bits/stdc++.h> using std::operator""sv; enum Type { HighCard, OnePair, TwoPair, ThreeOfKind, FullHouse, FourOfKind, FiveOfKind }; struct Hand { Type type = HighCard; int deck[5]; int bet = 0; }; Hand makeHand(std::string_view line) { Hand h; std::unordered_map<int, int> count; ...
ALGO
0.997842
5.663015
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2023-12-01T18:59: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": "8eedaf9c6bb...
f51b0e11-1d15-4d9b-927c-19f1042de998
101magikarp101/USACO
875-2/pairs.cpp
#include <iostream> #include <algorithm> #include <vector> #include <set> #include <queue> #include <map> #include <cmath> #include <iomanip> #include <cstring> #include <bitset> #include <string> #define ll long long using namespace std; int T, N; map<pair<int, int>, int> m; int a[200001], b[200001]; int main() { ...
ALGO
0.999963
3.379421
{ "github_metadata": { "branch": "main", "commit_count": 66, "repo_created_at": "2024-09-25T15:08: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": "7f50d362707...
237680b3-d564-4242-8f30-97b2d74b822f
zhuli19901106/51nod
NOD1276(AC).cpp
#include <algorithm> #include <cstdio> #include <vector> using namespace std; vector<int> v; int n, q; vector<int> p, t;// p for peak, t for trough int main() { int i, j; scanf("%d%d", &n, &q); v.resize(n); for (i = 0; i < n; ++i) { scanf("%d", &v[i]); } int m = 0; i = 0; ...
ALGO
0.999975
3.793644
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2015-05-28T05:46:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "116e18805...
f3c84863-e0e7-485b-8630-0a0254e16f46
AveePB/AEI
algorithms-and-data-structures/szkopul/zadanie-urzednicy.cpp
#include <iostream> const int N = 1e6+7; // https://szkopul.edu.pl/problemset/problem/cSV0kK7zLib42_NGIA7DvOoZ/site/?key=statement int main() { // Speed boosters std::ios_base::sync_with_stdio(0); std::cout.tie(0); std::cin.tie(0); // Initialize variables int n, nReports=0, arr[N], dp[N]; ...
ALGO
0.999949
4.450225
{ "github_metadata": { "branch": "main", "commit_count": 76, "repo_created_at": "2024-10-21T19:31: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": "aaca51a33c5...
0d8cc53e-dc7e-46c0-ab12-465d3687b1f0
godotengine/godot
thirdparty/rvo2/rvo2_3d/KdTree3d.h
/* * KdTree.h * RVO2-3D Library * * Copyright 2008 University of North Carolina at Chapel Hill * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/license...
ALGO
0.99169
5.572577
{ "github_metadata": { "branch": "master", "commit_count": 76043, "repo_created_at": "2014-01-04T16:05:36.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 98972, "forks": 22820, "issues": 5000, "pull_requests": 3866 }, "file_meta": { "content...
6a585967-c859-46ae-a0b2-920bbd1fe378
elisaoh/ECE759
cuml_ver2/cuml/cpp/src/tsne/exact_tsne.h
/* * Copyright (c) 2019-2020, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable...
ALGO
0.999807
6.214178
{ "github_metadata": { "branch": "master", "commit_count": 69, "repo_created_at": "2020-03-27T01:14:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "039f49ae5...
f60a3e9f-8d53-4314-84ed-861433858edf
keshavgupta1304/DSA-QUESTIONS
3629-total-characters-in-string-after-transformations-i/total-characters-in-string-after-transformations-i.cpp
class Solution { public: int lengthAfterTransformations(string s, int t) { const int MOD = 1e9 + 7; long long result = s.size(); vector<long long> freq(26, 0); for (char ch : s) { freq[ch - 'a']++; } for (int i = 0; i < t; i++) { vector<long lo...
ALGO
0.999993
6.204728
{ "github_metadata": { "branch": "main", "commit_count": 1333, "repo_created_at": "2024-06-14T10:54: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": "5c7549131...
3d952e56-cdac-4960-99ce-d1d7a782fe2b
hitlar240/Code
Phitron-DSA/W05-level-order_traversal.cpp
#include<bits/stdc++.h> using namespace std; class Node { public: int val; Node* left; Node* right; Node(int val) { this->val = val; left = NULL; right = NULL; } }; void level_Order(Node* root) // O(N) { //if(root != NULL) // NULL -> false if(!root) return; ...
ALGO
0.999991
4.686897
{ "github_metadata": { "branch": "main", "commit_count": 104, "repo_created_at": "2023-05-22T09:19: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": "00424afa7b...
22a92fa6-f431-4b7f-925f-0348f2baab45
cuicunze1/SwordToOffer
面试体5-Extra:排序数组按序合并/面试题5-Extra:排序数组按序合并.cpp
#include<cstdio> /* 测试用例: 1.数组为空 2.数组2穿插在数组1中间 3.数组2全部在数组1后面 4.数组2全部在数组1前面 5.数组1数字相同 6.数组2数字相同 7.数组1中有重复数字 8.数组2中有重复数字 9.二者均有重复数字 */ void SortMerge(int num1[], int num2[],int length) { if (num1 == nullptr || num2 == nullptr||length<=0) return; int length1=0, length2=0; for (; num1[length1] != '\0'; length1++); fo...
ALGO
0.999198
4.248035
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2018-03-06T13:50: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": "819318ac0...
dca3e522-46f7-42be-bc42-23747ec64db2
jbhongg/algorithm-solve
BOJ/BOJ17413.cpp
//#include<iostream> //#include<string> //#include<queue> // //using namespace std; // //int main() { // ios_base::sync_with_stdio(false); // cin.tie(0); // cout.tie(0); // // string s; // char a; // int idx = 0; // 부분 문자열의 시작점을 저장하는 변수 // queue <pair <int, int>> q; // // getline(cin, s); // // //공백과 특수문자의 위치를 저장 // f...
ALGO
0.999895
3.755033
{ "github_metadata": { "branch": "main", "commit_count": 38, "repo_created_at": "2021-07-11T07:00: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": "06841e86dae...
ee597270-1f3f-408d-8a3a-ae056e3760f1
viniciuskuwakino/APOO
Fila.cpp
#include <iostream> #include <string> using std::cout; using std::endl; using std::string; class Node { private: Node* next; int value; public: Node (int value) { this->value = value; this->next = NULL; } ~Node () { } int ...
TOOL
0.948667
4.86415
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-10-24T10:24: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": "fc1a44d219...
24ff79e8-c3ec-47c5-9529-6b9b3dcb9f43
akonneker/mtf_mapper
include/distortion_optimizer.h
/* Copyright 2011 <NAME>. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following dis...
ALGO
0.999761
6.08472
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-06-15T04:32:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9345464050d3...
0a876b13-e275-4090-8650-f06e6654eed5
Linsenx/AcmCodes
Contests/ECJTUACM17/1008/main.cpp
#include <bits/stdc++.h> using namespace std; int table[1000100]; int o7(int x) { if (x % 7 == 0) { return 1; } else { //123 while (x > 1) { int k = x % 10; x /= 10; if (k == 7) { return 1; } } } return 0; } int main() { ios::sync_with_stdio(false); #ifdef O...
ALGO
0.998641
3.961029
{ "github_metadata": { "branch": "master", "commit_count": 51, "repo_created_at": "2018-03-04T07:21: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": "f3d0d5202...
4345c15c-33cc-4278-b2c6-9b78d9dc4634
okp369/AtCoder
AtCoder/ソース95.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <map> #include <set> using namespace std; typedef long long ll; #define rep(i,n) for (int i = 0; i < (n); ++i) int main() { vector<int> v = { 0,0,0,1,1,1,4,4,4 }; // | 0 | 0 | 0 | 1 | 1 | 1 | 4 | 4 | 4 | // 0 1 2 3 4 5...
ALGO
0.999861
3.538414
{ "github_metadata": { "branch": "master", "commit_count": 88, "repo_created_at": "2021-12-30T02:20: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": "48f2d521b...
d017ff80-f7f3-4b5e-8263-8e62c023fefd
matheusmtta/Competitive-Programming
Codeforces/1382A.cpp
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define INF (int)0x3f3f3f3f #define LINF (long long)0x3f3f3f3f3f3f3f3fll #define mp make_pair #define pb push_back typedef long int int32; typedef unsigned long int uint32; typedef long long int int64; typedef unsigned long long int uint64; int m...
ALGO
0.999949
3.248512
{ "github_metadata": { "branch": "master", "commit_count": 301, "repo_created_at": "2019-11-23T14:54:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "69d45fea...
2c01bb10-844c-4469-b284-a8518a859c04
Ultron011/DSA
BINARY TREE/MEDIUM/DIAMETER OF BINARY TREE/OPTIMAL APPROACH/diameterOfBinaryTree.cpp
/** * Problem : Diameter of a Binary Tree * * Description : * The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path may or may not pass through the root. * The length of a path between two nodes is represented by the number of edges between them. * * Input: ...
ALGO
0.999996
6.49926
{ "github_metadata": { "branch": "main", "commit_count": 206, "repo_created_at": "2024-10-19T16:32: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": "90a5e2e9c1...
c636327e-0f93-4de6-a29c-b0d9f8b36dc2
Eangsokunthea/CODE_BK
TH20201_TTUD_BK/BAI_TRAINNG2/baiTH2_K_QUEUE.cpp
#include <cstdio> #include <cmath> #include <cstring> #include <ctime> #include <iostream> #include <algorithm> #include <set> #include <vector> #include <sstream> #include <queue> #include <typeinfo> #include <fstream> #include <map> #include <stack> typedef long long ll; using namespace std; //freopen("D.in","r",stdi...
ALGO
0.999993
3.616502
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2021-11-01T08:00: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": "3d332f09fa...
bc8f50a8-a986-473e-8b3f-787eca5af63b
soybean33/BAEKJOON
1394 암호.cpp
#include <iostream> #include <string> #include <unordered_map> int sLen; // sLen: 암호에 사용할 수 있는 문자의 개수 std::unordered_map<char, int> um; // um[i]: 암호로 사용할 수 있는 문자의 위치 std::string cyperText; // cyperText: 암호 int answer; // answer: 주어진 암호를 풀기위한 시도 횟수 void Solution(){ int cyperTextLen = cyperText.length(); // cyperTex...
ALGO
0.999834
4.24834
{ "github_metadata": { "branch": "main", "commit_count": 338, "repo_created_at": "2023-03-06T04:20: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": "192ee2e90f...
bd55b659-91e8-478e-b157-4771c115f1bb
memcpy0/LeetCode-Conquest
Solutions/2591-2600/135. Candy[贪心,一次遍历] 困难.cpp
/* ** Problem: https://leetcode.cn/problems/candy ** Article: https://memcpy0.blog.csdn.net/article/details/111602874 ** Author: memcpy0 */ // BEST: 一次遍历+常量空间 class Solution { public: int candy(vector<int>& ratings) { int n = ratings.size(); int ret = 1; int inc = 1, dec = 0, pre = 1; ...
ALGO
0.999999
6.359715
{ "github_metadata": { "branch": "main", "commit_count": 366, "repo_created_at": "2021-08-14T13:49:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ae09321795...
ba88af50-fb6a-4824-8896-fa91785e533d
vanshxgupta/DSA
Graph/DetectacycleinanUndirectedgraph.cpp
//USING BFS //T.C->O(V+2E)+O(V) //S.C->O(V) class Solution { private: bool detect(int src,vector<int> adj[],int vis[]){ vis[src]=1; queue<pair<int,int>>q; q.push({src,-1}); while(!q.empty()){ int node=q.front().first; int parent=q.front().secon...
ALGO
0.999975
6.116503
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2025-01-14T14:10: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": "abb29480db8...
38717d4c-661d-4501-93e6-24c9e5bf3d8d
kassonlab/gmxapi
src/gromacs/linearalgebra/gmx_lapack/dlarnv.cpp
#include <cmath> #include "../gmx_lapack.h" void F77_FUNC(dlarnv,DLARNV)(int *idist, int *iseed, int *n, double *x) { int i__1, i__2, i__3; int i__; double u[128]; int il, iv, il2; --x; --iseed; i__1 = *n; for (iv = 1; iv <= i__1; iv += 64) { i__2 = 64, i__3 = *n - iv + 1; il...
ALGO
0.990221
3.364871
{ "github_metadata": { "branch": "master", "commit_count": 19315, "repo_created_at": "2017-05-25T14:05:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 53, "forks": 13, "issues": 93, "pull_requests": 2 }, "file_meta": { "content_id": "296d...
232187ab-5217-4070-a7de-e5927d0c68bd
mueller-seb/amandus
elasticity/eigen.cc
/********************************************************************** * Copyright (C) 2011 - 2014 by the authors * Distributed under the MIT License * * See the files AUTHORS and LICENSE in the project root directory **********************************************************************/ /** * @file * <ul> ...
ALGO
0.998743
5.642495
{ "github_metadata": { "branch": "heat", "commit_count": 670, "repo_created_at": "2019-05-06T21:21: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": "c433b59890...
5f532cc6-d95f-4ddf-aff7-f8b46c4c8e32
ishandutta2007/codeforces-a
aryanc403/normal/1394/A.cpp
/* in the name of Anton */ /* Compete against Yourself. Author - <NAME> (@aryanc403) */ #pragma GCC optimize ("Ofast") #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize ("-ffloat-store") #include<iostream> #include<bits/stdc++.h> using namespace std; #define fo(i...
ALGO
0.999883
3.155283
{ "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": "36f3b7af0f0d...
ef410c26-8cb4-4018-9d30-08dc7cf6765f
rishilss99/Leetcode-DataStructures_Algorithms
Leetcode_Explore/same_tree_recursion.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999977
6.477545
{ "github_metadata": { "branch": "master", "commit_count": 48, "repo_created_at": "2020-07-27T05:51:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6c0c99f61...
caab5ca7-e5b6-43e7-b76f-205bfc6dda6a
kaixin-sourse/kaoyan842
链表(完结).cpp
#include <stdio.h> #include <stdlib.h> #define Wa 0 #define Ac 1 #define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR 0 #define INFEASIBLE -1 #define OVERFLOW -2 typedef int ElemType; typedef int Status; typedef struct Node { ElemType data; struct Node *next; } LNode, *LinkList; //逆位序输入n个元素的值,建立带表头结点的单链线...
ALGO
0.999936
3.616534
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-08-30T13:05: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": "9e5509eb04bc...
624a9ee7-16cc-438e-89e5-136575ffb92d
scottNicho/503_Indexing
PhysicsSystem.h
#pragma once #ifdef max #undef max #endif #ifdef min #undef min #endif #include "BPtree.h" #include "GameWorld.h" #include <cstdint> #include <utility> template<typename T> std::ostream& operator<<(std::ostream& os, const std::set<T>& insertion) { os << '{'; auto it = insertion.begin(); for (size_t i = 0,...
ALGO
0.991939
4.373498
{ "github_metadata": { "branch": "main", "commit_count": 33, "repo_created_at": "2023-06-07T14:14:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "75b3544c856...
bfa5b744-37a2-494c-92c0-50ad6eafc2de
linliwan/ccc
cpp_letcode/dfs_summary_3.cpp
#include <bits/stdc++.h> using namespace std; // 题目需求:找到所有的“12325”,打印其数量; vector<vector<int>> grid = { {1, 0, 0, 0, 1}, {2, 3, 0, 1, 0}, {5, 2, 3, 2, 0}, {0, 0, 0, 3, 0}, {0, 0, 5, 2, 1} }; int row = grid.size(); int col = grid[0].size(); // 定义目标 vector<int> target = {1, 2, 3, 2, 5}; // 用来标记已经遍历...
ALGO
0.999691
5.543015
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2025-02-10T00:09: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": "714d5e23f87d...
2e773ec0-be82-4081-9764-1239b955ff3e
gpiwar/projekt_spciaa
project_oil2d/oil2d.hpp
#ifndef OIL2D_HPP #define OIL2D_HPP #include <cmath> #include "ads/executor/galois.hpp" #include "ads/output_manager.hpp" #include "ads/simulation.hpp" #include <fstream> #include <sstream> #include <vector> #include <string> #include <filesystem> #define MATRIX_CSV "matrix.csv" std::string find_file(const std::st...
ALGO
0.923141
4.546036
{ "github_metadata": { "branch": "main", "commit_count": 39, "repo_created_at": "2024-04-10T15:55: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": "afd67025263...
9a0dd3b3-59ba-4000-a090-5066fa32409b
Thomaw/Project-Euler
300-400/309.cpp
#include <cmath> #include <iostream> #include <vector> using namespace std; long long GCD(long long x, long long y) { while (true) { if (x == 0) return y; else y %= x; if (y == 0) return x; else x %= y; } } typedef vector<long long> Vector; const long long kMin = 1; const long long kMax = 1000000; int ...
ALGO
0.999593
3.914676
{ "github_metadata": { "branch": "main", "commit_count": 166, "repo_created_at": "2021-09-19T16: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": "da88f21bdc...
c60c8bac-2d73-4366-b333-3ef20af5b716
Mrszhao112/c-cpp-Linux
Cpp/Hash/bites.hpp
#pragma once #include <vector> using namespace std; //位图使用 //用于查找100亿个数据中是否存在某个数 //用于内存不够用的场景 namespace bit { class bitset{ public: bitset(size_t N) { _bits.resize(N / 32 + 1, 0); _num = 0; } void set(size_t i) { size_t index = i / 32;//第几个整形 size_t pos = i % 32;//整形的第几个位 _bits[index] |= (1 <<...
ALGO
0.913669
3.432385
{ "github_metadata": { "branch": "master", "commit_count": 101, "repo_created_at": "2020-04-23T02:19: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": "a572ef76...
d2d988eb-0216-478a-9747-f5da4f8fe74e
mridden/Hactoberfest2021
firstRepeatingEle.cpp
// Given an array arr[] of size n, find the first repeating element. The element should occurs more than once and the index of its first occurrence should be the smallest. // // // // Example 1: // // Input: // n = 7 // arr[] = {1, 5, 3, 4, 3, 5, 6} // Output: 2 // Explanation: // 5 is appearing twice and // its first ...
ALGO
0.999908
5.623476
{ "github_metadata": { "branch": "master", "commit_count": 88, "repo_created_at": "2020-10-06T03:08:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 60, "issues": 2, "pull_requests": 30 }, "file_meta": { "content_id": "0934bf...
5d1e89c1-774e-4e98-bcd7-01856e7daa14
sw-devendra/algo-practice
algo-practice/orientation.h
#pragma once #include <iostream> using namespace std; typedef enum { COLINEAR = 0, CLOCKWISE = 1, ANTICLOCKWISE = 2 } Orientation; struct Point { int x; int y; Point() :x(0), y(0) {}; Point(int xx, int yy) :x(xx), y(yy) {}; void print() { cout << "(" << x << "," << y << ")"; } friend ostream& operator<<(os...
ALGO
0.976661
5.223483
{ "github_metadata": { "branch": "master", "commit_count": 73, "repo_created_at": "2017-08-21T18:44:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 5, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "8dd4d768a...
14d527e7-0801-498a-86d6-61e69850ecdf
Kyan820815/leetcode
lc11xx/lc1104.cpp
//--- Q: 1104. Path In Zigzag Labelled Binary Tree //--- method 1: level symmetric, height condition class Solution { public: vector<int> pathInZigZagTree(int label) { vector<int> res; int h = 0, tmp = label; while (tmp != 1) { tmp >>= 1; ++h; } res.p...
ALGO
0.999993
5.574994
{ "github_metadata": { "branch": "main", "commit_count": 137, "repo_created_at": "2020-11-27T03:28:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "41719c4c9a...
b6ee1da5-62d5-4037-92f0-8f0f709857b9
HarishR21/Geeks-for-Geeks
Difficulty: Easy/Special array reversal/special-array-reversal.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: string reverse(string str) { //code here. /*int count=0; for(int i=0;i<str.size();i++){ if(str[i]>='A' && str[i]<='Z' || str[i]>='a' && str[i]<='z'){ ...
ALGO
0.999815
5.830912
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2024-03-22T18:04:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cd06bb6f26b...
ff82187a-2b19-4f56-a033-0048b893374f
houxianxu/leetcode
leetcode/evalRevesePolishNotation.cc
// http://oj.leetcode.com/problems/evaluate-reverse-polish-notation/ #include <vector> #include <string> #include <stdio.h> #include <stdlib.h> #include <ctype.h> using std::string; using std::vector; // define sim_stack #define MAXVAL 100 int sim_stack[MAXVAL]; int i = 0; /* next free index of sim_stack */ void pu...
ALGO
0.999962
4.692817
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2014-03-20T12:51: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": "667e6c70a...
2e963830-5994-480a-89ff-4f3eb0f0983f
Ph0en1xGSeek/ACM
NowCoder/coding interview/判断t1树中是否有与t2树拓扑结构完全相同的子树.cpp
#include <iostream> #include <vector> using namespace std; bool check(int node1, int node2, vector<int> &lc1, vector<int> &rc1, vector<int> &lc2, vector<int> &rc2) { if(node1 == 0 && node2 == 0) { return true; } if(node1 == 0 || node2 == 0 || (node1 != node2)) { return false; } return check(lc1[n...
ALGO
0.999832
4.340076
{ "github_metadata": { "branch": "master", "commit_count": 558, "repo_created_at": "2016-07-22T08: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": "66e651ae...
34de655b-8f19-4a08-bdc3-e6bbda731ca9
rahulnagurtha/Mycode
codechef/rgame.cpp
#include <bits/stdc++.h> using namespace std; #ifndef ONLINE_JUDGE #include "../debug.hpp" struct debugger dbg; #else #define debug(args...) // Just strip off all debug tokens #endif #define si(i) scanf("%d",&i) #define si2(i,j) scanf("%d %d",&i,&j) #define si3(i,j,k) ...
ALGO
0.999888
3.329311
{ "github_metadata": { "branch": "master", "commit_count": 54, "repo_created_at": "2015-10-06T14:14:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0899fde00...
a3a7647b-7d2f-4bc7-bfe0-332866aba852
kinmioliu/practice
tree/105_construct_binary_tree_from_preorder_and_inorder_traversal.cc
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999993
6.351776
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2021-05-31T15:03: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": "228acd0078...
371025b4-cbd9-4485-ac08-31cd1ecd2589
freitagfelipe/neps-academy
cpp/0599.cpp
#include <iostream> #include <algorithm> using namespace std; #define MAXN 1000 #define MAXS 28 string dict[MAXN + 1]; int tab[MAXS][MAXS]; bool edit_distance(string &a, string &b) { for (int i {}; i < a.size(); ++i) { for (int j {}; j < b.size(); ++j) { int cost {}; if (a[i] !=...
ALGO
0.999985
4.21705
{ "github_metadata": { "branch": "main", "commit_count": 45, "repo_created_at": "2021-04-26T00:22:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5a26075b354...
33b353d8-ecef-4640-9b20-6f22c0bda38d
Akbar014/Competitive_programming_preparation
2D_array.cpp/diagonal_matrix.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int row, col; cin >> row >> col; int ar[row][col]; for ( int i=0; i<row; i++){ for (int j=0; j<col; j++){ cin >> ar[i][j] ; } } int flag = 1; // secondary diagonal // for (int i=0; i<row; i++){...
ALGO
0.999916
4.116007
{ "github_metadata": { "branch": "main", "commit_count": 29, "repo_created_at": "2024-11-20T15:34:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e6680529caa...
5c166f44-e4a4-4228-9158-02ff4099eab9
TosakaUCW/CompetitiveProgramming
Old/Luogu/[Luogu P2068] 统计和.cpp
#include <iostream> #include <stdio.h> #include <algorithm> #include <memory.h> #define ls (p << 1) #define rs (p << 1 | 1) const int N = 1e5 + 5; int n, m; struct Node { int sum, lazy, L, R; } tree[N << 2]; void push_up(int p) { tree[p].sum = tree[ls].sum + tree[rs].sum; } void push_down(int p) { if (tree...
ALGO
0.999834
4.361721
{ "github_metadata": { "branch": "master", "commit_count": 506, "repo_created_at": "2018-09-23T04:02:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5c3033d5...
7280cb4c-0eb0-4a0f-b92e-c53e1cdddc19
Liam-Wei/Data-structures-and-algorithms
第2章:线性表/page40/14.cpp
#include <iostream> using namespace std; typedef struct LNode { int data; struct LNode *next; } LNode, *LinkList; // 头插法 void HeadInsert(LinkList &L) { int val = 0; while (cin >> val) { LNode *s = new LNode; s->data = val; s->next = L->next; L->next = s; if...
ALGO
0.999887
4.150831
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-05-11T11:01:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 24, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "113c7d60a8a...
a2c06ce9-2437-4c65-96d5-aefd3a0868fd
ixray-team/ixray-1.6-stcop
sdk/include/freemagic/MgcDist3DTriTri.h
// Magic Software, Inc. // http://www.magic-software.com // Copyright (c) 2000-2002. All Rights Reserved // // Source code from Magic Software is supplied under the terms of a license // agreement and may not be copied or disclosed except in accordance with the // terms of that agreement. The various license agreemen...
TOOL
0.977813
6.290296
{ "github_metadata": { "branch": "default", "commit_count": 2678, "repo_created_at": "2019-06-29T15:22:47.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 232, "forks": 47, "issues": 43, "pull_requests": 2 }, "file_meta": { "content_id": "12d...
88a4d3a9-1d8c-46b9-9b00-1c8a0c74fcba
Sondinh2k3/Number_Theory
B10_Tprime/main.cpp
/* Cho số tự nhiên N, nhiệm vụ của bạn là hãy liệt kê tất cả các số có đúng 3 ước số. VD: N=100 => ta có các số: 4, 9, 25, 49 Input: Dòng đầu tiên đưa vào số lượng test T Những dòng kết tiếp đưa vào các bộ test. Mỗi bộ test là một số N T, N thõa mãn ràng buộc: 1 <= T <= 100 và 1 <=...
ALGO
0.99959
4.963878
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2024-05-27T03:55: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": "748fcdc15...
3d24143e-178b-426b-a5b5-87802459c032
kaidavid1100/kaidavid1100
player_try.cpp
#include <iostream> #include <fstream> #include <array> #include <vector> #include <cstdlib> #include <ctime> #include <limits.h> #define max(a,b) (a>b?a:b) #define min(a,b) (a<b?a:b) #define DD 5 int setboard[8][8]; int player; const int SIZE = 8; std::array<std::array<int, 8>, 8> board; void setvalue(void); struct ...
ALGO
0.996619
3.825403
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2021-06-29T09:56: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": "0fc020bf2b8b...
ecb6d74b-3b88-4de0-984f-f5b5b6548468
arshpreetsingh134/Algorithms
Data Structures/Trees/BTree.cpp
// Implementation of a B-Tree (O(nlog(n)) for all operations) #include <iostream> using namespace std; // A B-Tree Node class Node { int n; // No. of keys currently in the Node int *keys; // An array of keys inside the node Node **child; // An array of pointers representing child nodes int ...
ALGO
0.99995
4.892091
{ "github_metadata": { "branch": "main", "commit_count": 42, "repo_created_at": "2021-01-23T05:56:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cb4136b906d...
d8d1db47-1a2a-4f15-8ab4-5e6a2d476394
woorimlee/Algorithm-Repository
BOJ_백준/10814 나이순 정렬.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; //sort 함수에서 사용할 비교 기준 함수 //기본적으론 오름차순 //내림차순 : greater <int>() //사용자 정의 순서를 만들어주기 위해 아래와 같은 함수를 만듦. bool comp(pair<int, string> a, pair<int, string> b) { //a.first보다 b.first가 크면 놔두고 if (a.first < b.first) return true; ...
ALGO
0.999972
4.733414
{ "github_metadata": { "branch": "master", "commit_count": 724, "repo_created_at": "2019-01-13T06:40:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2cad17da...
552809dd-54f6-40d6-a941-14a41773869d
jeong-hyeonHwang/Algorithm
Steps/ETC/prob_11866.cpp
//2022.01.29 #include <iostream> #include <vector> using namespace std; int main() { int num, eNum; // eNum: eraseNum cin >> num >> eNum; vector<int> jose(num, 0); bool* eraseIndex = new bool[num]; int index = -1; int* eraseNum = new int[num]; for(int i=0; i<num; i++) { eraseN...
ALGO
0.999984
3.454954
{ "github_metadata": { "branch": "main", "commit_count": 239, "repo_created_at": "2022-01-01T10:04:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 10, "pull_requests": 0 }, "file_meta": { "content_id": "7b7893994...
84d956fb-358d-4132-98e9-778bf7cf4568
wakatakerutmt/atcoder
ABC122/C/main.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for (int i = 0; i< (n); ++i) const long long INF = 1LL<<58; // aを常に小さい値にする 大きい値にする template<class T> void chmin(T &a, T b){ if(a>b) a = b; } template<class T> void chmax(T &a, T b){ if(a<b) a = b; } // 二分探索 前方のindexを返すもの(自分自身を含む) 前方:...
ALGO
0.99985
4.626278
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2020-03-28T11:19: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": "6b2f56c11...
3c11d06a-8c8d-414c-b812-df29a69380d6
hdi-superuser/trainning
HB 2016/DAY 3/C/Tasks/INTSLE/intsle.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll a1, b1, c1, a2, b2, c2; ll d, dx, dy; int main() { freopen("INTSLE.inp", "r", stdin); freopen("INTSLE.out", "w", stdout); while (cin >> a1 >> b1 >> c1 >> a2 >> b2 >> c2) { d = a1*b2 - a2*b1; dx = c1*b2 - c2*b1; ...
ALGO
0.999915
4.981726
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2016-06-07T20:25: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": "443ed7521...
5af94985-ad26-4836-a55d-5868083eccb5
mbtrt7/MyCppPrimer
ch17/Ex_17_10.cpp
#include <iostream> #include <bitset> using std::bitset; template <unsigned N> class Quiz { template <unsigned M> friend std::ostream& operator<<(std::ostream &os, const Quiz<M> &q); public: Quiz(std::istream &is = std::cin) { unsigned n; bool ans; std::cout << "Setting answers" << std::endl; while(is >> n...
ALGO
0.935414
4.770179
{ "github_metadata": { "branch": "main", "commit_count": 54, "repo_created_at": "2023-01-30T16:09: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": "4901635e6c5...
411da5d4-80ca-4d66-8eb3-768990b9b957
MontMor4/CodeforcesExercises
Contest1692/WhereIsTheBishop.cpp
//https://codeforces.com/contest/1692/problem/C #include <bits/stdc++.h> using namespace std; //alias comp='g++ -std=c++17 -g -O2 -Wall -Wconversion -Wshadow -fsanitize=address,undefined -fno-sanitize-recover -ggdb -o out' #define sws std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); //Melhora o desemp...
ALGO
0.999599
3.589177
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-02-23T21:10: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": "666eff8bac75...
6d183830-65ce-4518-aac7-43c578f1c41d
paulinechainet/ECE-ProjetGi
Projet_TG/grman/coords.cpp
#include "coords.h" // Renvoie les coordonnées (dans le repère de la position de Frame) de l'intersection // entre la demi-droite centre Frame -> vecteur directeur vec et le cadre de la Frame Coords Frame::intersect(Coords vec) { Coords mid = dim *0.5; Coords rel = vec / mid; Coords res; if ( rel.x ||...
ALGO
0.988841
4.782201
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2018-04-03T09:08:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 3 }, "file_meta": { "content_id": "2c4f9de2b...
0a07fa02-0b64-46db-9b4f-0d529fe4ffa8
MathProgrammer/CodeForces
2021/Div 2/726/Programs/Challenging Cliffs.cpp
#include <iostream> #include <vector> #include <algorithm> #define all(v) (v).begin(), (v).end() using namespace std; void solve() { int no_of_elements; cin >> no_of_elements; vector <int> A(no_of_elements + 1); for(int i = 1; i <= no_of_elements; i++) { cin >> A[i]; } sort(all(A...
ALGO
0.999824
4.458244
{ "github_metadata": { "branch": "master", "commit_count": 2511, "repo_created_at": "2017-03-13T14:02:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 224, "forks": 90, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "b832...
b584aed1-d8bd-4e01-8e27-662745dd48e4
ritszaar/Project-Euler
1-50/29.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; #define F first #define S second set<pii> prime_factorise(int a, int b) { set<pii> factorisation; for (int i = 2; i * i <= a; i++) { int cnt = 0; if (a % i == 0) { while (a % i == 0) { ...
ALGO
0.999486
5.548639
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2023-03-27T03:07: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": "4ef8422c10...
c7d1eccf-ddea-4b80-b013-a51145644898
yamate11/compprog
agc/agc041/c/cans2.cc
#include <bits/stdc++.h> #include <cassert> typedef long long int ll; using namespace std; int main(int argc, char *argv[]) { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout << setprecision(20); int N; cin >> N; if (N == 2) { cout << "-1\n"; return 0; } vector<vector<char>> B(N, vector...
ALGO
0.999717
3.480793
{ "github_metadata": { "branch": "main", "commit_count": 219, "repo_created_at": "2021-03-11T06:12:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cb6e7b2e39...
200ad8e6-3e6a-479e-9361-694fcd923ac0
paresh113/CodeIsLifeOrLifeIsCode
2.DataStructure/5.Stack/stockSpan.cpp
#include<bits/stdc++.h> using namespace std; vector < int > v; stack < int > s,temp; void stockSpan(int a[], int sz){ for( int i = 0; i < sz; i++){ int c = 1; if(s.size() == 0){ v.push_back(1); } else if(s.size() > 0 && s.top() <= a[i]){ while(s.size() > 0 && s.top() <= a[i]){ ...
ALGO
0.999912
4.194308
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2020-11-22T05:44:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "757eac62e7...
563b10a9-fdb0-4310-b07a-9d325a3d9e8d
ivanisakov99/EC330
7. Graph Algorithms 1/Maze.h
#include <iostream> #include <fstream> #include <cmath> #include <stack> #include <utility> #include <string> #include <cstring> #include <stdio.h> #include <cctype> #include <algorithm> #include <iterator> #include <queue> using namespace std; //Create a class to store the coordinates of the Maze class Coordinates{ ...
ALGO
0.999706
4.159338
{ "github_metadata": { "branch": "main", "commit_count": 119, "repo_created_at": "2021-03-03T21:51:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "935b51ec18...
da795874-7b0f-412e-9230-493ed5f4c8bf
Redleaf23477/ojcodes
cses/1160.cpp
#include <bits/stdc++.h> using namespace std; using LL = long long int; vector<int> nxt; vector<vector<int>> graph; vector<vector<tuple<int,int>>> query; vector<int> ans; vector<bool> vis; vector<int> instk, inpath, incyc; void dfs(int u, int pa, int dep, int rt, int cyc_size) { vis[u] = true, inpath[u] = dep; ...
ALGO
0.999899
4.273893
{ "github_metadata": { "branch": "master", "commit_count": 183, "repo_created_at": "2017-10-19T06:38: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": "25c23170...
003d3118-aacb-481e-a30f-bac7dcfae5ba
ishandutta2007/codeforces-k
ko_osaga/normal/542/A.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <limits.h> #include <math.h> #include <time.h> #include <iostream> #include <functional> #include <numeric> #include <algorithm> #include <stack> #include <queue> #include <deque> #include <vector> #include <string> #include <bitset...
ALGO
0.99998
4.554072
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:06: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": "18082cca43cb...
7d553d56-c6ed-45f0-9fc9-f1004b646d16
Rafiqul-Ala-Mahid/CodeForcesProblem
ARoundDown.cpp
#include<bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { /* code */ int n; cin >> n; if(n==1){ cout << 0 << endl; } else if(n<10) cout << (n - 1) << endl; else if(n<100) cout << (...
ALGO
0.999791
3.775855
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-01-25T19:23:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "681b4fd849c8...
b3a9ec2f-3c8e-473a-9bb1-e1142c470429
Hytidel/SZU_Math_and_Computer
计算机课/数据结构/DSOJ答案/图/村村通工程(Prim算法).cpp
#define _CRT_SECURE_NO_WARNINGS #include<iostream> #include<cstdlib> #include<iomanip> #include<cmath> #include<cstring> #include<algorithm> #include<complex> #include<array> #include<vector> #include<queue> #include<stack> #include<set> #include<map> #include<list> #include<unordered_set> #include<unordered_map> #incl...
ALGO
0.999493
3.644426
{ "github_metadata": { "branch": "main", "commit_count": 349, "repo_created_at": "2023-07-02T02:38:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 197, "forks": 34, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "5824906...