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
286bbb67-55e6-46e3-9bd2-bd12c149c817
Mayank9mare/Codechef-Solutions
janchallenge20121/dw.cpp
#include<bits/stdc++.h> #define pb push_back #define mk make_pair #define ll long long #define ss second #define ff first #define pll pair<ll,ll> #define vll vector<ll> #define mll map<ll,ll> #define mod 998244353 #define w(x) ll x; cin>>x; while(x--) #define ps(x,y) fixed<<setprecision(y)<<x; #define fo(i, j, k, in) f...
ALGO
0.999994
4.793654
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2021-11-04T19:43:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9ddea95ff...
ddbd18f3-f3e1-44f7-81d2-95ccde4adc5d
Zixuan-QU/Leetcode
Code/palindrome.cpp
//second time class Solution { public: bool isPalindrome(int x) { if(x<0) return false; int a =1,b=1; while(x/a>=10) a*=10; int left,right; while(a>b){ left = x/a%10; a/=10; right = x/b%10; b*=10; if(right!=...
ALGO
0.999933
5.214354
{ "github_metadata": { "branch": "master", "commit_count": 309, "repo_created_at": "2015-01-23T13:58: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": "a5b7ff0a...
4200d842-4a72-4006-b0b9-a5fe914e959f
vinay030901/Algorithms
450/G1/3shortedUnsortedContinuousSubarray.cpp
/*Given an integer array nums, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order. Return the shortest such subarray and output its length. Example 1: Input: nums = [2,6,4,8,10,9,15] Output: 5 Explanation: You nee...
ALGO
0.999976
4.873304
{ "github_metadata": { "branch": "master", "commit_count": 42, "repo_created_at": "2021-07-12T04:12: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": "8acbc9ae1...
11cfd3e7-087c-420b-8db4-5c1a382d846e
dumbbellcode/CP
TREES/Max heap and heap sort.h
// MAX HEAP #include<bits/stdc++.h> using namespace std; void max_heapify(int a[],int index,int N) { int largest; int left = 2*index; int right = 2*index+1; if(left<=N && a[left]>a[index]) { largest = left; } else { largest = index; } if(right<=N && a[right]>a[...
ALGO
0.999816
4.566078
{ "github_metadata": { "branch": "master", "commit_count": 164, "repo_created_at": "2019-11-06T06:16:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c3d4a944...
8a1d853e-d894-4345-a7fd-d68bf94bb376
Gageco/CS-Classes
CSM/CSCI261/week07/Lab07C/main.cpp
/* Author: <NAME>, sunshengliu Section: A Week: 7 Homework: 2 */ #include <iostream> using namespace std; const int LENGTH_OF_USERINPUT = 5; int userInput[LENGTH_OF_USERINPUT]; int allThrees(int userInput[LENGTH_OF_USERINPUT]) { for (int i = 0; i < LENGTH_OF_USERINPUT; i++) { if (userInput[i] != 3) { ret...
ALGO
0.995763
4.399575
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2020-09-10T05:06:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2600917ad6...
84e7789d-d291-4c42-a7cf-78b197956f37
alimdneaz/cpp_main_course_apna_college_last
Lecture10_characterArray/28_characterArrays.cpp
#include<iostream> using namespace std; int main(){ // char fruit[100]="apple"; // int i=0; // while(fruit[i]!='\0'){ // cout<<fruit[i]<<endl; // i++; // } // i/o // char name[100]; // cout<<"Enter a name"; // cin>>name; // cout<<name<<endl;; // // accesing inde...
ALGO
0.997428
3.317708
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2022-11-24T12:47:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "de36c23ac53...
982d4a28-bf48-4eca-98af-6836a8c54a59
pilkch/ac-display
src/settings.cpp
#include <climits> #include <cstring> #include <limits> #include <iostream> #include <filesystem> #include <pwd.h> #include <sys/stat.h> #include <sys/time.h> #include <sys/types.h> #include <unistd.h> #include <json-c/json.h> #include "json.h" #include "settings.h" #include "util.h" namespace { bool JSONParseStr...
TOOL
0.952784
6.068525
{ "github_metadata": { "branch": "main", "commit_count": 73, "repo_created_at": "2024-02-11T11:38:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "f2b7b8867d6...
264aeeaa-5b2b-44aa-bd81-b0746b96cd4d
koonan/Projects
SIC_XE Assembler/phase2/pass1/ExpressionEvaluator.cpp
#include "ExpressionEvaluator.h" ExpressionEvaluator::ExpressionEvaluator() { } ExpressionEvaluator::~ExpressionEvaluator() { } int ExpressionEvaluator::fromHexToDecimal(string hex) { unsigned int result ; std::stringstream ss; ss << std::hex << hex; ss >> result; return static_cast<int>(result)...
ALGO
0.927197
4.679696
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2016-11-01T02:29: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": "665ece9c66...
e1ec1f42-f003-405c-84f5-739e4d8f0fe9
SalmanNawaz921/Data_Structures_Algroithms
Linked-List/LinkedList.h
#pragma once #include "Node.h" #include "Iterator.h" #include <iostream> using namespace std; template <typename T> class LinkedList { Node<T> *head; Node<T> *tail; public: LinkedList() { head = nullptr; tail = nullptr; } Iterator<T> begin() { return Iterator<T>(he...
ALGO
0.997963
4.833849
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2023-11-06T16:14: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": "6a6ecd10d...
e9e71005-6523-4d70-a93d-6ec9737e8976
Gastonm123/Notebook-ICPC
src/grafos/.test.hamiltonian_path.cpp
// https://www.hackerearth.com/practice/algorithms/graphs/hamiltonian-path/practice-problems/algorithm/micro-and-coins/ #include <bits/stdc++.h> using namespace std; #define forr(i, a, b) for (int i = int(a); i < int(b); i++) #define forn(i, n) forr(i,0,n) #define dforr(i, a, b) for (int i = int(b)-1; i >= int(a); i-...
ALGO
0.999865
5.652399
{ "github_metadata": { "branch": "master", "commit_count": 59, "repo_created_at": "2024-09-14T01:59:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1341d1485...
97029d41-90c5-4e6f-b498-9e99d88e8f23
tk-yoshimura/TensorShaderAVX
TensorShaderAvxBackend/Elementwise/UnaryArithmetric/rcbrt.cpp
#include "../../TensorShaderAvxBackend.h" using namespace System; void rcbrt(unsigned int length, float* src_ptr, float* dst_ptr) { const unsigned int j = length & ~7u, k = length - j; for (unsigned int i = 0; i < j; i += 8) { __m256 x = _mm256_load_ps(src_ptr + i); __m256 y = _mm256_invcbrt...
ALGO
0.999089
5.223335
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2019-10-20T03:32: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": "45827ee7c...
fac923b0-02ad-41ca-af9c-8067eab88968
yyyy1221/BOJ
boj_code/10815.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; vector<int> num_N; vector<int> num_M; vector<int> answer; int main(){ int N, M; cin>>N; for(int i = 0; i < N; i++){ int x; cin>>x; num_N.push_back(x); } sort(num_N.begin(), num_N.end()); cin>...
ALGO
0.999994
4.39256
{ "github_metadata": { "branch": "master", "commit_count": 111, "repo_created_at": "2021-01-06T14:31: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": "1bd73720...
90cb7103-2b4f-4dec-b630-e2cd31e37b3c
alibaba/MNN
backupcode/cpubackend/BlstmComputer.cpp
// // BLSTM.cpp // MNN // // Created by MNN on 2020/04/30. // Copyright © 2018, Alibaba Group Holding Limited // #include <math.h> #include "MNN/ErrorCode.hpp" #include "MNN_generated.h" #include "backend/cpu/CPUBackend.hpp" #include "backend/cpu/compute/BlstmComputer.hpp" #include "core/BufferAllocator.hpp" #inc...
ALGO
0.999906
7.07163
{ "github_metadata": { "branch": "master", "commit_count": 2067, "repo_created_at": "2019-04-15T07:40:18.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 12546, "forks": 2006, "issues": 91, "pull_requests": 9 }, "file_meta": { "content_id": "...
a7c5364b-7c5a-4f79-ab6f-6e5ee7490f63
ishandutta2007/codeforces-d
dotorya/normal/828/A.cpp
#include <stdio.h> #include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <complex> #include <deque> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <stdlib.h> #include <string...
ALGO
0.999822
3.538437
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:31:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0a3595724067...
8cd9b3d6-88ef-4d03-8c88-1f62c3709845
Balaji20042008/CPP
CPP_100.cpp
#include<iostream> #include<vector> using namespace std; int recursion (int n, int x, int y, int z) { if (n == 0) { return 0; } if (n < 0) { return INT_MIN; } int a = recursion (n-x, x, y, z) + 1; int b = recursion (n-y, x, y, z) + 1; int c = recursion (n-z, x, y, z) + ...
ALGO
0.99998
4.391239
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-04-10T17:50: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": "52e0f7c893b8...
7f76b494-03e3-4d72-822d-7cb9b03518f4
tonywilliams1990/TSL
Examples/Project/Eigenvalue_Problem.cpp
#include <cassert> #include <cmath> #include "Newton.h" #include "Residual.h" #include "ODE_BVP.h" #include "Vector.h" #include "Eigensystem.h" #include "Timer.h" // ODE enumeration enum{ f, fd, fdd, g, gd, gdd }; // Base flow enumeration enum{ UB, UBd, PhiB, ThetaB, ThetaBd, PsiB }; // Eigenvalue enumeration enum...
ALGO
0.999596
4.734751
{ "github_metadata": { "branch": "master", "commit_count": 120, "repo_created_at": "2016-08-05T15:45: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": "1c0fcf65...
f3e9a748-9782-49ca-89ae-e13a29de1060
bhhbazinga/leetcode
170周赛/4/main.cc
#include <algorithm> #include <climits> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <map> #include <memory> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #define log(fmt, ...) ...
ALGO
0.999974
4.653071
{ "github_metadata": { "branch": "master", "commit_count": 64, "repo_created_at": "2019-11-05T14:39:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e482acd55...
279e0efa-08de-406d-a4c8-488c15bc0417
Zac-hills/Game_Engine
DrunkenInsomnia/VectorMath.h
#ifndef __VECTOR_MATH__ #define __VECTOR_MATH__ #include "windows.h" #include <iostream> class vec2 { public: vec2() : x(0.0f), y(0.0f){}; vec2(int a_x, int a_y) : x((float)a_x), y((float)a_y) {}; vec2(float a_x, float a_y) : x(a_x), y(a_y) {}; vec2(double a_x, double a_y) : x((float)a_x), y((float)a_y) {}; vec2(...
TOOL
0.973188
5.115306
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-10-21T01:31: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": "46365154c3...
4dbb7444-f6b0-451f-84e3-9603e7280372
saken03/Competitive-Programming
USACO/2018/January Contest/Bronze/Problem 1. Blocked Billboard II/BlockedBillboardII.cpp
/*** AUTHOR: shabylkhan CREATED: 17.05.2022 16:59:10 ***/ #include<bits/stdc++.h> using namespace std; bool covered(int x1, int y1, int x3, int y3, int x4, int y4) { return x1 >= x3 && x1 <= x4 && y1 >= y3 && y1 <= y4; } void solve() { int x1, x2, y1, y2; cin >> x1 >> y1 >> x2 >> y2; int x3, y3, x4...
ALGO
0.998462
4.508715
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2022-12-19T13:35: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": "f9f9411d1...
da00500d-85d5-4e62-a1a3-c3a5274ea1c4
abumusasakib/my-codes
c++/data structures/Hashing/Collision Resolution/LinearProbing.cpp
#include <iostream> #include <cstdlib> #include <ctime> #include <cmath> using namespace std; int hashFunctionDivisionMethod(int data, int hashTableSize) { int hashValue = (abs(data)) % hashTableSize; return hashValue; } void addValueLinearProbing(int hashTable[], int stateArray[], int data, int hashTableSiz...
ALGO
0.999629
4.048315
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2021-05-19T04:38:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4ef56f26062...
aa884a7e-d822-4468-b51f-b3b85a4c6145
chinwe/trunk
CPP/C++11/faq/MoveSemantics/basics/customerimpl.cpp
#include <string> #include <vector> #include <iostream> #include <cassert> #include <utility> class Customer { private: std::string name; // name of the customer std::vector<int> values; // some values of the customer public: Customer(const std::string &n) : name{n} { assert(!name.empty()); } std::string g...
TOOL
0.914859
6.122491
{ "github_metadata": { "branch": "master", "commit_count": 341, "repo_created_at": "2016-06-24T14:46:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 19 }, "file_meta": { "content_id": "9695a1e...
83c5a5c8-d59d-4658-aa30-4025734b387b
chohan/Test
C/arch/interval_map.cpp
// compile: g++ -g -w -o interval_map interval_map.cpp --std=c++17 -lpthread // platform: g++ (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 // run: ./interval_map #include <iostream> #include <sstream> #include <fstream> #include <string> #include <algorithm> #include <optional> #include <iterator> #include <map> #include <limi...
ALGO
0.978536
5.881814
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2019-07-02T19:51:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "da3b29055e...
8b3082bb-e942-4428-8c34-4418dd5137a1
aartic88/msl
examples/leetcode/dfs_bfs/course_schedule.cpp
#include <gtest/gtest.h> #include <iostream> #include <vector> using namespace std; /* bool canFinish(int n, vector<vector<int>> &prerequisites){ vector<vector<int>> G(n); int time = 0; vector<int> degree(n, 0), bfs; for (auto &e : prerequisites){ int e_second = e[1], e_first = e[0]; ...
ALGO
0.997418
6.495087
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2020-06-18T07:36: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": "fc0b1e3d4...
aa140f05-f19a-466e-a484-d85a0129c6eb
fury699/Hello
heap_sort.cpp
#include <iostream> #include <vector> using namespace std; // Function to heapify a subtree rooted at index i void heapify(vector<int>& arr, int n, int i, int& comparisons) { int largest = i; // Initialize largest as root int left = 2 * i + 1; // left = 2*i + 1 int right = 2 * i + 2; // right = 2*i + 2...
ALGO
0.99999
5.840766
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-05-17T17:04: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": "f2e15abc4ef5...
b477b529-02f1-4f86-b6d8-e6c15afd1032
cmr1357/Arduino-Projects
Pedometer.ino
//Pedometer #include <LiquidCrystal.h> #define sq(x) ((x)*(x)) const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); const int xpin = A1; const int ypin = A2; const int zpin = A3; float threshold = 5; float xval[100] = {0}; float yval[100] = {0}; float zval[100] = {0...
ALGO
0.953433
3.522012
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2022-05-01T12:15: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": "59c28f4e54f6...
18199732-fad9-4e44-aeed-c1308d4ab138
Tkaa1731/ALG_project
main.cpp
/** * @mainpage Algorithm for random maze generation * @authors <NAME> (<EMAIL>) * @section Labyrinth * <p>This is a documentation of project to subject Algorithms I. The assigned of project was to write a program that generate maze by using DFS (Depth First Search) algorithm.</p></br> * You can find the generated ...
ALGO
0.991607
4.846734
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-04-16T21:36: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": "aa604ec203b5...
651d98ee-ad6b-4cfa-993f-2c533c6bf9a4
TZY-H/RTPP
CDRT2/lib/CDRT/CDRTmapcd.cpp
#include "CDRT.h" #include <math.h> #include <list> void BImap::FindConcave(const BIpolygons &polygons, std::set<BIangle> &ConcaveSet) { for (int list_i = 0; list_i < polygons.size(); list_i++) { const std::vector<BIpoint> &subpolygons = polygons[list_i]; int n = subpolygons.size(); fo...
ALGO
0.999789
3.233483
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-06-17T07:53:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9513e21e5d0e...
3c0e18bf-1785-44ad-8d0c-beca500db6bc
cindy-cho/Problem-Solving
Baekjoon/2021년/2021 상반기/5월/5월5일/1013_Contact.cpp
#include<iostream> #include<string> using namespace std; int flag; void testString(string p){ // cout << "input String : " << p << endl; if(flag==-1) return; int len=p.length(); if(len==0) return; if(len==1){ flag = -1; return; } if(len>=2){ if(p.substr(0,2)=="01"){...
ALGO
0.999791
4.244133
{ "github_metadata": { "branch": "main", "commit_count": 109, "repo_created_at": "2021-04-09T08:11: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": "36c9a29ab8...
3b48c00c-c38e-4640-9ac1-c35decebce86
iamakshatjain/Data-Structures-and-Algorithms
Algorithms/selection/kSmallestIntegers/ksi.cpp
//AC #include<bits/stdc++.h> #include<iostream> using namespace std; void printElements(int arr[], int l, int r){ for(int i = 0; i <= r; i++){ cout<<arr[i]<<' '; } cout<<endl; } void display(int arr[], int l, int r){ for(int i = l; i <= r; i++){ cout<<arr[i]<<' '; } cout<<endl; } void swap(int *a, int* b){...
ALGO
0.999994
5.189193
{ "github_metadata": { "branch": "master", "commit_count": 50, "repo_created_at": "2019-06-06T09:48: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": "57ca9d5f4...
5cc383a8-0b12-43c6-931f-deef0fc208d9
StevenLicc/buzzer-tunes
buzzer_tunes/buzzer_tunes.ino
/* * Music Player * * 6/26/2020 * <NAME> */ int GLED = 7; int nB0 = 31; int nC1 = 33; int nCS1 = 35; int nD1 = 37; int nDS1 = 39; int nE1 = 41; int nF1 = 44; int nFS1 = 46; int nG1 = 49; int nGS1 = 52; int nA1 = 55; int nAS1 = 58; int nB1 = 62; int nC2 = 65; int nCS2 = 69; int nD2 = 73; int nDS2 = 78;...
CONFIG
0.952104
4.659415
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2020-06-28T23:41:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a34dd5ab23...
3a94c81b-1dd7-4d48-a24b-f99f67f915d0
maxim092001/Itmo-University
algorithms/segment-tree/A/main.cpp
#pragma comment(linker, "/stack:200000000") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize("no-stack-protector") #pragma GCC optimize("fast-math") #include <iostream> #include <set> #include <map> #i...
ALGO
0.99983
3.764295
{ "github_metadata": { "branch": "master", "commit_count": 407, "repo_created_at": "2019-12-17T12:27:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 28, "forks": 2, "issues": 0, "pull_requests": 6 }, "file_meta": { "content_id": "9f25d58...
904006bc-6333-4bf9-b2f7-15c33b3bbe23
ishandutta2007/codeforces-a
azberjibiou/normal/1666/L.cpp
#include <iostream> #include <algorithm> #include <vector> #include <queue> using namespace std; vector<int> v[200009], st, ans[2]; vector<pair<int, int> > rv[200009]; int gn[200009], cn[200009], pn[200009], cc = 0, gc = 0; bool sf[200009], vs[200009]; int dfs(int n) { cc++; cn[n] = cc; st.push_back(n); ...
ALGO
0.999883
3.851453
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-11T00:51:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6647354ae3df...
a20c3696-ff4b-4804-b94b-79d94a81db5e
RiceReallyGood/LeetCode_Revise
401-500/424_Longest_Repeating_Character_Replacement.h
#include <string> #include <vector> using namespace std; class Solution { public: int characterReplacement(string s, int k) { int res = 0; MaxIndexHeap counts(26); for(int i = 0, j = 0; j < s.length(); j++){ counts.increase(s[j] - 'A', 1); while(counts.top() + k < j ...
ALGO
0.999916
5.881827
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2020-12-03T06: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": "0a29c3e652...
68e80ab7-eb8f-4084-b945-ff70f7f0020d
anuragji111/cpp-solutions-leetcode-top-150
surrounded_regions.cpp
**Surrounded Regions** Problem Statement 90) Given an m x n matrix board containing 'X' and 'O', capture all regions that are 4-directionally surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in that surrounded region. Example 1: Input: board = [["X","X","X","X"],["X","O","O","X"],["X","X",...
ALGO
0.999876
7.750865
{ "github_metadata": { "branch": "main", "commit_count": 157, "repo_created_at": "2024-01-03T13:11: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": "8e55a76588...
7d2bfad7-2e4e-4bbf-937a-49adad7c7987
mh-rahman/Programming-Practice
hr_minheap_Jessie_Cookie.cpp
#include <bits/stdc++.h> using namespace std; vector<string> split_string(string); struct minHeap{ int capacity; int heapSize=-1; int *harr; minHeap(int x){ capacity=x; heapSize=0; harr=new int[x]; } //Functions int parent (int x){ return (x-1)/2; }...
ALGO
0.999847
3.863667
{ "github_metadata": { "branch": "master", "commit_count": 318, "repo_created_at": "2019-11-04T23:13:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "57675738...
39547deb-9297-4bcd-b9e7-c12fc61252df
Durgesh2000/CPP-lang
Constant5.cpp
#include<iostream> using namespace std; class Demo { public: int i; const int j; // constant characteristics // Parametrised constructor with DEFAULT values Demo(int x = 10, int y = 20) : j(y) { i = x; } void fun() { int...
TOOL
0.910016
4.945721
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-12-01T17:49:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e87d5ef11c5b...
92baf28c-b0ca-420f-a6ca-e53755204735
kgoel9899/CF_Solutions
codeforces/1989/B.cpp
#include<bits/stdc++.h> using namespace std; #define MOD 1000000007 #define mod 998244353 #define int long long #define setpres cout << fixed << setprecision(10) #define all(x) (x).begin(), (x).end() #define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define endl "\n" const int INF = 1e18; #ifdef DEBUG #de...
ALGO
0.999974
5.113883
{ "github_metadata": { "branch": "master", "commit_count": 1962, "repo_created_at": "2020-12-21T08:58:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6e14761...
91233291-0889-4734-846c-5884f27ba9ce
KevinMuyaoGuo/PAT_levelB
1034.cpp
/* * 本题要求编写程序,计算 2 个有理数的和、差、积、商。 输入格式: 输入在一行中按照 a1/b1 a2/b2 的格式给出两个分数形式的有理数,其中分子和分母全是整型范围内的整数,负号只可能出现在分子前,分母不为 0。 输出格式: 分别在 4 行中按照 有理数1 运算符 有理数2 = 结果 的格式顺序输出 2 个有理数的和、差、积、商。注意输出的每个有理数必须是该有理数的最简形式 k a/b,其中 k 是整数部分,a/b 是最简分数部分;若为负数,则须加括号;若除法分母为 0,则输出 Inf。题目保证正确的输出中没有超过整型范围的整数。 输入样例 1: 2/3 -4/2 输出样例 1: 2/3 + (-2) = (-...
ALGO
0.998959
4.559701
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-08-08T11:02:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "544cc00f96...
80740077-1d55-44a7-9eb8-d79f4c8183fc
anda-g/cpp-sll-pointer-demo
singly_method.cpp
#include <stdlib.h> #include <iostream> #include <conio.h> #include <unistd.h> #include <fstream> using namespace std; /** * Royal University of Phnom Penh * Department of Information Technology * Major: Computer Science (Year 2, Generation 27) * * Homework: Linked List with Pointer * * Team Members: * ...
ALGO
0.9997
4.767668
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2025-05-24T06:55: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": "88f84c59f343...
d2c80ee1-ba0a-43e0-8ed5-3e47dce4acde
HowardChengUleth/Contest
adventofcode/2022/18a.cc
#include <bits/stdc++.h> using namespace std; int main() { // max input coord is 21 char comma; int X, Y, Z; bool A[22][22][22] = {false}; while (cin >> X >> comma >> Y >> comma >> Z) { A[X][Y][Z] = true; } int ans = 0; for (int x = 0; x <= 21; x++) { for (int y = 0; y <= 21; y++) { ...
ALGO
0.998165
4.042002
{ "github_metadata": { "branch": "master", "commit_count": 600, "repo_created_at": "2020-05-11T16:38:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2c4914e8...
19f4ebb5-b749-4d8b-b7b7-5436ab6dcd7a
kristevalex/PhysicsOfStick
vec.h
double atan_ (double x, double y) { if (x == 0) x = 0.00001; double returned = atan(y/x); if (x < 0) returned += M_PI; return returned; } inline double sqr (double val) { return val*val; } class vec { public: double x, y; double k, l; vec () noexcept = default;...
TOOL
0.927119
4.658059
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2018-05-26T16:34:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5dc931aff1...
375eacd7-ff84-488d-a29e-df8bcdc970a7
IgnaCat/codeforces
tc2023/contest1/H.cpp
#include <bits/stdc++.h> #define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0) #define pb push_back #define forn(a,b,c) for(unsigned int a=b; a<c;++a) #define show(a) cout<<a<<"\n" #define showAll(a) for(auto i:a) cout<<i<<" ";cout<<"\n" #define input(a) for(auto& i:a) cin>>i #define all(a) a.begin(),a.end() #defi...
ALGO
0.999932
3.618207
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-07-29T15:29: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": "3292bc244c91...
884747b8-20be-4f2e-9a7f-9f146abc6583
ryotaro612/at_c
src/abc183/e.cc
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll MOD = 1000000007ll; vector<vector<ll>> dp, acc_w, acc_h, acc_d; int H, W; void trav(int i, int j, vector<vector<char>> &s) { if(dp[i][j] != -1) return; if(s[i][j] == '#') { dp[i][j] = acc_w[i][j] = acc_h[i][j] = acc_d[...
ALGO
0.999796
4.39345
{ "github_metadata": { "branch": "master", "commit_count": 2006, "repo_created_at": "2019-07-01T03:51: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": "1868ba7...
61e11cd1-45c8-422a-a0e2-4e956e5c2acd
obleevious/leetcode
692TopKFreqentWords.cpp
// priority queue // how to overload for object pointer queue // compare string alphabetical: // https://stackoverflow.com/questions/15212820/do-and-on-c-strings-reflect-alphabetical-ordering class Item { public: string name; int times; Item(string na, int ti): name(na), times(ti) {} }; struc...
ALGO
0.999983
6.486195
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2017-08-31T22:42: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": "ed1bb4008...
5af0f6e2-1f58-4111-aca6-0f0a1ccc91db
webalorn/mc_maxsat
src/mc.cpp
#include <iostream> #include <algorithm> #include <cassert> #include "mc.hpp" using namespace std; /* Settings */ MCSettings::MCSettings(){ seed = 0; // Actions from nodes (MCTS, NMCS) nodeNActionVars = 2; nodeActionVarsHeuristic = 3; nodeActionHeuristicDynamic = false; // Rollout heur...
ALGO
0.999984
6.014002
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2023-03-04T13:26: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": "2a8e34c9b15...
b4915166-aab0-4131-9f95-d70fdc68e1c3
JohnItoo/Solvay
codeforces/rounds/CF-279B.cpp
// Problem: B. Books // Contest: Codeforces - Codeforces Round #171 (Div. 2) // URL: https://codeforces.com/problemset/problem/279/B // Memory Limit: 256 MB // Time Limit: 2000 ms // // Powered by CP Editor (https://cpeditor.org) //============================================================================ // Name ...
ALGO
0.999983
4.291413
{ "github_metadata": { "branch": "master", "commit_count": 1463, "repo_created_at": "2019-05-24T08:33:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4a25703...
13638227-af16-4782-848c-e95468595d1a
bgrzesik/sem1-2019-wdi
zestaw6/3.cpp
#include <iostream> // // Created by <NAME> on 18/11/2019. // /* 1. Dany jest zestaw odważników int t[N]. Napisać funkcję, która sprawdza czy jest możliwe odważenie określonej masy. Odważniki można umieszczać tylko na jednej szalce. 2. Poprzednie zadanie, odważniki można umieszczać na obu szalkach. 3. Poprzed...
ALGO
0.998832
4.263491
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2019-10-25T08:40: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": "eb937231e...
7b787eb5-e3f0-4566-a4bc-d7bde8523950
kacey0416/algorithm
dongmin/032-인구 이동/main.cpp
#include <iostream> #include <vector> #include <cmath> #include <queue> using namespace std; struct Pos { int r, c; }; int N, L, R; vector<vector<int> > populations; const int DIR[4][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}}; void solve() { int total_moves = 0; int unit_moves = -1; while (unit_moves != 0) { ...
ALGO
0.999956
3.882693
{ "github_metadata": { "branch": "main", "commit_count": 206, "repo_created_at": "2021-01-02T04:05:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 10, "pull_requests": 0 }, "file_meta": { "content_id": "ced2fd1fa...
c70f6754-c644-43dd-8afd-290a916480f1
Meron3r/Cp-Solutions-Vim
Problemset/385B.cpp
#include <bits/stdc++.h> using namespace std; #define debug cout << "I was here!" << '\n' #define all(a) a.begin(), a.end() typedef unsigned u; typedef long long ll; void solve() { string s; cin >> s; int n2 = s.size(), sum = 0, n = 0; for (int i = 0; i < n2; i++) { if (s[i] == 'b' && s[i ...
ALGO
0.995487
3.657678
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2024-09-16T11:11: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": "f9a50c669...
b453a987-39ce-42dc-895c-e07b7d74f0f3
ishandutta2007/codeforces-a
akulyat/normal/1086/A.cpp
#include <bits/stdc++.h> using namespace std; #define F first #define S second typedef long long ll; typedef long double ld; typedef pair <ll, ll> pll; ifstream in; ofstream out; const long long kk=1000; const long long ml=kk*kk; const long long mod=ml*kk+7; const long long inf=ml*ml*ml+7; ll n,i,j; vector <ll>...
ALGO
0.999788
3.216267
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-11T00:51:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0335f2cf608b...
73386a18-4925-4257-9370-a8070f0efbae
avcopan/MPACK
mlapack/library/Cpotf2.cpp
/* * Copyright (c) 2008-2010 * <NAME> * All rights reserved. * * $Id: Cpotf2.cpp,v 1.12 2010/08/07 04:48:32 nakatamaho Exp $ * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions o...
ALGO
0.999628
5.157961
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2019-12-18T18:49:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5654beee8...
a1987499-6ffb-48f8-b3b7-ce5ccfb33ad7
Gnnng/SVDFeature
solvers/gbrt/apex_gbrt.h
/* * Copyright 2011-2012 APEX Data & Knowledge Management Lab, Shanghai Jiao Tong University * * 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...
ALGO
0.935768
6.292958
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2014-05-14T04:43:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 82, "forks": 33, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3c3bad1...
95472172-fa40-43c5-bde2-5fe44e74d9d5
TheTensorGeek/EE5011-Computer-Methods-
COMPUTER METHODS CODE/polintdevc.cpp
#include<stdio.h> #include<conio.h> #include <math.h> #include "nrutil.h" int polint(float xa[], float ya[], int n, float x, float y, float dy) /*Given arrays xa[1..n] and ya[1..n], and given a value x, this routine returns a value y, and an error estimate dy. If P(x) is the polynomial of degree N - 1 such that P(xai) ...
ALGO
0.999904
4.171807
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-08-13T15:04: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": "20b95ec66921...
d7c033d4-968b-4925-9183-b384ec801cdf
frooms/stira
stira/common/common/Random.h
// RandomNumbers.h: Definition and Implementation of Random Number Distribution Class // Ref: <NAME>, "Computer Generation of Statistical // Distributions," ARL-TR-2168, US Army Research Laboratory, // Aberdeen Proving Ground, MD, 21005-5068, March 2000. // // http...
ALGO
0.975279
3.751636
{ "github_metadata": { "branch": "master", "commit_count": 292, "repo_created_at": "2015-04-27T19:28:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bda8935...
ba089de2-2397-4318-9e6a-3225f8158914
geometryprocessing/voroffset
src/vor3d/MorphologyOperators.cpp
#include"vor3d/MorphologyOperators.h" using namespace voroffset3d; #ifndef MIN_SEG_SIZE #define MIN_SEG_SIZE 1e-10 #endif namespace voroffset3d { // Appends segment [a,b] to the given sorted line // Assume that inserted segment is larger than all of the segments in the segments vector void appendSegment(std::ve...
ALGO
0.998495
4.6269
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2019-04-02T18:24:58.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 41, "forks": 15, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7504c96d...
3875dc58-de97-49bb-b571-63354812c377
ryanjob42/Super-EGO-Speedup
Util.cpp
//Copyright (c) 2013, <NAME>. All rights reserved. //This copyright notice should remain at the top of this file. // #include <stdio.h> #include <math.h> #include <stdlib.h> #include <time.h> #include <unistd.h> #if defined(IMPROVE4) || defined(IMPROVE5) #include <immintrin.h> #endif #include "Point.hpp" //#includ...
ALGO
0.990435
3.750047
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2023-10-28T15:57: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": "789d17844f5...
4eb7872d-84d0-4d7b-a5b1-c549b74020b1
AdityaMahaddalkar/LP1
HPC3/bubble_sort.cpp
#include <omp.h> #include <stdio.h> #include <iostream> #include <ctime> #include <stdlib.h> #include <algorithm> #define SIZE 1000 using namespace std; void bubblesort(int *a){ for(int i = 0;i < SIZE;i ++){ bool stop = true; for(int j = 0;j < SIZE-1;j ++){ if( a[j] > a[j+1] ){ swap(a[j], a[j+1]); ...
ALGO
0.999729
4.604338
{ "github_metadata": { "branch": "master", "commit_count": 43, "repo_created_at": "2019-06-15T03:51:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "967328556...
54f8b328-dd15-4e95-a2dd-a82f809a42c4
nishanthsri007/99004442_Intermediatecpp
Assignments/STL/1_pairs.cpp
#include <bits/stdc++.h> #include <iostream> #include <utility> using namespace std; void printPairs(int arr[], int arr_size, int sum) { unordered_set<int> s; for (int i = 0; i < arr_size; i++) { int temp = sum - arr[i]; if (s.find(temp) != s.end()) cout << "Pair with given s...
ALGO
0.999752
4.765388
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2021-07-13T08:03: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": "f615b407f1f6...
069a2239-1e19-427c-a127-aee4e6a0a6b5
eagletmt/procon
poj/3/3314.cc
#include <iostream> #include <vector> #include <queue> #include <deque> using namespace std; int main() { int n, w, b; while (cin >> n >> w >> b && n != 0) { vector<deque<string> > blocks; deque<string> block; for (int i = 0; i < n; i++) { int h; cin >> h; vector<string> plaque(h); ...
ALGO
0.999055
3.289377
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2014-04-13T04:02:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c27c68df5...
f42fee5e-a89f-436b-9f7b-e0b38245aeda
aksenoff/leetcode-challenge-2020
july-07-island-perimeter.cpp
// https://leetcode.com/problems/island-perimeter/ class Solution { public: int islandPerimeter(vector<vector<int>>& grid) { int m = grid.size(); if (!m) return 0; int n = grid[0].size(); if (!n) return 0; int result = 0; for (int i = 0; i < m; ++i) { ...
ALGO
0.999812
5.977976
{ "github_metadata": { "branch": "master", "commit_count": 86, "repo_created_at": "2020-04-15T14:58: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": "41547342e...
734d7472-87cd-48eb-bcb0-6080c0324a80
rajuahmed118124r/Data-Structure
Data Structure/Exam/Assignment/lab assignment/infix to postfix.cpp
#include <iostream> #include <stack> #include <string> using namespace std; int priority(char op) { if (op == '^') return 3; else if (op == '*' || op == '/') return 2; else if (op == '+' || op == '-') return 1; else return -1; } string infix_To_Postfix(string exp) { ...
ALGO
0.999844
4.881574
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-01-25T14:23:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "46758b11fcf4...
508ee165-0b6b-4360-b499-de3bc0f5d347
Divyanshu9794/GFG_POTD
Difficulty: Medium/Find the number of islands/find-the-number-of-islands.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // class Solution { // public: // // Function to find the number of islands. // int numIslands(vector<vector<char>>& grid) { // // Code here // } // }; class Solution { public: // Function to find ...
ALGO
0.999788
6.717963
{ "github_metadata": { "branch": "main", "commit_count": 1538, "repo_created_at": "2023-04-22T04:24:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e5ad55807...
0010f67f-90c9-4f41-b609-fc2e24a72bb6
zf-w/mini_problem_collection_before_y2023m11
Leetcode/Leetcode.336.palindrome-pairs/Leetcode.336.palindrome-pairs.cpp
/* * @lc app=leetcode id=336 lang=cpp * * [336] Palindrome Pairs * * https://leetcode.com/problems/palindrome-pairs/description/ * * algorithms * Hard (35.31%) * Likes: 2929 * Dislikes: 284 * Total Accepted: 154.1K * Total Submissions: 438.5K * Testcase Example: '["abcd","dcba","lls","s","sssll"]' ...
ALGO
0.99948
6.480015
{ "github_metadata": { "branch": "main", "commit_count": 233, "repo_created_at": "2022-06-30T00: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": "2d01fd9507...
5b0606ff-7312-48ea-ba7b-09aac6792601
Godhuli11/My-LeetCode-questions
0378-kth-smallest-element-in-a-sorted-matrix/0378-kth-smallest-element-in-a-sorted-matrix.cpp
class Solution { public: // Function to count elements <= val in a single row using binary search int bsRows(vector<int>& row, int val) { int n = row.size(); int low = 0; int high = n - 1; int cnt = 0; while (low <= high) { int mid = (low + high) / 2;...
ALGO
0.999995
6.398824
{ "github_metadata": { "branch": "main", "commit_count": 856, "repo_created_at": "2023-07-30T10:02: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": "d8f6f71951...
faca65a4-cb6f-4304-a113-1ed2cd63d73c
CloudCompare/CloudCompare
plugins/core/Standard/qRANSAC_SD/extern/RANSAC_SD/LowStretchSphereParametrization.h
#ifndef LOWSTRETCHSPHEREPARAMETRIZATION_HEADER #define LOWSTRETCHSPHEREPARAMETRIZATION_HEADER #include "Sphere.h" #include "basic.h" #include <GfxTL/VectorXD.h> #include <GfxTL/Frame.h> #include <GfxTL/MathHelper.h> #include <GfxTL/AABox.h> #include <utility> #include <MiscLib/Vector.h> class LowStretchSphereParametri...
ALGO
0.995438
6.880135
{ "github_metadata": { "branch": "master", "commit_count": 5089, "repo_created_at": "2012-11-06T20:15:51.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4019, "forks": 1100, "issues": 256, "pull_requests": 4 }, "file_meta": { "content_id": "...
66026ed6-8b79-4a8f-88ab-4c1a3bb4e59d
caputdraconis050630/algorithm
baek/baek_10866.cpp
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(0); int N; cin >> N; deque<int> deq; for (int i = 0; i < N; i++) { string op; cin >> op; if (op == "push_front") { int tmp; cin >> tmp; ...
ALGO
0.996679
4.564532
{ "github_metadata": { "branch": "master", "commit_count": 316, "repo_created_at": "2021-07-07T20:48: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": "e65e5be0...
c2d5d77b-fb4c-4708-be4c-33a1992e4ba4
TobiasFaller/NCIP
deps/minicraig/minisat/mtl/Aig.cc
#include "./Aig.h" #include <map> #include <set> #include <stack> #include "../core/SolverTypes.h" using namespace MiniCraig; AigEdge Aig::createVar(const Var& variable) { // Try to check if there is a node for the literal already if (auto it = varHashMap.find(toInt(variable)); it != varHashMap.end()) { ...
ALGO
0.994368
5.903593
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-03-21T12:20:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3dc0350cafb8...
4f29745e-0d8a-43c9-9907-21b6406d03a0
satoooh/procon
AOJ/ITP1/ITP1_6/B.cpp
#include <bits/stdc++.h> #include <tuple> using namespace std; typedef long long ll; #define rep(i, a, b) for (int i=(int)a; i<(int)b; i++) int main() { // initialize vector< pair<char, int> > cards; rep(i, 1, 13+1) { pair<char, int> p('S', i); cards.push_back(p); } rep(i, 1, 13+1) { pair<char,...
ALGO
0.996841
3.309189
{ "github_metadata": { "branch": "master", "commit_count": 252, "repo_created_at": "2019-07-01T06:35:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "47595d80...
3a0ca7a1-9417-4e0b-bf41-0928f6eb7034
RyanL123/Competitive-Programming
USACO/usaco19decgoldp1.cpp
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; typedef vector<pair<int, int>> vii; typedef vector<int> vi; typedef long long ll; typedef unsigned long long ull; #define pb(x) push_back(x) #define mp(a, b) make_pair(a, b) #define inf 0x3f3f3f3f vector<pair<int, pii>> adj[1010]; int n, m; int...
ALGO
0.999898
3.615862
{ "github_metadata": { "branch": "master", "commit_count": 616, "repo_created_at": "2019-04-09T21:00:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5980e36f...
5cdfb00e-19aa-46fc-9177-e51ed33d2248
magicmoo/codeforces
ProblemSet/1475G.cpp
#include<cstdio> #include<cstring> #include<algorithm> #include<iostream> #include<string> #include<vector> #include<stack> #include<bitset> #include<cstdlib> #include<cmath> #include<set> #include<list> #include<deque> #include<map> #include<queue> using namespace std; typedef long long ll; const double PI = acos(-1.0...
ALGO
0.999779
3.578635
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2021-09-06T08:07: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": "89e5d0ac5...
44017a72-5c30-4f8e-a467-c5678c211b9b
somandra/Algorithm-ToolBox
week2/8_last_digit_of_the_sum_of_squares_of_fibonacci_numbers/fibonacci_sum_squares.cpp
#include <iostream> int fibonacci_sum_squares_naive(long long n) { if (n <= 1) return n; long long previous = 0; long long current = 1; long long sum = 1; for (long long i = 0; i < n - 1; ++i) { long long tmp_previous = previous; previous = current; current =...
ALGO
0.999486
3.628945
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2020-08-02T06:14: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": "2e439dceb...
40b542d3-32ed-44bc-8b8f-fa065b039cd1
JonathanCLo/alpha
execute.cpp
/** * execute.cpp * * Author <NAME> < > * Contributor: <NAME> */ #include "includes.h" #include "hazards.h" char pc1value_ex [16]; char opc1value_ex [16]; char ra1value_ex [16]; char rb1value_ex [16]; char rc1value_ex [16]; char lit1value_ex [16]; char disp1value_ex [16]; char opc2value_ex [16]; char addr2value...
TOOL
0.918697
4.777346
{ "github_metadata": { "branch": "master", "commit_count": 178, "repo_created_at": "2017-03-31T14:42: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": "bd18d5ab...
23fbaeb1-e810-4b4f-b6ed-d8bd50b9357c
chefxxx/triangular-solitaire
src/genetic/gen_alg_main.cpp
// // Created by <NAME> on 30/03/2025. // #include <fstream> #include <iostream> #include <ostream> #include <string> #include <vector> #include "chromosome.h" #include "distance_to_center.h" #include "eval.h" #include "heuristic.h" #include "isolated_pegs.h" #include "number_of_free_positions.h" #include "number_of_...
ALGO
0.99856
5.960313
{ "github_metadata": { "branch": "main", "commit_count": 103, "repo_created_at": "2025-03-25T12:23: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": "b36db30c02...
c089911c-2621-4833-8aa6-a242e90a3b04
seaside-play/technical-summary
algorithm/basic/data_structure/tree/55.cc
#include <iostream> #include "tree.h" unsigned GetBinaryTreeDepth(BinaryTreeNode *pNode) { if (pNode == nullptr) return 0; int depLeft = 1 + GetBinaryTreeDepth(pNode->left); int depRight = 1 + GetBinaryTreeDepth(pNode->right); return depLeft > depRight ? depLeft : depRight; } bool IsBalanceBinaryTree(...
ALGO
0.999265
5.10439
{ "github_metadata": { "branch": "master", "commit_count": 75, "repo_created_at": "2021-08-04T09:56: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": "9b4b16558...
40990fe1-c7da-4e8a-b09a-25e76fef0d64
hyj1204/algorithm_Geek
1.two-sum.cpp
/* * @lc app=leetcode id=1 lang=cpp * * [1] Two Sum */ // @lc code=start // way 1: brute force // class Solution { // public: // vector<int> twoSum(vector<int>& nums, int target) { // vector<int> results; // for (int i = 0; i < nums.size() - 1; i++) // { // for (int j =...
ALGO
0.999941
5.760911
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2020-06-21T19:32: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": "c313c6113...
5e9e99ec-442c-4821-bd1d-f8bcbcdae87d
mjan1997/SPD_2019_PN_19_janiszewski
SPD1.cpp
#include <string> #include <fstream> #include <iostream> using namespace std; int main() { int liczba_taskow; int liczba_maszyn; ifstream file("dane.txt", std::ifstream::in); file >> liczba_taskow; file >> liczba_maszyn; //liczba_taskow = 20; //liczba_maszyn = 5; /* std::cout << "liczba zadan : " << liczba_taskow<<std...
ALGO
0.998295
3.7352
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2019-03-02T13:51:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c9dd4af19...
0b15046b-1ab4-4d03-aaa9-f24c9cd0cbab
liuyubobobo/Play-Leetcode
2501-3000/2539-Count-the-Number-of-Good-Subsequences/cpp-2539/main.cpp
/// Source : https://leetcode.com/problems/count-the-number-of-good-subsequences/description/ /// Author : liuyubobobo /// Time : 2023-01-19 #include <iostream> #include <vector> #include <algorithm> #include <numeric> using namespace std; /// Math /// Time Complexity: O(n) /// Space Complexity: O(maxn) class Sol...
ALGO
0.999978
5.622855
{ "github_metadata": { "branch": "master", "commit_count": 2592, "repo_created_at": "2016-12-01T17:08:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2732, "forks": 718, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "d2...
f96dd1cf-ff80-40d9-940e-55b554aaa464
apache/trafficserver
lib/swoc/src/RBTree.cc
// SPDX-License-Identifier: Apache-2.0 // Copyright Apache Software Foundation 2019 /** @file Red/Black tree implementation. */ #include "swoc/RBTree.h" #include <iostream> namespace swoc { inline namespace SWOC_VERSION_NS { namespace detail { // These equality operators are only used in this file. /// Equality...
ALGO
0.95701
5.880239
{ "github_metadata": { "branch": "master", "commit_count": 16378, "repo_created_at": "2009-10-31T08:00:10.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1882, "forks": 829, "issues": 409, "pull_requests": 26 }, "file_meta": { "content_id": ...
dea31f97-0618-40f0-ab7a-ad2d1bc10ae9
SNbappy/CP-Vault
D_Place_of_the_Olympiad.cpp
/* بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيْمِ Author: Depressed_C0der Created: 2025-03-25 21:16:07 */ #include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; #define ll long long #define tst \ int t; \ cin >> t; \ while (t--) #define el '\n' #def...
ALGO
0.999988
3.937724
{ "github_metadata": { "branch": "main", "commit_count": 223, "repo_created_at": "2025-02-09T15:36: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": "bfe01f8758...
d043a105-95ca-4bbe-b79f-3b5775cf2dd8
Dedoff1/University
Labs/2 kurs/1 semestr/KPO/zadachiKrota-main/1/main.cc
#include <cstdio> #include <cstdlib> #define BUFFER_CAPACITY 256 #define NUM_BUFFER_CAPACITY 64 size_t skipSpaces(char *str, size_t start); int calcNumOfEntries(char *str, char *M); size_t getWordEnd(char *str, size_t start); char substrEquals(char *str, size_t from, size_t to, char *substr); int main() { char *st...
ALGO
0.999286
4.23996
{ "github_metadata": { "branch": "main", "commit_count": 314, "repo_created_at": "2025-02-17T23:06: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": "58e49284fe...
4a7a4ffd-c111-4cbd-8227-c9979e694d88
constcycle/cr0nus
structs/vector.h
#define CHECK_VALID( _v ) 0 #define Assert( _exp ) ((void)0) extern float(*pfSqrt)(float x); #define FastSqrt(x) (*pfSqrt)(x) #define PI 3.14159265358979323846f #define RAD2DEG( x ) ( ( float )( x ) * ( float )( 180.0f / ( float )( PI ) ) ) #define square( x ) ( x * x ) #define M_PI 3.14159265358979323846 #define D...
TOOL
0.909213
3.745957
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-10-07T20:01:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 8, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "d08c456028...
752b0fd0-229d-4cd0-8339-16c9aa226457
johan-bjareholt/cpp-playground
DV1549/Inlämningar/IA/Main.cpp
#include <iostream> #include <iomanip> #include <fstream> #include <sstream> #include <windows.h> #include "Snake.h" #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) using namespace std; // Size of the game area const int GRID_HEIGHT = 25; const int GRID_WIDTH = 40; // Frames per second const int FPS = 10; co...
TOOL
0.94493
6.026964
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2014-11-04T09:54: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": "9cc7c3be26...
ada9582a-f673-4687-835c-d3cc144c499f
SamBobBarnes/Everybody.Codes-24
Day2/Part2.cpp
// // Created by <NAME> on 11/11/24. // #include <bitset> #include <iostream> #include <vector> #include <cmath> #include "Day2.h" #define alert "\033[31;4m" #define info "\033[34m" #define underline "\003[4m" #define reset "\033[0m" int Day2::Part2() { // std::cout << std::endl; const std::string filePat...
ALGO
0.995797
4.976933
{ "github_metadata": { "branch": "main", "commit_count": 118, "repo_created_at": "2024-11-11T04:24: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": "c20d5003f7...
cb1e554f-1dc6-4ee3-b837-536656fb6777
YashSaroha/DSA---Love-Babbar
Phase 2/Linked Lists/1) Singly Linked List/4_insertAtTail.cpp
#include<iostream> using namespace std; class Node { public: int data; Node *next; Node(int data) { this -> data = data; this -> next = NULL; } }; // inserting a new node at the last void insertAtTail(Node* &tail, int d) { // new node is created first Node *temp = new Node...
ALGO
0.997609
5.199191
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-08-17T04:48: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": "90d4b8600a02...
3fdbb001-0834-4118-8e82-dfd3bb742f10
hwang131/BOJ
01000-09999/09000-09999/9328.cpp
// 9328 열쇠 // https://www.acmicpc.net/problem/9328 #include <iostream> #include <string> #include <queue> #include <utility> using namespace std; char map[102][102]; pair<int, int> door[26]; int T, height, width, document; int key_list, qsize; string s; queue<pair<int, int>> q, locked_door; void Search(int y, int x){...
ALGO
0.99974
4.355
{ "github_metadata": { "branch": "main", "commit_count": 53, "repo_created_at": "2021-07-04T10:37:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "117b7538182...
29335a62-bbb4-44c8-b487-012928f09f94
mfazen2/CS225_Coursework
mp_traversals/src/ImageTraversal.cpp
#include <cmath> #include <iterator> #include <iostream> #include "cs225/HSLAPixel.h" #include "cs225/PNG.h" #include "Point.h" #include "ImageTraversal.h" namespace Traversals { PNG ImageTraversal::getPNG(){return png_;} /** * Calculates a metric for the difference between two pixels, used to * calculate if...
ALGO
0.999294
4.924369
{ "github_metadata": { "branch": "main", "commit_count": 68, "repo_created_at": "2025-07-03T21:38: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": "3d8487b209c...
3df94976-725c-4736-9523-aaece3546fae
lemene/PECAT
src/assemble/contig_generator.hpp
/** * @brief generate contigs from assembly graph. * */ #pragma once #include <list> #include <vector> #include "../read_store.hpp" #include "asm_options.hpp" #include "string_graph.hpp" #include "phase/phase_info.hpp" #include "asm_dataset.hpp" namespace fsa { class ContigGenerator { public: struct Contig ...
ALGO
0.908459
3.269943
{ "github_metadata": { "branch": "main", "commit_count": 40, "repo_created_at": "2022-02-06T02:20:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 54, "forks": 2, "issues": 26, "pull_requests": 1 }, "file_meta": { "content_id": "5e5009b2f...
e0693401-2eec-4fce-ac79-6e63708155ab
tuantai1522/DSA-practice
Leetcode/300 Problems/Topics/Project1/Graph/DetectCycleinDirectedGraph.cpp
//https://practice.geeksforgeeks.org/problems/detect-cycle-in-a-directed-graph/1?utm_source=youtube&utm_medium=collab_striver_ytdescription&utm_campaign=detect-cycle-in-a-directed-graph #include<iostream> #include<vector> #include<cmath> #include <algorithm> #include <queue> using namespace std; bool dfs(int curNode, ...
ALGO
0.999889
5.147816
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2023-07-27T15:05: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": "919b26224...
75ec5f9c-dd95-4c73-ab1d-6e9de74ab2e8
kashee337/problems
abc184/b.cpp
#include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define pb push_back #define rep(i, n) for (int i = 0; i < (n); i++) #define reps(i, n, s) for (int i = (s); i < (n); i++) #define rrep(i, n) fo...
ALGO
0.999911
4.161259
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2021-09-29T10:37: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": "25e774224a...
03191176-fa2a-44b7-beba-4b271c78e0c4
saifur-shamim/Codeforces-Solution
Increase Subarray Sums 1644.cpp
///<NAME> ///Happy Coding #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long int li; typedef double dl; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef vector<pii>vpi; typedef vector<pll> vpl; #define PB push...
ALGO
0.99952
4.238745
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-02-28T00:46: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": "d52d0bb3ec60...
2ecf9cf3-f471-4cc9-98ec-cb322bb11c49
OpenSourceRisk/Engine
QuantExt/qle/models/eqbspiecewiseconstantparametrization.hpp
/* Copyright (C) 2016 Quaternion Risk Management Ltd All rights reserved. This file is part of ORE, a free-software/open-source library for transparent pricing and risk analysis - http://opensourcerisk.org ORE is free software: you can redistribute it and/or modify it under the terms of the Modified BSD License...
ALGO
0.903493
7.333558
{ "github_metadata": { "branch": "master", "commit_count": 24865, "repo_created_at": "2016-10-07T09:15:00.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 567, "forks": 245, "issues": 58, "pull_requests": 7 }, "file_meta": { "content_id": "39...
74c97744-2646-4b88-88f7-5ef2a663308b
ishandutta2007/codeforces-d
darkkcyan/normal/166/B.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; struct Point { ll x, y; bool side; }; ll cross(const Point& u, const Point& v) { return u.x * v.y - u.y * v.x; } Point operator-(const Point& u, const Point& v) { return {u.x - v.x, u.y - v.y, 0}; } vector<Point> one_side_hull(cons...
ALGO
0.999982
4.477679
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:31:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4ecd3c90b37d...
e0537686-6c28-447a-9cae-63fc2ad46b02
infertom/hiho
hiho/1158.cpp
/* #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <algorithm> using namespace std; typedef long long ll; const int MAXP = 500000 + 100; int prime[MAXP] = {0}; bool isPrime[MAXP]; int getPrime(int maxn) { int n = 0; int k = (int) sqrt(maxn + 0.5); memset(isPrime, true, sizeof(i...
ALGO
0.999796
4.275288
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2015-08-17T04:58: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": "37252d700...
0858bbf0-0267-4263-8aac-725fd33a7e66
Nau1994/CPP_Practice
DSA/countMinSwap.cpp
#include<bits/stdc++.h> // #include <iostream> // #include <vector> #include <unordered_set> using namespace std; #define int long long int int countMinSwap(vector<int> a){ int n=a.size(); pair<int,int> ap[n]; for (int i = 0; i < n; i++) { ap[i].first=a[i]; ap[i].second=i; } s...
ALGO
0.999955
4.202557
{ "github_metadata": { "branch": "main", "commit_count": 132, "repo_created_at": "2022-05-30T22:30:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cc66e681c5...
ae895743-2c0f-4aca-8135-765efd0b2b20
Mostafa-Moin26/LeetCode
3Sum.cpp
// Problem Link ----> https://leetcode.com/problems/3sum/description/ // Solutions ----> // Brute force // O(n^3) will get TLE class Solution { public: vector<vector<int>> threeSum(vector<int>& nums) { set<vector<int> > st; int n = nums.size(); for (int i = 0; i < n; i++) { ...
ALGO
0.999945
6.355068
{ "github_metadata": { "branch": "main", "commit_count": 94, "repo_created_at": "2024-07-14T04:48:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3001dadf9ad...
3ef5c0dd-1a78-41d5-bcd5-228f72a60ce3
alps-jbnu/23ALPStudy
2023-1/Basic/eunhyoha2/Linked List/5397 키로거.cpp
#include <iostream> #include <list> using namespace std; int main(void) { ios::sync_with_stdio(0); // 출력시간 도움 cin.tie(0); cout.tie(0); int T; list<char> I; list<char>::iterator t; //반복자 string L; // 문자열 cin >> T; // T 입력받기 for (int i = 0; i < T; i++) { cin >> L; I.clear(); t = I.begin(); for (int j =...
ALGO
0.999971
4.006465
{ "github_metadata": { "branch": "main", "commit_count": 2930, "repo_created_at": "2023-02-03T06:11:26.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 12, "forks": 59, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6d9b7a07...
5ea56bf4-4650-401e-9fa9-a549f8fd8263
keryell/loan_calculator
loan_calculator.cpp
/** \file Compute the cost of different loan combinations https://en.wikipedia.org/wiki/Amortization_calculator */ #include <cmath> #include <iostream> /** Display the loan for a yearly APR \param f amount to finance \param y yearly APR (annual percentage rate) */ void display_loan(double f, double y)...
ALGO
0.941397
5.039087
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2018-08-06T02:28:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "42a4ec53d1...
0357e517-a0a1-4442-8de5-296718498c71
meetgami510/Competitive-Programming
facebook/a1.cpp
#include<bits/stdc++.h> using namespace std; void pline(long long i) { cout<<"Case #"<<i<<":"<<" "; } int main() { long long t; cin>>t; long long i=1; while(t--) { pline(i++); // cout<<"\n"; long long n,k; cin>>n>>k; map<int,int> mp; vector<long...
ALGO
0.999965
3.819827
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-02-16T11:27: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": "c233eca72b4b...
a0c614d9-0597-40b9-a390-b833584b67cf
GopherTeen/template
Category/02_String/Trie/Trie.cpp
static constexpr int MX = 2E5 + 10; int trie[26][MX] {}; int cnt[MX] {}; int tot {}; bool isEnd[MX] {}; int f(char ch) { return ch - 'a'; } void insert(const string& s) { int p = 0; for (char ch : s) { int o = f(ch); if (!trie[o][p]) { trie[o][p] = ++tot; } p =...
ALGO
0.99955
4.418935
{ "github_metadata": { "branch": "master", "commit_count": 190, "repo_created_at": "2024-09-30T06:32:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0af0d5d1...
c35d6254-1530-45b2-901e-4991fd9f3c5d
mirabl/j
minimum-falling-path-sum.cpp
class Solution { public: int minFallingPathSum(vector<vector<int>>& A) { int N = A.size(); int INFTY = 1e8; vector<vector<int>> dp(N, vector<int>(N)); for (int row = N - 1; row >= 0; row--) { for (int col = 0; col < N; col++) { dp[row][col] = A[row][col]; ...
ALGO
0.999981
6.109432
{ "github_metadata": { "branch": "master", "commit_count": 904, "repo_created_at": "2016-12-26T13:22: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": "d095794a...