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 |
|---|---|---|---|---|---|---|---|
b44fb88b-d412-4706-9fa5-b4bdb66b8ca3 | yergen/leetcode | CombinationSumII/CombinationSumII.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace::std;
class Solution {
public:
vector<vector<int>> combinationSum2(vector<int>& candidates, int target) {
sort(candidates.begin(), candidates.end());
std::vector<std::vector<int> > res;//the final results
std::vector<int> combination;//a ... | ALGO | 0.99998 | 5.556637 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-04-12T02:07: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": "aa02b6ae2... |
6f5ed528-2301-457f-aa03-2b121486f868 | rhkrwnstjd19/algorithm | algorithm/algorithm/b_1541.cpp | #include <iostream>
#include <queue>
#include <math.h> //cnt를 통해 몇의 자리(10의 몇승) 인지 알기 위해 math.h에 포합된 pow함수 사용.
using namespace std;
string s;
int sum = 0,cnt=-1,rpt;
bool minus_flag = false;
queue<int> num;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cin >> s; //입력을 문자열로 받는다.
for (int i = 0;i<s.size(... | ALGO | 0.999923 | 4.229867 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-02-09T03:41:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0768193b8ec... |
df4546a3-c538-432d-8d55-b61efa019466 | nagahara-naoki/LeetCode | #88. Merge Sorted Array.cpp | // ソート済みの配列 nums1 と nums2 がある
// nums1 のサイズは m + n で、
// 最初の m 個が本物のデータ
// あとの n 個は空きスペース(0で埋まっている)
// nums2 は n 個のデータがある
// やること
// nums1 と nums2 を一つにまとめて昇順に並べる
// 並べた結果は、nums1 の中に直接入れる(新しい配列を作らない)
#include <vector>
using namespace std;
class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>... | ALGO | 0.999952 | 5.715437 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2025-06-23T14:04:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab73ae64560... |
39e966e1-eb5a-4b66-8ce2-505a83093f96 | SakshamSahgal/Competitive-Programming | Codeforces + Codechef/B. Students and Shoelaces.cpp | #include<iostream>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cmath>
#include<climits>
#define usi unsigned short int
#define ui unsigned int
#define ulli unsigned long long int
#define lli long long int
using namespace std;
map<int,vector<int>> gph;
void Delete_Edge(i... | ALGO | 0.99988 | 4.089371 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2021-12-26T10:02: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": "f4116f56a7e... |
655658cd-0041-44c7-82f0-f05d7ac98467 | Vison307/Sukoban | ConsoleApplication1/game.cpp | #include "game.h"
#include <conio.h>
Status Game::Push() {
const int dx[] = { 0, -1, 0, 1 };
const int dy[] = { -1, 0, 1, 0 };
char ch = _getch();
if (ch == 0 || ch == 0xE0) ch = _getch();
int px = this->player_pos.first, py = this->player_pos.second;
int pxx, pyy, bxx, byy;
int twist = -1;
switch (ch) {
//左键... | ALGO | 0.990209 | 3.528245 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-11-29T14:27:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "efb113d0ea... |
296f7754-de1e-451e-97bb-22a8759d859d | anadodik/sdmm | benchmarks/distributions.cpp | #include <set>
#include <vector>
#include <benchmark/benchmark.h>
#include "sdmm/distributions/sdmm.h"
#include "sdmm/distributions/sdmm_conditioner.h"
#include "sdmm/spaces/directional.h"
#include "sdmm/spaces/euclidian.h"
#include "sdmm/spaces/spatio_directional.h"
using Scalar = float;
template <size_t PacketSi... | TEST | 0.983085 | 6.31725 | {
"github_metadata": {
"branch": "main",
"commit_count": 75,
"repo_created_at": "2020-05-19T15:37:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "326cecde49b... |
e45e2744-e108-4bb7-b7aa-946d518e3c06 | czak/aoc | 2017/cpp/day08.cpp | #include <iostream>
#include <algorithm>
#include <unordered_map>
#include <regex>
#include <limits>
using namespace std;
using reg_map = unordered_map<string, int>;
regex re {"(\\w+) (inc|dec) (-?\\d+) if (\\w+) (\\S+) (-?\\d+)"};
// 0: 'c dec -10 if a >= 1'
// 1: 'c'
// 2: 'dec'
// 3: '-10'
// 4: 'a'
// 5: '>='
//... | ALGO | 0.999761 | 5.264786 | {
"github_metadata": {
"branch": "master",
"commit_count": 281,
"repo_created_at": "2019-12-01T10:51:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "a871fb02... |
85076efc-e8d1-4ba0-9b91-52f5b59b56db | DomikoX/ElectionResultProcces | Treap.h | #pragma once
#include "BST.h"
#include "StructureItem.h"
#include "DSRoutines.h"
#include <stdexcept>
#include <random>
namespace DS
{
template <typename K, typename T>
class Treap :
public BST<K, T>
{
public:
Treap(const CompareFunction<K> compare);
Treap(const Treap<K, T>& other);
//terba konstruktor
... | ALGO | 0.926457 | 4.601502 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-10-09T09:49:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f38f2bac4... |
a0394318-1f19-444d-93ef-d84535919905 | chenhongluo/HBF | XLib/Graph/Host/src/GraphCSRMerge.cpp | #include "../include/GraphPreDeal.hpp"
#include <algorithm>
#include <exception>
#include <stdio.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <vector>
using std::vector;
namespace graph
{
static
void ToCSR(vector<int3>& TriEdgesVec,
vector<int>& Nodes,
vector<int2>& Edg... | ALGO | 0.996923 | 3.985588 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-07-09T17:21: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": "3f867b2fe5... |
22e6091a-167a-48da-8aca-3b2e6c4d2e23 | OpenFOAM/OpenFOAM-dev | src/OpenFOAM/meshes/bandCompression/bandCompression.H | /*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\... | ALGO | 0.99986 | 4.31518 | {
"github_metadata": {
"branch": "master",
"commit_count": 8589,
"repo_created_at": "2014-12-10T15:47:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1770,
"forks": 642,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "8e... |
7441a86c-1fcc-4bda-9b83-b5d801a44cab | tkozakas/school | Avys/Avys Variantas2/main.cpp | #include <iostream>
#include <fstream>
#include <iomanip>
const char FV[] = "Duomenys.txt";
const char FD[] = "Rezultatas.txt";
using namespace std;
struct Avys {
string name;
string dnr;
int koef = 0;
}dnk[20];
void read(int &n, int &m, int &num)
{
ifstream fin(FV);
fin >> n >> m >> num;
for(in... | ALGO | 0.999899 | 3.554983 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-02-03T21:04: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": "4f1f0a9247... |
f0550b7d-0866-40f4-8c37-db738d5be269 | madhu9613/dsa_codeforce_folder | stack/twostackproblem.cpp | #include<iostream>
using namespace std;
class Stack {
int* arr;
int size;
int top1;
int top2;
public:
// Constructor to initialize two stacks in one array
Stack(int s) {
this->size = s;
arr = new int[size]; // Dynamically allocate memory
top1 = -1;
top2 = s;
... | ALGO | 0.999933 | 4.916428 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2025-03-26T07:13: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": "09a00d4fde3... |
9018bf3d-5d4e-4331-b0ca-ab73c2fc8a44 | roba269/problem_solving | gcj/2019r1b/a.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
const int MAXQ = 100010;
int c1[MAXQ], c2[MAXQ];
int main() {
int T, n, q;
scanf("%d",&T);
for (int ca = 1 ; ca <= T ; ++ca) {
scanf("%d%d",&n,&q);
memset(c1, 0, sizeof(c1));
memset(c2, 0 ,sizeof(c2));
for (int i = 0 ; i < n ; ++i) {
char buf[4];
... | ALGO | 0.999851 | 3.406689 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2013-03-17T02:38: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": "fc8167a90... |
55986794-bb2f-474c-9cc0-cce51dcb8391 | krmiller678/Summer-2024-Repo | Mod8BINio/main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
using namespace std;
int main()
{
vector<int> numbers;
// Generate some random numbers
for (int i = 0; i < 20; i++)
numbers.push_back(rand() % 50 + 1);
// Write values to atext file
ofstream textFile("data/numbers.txt");
for (unsigned ... | TOOL | 0.966533 | 4.613313 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-06-14T02:21:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "31eb3ac0181... |
cb5ef865-f861-4dd8-a88c-2d7b847341aa | TarekHasan011/Problem-Solving | UVa/212.cpp | #include<bits/stdc++.h>
using namespace std;
struct patient
{
int id;
string name;
int room;
int op_begin;
int op_end;
int bed;
int re_begin;
int re_end;
int minutes_for_surgery;
int minutes_for_recovery;
};
struct roomBed
{
int id;
int minutes;
double used;
};
boo... | ALGO | 0.994569 | 3.896331 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-07-11T10:59: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": "a4560133c8... |
98dab013-1bce-4a42-9721-9850447ae114 | XieShengda/DataStructureCPP | src/stack/link/link_stack.cpp | //
// Created by Sender on 5/29/21.
//
typedef int Stack_entry;
#include "link_stack.h"
Node::Node() {
next = nullptr;
}
Node::Node(Node_entry item, Node *add_on) {
entry = item;
next = add_on;
}
Stack::Stack() {
top_node = nullptr;
}
bool Stack::empty() const {
return top_node == nullptr;
}
... | ALGO | 0.963071 | 3.902726 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-05-29T13:03: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": "d31c2dd50a... |
d815b1e1-5cda-414d-af1b-3167e4686072 | abhikabade562/R | C/3_binning/Binning.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <sstream>
#include <algorithm>
#include<bits/stdc++.h>
using namespace std;
// Equal Frequency Binning
vector<vector<int>> equalFrequencyBinning(vector<int> data, int numBins)
{
int dataSize = data.size();
int binSize = dataSize / numBins;
vector<... | DATA | 0.999372 | 6.28549 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-12-11T03:07: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": "f79ccd41798c... |
5e70d78f-3363-45fa-8e2c-36428a6750fb | cormackikkert/competitive-programming | ICPC/2015 Divisionals/keep/submissions/keep-darcy2.cpp | #include <bits/stdc++.h>
using namespace std;
double EPS = 1e-8;
struct Umb {
int x,y,r;
};
double dist(const Umb& a,const Umb& b){
return max(0.0,hypot(a.x-b.x,a.y-b.y)-a.r-b.r);
}
int main(){
int n,K,x,y;
cin >> n >> K >> x >> y;
vector<Umb> p(n);
for(int i=0;i<n;i++)
cin >> p[i].x >> p[i].y >>... | ALGO | 0.999952 | 3.896802 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-05-25T12:47: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": "dbad0467d... |
e59ccca6-c7f8-4cd6-b7c0-fe51a22adf64 | gChagasGit/robotica | banca_servos_2/banca_servos_2.ino | #include <Servo.h>
Servo servo1;
//Servo servo2;
//Servo servo3;
int angles[3] = {0, 90, 90}; // array que armazena os ângulos dos 3 servos
int minAngle = 0;
int maxAngle = 180;
int minPulseWidth = 580;
int maxPulseWidth = 2770;
void setup() {
Serial.begin(9600);
servo1.attach(5, minPulseWidth, maxPulseWidth);... | TOOL | 0.936322 | 4.177604 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-04-13T22:03: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": "fb7dedfa9aae... |
f20149c0-a3de-40fa-be49-8e78dea60308 | Sharafabdullah/CompetitiveProgramming | contests/SerialCPC/H_Good_Array.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(v) ((v).begin()), ((v).end())
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define pb push_back
#define ppb pop_back
#define F ... | ALGO | 0.999031 | 3.820966 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2023-05-31T06:13:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03e1afd21... |
6fb988d6-fe60-4fce-9244-a517c08c233d | TacNap/cpp_leetcode | easy.cpp | #include "easy.h"
#include <iostream>
#include <map>
#include <set>
#include <unordered_set>
#include <algorithm>
#include <vector>
#include <array>
using namespace std;
//#include <unordered_map>
/*
The dictionary doesn't need to include paired combinations - it could also be changed to just 'char'.
"IV" is equivalen... | ALGO | 0.998166 | 5.609102 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-01-24T01:33: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": "d587fb8b48df... |
17f30d9e-4eb2-4473-8ad7-b45403f0b111 | OmarAhmedSaleh/competitive-programming | codeforces/B.-RGB-plants-GYM.cpp | #include <cstring>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <c... | ALGO | 0.999826 | 3.676304 | {
"github_metadata": {
"branch": "master",
"commit_count": 686,
"repo_created_at": "2016-11-28T15:02:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4cbbe7b... |
140d3708-e6cd-4c2d-8063-ae0de39bb42f | feelpp/feelpp-book | en/03-modeling/Examples/advection_model.cpp |
#include <feel/feelmodels/advection/advection.hpp>
namespace Feel
{
template <uint16_type OrderAdvection>
void
runAdvectionApplication()
{
using namespace Feel;
typedef FeelModels::Advection<
Simplex<FEELPP_DIM,1>,
Lagrange<OrderAdvection, Scalar,Continuous,PointSetFekete> > model_type;
... | ALGO | 0.996698 | 5.731462 | {
"github_metadata": {
"branch": "master",
"commit_count": 2748,
"repo_created_at": "2015-05-10T17:53:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 5,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9ef11d1... |
4211d4d0-f8c5-41c9-ae69-61aad8584ee6 | OU-CLDT-BTL/B-i-T-p-nh-m-8 | BT nhóm CTDL GK/CodeC2/BTH2_BT11.cpp | #include <iostream>
using namespace std;
struct Node {
int data;
Node* next;
};
typedef struct Node* node;
void init(node back) {
back = NULL;
}
int isEmpty(node back) {
if (back == NULL)
return 1;
return 0;
}
node makeNode(int x) {
node tmp = new Node();
tmp->data = x;
tmp->next = NULL;
return tmp;
}
void ... | ALGO | 0.973075 | 3.631653 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-08-29T14:16:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e794f4d35972c... |
c7c3f82e-a896-41b0-ac2b-86dc00ec3794 | Calebsakhtar/MathTools | src/Distribution.cpp | #include<algorithm>
#include "../headers/Distribution.h"
#include "../headers/MathTools.h"
namespace MathTools {
// *********** DISTRIBUTION FUNCTIONS *********** //
double Distribution::evaluate_CDF(const double x) const {
// Evaluates the CDF of the Distribution at the point x.
//
// This is done by numeri... | ALGO | 0.999863 | 5.780055 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2023-03-28T17:10: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": "c74bc0ddea... |
c8e8415e-1d73-496c-a641-702bb97835a1 | maksverver/cses | stick-lengths.cc | // Stick Lengths
// https://cses.fi/problemset/task/1074
//
// Solution:
// The optimal length is the median element.
//
// Rationale: let's say we pick some target L and calculate the total cost.
//
// Let's say there are A sticks which are strictly shorter than L, and B
// sticks that have length greater than or equa... | ALGO | 0.999817 | 5.686731 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2023-04-11T10:04: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": "968746a03... |
f81340cd-4c62-4980-aa90-f089ac9a0e3e | ShenpaiSharma/hello-world | DPMinSol.cpp | #include <iostream>
using namespace std;
int Solution(int n){
if(n ==1){
return 0;
}
int ans = 1+Solution(n-1);
if(n%2 == 0){
ans = min(ans,(1+Solution(n/2)));
}
if(n%3 == 0){
ans = min(ans,(1+Solution(n/3)));
}
return ans;
}
int SolutionDP(int* dp,int n){
i... | ALGO | 0.999979 | 4.103163 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2020-04-09T13:54: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": "f92cab901... |
1117e03c-e678-498d-814e-418e40ba5664 | DHEERAJHARODE/Hacktoberfest2024-Open-source- | C++/Bubble Sort.cpp | #include<iostream>
using namespace std;
void swapping(int &a, int &b) { //swap the content of a and b
int temp;
temp = a;
a = b;
b = temp;
}
//displaying sorted array
void display(int *array, int size) {
for(int i = 0; i<size; i++)
cout << array[i] << " ";
cout << endl;
}
void bubbleSort(in... | ALGO | 0.99977 | 4.342079 | {
"github_metadata": {
"branch": "main",
"commit_count": 945,
"repo_created_at": "2020-10-03T04:58:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 473,
"forks": 3840,
"issues": 177,
"pull_requests": 1367
},
"file_meta": {
"content_id": "... |
368dc965-89be-405a-af86-536be6cc46d2 | CXYhh121/Data-Structure | 二叉树的深度/二叉树的深度/test.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;
//二叉树的最大深度,递归求解
//class Solution {
//public:
// int maxDepth(TreeNode* root) {
// if (root == NULL)
// return 0;
//
// int left = maxDepth(root->left);
// int right = maxDepth(root->right);
//
// return (left > right) ? (left + 1) : (right... | ALGO | 0.9997 | 4.919829 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2019-01-11T10:36:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "65e38f25e... |
1d24dd54-177e-4f5c-ade4-76ff65a006a5 | bukanyohandi/personal-website | static/archive/The-Chinese-University-of-Hong-Kong-Shenzhen/SchOJ/usaco20opensilver1.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, m;
cin >> n >> m;
vector<pair<int, int>> interval(m);
for (int i = 0; i < m; ++i) {
cin >> interval[i].first >> interval[i].second;
}
sort(interval.begin(), interval.end());
long ... | ALGO | 0.999995 | 4.663772 | {
"github_metadata": {
"branch": "main",
"commit_count": 235,
"repo_created_at": "2023-07-23T03:48:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2201c436e... |
877eaceb-63c0-495a-826f-7d00d16493a6 | agrwalh/DSALEARN | binarysearch.cpp | #include <iostream>
using namespace std;
int binarysearch(int arr[], int s, int e, int k)
{
if (s > e)
{
return false;
}
int mid = s + (e - s) / 2;
if (arr[mid] == k)
{
return true;
}
else if (arr[mid] < k)
{
return binarysearch(arr, mid + 1, e, k); // right p... | ALGO | 0.999966 | 5.067686 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-12-14T17:34: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": "d0747bddc68c... |
92e0a4f6-b5d6-4d66-9bb1-f62495e55600 | SgAkErRu/labs-se | 3 course/spo_lab/lab02/translator.cpp | #include "translator.h"
#include "mathparser.h"
#include <fstream>
#include <string_view>
#include <iostream>
#include <iomanip>
using VM_types::COP;
using VM_types::Prefix;
using VM_types::byte_t;
using VM_types::data_t;
using VM_types::address_t;
using ASM_types::Error;
using ASM_types::LabelValue;
using ASM_types::... | ALGO | 0.93696 | 4.818541 | {
"github_metadata": {
"branch": "master",
"commit_count": 427,
"repo_created_at": "2021-11-24T21:13: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": "94a45d24... |
be84f805-ba52-4e8d-b113-ef9cbc57908f | Aphrodicez/POSN | POSN17/Camp3/KU01/KU_Bear_Pretty.cpp | /*
Author : ~Aphrodicez
School : RYW
Lang : CPP
Algo : Brute Force Algorithm
Status : Accepted
*/
#include <bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()
#define pc(x) putchar(x)
#define dec(x) fixed << setprecision(x)
void setIO();
const... | ALGO | 0.999678 | 3.776877 | {
"github_metadata": {
"branch": "master",
"commit_count": 270,
"repo_created_at": "2020-11-21T02:11:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "733ab3fe... |
4be8fb31-c85a-429f-b0b9-3e9682201290 | Bless-Han/Workspace | C++PrimerPlus/Chapter_11/编程练习/3/ranwalk.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include "vect.h"
int main()
{
using namespace std;
using VECTOR::Vector;
srand(time(0));
double direction;
Vector step;
Vector result(0.0, 0.0);
unsigned long steps = 0;
double target;
double dstep;
int times;
int min, ... | ALGO | 0.998845 | 3.409906 | {
"github_metadata": {
"branch": "main",
"commit_count": 508,
"repo_created_at": "2021-05-04T04:48: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": "8ffd8d653d... |
7662c284-8a04-4a8d-9b69-a8f3d61e3adc | Menny11/EducationalTasks | sudoku/src/sudoku.h | /*
* sudoku.h
*
* Sudoku solver header
* created by <NAME> <EMAIL>
*
*/
#ifndef SUDOKU_H
#define SUDOKU_H
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <exception>
typedef int Cell;
typedef std::vector<Cell> Row;
class BitMask;
class Table
{
public:
Table() = default;
Tab... | ALGO | 0.946858 | 5.93791 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-02-01T08:40: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": "26885e6085... |
a07aad4f-9b9d-4dd5-9ee6-9145b83e80c2 | ishandutta2007/codeforces-f | flashmt/normal/455/B.cpp | #include <bits/stdc++.h>
using namespace std;
struct Trie
{
Trie *next[26];
int win, lose;
Trie()
{
for (int i = 0; i < 26; i++) next[i] = NULL;
win = lose = 0;
}
void build(string &s, int id)
{
if (id == s.size()) return;
int ch = s[id] - 'a';
if (!next[ch]) next[ch] = new Trie... | ALGO | 0.999971 | 4.240489 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e3258e3c3d25... |
0189542d-b4af-45bc-a6d6-c1e0a0e94e6b | Aninha1105/conta-palavras-tdd-MP | conta_palavras.hpp | /**
* \file conta_palavras.hpp
* \brief Declaração das funções para o contador de palavras.
* \author <NAME> - 231003442.
*/
#ifndef CONTA_PALAVRAS_HPP_
#define CONTA_PALAVRAS_HPP_
#include <string>
#include <vector>
#include <utility>
/**
* \brief Função principal que chama as auxiliares para contar e ordenar a... | ALGO | 0.983772 | 6.068678 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2025-01-14T00:23: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": "0ebe7cb3337... |
748fee47-4f22-4ed2-ba9e-ede857cd52aa | LARG/robotics-2018 | core/motion/rswalk2014/utils/matrix_helpers.hpp | #pragma once
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
#include <boost/numeric/ublas/lu.hpp>
/* Creates a matrix that Rotate vector about the z axis
* Currently needed for our robot relative coordinate system
*/
template <typename T>
boost::numeric::ublas::matrix<T> rotateZMatr... | TOOL | 0.981791 | 5.202034 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2018-08-20T22:30:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6dd55f6b7... |
096488ec-9853-40f8-b0f9-3fe56cf017ed | NicholasRobishaw/INF-HW2 | test.cpp | #include "main.h"
using namespace std;
int main(){
string str_One = "Big";
string str_Two = "Apples";
string str_Three = "Bid";
string return_Arr[3] = {str_One, str_Two, str_Three};
cout << "Initial array unsorted\n";
for(int index=0; index < 3; index++){
cout << return_Arr[index] <... | ALGO | 0.995692 | 4.582122 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-06-26T20:26: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": "9bd16a35c1aa... |
157926e2-543b-4d45-89d9-997ffd026e01 | carter468/boj-cpp | 12760.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool cmp(int a, int b) {
return a > b;
}
int main() {
int n, m, max_val;
cin >> n >> m;
vector<vector<int>> num(n, vector<int>(m));
vector<int> ans(n);
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++)
cin >> num[i][j]... | ALGO | 0.999991 | 3.478359 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2023-02-24T06:37: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": "f0d98aec83e... |
76cb1620-8bfa-45a8-9ff4-71475d9b2b79 | lineCode/FactoryEngine | Geometry/Segment.cpp |
#include <Geometry/Segment.h>
#include <Geometry/Triangle.h>
namespace ftr {
const float kEpsilon = 0.00000001f;
float Segment::DistanceFromPoint(const glm::vec3& point) const
{
return glm::length(NearestPoint(point) - point);
}
glm::vec3 Segment::NearestPoint(const glm::vec3 &testPoint) const
{
c... | ALGO | 0.999324 | 6.590824 | {
"github_metadata": {
"branch": "depthTree",
"commit_count": 339,
"repo_created_at": "2020-02-13T01:52:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb8ac... |
659732a4-b1ba-403b-91cb-ee963162e00b | MAZHARMIK/Interview_DS_Algo | Greedy/Minimum Replacements to Sort the Array.cpp | /*
MY YOUTUBE VIDEO ON THIS Qn : https://www.youtube.com/watch?v=2nRXvlxkU2Y
Company Tags : GOOGLE
Leetcode Link : https://leetcode.com/problems/minimum-replacements-to-sort-the-array/
*/
************************************************** C++ *****************************... | ALGO | 0.999838 | 5.774182 | {
"github_metadata": {
"branch": "master",
"commit_count": 5946,
"repo_created_at": "2020-07-12T13:13:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2586,
"forks": 1357,
"issues": 7,
"pull_requests": 37
},
"file_meta": {
"content_id": "... |
c1ca6794-e996-4987-a6e5-e47db31321a8 | MaleekNoob/PF | PF-Assignments/TA-Assign-4_Sol/q3,q4.cpp | #include<iostream>
using namespace std;
int gcd(int x, int y)
{
if(x<0 || y<0)
return -1;
if (y > x)
gcd(y, x);
if (y == 0)
return x;
else
return gcd(y, x % y);
}
int reverse(int x,int rev=0)
{
if (x == 0)
return rev;
else
return reverse(x / 10, rev * 10 + x % 10);
}
void show_all_palindromes(... | ALGO | 0.998452 | 4.438766 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-05-19T07:26:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "385ca47fb1d2... |
2d2dced5-4c0c-4849-982f-b43b1b7f37f1 | ishandutta2007/codeforces-a | atreus/normal/1056/B.cpp | #include <bits/stdc++.h>
#define F first
#define S second
#define PB push_back
#define PF push_front
#define MP make_pair
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
int mark[200];
int main() {
ios_base::sync_with_stdio(false);
int n, m;
cin >> n >> m;
ll cnt... | ALGO | 0.999824 | 3.963711 | {
"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": "a0a21418ad20... |
65419990-e9a2-4c3a-8c23-0a3d2ee3e816 | Lebo2678/Embedded-Project | Embedded Project/Project.cp | #line 1 "C:/Users/pc/OneDrive - Egyptian Ministry of Education/Desktop/Embedded Project/Project.c"
int w_count = 23;
int s_count = 15;
int y_count = 3;
char str = 'w';
void Automatic();
void manual();
void main() {
ADCON1 = 7;
trisA.B0 = 1;
trisA.B1 = 1;
trisA.B2 = 1;
trisB = 0;
portB = 0;
trisC = 0;
portC = ... | ALGO | 0.966009 | 3.959868 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-08-08T20:05:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7bde42005... |
aa90fb2c-49bd-4d43-bc9e-a2a27f098abe | mingpuwu/Daily-development | alg/trie/trie.cpp | /*
前缀树,字典树
*/
#include <string>
#include <iostream>
#include <vector>
#include <memory.h>
#define MaxNum 26
using namespace std;
struct Node
{
int pass = 0;
int end = 0;
char c = 0;
Node *next[MaxNum] = {nullptr};
Node(int p, int e,char c)
{
this->pass = p;
this->end = e;
... | ALGO | 0.999587 | 3.840852 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2018-12-18T15:27: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": "4f3a38ecd... |
8f6959cc-c65c-482f-95f5-be6f6a0fe4e1 | angelf02/Proyecto_Electromagnetismo | src/Gauss_Seidel.cpp | #include <iostream>
#include <vector>
#include <cmath> // Para std::abs
#include <algorithm> // Para std::max
double calcular_delta(const std::vector<double> &phi, const std::vector<double> &phi_copy) {
double delta = 0.0;
for (size_t i = 0; i < phi.size(); ++i) {
delta = std::max(delta, std::abs(phi[i... | ALGO | 0.99979 | 5.171056 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2024-11-14T04:48:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3cf6b68850f... |
6cdf7d0d-0719-4e0a-8e90-bb2de7150d44 | marak89/cpplessons | tree/main.cpp | #include <iostream> // dołączanie zewnętrznej biblioteki - iostream
using namespace std; // używamy standardowej przestrzeni nazw
void lejek(){
int i = 0;
for (;i<10;i++) { // pętla zewnętrzna
for (int s=(0);s<i;s++) { // pętla wewnętrzna
cout << " " ; // wyświetlanie spacji przed gwiazdkami
... | ALGO | 0.993936 | 3.083572 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2019-05-17T15:15: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": "260dbee6e... |
792382b3-c889-47b7-a1da-8a621dbf4791 | bman776/Portfolio_Advanced-Programming-Projects | SignalConvolver/FinalVersion/FFTConvolveProfiled.cpp | /*
CPSC501 FALL2023 Assignment 4 Submission
<NAME> 30009390
*/
#include <filesystem>
#include <WaveReader.hpp>
#include <WaveWriter.hpp>
#include <BasicConvolve.hpp>
#include <FFTconvolve.hpp>
int main (int argc, char *argv[]) {
WaveReader wav_reader = WaveReader();
WaveWriter wav_writer = WaveWriter();
FFTco... | ALGO | 0.960596 | 6.335808 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2024-03-07T22:28: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": "38eeecf0483... |
3e1205e2-e69b-4071-8c74-08fb632332a7 | yashgautam12049/My_Leetcode_problems | 1496-lucky-numbers-in-a-matrix/1496-lucky-numbers-in-a-matrix.cpp | class Solution {
public:
vector<int> luckyNumbers(vector<vector<int>>& matrix) {
int index;
int index_r,index_c;
vector<pair<int, int>> row;
vector<int> min;
vector<int> ans;
int n = matrix.size();
int m = matrix[0].size();
for (int i = 0; i < n; i++) ... | ALGO | 0.999918 | 6.506691 | {
"github_metadata": {
"branch": "main",
"commit_count": 744,
"repo_created_at": "2024-07-04T19: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": "afe6f4b2f8... |
72337e95-6671-45bb-9c00-3b96ee8506c0 | cos18/COM3026-Algorithm | greedy/task_scheduling.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
ostream& operator<<(ostream& os, const vector<pair<int, int>>& vp)
{
os << "[";
for(int i=0;i<vp.size();i++){
os << "[" << vp[i].first << ", " << vp[i].second << "]";
if(i!=vp.size()-1) os << ", ";
}
os << "... | ALGO | 0.999191 | 4.548139 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2019-09-05T07:48:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5028f89f0... |
089a82a1-8891-4151-b2ee-af0c7ca708c2 | gougon/LeetCode | 39-CombinationSum/combinationSum.cpp | #include <iostream>
#include <bits/stdc++.h>
#include "../utils/Utils.cpp"
using namespace std;
class Solution {
public:
vector<vector<int>> combinationSum(vector<int>& candidates, int target) {
int n = candidates.size();
vector<vector<int>> ans;
DFS(candidates, ans, {}, 0, target);
... | ALGO | 0.999976 | 6.100728 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2022-10-21T14:41: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": "84698348d... |
e1271005-012b-4ca6-9f3f-b70a9970458f | Factoriall/Algorithm-2021 | LCA/11438_lca2.cpp | #include <iostream>
#include <vector>
using namespace std;
const int MAX = 100000;
vector<int> adj[MAX];
int parent[MAX][18];
int depth[MAX];
int N, M;
void makeTreeByDFS(int now, int dep, int prev) {
parent[now][0] = prev;
depth[now] = dep;
for (int next : adj[now]) {
if (next != prev) {
makeTreeByDFS(nex... | ALGO | 0.999998 | 5.06296 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2020-09-23T06:06:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98ba89d85... |
89e106f6-725d-4657-8281-75fe3388e040 | selective-inference/Python-software | selectinf/src_C/HmcSampler.cpp | /*
* File: HmcSampler.cpp
* Author: aripakman
*
* Created on July 4, 2012, 10:44 AM
*/
#define _USE_MATH_DEFINES // for the constant M_PI
//#include <cstdlib>
#include <cmath>
#include <tr1/random>
#include <Eigen/Dense>
#include <magnet/math/quartic.hpp>
#include "HmcSampler.h"
using namespace std;
using... | ALGO | 0.996376 | 5.433815 | {
"github_metadata": {
"branch": "master",
"commit_count": 2956,
"repo_created_at": "2015-01-25T02:39:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 52,
"forks": 36,
"issues": 4,
"pull_requests": 1
},
"file_meta": {
"content_id": "96c754... |
aef9f8c5-1a9c-46fc-a17b-591359e07a92 | stella6767/basicPracticeAndAlgorithm | 알고리즘 연습2/과제dpcpp.cpp | #include<iostream>
#include<string>
#include<memory.h>
#include<time.h>
using namespace std;
int dp[16][16];
//테스트 케이스 문자열 a와 b의 길이는 최대 15
//dp[i][j]=a문자열 i번째까지 b문자열 j번째 까지 사용했을때
//c문자열이 셔플문자열이 가능한지 불가능한지를 나타냄
string a, b, c;
int aLen;
int bLen;
void solve() {
for (int j = 0; j <= aLen; j++) {
for (int k = 0; k <= ... | ALGO | 0.999821 | 4.63062 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-08-08T18:18: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": "592bc60870... |
1d0850a9-2e46-4ed0-ae18-f844302cf277 | tanishqtajne25/DSA-sem3 | DSA_sem3/ass1c_123B1B276.cpp | //123B1B276
//ass1c
//c. Arrange list of students to find out first ten toppers from a class using Radix sort.
#include <iostream>
using namespace std;
class Student{
int rno;
string name;
float sgpa; // CGPA in float
public:
// Function to input student details
void read(){
cout << ... | ALGO | 0.999891 | 6.456337 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-29T18:28: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": "ab2e44b26039... |
54329b49-2bcb-4062-98b6-34b459739684 | freedom1y/KyouPro | AtCoder/ABC040/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX = 1e5+10;
const ll INF = 1e9;
template<class T> inline bool chmin(T& a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
int main() {
int N; cin >> N;
int h[MAX];
for (int i = 0; i < N; ++i) cin... | ALGO | 0.999941 | 4.077526 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-02-28T07:46: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": "62d3c12c5... |
926a2aec-b95c-4705-a389-ae07404c32d6 | GipnoMops/Basics-and-methodology-of-programming-cpp | kontest 5/9/main.cpp | #include <iostream>
int gcd(int a, int b) {
while (b) {
a %= b;
std::swap(a, b);
}
if (a < 0) {
return -a;
} else {
return a;
}
}
class Rational {
int numerator_;
int denominator_;
public:
Rational(int numerator = 0, int denominator = 1) {
numer... | ALGO | 0.999483 | 5.817706 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-07-05T11:50: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": "9b69a1253552... |
bcf7268e-f728-4b4d-a65b-6e7053c3eee7 | ishandutta2007/codeforces-s | shadowlight/normal/1190/D.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
struct TNode {
int L, R;
TNode *left, *right;
int sum;
};
TNode *new_node(int L, int R) {
return new TNode({L, R, nullptr, nullptr, 0});
}
int safe_sum(TNode *root) {
return (root ? root->sum : 0);
}
void relax(TNode *root) {
if (!root) retur... | ALGO | 0.999454 | 3.890602 | {
"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": "e6e73d1e334c... |
78b04c9b-cf64-437e-a069-7368b873bd12 | mkaouer/Code-Smells-Detection-in-JavaScript | JS-CS-Detection-byExample/Dataset (ALERT 5 GB)/362764/shogun-3.1.1/shogun-3.1.1/tests/unit/mathematics/linalg/LogDetEstimator_unittest.cc | /*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* Written (W) 2013 <NAME>
*/
#include <shogun/lib/common.h>... | TEST | 0.976211 | 6.825146 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2016-11-16T11:47:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 4,
"issues": 0,
"pull_requests": 18
},
"file_meta": {
"content_id": "cae1ee83... |
044be145-9d2e-45f2-bf6a-e8e0c8f6b5bf | gimli-org/gimli | core/src/vectortemplates.h | /******************************************************************************
* Copyright (C) 2006-2024 by the GIMLi development team *
* <NAME> <EMAIL> *
* *
* Licensed under the ... | TOOL | 0.93967 | 5.969968 | {
"github_metadata": {
"branch": "master",
"commit_count": 5285,
"repo_created_at": "2013-09-04T21:10:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 416,
"forks": 146,
"issues": 31,
"pull_requests": 0
},
"file_meta": {
"content_id": "b30... |
c4f96a17-e2ba-4294-81e8-827bf75b00f4 | ayukumi-cmd/Leetcode_solutions | 2227-sum-of-subarray-ranges/2227-sum-of-subarray-ranges.cpp | class Solution {
public:
long long sumofSubarrayrange(vector<int>& arr) {
int n = arr.size();
vector<long long> lefts(n, 0), rights(n, 0);
vector<long long> leftm(n, 0), rightm(n, 0);
stack<pair<int, long long>> sLeft, sRight;
stack<pair<int, long long>> mLeft, mRight;
... | ALGO | 0.999955 | 5.874538 | {
"github_metadata": {
"branch": "main",
"commit_count": 2535,
"repo_created_at": "2024-04-10T15:11: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": "7e03a8c14... |
ff39ce36-27a7-4fc3-ba64-4a577a56ac03 | SteBry/competitive_programming | kattis/setstack/setstack.cpp | #include <bits/stdc++.h>
#include <stack>
#include <vector>
#include <set>
#include <string>
#include <iostream>
#include <algorithm>
//#define REP(var, k) for (int var = 0; var < (int) k; ++var)
using namespace std;
//using vi=vector<int>;
void solve_case()
{
int nr_operations;
cin >> nr_operations;
//... | ALGO | 0.998045 | 5.521561 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2019-02-19T17:54: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": "77034ba2a... |
a3bd91d0-45ae-409b-a80c-62bf0aa8590a | varshit97/MPI | grep.cpp | #include <iostream>
#include <fstream>
#include <pcre++.h>
#include <map>
#include "mpi.h"
using namespace std;
int main(int argc, char * argv[]){
int world_rank, world_size;
MPI_Status status;
map<string, long> words;
map<string, long>::iterator it;
char line[1024];
string sline;
int source = 0;
int p = 0, i,... | TOOL | 0.973791 | 3.537114 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-09-29T13:55: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": "a63d4155ff... |
29e1ca52-3632-44bd-92e8-9e6bc58f687f | acxdme/LB_-indestructable | Debug/Queue/01.cpp | // debugging in queue implementation using 2 stacks
#include <iostream>
#include<stack>
using namespace std;
class MyQueue {
public:
stack<int> s1;
stack<int> s2;
MyQueue() {
}
void push(int x) {
s1.push(x);
}
int pop() {
while (!s1.empty()){
... | ALGO | 0.987187 | 3.885082 | {
"github_metadata": {
"branch": "main",
"commit_count": 662,
"repo_created_at": "2023-02-10T16:50: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": "ec1a50d1c6... |
37b5518b-f188-4082-93c7-7379d50c886c | asdfvar/numerical_sandbox | raytracing/body.cpp | #include "comm.h"
#include "vector.h"
#include "object.h"
#include "iostream"
#include "ray.h"
#include "queue.h"
#include "tags.h"
#include <cmath>
#define TOTAL_NUM_CELL_ROWS 1000
#define PI 3.14159265358979323
int main (int argc, char *argv[])
{
const int head_rank = 0;
const int this_module = 1;
const ... | ALGO | 0.997647 | 4.812886 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2020-08-30T00:41: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": "03492025d... |
67845a0b-0950-4acd-969c-760978fccd2d | SejalDhadve/Logic-Building-Assignments | Assignment_37/Program1.cpp | /*Complete below code snippet of below functions
1.SearchLast()
2.EvenCount()
3.OddCount()
4.SumAll()
*/
#include <iostream>
using namespace std;
class Array
{
protected:
int *Arr;
int size;
public:
Array(int value = 10)
{
cout << "Inside Constructor\n";
this->size = value;
t... | ALGO | 0.981217 | 4.420858 | {
"github_metadata": {
"branch": "main",
"commit_count": 89,
"repo_created_at": "2025-05-11T18:27: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": "acf7cc12801... |
ea0ae704-daa7-40e9-b9e9-e8ce9c44e2bd | nvnnv/Leetcode | 1471. The k Strongest Values in an Array.cpp | public:
vector<int> getStrongest(vector<int>& arr, int k) {
if(arr.size() == 1) return arr;
sort(arr.begin(), arr.end());
int index = (arr.size() - 1) / 2;
int m = arr[index];
vector<int> strong;
int left = 0;
int right = arr.size() - 1;
while (k > 0)
{
int t1 = abs(arr[left]... | ALGO | 0.99999 | 5.177194 | {
"github_metadata": {
"branch": "master",
"commit_count": 413,
"repo_created_at": "2019-09-29T06:38: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": "4a1162ec... |
c2f351a0-c36a-4eb7-8080-58ec16cb84d8 | Christopher42/computational-mathematics | differentialEquationSolvers/ellipticSolvers/code/tridiagTest.cpp | #include <iostream>
#include "tridiag.h"
double f (double x)
{
return sin(x*3.14159);
}
double k (double x)
{
return 1;
}
void printVector (std::vector<double> x)
{
std::cout << '[' << x[0];
for (int i=1;i<x.size();++i)
std::cout << ", " << x[i];
std::cout << ']' << std::endl;
}
void printElliptic(TridiagSys... | ALGO | 0.997872 | 5.470577 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2017-09-15T12:48:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "6cf97196b... |
05c2636a-1dbf-432e-a841-4caceb5ff05a | dmccreary/coderdojo-robots | src/v1/robot_servo_ping/robot_servo_ping.ino | #include <Servo.h>
#include <Adafruit_NeoPixel.h>
// the pin that the servo is on
const int servoPin = 11;
// ping sensor
const int pingPin = 10;
const int ledPin = 12; // the pin that the LED strip is on
const int numberPixels = 10;
int dist_in_cm = 120;
Servo myservo; // create servo object to control a servo
int ... | TOOL | 0.99178 | 5.842839 | {
"github_metadata": {
"branch": "master",
"commit_count": 199,
"repo_created_at": "2015-03-30T00:55:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e2b52... |
4c827839-82e8-4242-9110-d6c1264d589d | Jak57/academic-courses-cse-sust | CSE374_Computer Graphics Lab/Graphics Lab/bresenham_line_algorithm.cpp | /**
Topic: Bresenham's Line Drawing Algorithm
Date: 26-10-22
*/
#include<bits/stdc++.h>
using namespace std;
void plotLine(int x0, int y0, int x1, int y1)
{
int dx, dy, D, x, y;
dx = x1 - x0;
dy = y1 - y0;
D = 2*dy - dx;
x = x0;
y = y0;
while (x <= x1) {
printf("--- %d %d\n", x,... | ALGO | 0.998835 | 3.646916 | {
"github_metadata": {
"branch": "master",
"commit_count": 117,
"repo_created_at": "2020-04-17T05:34:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "142fdef4... |
9329ee0b-3c72-4926-8af8-4e02d3d90133 | rohingosling/common-cpp | platform/simulated_annealing_optimizer/trainer/training_engine.cpp | //--------------------------------------------------------------------------------------------------------------------------------------------------------------
// Project: Entelect 100k challenge.
// Application: Agent Training Engine
// Class: TrainingEngine
// Version: 1.0
// Date: 2015
// Author: ... | ALGO | 0.969936 | 6.805826 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2016-08-23T21:51:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a8b1044b... |
ac45f52a-f103-470c-a0e4-b69be7ef6617 | sidangvn/Dijkstra-s-Algorithm | Graph.cpp | #include "Graph.hpp"
#include <queue>
#include <string>
#include <math.h>
using namespace std;
//Construction
Edge::Edge()
{
dist1 = "";
dist2 = "";
weight = 0;
}
//Deconstruction
Edge::~Edge(){}
//add Vertex
void Graph::addVertex(std::string label)
{
vertexList.push_back(label); //add label into vertex vector
... | ALGO | 0.998827 | 4.130032 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-01-28T04:52:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b81ff1442... |
9f8b4833-5a9e-454b-9994-ef3e4822bbff | JustintheButton/Coursera_Algorithm_Princeton | Collinear_Points/Collinear_Points/Collinear_Points.cpp | #include <bits/stdc++.h>
using namespace std;
class Point;
class Point {
public:
Point() {
_x = 0;
_y = 0;
}
Point(int x, int y) {
_x = x;
_y = y;
}
string toString() {
auto xString = to_string(_x);
auto yString = to_string(_y);
return "(" + xS... | ALGO | 0.999557 | 4.376776 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2021-11-24T22:15: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": "ac2625c92f... |
f1f69d6c-98af-4242-820d-1e2c915e4942 | ishandutta2007/codeforces-a | alishahali1382/normal/1718/C.cpp | #include <bits/stdc++.h>
#pragma GCC optimize ("O2,unroll-loops")
//#pragma GCC optimize("no-stack-protector,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> ... | ALGO | 0.999839 | 4.338939 | {
"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": "a90a35454dad... |
90d155af-79b0-4658-9c8d-d0bf271757f3 | YosysHQ/yosys | libs/minisat/SolverTypes.h | /***********************************************************************************[SolverTypes.h]
Copyright (c) 2003-2006, <NAME>, <NAME>
Copyright (c) 2007-2010, <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), ... | TOOL | 0.951359 | 3.390517 | {
"github_metadata": {
"branch": "main",
"commit_count": 15303,
"repo_created_at": "2013-01-05T10:10:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3933,
"forks": 973,
"issues": 482,
"pull_requests": 128
},
"file_meta": {
"content_id": "... |
01208297-9d53-4147-9b6b-28b68c07cdee | PyMesh/PyMesh | tools/MeshUtils/IndexHeap.h | /* This file is part of PyMesh. Copyright (c) 2015 by <NAME> */
#pragma once
#include <cassert>
#include <vector>
#include <algorithm>
namespace PyMesh {
template<typename T>
class IndexHeap {
public:
IndexHeap(bool max_heap = true) {
init_comp(max_heap);
}
IndexHeap(const std... | ALGO | 0.96659 | 5.568443 | {
"github_metadata": {
"branch": "main",
"commit_count": 2064,
"repo_created_at": "2015-06-06T17:17:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1987,
"forks": 373,
"issues": 237,
"pull_requests": 11
},
"file_meta": {
"content_id": "43... |
ece59a63-8c44-4aec-9e0f-e95cab38a064 | huangbin0709/ImageDIY | ImageDIY/jni/LineDetect.h | #pragma once
#include "cv.h"
#include "cxcore.h"
#include "highgui.h"
#include "math.h"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
using namespace cv;
using namespace std;
//#define MAXNUM_LINE_CANDI 30
#define MAXNUM_LINE_CANDI 30
//#define CORNER_WIDTH 10
#define CORNER_WIDTH 10
#d... | TOOL | 0.976233 | 3.403407 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-07-10T03:32:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "120c4b932... |
2b48058e-452d-41a1-a0a6-e2fb0b4d4561 | shubhamsingh310/leetcode-solutions | 0714-best-time-to-buy-and-sell-stock-with-transaction-fee/0714-best-time-to-buy-and-sell-stock-with-transaction-fee.cpp | class Solution {
public:
int dp[99999][2];
// Function to solve the problem recursively
int solve(vector<int> &prices, int fee, int itr, int hold) {
if (itr >= prices.size()) return 0;
if (dp[itr][hold] != -1) return dp[itr][hold];
int ans = 0;
// Checking if current stock ... | ALGO | 0.999982 | 5.525961 | {
"github_metadata": {
"branch": "main",
"commit_count": 1546,
"repo_created_at": "2022-11-17T09:25: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": "979728e78... |
5c7f11a5-3598-4032-b454-01859a450c17 | gwealm/FEUP-PROG | ficha1/cap2/2.07a.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
int n; // User input. It's an unsigned int, because it is incorrect to say a negative number is prime
bool isPrime = true; // Boolean variable which will track if the number is or is not prime
... | ALGO | 0.997493 | 4.519701 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2021-02-07T23:26:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17cacbd5f26... |
9e56a843-976a-4371-9815-2a128b582704 | AyakaKamata/Atcoder | src/abc088_d.cpp | #include <bits/stdc++.h>
#define rep(i, a, b) for (ll i = a; i < b; i++)
#define rrep(i, a, b) for (ll i = a; i >= b; i--)
#define fore(i, a) for (auto &i : a)
#define all(x) (x).begin(), (x).end()
#pragma GCC optimize("-O3")
using namespace std;
using ll = long long;
using ld = long double;
using i128 = __int128_t;
u... | ALGO | 0.999913 | 4.651752 | {
"github_metadata": {
"branch": "main",
"commit_count": 175,
"repo_created_at": "2025-01-10T17:02:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0c0bfb4a6... |
7c4e875f-8f02-4a34-9a51-c68e71706a11 | YeonWon123/2019_Problem_Solving | 문제해결 중간고사 준비/동전 0/동전 0.cpp | // greedy 알고리즘
#include <iostream>
using namespace std;
int arr[10];
void sum_value(int & sum, int & counts, int N, int K);
int main(void)
{
int N, K;
int counts = 0;
cin >> N >> K;
for (int i = 0; i < N; i++) {
cin >> arr[i];
}
// 오름차순이니깐 먼저 맨 끝에 있는 동전으로 값을 만들수 있는지 테스트
// 재귀함수를 돌면서 계속 테스트...
int sum = 0... | ALGO | 0.999879 | 4.154597 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-05-19T11:15:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f126873106... |
9513b973-58a1-4ff6-97f6-3dbc611cc89e | kwisniew/devsim | src/AutoEquation/EquationFunctions.hh | /***
DEVSIM
Copyright 2013 Devsim LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | TOOL | 0.971536 | 4.813551 | {
"github_metadata": {
"branch": "master",
"commit_count": 119,
"repo_created_at": "2016-12-08T10:52: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": "04014826... |
ef350058-b554-48a8-aafe-671ca16d6ead | shibam120302/LeetCode | Prefix Suffix String - GFG/prefix-suffix-string.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class TrieNode{
public:
TrieNode *children[26];
};
TrieNode *getNode(){
TrieNode *pNode = new TrieNode();
for (int i = 0; i < 26; i++)
pNode->chi... | ALGO | 0.999601 | 5.111481 | {
"github_metadata": {
"branch": "main",
"commit_count": 4233,
"repo_created_at": "2022-12-15T12:12:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d6f1f50bf... |
4b47dceb-a967-4534-927c-7127aebc0d2c | 1ejheinz/C-Plus-Plus | Practice/Chapter 8 and 9/Drill 2/Drill 2/Drill 2.cpp | // Drill 2.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
/***************************************
* Lesson 7: Chapter 8 Exercise Drill 2
* Student: <NAME>
* Date: Jan 1, 2024
******************************************/
#include "std_lib_facilities.h"
void swap_v(int a, ... | ALGO | 0.997245 | 5.776312 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2024-12-29T22:36: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": "004cf540a4... |
e47556d9-4c9b-46b9-bed2-a95e2e9f48b3 | timlee0131/Algorithms-Collection | Lab1/src/Sort.cpp | #include "Sort.h"
void Sort::load(string filename) {
ifstream input(filename);
string temp;
file_vector.clear();
while(input >> temp) {
int temp_converted;
temp_converted = stoi(temp);
file_vector.push_back(temp_converted);
}
}
void Sort::execute() {
std::chrono::high_r... | ALGO | 0.994246 | 4.77968 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2019-09-06T04:43: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": "715d73c4c... |
23160127-e82d-469d-86a0-077042b8267c | utkarsh914/LeetCode | Trees/652. find-duplicate-subtrees.cpp | // https://leetcode.com/problems/find-duplicate-subtrees/
/**
* 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, Tre... | ALGO | 0.999813 | 6.95048 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2021-02-13T18:22:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f301e83d30b... |
9591c3fe-d12d-4038-ac26-36fe80af0c4c | 0000King/CPP | powerSet.cpp | #include <iostream>
#include <math.h>
using namespace std;
int subsequences(string str[], string output[])
{
if(*str == "\0")
{
*output = "";
return 1;
}
int a = subsequences(str+1, output);
int i;
for(i = 0; i < a; i++)
{
if(*(output+i) == "\0")
*(output... | ALGO | 0.995444 | 4.462939 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-04-15T17:55: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": "2a92e0e5eb14... |
8b5bde65-7272-4d02-b7e0-5d00d1c6d1a0 | domso/misc | misc/shared_queue.h | #ifndef shared_queue_h
#define shared_queue_h
#include <queue>
#include <mutex>
#include "time.h"
#include "semaphore.h"
#include "assert.h"
namespace network {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | TOOL | 0.911707 | 5.680009 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-12-21T14:47:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bbadcd6119... |
7a3dcb47-7672-499d-b4de-5768dec9ae50 | DobromirNPeev/Introduction-to-Programming-FMI | Homeworks/Homework 1/Task 2/fn4MI0600262_d1_2.cpp | /**
*
* Solution to homework assignment 1
* Introduction to programming course
* Faculty of Mathematics and Informatics of Sofia University
* Winter semester 2022/2023
*
* @author <NAME>
* @idnumber 4MI0600262
* @task 2
*
*/
#include <iostream>
using namespace std;
int Length(int input) {
int length = 0;
while (inpu... | ALGO | 0.999053 | 4.302222 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-03-03T16:58: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": "8e921bb77e21... |
633724cd-964a-4c12-a02a-e8c5c4df38e0 | grasmanek94/darkreign2 | graphics/vid_config.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// Copyright 1997-2000 <NAME>, Dark Reign II
//
// vid_config.cpp
//
// 14-NOV-1999
//
#include "vid_private.h"
#include "iface.h"
#include "dlgtemplate.h"
//-----------------------------------------------------------------------------
... | CONFIG | 0.93362 | 4.082233 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2015-04-16T10:10:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 61,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "679927a... |
fa210bcc-bf18-4009-abdb-76e916c5c99f | tu-rbo/omip | shape_reconstruction/include/vcglib/apps/sample/trimesh_ransac/trimesh_ransac.cpp | /****************************************************************************
* VCGLib o o *
* Visual and Computer Graphics Library o o *
* _ O _ *
* Copyri... | ALGO | 0.942727 | 5.000467 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2016-11-03T13:24:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 29,
"forks": 10,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "bdc93bc6... |
9f07a236-0b3b-42ad-a4ec-12fe2f9872da | ifra817/Hangman | Hangman.cpp | // Include necessary header files
#include <iostream> // For input/output operations
#include <string> // For working with strings
#include <windows.h> // For Windows-specific functions
#include <algorithm> // Transform function for Upper Case
using namespace std;
// Function to print a message with optional top an... | ALGO | 0.99938 | 4.328249 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-01-20T06:35: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": "4b479efcfde3... |
7ee6700b-0003-4b2e-bce3-505ace4c8f54 | gim-largerepo/including-investment-59GB | src/interesting.cpp | Face south Democrat election cost arrive spring.
Conference billion computer because yourself information.
Work same scene analysis decade factor local.
Produce cultural how organization throughout.
Quality leave ten true resource black contain.
Friend heavy president.
Vote understand spend least large company.
Detail ... | TEST | 0.965425 | 3.406969 | {
"github_metadata": {
"branch": "main",
"commit_count": 92233,
"repo_created_at": "2023-03-08T12:49:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "adc4117eb... |
3c442391-8510-4de5-8683-c764b3ede2ac | li-chiun-lin/GoogleKickStart | 2016_B/sherlock_and_watson_gym_secrets.cpp | /*
*/
#define _USE_MATH_DEFINES
#include <algorithm>
#include <climits>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <cmath>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_m... | ALGO | 0.999877 | 5.160313 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2023-05-07T06:39: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": "da1c07d18... |
02d3a590-b8ee-4bcd-89be-7d050cf0e209 | Kiritow/OJ-Problems-Source | POJ/1189_xiaoxiaoluo.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int const maxn = 51 + 51 * 50 / 2;
int n, m;
long long dp[55][55];
bool triangle[maxn];
long long gcd(long long a, long long b)
{
if(b)
return gcd(b, a % b);
return a;
}
int main()
{
scanf("%d %d", &n, &m);
char s[5];... | ALGO | 0.999953 | 3.362611 | {
"github_metadata": {
"branch": "master",
"commit_count": 939,
"repo_created_at": "2016-04-10T01:06:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51045ac... |
e5a41ff0-ed54-43ef-9c45-fa2e8cf6fc63 | alexluscan/Cpp-algorithms | Algoritmica/ONI/14.03/CompBiconexe/Probleme/Clepsidra_ONI_2014/clepsidra/clepsidra.cpp | #include <stdio.h>
#include <algorithm>
#include <vector>
using namespace std;
#define MAXN 300010
#define MOD 666013
vector<int> G[MAXN];
int L[MAXN], niv[MAXN], Ans[MAXN], Power[MAXN];
bool s[MAXN];
int N, M;
void Df(int x, int tata)
{
s[x] = true;
L[x] = niv[x] = niv[tata] + 1;
int nr = 1;
if (x == 1) nr = 0... | ALGO | 0.999949 | 4.201577 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-12-29T14:48: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": "8f9604f4ac3c... |
1e12ee1d-b664-40ba-8cc1-73d1b9c8bb20 | rohanxxx/leetcode | 0105-construct-binary-tree-from-preorder-and-inorder-traversal/0105-construct-binary-tree-from-preorder-and-inorder-traversal.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.999993 | 6.621219 | {
"github_metadata": {
"branch": "main",
"commit_count": 4948,
"repo_created_at": "2024-06-21T19:42: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": "e9fe2c623... |
32ec2aa8-908e-4b12-9df8-4dd234fbe9ab | ashwinchembu/Projects | C++ Projects - Data Structures and Algorithms/binary-heap/BinHeap/binheap.h | // Filename: linkedlist.h
//
// Header file for the class BinHeap that represents a Binary Heap
//
// <NAME>, Jan 2020
#ifndef HEAP_H
#define HEAP_H
#include <string>
using namespace std;
class BinHeap
{
private:
int* A; // it's an array of ints
int size; // a non-negative size
int capac... | ALGO | 0.997127 | 4.013805 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2022-07-13T20:20:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81015b9a0b8... |
460ebd7f-9fbe-45f6-afda-ba54dd0193e5 | GridinD/Comp_math | ody.cpp | #include <iostream>
#include <cmath>
using namespace std;
double f(double x, double y) {
return x * y + pow(x, 2);
}
int main() {
double x0 = 0.0;
double y0 = 1.0;
double h = 0.1;
double x = x0;
double y = y0;
cout << "At x = "... | ALGO | 0.999728 | 4.373372 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-05-06T12:51: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": "3b89e012d213... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.