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
0420980c-3405-4bda-a59f-c9121180077c
ishandutta2007/codeforces-k
kuroni/normal/780/E.cpp
#include <iostream> #include <cstdio> #include <vector> using namespace std; bool chk[200005]; int i, j, t, k, n, m, u, v, save[200005]; vector <int> adj[200005], p; void DFS(int u) { chk[u] = true; for (int i = 0; i < adj[u].size(); i++) { int v = adj[u][i]; if (chk[v]) contin...
ALGO
0.999985
3.800217
{ "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": "c93e71d9e30f...
fda69d19-5fa7-442e-8e7d-4c425e2ddc69
DCTewi/CodeWorkspace
Contests/Pintia/e2-4.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; template<class T> T read() { T x = 0; int ch = getchar(), w = 0; while (!isdigit(ch)) w |= ch == '-', ch = getchar(); while (isdigit(ch)) x = (x << 3) + (x << 1) + (ch ^ 48), ch = getchar(); return w ? -x : x; } const int MAXN = 3e3 +...
ALGO
0.999712
3.641652
{ "github_metadata": { "branch": "master", "commit_count": 162, "repo_created_at": "2019-03-12T11:11: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": "1a71a682...
70386814-1f8a-43b1-ba26-20c2b2112e65
LobanovPetr/Cpp-Primer-Plus-6th-ed.-by-Stephen-Prata
16p/Party.cpp
#include <iostream> #include <algorithm> #include <vector> #include <iterator> #include <string> using namespace std; int main() { cout << "Enter Mat friends (\"q\" to stop)\n"; vector<string> MatFr; string s; while (cin >> s, s != "q") MatFr.push_back(std::move(s)); sort(MatFr.begin(), Ma...
ALGO
0.995924
4.124288
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2022-08-22T16:39:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7d9a520558...
f3c9f05b-f90f-4dbe-adcc-a51866ab3528
trilinos/Trilinos
packages/ifpack/test/IC/cxx_main.cpp
/*@HEADER // *********************************************************************** // // Ifpack: Object-Oriented Algebraic Preconditioner Package // Copyright (2002) Sandia Corporation // // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive // license for use of this work by o...
ALGO
0.96474
5.524117
{ "github_metadata": { "branch": "master", "commit_count": 104031, "repo_created_at": "2015-11-16T19:39:16.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1299, "forks": 593, "issues": 263, "pull_requests": 61 }, "file_meta": { "content_id":...
75106453-f9b6-48e6-b4a4-e6f7578f36d5
laotieyyds/leetcode
C++/src/paixu.h
#pragma once #include<iostream> using namespace std; class Sort { public: void BubbleSort(vector<int>& nums) { for (int i = 0; i < nums.size(); i++) { for (int j = i; j < nums.size(); j++) { if (nums[j] < nums[i]) swap(nums[i], nums[j]); } } return; } //quick sort void quicksort(vector<int>& nums...
ALGO
0.999867
4.853667
{ "github_metadata": { "branch": "main", "commit_count": 47, "repo_created_at": "2021-07-18T15:56:02.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "15e692d6083e...
7cc57355-df55-43a3-aabc-c376ab2b088d
ishandutta2007/codeforces-b
babaee/normal/1388/A.cpp
/* <NAME> OK, im back :) */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll, ll> pll; #define all(x) (x).begin(),(x).end() #define X first #define Y second #define sep ...
ALGO
0.99965
3.932848
{ "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": "3486873e5b63...
bf724827-d19a-4d1e-a14a-16dcec581ec5
czinn/cfr
cfr.cpp
#include <deque> #include <unordered_map> #include <iostream> #include "cfr.h" #include "InformationSet.h" namespace cfr { // Game must be two-player, zero-sum. double cfr(InformationSetManager *m, Game *g, double p0, double p1) { if (g->isTerminal()) { return g->utility(); } int player = g->currentPlayer...
ALGO
0.999908
5.462379
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2017-12-24T21:06: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": "5a3963a26d...
0b3243a2-4e56-47aa-8359-e89574d138bb
hmazhar/physbam_public
PhysBAM_Tools/Grids_Uniform_Advection/ADVECTION_SEMI_LAGRANGIAN_UNIFORM_DEFINITION_BETA.h
//##################################################################### // Copyright 2002-2010, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>. // This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt. //######################################...
ALGO
0.999206
5.291536
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2014-04-02T21:48:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 30, "forks": 13, "issues": 2, "pull_requests": 1 }, "file_meta": { "content_id": "db5e49d...
44ed1e83-8713-427b-bbfe-88993d1194b7
isedaniel/sistemas
src/13-estructuras/code/clase0531/clase0531/clase0531.cpp
#include <iostream> /* Nodo con puntero al siguiente y al anterior */ struct Node { int value; Node* next; Node* prev; }; /* Creamos nodo con malloc */ static Node* create_node(int value) { Node* n = (Node*)malloc(sizeof(Node)); if (!n) { exit(EXIT_FAILURE); } n->valu...
ALGO
0.999759
5.348186
{ "github_metadata": { "branch": "main", "commit_count": 410, "repo_created_at": "2024-03-25T15:49: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": "edaae923d2...
02712e07-13ac-4b9f-8fe2-87e6ec162941
ManojG13/C_plus_plus
3Controlflow/4Simplett.cpp
#include<iostream> int main() { //(A and B and C) or (A and( (not B) or (not C))) = Q int A = 0; int B = 0; int C = 0; int Q; Q = A; //case 0: std::cout<<"A\tB\tC\t\tQ\n"; std::cout<<A<<"\t"<<B<<"\t"<<C<<"\t\t"<<Q<<"\n"; C = 1; Q = A; std::cout<<A<<"\t"<<B<<"\t"<<C<<...
ALGO
0.999124
3.57462
{ "github_metadata": { "branch": "main", "commit_count": 29, "repo_created_at": "2021-01-30T09:49:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "80f63ed3314...
3542b529-25bb-4dbf-93d7-52fc3c03bd01
FrankLiQiang/SolidJava
app/src/main/jni/native-lib.cpp
#include <jni.h> #include <cstring> #include <cmath> #include <android/log.h> #include <vector> #include <cfloat> #include <cstdlib> #include <complex> using namespace std; #define LOG_TAG "System.out" #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__) #define LOGI(...) __android_log_print...
ALGO
0.987663
3.312372
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2023-09-11T09:48: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": "124acda2b1...
7460a3b5-1d30-4971-aa13-9599eda12013
timshnayder/projects
SnowCalls/main.cpp
#include <iostream> #include <vector> using namespace std; int main() { int cases; int max = 10; string phoneNumber; string phoneClean; cin >> cases; for(int i = 0; i < cases; i++){ max=10; phoneClean.clear(); cin >> phoneNumber; for(int i = 0; i < max; i++){ ...
ALGO
0.99656
3.798162
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2022-08-31T23:10:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "15e81124271...
1f1f004a-3de6-4a12-8334-3680ade040f0
vaibhavpuri32/Standard-programs
Segment Trees/Assignment on segments.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int #define inf 1e18 ll t[400005]; bool marked[400005]; void push(int v) { if (marked[v]) { t[v*2] = t[v*2+1] = t[v]; marked[v*2] = marked[v*2+1] = true; marked[v] = false; } } void update(int v, int tl, int tr, int l,...
ALGO
0.999951
4.67465
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2020-07-23T18:38:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 4, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "abd997ec7...
4ead30dd-1e0e-427b-896f-e6998a8819f5
imulan/procon
codeforces/1207B.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for(int i=0;i<(int)(n);++i) #define all(x) (x).begin(),(x).end() #define pb push_back #define fi first #define se second #define dbg(x) cout<<#x" = "<<((x))<<endl template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U...
ALGO
0.999642
3.143857
{ "github_metadata": { "branch": "master", "commit_count": 2571, "repo_created_at": "2015-11-25T03:18:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 1, "issues": 27, "pull_requests": 0 }, "file_meta": { "content_id": "260f90...
5c0b4b2c-6c3b-427a-a15e-a6ee302bfa09
Infus3d/CSES-Solutions
cses_solutions/Sorting And Searching/NearestSmallerValues.cpp
/* * Problem link : https://cses.fi/problemset/task/1645 * * We can maintain a stack that contains the smallest numbers to * the left of i. At each i we pop from the stack the elements * that are not smaller that x[i]. This helps 'clean' the stack * from the unnecessary elements as x[i] is clearly the better * ...
ALGO
0.999998
4.631433
{ "github_metadata": { "branch": "main", "commit_count": 212, "repo_created_at": "2023-01-19T20:15: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": "80c6892ba6...
2986d788-2785-46af-bb08-4059c8f878e8
wincle626/HLS_Legup
legup-4.0/llvm/lib/Transforms/LegUp/ElementaryCycles.h
//===------ ElementaryCycles.cpp ------------------------------------------===// // // This file is distributed under the LegUp license. See LICENSE for details. // //===----------------------------------------------------------------------===// // // Enumerating Circuits and Loops in Graphs with Self-Arcs and Multiple...
ALGO
0.998719
6.303721
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-09-29T15:48:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 27, "forks": 19, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "39550d91...
33ee6063-3790-42f6-995b-64f6959db897
Pankajesc/Leetcode
0218-the-skyline-problem/0218-the-skyline-problem.cpp
class Solution { public: vector<vector<int>> getSkyline(vector<vector<int>>& buildings) { int edge_idx = 0; vector<pair<int, int>> edges; priority_queue<pair<int, int>> pq; vector<vector<int>> skyline; for (int i = 0; i < buildings.size(); ++i) { const auto &b = ...
ALGO
0.999984
6.637101
{ "github_metadata": { "branch": "main", "commit_count": 796, "repo_created_at": "2023-05-29T10:33: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": "d0a590566a...
fd2705ab-1538-4e07-853b-f5b708a2c514
WenjieSun1996/LeetCode
Cpp/601~1250 hard/1074. Number of Submatrices That Sum to Target.cpp
class Solution { public: int numSubmatrixSumTarget(vector<vector<int>>& matrix, int target) { int n = matrix.size(), m = matrix[0].size(), res = 0; vector<vector<int>> v{vector<int> (m, 0)}; for (auto &t : matrix) { v.push_back(v.back()); for (int i = 0; i < m; ++i) {...
ALGO
0.999988
6.340953
{ "github_metadata": { "branch": "master", "commit_count": 55, "repo_created_at": "2019-11-28T06:06: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": "846515d15...
1f0ce072-41aa-4adf-a997-7f0591c20028
lighthouse97/algorithm
BaekJoon/1920.cpp
// 1920.cpp // 수 찾기 // 이분탐색 #include "pch.h" #include <cstdio> // NULL #include <iostream> //#include <cstring> // memset #include <vector> #include <algorithm> // sort, max, min //#include <climits> // INT_MAX //#include <string> // string, stoi //#include <utility> // pair //#include <stack> //#include <set> //#incl...
ALGO
0.999996
4.81851
{ "github_metadata": { "branch": "main", "commit_count": 226, "repo_created_at": "2020-10-15T05:53: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": "c145349cee...
3197aff3-f5f3-4a84-ab2a-a86b56486cdd
ANI-IN/leetcode
2829-determine-the-minimum-sum-of-a-k-avoiding-array/2829-determine-the-minimum-sum-of-a-k-avoiding-array.cpp
class Solution { public: int minimumSum(int n, int k) { // Initialize an array 'arr' to store the sequence of integers. vector<int> arr = {1}; // Initialize a variable 'i' to start generating integers from 2. int i = 2; // Initialize a boolean variable 't' t...
ALGO
0.999991
6.473185
{ "github_metadata": { "branch": "main", "commit_count": 2012, "repo_created_at": "2023-08-05T02:22:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d303e6770...
92413187-2d3f-4a48-aac6-671b13814a61
privefl/bigutilsr
src/rollmean.cpp
/******************************************************************************/ #include <Rcpp.h> using namespace Rcpp; /******************************************************************************/ // [[Rcpp::export]] NumericVector roll_mean(const NumericVector& x, const NumericVector& w...
ALGO
0.999969
6.045799
{ "github_metadata": { "branch": "master", "commit_count": 92, "repo_created_at": "2019-07-31T12:57:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 3, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "f7328da7...
89883d6e-f881-4cd0-9e48-cb76423dab72
cms-sw/cmssw
JetMETCorrections/InterpolationTables/interface/interpolate.h
#ifndef NPSTAT_INTERPOLATE_HH_ #define NPSTAT_INTERPOLATE_HH_ /*! // \file interpolate.h // // \brief Low-order polynomial interpolation (up to cubic) // for equidistant coordinates // // Author: <NAME> // // October 2009 */ #include "JetMETCorrections/InterpolationTables/interface/ProperDblFromCmpl.h" namesp...
ALGO
0.978106
6.623061
{ "github_metadata": { "branch": "master", "commit_count": 251237, "repo_created_at": "2013-06-26T14:09:07.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1144, "forks": 4480, "issues": 947, "pull_requests": 108 }, "file_meta": { "content_id...
da33e19a-d2ac-4a69-90e0-756933fa42cc
JoshH28/CP_cpp
numberfun.cpp
// These days, our song's on replay // Begging the DJ, don't turn it off // Baby, let your body move to my heartbeat // I don't need no sleep, leave our love on // And turn it up, up, play it all night // Let your hands go, pick the tempo // You're spinning on and on in my head // Like a broken record, since I met ya, ...
ALGO
0.999556
3.377856
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2022-12-23T12:56: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": "4d7e2fc5b1cc...
007dae09-e80f-44fb-9a22-3076255ef42d
ishandutta2007/codeforces-f
farhod_farmon/normal/1000/B.cpp
#include <bits/stdc++.h> #define fi first #define se second #define fin(s) freopen( s, "r", stdin ); #define fout(s) freopen( s, "w", stdout ); const long long N = 100100; const long long Q = 2e18; const long long mod = 1e9 + 7; const long long MAGIC = 30; using namespace std; int n; int m; int d[N][2][2]; void so...
ALGO
0.999816
3.256336
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:43:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d5eae2db63ce...
afe63171-4f5c-493e-b141-4cac9ddf93ef
jitendrabhadoria/competitiveprogramming
Graphs 1/has_path.cpp
// Code : Has Path // Send Feedback // Given an undirected graph G(V, E) and two vertices v1 and v2(as integers), check if there exists any path between them or not. Print true or false. // V is the number of vertices present in graph G and vertices are numbered from 0 to V-1. // E is the number of edges present in gra...
ALGO
0.999633
5.636915
{ "github_metadata": { "branch": "main", "commit_count": 191, "repo_created_at": "2021-10-15T18:17:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "16f2a57607...
b3e371c5-4e27-4446-85d6-4c58f94a0a68
krish09111/CPP
Practical7-2.cpp
#include <iostream> #include <fstream> #include <vector> #include <string> #include <sstream> using namespace std; int main() { ifstream inputFile("students.txt"); if (!inputFile) { cerr << "Error: Unable to open file." << endl; cout<<"<NAME>_24DCE133"<<endl; return 1; } ...
TOOL
0.964448
4.259713
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2025-03-31T07:25: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": "eaa47d397ee7...
ed4c8437-cc79-41fb-aedc-43b0e2c5d029
carlosngo/CompetitiveProgramming
UVA/UVA12376.cpp
#include <bits/stdc++.h> using namespace std; // READING INPUT #define SCD(t) fscanf(stdin, "%d",&t) #define SCLD(t) fscanf(stdin, "%ld",&t) #define SCLLD(t) fscanf(stdin, "%lld",&t) #define SCC(t) fscanf(stdin, "%c",&t) #define SCS(t) fscanf(stdin, "%s",t) #define SCF(t) fscanf(stdin, "%f",&t) #define SCLF(t) fscanf...
ALGO
0.99985
4.085525
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2019-04-27T13:36: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": "dd132c81d...
1855bdb2-999b-4e41-9ace-5c3f13f2b9ce
PaddlePaddle/Paddle-Lite
lite/kernels/xpu/lookup_table_compute.cc
// Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required...
TOOL
0.972785
7.127958
{ "github_metadata": { "branch": "develop", "commit_count": 7526, "repo_created_at": "2017-09-20T11:41:42.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 7124, "forks": 1620, "issues": 68, "pull_requests": 17 }, "file_meta": { "content_id": ...
8baa8f17-06c0-41d4-860c-fd429d07c90c
mhlee1215/cvip-tmp-repos
colorization/colorization.cpp
#include "Taucs_fix.h" #include "Taucs_matrix.h" #include "Taucs_vector.h" #include <stdio.h> #include <cmath> typedef Taucs_matrix<taucs_double> TaucsMatrix; typedef Taucs_vector<taucs_double> TaucsVector; typedef Taucs_symmetric_matrix<taucs_double> TaucsSymmetricMatrix; #define mu 5 //local window size for calcu...
ALGO
0.996732
3.591035
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2015-03-29T04:44: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": "dd3a0841c5...
a6336b5c-f11a-494a-bf38-61edc4ec10e3
johannasmriti/Data-Structures
array/level-2/twentyeight.cpp
/*Majority Element Difficulty Level : Medium Last Updated : 22 Apr, 2021 Write a function which takes an array and prints the majority element (if it exists), otherwise prints “No Majority Element”. A majority element in an array A[] of size n is an element that appears more than n/2 times (and hence there is at most o...
ALGO
0.999979
4.69921
{ "github_metadata": { "branch": "main", "commit_count": 53, "repo_created_at": "2021-07-07T05:07:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0e005674cf8...
9416270e-fa1f-4caa-86fd-6f7d34aa397d
nicoladematteo/TicTacToe
GameBoard.cpp
#include <iostream> #include <string> #include "GameBoard.h" void GameBoard::instruction() { std::cout << "1|2|3\n-----\n4|5|6\n-----\n7|8|9\n\n"; } char GameBoard::numberToLetter(int x) { return ((x > 0) ? (x == 1) ? 'X' : 'O' : ' ')...
ALGO
0.963183
4.268628
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2022-08-08T14:46: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": "5fbc05c4150...
fe73726b-80ea-4766-a7c1-73b218cd55da
blender/blender
extern/ceres/internal/ceres/small_blas.h
// Ceres Solver - A fast non-linear least squares minimizer // Copyright 2023 Google Inc. All rights reserved. // http://ceres-solver.org/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of so...
ALGO
0.998477
7.163851
{ "github_metadata": { "branch": "main", "commit_count": 152123, "repo_created_at": "2019-10-09T12:47:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 15670, "forks": 2395, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f...
0ee9d931-8de5-4c0e-989e-79ad8214acc7
D1shi/competitive-programming-problem-solutions
CSES/TwoSets.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll N; cin >> N; ll target = (N * (N + 1)) / 2; vector<ll> s1, s2; if (target % 2 != 0 || N == 1) { cout << "NO"; return 0; } target /= 2; cout << "YES" << endl; for (int n = N; n > 0; --n...
ALGO
0.999977
4.147875
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2024-09-19T22:53: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": "9906989d186...
d9828b48-3bf2-41ef-852b-86b6c83f4924
Ayu-hack/Hacktoberfest2024-1
C++_Problems/2ndMin.c++
// finding the 2nd min element in the array #include <iostream> using namespace std; int secondMinElement(int arr[], int n, int min) { int secondMin = arr[0]; for (int i = 1; i < n; i++) { if (arr[i] < secondMin && arr[i] > min) { secondMin = arr[i]; } } return secondMin; } int minElemen...
ALGO
0.999875
5.475816
{ "github_metadata": { "branch": "main", "commit_count": 185, "repo_created_at": "2023-10-11T17:59:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 38, "forks": 424, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "235a456...
55a15736-f2c3-4525-974d-611c387b5613
Arin0402/Data-structures-and-Algorithms
14_Dp/D090.Mobile Numeric Keypad Problem [ IMP ].cpp
#include <bits/stdc++.h> using namespace std; // https://practice.geeksforgeeks.org/problems/mobile-numeric-keypad5456/1 // 1 // memo // O(n) (for loops are runiing for negligible number so consider O(n)) // O(n) class Solution { public: long long helper(int i, int j, int count, int n, vector<vector<int>> &nums, ...
ALGO
0.999774
5.302994
{ "github_metadata": { "branch": "main", "commit_count": 224, "repo_created_at": "2022-12-08T07:13:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "24c28da192...
68fb0f21-eea4-490b-8013-d90f4458164d
butasebi/Algorithms
Lowest Common Ancestor.cpp
//<NAME> (butasebi) //University of Bucharest #include<bits/stdc++.h> #define MOD 1000000007 #pragma comment(linker, "/stack:200000000") #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize("unroll-loops") #pragma warning(disable:4996) using na...
ALGO
0.999991
4.358553
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2021-02-12T12:10: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": "6eb40e31bfb...
919301aa-68c4-434e-b56d-639ce5d7f08b
ishandutta2007/codeforces-t
thebes/normal/1307/D.cpp
#include <bits/stdc++.h> #define DEBUG 1 using namespace std; namespace output{ void __(short x){cout<<x;} void __(unsigned x){cout<<x;} void __(int x){cout<<x;} void __(long long x){cout<<x;} void __(unsigned long long x){cout<<x;} void __(double x){cout<<x;} void __(long double x){cout<<x...
ALGO
0.99991
3.341361
{ "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": "30534293ec09...
dc3262ad-59e7-4ab5-bda1-31962191761e
kuntalojha/C--
Question_13.cpp
// Created by <NAME> on 12/01/2020. // Write a C program to read temperature in centigrade and display a // suitable message according to temperature state. // Website Link : // https://www.w3resource.com/c-programming-exercises/conditional-statement/index.php /* Temp < 0 then Freezing weather Temp 0-10 then Very Cold...
TOOL
0.984641
3.872133
{ "github_metadata": { "branch": "master", "commit_count": 27, "repo_created_at": "2020-11-30T07:22: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": "b3df53fe1...
c22f1aae-06fa-4565-9bd4-96cdce46641b
lucat1/unibo_00819_progetto
src/engine/ui/text_box.cpp
/* University of bologna First cicle degree in Computer Science 00819 - Programmazione <NAME> #971133 03/15/2021 text_box.cpp: Implements the Engine::UI::TextBox class with the line-splitting algoritm to make a given strign fit inside a max_width large boh. Liens are cut, with trailing '-' added where...
TOOL
0.975976
5.629597
{ "github_metadata": { "branch": "develop", "commit_count": 901, "repo_created_at": "2020-11-16T18:07:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "250d22e...
5b4a4624-8766-4c7f-a1f0-219db26a9b51
Sumanth-NR/CompetitiveProgramming
Platforms/AtCoder/abc353/G_Merchant_Takahashi.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; template <typename T> class SegTree { int n; std::vector<T> s; public: static constexpr T ID = -1e18; static T f(T a, T b) { return std::max(a, b); } SegTree(unsigned _n): n(2*_n - 1), s(2*n, ID) {} template <typename U> ...
ALGO
0.999946
4.62635
{ "github_metadata": { "branch": "master", "commit_count": 104, "repo_created_at": "2022-04-18T13:29:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d6f12dcc...
9dd9f7a7-becb-4a17-97a7-6f0065968861
ishandutta2007/codeforces-m
mango_lassi/normal/1470/B.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; // Function for precalculating primes and prime divisors pair<vector<int>, vector<int>> sieve(int n) { vector<int> div_ind(n+1, -1), primes; for (int i = 2; i <= n; ++i) { if (div_ind[i] == -1) { div_ind[i] = primes.size(); primes.push_back(...
ALGO
0.999635
4.848499
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-06-06T01:03: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": "af737eda4076...
e3cebe79-f118-4157-8ec3-53a42ad76e57
g-gaston/rsatools
prime_math.cpp
#include "prime_math.h" #include <iostream> #include <sstream> bigint gcd(bigint a, bigint b) { return b == 0 ? a : gcd(b, (a % b)); } bigint phi(bigint n) { bigint coprimes = conv<bigint>(0); for (bigint i = conv<bigint>(0); i < n - 1; ++i) { if (NTL::GCD(n, i) == 1) { coprimes++; } } return coprimes; }...
ALGO
0.999285
4.665749
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2016-06-28T22:44: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": "3af1f4776d...
ce9c1866-f465-4b51-9ac6-55c2db2a0efc
morphorm22/analyze
src/hyperbolic/ElastomechanicsResidual_def.hpp
#pragma once #include "hyperbolic/ElastomechanicsResidual_decl.hpp" #include "ToMap.hpp" #include "PlatoTypes.hpp" #include "PlatoStaticsTypes.hpp" #include "GradientMatrix.hpp" #include "CellVolume.hpp" #include "SmallStrain.hpp" #include "LinearStress.hpp" #include "GeneralStressDivergence.hpp" #include "Project...
ALGO
0.983451
6.198951
{ "github_metadata": { "branch": "develop", "commit_count": 3768, "repo_created_at": "2022-03-31T22:48:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "655e84...
0c3b05c8-3234-4e4f-a94d-250890fd3530
HSA-Libraries/Bolt
include/bolt/btbb/detail/transform_reduce.inl
/*************************************************************************** * © 2012,2014 Advanced Micro Devices, Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the Licen...
ALGO
0.998284
6.564354
{ "github_metadata": { "branch": "master", "commit_count": 706, "repo_created_at": "2012-10-16T15:56:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 373, "forks": 64, "issues": 19, "pull_requests": 5 }, "file_meta": { "content_id": "c4b6...
a74b7b0b-7eec-4a73-9b1f-36a6c805d304
ep-trvno/hangman
main.cpp
#include <iostream> #include <string.h> using namespace std; //PENDING IMPLEMENTATION: to turn into lower case /* string toLowerCase(string str) { for(int i=0; i<str.length(); i++) if(str[i] >= 'A' && str[i] <= 'Z') str[i] = str[i] + 32; return str; } */ int ma...
TOOL
0.998184
3.26474
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2019-11-01T15:19:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f395edbffa...
9c3a955e-8005-4ace-b93d-b43ee2879292
Sahilsharma500/CPP
Dynamic Programming/Unbounded Knapsack Problems/coin-change.cpp
// Coin Change Problem (Memoization + Tabulation) // ---------------------------------------------- // Problem: Given an array of coin denominations and a target amount, // return the minimum number of coins needed to make the amount. // You can use a coin **unlimited times**. // // If it's not possible to form the amo...
ALGO
0.999991
6.747714
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2024-10-11T11:54: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": "baeffab1b44...
b9517217-7bf4-4d33-ab1e-cfd04126ef29
Priyanshu-Ganatra/Leetcode-Codestudio-And-DSA-problems
CS_41_PrintLeftViewOfBT.cpp
#include <bits/stdc++.h> using namespace std; // BinaryTreeNode with template argument template <typename T> class BinaryTreeNode { public: T data; BinaryTreeNode<T> *left; BinaryTreeNode<T> *right; // constructor BinaryTreeNode(T data) { this->data = data; left = NULL; ...
ALGO
0.99999
5.29789
{ "github_metadata": { "branch": "main", "commit_count": 293, "repo_created_at": "2023-08-08T09:24:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 26, "forks": 15, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4454b0b3...
90efa649-b259-4f9e-ac96-a28b258db0a1
SHASHANKRAJ21/Linked-List
insertion.cpp
#include <iostream> using namespace std; class node { public: int data; node *next; node() { this->next = NULL; } node(int data) { this->data = data; this->next = NULL; } }; int getlength(node *head) { node *temp = head; int count = 0; while (temp != N...
ALGO
0.99993
4.610882
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-08-09T20:17: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": "4816490cc926...
7b012b21-baea-4dec-bbb5-a9b8a468fdd7
CephasSvosve/C-Multi_Asset_Artificial_Stock_Market
Params.h
// // Created by <NAME> on 6/8/2021. // #ifndef UNTITLED21_PARAMS_H #define UNTITLED21_PARAMS_H #include "StochasticMath.h" #include <iostream> #include <Eigen/Dense> using namespace Eigen; using namespace std; //////////////////////////////////////////////////////////////////////////////////////////////////////////...
ALGO
0.97476
4.258327
{ "github_metadata": { "branch": "main", "commit_count": 91, "repo_created_at": "2021-06-21T21:57:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "fffb7bbc2d6...
46fc214d-1ff8-4560-8fdd-4f47d40416db
nvtaveras/Codeforces-Solutions
Codeforces Round #226 (Div. 2)/A.cpp
#include <iostream> #include <string> #include <vector> #include <cstdlib> #include <map> #include <set> #include <algorithm> #include <cstring> #include <queue> #include <stack> #include <sstream> #include <cstdio> #include <ctime> #include <cctype> using namespace std; #define mp make_pair typedef long long llong; t...
ALGO
0.999927
3.065494
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2015-06-08T01:18: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": "b4f7f841e9...
6b95c102-92f1-4b5f-a900-e0f7e618fb2f
adiletabs/Algos
DataStructures/Advanced/BST.cpp
#include <bits/stdc++.h> using namespace std; template<typename T> class Node { public: Node* left; Node* right; T value; int level; int height; int cnt; int subtree_size; Node (T x = 0, int _level = 0) { value = x; level = _level; height = 1; cnt = 0; subtree_size = 1; left = nullptr; right = n...
ALGO
0.999923
4.621794
{ "github_metadata": { "branch": "master", "commit_count": 99, "repo_created_at": "2019-01-25T15:19: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": "be7f87e04...
e5ccac7c-494f-4953-ba86-aac67b9f723f
nhjbest22/BOJ
code/7562.cpp
#include <bits/stdc++.h> using namespace std; #define visit VISIT #define FOR(n) for(int i = 0; i < n; i++) int visit[302][302]; int dx[8] = {1,2,2,1,-1,-2,-2,-1}; int dy[8] = {2,1,-1,-2,-2,-1,1,2}; int main (){ ios::sync_with_stdio(0); cin.tie(0); queue <pair<int,int>>Q; int TN; cin>>TN; in...
ALGO
0.999941
4.702125
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2021-02-15T23:06: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": "7fe9f0f55...
658cb07a-c336-4732-a006-9f81e00951c6
navkagleb/knu-labs
term4/Algorithms/Lab05/src/PersistentTree.inl
#include <iostream> namespace Ng { template <typename Key, typename Value> PersistentTree<Key, Value>::IIterator::IIterator(NodePtr node, std::stack<NodePtr>&& stack) : m_Node(node) , m_Stack(std::move(stack)) {} template <typename Key, typename Value> typename PersistentTree<Key, Val...
TOOL
0.974151
6.433029
{ "github_metadata": { "branch": "master", "commit_count": 402, "repo_created_at": "2020-08-07T14:25: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": "d6280983...
2b98e058-d5f5-4850-a935-9c5c96560be3
NathanNatNat/Beginning-CPP-Programming-From-Beginner-to-Beyond
Section12_K_Debugger/main.cpp
// This is a personal academic project. Dear PVS-Studio, please check it. // PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com // Debugger // Watch the video which goes over how to use the debugger! #include <iostream> void swap(int* A, int* B) { int Temp = *A; *A = *B; *B =...
TOOL
0.972132
4.991078
{ "github_metadata": { "branch": "main", "commit_count": 90, "repo_created_at": "2021-11-19T02:53: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": "93c872a2251...
229b4f12-87b6-44ad-b9ee-1d2268dfdef4
shafinkun/Codeforces
445B.cpp
/*___________________In the name of Allah________________*/ /*____________________Solved By shafinkun________________*/ // Problem link : https://codeforces.com/problemset/problem/445/B // Inquilab Zindabad!!! #include <bits/stdc++.h> using namespace std; #define optimize() \ ios_base::sync_with_stdi...
ALGO
0.999888
4.104995
{ "github_metadata": { "branch": "main", "commit_count": 573, "repo_created_at": "2023-02-25T07:08: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": "57af965b0b...
5054ad33-32c2-4013-981e-80255b5b9cd1
nickcharron/vicon_calibration
src/lib/libcbdetect/weight_mask.cc
/** * Copyright 2018, ftdlyc <<EMAIL>> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This library is dist...
TOOL
0.906013
6.146889
{ "github_metadata": { "branch": "master", "commit_count": 296, "repo_created_at": "2019-05-01T19:59:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9fe3a8e5...
4192c6eb-6bbe-4f93-a70d-1c12ad3fac5c
cdh981009/Algorithm
codeforces/812/D.cpp
#include <bits/stdc++.h> using namespace std; #define INF (1e9 + 7) #define fi first #define se second #define rep(i, a, b) for (int i = (a); i < (b); ++i) #define rep_(i, a, b) for (int i = (a); i <= (b); ++i) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FOR_(i, a, b) for (int i = (a); i <= (b); ++i)...
ALGO
0.999954
3.749259
{ "github_metadata": { "branch": "master", "commit_count": 850, "repo_created_at": "2020-02-16T08:17: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": "082f93c6...
ab0b735e-29b1-4a0b-96d4-6b30525be2f8
AndersonKao/CP_Problems
CSES/Introductory_Problems/Digit_Queries.cpp
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for(int i = 0; i < (int)n; i++) #define REP1(i, n) for(int i = 1; i <= (int)n; i++) #define debug(x) cout << #x << ": " << x << endl; #define depii(x) cout << "(" << x.first << ", " << x.second << ")"; #define devec(x) for(auto v: x) cout << v << endl; #de...
ALGO
0.999473
3.599885
{ "github_metadata": { "branch": "master", "commit_count": 244, "repo_created_at": "2022-01-23T04:16:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "be7c0c83...
16ce1218-666f-4d5f-9c32-ad2c023b0eff
doghoney/temp-storage-sangjoondocker
ps/9240.cpp
#include<iostream> #include<algorithm> #include<cmath> #define C 100005 using namespace std; struct coordinate{ int x; int y; }; coordinate arrow[C]; bool compare(const coordinate &a, const coordinate &b){ if(a.y-arrow[0].y==0 && b.y-arrow[0].y==0){ if(a.x-arrow[0].x<b.x-arrow[0].x) ...
ALGO
0.999978
3.617199
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2022-09-04T07:16: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": "47e7e34fa5...
16bb20e8-2e77-45e2-91a2-81a8a0ddb0bc
IamLucif3r/Data-Structure-Algorithm
FacePrep/Codes/collatz-problem.cpp
/*Collatz problem <NAME> started working for <NAME> and he wanted her to write a C++ program to generate Collatz Sequence.The rules for generating Collatz sequence are: If n is even: n = n / 2 If n is odd: n = 3n + 1 For example, if the starting number is 5 the sequence is: 5 -> 16 -> 8 -> 4 -> 2 -> 1 It h...
ALGO
0.999954
4.35762
{ "github_metadata": { "branch": "main", "commit_count": 399, "repo_created_at": "2021-06-07T09:27:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 9, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5372a80f0d...
70f422c0-a6a2-4cb0-8eec-f5a6a499d45e
iamitshaw/codechef-practice-problem
beginner/CHEFSQ/main.cpp
#include <bits/stdc++.h> int32_t main(int32_t argc, char* argv[]) { /* fast input-output */ std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr); /* get test_case */ int32_t test_case; std::cin >> test_case; while (test_case--) { /* get length_o...
ALGO
0.999977
5.194403
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2021-07-05T17:25:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2d18e0b794...
d1102d49-6d00-4849-bdda-51468def514a
martishin/algorithms
bst.cpp
#include <iostream> #include <vector> using namespace std; template <typename T> class BST { private: struct Node { T data; Node *left; Node *right; Node() { left = nullptr; right = nullptr; } Node (T data, Node *left = nullptr, Node *righ...
ALGO
0.999821
5.784164
{ "github_metadata": { "branch": "master", "commit_count": 30, "repo_created_at": "2018-06-17T15:29:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "604d8d9cf...
e1d70cdb-055d-4c1f-9752-fb8d5e1ff906
RayTracing/TheRestOfYourLife
src/sphereimp.cc
//================================================================================================== // Written in 2016 by <NAME> <<EMAIL>> // // To the extent possible under law, the author(s) have dedicated all copyright and related and // neighboring rights to this software to the public domain worldwide. This softw...
ALGO
0.99479
4.565642
{ "github_metadata": { "branch": "master", "commit_count": 89, "repo_created_at": "2016-05-06T13:16:09.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 260, "forks": 42, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "9f9f79e...
1cb7e690-73b4-4c37-825d-9a4ffe3981b8
vaibhavsiingh/CSES-problem-set
02-Sorting-and-Searching/08-Maximum-Subarray-Sum.cpp
#include <bits/stdc++.h> using namespace std; typedef int64_t ll; typedef vector<ll> vll; typedef pair<ll, ll> pll; typedef complex<ll> P; #define X real() #define Y imag() #define pb push_back #define pob pop_back #define ff first #define ss second #define sz size #define reach cout << "Reached" << endl; #define o1(...
ALGO
0.999951
4.043423
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2024-06-25T07:45: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": "684c937bfb7...
7919824a-93d5-41ff-8431-690b3b67d7e0
ou-real/finch
src/maze_run/main.cpp
#include <finch/evaluator.hpp> #include <finch/maze_algorithms.hpp> #include <finch/objective_fitness_mapper.hpp> #include <finch/program_node_types.hpp> #include <finch/ui/ui_tools.hpp> #include <finch/cpu/cpu_stepper.hpp> #include <finch/maze_run/agent_stepper.hpp> #include <iostream> #include <ctime> #include <fstr...
ALGO
0.919135
5.950532
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2014-08-27T07:27:30.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2ead3701c1...
54478703-0c20-41c6-be6b-fc875dd84927
Tushar2009/DSA
Striver Dsa sheet solve/Day17/12_maximum_width_of_Binary_tree.cpp
#include <bits/stdc++.h> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode() : val(0), left(nullptr), right(nullptr) {} TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(...
ALGO
0.999689
4.387478
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2023-12-29T08:16: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": "b4a2e1a9b6...
d029453a-bfc8-41b8-ae19-d40952f8944d
ishandutta2007/codeforces-p
physics0523/normal/1462/E2.cpp
#include<bits/stdc++.h> #define mod 1000000007 using namespace std; long long power(long long a,long long b){ long long x=1,y=a; while(b>0){ if(b&1ll){ x=(x*y)%mod; } y=(y*y)%mod; b>>=1; } return x%mod; } long long modular_inverse(long long n){ return power(n,mod-2); } long long fact...
ALGO
0.999878
4.15958
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:49:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "565a848f007d...
8f2ffcb4-7ef3-4e11-b4f6-13595703554f
afb2001/mpc
src/controller.h
#ifndef SRC_CONTROLLER_H #define SRC_CONTROLLER_H #include "control_receiver.h" #include "path_planner_common/State.h" #include "VehicleState.h" #include "CurrentEstimator.h" #include <mutex> #include <future> #include <random> #include <path_planner_common/DubinsPlan.h> /** * Class which runs model predictive contr...
ALGO
0.926668
6.61523
{ "github_metadata": { "branch": "master", "commit_count": 96, "repo_created_at": "2019-05-13T23:54:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 10, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "67eb77a4...
69730664-bf2c-499c-81ac-caa01cf5ec9b
ShougataDas/Codeforces-Contest
891 Div 3/B.cpp
#include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> #define ll long long #define fastread() (ios_base::sync_with_stdio(0),cin.tie(0)); using namespace __gnu_pbds; using namespace std; template <typename T> using pbds = tree<T, null_type, less<T>, rb_tree_tag, tree_order...
ALGO
0.999941
4.804475
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2024-06-23T14:23:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9405f8c661cc...
c3358f2a-e638-445f-b1bc-9218b8cf5216
knightzf/review
leetcode/findMinimumInRotatedSortedArray/main.cpp
#include <vector> #include <iostream> #include <algorithm> #include <set> #include <sstream> #include <cmath> #include <queue> #include <map> #include <string> #include <cstdlib> #include <cctype> #include <stdexcept> #include <climits> #include <utility> #include <bitset> #include <stack> #include <unordered_map> #inc...
ALGO
0.999956
4.949615
{ "github_metadata": { "branch": "master", "commit_count": 846, "repo_created_at": "2013-05-15T02:50: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": "28857e60...
92dd959f-7b76-448a-94cd-c96c72027d4f
faatehsultan/MiniProjects
cpp/Schedular_simulator/MLFQ.h
#ifndef MLFQ_H #define MLFQ_H #include <Windows.h> #include<iomanip> #include "Queues.h" #include "RoundRobin.h" #include "SRTF.h" class MLFQueue : public Queue { //Three Queues to manage the processes RoundRobin queue0; RoundRobin queue1; SRTF queue2; int displayChart(Queue& Q, int start, int end, int t) { ...
ALGO
0.993487
3.539138
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2019-11-17T06:54:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 3, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "02f621826...
cbf322c3-18a5-48bc-93fa-c76e7ba4a6a8
Tiger1994/LeetCode
Q42.cpp
#include<vector> #include<algorithm> #include<stack> using namespace std; class Solution { public: int trap_1(vector<int>& height) { int result = 0; for (int i = 0; i < height.size(); i++){ int leftMax = *max_element(height.begin(), height.begin()+i+1); int rightMax = *max_element(height.begin() + i, height...
ALGO
0.999982
6.301898
{ "github_metadata": { "branch": "master", "commit_count": 201, "repo_created_at": "2018-06-04T15:32:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "484b3c1b...
3387b94f-4bc6-4bb9-97b5-f2de4cfcdd61
jianlany/semicrystalline_publication_repo
src/compute.cpp
#include "compute.h" #include "end_bridge.h" #include "md_system.h" #include "string_tools.h" #include "input_file.h" #include <algorithm> #include "table.h" const double avogadros_number = 6.0221413e23; const double pi = acos(-1.0); Compute::Compute(const Geometry &g, MDSystem &s, const InputFile &opt) : _geometr...
ALGO
0.998237
4.236958
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2024-09-16T00:15: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": "12558b0768...
04214fe4-44c8-41c1-86bf-e603635ac0e7
loioladev/competitive-programming
Algorithms/Shortest paths/dijkstra.cpp
#include "../definitions.h" int main(void){ int n = 5; vi distance (n); // The graph is stored as a adjacent vector // with a pair (b, w) that indicates when there // is an edge from node a to node b with weight w. vector<vector<pii>> adj (n, vector<pii> ()); // Priority queue for the node...
ALGO
0.99995
3.985811
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2022-12-05T15:09: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": "46b37fce7b2...
8d5625d0-06f8-42cc-b0ed-45f516b4efd9
okraus42/AdventofCode
C++/2024/12/solver.cpp
#include <iostream> #include <fstream> #include <string> #include <cctype> #include <set> #include <vector> #include <sstream> #define MAP 50 #define FILE "input.txt" int get_area(std::vector<std::string> &lines, int y, int x, char c) { // std::cout << "Ay " << y << " x " << x << std::endl; int area; if (y < 0 || ...
ALGO
0.996162
4.40334
{ "github_metadata": { "branch": "main", "commit_count": 137, "repo_created_at": "2023-12-12T18:48: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": "2807fbe13f...
c6521002-3714-4aa7-ae50-56975a43163c
nikhil-sharma07/Data-Structures-And-Algorithms
Dynamic Programming/MCM.cpp
#include <bits/stdc++.h> using namespace std; //TIME COMPLEXITY - O(N^3) //SPACE COMPLEXITY - O(N^2) int dp[1001][1001]; int func(int a[], int s, int e) { if (s >= e) { return 0; } if (dp[s][e] != -1) { return dp[s][e]; } int res = INT_MAX; for (int k = s; k < e; k++) ...
ALGO
0.999783
4.384695
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2021-08-02T09:17:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0255a67cf84...
8c48e337-1414-4cfb-af25-576cc1b99cc0
rbalsJ/algo
hw03/fish.cpp
#include <iostream> #include <algorithm> using namespace std; int input[10001] = { 0 }; int temp[10001] = { 0 }; int k = 0; void flip(int array[], int start, int end) { reverse(array + start, array + end + 1); for (int i = start; i <= end; i++) array[i] = -(array[i]); } void countFlip() { int start = 0; int en...
ALGO
0.999937
3.657473
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-03-26T08:11: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": "e1683b2d6120...
a33d67d3-c91a-4b6f-a2f5-4a7505a6dbcb
llvm-mirror/llvm
lib/CodeGen/MachinePipeliner.cpp
//===- MachinePipeliner.cpp - Machine Software Pipeliner Pass -------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
TOOL
0.98615
4.214916
{ "github_metadata": { "branch": "master", "commit_count": 186941, "repo_created_at": "2012-01-27T23:49:56.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4612, "forks": 2086, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "...
5194485f-11f6-47db-a055-d09ff2cd193e
go-row/myCppLab
Atcoder/abc81_c.cpp
//gauravsinghh #include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define ll long long int #define ld long double #define db double #define pii pair<int,int> #define pll pair<long long,long long> #define sii set<int> #de...
ALGO
0.999996
3.991946
{ "github_metadata": { "branch": "master", "commit_count": 130, "repo_created_at": "2019-08-01T07:20:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "308260db...
c1347797-ee56-4f1c-9b8f-0fdf0fad0f43
klb3713/aoapc-book
TrainingGuide/bookcodes/ch2/la3485.cpp
// LA3485 Bridge // <NAME> #include<cstdio> #include<cmath> // sqrt(a^2+x^2)的原函数 double F(double a, double x) { double a2 = a*a, x2 = x*x; return (x*sqrt(a2+x2)+a2*log(fabs(x+sqrt(a2+x2))))/2; } // 宽度为w,高度为h的抛物线长度,也就是前文中的p(w,h) double parabola_arc_length(double w, double h) { double a = 4.0*h/(w*w); double b ...
ALGO
0.999678
3.384063
{ "github_metadata": { "branch": "master", "commit_count": 198, "repo_created_at": "2013-09-22T01:26:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 181, "forks": 56, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "3a359...
b73e58a2-40af-47de-9b24-cd2665b28891
baqiyansheng/Ccode
Nqueens.cpp
#include <iostream> #include <cstdlib> #include <ctime> #include <vector> #include <stdio.h> #include <cstring> using namespace std; const double C1 = 0.53; const double C2 = 10000; FILE *fp = fopen("answer.txt", "w"); vector<int> queen; //记录第i行皇后所在的列 void initQueen(int N, vector<int> &queen) // ...
ALGO
0.99993
3.748724
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2022-09-23T02:08: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": "9824f2e8dcd4...
d4415644-6c45-4340-a100-39008d3bb30a
namvnngu/dev-learning
general/hello-algo/codes-en/cpp/chapter_greedy/coin_change_greedy.cpp
/** * File: coin_change_greedy.cpp * Created Time: 2023-07-20 * Author: krahets (<EMAIL>) */ #include "../utils/common.hpp" /* Coin change: Greedy */ int coinChangeGreedy(vector<int> &coins, int amt) { // Assume coins list is ordered int i = coins.size() - 1; int count = 0; // Loop for greedy sele...
ALGO
0.999834
5.877217
{ "github_metadata": { "branch": "main", "commit_count": 29, "repo_created_at": "2024-03-25T23:27: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": "79b29f7cc18...
4964cd3c-9166-4e54-8728-471fe34afb4f
QuantumBird/ACM_Team
gjz/DataStruct/I.cpp
#include <iostream> #include <algorithm> using namespace std; const int maxn = 2e5 + 5; int s[maxn], mx[maxn << 2]; void pushup(int rt) { mx[rt] = max(mx[rt*2], mx[rt*2 + 1]); } void build(int l, int r, int rt) { if(l == r) { mx[rt] = s[l]; return ; } int mid = (l + r) / 2; build(l...
ALGO
0.999866
3.834918
{ "github_metadata": { "branch": "master", "commit_count": 148, "repo_created_at": "2019-08-04T09:36:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "55cfde5c...
3c3b5a28-819e-4000-8e76-d1de5b98c3e8
RachnaShriwas/Algorithm-Programs
Arrays/kthLargest.cpp
//algo to find kth smallest element in an array //same as finding element with a given rank //running time = O(n) //Randomized Algorithm /****Also known as RANDOMISED QUICKSELECT****/ #include<iostream> #include<cstdlib> #include<climits> using namespace std; void swap(int *a, int *b) { int temp = *a; *a = *b; *b ...
ALGO
0.999995
5.277533
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2017-10-11T17:05: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": "2ad2949c8...
cd5385f5-e6ae-4095-bfb0-4fc65996b37d
andremralves/competitiveProgramming
codeforces/round916/f.cpp
/** * author: mralves * created: 19-12-2023 11:35:20 **/ #include <bits/stdc++.h> #define pb(x) push_back(x) #define all(x) x.begin(),x.end() using namespace std; using ll = int64_t; using pii = pair<int, int>; ll ceil(ll a, ll b) {return a % b == 0 ? a / b : a / b + 1;} vector<pii> dir4 = {{1, 0}, {...
ALGO
0.999915
5.071942
{ "github_metadata": { "branch": "master", "commit_count": 147, "repo_created_at": "2022-09-16T06:11: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": "02ec95f5...
4c6b895c-10d3-4e00-ad78-b5a82333e045
Vulpolox/CS303Assignment3
ExpressionObject.h
//<NAME> || CompSci303 || Assignment #3 #ifndef EXPRESSION_OBJECT_H #define EXPRESSION_OBJECT_H #include <string> #include <iostream> #include <stack> #include <cctype> #include <vector> #include <sstream> #include <cstdlib> class ExpressionObject { private: std::string validOperators = "+-/*%"; //list of...
ALGO
0.946243
6.076329
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-11-09T10:22:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7acc2f97b8f5...
e7d94aad-41e4-46a2-83b8-1eeec1a7e501
Rajadarsh55/Java-Practice-codes
pepq.cpp
#include <iostream> #include <string> #include <algorithm> using namespace std; int solution(int N, int K) { string str = to_string(N); int n = str.length(); for (int i = 0; i < n && K > 0; i++) { int max_digit = str[i]; int max_index = i; // find the maximum digit among the rema...
ALGO
0.999973
5.373248
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-04-28T17:48: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": "c56358a707e9...
7ddfb2d7-9a3b-4879-8eab-8da8c0c1be7d
tskopen/C-Course
Floor.cpp/main.cpp
/* * Program to figure out how many boxes of flooring materials are needed. * * Name: <NAME> * Date: January 26, 2025 */ #include <iostream> using namespace std; const double BOX_COST = 21.95; const int BOX_FOOTAGE = 40; /* * main - Figure out how many boxes of flooring materials are needed. Balances not ...
ALGO
0.9938
4.68936
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2025-01-19T20:05: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": "f4d8934b533d...
091fd165-bbc0-468d-ab01-eec01947257f
r4ghuveer/DSA-programs
Anagram_leetcode.cpp
#include <bits/stdc++.h> // this code doesn't work for s and p that is given below and similar examples using namespace std; int main(){ string s="cbaebabacd"; string p="abc"; // int n=1; // vector<int> ans; // unordered_map<char,int> umap; // // unordered_map<char,int>:: iterator itr; // fo...
ALGO
0.999834
4.636554
{ "github_metadata": { "branch": "main", "commit_count": 307, "repo_created_at": "2022-12-14T22:24: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": "4b0f0f4d49...
4571b033-c61c-422d-ab32-2bd011292115
tangjz/acm-icpc
leetcode/1-1000/30-substring-with-concatenation-of-all-words.cpp
class Solution { public: vector<int> findSubstring(string s, vector<string>& words) { int n = s.size(), m = words[0].size(), q = words.size(); if(m * q > n) return {}; vector<int> idx(n); unordered_map<string, int> Hash; for(auto &it: words) Hash.inser...
ALGO
0.999895
5.887097
{ "github_metadata": { "branch": "master", "commit_count": 293, "repo_created_at": "2013-10-06T18:57:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 45, "forks": 13, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "202a7d...
d863f26c-9193-4a5d-bf32-f9f1a10d32df
RodRomDa/SomeStuff
Code/Source Files/QuadraticHashTable.cpp
#include "QuadraticHashTable.h" using std::string; QuadraticHashTable::QuadraticHashTable(size_t size) { while (size >>= 1) { size_log++; } table_size <<= size_log; table = new Data[table_size]; } QuadraticHashTable::~QuadraticHashTable() { delete[] table; } uint16_t QuadraticHashTable::hash_int(uint16_t x) {...
ALGO
0.985434
4.856595
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2020-03-22T09:57: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": "eee065be2...
003c369f-4dbf-4e44-b44e-7c167fd6e87d
yuliangguo/MSEL_contour_extraction_cxx
MSEL_src/MSEL_core/dbdet_third_order_color_edge_detector_process.cxx
// This is brcv/seg/dbdet/pro/dbdet_third_order_color_edge_detector_process.cxx //: // \file #include "dbdet_third_order_color_edge_detector_process.h" #include "vidpro1_image_storage.h" #include "vidpro1_vsol2D_storage.h" #include "vidpro1_vsol2D_storage_sptr.h" #include "dbdet_edgemap_storage.h" #include "dbdet_e...
ALGO
0.973787
6.672552
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2017-05-31T06:03:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0d0fe23974...
6988ecce-90f6-44bf-ae9d-9d7813e63c0e
benwu25/LeetCode
221-maximal-square.cpp
#include <vector> using namespace std; class Solution { public: int maximalSquare(vector<vector<char>>& matrix) { int max = 0; int best[matrix.size()][matrix[0].size()]; for (int j = 0; j < matrix[0].size(); ++j) { if (matrix[0][j] == '1') best[0][j] = max = 1; ...
ALGO
0.999938
5.993318
{ "github_metadata": { "branch": "master", "commit_count": 95, "repo_created_at": "2025-06-14T04:16: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": "14ea12299...
af13c0c4-c29a-4124-92d9-13d808468ba1
htsaustin/financial_enginering_2023
code/binomial/Example6/src/Options02.cpp
#include <iostream> #include <cmath> #include "Options02.h" #include "BinModel01.h" using namespace std; //Passing in pointers here. //Assign the value to the pointer location //ptrN is the pointer, and *ptrN is the value contained int getInputData(int* ptrN, double* ptrK) { cout << "Enter steps to expiry, N: "; ...
ALGO
0.999848
5.627211
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2023-05-01T09:57: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": "587843f0e58...
c0a50809-e941-4d5c-b359-2d22577fb036
kimminhyeongkong/Forouzan_CPP_Essential
Chapter10/Practice/05.cpp
// 두 문자열 입력받은 후 공통으로 있는 문자들 리턴 #include <iostream> #include <string> using namespace std; void RemoveOverlappedChar(string&); void CheckOverlappedChar(string&, string&, string&); int main() { string str1, str2, overlappedStr; cout << "첫 번째 문자열을 입력: "; getline(cin, str1); cout << "두 번째 문자열을 입력: "; getline...
ALGO
0.999476
5.311281
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2022-06-15T18:05: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": "5b69f97c4...
90ab49ea-ae56-4b88-a829-7ae2c96afa16
rondelfino/aoc
2024/day2.cpp
#include <cmath> #include <fstream> #include <iostream> #include <sstream> #include <string> #include <vector> bool is_safe_report(const std::vector<int> &report) { if (report.size() < 2) return true; int difference = report[1] - report[0]; bool increasing = difference > 0; bool safe = std::ab...
ALGO
0.998721
4.411498
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2024-12-02T04:30: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": "93018f114...
34314ef9-a9da-47b6-b276-68a050426d1d
bodasadallah/problem-solving
codeforces/ Ant colony/main.cpp
#include <iostream> #include "bits/stdc++.h" using namespace std; const int N = 1e5 + 5; int t, n; int seg[4 * N], power[N]; map<int, vector<int>> mp; void build(int p, int l, int r) { if (l == r) { seg[p] = power[l]; return; } build(2 * p, l, (l + r) / 2); build(2 * p + 1, (l + r) ...
ALGO
0.999973
5.0522
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2022-06-27T16:43:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c55332c7fba...
24017526-3497-4278-b05c-07e97ad13d65
xw6666/algorithm
icpc预选/E.cpp
#include <bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<int, int> PII; #define x first #define y second void solve() { int n, k; cin >> n >> k; LL ans = 0; if(k % 2) { ans += k; if((n - 1) % 2) { ans += (n - 1) / 2 * 3 + ((n - 1) / 2 + 1) * 2; } else { ans += (n - 1) /...
ALGO
0.999905
3.352406
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-07-03T15:48: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": "0fc7fc8b743c...
dc7786b5-afeb-4d40-b864-e6aa4d24ba78
j2noo/SJCE_Algorithm_Study
jHyuk/Legacy/week1/단지번호붙이기.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int nApart = 0; int nHouse[625] = { 0 }; int n, map[25][25]; void DFS(int i, int j) { nHouse[nApart]++; map[i][j] = nApart + 1; //단지번호 + 1로 숫자 변경 if (map[i + 1][j] == 1 && i < n - 1) { //아래에 아직 탐색하지 않은 집이 있다면 탐색 DFS(i + 1, j); }...
ALGO
0.999984
3.78631
{ "github_metadata": { "branch": "main", "commit_count": 603, "repo_created_at": "2023-11-27T06:13:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 6, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "1faea7723a...
9060c22b-9bda-46cd-b656-5fa601b0c9e1
devkaran7/Competitive-Programming
NUMBER_THEORY/eulerTotientFunction.cpp
//factorization method (time complexity -> O(sqrt(N))) ll phi(ll n){ ll answer = n; for(ll i = 2; i * i <= n; i++){ if(n % i == 0){ while(n % i == 0){ n = n / i; } answer = answer - answer/i; } } if(n > 1){ answer = answer - ans...
ALGO
0.99995
4.680217
{ "github_metadata": { "branch": "main", "commit_count": 72, "repo_created_at": "2021-08-31T10:11:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "70307710d42...