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 |
|---|---|---|---|---|---|---|---|
09392aef-4521-4f32-9496-5c3fb1d486d4 | kunyavskiy/competitive-programming-archive | ProblemArchives/timus/p1684.cpp | #ifndef LOCAL
#pragma comment(linker, "/STACK:33554432")
#endif
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <queue>
#include <memory.h>
#include <stack>
#define mp make_pa... | ALGO | 0.999926 | 3.080245 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2022-10-08T20:56:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ebc2280565... |
65d2bf44-8490-4600-8021-2114287f9429 | husk214/rpcvelb | problem2/lib/L2R_L2L_SVC.cpp | #include "L2R_L2L_SVC.h"
L2R_L2L_SVC::L2R_L2L_SVC(const std::string fileNameLibSVMFormat, const double c)
: X(), y(), z(), vI(), l(), n(), C(c) {
read_LibSVMdata1(fileNameLibSVMFormat.c_str(), X, y);
l = X.rows();
n = X.cols();
z = Eigen::VectorXd::Zero(l);
}
L2R_L2L_SVC::~L2R_L2L_SVC() {}
L2R_L2L_SVC *L... | DATA | 0.929906 | 5.545445 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-10-26T01:16: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": "3fdd94a5a4... |
41d83c6c-3b77-4c14-903f-b1d92c332633 | imran7955/Problem-Solving-on-different-OJ | Hackerrank/1 Contest/Inter Single Soul Programming Contest -2023/F All pair distance sum 2.cpp | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define up upper_bound
#define bs binary_search
#define fi first
#define sc second
#define all(x) x.begin(),x.end()
#define set0(x) memset(x,0,sizeof(x))
#define set1(x) memset(x,1,sizeof(x))
#define pii pair<int,int>
#define pll ... | ALGO | 0.999888 | 3.690336 | {
"github_metadata": {
"branch": "main",
"commit_count": 107,
"repo_created_at": "2023-02-17T16:53: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": "761a0f8dfc... |
b42ff612-6ea6-4791-b245-ea35ee81d8b3 | anzaika/guidance | libs/phylogeny/likeDist.h | // $Id: likeDist.h 9752 2011-08-05 20:27:25Z rubi $
#ifndef ___LIKE_DIST_H
#define ___LIKE_DIST_H
#include "definitions.h"
#include "countTableComponent.h"
#include "distanceMethod.h"
#include "stochasticProcess.h"
#include "logFile.h"
#include "jcDistance.h"
#include "unObservableData.h"
#include <cmath>
using names... | ALGO | 0.999044 | 5.593036 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-08-28T12:48:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 3,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "87bccfee... |
e03645da-566b-4928-9935-603bd11ab2a6 | sankantsu/competitive-programming | atcoder/abc243/e.cc | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
constexpr long inf = pow(10,12);
struct edge {
int from;
int to;
long cost;
};
template <typename Edges>
auto warshall_floyd(int n, const Edges &edges) {
vector<vector<long>> d(n,vector<long>(n,inf));
for (auto e : edges... | ALGO | 0.999737 | 4.555098 | {
"github_metadata": {
"branch": "master",
"commit_count": 161,
"repo_created_at": "2022-03-31T15:00:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2099b7a1... |
c1fa3ff1-5ae3-40ae-ac40-f4643b9b26c4 | ghaniiii/3rd-Semester-Dump | Data Structures LAB/Lab 9 AVL/22P_9037-AbdulGhaniKhan-Task1.cpp | #include<iostream>
#include<string.h>
using namespace std;
struct Node{
int info;
Node *left;
Node *right;
Node(){
left = NULL;
right = NULL;
}
Node(int number){
left = NULL;
right = NULL;
info = number;
}
};
class tree{
public:
Node *root;
Node *temp;
Node *temp1;
int number;
i... | ALGO | 0.999988 | 4.390779 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-12-28T14:57: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": "6141ce254fa5... |
51255b0e-4f9d-49f5-8593-588cfa43225b | Safin178/2nd-Semester | CP/Sheet#6_Reboot/J_Prime_Factors.cpp | // <NAME>
#include<bits/stdc++.h>
using namespace std;
//typedef data type define korae
typedef vector<int> vi;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define bismillah ios_base::sync_with_stdio(0);cin.tie(0);cou... | ALGO | 0.999709 | 4.217656 | {
"github_metadata": {
"branch": "main",
"commit_count": 119,
"repo_created_at": "2023-06-19T13: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": "a282619044... |
03ee323f-9eb1-4c2c-a348-0fb43e7fc15e | ShahjalalShohag/code-library | Number Theory/CRT.cpp | #include<bits/stdc++.h>
using namespace std;
using T = __int128;
// ax + by = __gcd(a, b)
// returns __gcd(a, b)
T extended_euclid(T a, T b, T &x, T &y) {
T xx = y = 0;
T yy = x = 1;
while (b) {
T q = a / b;
T t = b; b = a % b; a = t;
t = xx; xx = x - q * xx; x = t;
t = yy; yy = y - q * yy; y = t... | ALGO | 0.9999 | 4.600908 | {
"github_metadata": {
"branch": "main",
"commit_count": 952,
"repo_created_at": "2018-11-18T08:49:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3240,
"forks": 840,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b266... |
ea1b74ad-4c59-4bdf-a599-b3de95befd52 | bytendpixel/Leetcode-Solution | Odd Even Jump.cpp | class Solution {
public:
int oddEvenJumps(vector<int>& arr) {
int n = arr.size();
vector<int> next_greater(n,-1), next_smaller(n,-1);
stack<int>s;
vector<pair<int,int>>sortedPairs;
for(int i=0;i<arr.size();i++){
sortedPairs.push_back({arr[i],i});
}
... | ALGO | 0.999959 | 4.744645 | {
"github_metadata": {
"branch": "main",
"commit_count": 1011,
"repo_created_at": "2024-06-30T18:16: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": "de9923063... |
1337b8f9-0ff1-4671-8d65-af6bf4d26e12 | OliviaCheng99/FinalProject | FinalProject/src/GameFunctions.cpp | //
// GameFunctions.cpp
// FinalProject
//
// Created by <NAME> on 9/21/22.
//
#include "GameFunctions.hpp"
void Startgame(Gametable& table){
// Filling the game table with a frame of tiles.
for (int i = 0; i < table.Rows(); i++)
{
for (int j = 0; j < table.Columns(); j++)
{
... | ALGO | 0.951106 | 3.045193 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2022-09-20T17:00: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": "47598ea599c... |
a03df538-0bb3-48af-8f87-bb78741faeaa | sunqinxuan/plane_edge_shadow | src/motion_estimation/motion_estimation.cpp | /*==============================================
#
# Author: <NAME>
#
# Email: <EMAIL>
#
# Last modified: 2018-12-03 09:22
#
# Filename: motion_estimation.cpp
#
# Description:
#
===============================================*/
#include "motion_estimation.h"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui... | ALGO | 0.996372 | 5.141009 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-03-22T06:59: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": "827acb5034e3... |
a3cc7a72-94f4-4cc6-9517-ae066ff26315 | KrishnavKoganti/CSCI60 | HW/HW6/HW6P2Koganti.cpp | //Lab 6
#include <cmath>
#include <iostream>
using namespace std;
//pre: T1 needs to support ==, T2 must support <
//post:returns how many of find are in the array
template <typename T1, typename T2>
int count_exact(T1 a[], T2 size, T1 find){
int count = 0;
for(int i=0; i<size; i++){
if(a[i] == find){
... | ALGO | 0.986349 | 3.810284 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2021-10-03T18:47: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": "fcee7b15d79... |
686213be-08c5-4483-8f60-4be21458728e | krisszzzz/parallel-computation | conv_diff.cc |
#include <boost/hana.hpp>
#include <boost/mpi.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/type_index.hpp>
#include <cmath>
#include <matplot/matplot.h>
namespace conv_eq {
struct Ranges {
int x_steps;
int t_steps;
double x_max;
double t_max;
};
class SolverBase {
public:
using InitFunc =... | ALGO | 0.999884 | 6.066611 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-28T09:39: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": "9e9f2490f0e8... |
f92a9ce4-ea49-4bb9-93f4-bf8ce5a330c4 | theprakash97/Introduction-To-Cpp | thousand++programs/isIt3DigitsNumber.cpp | #include <iostream>
using namespace std;
// wap to take positive integer input and tell if it is a three digit number or not
/*
hints :
the samllest 3 digit number is : 100
the highest 3 digit number is : 999
so, any number lies on this range, that number is 3 digit number !
*/
int main(){
int n;... | ALGO | 0.995695 | 3.776506 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-11T14:09: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": "3d4634ba744e... |
105697ac-6b0f-403a-808f-df754daf3345 | Ullas02/Data-Structures-and-Algorithms-practice-using-Cpp | 12_book_allocation.cpp | #include <iostream>
#include <vector>
using namespace std;
bool isValid(vector<int> vec, int M, int N, int allowedPages)
{
int students = 1, pages = 0;
for (int i = 0; i < N; i++)
{
if (vec[i] > allowedPages)
{
return false;
}
if (vec[i] + pages <= allowedPages... | ALGO | 0.999997 | 5.128632 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-06-26T14:59: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": "a7e2c6803d11... |
fd221af9-f514-4f97-a5d5-16ee9d2d1eef | rokicki/apsp | toedgelist.cpp | /*
* Read graphs and calculate the diameter and average shortest
* path length.
*/
#include <iostream>
#include <cstdio>
#include <inttypes.h>
using namespace std ;
const int MAXBUF = 16000 ;
char mbuf[MAXBUF+1] ;
int n ;
const int MAXN = 128 ;
const int INF = MAXN ;
int adj[MAXN][MAXN] ;
int e ;
double goal = 0... | ALGO | 0.999035 | 3.864893 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2019-06-30T17:38: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": "853459914... |
27505d09-0491-4be3-9b63-e29d6a67d49c | durgeshpushpakar/LeetCode-Questions | Segment Tree/segment tree class(SUM).cpp | #include<bits/stdc++.h>
using namespace std;
// sum segment tree
class SegmentTree{
public:
vector<int>arr, tree;
int n;
SegmentTree(vector<int>&temp, int n):arr(n), tree(4*n){
arr=temp;
this->n=n;
buildTree();
}
void buildHelper(int left, int right, int idx){
if(... | ALGO | 0.999914 | 5.465261 | {
"github_metadata": {
"branch": "main",
"commit_count": 162,
"repo_created_at": "2021-10-02T18:51:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc75faf837... |
57bedc48-2b66-4d1a-ac97-471b632aaeec | JatinGarg19/Leetcode-Coding-Problems | 0763-partition-labels/0763-partition-labels.cpp | class Solution {
public:
vector<int> partitionLabels(string s) {
map<char , int> m;
for(int i = 0; i < s.size(); i++) {
m[s[i]] = i;
}
vector<int> ans;
int start = 0;
int last = 0;
for(int curr = 0; curr < s.size... | ALGO | 0.99958 | 6.438422 | {
"github_metadata": {
"branch": "main",
"commit_count": 737,
"repo_created_at": "2022-11-26T11:11: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": "64deb9359e... |
2cac2b3f-432d-432a-b8c1-7e0a865586e1 | rafa238/competitive_programming_templates | FenwickTree.cpp | #include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
#define LSOne(a) (a & -(a))
class FenwickTree{
private:
vi ft;
public:
FenwickTree(int n){
ft.assign(n+1, 0);
}
FenwickTree(vi v){
build(v);
}
void build(const ... | ALGO | 0.999797 | 4.027569 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-11-22T03:23: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": "70c65c4f3b... |
385c250d-db7f-4831-a7ef-b5c064132015 | JBalakrishnaReddy/my-cpp-practise | sorting algorithms/insertionsort.cpp | #include <iostream>
#include <cstddef>
#include <string>
using namespace std;
void swap(int *a, int *b)
{
int temp = *a ;
*a = *b ;
*b = temp ;
}
void push_back()
{
}
void push_at_start()
{
}
class Sort
{
public:
void insertion_sort(int arr[], int len)
{
// swap();
int a... | ALGO | 0.999475 | 4.78837 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-03-12T07:06: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": "1014e225477... |
8032fdd8-27e3-4e64-b97f-017df316efff | kks227/BOJ | 1500/1585.cpp | #include <cstdio>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
const int MAX_N = 50;
const int MAX_V = 2*(MAX_N+1);
const int S = MAX_V-2;
const int E = MAX_V-1;
const int INF = 1000000000;
int N, c[MAX_V][MAX_V], d[MAX_V][MAX_V];
vector<int> adj[MAX_V];
int MCMF(){
int result = 0, f[... | ALGO | 0.999972 | 3.456083 | {
"github_metadata": {
"branch": "master",
"commit_count": 531,
"repo_created_at": "2016-07-26T12:54:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 66,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36fca19... |
758df77f-2b11-4f63-9610-9b99d6f7e558 | raincross7/code-similarity | codes/train_code/problem098/problem098_227.cpp | /*
* c.cc:
*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functi... | ALGO | 0.999467 | 4.651201 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c2aec51600fa... |
bdf7d512-9423-45ac-b488-e44ed856aac1 | AlphaGoat/GameOfBlobs | game_of_blobs.cpp | #include <cmath>
#include <iostream>
#include <stdlib.h>
#include <vector>
#include "game_of_blobs.h"
#include "ascii_art.h"
// Vector to hold all instances of blobs
//typedef std::vector<blob> vblob;
//int InitGameLoop();
//grid_space minimize_distance(grid_space position_blob1,
// const grid_space positio... | ALGO | 0.994191 | 4.362316 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-02-16T20:24:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c6f5a9928... |
eca437b2-591b-46ad-8eda-47d7dacfb88b | alexagedah/ProjectEuler | Problem 022/problem_022.cpp | // Problem 22
/*
First read all the names into a vector and store them as vectors
There are quoation marks at the start and end of each name so remove those
Then sort the vectors alphabetically
*/
#include <fstream>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <vector>
int name_score(std::stri... | ALGO | 0.999608 | 4.406955 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-09-09T02:11: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": "63d9f2407116... |
15d4b698-4e85-44c3-8440-7a90c31be402 | ShunYaoCodes/option-price-calculator | Main.cpp | // Main.cpp
// include necessary files
#include "BaseOption.hpp"
#include "EuropeanOption.hpp"
#include <vector>
#include <iomanip> // Manipulate the output format
#include <iostream>
using namespace std;
/*
Data sets:
Batch 1: T = 0.25, K = 65, sig = 0.30, r = 0.08, S = 60 (then C = 2.13337, P = 5.84628).
Batch 2: ... | ALGO | 0.957123 | 5.480577 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2017-11-16T17:30:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a0642b696... |
caeee284-d7c9-41ba-9e1e-a64d3b537552 | niloy097/Phitron_Algorithm | Module 27 LCS Variation/minimumInsertionAndDeletionToMakeAStringFromAnotherStr.cpp | #include<bits/stdc++.h>
using namespace std;
// making a --> b
int main()
{
string a , b;
cin >> a >> b;
int n = a.size();
int m = b.size();
int dp[n+1][m+1];
for(int i = 0; i <= n; i++)
{
for(int j = 0; j <= m; j++)
{
if(i == 0 || j == 0) dp[i][j] = 0;
}
... | ALGO | 0.999949 | 3.836837 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-08-02T20: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": "8f122cb4cff9... |
1a57a128-3fe0-409a-b365-395d80f8e1a6 | malhotraarshdeepsingh/DSA | problemQuestions/p57.largestRectangleArea.cpp | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
int largestRectangleArea(vector<int> &heights)
{
int n = heights.size();
vector<int> left(n, 0), right(n, 0);
stack<int> s;
for (int i = 0; i < n; i++)
{
while (!s.empty() && heights[s.top()] >= heights[i])
... | ALGO | 0.999925 | 7.083965 | {
"github_metadata": {
"branch": "master",
"commit_count": 159,
"repo_created_at": "2024-12-29T07:42: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": "f9dab8ce... |
3ec46ee5-0e5f-4ded-b33c-7b36517f5f63 | soedinglab/MMseqs2 | lib/alp/njn_localmaxstat.hpp | #ifndef INCLUDED_NJN_LOCALMAXSTAT
#define INCLUDED_NJN_LOCALMAXSTAT
/* $Id: $
* ===========================================================================
*
* PUBLIC DOMAIN NOTICE
* National Center for Biotechnology Information
*
* This software/database is a "United States G... | ALGO | 0.996952 | 4.649911 | {
"github_metadata": {
"branch": "master",
"commit_count": 6592,
"repo_created_at": "2016-07-20T06:17:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1732,
"forks": 234,
"issues": 448,
"pull_requests": 15
},
"file_meta": {
"content_id": "... |
f6a165c5-78fb-40ee-9d56-b490bfb7a49a | VinayakJamadar/DSA | Dynamic Programming/Code/Part 6 - DP on Stocks/Lect 39 - DP on Stocks - Buy and Sell Stock with Cooldown/Method_2_Memoization.cpp | // Topic : DP on Stocks
// Problem : Buy and Sell Stock with Cooldown
// Method 2 : Using Memoization (Top-Down DP --> Recursive Cases to Base Cases)
// Time Complexity : O(n*2)
// Reason :
// As we avoided the overlapping subproblem. So mostly we have to calculate only n*2 values (i.e calculating and storing the v... | ALGO | 0.999827 | 5.483563 | {
"github_metadata": {
"branch": "main",
"commit_count": 76,
"repo_created_at": "2023-01-24T16:23:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 27,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "edcfa445a... |
3baaa818-116f-4db9-8e77-347fe58297f7 | kaustubh0x77/triangulation | src/Polygon.h | #ifndef TRIANGULATION_POLYGON_H
#define TRIANGULATION_POLYGON_H
#include "primitives.h"
#include <vector>
using namespace std;
class Polygon {
public:
vector <Point> pointList;//!< Stores the points in polygon in CCW order
/**
* Default constructor of the class.
*/
Polygon ();
/**
* Par... | ALGO | 0.957712 | 5.359101 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2019-04-24T06:56:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c2030ff34... |
a232d8c9-9f60-4641-a00a-ccef389dbbb6 | NekoMio/ACMcode | Codes/BZOJ/BZOJ_2819.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 500005;
struct edge
{
int next, END;
} v[N << 1];
int first[N], p;
void add(int a, int b)
{
v[p].END = b;
v[p].next = first[a];
first[a] = p++;
}
int dep[N], size[N], fa[N], id[N], son[N], top[N], Index;
void df... | ALGO | 0.999994 | 4.349479 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2017-07-14T23:35:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "942365cb... |
1b122ff2-2f9c-45d4-ac33-01e325455a77 | Derz65/sys-program-7 | sys-program-7/Graph.h | #pragma once
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;
class Graph {
private:
int vertices;
vector<vector<int>> adjList;
void DFSutil(int v, vector<bool>& visited) {
visited[v] = true;
cout << v << " ";
for (i... | ALGO | 0.99557 | 5.431124 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-04-30T04:28: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": "88dee48e0b2b... |
b17a4707-8d89-4c3b-bdcd-70e1ab701284 | GpsLypy/home | leetcode/701.二叉搜索树中的插入操作.cpp | /*
* @lc app=leetcode.cn id=701 lang=cpp
*
* [701] 二叉搜索树中的插入操作
*/
// @lc code=start
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullpt... | ALGO | 0.999958 | 6.297879 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-05-13T02:58: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": "0833502ec3b5... |
5359bbfe-fc9b-4809-999e-1c5095a69448 | iayushsahu/Hackerrank_cpp | Input_and_Output.cpp | // Input and Output in C++
// Author : <NAME>
// Objective
// In this challenge, we practice reading input from stdin and printing output to stdout.
// In C++, you can read a single whitespace-separated token of input using cin, and print output to stdout using cout.
// For example, let's say we declare the followi... | ALGO | 0.990892 | 4.023124 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-07-25T17:14:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3a87188797fa... |
287444bd-1859-412c-a272-fb3849f128cc | Harsh50/Algo-coding | Linked list/task2.cpp | #include<iostream>
#include<string.h>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
class Node{
char name[20];
int age;
char occ[20];
char loc[20];
char gender;
Node *next;
public:
Node(){next=NULL;
}
void setData(char *Name,int Age,char *Occ, char *Loc, char Gender){
... | ALGO | 0.98907 | 3.072753 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2014-06-03T10:45: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": "80cb9c5fb... |
94f2c2f2-1e1a-4de6-8948-fd6900bbcfe3 | Hunterdii/GeeksforGeeks-POTD | March 2024 GFG SOLUTION/March-06.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
class Solution
{
public:
vector <int> search(string pattern, string text)
{
//code here.
int n = text.size();
int m = pattern.size();
vector<int> ans;
... | ALGO | 0.999413 | 5.88694 | {
"github_metadata": {
"branch": "main",
"commit_count": 3732,
"repo_created_at": "2024-03-09T09:48:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 202,
"forks": 54,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb47fa... |
40abf31c-fb81-48e6-8bee-55de77950fb9 | lechenyu/TSan-spd3 | libc/src/__support/FPUtil/builtin_wrappers.h | //===--Convenient template for builtins -------------------------*- C++ -*-===//
// (Count Lead Zeroes) and (Count Trailing Zeros)
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apac... | TOOL | 0.919282 | 7.387844 | {
"github_metadata": {
"branch": "main",
"commit_count": 427321,
"repo_created_at": "2022-10-15T00:02:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f34b78b... |
039134db-c184-4475-9a52-7916a99e3660 | Florane/sdl_game | rect.cpp | #include <iostream>
#include "rect.hpp"
//математика для коллизий
double _abs(const double& a)
{
if(a < 0)
return -a;
return a;
}
double min(const double& a, const double& b)
{
if(a < b)
return a;
return b;
}
double max(const double& a, const double& b)
{
if(a > b)
return ... | ALGO | 0.994491 | 4.088412 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2021-04-20T18:22:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a50459a57... |
74fe5081-a3b7-4ac3-a3d0-1f12ef4fb5f7 | serzaxlucifer/Leetcode | Graphs/542. 01 Matrix.cpp | vector<vector<int>> updateMatrix(vector<vector<int>>& mat)
{
int DIR[5] = {0, 1, 0, -1, 0};
queue<pair<int, int>> BFS;
int r = mat.size(), c = mat[0].size();
for(int i = 0; i < r; i++)
{
for(int j = 0; j < c; j++)
{
if(mat[i][... | ALGO | 0.999941 | 5.793694 | {
"github_metadata": {
"branch": "main",
"commit_count": 379,
"repo_created_at": "2023-01-09T20:01:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7feae602d4... |
72023614-4037-4a95-8fa1-fa638a8ba685 | JeroenDM/ocpl | ocpl_ros/include/ocpl_ros/planning_cases/util.h | #pragma once
#include <vector>
#include <Eigen/Core>
#include <ocpl_planning/types.h>
#include <ocpl_tsr/task_space_regions.h>
std::vector<ocpl::TSR> createLineTask(ocpl::TSRBounds bounds, Eigen::Vector3d start, Eigen::Vector3d stop,
Eigen::Isometry3d orientation, std::size_t n... | ALGO | 0.981706 | 6.603999 | {
"github_metadata": {
"branch": "main",
"commit_count": 229,
"repo_created_at": "2020-12-21T16:56:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "883de6ca83... |
d90fa1ec-6110-43e4-8ae1-76f3db3e1dc4 | NyaanNyaan/library | segment-tree/segment-tree-beats-abstract.hpp | #pragma once
template <typename Node>
struct Beats {
int n, log;
vector<Node> v;
template <typename T>
Beats(vector<T>& vc) {
n = 1, log = 0;
while (n < (int)vc.size()) n <<= 1, log++;
v.resize(2 * n);
for (int i = 0; i < (int)vc.size(); ++i) v[i + n] = Node(vc[i]);
for (int i = n - 1; i; ... | ALGO | 0.99857 | 6.760894 | {
"github_metadata": {
"branch": "master",
"commit_count": 1700,
"repo_created_at": "2020-04-11T09:13:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 239,
"forks": 20,
"issues": 10,
"pull_requests": 1
},
"file_meta": {
"content_id": "df2... |
b16b6df2-46d8-477f-9653-ab4d2b410985 | SIC1740/LaptrinhC | timkiemnhiphan.cpp | #include<bits/stdc++.h>
using namespace std;
bool binarysearch(int a[], int l , int r , int x){
if (l > r) return false ;
int m = (l+r)/2 ;
if (a[m] == x)
return true ;
else if (a[m] < x)
return binarysearch(a, m+1 , r,x);
else
return binarysearch(a,l,m-1,x);
}
int first_pos(int a[], int n , int x ){
int ... | ALGO | 0.999998 | 4.593712 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-08-17T12:07: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": "399d4414206b... |
faefe2b0-7f77-482e-98ec-e68b4815702e | LeeHwanWoong/workspace | quadtree.cpp | #include <iostream>
using namespace std;
int position(string s, int idx){ //idx = from 'x'
int count = 4;
for(int i = idx+1;i<s.size();i++){
if(s[i] != 'x'){
count--;
if(count == 0){
return i;
}
}
else{
count += 3;
... | ALGO | 0.999953 | 3.580117 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-11-07T09:09: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": "76ef8c0dde... |
f03cf096-9216-459a-a11d-3520d95d3f23 | gyu6172/MultimediaProgramming | 멀티미디어프로그래밍/과제2 코드.cpp | #include <opencv2/opencv.hpp>
//이미지를 입력으로 받아, y좌표가 startY에서 시작해서 dy만큼 증가하면서 이미지의 경계를 찾는 함수
int findBoundaryVertical(IplImage* img, int startY, int dy);
int main() {
//이미지 경로 입력
printf("Input File Name : ");
char str[100];
scanf("%s", str);
//입력된 경로에 있는 이미지를 불러옴.
IplImage* src = cvLoadImage(str);
//src의 크기를 저... | TOOL | 0.981585 | 4.773317 | {
"github_metadata": {
"branch": "master",
"commit_count": 165,
"repo_created_at": "2023-03-07T06:28: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": "8b145136... |
1787d1b8-0194-44ff-a21d-05fb2b398263 | trongbq/AoC | 2022/day13/part2.cc | #include <fstream>
#include <iostream>
#include <vector>
#include "element.h"
using namespace std;
int main (int argc, char *argv[]) {
ifstream my_file;
if (argc > 1 && string(argv[1]) == "-d") {
my_file.open("sample.txt");
} else {
my_file.open("input.txt");
}
if (my_file.is_open... | ALGO | 0.966564 | 3.990226 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2021-12-01T07:45: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": "d0cf1ce93... |
ee018bb1-c8e4-45d7-8e6c-87e2585ad3ff | alexandraback/datacollection | solutions_6404600001200128_0/C++/kingo/main.cpp | #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
using namespace std;
int m[1002];
int max(int a, int b){
return a > b ? a : b;
}
int main(int argc, char *argv[]){
freopen("a.in", "r", stdin);
freopen("a.out", "w", stdout);
int num;
cin >> num;
for(int i = 0; i < num... | ALGO | 0.999421 | 3.127767 | {
"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": "a2f4238c8... |
95600fe4-6c9a-4320-8e7e-38fe9ea209d9 | UtkarshSharma26/CPP | cll.cpp | #include <stdio.h>
#include <malloc.h>
#include<process.h>
typedef struct link_tag
{
int data;
struct link_tag *link;
}node;
/********** Function Declaration begins **********/
node *push(node *);
node *pop(node *);
void display(node *);
/********** Function Declaration ends **********/
int main()
{
node *start=NULL;
i... | ALGO | 0.99932 | 4.423802 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-01-08T15:19: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": "5efeae5378... |
a7c4da7b-cf42-4b88-9c3b-c6cdd402aa90 | adityajamwal02/LeetcodeProblemSet1 | SeatReservationManager.cpp | /*
Design a system that manages the reservation state of n seats that are numbered from 1 to n.
Implement the SeatManager class:
SeatManager(int n) Initializes a SeatManager object that will manage n seats numbered from 1 to n. All seats are initially available.
int reserve() Fetches the smallest-numbered unreserved se... | ALGO | 0.991595 | 7.05946 | {
"github_metadata": {
"branch": "main",
"commit_count": 583,
"repo_created_at": "2022-07-01T03:50: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": "7a58d63e06... |
d0b972d1-d9b8-469a-9f5e-5dc89397d81e | doldre/ACM | practice/ccpc-hangzhou/i.cpp | /************************************************
*Author :mathon
*Email :<EMAIL>
*************************************************/
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include ... | ALGO | 0.999954 | 3.930662 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2016-04-09T08:35:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1aef1e9a... |
5ff56a75-9521-43bf-8179-1bfc506608ff | jrachels/Heston-Hull-White | HestonHullWhiteMonteCarlo/StateTypes/Examples/HestonHullWhite/hestonhullwhite.h | // Implements Theorem 5.4, page 39 of https://media-exp1.licdn.com/dms/document/C4D2DAQH3DQXdHV78BA/profile-treasury-document-pdf-analyzed/0/1592809800927?e=1624611600&v=beta&t=1beaP4zemdBLAEvqJsVoOmtQr8KQLX4dmOKBE4-jmMg
// "Approximating the Heston-Hull-White Model"
// by <NAME>
// TO DO: I could slightly speed up ea... | ALGO | 0.984357 | 3.277908 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2021-10-09T15:11:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bea226962d8... |
32b5a695-65e0-4961-bc23-07c375f379f6 | liuchuo/PAT | AdvancedLevel_C++/1110. Complete Binary Tree (25).cpp | #include <iostream>
using namespace std;
struct node{
int l, r;
}a[100];
int maxn = -1, ans;
void dfs(int root, int index) {
if(index > maxn) {
maxn = index;
ans = root;
}
if(a[root].l != -1) dfs(a[root].l, index * 2);
if(a[root].r != -1) dfs(a[root].r, index * 2 + 1);
}
int main() {... | ALGO | 0.999988 | 3.803661 | {
"github_metadata": {
"branch": "master",
"commit_count": 703,
"repo_created_at": "2016-01-06T05:06:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3399,
"forks": 809,
"issues": 44,
"pull_requests": 9
},
"file_meta": {
"content_id": "9d... |
fd980f72-3012-4417-ae81-f5bbdca9668b | losyoply/Competitive-Programming-Training-HW | week5_sortQueries.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <deque>
#include <queue>
using namespace std;
int main() {
int Q, query_type, x;
deque<int> A;
bool is_sorted = true;
cin >> Q; // number of queries
for (int i = 0; i < Q; ++i) {
cin >> query_type;
switch (query_... | ALGO | 0.998002 | 5.364517 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-02-19T12:44: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": "360b2edc4783... |
69d71f41-6025-424d-bb1e-bb8589d679cc | MatiasBlake/past-cs-projects | Embedded systems final project/maze_solver_final/solve2.cpp | #include "mbed.h"
#include "RGBmatrixPanel.h" // Hardware-specific library
//DigitalOut gpo(D0);
//DigitalOut led(LED_RED);
//structs/types
typedef struct point{
int x;//index from MSB
int y;//index of array
} point;
typedef struct node{
point value;
struct node * next;
} node_t;
//global vars
node_... | ALGO | 0.941654 | 3.721039 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-11-09T20:46: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": "1469669c66... |
346556fe-c0ef-4e02-bb67-58c6e615d9af | weizds/LeetCode | medium/990_Satisfiability_of_Equality_Equations.cpp | class Solution {
public:
struct Subset {
int parent;
int rank;
};
int find(int val) {
if(subsets[val].parent != val) {
subsets[val].parent = find(subsets[val].parent);
}
return subsets[val].parent;
}
void unionSubsets(int root1, int root2) {
... | ALGO | 0.999965 | 5.588902 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-02-12T20:14: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": "a86c3d0011b... |
508ad07d-05f2-41d1-b8c1-c987583a1e6d | mkson668/interview-prep | cpp-medium/combinationsum.cpp | #include <vector>
#include <numeric>
#include <algorithm>
class Solution {
public:
static std::vector<std::vector<int>> combinationSum(std::vector<int>& candidates, int target) {
std::vector<std::vector<int>> allComb;
std::vector<int> currComb;
// sort by ascending
std::sort(candida... | ALGO | 0.999982 | 6.517354 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2020-01-08T00:19: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": "93405fcdd... |
6d29b7f0-7f81-49ab-bf23-5de103e08679 | hyeongjic/problems | 백준/Gold/16234. 인구 이동/인구 이동.cc | #include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <queue>
using namespace std;
int map[52][52];
int check[52][52] = {0,};
int visit[52][52] = {0,};
int up,down,n;
int sum[2001]={0,};
int seq;
int dy[4] = { -1,0,1,0 };
int dx[4] = { 0,-1,0,1 };
queue <pair<int,int> > que;
bool move() {
seq = 1;... | ALGO | 0.999751 | 3.904031 | {
"github_metadata": {
"branch": "main",
"commit_count": 169,
"repo_created_at": "2024-06-26T04:51: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": "db37b98d26... |
63211ab8-b492-4416-a289-59fe75ea2337 | Pranav0786/COdeForEnjoy | 13recursion/4linearsearch.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
bool linearsearch( int *arr , int size , int k )
{
if( size == 0) return false ;
if( arr[0] == k ) return true ;
linearsearch( arr+1 , size-1 , k ) ;
// return false ;
}
int main()
{
int size ;
cout << "Enter the size\n" ;
c... | ALGO | 0.999897 | 4.941752 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2023-12-21T10:12:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "20819f95dc1... |
33b1e0c0-6738-4b0b-940f-b96cab689aed | Sierddm/i-Botics-Haptic-Feedback-Pedals | ROS package/haptic_pedals/src/forceFeedback.cpp | //
// Node for calculating the increased force output based on the
// distance and angle to an obstacle and the velocity of the platform
//
//
#include "ros/ros.h"
#include "std_msgs/Float64.h"
#include "haptic_pedals/Forces.h"
#include "geometry_msgs/Twist.h"
#include "nav_msgs/Odometry.h"
#include "geometry_msgs/Tw... | ALGO | 0.936383 | 5.076491 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-11-04T16: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": "cd3829c03c... |
ec24ce71-5930-4fee-af99-c36be5234c0e | Tarunagg1/Ds_Alog_notes | Pythagorean_Triplets/Pythagorean_Triplets.cpp | /*
PYTHAGOREAN TRIPLETS
Three numbers - a, b and c are said to be pythagorean triplets if following
formula holds :
a^2 + b^2 = c^2
*/
#include<bits/stdc++.h>
using namespace std;
int main() {
int a, b, c;
cout<<"Enter a: "<<endl;
cin>>a;
cout<<"Enter b: "<<endl;
cin>>b;
cout<<"Enter c: "<<e... | ALGO | 0.994903 | 4.261443 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-01-19T04:18:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4eefe8145... |
2edee8e4-a2a7-424b-8a7b-d2b4c461a059 | zhengs/leetcode | leetcode_6.7_sort_color.cpp | #include <vector>
#include <iostream>
using namespace std;
void _sort(vector<int> &vi) {
if(vi.size() <= 1) {
return;
}
int idx_0_insert = 0;
int idx_0_search = 0;
int idx_2_insert = vi.size()-1;
int idx_2_search = vi.size()-1;
while(vi[idx_0_insert] == 0) {
idx_0_insert++;
}
idx_0_search = idx_0_insert;... | ALGO | 0.999943 | 3.74192 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2014-02-27T19:45: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": "3a025ba619... |
50d3df9e-d176-4f2e-b93b-2b05bc4e4b1d | beingbing/pathshala-problems | 29DynamicProgramming/06Homework01/1_gfg_get-score.cpp | /*
optimal substructure => table[i] = table[i] + table[i - 3] + table[i - 5] + table[i - 10]
0
3 5 10
3 5 10 5 10 10
3 5 10 5 10 10 5 10 10 10
*/
#include <iostream>
#incl... | ALGO | 0.999694 | 4.378332 | {
"github_metadata": {
"branch": "main",
"commit_count": 1324,
"repo_created_at": "2021-08-10T11:54: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": "4982fd2ef... |
ac2037ec-e18d-4bcd-886d-64c3cc9d5ad1 | mostafa-saad/MyCompetitiveProgramming | Olympiad/Baltic/official/boi2015_solutions/hac-sol-2.cpp | /*
Task: Hacker
Model Solution 2
Author: <NAME>
Complexity: O(n log n)
Uses segment tree to calculate maximum
*/
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<vector>
using namespace std;
#define REP(I,N) for(int I=0;I<(N);I++)
#define PB push_back
#define MP make_pair
#define ... | ALGO | 0.999992 | 3.671391 | {
"github_metadata": {
"branch": "master",
"commit_count": 439,
"repo_created_at": "2017-02-05T22:26:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 415,
"forks": 85,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e1936... |
78e58c02-9174-47e8-89bc-33e6cbea1e44 | XaryLee/spmm | PreProcessing/bitmap.h | #ifndef _BITMAP_H_
#define _BITMAP_H_
#include <iostream>
#include <vector>
#include <math.h>
#include <algorithm>
#include <numeric>
// #include <execution>
#include <ctime>
#include "csr.h"
using namespace std;
// int blur(int* score, int sectnum, SpM &mr){
// int index, max = 0;
// for( int i = 0; i < sec... | ALGO | 0.995824 | 3.883799 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2023-01-03T11:58:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98a1d807187... |
b9e17392-ee7b-407a-84a5-4bf70e1ff01f | Espeto/tcc-vss-vision | classes/Pipe/SegEx/HSSegFull/FullSeg.cpp | #include "FullSeg.hpp"
#include "../../../../libs/globals/Global.h"
#include "../../../../libs/libvision/ImgProcess.h"
#include "../../../../libs/helpers/helper.h"
#include <opencv2/highgui.hpp>
#include <iostream>
#include <omp.h>
objectsContours FullSeg::execute(cv::Mat preProcessedImg)
{
std::vector<std::vector... | ALGO | 0.963568 | 4.296441 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2021-06-13T14:41: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": "5d20cb96550... |
51860432-834e-45ff-9527-b952c5f24f4c | facebookarchive/RakNet | DependentExtensions/cat/src/math/rtl/mul/Multiply.cpp | /*
Copyright (c) 2009 <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 the above copyright notice,
this list of conditions and the following d... | ALGO | 0.999709 | 4.915033 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2014-06-05T00:25:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3381,
"forks": 1050,
"issues": 67,
"pull_requests": 52
},
"file_meta": {
"content_id": "c5... |
f4e29d85-ce64-4bbe-b3d4-d22b6e672721 | ishandutta2007/codeforces-a | antoine/normal/1073/C.cpp | #undef NDEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct Vec {
ll x = 0, y = 0;
Vec operator+(const Vec other) {
return {x + other.x, y + other.y};
}
Vec operator-(const Vec other) {
return {x - other.x, y - other.y};
}
ll norm() {
return llabs(x) + llabs(y);
}
};
Vec vec... | ALGO | 0.999892 | 3.913773 | {
"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": "2ed344fd8c0d... |
6a10ddf9-aff5-4fc4-8d08-a9126075d6a6 | hannahfili/spojprojects | szyfrCezaraWprowadzZnak.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
void shift(string, int);
int main()
{
int number = 0;
string sentence = "";
cout << "Wprowadz liczbe z zakresu <0,25>: ";
cin >> number;
while (!(number >= 1 && number <= 25)) {
cout << "Wprowadzono niepoprawna liczbe. Wprowadz lic... | ALGO | 0.999182 | 3.994394 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-10-06T20:23:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b06bb0a62307... |
d43a4b51-fb23-4276-a87c-7ea0786ad11c | sarthak-magar15/DSA_codes_CPP | 2dArrayDynamicMem.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int **arr = new int *[n];
for (int i = 0; i < n; i++)
{
arr[i] = new int[n];
}
// creation of 2d array done
// taking input
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
... | ALGO | 0.995395 | 4.071969 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2023-02-12T16:27: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": "2904128ae... |
63023af3-cc49-4b40-9c6f-8bd094e38cd1 | nerdooit/code_practice | Book/Accelerated/02/practice/2-5.cc | /*
* Name : nerdooit
* Description : *를 이용하여 정사각형, 직사각형, 삼각형의 형태를 출력하시오.
*/
#include <iostream>
#include <string>
using namespace std;
void rectangle(int a, int b)
{
for (int i = 0; i < a; i++) {
for (int j = 0; j < b; j++) {
cout << "*";
}
cout << endl;
}
}
void triangle(int a)
{
// 인자가 홀수로 들어온다고 가정
... | ALGO | 0.998001 | 3.716581 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2019-12-31T23:57: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": "f7ff4e1f8... |
6748bc57-b95a-4baf-a96a-06e663208de2 | samertufail/algorithms | leet/clone-graph.cpp | #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <functional>
#include <set>
#include <math.h>
#include <cassert>
#include <ctime>
#include <fstream>
#include <sstream>
#include <locale>
#include <ma... | ALGO | 0.999905 | 6.358277 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2016-05-04T21:21:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08563e05... |
cc421d96-22be-40e2-925b-020acbfb4946 | micYn/data_structure_hw | HW4/HW4/B103040009-hw4.cpp | //Author:尹信淳
//Date: Oct.07 2022
//Purpose: 西洋棋騎士(knight)走完棋盤的順序
#include <iostream>
#include <iomanip>
using namespace std;
int solveKTUtil(int x, int y, int movei, int** sol,int N,int xMove[], int yMove[]);
//確認該位置可以放入的函數
int isSafe(int x, int y, int** sol,int N){
return (x >= 0 && x < N && y >= 0 && y < N && sol... | ALGO | 0.999768 | 3.934251 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-11-19T05:11: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": "72347e52be57... |
a28fd2f4-74df-4360-908c-ec404a8c0fc4 | mmunos/cp | workspace/cf774/C.cpp | #include <iostream>
#include <vector>
using namespace std;
typedef long long int ll;
int count(ll x){
int res = 0;
while(x > 0){
if(x & 1) res++;
x >>= 1;
}
return res;
}
int main(){
int m = 12;
ll arr[m];
arr[0] = 6;
for(int i = 1; i < m; i++){
arr[i] = arr[i-... | ALGO | 0.999893 | 4.044799 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2016-05-08T07:31: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": "54a29831d... |
7a248890-6415-4924-98b2-0dd1c8a1f723 | momomorgentau/code | atcoder/abc/abc174/E_Logs.cpp | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
int main()
{
int n, k;
cin >> n >> k;
vector<int> a(n);
rep(i, n) cin >> a[i];
int up = *max_element(a.begin(), a.end());
int low = 0;
int mid;
int cnt = 0;
while (up - low > 1)
{
cnt ... | ALGO | 0.999982 | 3.854317 | {
"github_metadata": {
"branch": "develop",
"commit_count": 286,
"repo_created_at": "2020-10-01T18:13: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": "3802029... |
52fdf737-dc7e-4fb8-8ced-6a59c2115a4c | almaeder/ACM_CG | src/dist_objects.h | #pragma once
#include <mpi.h>
#include <hip/hip_runtime.h>
#include <hip/hip_runtime.h>
#include <hipsparse.h>
#include <iostream>
#include "cudaerrchk.h"
#include <unistd.h>
#include <rocsparse.h>
#include "utils_cg.h"
class Distributed_vector{
public:
int matrix_size;
int rows_this_rank;
... | ALGO | 0.999355 | 4.26754 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2024-05-03T11: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": "3179fd32a6b... |
c4a1283a-1b75-43d4-8129-c456f13e5d4c | ksagar03/DS-and-algorithm | c++(learning)/sorting_algorithm(2).cpp | #include<bits/stdc++.h>
using namespace std;
// ***************************
// sorting algorithm
//*****************************
// merge sort
// void merge(int arr[],int x,int y,int mid)
// {
// ... | ALGO | 0.999995 | 5.340548 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-09-24T11:06: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": "61587481a9c3... |
b42feaa2-c457-4751-9549-eacd15741deb | AnujKV123/DSA-Code-Base | graph/code12_sortestPath_udg.cpp | // ********************************* find the sotest path in a graph by using BFS (in unweighted graph)**********************************
// TC = O(n + e) n = no. of nodes, e = no of edges
// SC = O(n + e) n = no. of nodes, e = no of edges
// know more :- https://www.codingninjas.com/codestudio/problems/shortest-path... | ALGO | 0.999989 | 5.538435 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2022-10-22T09:14:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6bb961693... |
26d219c1-f9bb-42a9-8f31-1a07c234d947 | Korin777/DataSturcture | medianofthree_ol.cpp | #include<iostream>
#include<ctime>
#include<algorithm>
using namespace std;
void quicksort(int a[], int left, int right)
{
int pivot,i,j,middle;
int temp;
if(left < right)
{
i = left;
j = right + 1;
middle = (left + right) / 2;
int b[3];
b[0] = a[left];
b... | ALGO | 0.999858 | 4.312691 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-02-17T08:46: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": "49fa930f1c... |
796e532a-0e46-477b-89ad-9b711ab7936a | adri87/Q-A | Unitex2.1/Src/C++/AutomatonDictionary2Bin.cpp | /*
* Unitex
*
* Copyright (C) 2001-2011 Université Paris-Est Marne-la-Vallée <<EMAIL>>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (a... | TOOL | 0.921141 | 5.319284 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2012-11-15T19:03:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "38add2ecc9... |
ec5a4429-0118-4f12-a5a7-7bbd1621c135 | Gaius-Augustus/Augustus | include/pp_scoring.hh | /*
* pp_scoring.hh
*
* License: Artistic License, see file LICENSE.TXT or
* https://opensource.org/licenses/artistic-license-1.0
*
* Project : Gene Prediction with Protein Family Patterns
* Description: Classes that perform the evaluation of ProteinProfile
* emission probabilities
*/... | ALGO | 0.985189 | 5.75354 | {
"github_metadata": {
"branch": "master",
"commit_count": 2716,
"repo_created_at": "2018-05-24T17:34:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 313,
"forks": 115,
"issues": 162,
"pull_requests": 7
},
"file_meta": {
"content_id": "06... |
ea67927c-6352-4d36-a63f-f96efa5f512e | iliyian/CompetitiveProgramming | vjudge.net/664718/D.cpp | #include <bits/stdc++.h>
#define int long long
signed main() {
std::cin.tie(nullptr)->sync_with_stdio(false);
int n, m;
std::cin >> n >> m;
std::vector<std::vector<int>> a(n + 1, std::vector<int>(m + 1));
std::vector<int> vec = {INT_MIN};
auto id = [&](int x) {return std::lower_bound(vec.begin(), vec.end... | ALGO | 0.999843 | 3.596459 | {
"github_metadata": {
"branch": "main",
"commit_count": 354,
"repo_created_at": "2024-04-21T10:50:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3201a060e5... |
98f23d06-ff30-45d9-8d07-db6d359ac097 | Tauke190/Leetcode | BFS/DFS/Graphs/Max_Area_of_Island.cpp |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
/*
Difficulty - Medium
Type - Depth First Search
Attmept 1 - Solved it with a little bit of help , 2 hours , Forget to mark visited node and it cause out of bounds error
Algorithm
1. We look for neighbours in each 1's block recursively
2... | ALGO | 0.999699 | 6.059305 | {
"github_metadata": {
"branch": "master",
"commit_count": 117,
"repo_created_at": "2022-08-04T04: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": "baae7b88... |
31a71eeb-5622-427b-8ec8-f139b67df16e | kindlytrees/leetcode | dp/climbing-stairs.cpp | /*
题目来源: https://leetcode.cn/problems/climbing-stairs/
假设你正在爬楼梯。需要 n 阶你才能到达楼顶。
每次你可以爬 1 或 2 个台阶。你有多少种不同的方法可以爬到楼顶呢?
示例 1:
输入:n = 2
输出:2
解释:有两种方法可以爬到楼顶。
1. 1 阶 + 1 阶
2. 2 阶
示例 2:
输入:n = 3
输出:3
解释:有三种方法可以爬到楼顶。
1. 1 阶 + 1 阶 + 1 阶
2. 1 阶 + 2 阶
3. 2 阶 + 1 阶
提示:
1 <= n <= 45
*/
#include<vector>
//方法一:递归解法,有可能会... | ALGO | 0.999961 | 5.55314 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2022-09-20T06:32:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8304c5c7c... |
d03b7843-db99-4b5f-bbd3-cc5ff6e97986 | aatman-24/DSA | APNA College C++ Placement/22. Linked List/22.2 Deletion at Linked List.cpp | #include <bits/stdc++.h>
#define ll long long
#define REP(i,n) for(int i = 0; i < n; i++)
#define REP1(i,n) for(int i = 1; i <= n; i++)
#define debug cout << "Ok" << endl;
#define mod 1000000007
using namespace std;
typedef pair<ll,ll> ii;
typedef vector<ii> vii;
typedef map<char,int> mci;
typedef vector<int> vi;
ty... | ALGO | 0.999919 | 4.034989 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2021-04-13T13:29: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": "c97ac647bca... |
633d8f4d-836b-47db-ac43-5f380b84c7f2 | ssurcin/gramlab-unitex-cpp-uima-annotator | Utils.cpp | #include "Utils.h"
#if (defined(_WIN32) || defined(_WIN64))
#define WINDOWS
#include <windows.h>
#include <direct.h>
#else
#include <sys/types.h>
#include <sys/stat.h>
#endif
#include "FileUtils.h"
// ICU
#include <unicode/ustream.h>
#include <unicode/ustdio.h>
#include <unicode/regex.h>
#include <iostream>
#include... | TOOL | 0.964071 | 6.159202 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2015-03-31T08:30: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": "db4434d07... |
8639d7b3-7695-49ec-b0c6-64065857bd74 | ishandutta2007/codeforces-s | shadowatyy/normal/815/C.cpp | #include <bits/stdc++.h>
#include <unistd.h>
#define ll long long
#define ull unsigned long long
#define inf 1000000007
#define inf16 0x3f3f3f3f
#define INF 1000000000000000007LL
#define VI vector<int>
#define VPII vector<pair<int, int> >
#define VLL vector<ll>
#define PII pair<int, int>
#define PLL pair<ll, ll>
#defin... | ALGO | 0.999858 | 3.5248 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07: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": "021e327085e2... |
1722f2fe-4a38-4fde-b9f1-f002b8d03e58 | russellmatt66/GPU-samples | MiscAlgorithms/MatrixMultiply/include/matmul.h | #ifndef MATMUL_H
#define MATMUL_H
// #include <stdio.h>
#include <cstdint>
#include <random>
#define IDX2D(i, j, N) (i*N + j)
/* Host code */
void initMatrices(float *C, float *A, float *B, const uint64_t N, const int begin, const int end){
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_rea... | ALGO | 0.99924 | 5.17129 | {
"github_metadata": {
"branch": "main",
"commit_count": 133,
"repo_created_at": "2023-12-16T01:41: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": "0225dcc8dc... |
514a72f4-1e70-44a2-ace4-b44a246132e3 | NoumanShah042/Programming-Fundamentals | Arrays lab question/Source.cpp | #include <iostream>
using namespace std;
void candyExchange(int * A, int aSize, int * B, int bSize, int * aExchange, int * bExchange);
int main()
{
int b[2] = { 1,1 };
int a[2] = { 2,3 };
int aExchange ,bExchange;
candyExchange( a, 1, b, 2 ,&aExchange, &bExchange);
cout << aExchange<<'\n';
cout <<... | ALGO | 0.999972 | 3.694147 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-01-05T19:21:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aac3ef21af... |
d4a4c2d6-41d1-4b89-b48c-baf737fe080e | Time1ess/MyCodes | LeetCodeR3/200-Number of Islands/solution.cpp | class Solution {
public:
void dfs(vector<vector<char>>& grid, int x, int y, int m, int n) {
if (x < 0 || x == m || y < 0 || y == n || grid[x][y] == '0') {
return;
}
grid[x][y] = '0';
dfs(grid, x - 1, y, m, n);
dfs(grid, x + 1, y, m, n);
dfs(grid, x, y - 1,... | ALGO | 0.999982 | 6.561174 | {
"github_metadata": {
"branch": "master",
"commit_count": 1837,
"repo_created_at": "2014-10-23T02:43:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b12ce16... |
771be9a3-759b-425d-89e0-018692afa23b | dengwirda/jigsaw-matlab | external/jigsaw/src/libcpp/iter_mesh/iter_flip_2.inc |
/*
--------------------------------------------------------
* ITER-FLIP-2: optim. schemes to "flip" topology.
--------------------------------------------------------
*
* This program may be freely redistributed under the
* condition that the copyright notices (including this
* ent... | ALGO | 0.99887 | 5.135609 | {
"github_metadata": {
"branch": "master",
"commit_count": 345,
"repo_created_at": "2016-02-20T18:14:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 82,
"forks": 28,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a69111... |
4e5d818e-8e26-4e0c-9fb4-31e1708621cc | YangFengCodeCode/algorithm | divide_conquer-1/divide_conquer-1/Test.cpp | #define _CRT_SECURE_NO_WARNINGS 1
using namespace std;
#include<iostream>
#include<vector>
#include<string>
class Solution {
public:
void sortColors(vector<int>& nums) {
int left = -1, right = nums.size(), i = 0;
while (i < right)
{
if (nums[i] == 0) swap(nums[++left], nums[i++... | ALGO | 0.999954 | 5.347313 | {
"github_metadata": {
"branch": "main",
"commit_count": 98,
"repo_created_at": "2023-12-20T11:47: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": "d6cffb44cc1... |
bb6bce11-5d04-4f19-9552-d4a398c1782f | cdh981009/Algorithm | baekjoon/2836_water_taxi.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 987654321
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FOR_(i, a, b) for (int i = (a); i <= (b); ++i)
int main() {
freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
ios_base::sync_with_stdio(false);
cin.ti... | ALGO | 0.999789 | 3.260416 | {
"github_metadata": {
"branch": "master",
"commit_count": 850,
"repo_created_at": "2020-02-16T08:17:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "443faa56... |
66e80a23-aaf3-4e41-a8a8-76f1da98f6c2 | supercatex/OI | CJ2021_Q1.cpp | /*
* Author: <NAME>
* CodeJam 2021 Qualification -- Question 1 -- Reversort
* https://codingcompetitions.withgoogle.com/codejam/round/000000000043580a/00000000006d0a5c
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int solve(vector<int> v)
{
int total_cost = 0;
for (int i = 0;... | ALGO | 0.999932 | 5.709437 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2021-03-31T07:16:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a4cbc8b031... |
0de34c68-a607-4dd4-8ec5-c286200491ac | gnahtb/Code-Archive | CP/Codeforces/616E.cpp | #include <cstdio>
#include <iostream>
using namespace std;
#define sqr(a) (a) * (a)
typedef long long ll;
const ll mod = 1E9 + 7;
ll n, m, ans = 0, tmp;
int main()
{
ios_base::sync_with_stdio(false);
scanf("%lld%lld", &n, &m);
ans = m % mod * (n % mod) % mod;
for (ll i = 1; sqr(i) <= n; ++i)
{... | ALGO | 0.999991 | 4.093201 | {
"github_metadata": {
"branch": "main",
"commit_count": 87,
"repo_created_at": "2021-07-22T18:42: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": "0ed78827472... |
5e5f9487-00b8-4a0d-b662-8cb26e0494dd | Sughandhan/Competitive-Programming | codeforces/469/A.cpp | // BATMAN WAS HERE
#include<bits\stdc++.h>
using namespace std;
#define inf 1000000007
#define pb push_back
#define fr(i,a,b) for(int i=a;i<b;++i)
#define frn(i,a,b) for(int i=a;i>=b;--i)
#define all(v) (v).begin(), (v).end()
#define tr(v, it) for(vector<long long int> ::iterator (it) = (v).begin(); it!= (v).end() ... | ALGO | 0.999893 | 3.071011 | {
"github_metadata": {
"branch": "master",
"commit_count": 385,
"repo_created_at": "2021-05-01T05:50: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": "e05fb6d7... |
cde8a041-0dc3-4d76-adb3-4f9f38b398f7 | vjabhi000985/C_CPP | swap.cpp | #include<iostream>
using namespace std;
int main()
{
int a,b,temp;
cout<<"The first number is:";
cin>>a;
cout<<"The second number is:";
cin>>b;
// Print the value before swapping.
cout<<"Before Swapping: a="<<a<<" and b="<<b<<endl;
/* By using for loop or if-else statement we will increase t... | ALGO | 0.999767 | 4.398726 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-09-30T15:27:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4c6068bec... |
f97be54d-d288-4084-b730-6b10060d40ee | kaisersoju/Eac-Bypass | MemEx.hpp | //Every parameter of 'uintptr_t' type refers to an address in the context of the virtual address space of the opened process.
//Every parameter of pointer type refer to an address/pointer/buffer in the context of the virtual address space of the current process.
#ifndef MEMEX_H
#define MEMEX_H
#include <Windows.h>
#i... | TOOL | 0.940682 | 4.396646 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-05-09T17:04:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 34,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47e92e8ff... |
86c75d92-a35e-4fa8-9d0c-6e54268cca45 | woohyunjng/Coding-Practice | CP/Codeforce/Round 1024/C.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int MAX = 200001;
int A[MAX], tree[MAX * 4], lazy[MAX * 4];
vector<int> arr[MAX];
void init(int n, int s, int e) {
tree[n] = lazy[n] = 0;
if (s == e)
tree[n] = -s;
else {
int m = s + e >> 1;
init(n << 1, s,... | ALGO | 0.999829 | 5.192896 | {
"github_metadata": {
"branch": "main",
"commit_count": 485,
"repo_created_at": "2022-06-04T14:40: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": "5234217457... |
5a291b86-a21a-49ae-a2b6-a7d087406426 | Kenshin2438/CP-Code-Collection | OJ/AIZU/DSL/DSL_4_A.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.hpp"
#else
#define debug(...) 42
#endif
#define PII pair<int, int>
#define vec vector
#define str string
#define fi first
#define se second
#define all(a) a.begin(), a.end()
using db = double;
using ll = long long;
template<typename T, typen... | ALGO | 0.999696 | 4.549403 | {
"github_metadata": {
"branch": "master",
"commit_count": 95,
"repo_created_at": "2022-04-15T06:16:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8acd5321... |
1fa01b6c-d70c-459d-8656-9f296d3fc5f3 | itz-Pratham/A2Z-DSA-Sheet-Solution | Step_13/Lec_2/Check if the Binary tree is height-balanced or not.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999799 | 6.160681 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2025-03-13T18:10: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": "da2a0a0bfdc... |
38682b05-9d36-4b09-a3de-b9ed15442d53 | startupbuilders777/Algorithms-Data-Structures-and-Design | Algorithms and Data Structures Practice/C++ Leetcode Practice/804. Unique Morse Code.cpp | /*
International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows: "a" maps to ".-", "b" maps to "-...", "c" maps to "-.-.", and so on.
For convenience, the full table for the 26 letters of the English alphabet is given below:
[".-","-...","-.-.","-..","."... | ALGO | 0.999989 | 5.863883 | {
"github_metadata": {
"branch": "master",
"commit_count": 243,
"repo_created_at": "2017-08-24T19:32:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc696420... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.