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
ea0518f3-7329-4f97-9971-9211f83c92b8
hgoose/leetcode
dailies/maxsumofapairwithequalsumofdig/main.cc
#include <iostream> #include <vector> #include <string> #include <queue> #include <unordered_map> using std::cout; using std::string; using std::vector; using std::unordered_map; using std::endl; using std::priority_queue; typedef long long dword; typedef unordered_map<int, priority_queue<int, vector<int>>> umap; clas...
ALGO
0.99996
4.701774
{ "github_metadata": { "branch": "master", "commit_count": 68, "repo_created_at": "2025-01-24T15:55:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a5dbc7fb2...
c0acfc60-3491-43a4-a8f2-031d8f416902
deserted335/baekjoon_record
BruteForcing/18312.cpp
#include <iostream> #include <string> using namespace std; int IntContainsK(int tar, int K){ int tens = tar / 10, zeros = tar % 10; return (tens == K) || (zeros == K); } int isContained(int time, int K){ // return 1 if time(sec) : HHMMSS has K / 0 otherwise int H, M, S; S = time % 60; M = (time / 60) % 60...
ALGO
0.996878
4.117121
{ "github_metadata": { "branch": "main", "commit_count": 56, "repo_created_at": "2023-06-27T02:02: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": "c2cbf844cba...
34ae9343-044b-4757-afaf-adc6ece9b7e5
LucaDiba/timetabling-problem-solver
multistart/GA/Chromosome.cpp
#include <algorithm> #include <iterator> #include <vector> #include "Chromosome.h" #include "../../data-structures/Solution.h" #include "../../data-structures/Problem.h" #include "../../data-structures/rand.h" float mutRate = 0.8; Chromosome::Chromosome(Problem* problem, bool improved_solution) { mutationRate = ...
ALGO
0.999982
4.638492
{ "github_metadata": { "branch": "master", "commit_count": 99, "repo_created_at": "2020-01-14T13:29:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "f16c02e50...
f8991be1-41ce-4bed-8d1d-1f0c715532ab
neetish-borkar/HPC
llBubblesort.cpp
#include <iostream> #include <cstdlib> #include <omp.h> #include <time.h> using namespace std; class sort{ public: int *array; int size; int *array2; void accept(int); void display(); void display2(); void bubb_sort_ll(); void bubble_sort(); void check(); }; void sort::accept(int...
ALGO
0.999476
4.129745
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2020-01-27T20:20:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2b9fcb9e5b...
27d17cca-8403-4be7-a0b6-8b51b9f49a43
Shauryacious/competative-programming
CF-Learning/Graph/08-DSU/04-problems/01-Number-of-Operations-to-Make-Network-Connected/code.cpp
// Author : <NAME> // Linkedin: https://www.linkedin.com/in/shauryacious/ // Codeforces: https://codeforces.com/profile/Shauryacious // Love you mumma <3 #include<iostream> #include<algorithm> #include<vector> #include<set> #include<map> #include<cmath> #include<queue> #include<stack> #include<bitset> #include<unorder...
ALGO
0.99971
5.317971
{ "github_metadata": { "branch": "main", "commit_count": 112, "repo_created_at": "2024-07-18T09:08:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f498c2bc3d...
04245ddb-8b5e-4bee-9215-b4d7cf125dca
aryans1319/LeetCode
1383-maximum-performance-of-a-team/1383-maximum-performance-of-a-team.cpp
class Solution { public: int maxPerformance(int n, vector<int>& speed, vector<int>& efficiency, int k) { priority_queue<int, vector<int>, greater<int>> heap; vector<vector<int>> worker; vector<int> tmp(2,0); for (int i = 0; i < n; i++) { tmp[0] = speed[i]; tmp...
ALGO
0.999928
5.502405
{ "github_metadata": { "branch": "main", "commit_count": 2613, "repo_created_at": "2021-08-18T09:54:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 8, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c22a536c0...
4bb6339a-5f29-4d9a-9909-0f6e0c7aac14
Italianorafa/FEUP
EDA/vectors/ex01/vector.cpp
#include <iostream> #include <vector> #include<algorithm> using namespace std; /** * Imprime os elementos do vetor; * Imprime o tamanho do vetor. */ int imprime_vetor(vector<int> vec){ cout<<"Elementos do vetor: {"; for(int i=0; i<(int)vec.size();i++){ cout<<vec[i]<<" "; } cout<<"}"<<en...
ALGO
0.999444
4.906346
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2025-02-13T15:38: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": "64aacfccc...
76772b79-1fe0-4a54-92da-d570966f52e8
CSLiuPeng/GPU4LdbcGraph
include/CPUPR.hpp
#pragma once #include <graph_structure/graph_structure.hpp> #include <vector> #include <iostream> #include <mutex> #include <omp.h> /* to run this file,you need add below code to Cmakelists: set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp") you must not use clock() fun in...
ALGO
0.999494
4.169397
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-07-08T11:45: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": "861c988d6121...
3950de9e-d3ea-4b35-a6cf-4d863f8fab6d
kds285/CGIGo
CGI/WeichiMiniSearch.cpp
#include "WeichiMiniSearch.h" // 1 liberty WeichiBlockSearchResult WeichiMiniSearch::canEscape1Lib( uint blockPos, int deep, int& nodes ) { const WeichiBlock* block = m_board.getGrid(blockPos).getBlock(); Color turnColor = block->getColor(); assertToFile( block->getLiberty()==1, const_cast<WeichiBoard*>(&m_board) )...
ALGO
0.999039
5.332191
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2021-12-19T07:24: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": "5baebb75b3...
b42be782-e227-43ce-b668-a87acbee714c
akashwar/Eye-NAB
StartingEffortAndReferenceCode/colordetect.cpp
/*ALL the necessary header files*/ #include"math.h" #include"conio.h" #include"cv.h" #include"highgui.h" #include"stdio.h" void captureOriginal(IplImage* []); int main() { int i,j,k; int height,width,step,channels; int stepr, channelsr; int temp=0; uchar *data,*datar; i=j=k=0; IplImage *OriginalFrame[50]; captureOri...
TOOL
0.9767
3.754605
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2016-04-10T08:27:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4a4a48e8d1...
5b6bbad5-90b7-4fc1-ad55-ed1cc11c7c6a
VPG1/oaip_labs_sem1
Lab2/Task12/Task12.cpp
#include <iostream> #include <cmath> using namespace std; int main() { //ввод данных double x1, y1, x2, y2, r, R; cout << "Enter x1, y1 and r: "; cin >> x1 >> y1 >> r; cout << "Enter x2, y2 and R: "; cin >> x2 >> y2 >> R; //проверка положение М1 относительно М2 и вывод if (R - r > sqrt(pow(x2-x1, 2) + pow(y2 ...
ALGO
0.999548
4.431067
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2021-11-30T19:43: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": "d234aa6266...
b1621069-1184-485f-9504-dc91e149f16c
creep06/competitive-programming
ARC/034/B.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(ll (i)=0;(i)<(ll)(n);(i)++) #define rept(i,n) for(ll (i)=0;(i)<=(ll)(n);(i)++) #define reps(i,s,n) for(ll (i)=(s);(i)<(ll)(n);(i)++) #define repst(i,s,n) for(ll (i)=(s);(i)<=(ll)(n);(i)++) #define repr(i,n) for(ll (i)=(n);(i)>=0;(i)--) #define each(itr...
ALGO
0.99983
3.546305
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2018-12-03T05:31: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": "fc50fd35b...
577983f1-e5a4-454f-bf4f-2946f6dc27c0
ektagarg786/Coding-Ninjas-CP
Modulo_Arithmetic/No_of_Balanced_BTs.cpp
/*Given an integer h, find the possible number of balanced binary trees of height h. You just need to return the count of possible binary trees which are balanced. This number can be huge, so return output modulus 10^9 + 7. Write a simple recursive solution. Input Format : Integer h Output Format : Count % 10^9 + 7 Inp...
ALGO
0.999948
4.735858
{ "github_metadata": { "branch": "master", "commit_count": 150, "repo_created_at": "2020-03-17T13:54:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "8c0ecdfd...
1ff7afdd-2916-455b-bad3-5eeb2ffc2268
leggedrobotics/ocs2
ocs2_oc/include/ocs2_oc/multiple_shooting/MetricsComputation.h
/****************************************************************************** Copyright (c) 2020, <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: * Redistributions of source code must retain t...
ALGO
0.994103
6.881955
{ "github_metadata": { "branch": "main", "commit_count": 7465, "repo_created_at": "2021-07-08T07:09:10.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1106, "forks": 258, "issues": 50, "pull_requests": 3 }, "file_meta": { "content_id": "2aee...
42fd17ba-4de5-4b6a-b948-25069c463469
KatsuyaKikuchi/ProgrammingContest
Codeforces/Div2/Round 695/D.cpp
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pll; #define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i)) #define REP(i, n) FOR(i,n,0) #define OF64 std::setprecision(40) const ll MOD = 1000000007; const ll INF = (ll) 1e15; template<std::uint_fast64_t Modulus> class ModInt...
ALGO
0.999813
4.176287
{ "github_metadata": { "branch": "master", "commit_count": 87, "repo_created_at": "2020-12-04T21:42: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": "9638c1706...
66ed4adb-361c-4f77-b448-a912f4dbb7b9
bitzsalex/YouTube
C++/#26 Functions/main.cpp
/** * @file main.cpp * @author <NAME> (<EMAIL>) * @brief A function is a group of statements that perform a particular task. * You may define your own functions in C++. * * Using functions can have many advantages, including the following: * - You can reuse the code within a function. * - You can easily test...
TOOL
0.966676
5.5509
{ "github_metadata": { "branch": "master", "commit_count": 55, "repo_created_at": "2022-08-17T17:21: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": "b80650a06...
94d39640-f328-4b95-8bf0-38b9c558013b
ishandutta2007/codeforces-b
benq/normal/1510/C.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using db = long double; // or double, if TL is tight using str = string; // yay python! using pi = pair<int,int>; using pl = pair<ll,ll>; using pd = pair<db,db>; using vi = vector<int>; using vb = vector<bool>; using vl = vector<ll>; using vd = vec...
ALGO
0.998598
3.85445
{ "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": "d224291223bd...
47435501-ddbb-4138-8aed-f980e0f6d083
gpudev0517/Fire-Simulator
NVIS/NDYN/include/Core/Utility/mathUtil.h
#pragma once //#include <math.h> class vec2f; class vec3f; class matrix33f; class quatf; class eulerf; #define FPi 3.1415926535897932384626433832795f #define FPiHalf 1.5707963267948966192313216916398f #define FPiOver180 0.01745329251994329576923690768489f #define FEps 1.0e-6f #define FTwoPi 2.0f*FPi #define DEps 2.2...
TOOL
0.956012
6.154073
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2020-07-06T15:29:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d2a7a73181...
60a0c126-603b-4ffe-83c4-ce40c5e73355
pankajgupta3/January-LeetCoding-Challenge-2021
Day-04 - Merge Two Sorted Lists.cpp
/* Problem: Merge two sorted linked lists and return it as a sorted list. The list should be made by splicing together the nodes of the first two lists. Example 1: Input: l1 = [1,2,4], l2 = [1,3,4] Output: [1,1,2,3,4,4] Example 2: Input: l1 = [], l2 = [] Output: [] Example 3: Input: l1 = [], l2 = [0] Output: [0...
ALGO
0.999973
6.418005
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2021-02-27T08:06: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": "2e5edc612c2...
6815ca69-20f2-49d6-8789-ea517817e9e4
canhnd58/minesweeper
src/board.cpp
#include "board.h" #include "util.h" #include <vector> #include <algorithm> std::vector<Board::Pos> Board::getNeighbors(Board::Pos p) const { std::vector<Pos> neighbors; if (p == POS_UNDEFINED) { return neighbors; } Pos r = getRow(p); Pos c = getCol(p); for (Pos i = -1; i <= 1; i...
ALGO
0.948716
5.87107
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2020-04-04T07:44: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": "d76123f6f...
c59f879b-7054-432c-9613-12c223fb9b21
Gongdolgun/Algorithm
백준/Gold/4485. 녹색 옷 입은 애가 젤다지?/녹색 옷 입은 애가 젤다지?.cc
#include <string> #include <vector> #include <algorithm> #include <iostream> #include <cmath> #include <queue> #include <stack> #include <map> #include <set> #include <algorithm> #include <bitset> #include <thread> #include <mutex> #define FASTIO cin.tie(NULL); cout.tie(NULL); ios::sync_with_stdio(false); #define INF ...
ALGO
0.999612
4.812562
{ "github_metadata": { "branch": "main", "commit_count": 226, "repo_created_at": "2023-03-29T10:03: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": "a299fe6b26...
47260408-0bfb-4012-9b32-9da48fbaea74
xiaozhuyfk/DeepDriving
torcs-1.3.6/src/drivers/sparkle/linalg.h
/*************************************************************************** file : linalg.h created : Wed Feb 18 01:20:19 CET 2003 copyright : (C) 2003 <NAME> email : <EMAIL> version : $Id: linalg.h,v 1.2 2003/08/13 00:03:15 berni...
TOOL
0.927201
5.015471
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2016-10-05T20:43:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "25f76a6830...
905d1bd1-a064-4f38-b037-f6a62412ea58
tanvir248/August-21
Codeforces_August-2021/Binary Decimal.cpp
#include<bits/stdc++.h> using namespace std; using lln = long long int; using ls = string; using ch = char; using lld = long double; using lf = float; using ll= int; using ld = double; #define pb push_back #define eb emplace_back #define B begin() const int MOD = 1000000007; const int INF = 0x3f3f3f3f; #define E end()...
ALGO
0.999785
4.582947
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2021-08-31T18:11: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": "828da06b3388...
131473f1-2efe-4121-8c8d-a112d856f8ce
NCAR/lrose-core
codebase/libs/radar/src/filter/FilterUtils.cc
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* // ** Copyright UCAR (c) 1990 - 2016 // ** University Corporation for Atmospheric Research (UCAR) // ** National Center for Atmospheric Research (NCAR) // ** Bo...
ALGO
0.994651
5.817627
{ "github_metadata": { "branch": "master", "commit_count": 7406, "repo_created_at": "2016-02-09T23:36:25.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 99, "forks": 51, "issues": 16, "pull_requests": 3 }, "file_meta": { "content_id": "54306...
fa82ab07-629f-46fe-80de-2024813f08d9
satyam-knit/scalerDSA
array/practice6.cpp
// Adding two matrices #include <bits/stdc++.h> using namespace std; int main() { int a[4][2] = {{1, 2}, {3, 4}, {5, 6}, {7, 8}}; int b[4][2] = { {5, 6}, {7, 8}, {1, 2}, {1, 2}, }; int sum[4][4]; for (int i = 0; i < 4; i++) { for (int j = 0; j < 2; j++...
ALGO
0.99986
5.010467
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2023-11-03T13:17: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": "93d86921b8f...
293e0418-9b64-4264-9ce2-fe8dfd5df84b
TimeDA/TimeDA
dataset/cpp_12_18/gcj2018/sohelH/0000000000007883_000000000003005a_sohelH.cpp
#include<bits/stdc++.h> using namespace std; const int debug = 0; int R, C; int H, V; vector<string> v; int perGroup; string impossible = "IMPOSSIBLE"; string possible = "POSSIBLE"; bool ok(int h1, int h2, vector<int> &vIndex) { int last = 0; for (int i = 0; i < vIndex.size(); i++) { int cnt = 0; for (int a ...
ALGO
0.998999
4.151184
{ "github_metadata": { "branch": "main", "commit_count": 70, "repo_created_at": "2022-10-24T06:47: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": "b5aafeaaa78...
1a4f1e6f-a658-42d9-b847-49451dd912bc
pushpak25w/Codes
graphs/primeAdj.cpp
#include<bits/stdc++.h> using namespace std; #define V 5 int minKey(int key[],bool mstSet[]){ int min=INT_MAX,min_idx; for(int i=0;i<V;i++){ if(mstSet[i]==false && key[i]<min){ min=key[i]; min_idx=i; } } return min_idx; } void printMst(int parent[],int graph[V][V]){ for(int i=1;i<V;i++){ cout<<paren...
ALGO
0.999984
4.791709
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2021-08-06T07:17:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b16943a674b...
515b054a-2623-410b-84f3-447fd076efb0
yiyeli2020/Algorithm
Algorithm/题目1地铁站[Offer收割]编程练习赛73-hihoCoder.cpp
//#include <iostream> //#include <string> //#include <stdio.h> //#include <string.h> //#include <vector> //#include <ctime> //#include <set> //#include <map> //#include <unordered_map> //#include <queue> //#include <algorithm> //#include <cmath> //#include <assert.h> //using namespace std; ////#define vi vector<int> //...
ALGO
0.999991
4.122938
{ "github_metadata": { "branch": "master", "commit_count": 61, "repo_created_at": "2018-08-10T07:00: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": "80fc46cef...
1a97da89-4af3-42d9-8048-828ad91b6205
AlanCBH/ICPC-code-sample
UVA_code/all_pair.cpp
#include <bits/stdc++.h> using namespace std; int bfs(int start,int target, map<int, vector<int>> adj_list) { queue<int> q; queue<int> cur_q; map<int, int> visited; q.push(start); int cur_dist = 1; while (!q.empty()) { int t = q.front(); q.pop(); for (int i = 0; i < adj_list[t].size(); i++) { int temp = a...
ALGO
0.999839
3.749215
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2019-11-04T06:43: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": "2ede1d14b...
1a611948-45ae-4bc9-9f40-4cf60247f1c8
yashsaxena972/Competitive-coding
InterviewBit/merge_overlapping_intervals.cpp
// Merge Overlapping Intervals /** * Definition for an interval. * struct Interval { * int start; * int end; * Interval() : start(0), end(0) {} * Interval(int s, int e) : start(s), end(e) {} * }; */ bool compareInterval(Interval i1, Interval i2) { return (i1.start < i2.start); } vec...
ALGO
0.999989
5.951341
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2020-08-21T13:24:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a45548c10...
9afe7e62-ac21-4cab-8f9b-53d8d64e6bfc
Justin-Singh125125/CISP-360
CISP 360/Chapter 9/using nullPTRs.cpp
//This program stores the address of a variable in a pointer #include <iostream> using namespace std; int main() { int x = 25; int *ptr = NULL; //you do not need to put the asterix again, that was just the way to declare it //you have to assign it to the &x because the & gets the address ptr = &x; cout << "Th...
ALGO
0.953743
4.048531
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2018-11-28T04:14:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d9f8315203...
a0dab5b3-cfde-4141-9acb-2fe041f734ef
nolan0801/Competitive-Programming
Others/Trai He Tin Hoc (Mien Bac)/DP_digit/M.cpp
/* Author : vidut_206_CNH */ #include <bits/stdc++.h> using namespace std; #define fi first #define se second #define pb push_back #define gcd(a,b) (__gcd(a,b)) #define lcm(a,b) (a/gcd(a,b)*b) #define sz(x) (int)(x.size()) #define fast_cin() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define db(x) cerr << "...
ALGO
0.999978
3.826597
{ "github_metadata": { "branch": "main", "commit_count": 144, "repo_created_at": "2021-12-21T06:10:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "10a5dcbbb8...
6b229ba9-8ad0-44a5-a49a-47b61e83611b
davepandit/Data-Structures-And-Algo
Dynamic Programming/Dynamic_programming_approach/DP on subsequences/Subset problem/Subset problem memoization.cpp
class Solution { public: bool solve(int index, int target, vector<vector<int>>& dp, vector<int>& arr){ if(target == 0){ return true; } else if(index == 0 && arr[index] == target){ return true; } else if(index == 0 && arr[index] != target){ ...
ALGO
0.999722
5.792322
{ "github_metadata": { "branch": "main", "commit_count": 101, "repo_created_at": "2024-12-04T08:08: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": "8fab66f63b...
5463d7dc-3e4e-4906-904d-f5c8f2f61022
CRAVA/crava
src/state4d.h
#ifndef STATE4D_H #define STATE4D_H #include <vector> #include <map> #include <nrlib/flens/nrlib_flens.hpp> class SeismicParametersHolder; class FFTGrid; class TimeEvolution; class TimeLine; class DistributionsRock; class Simbox; // This class holds FFTGrids for the 4D inversion. This includes grids for the static a...
ALGO
0.943685
5.588604
{ "github_metadata": { "branch": "master", "commit_count": 2679, "repo_created_at": "2013-05-07T08:46:47.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 6, "forks": 14, "issues": 7, "pull_requests": 0 }, "file_meta": { "content_id": "8f110de...
07d7b6ca-2dcc-4de8-9b0e-f14bbdf5842c
alexandraback/datacollection
solutions_5708921029263360_0/C++/MatusH/main.cpp
#include <iostream> #include <fstream> #include <stdlib.h> #include <sstream> #include <string> using namespace std; ifstream in; ofstream out; void count(unsigned int J, unsigned int P, unsigned int S, unsigned int K){ unsigned int JPS = J*P*S; unsigned int JPK = J*P*K; if (JPS < JPK) { out <<...
ALGO
0.997889
3.614506
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c017a090b...
6162ddab-8687-45f7-b5df-962a08be14cc
vantuan2905/DSA_DSLK-
quan li danh sach sinh vien bang DSLKD.cpp
#include<bits/stdc++.h> using namespace std; struct student{ string ten,id;float gpa; }; struct SV{ student s; SV* next; }; typedef struct SV* sv; sv makenode(){ sv t=new SV();student tmp;cin.ignore(); cout<<"Nhap ho ten sinh vien: ";getline(cin,tmp.ten); cout<<"Nhap ma id sinh vien: ";cin>>tmp.id; cout<<"nhap d...
ALGO
0.996909
3.468899
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2022-07-07T07:28: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": "e580f113bef...
0ebacb9c-2515-4518-b354-f9cb58aee59b
goriwastaken/ecu-scheme
projects/ecu_scheme/assemble/supg_linear_matrix_provider.h
#ifndef LEHRFEMPP_PROJECTS_ECU_SCHEME_ASSEMBLE_SUPG_LINEAR_MATRIX_PROVIDER_H_ #define LEHRFEMPP_PROJECTS_ECU_SCHEME_ASSEMBLE_SUPG_LINEAR_MATRIX_PROVIDER_H_ #include <lf/assemble/assemble.h> #include <lf/fe/fe.h> #include <lf/mesh/mesh.h> #include <lf/uscalfe/uscalfe.h> #include <Eigen/Core> #include <Eigen/LU> #incl...
ALGO
0.998616
6.117634
{ "github_metadata": { "branch": "master", "commit_count": 1519, "repo_created_at": "2023-11-29T11:12: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": "b63604a...
71907dd8-4e6f-4642-90cc-4395f8f18a69
mmorri22/f21-cse20312
Lec23_Code/src/Prob4.cpp
#include <iostream> #include <fstream> #include <string> #include <vector> #define COUT std::cout #define CIN std::cin #define ENDL std::endl #define OFSTREAM std::ofstream int main(){ bool solved = false; while( !solved ){ COUT << "Given a Hash Table where there are 7 buckets, draw the final table using O...
ALGO
0.975913
3.599715
{ "github_metadata": { "branch": "main", "commit_count": 138, "repo_created_at": "2021-07-28T21:02:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1e32ea2798...
e969ad37-7f38-4986-a810-f7387d7fb726
TheRakibJoy/Algorithms
String/String Hashing/TIMUS - 1517. Freedom of Choice with hashing+BS.cpp
#include<bits/stdc++.h> #define Input freopen("in.txt","r",stdin) #define Output freopen("out.txt","w",stdout) #define ll long long int #define ull unsigned long long int #define pii pair<int,int> #define pll ...
ALGO
0.999995
3.838323
{ "github_metadata": { "branch": "master", "commit_count": 880, "repo_created_at": "2021-12-21T07:08:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "30363f51...
7d905d88-5c48-4631-938a-9d917a517f5b
Vlada-V29/tasks
task-3/number-1.cpp
#include<iostream> #include<vector> #include<set> #include<algorithm> #include<chrono> using namespace std; void time_of_sort1(int); void time_of_sort2(int); int main() { const int N = 100; //~25 -- changes time_of_sort1(N); time_of_sort2(N); return 0; } void time_of_sort1(const int n) { aut...
ALGO
0.979521
5.469638
{ "github_metadata": { "branch": "main", "commit_count": 103, "repo_created_at": "2021-02-15T12:32: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": "5b15c6258b...
640c077f-e3ec-4831-804a-0b8021e430df
yeonheey/algorithms
baekjoon/gold/baekjoon_11049.cpp
#include <iostream> using namespace std; const int SIZE = 501; int N; int matrix[SIZE][2]; // r, c int dp[SIZE][SIZE]; int main() { cin >> N; for(int i = 1; i <= N; i++) cin >> matrix[i][0] >> matrix[i][1]; for(int i = 1; i < N; i++) dp[i][i + 1] = matrix[i][0] * matrix[i][1] * ma...
ALGO
0.999958
3.490053
{ "github_metadata": { "branch": "main", "commit_count": 144, "repo_created_at": "2021-04-05T05:29: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": "e64c8bbc0b...
6e8e4d05-2463-4650-806a-69994190cf75
Patistar/ReactiveEulerSolver
solver/include/fub/euler/kinetic_source_term.hpp
// Copyright (c) 2018 <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 use, copy, modify, merge, publish, distri...
ALGO
0.999875
6.361247
{ "github_metadata": { "branch": "master", "commit_count": 48, "repo_created_at": "2018-10-26T08:29: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": "cd74360b9...
d848a260-aafe-4954-a209-ad135f983b56
min02choi/Cpp-Programming
C++ Programming/Week5/task3_3.cpp
#include <string> #include <vector> #include <iostream> using namespace std; // 내 풀이 vector<int> solution(vector<string> keyinput, vector<int> board) { vector<int> start = { 0, 0 }; vector<int> answer; int max_width = board[0] / 2; // 최대 이동 가능 좌표값 int max_height = board[1] / 2; int min_wi...
ALGO
0.998686
4.894033
{ "github_metadata": { "branch": "master", "commit_count": 49, "repo_created_at": "2022-09-30T18:05: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": "924379778...
75722e81-e7a3-4a29-acda-ae1f2d0b5f83
durgeshkk/Codeforces-Contests
Practice/1700/D_The_Number_of_Imposters.cpp
#include<bits/stdc++.h> #include<iomanip> #include <deque> #include <bitset> #include <cstdint> //#include <ext/pb_ds/assoc_container.hpp> // Common file //#include <ext/pb_ds/tree_policy.hpp> //using namespace __gnu_pbds; //#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_updat...
ALGO
0.99991
3.631011
{ "github_metadata": { "branch": "main", "commit_count": 29, "repo_created_at": "2023-11-23T16:31:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8c351165a9b...
e9b9f507-56ab-49c4-a226-da79f8bf10f2
zhengjingwei/coding-interview
demo/二叉树遍历/main.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; // 层序遍历二叉树 void seqOrder(TreeNode *root){ // vector<int> ret; if(root == nullptr) return; queue<TreeNode*> q;...
ALGO
0.999843
4.309369
{ "github_metadata": { "branch": "master", "commit_count": 75, "repo_created_at": "2019-03-15T15:24: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": "b3c7cab98...
dde33bd8-3841-40d0-af97-fb0c8f9966cf
hackerspace-ntnu/BreadboardComputer
Legacy/ramprogram/Output/output.ino
#include <stdlib.h> #include <stdio.h> #include "assembler.c" const int addressBus[15] = {50, 48, 46, 44, 42, 40, 38, 36, 34, 32, 30, 28, 26, 24, 22}; const int dataBus[16] = {53, 51, 49, 47, 45, 43, 41, 39, 37, 35, 33, 31, 29, 27, 25, 23}; // MINSTE SIGNIFICANT BIT FØRST const int lightPin = 8; // når lyser - er kl...
TOOL
0.942481
4.197534
{ "github_metadata": { "branch": "main", "commit_count": 80, "repo_created_at": "2023-08-28T14:39:24.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "00e2cf9faeb7...
0c49843e-ea4e-46f7-b833-a7b7bd045a6d
iamvickynguyen/Kattis-Solutions
rings.cpp
#include <iostream> #include <vector> #include <tuple> #include <math.h> #include <unordered_set> #include <queue> #include <algorithm> using namespace std; typedef tuple<double, double, double> ddd; int get_largest_component(vector<unordered_set<int>> intersection_map, int n) { int max_count = 0; vector<bool> visit...
ALGO
0.999681
4.620783
{ "github_metadata": { "branch": "master", "commit_count": 432, "repo_created_at": "2019-11-12T01:25:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "135f7eb2...
70a531c7-04b8-4b3d-b319-02eecf1499aa
chakravartiavinit/Practice
Practice1/B_Lecture.cpp
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n, m; cin >> n >> m; map<string, string> mp; for (int i = 0; i < m; ++i) { string a, b; cin >> a >> b; mp[a]...
ALGO
0.999994
4.062828
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2021-10-02T19:33: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": "bfe7b9ce0dd...
f954bbbd-1553-4418-87d6-e3a052b05eb5
sat0yu/sandbox
arc/032/B_unionFindTree.cpp
#include<iostream> #include<stdio.h> #include<vector> #include<set> #include<algorithm> #include<map> #include<string> #include<math.h> #define MAX(x,y) ( (x)>(y) ? (x) : (y) ) #define MIN(x,y) ( (x)<(y) ? (x) : (y) ) using namespace std; int N,M; int uf_parent[100001], uf_rank[100001]; int root(int a){ if(uf_p...
ALGO
0.999908
3.247088
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2014-06-10T04:47: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": "75d3dae98...
eb624df2-2b78-4e5b-93ef-67d93526b625
guru-narayana/Aliengo_2D_Nav-sim
aliengo_gait_controller/src/trajectory_generator.cpp
#include "trajectory_generator.h" #include "Kinematics.h" double T = 0; // Time Period of the trajectory vector<vector<double>> blending_matrix ={{1,-3,2}, {0,4,-4}, {0,-1,2}}; vector<double> Circle_intersection_points(double h,double k...
ALGO
0.999342
3.967903
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2022-07-05T07:25:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 16, "forks": 3, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "21b733535b...
7ffe4818-db0f-466f-9a08-fe13bccd7f2a
Bojorge/Proyecto_de_diseno_CE
IPC/shared_memory/POSIX/reader.cpp
#include <fcntl.h> #include <sys/mman.h> #include <sys/stat.h> #include <unistd.h> #include <iostream> #include <cstring> #include <chrono> #include <thread> const char* SHARED_MEMORY_NAME = "/MySharedMemory"; const size_t SHARED_MEMORY_SIZE = 65536; #include <sys/resource.h> long getRAMUsage() { struct rusage u...
TOOL
0.990022
6.617967
{ "github_metadata": { "branch": "main", "commit_count": 95, "repo_created_at": "2024-06-27T21:44: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": "847f063f57b...
7c1e00c7-7a22-4c1c-8ea9-bf96e674947c
Mhmd-Hisham/Problem-Solving
UVA/12356 - Army Buddies.cpp
#include <bits/stdc++.h> /* Problem: 12356 - Army Buddies Link : https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=3778 Solution by: <NAME> Gmail : <EMAIL> Github : www.github.com/Mhmd-Hisham LinkedIn: www.linkedin.com/in/Mhmd-Hisham */ using namespace s...
ALGO
0.999932
3.671199
{ "github_metadata": { "branch": "master", "commit_count": 101, "repo_created_at": "2019-01-25T21:33:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0b20b15f...
40aa44db-d6aa-4036-8dee-8acb072036d6
yhshu/Data-Structures-Algorithms-and-Applications-in-cpp
all codes in book/Data Structures, Algorithms, & Applications in C++, 2nd Edition/bubbleSort.cpp
// bubble sort #include <iostream> #include <algorithm> // has copy using namespace std; template<class T> void bubble(T a[], int n) {// Bubble largest element in a[0:n-1] to right. for (int i = 0; i < n - 1; i++) if (a[i] > a[i+1]) swap(a[i], a[i + 1]); } template<class T> void bubbleSort(T a[], int n) {...
ALGO
0.999726
4.985606
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-10-02T12:05:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 76, "forks": 26, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bd10adc4...
40b5fa55-f282-4f04-bca0-e30da64ddef3
yuba-lab/miscellanea
uva/c/11187.cpp
#include<cstdio> #include<algorithm> struct X { int l,n; bool operator<(X a)const{return l<a.l;} }s[50]; int n,len,sum,c[30][30]; char go(int m,int l,int i) { if(!sum)return 1; if(m<=0)return(sum<=len); if(len==l) { while(!s[i].n)i--; s[i].n--,sum-=s[i].l; char z=go(m,l-s...
ALGO
0.999767
3.619208
{ "github_metadata": { "branch": "master", "commit_count": 89, "repo_created_at": "2016-05-22T13:54:47.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fbcd7a7c52...
28245b0d-270c-430b-9c46-bcb6564fc138
alexandraback/datacollection
solutions_2751486_0/C++/comesskywalker/main.cpp
#include <cstring> #include <fstream> #include <iostream> #include <vector> #include <sstream> #include <iomanip> #include <string> #include <vector> #include <stack> #include <queue> #include <deque> #include <list> #include <set> #include <map> #include <bitset> #include <algorithm> #include <numeric> #include <compl...
ALGO
0.999466
3.896469
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "68c3e8f36...
62921bc0-dfc9-479d-9b06-f093a595635e
Sharafabdullah/CompetitiveProgramming
cses/rangeQueries/K_query.cpp
#include <bits/stdc++.h> using namespace std; #define all(v) ((v).begin()), ((v).end()) #define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end))) #define pb push_back #define ppb pop_back #define F ...
ALGO
0.999966
4.544316
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2023-05-31T06:13:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b63e181a5...
07fb7b2f-312b-4d7e-a826-b9316ec7c2a2
mikoker/legendware
protect/crypt_hash.h
#pragma once #include "../includes.h" class Fnv { static const unsigned int FNV_PRIME = 16777619; static const unsigned int OFFSET_BASIS = 2166136261; template <unsigned int N> constexpr unsigned int fnv_hash_const(const char(&str)[N], unsigned int i = N) { return i == 1 ? (OFFSET_BASIS ^ ...
TOOL
0.951833
6.172926
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-07-02T21:40:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 19, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "29fce0db852...
821f8828-d9d0-4054-8649-5261841a804c
mnajj/JuniorTrainingSheet
B/476B.cpp
#include <bits/stdc++.h> #include <math.h> #define fastio ios_base::sync_with_stdio(false); cin.tie(nullptr); #define ll long long int using namespace std; int fact(int n); int main() { fastio int c(0), d(0), e(0); string a, b; cin >> a >> b; for (int i = 0; i < a.size(); ++i) { a[i] == '+' ? c++ : c--; if...
ALGO
0.999892
4.123316
{ "github_metadata": { "branch": "main", "commit_count": 176, "repo_created_at": "2022-01-26T15:55:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ea45f0d043...
24965c86-10ff-4446-aa51-7a310fcfd4b9
alipw/Competitive_Programming
C++/1461-B.cpp
#include <bits/stdc++.h> using namespace std; #define endl "\n" #define MOD 1000000007 #define ull unsigned long long int #define ll long long int #define umap unordered_map #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define absolute(a) sqrt((a) * (a)) #define rep(i,n) for(int i = 0; i < (n)...
ALGO
0.999825
4.180297
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2021-02-09T06:00: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": "d1c2c8b034e...
5a7203e8-1890-4772-ad3b-d3329737ccc7
leo-liuzy/OI_repository
codeforces/814/e.cc
//This sourcecode is under GPLv3 //http://yeguanghao.xyz #include <bits/stdc++.h> #define rep(name,start,end,step) for(int name=start;name<=end;name+=step) using namespace std; #define Pn(x) printf("%d\n",x) #define Ps(x) printf("%d ",x) #define mp make_pair #define pb push_back #define fi first #define se second #defi...
ALGO
0.99996
3.432976
{ "github_metadata": { "branch": "master", "commit_count": 154, "repo_created_at": "2018-07-14T22:04:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "faf9d162...
acc258ef-1f94-476f-bde5-9ed3e04a1830
jayjinjuwadia/CS14-UCR
labs/lab7/HashTable.cc
#include <string> #include <iostream> #include <list> #include <cmath> #include <vector> #include <fstream> #include <iterator> #include <cstdlib> using namespace std; class Hash { private: struct Node { Node *next; unsigned value; int count; string stval; Node() { next = NULL; cou...
ALGO
0.995246
3.234377
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-07-17T18:23: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": "2d626dfa13...
c0ea95ee-2aef-47f9-b815-e439f6bcb0fd
professormarcosp/AprendaCParaGamesUE4
PonteirosReferencias/PraticandoConsolidandoReferencias/PorPonteiros/PassagemDeArgumentosPorPonteiros.cpp
#include <iostream> //Agora vamos fazer o mesmo. A passagem de argumentos para a função por //Referência. Só que agora utilizando ponteiros //Lembre-se ponteiros são variáveis que possuem dentro delas um endereço de outra variável //Além disso eles precisam ser desreferenciados para chegar ao valor apontado ou alterá-...
ALGO
0.997706
4.322081
{ "github_metadata": { "branch": "master", "commit_count": 220, "repo_created_at": "2018-08-23T17:55:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 28, "forks": 27, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "57727f...
26c1fdd5-1a67-4e6a-98b0-35df73b69e60
hwanzar/Codee
CP/Prim_Kruskal/Prim_DarkRoads.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define _io \ ios_base::sync_with_stdio(false); \ cin.tie(0); #define pb push_back #define pii pair<int, int> const int INF = 1e9; // 1ty const int MAXN = 400005; vector<pii> adj[MAXN]; int dist[MAXN]; bool visited[M...
ALGO
0.999983
4.202429
{ "github_metadata": { "branch": "main", "commit_count": 78, "repo_created_at": "2022-09-09T03:21:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "940e981d2b9...
093293b9-3c79-4560-9ab7-6255a767fb2c
hezudaopp/algorithm_datastructure
distinct_subsequence.cpp
#include <string> #include <iostream> #include <cstring> using namespace std; class Solution { public: int numDistinct(string S, string T) { // Start typing your C/C++ solution below // DO NOT write int main() function int s = S.size(); int t = T.size(); if (s < t || s == 0...
ALGO
0.99997
5.509992
{ "github_metadata": { "branch": "master", "commit_count": 71, "repo_created_at": "2013-07-24T02:29:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "60192093e...
bb1d20dd-459b-4d76-941d-51661e53887f
acil-bwh/ChestImagingPlatform
Common/vtkComputeMonogenicSignal.cxx
/*========================================================================= Program: Visualization Toolkit Module: $RCSfile: vtkComputeMonogenicSignal.cxx,v $ Copyright (c) <NAME>, <NAME>, <NAME> All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This soft...
ALGO
0.956944
6.070234
{ "github_metadata": { "branch": "master", "commit_count": 2341, "repo_created_at": "2015-01-06T10:43:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 58, "forks": 35, "issues": 23, "pull_requests": 0 }, "file_meta": { "content_id": "3e3c...
ce894987-3d8e-47b3-80cd-5b9c1f1d595e
apple/turicreate
src/external/boost/boost_1_68_0/boost/geometry/algorithms/detail/expand/box.hpp
// Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2007-2015 <NAME>, Amsterdam, the Netherlands. // Copyright (c) 2008-2015 <NAME>, Paris, France. // Copyright (c) 2009-2015 <NAME>, London, UK. // Copyright (c) 2014-2015 <NAME>, Grenoble, France. // This file was modified by Oracle on 2015, 2016, ...
TOOL
0.991867
7.233134
{ "github_metadata": { "branch": "main", "commit_count": 1571, "repo_created_at": "2017-12-01T00:42:04.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 11198, "forks": 1137, "issues": 502, "pull_requests": 21 }, "file_meta": { "content_id": "...
733d1825-c39a-4610-8d1b-3bea393117b9
catarinab/ASAlgorithms
proj1/proj1Source.cpp
#include <stdio.h> #include <list> #include <vector> #include <string> #include <stack> #include <iostream> #include <sys/time.h> using namespace std; class Graph { public: int nodes, edges, nSources; list<int> *adjList; vector<bool> visited; vector<bool> sources; vector<in...
ALGO
0.999739
4.067966
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2021-04-08T12:30:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fd67f0972...
7c26926e-3bfc-4428-baa7-8cb02564de0b
pboesu/rucrdtw
src/dtw_functions.cpp
/***********************************************************************/ /************************* DISCLAIMER **********************************/ /***********************************************************************/ /** This UCR Suite software is copyright protected 2012 by **/ /** <NAME>, <NAME>, <NAM...
ALGO
0.998794
3.387055
{ "github_metadata": { "branch": "master", "commit_count": 160, "repo_created_at": "2016-08-31T22:08:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 16, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "47a548b...
55ca742f-3e92-4317-b92c-b173af1c707b
IvanPodyukov/ACS_HW2
main.cpp
// main.c - содержит главную функцию, // обеспечивающую простое тестирование // Формат ввода данных о фильме: // Через пробел вводятся четыре параметра: // Первый - число (тип фильма в диапазоне от 1 до 3) // 1 - игровой, 2 - мультфильм, 3 - научный // Второй - строка (название фильма) // Третий - число (год выхода фил...
TOOL
0.902747
4.070591
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2021-10-23T18:55: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": "0e7ed028c435...
aad3b8f9-82f3-4696-8ac0-aa8f5b299464
Jaswanth03-cyber/Competitive-Programming
Algorithms/Greedy Algorithms/min_platforms.cpp
/* Given the arrival and departure times of all trains that reach a railway station, the task is to find the minimum number of platforms required for the railway station so that no train waits. We are given two arrays that represent the arrival and departure times of trains that stop. brute force: The idea is to tak...
ALGO
0.999885
5.199634
{ "github_metadata": { "branch": "main", "commit_count": 252, "repo_created_at": "2022-06-29T17:18:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "05940e6da8...
1612a632-8590-4853-b174-7b0c0a3cc290
MrKoT321/Combinatorial-Algorithms
lw6/HopcroftKarp/HopcroftKarp.cpp
#include "HopcroftKarp.h" #include <queue> HopcroftKarp::HopcroftKarp() { InputDataTest(); m_result = std::vector<int>(m_numNodesLeft, INF); m_matching = std::vector<int>(MAX_SIZE, NIL); m_distance = std::vector<int>(MAX_SIZE, NIL); } HopcroftKarp::HopcroftKarp(std::vector<std::vector<int>> graph, int...
ALGO
0.99977
4.398008
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-02-09T16: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": "315c8449e4fc...
3e9598fe-87d7-4a3e-8eb2-664e54c108a9
iCodeIN/Competitive-Programming-11
AtCoder/abc 237/E_Skiing.cpp
// // // // // // // // // // // // // // // // // // // // // // // // /* author : pasricha_dhruv */ // // // // // // // // // // // // // // // // // // // // // // // // #include <bits/stdc++.h> // // // // // // // // // // // // // // // // // // // // // // // // using namespace std; using LL = lo...
ALGO
0.999967
4.226626
{ "github_metadata": { "branch": "master", "commit_count": 211, "repo_created_at": "2022-03-22T12:10:57.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ccfaacfb4...
9941d58f-3465-4e43-a19a-2d4655cd750e
csugulo/leetcode-solutions
460_LFU_Cache/LFU_Cache.cpp
#include "leetcode_solutions.h" class LFUCache { public: LFUCache(int capacity) { capacity_ = capacity; size_ = 0; min_frequency_ = 0; } int get(int key) { if (!cache_.count(key)) { return -1; } value_t value = cache_[key].first; frequency_t frequency = cache_[key].second++; list<key_t> & list =...
ALGO
0.998706
5.579733
{ "github_metadata": { "branch": "master", "commit_count": 44, "repo_created_at": "2019-01-14T09:08: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": "417289ca9...
4330570c-afba-449f-8da0-427d940a5269
tapilyoca/compprog-notebook
DATASTRUCTS/segtree_lazy.cpp
#ifndef SNIPPETS_HPP #include "../snippets.hpp" #endif /* Lazy propagating range sum segtree with range addition updates. It might be convenient to replace ll val with a struct, and then overload the + operator */ struct Segtree { ll l, r; Segtree *lt, *rt; ll val; ll lazy = 0; void combine() { ...
ALGO
0.999146
6.689527
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2025-05-07T10:15: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": "0b1343a9f76...
2e4d7549-8edc-48ec-975a-fb92bafd1e6c
koalaverse/anomalyDetection
src/RcppExports.cpp
// Generated by using Rcpp::compileAttributes() -> do not edit by hand // Generator token: 1<PASSWORD> #include <RcppArmadillo.h> #include <Rcpp.h> using namespace Rcpp; // compute_md arma::mat compute_md(arma::mat x); RcppExport SEXP _anomalyDetection_compute_md(SEXP xSEXP) { BEGIN_RCPP Rcpp::RObject rcpp_resul...
ALGO
0.990229
5.303293
{ "github_metadata": { "branch": "master", "commit_count": 138, "repo_created_at": "2017-01-20T15:40:55.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 22, "forks": 6, "issues": 6, "pull_requests": 0 }, "file_meta": { "content_id": "a6c729a7...
5534646c-da7a-4c66-89fe-b028db954e9f
Kitware/VTK
ThirdParty/libproj/vtklibproj/src/projections/lagrng.cpp
#define PJ_LIB__ #include <errno.h> #include <math.h> #include "proj.h" #include "proj_internal.h" PROJ_HEAD(lagrng, "Lagrange") "\n\tMisc Sph\n\tW="; #define TOL 1e-10 namespace { // anonymous namespace struct pj_opaque { double a1; double a2; double hrw; double hw; double rw; double ...
ALGO
0.994226
5.994379
{ "github_metadata": { "branch": "master", "commit_count": 94968, "repo_created_at": "2010-04-27T15:12:58.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2910, "forks": 1246, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2...
103e844c-11de-401a-a935-633c491abcf6
qlhai/Algorithms
LeetCode/code/00000-00500/00374.cpp
/** * Forward declaration of guess API. * @param num your guess * @return -1 if num is lower than the guess number * 1 if num is higher than the guess number * otherwise return 0 * int guess(int num); */ class Solution { public: int guessNumber(int n) { int i = 1; ...
ALGO
0.99999
4.958317
{ "github_metadata": { "branch": "master", "commit_count": 221, "repo_created_at": "2018-02-13T15:33: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": "0a8766a4...
b1a12fc2-b803-4f5f-bcb0-c238cb48c380
Cjkeerthana/AdvancedProgramming
BST_project_exam/bst.cpp
#include <iostream> #include <utility> #include <memory> #include <algorithm> #include <vector> #include <cmath> #include "bst.hpp" #include "iterator.hpp" //BST OPERATIONS template <typename key_type, typename value_type, typename comp_op> std::pair<typename Bst<key_type, value_type, comp_op>::iterator, bool> Bst...
ALGO
0.997941
4.736832
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2020-10-10T21:18: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": "36dfa34ea7e1...
62a5d58a-212c-4557-9d62-d102a0d7b758
fhvirus/CodeArchive
TIOJ/1115.cpp
#include<unistd.h> #include<cstdio> #include<cmath> char OB[12502]; int OP; inline bool RD(double &d){ return scanf("%lf",&d) != -1; } inline void W(int n){static char buf[12],p;if(n==0)OB[OP++]='0';p=0;while(n)buf[p++]='0'+(n%10),n/=10;for(--p;p>=0;--p)OB[OP++]=buf[p];} inline void WD(double n){ int x = (n * 1000 + ...
ALGO
0.998888
3.566293
{ "github_metadata": { "branch": "master", "commit_count": 59, "repo_created_at": "2021-04-25T08:33:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "35f2adb56...
c33d02dd-5f86-4eb7-ba4a-914f80f41d62
Paradoxiao/OJ-and-PTA
C++/OJ/S8/f.cpp
#include <iostream> #include <string> using namespace std; class Animal { private: string name; int num; protected: public: Animal() : name(""), num(0) {} void setAnimal(string n, int number) { name = n; num = number; } int getNum() const { return num; } string getName() const { return ...
ALGO
0.998711
4.282669
{ "github_metadata": { "branch": "main", "commit_count": 57, "repo_created_at": "2025-05-25T13:26:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8b84df53566...
a991d866-62a2-41db-83c1-5dc579e0bea3
sshyeri/AlgorithmProblems
Swexpertacademy/cpp/홀수중간피라미드2.cpp
// #include <fstream> #include <iostream> using namespace std; int arr[200002]; int N; int ans; void binsearch(int s, int e){ while(s<=e){ int mid = (s+e)/2; int n = arr[N]>=mid; int nl = arr[N-1]>=mid; int nr = arr[N+1]>=mid; if(n && (nl||nr)){ s = mid + 1; if(mid>ans) ans = mid; continue; } ...
ALGO
0.999731
3.496001
{ "github_metadata": { "branch": "master", "commit_count": 27, "repo_created_at": "2019-08-15T05:17: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": "a7f5acd78...
460124eb-7cd7-4e6c-9056-f07ae820f545
Varuxn/Huffman-coded-zip
main.cpp
#include<bits/stdc++.h> #include"huffman_tree.h" #include"hash.h" #include"file.h" #include"out_in_hex.h" // #include"decoder.h" #include"decoder_new.h" using namespace std; std::mt19937_64 rnd(std::chrono::steady_clock().now().time_since_epoch().count()); string file,inid,outid,inname,outname; string file_hfm,file_j; ...
TOOL
0.99629
3.410698
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2025-02-22T08: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": "38d246786b...
f8d4bbab-e502-4e53-adf4-8fb30981d374
rwitten/vision-spl
quality_box.cc
/******************************************************** * * * Efficient Subwindow Search (ESS) implemented in C++ * * bound the sum-of-entries in a box (e.g. linear SVM) * * * * Copyright 2006-2008 <NAME...
ALGO
0.998984
4.844997
{ "github_metadata": { "branch": "master", "commit_count": 97, "repo_created_at": "2011-08-28T23: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": "5f470a565...
30d91d4f-764b-45be-8dfd-198e8c890b43
ishandutta2007/codeforces-y
yukimaru/normal/872/B.cpp
/************************************************************************* > File Name: 872_B.cpp > Author: yuki > ################### > Mail: ################### > Created Time: Sun 15 Oct 2017 04:23:02 PM CST ************************************************************************/ #include<ios...
ALGO
0.999965
3.063539
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:40: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": "8a9c7022dbfa...
1a2a977b-b0a9-43e7-9fbb-6d91aad0dab2
Wrent/ppr_zbs
seq_recursive/main.cpp
#include <iostream> #include <cstdlib> #include <fstream> #include <vector> #include <set> #include <cstdint> #include <string> #include <limits> #include <stdexcept> #include <cstring> using namespace std; #define _DEBUG void printUsage(const char* name) { const char* helptext = "a n m k infile\n\n" "a = natur...
ALGO
0.999281
4.294446
{ "github_metadata": { "branch": "master", "commit_count": 427, "repo_created_at": "2015-10-20T14:51:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "c35a995d...
71582510-9e68-4b62-8993-9d229e1def6b
Ixecd/Lars
lars_reactor/src/config_file.cc
#include <lars_reactor/config_file.hpp> // #include "config_file.hpp" #include <strings.h> #include <fstream> #include <iostream> #include <map> #include <sstream> // #include "qc.hpp" #include <lars_reactor/qc.hpp> namespace qc { // 直接获取单例模式,不需要在config_file中单独设置一个单例(饿汉式) static config_file* config = nullptr; con...
CONFIG
0.924509
4.493742
{ "github_metadata": { "branch": "main", "commit_count": 335, "repo_created_at": "2024-04-26T07:28: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": "6473ccb45c...
5b307068-0579-48ed-8a04-ffa6e52dd5e8
enitink/prj
generic/codes/leetcode/unsolved/aug31q3.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <cmath> #include <map> #include <set> #include <queue> #include <stack> #include <unordered_map> #include <unordered_set> #include <list> #include <deque> #include <bitset> #include <numeric> #include <functional> #include <utility> #...
ALGO
0.999815
4.602898
{ "github_metadata": { "branch": "master", "commit_count": 136, "repo_created_at": "2014-02-02T13:22: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": "5d5f574d...
695dd684-ecf8-4b08-a598-9809d1d9c1c3
rltn2121/Baekjoon
baekjoonPractice/5373.cpp
#include <iostream> #define rep(i,n) for(int i=0;i<n;i++) using namespace std; enum {U, D, L, R, F, B}; char cube[6][3][3]; int t, n; string cmd; // 큐브 초기화 void init() { rep(i, 3) { rep(j, 3) { cube[U][i][j] = 'w'; cube[D][i][j] = 'y'; cube[L][i][j] = 'g'; cube[R][i][j] = 'b'; cube[F][i][j] = 'r'; ...
ALGO
0.999879
4.690892
{ "github_metadata": { "branch": "master", "commit_count": 46, "repo_created_at": "2020-02-28T09:16: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": "bec7e6ba1...
2d0903f3-0554-44ab-b11a-fe364e778a1f
roy0701/AtCoder
ABC/ABC287/ABC287D.cpp
#include <iostream> using namespace std; string S, T; bool match(int i, int j) { return S[i] == T[j] || S[i] == '?' || T[j] == '?'; } int main() { cin >> S >> T; int n = S.length(); int m = T.length(); int i = 0; while (i < m) { if (!match(i, i)) break; i++; } int j = 0; while (j < m) { ...
ALGO
0.999996
3.882888
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-05-17T05:01: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": "7ff647cf7b31...
b952d533-e289-4e30-9d26-6b9ab9b87624
Todaymorning/Leetcode
30_4_top100/5_34_find-first-and-last-position-of-element-in-sorted-array.cpp
// https://leetcode.cn/problems/find-first-and-last-position-of-element-in-sorted-array/description/ // 34. 在排序数组中查找元素的第一个和最后一个位置 // 已解答 // 中等 // 相关标签 // 相关企业 // 给你一个按照非递减顺序排列的整数数组 nums,和一个目标值 target。请你找出给定目标值在数组中的开始位置和结束位置。 // 如果数组中不存在目标值 target,返回 [-1, -1]。 // 你必须设计并实现时间复杂度为 O(log n) 的算法解决此问题。 // 示例 1: // 输入:...
ALGO
0.999956
6.245785
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2024-07-24T12:50: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": "87c6b00455...
c41f4455-9ead-4b2f-9378-2c96bf7988a9
srishti02/MPI
ss2021-mpi-codes-provided/05-pi-hybrid/pi-hybrid.cpp
//=========================================================================== #include <limits> // for std::numeric_limits #include <numeric> // for std::transform_reduce #include <functional> // for std::plus #include <execution> // for std::execution #include <iostream> // for std::cout, std::cer...
ALGO
0.998664
6.005946
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-06-15T15:13:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "890e7d6011e4...
51b90a9e-feda-4e08-ac01-6d4afe0e31e5
myeongjin1115/baekjoon
12865.cpp
// https://www.acmicpc.net/problem/12865 #include <iostream> using namespace std; int N, K, i, j; int W[101], V[101], DP[101][100001]; int main() { cin >> N >> K; W[0] = V[0] = 0; for(i = 1; i <= N; i++) { cin >> W[i] >> V[i]; } for(i = 0; i <= N; i++) { for(j = 0; j <= K; j++...
ALGO
0.999996
4.300467
{ "github_metadata": { "branch": "master", "commit_count": 46, "repo_created_at": "2019-10-13T11:22: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": "af8051880...
49b8b445-c789-4950-a1ad-9ec35c9f822a
Toebin/GAME1001-2021
Intro to Programming Lab 3/Source.cpp
//* Intro To Programming Lab 3 *\\ // <NAME> - 101164498 #include <iostream> #include <String> #include <iomanip> using namespace std; int main() { // Declaring Variables float hoursWorked{}; float hourlyRate{}; float regularPay{}; float overtimePay{}; float totalPay{}; float overtimeHours{}; cout <...
ALGO
0.993858
3.67483
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2021-01-20T20:53: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": "a2f4ddc011e...
43967cce-7bc2-4f9a-af17-325503b90469
Foyez-Ahmed-Dewan/My-Learning
codesmash/Alter/wrong_solution4.cpp
#include<bits/stdc++.h> #define int long long using namespace std; void solve(){ int n; cin >> n; int cnt = 1, ans = 0; bool ok = true; if (n % 2 == 0) { for (int i = 2; cnt <= n; cnt++, i += 2) { cout << 0 << " "; ans += i; if (i % cnt != 0) { ...
ALGO
0.999741
3.650966
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2022-07-28T06:19: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": "948c1fc00...
738da40b-bf06-45ac-8e6f-cf3941adef30
SidharthSarangi/LOVE-BABBAR-FINAL-450-DYNAMIC-PROGRAMMING
Longest Palindromic Subsequence.cpp
//Initial template for C++ #include<bits/stdc++.h> using namespace std; // } Driver Code Ends //User function Template for C++ class Solution{ public: int lcs(string s1 , string s2 , int x , int y) { int dp[x+1][y+1] ; for(int i=0 ; i<=x ; i++) { for(int j=0 ; j<=y ; j++...
ALGO
0.999961
5.395988
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2021-08-16T19:05: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": "daeac0d3d6c...
68eda51e-4a2e-487a-8a46-266b2a6013a0
nshah25/eecs280
Project1 - stats/stats.cpp
// stats.cpp #include "stats.h" #include "p1_library.h" #include <cassert> #include <vector> #include <cmath> #include <iostream> using namespace std; vector<vector<double>> summarize(vector<double> v) { //Declaring a 2D vector to store the final result vector<vector<double>> finalVec; double count = 1; //sorting ...
ALGO
0.999178
4.872756
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2022-05-02T23:05: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": "cd595beeea6...
c99c5473-5719-4da9-8a97-524061c4526c
yuichiro-kurose/kyopro
edpc/d/main.cpp
// author: <NAME> #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, lim; cin >> n >> lim; vector<int> w(n + 1), v(n + 1); for (int i = 1; i <= n; i++) { cin >> w[i] >> v[i]; } vector<vector<long long>> dp(n + 1, vector<long long>(lim +...
ALGO
0.999997
4.336747
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2025-06-15T05:31: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": "3e4f4df5e...
180a6dc1-8769-4260-acdf-1b3bfe138c93
Yawn-Sean/Daily_CF_Problems
daily_problems/2024/06/0604/personal_submission/cf1949i_yrlpiao.cpp
#include <iostream> #include <vector> #include <array> using namespace std; #define ar3 array<int, 3> #define int long long vector<int> ed[1010]; int vis[1010] {}; bool check(auto x, auto y) { int x1 = x[0], y1 = x[1], r1 = x[2]; int x2 = y[0], y2 = y[1], r2 = y[2]; int a = x1 - x2, b = y1 - y2; return ...
ALGO
0.999752
5.372209
{ "github_metadata": { "branch": "main", "commit_count": 20410, "repo_created_at": "2024-02-26T01:04:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 478, "forks": 302, "issues": 0, "pull_requests": 7 }, "file_meta": { "content_id": "b379...
3407fb56-a27c-4321-8f8d-0d7f97904035
sraaphorst/spelunker
src/thickmaze/GridColouring.h
/** * GridColouring.h * * By <NAME>, 2018. * * Represents a periodic colouring of a grid, which we can use to make mazes. */ #pragma once #include <functional> #include <map> #include <sstream> #include <string> #include <tuple> #include <vector> #include <types/CommonMazeAttributes.h> #include <math/Partition...
ALGO
0.978244
7.008205
{ "github_metadata": { "branch": "master", "commit_count": 280, "repo_created_at": "2018-05-12T18:26:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 2, "issues": 27, "pull_requests": 0 }, "file_meta": { "content_id": "72dbf3...
1023cd09-21f4-49ce-9b39-173dacfa6203
Captain9965/Data-Structures-and-Algorithms
Algorithms/dynamic-programming/longest-common-subsequence.cpp
/* longest common subsequence in cpp: */ #include "iostream" #include "cstring" using namespace std; void lcsAlgo(char * S1, char* S2, int m, int n){ int lcsTable[m + 1][n + 1]; /*building the matrix in a bottom up way:*/ for (int i = 0; i <= m; i++){ for (int j = 0; j <= n; j++){ if...
ALGO
0.999947
5.19048
{ "github_metadata": { "branch": "master", "commit_count": 193, "repo_created_at": "2022-06-30T14:06:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b92cfed6...