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 |
|---|---|---|---|---|---|---|---|
14091aac-5222-45da-95c8-d347e8d51081 | sppu-exam/lp5 | HPC/2ParallelBubble.cpp | #include <iostream>
#include <ctime>
#include <omp.h>
#include <iomanip>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; ++i) {
for (int j = 0; j < n - i - 1; ++j) {
if (arr[j] > arr[j + 1]) {
swap(arr[j], arr[j + 1]);
}
}
... | ALGO | 0.999975 | 5.7123 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-05-04T17:39: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": "2044a9739550... |
707fc92c-8555-4558-9415-31865e2812f1 | jinnatul/problemSolving | src/LightOJ/1182/13882516_AC_0ms_1688kB.cpp | #include<bits/stdc++.h>
using namespace std;
/// Typedef
typedef long long int ll;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector< pii > vii;
//Int data type
#define ... | ALGO | 0.998317 | 3.364546 | {
"github_metadata": {
"branch": "master",
"commit_count": 521,
"repo_created_at": "2018-08-06T22:11:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7c21dc8... |
177ecd78-ff5c-457b-bcd6-b0980879e4ec | ammardab3an/ACM | problems/done/kattis/kattis - beepers.cpp |
#include "bits/stdc++.h"
using namespace std;
//#define int int64_t
//#define lli int64_t
typedef unsigned int uint;
typedef long long int lli;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<lli, lli> pll;
typedef pair<int, pii> iii;
typedef pair<lli, pll> ... | ALGO | 0.999983 | 4.055841 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2021-10-06T07:54:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f6d086ff398... |
059539f5-24f2-4d17-8f65-7adf3556393c | kalok008/MyCodePortfolio | Problems from competitions/Group D/National Olympiad/National Round/2024/bitstring.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int countSubstrings(const string& s, char ch) {
int count = 0;
if (s[0] == ch) {
count++;
}
for (int i = 1; i < s.length(); i++) {
if (s[i] == ch && s[i-1] != ch) {
count++;
}
}
ret... | ALGO | 0.999681 | 4.52103 | {
"github_metadata": {
"branch": "main",
"commit_count": 283,
"repo_created_at": "2024-09-05T15:22: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": "6233f7f465... |
e9b6b6ab-902e-422e-8cae-e0cba8c85936 | developer0hye/Algo-0hye | problems/2667/boj_2667.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<vector<int>> map;
vector<vector<bool>> visited;
int area;
void labeling(int x, int y)
{
if( y >= map.size() ) return;
if( y < 0 ) return;
if( x >= map[0].size() ) return;
if( x < 0 ) return;
if( visited[y][x] ... | ALGO | 0.999882 | 3.986028 | {
"github_metadata": {
"branch": "master",
"commit_count": 149,
"repo_created_at": "2019-11-22T10:17:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "223cf946... |
689bb4df-03be-4b22-9c1e-b533063a04d3 | architcs12b1007/DSA | Array/1_DecimalToBinary.cpp | #include <iostream>
#include <math.h>
#include <algorithm>
using namespace std;
int power1(int n, int index)
{
int ans = 1;
for (int i = 0; i < index; i++)
{
ans = ans * (n);
}
return ans;
}
// Approach 1: 1)Divide n by 2 ans store the remainder in my ans.2)Repeat until n does not equal t... | ALGO | 0.999973 | 5.232491 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-06-19T11:09:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bcdee08fd5... |
e01d61c9-67e3-4abd-aa09-868779376942 | sshhiirriinnaaa/lab8 | Source.cpp | #include <iostream>
#include <ctime>
#include <cstdlib>
#include <queue>
#include <fstream>
using namespace std;
struct Node {
int data;
Node* next;
};
void printAdjacencyList(Node** adjacencyList, int size) {
for (int i = 0; i < size; i++) {
cout << "Vertex " << i << " is adjacent to: ";
Node* current =... | ALGO | 0.999717 | 4.732905 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-12-15T12:17: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": "6e493b4ac4af... |
0b5d0bb2-adab-4e4e-8822-8de3fd34203f | naetherm/racoonengine_deprecated | Engine/Source/Base/RECore/Private/Math/Math.cpp | /*********************************************************\
* Copyright (c) 2012-2022 The Unrimp Team
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software without
* restriction, including wit... | ALGO | 0.997807 | 5.459138 | {
"github_metadata": {
"branch": "develop",
"commit_count": 99,
"repo_created_at": "2020-08-19T07:12:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9778395b... |
d7ecefae-1eac-4cf9-92bb-db9924f67c5c | the-stranded-alien/LeetCode | 0401_0500/461_Hamming_Distance.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long int
#define double long double
#define F first
#define S second
#define pb push_back
#define pob pop_back
#define mp make_pair
#define si set <int>
#define vi vector <int>
#define vs vector <string>
#define... | ALGO | 0.999883 | 4.64677 | {
"github_metadata": {
"branch": "main",
"commit_count": 421,
"repo_created_at": "2022-01-01T17:46:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "18947a5870... |
857f6369-1d1f-45f2-a917-d7eb5b9f7b76 | Leezed525/learning-algorithm | test/luogu/accepted/P2550.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int ans[8];
for (int i = 0; i <= 8; i += 1) {
ans[i] = 0;
}
int b[50];
for (int i = 0; i <= 50; i += 1) {
b[i] = 0;
}
for (int i = 0; i < 7; i++) {
int x;
cin >> x;
b[... | ALGO | 0.999697 | 3.263648 | {
"github_metadata": {
"branch": "master",
"commit_count": 185,
"repo_created_at": "2022-04-07T03:12: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": "de338701... |
aa78ecba-ed4b-4b3a-afb0-75d2449061f6 | Xiaxue0109/Datastructure | 6.DatastructurePractise/21.并查集游戏分组.cpp | /*************************************************************************
> File Name: 21.并查集游戏分组.cpp
> Author:
> Mail:
> Created Time: 2020年02月24日 星期一 12时32分21秒
************************************************************************/
#include <stdio.h>
#include <stdlib.h>
typedef struct DisjoinSet {
int ... | ALGO | 0.999857 | 4.031502 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2020-02-26T05:03: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": "29a3ecc7... |
d0705e77-7e9a-4080-87a5-541525c778f9 | SABARISHR4092/OPERATING-SYSTEM | OS C 8.cpp | #include <stdio.h>
#define MAX_PROCESSES 10
struct Process {
int id;
int burst_time;
int remaining_time;
};
void round_robin(struct Process processes[], int n, int quantum) {
int time = 0;
int completed = 0;
while (completed < n) {
for (int i = 0; i < n; i++) {
if (proces... | ALGO | 0.99991 | 4.415187 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-20T16:27: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": "324df13cbc51... |
4f13481a-1eca-4639-8003-82a77f3292a6 | ElijahDR/naughtsandcrosses | main.cc | #include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
const int human = 1; // user
const int ai = 2; // computer
int runs =0;
// Returns an array corresponding to the array, 0 for available move, -1 for taken.
int* getAvailableMoves(int board[9]){
static int possibleMoves[9]... | ALGO | 0.999572 | 4.79458 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-11-05T19:15: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": "e914c3eca9... |
b2c67890-bd02-4cfe-bd0d-3f2cd670c023 | 62theories/dinamic-programming | ugly_number_with_memo.cpp | //Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, Ö shows the first 11 ugly numbers. By convention, 1 is included.
//
//Given a number n, the task is to find níth Ugly number.
//
//Examples:
//
//
//
//Input : n = 7
//Output : 8
//
//Input : n = 10
//O... | ALGO | 0.999995 | 5.05689 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-10-12T18:22: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": "e0d9a34e1d... |
ce4ec939-6df6-4858-b622-28c4229a1162 | Ray-SunR/the-Game-of-Quadris | src/nextBlock.cpp | //
// nextBlock.cpp
// The Game of Quadris
//
// Created by <NAME>& <NAME> on 2013-07-11.
// Copyright (c) 2013 University of Waterloo. All rights reserved.
//
#include<iostream>
#include<fstream>
#include<sstream>
#include<string>
#include<cstdlib>
#include"nextBlock.h"
using namespace std;
//constructor
nextB... | TOOL | 0.924983 | 3.508894 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2013-07-29T22:18:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8da98074a... |
58b3c25b-9012-487a-8469-8e90f5c4e14d | ViniciusDugue/Ray-Tracing-Engine-from-Scratch | Scripts/vec3.h | #ifndef VEC3_H
#define VEC3_H
#include <cmath>
#include <iostream>
using std::sqrt;
class vec3
{
public:
float e[3];
vec3() : e{0,0,0} {}
vec3(float e0, float e1, float e2) : e{e0, e1, e2} {}
float x() const { return e[0]; }
float y() const { return e[1]; }
float z() const { return e[2];... | TOOL | 0.954943 | 6.595985 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-01-03T09:15: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": "990db0759516... |
32791a09-e98b-4892-9d33-42760218043e | emrecankeskin/LeetcodeSolutions | Graph/743. Network Delay Time.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int networkDelayTime(vector<vector<int>>& times, int n, int k) {
vector<int> dist(n,INT_MAX);
vector<bool> vis(n,false);
vector<vector<pair<long long,long long>>> adj(n);
priority_queue<pair<long long,long long>... | ALGO | 0.999926 | 4.873486 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-17T16:06:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e645a8a49cc... |
37ebe8da-718e-40a3-a1ff-0b18d7c0bab5 | zaurus-yusya/Competitive-Programming | atcoder/abc/abc264/f.cpp | #include <bits/stdc++.h>
// #include <atcoder/all>
// using namespace atcoder;
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define all(x) x.begin(),x.end()
#define br cout << '\n';
using namespace std;
const long long INF = 8e18;
using ... | ALGO | 0.999919 | 3.509697 | {
"github_metadata": {
"branch": "master",
"commit_count": 418,
"repo_created_at": "2019-08-14T07:36: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": "793a1991... |
55f82e3e-bcbe-4525-9a44-7398f8d62116 | briuin/em_matrix_hw | Vec.cpp | #include "stdafx.h"
#include "Vec.h"
#include <math.h>
Vec::Vec()
{
}
void Vec::push(vector<double> a)
{
S.push_back(a);
}
void Vec::push(string str)
{
vector<double> temp;
char s[40];
bool minus=false;
int c=0;
double x;
strcpy(s,str.c_str());
while (s[c]!='\0' && s[c]!='(')
{
c++;
}
if (s[c]=='\0... | TOOL | 0.967613 | 3.139859 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2014-03-10T07:40: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": "11b5b8b30... |
691ecd14-30ef-4611-b3f3-3a66670ce43e | stanley-chang/30-Days-of-Code | M - Day 12 - Inheritance.cpp | #include <iostream>
#include <vector>
using namespace std;
class Person{
protected:
string firstName;
string lastName;
int id;
public:
Person(string firstName, string lastName, int identification){
this->firstName = firstName;
this->lastName = lastName;
this->id = identificati... | TOOL | 0.919688 | 4.107818 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-12-20T13:45: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": "c6cd129d31... |
365f260b-cfef-4bc6-8bb4-1529ab544315 | Madhusudhangupta/Competitive-Programming-Solutions | 16B.cpp | /*GOD IS GREAT,
SO AM I*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ford(i,a,n) for(long long int i=a;i<n;++i)
#define fore(i,a,n) for(long long int i=a;i<=n;i++)
#define test ll t;cin>>t;while(t--)
#define op(z) cout<<z<<endl
#define ops(z) cout<<z<<" "
#define fastIO... | ALGO | 0.999945 | 3.232117 | {
"github_metadata": {
"branch": "master",
"commit_count": 76,
"repo_created_at": "2020-07-29T02:20:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "07ed72ea8... |
20720d90-9fd6-4018-a98f-78ec3b261d26 | alogeclock/Problem-Solving | BOJ/Gold/[2504] 괄호의 값.cpp | // idea: stack
/*
1. 스택에는 왼쪽 괄호만 넣고, 최근 괄호는 항상 s.top()이 된다.
2. 어떤 괄호든 닫히면 값이 sum[idx] 배열에 더해져서 관리된다.
3. 바로 이전 괄호가 닫은 괄호라면, 이전 값에 곱한다.
4. 이전 괄호가 연 괄호라면, 이전 값에 더한다.
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll, ll>
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3f
#defi... | ALGO | 0.999918 | 4.612929 | {
"github_metadata": {
"branch": "main",
"commit_count": 100,
"repo_created_at": "2024-02-10T05: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": "94681c7655... |
a42405b7-a047-4b30-95e3-3c5217d7e275 | vonJOKER/2023guosai | ssc-solarpilot_v1.3.1/shared/6par_gamma.h | /*******************************************************************************************************
* Copyright 2017 Alliance for Sustainable Energy, LLC
*
* NOTICE: This software was developed at least in part by Alliance for Sustainable Energy, LLC
* (“Alliance”) under Contract No. DE-AC36-08GO28308 with the ... | ALGO | 0.998975 | 5.419717 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2023-09-11T16:13: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": "76847f53cc... |
ffa4eee4-6b2f-4944-ae7a-93e5945fbd8e | loctempt/acm | AC automation/C.cpp | //#include <cstdio>
//#include <iostream>
//#include <cstring>
//#include <queue>
//using namespace std;
//const int maxNode = 500000+19, sigma_size = 26;
//int ch[maxNode][sigma_size];
//int val[maxNode];
//int last[maxNode];
//int f[maxNode];
//
//struct AC_automation{
// int sz, ret;
// AC_automation(){
// ... | ALGO | 0.999845 | 3.717293 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2017-08-17T00:22: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": "3276b5671... |
ecd9345a-fdc7-489c-9120-8bc4b7493d15 | Amod03/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.999999 | 6.489471 | {
"github_metadata": {
"branch": "main",
"commit_count": 1789,
"repo_created_at": "2023-03-16T09:53:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f4f049e6... |
a0162ac8-b9bf-4410-8c10-5d739425dadb | mimibetty/CP-Training- | 2 Online Judge/Codeforce/2022/764 d3/2.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef pair<long long, long long> pll;
typedef double ld;
#define For(i, l, r) for (int i = l; i < r; i++)
#define REP(i, l, r) for (int i = l; i <= r; i++)
#define FordE(i, l, r) for (int... | ALGO | 0.999841 | 4.460797 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-04-12T06:16: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": "7e07ffc6480... |
9c394fcb-2e79-4679-b68f-1834ad878d2f | doho-ho/Coding-test-practice | BOJ/5373 큐빙.cpp | #include<cstdio>
/* U
0 1 2
3 4 5
6 7 8
L __________ R B
36 37 38|F18 19 20 | 45 46 47 | 27 28 29
39 40 41| 21 22 23 | 48 49 50 | 30 31 32
42 43 44| 24 25 26 | 51 52 53 | 33 34 35
-----------
9 10 11
12 13 14
15 16 17
D
*/
enum FACE { U, D, F, B, L, R, SIZE };
char init[7] = "wyr... | ALGO | 0.999923 | 4.301649 | {
"github_metadata": {
"branch": "master",
"commit_count": 331,
"repo_created_at": "2020-03-27T13:26:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f5fd953... |
82eda9d5-25fd-45d8-9038-cfc3cbfc0cd6 | xiaofankwll41/DataStructure-Algorithm | 03_二叉树/test_4.cpp | #include "binaryTree.h"
// print a path from root to leaf and path = depth - 1;
// if there are more than one path, only print leftest one;
void printLeftestPath( BitNode * tree, int depth )
{
static BitNode *Stack[MAXSIZE]; static int top = -1;
if ( tree )
{
Stack[++top] = tree;
if ( !tree-... | ALGO | 0.999398 | 3.742226 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-02-26T13:05:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cdd200fc1a8b... |
9276f33f-8fd8-47a6-bf51-3d3c38a098c0 | 0verlooking/lab-15 | calculator.cpp | #include <iostream>
#include <string>
class BankAccount {
private:
std::string accountNumber;
double balance;
public:
BankAccount(const std::string& accNumber, double initialBalance)
: accountNumber(accNumber), balance(initialBalance) {
}
void deposit(double amount) {
balance += a... | TOOL | 0.974806 | 6.021348 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-06-13T13:50: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": "8021199ebdbb... |
071fd95d-4d75-4d1d-8c21-bbbc2994a24c | tauhrick/Competitive-Programming | Contests/Codeforces/CF-R2-567/a.cpp | #include <bits/stdc++.h>
using namespace std;
string to_string(string s) {
return '"' + s + '"';
}
string to_string(const char* s) {
return to_string((string) s);
}
string to_string(bool b) {
return (b ? "true" : "false");
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
return "(" + to_... | ALGO | 0.999987 | 3.972021 | {
"github_metadata": {
"branch": "master",
"commit_count": 266,
"repo_created_at": "2019-06-24T10:51:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e849a416... |
c38ee894-d7b4-430c-b4a9-8ad8682bfa16 | sunnypawat/cses-problem-set | introductory-problems/two-sets.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define lli long long int
int main(){
int n;
cin >> n;
if(n*(n+1)/2%2){
cout << "NO\n";
return 0;
}
vector<int> v1, v2;
if (n%4 == 0){
for(int i=n; i>=1; i-=4){
v1.push_back(i);
v... | ALGO | 0.99991 | 3.30379 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-01-06T14:33: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": "7f8726c8e8cd... |
b2fe6f24-77ea-4fc9-89f6-c1a9ab529886 | jiarong-wu/multiphase | solver/reference/APC523/include/problem.h | #ifndef PROBLEM_H
#define PROBLEM_H
#include "common_definitions.h"
#include "element.h"
#include "fe_value.h"
#include "cg_solver.h"
#include "operations.h"
#include "dof.h"
#include "print.h"
#include "bc_conditions.h"
class Problem
{
public:
/* Constructor. */
Problem();
/* Run this problem... | ALGO | 0.997849 | 5.51443 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2018-12-06T01: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": "a85f2235e... |
4ff9a8ea-7316-4f87-81e4-674e616c1651 | diazhector98/Red-Black-Tree | RBTree.h |
#include "RBNode.h"
#include <queue>
class RBTree {
public:
RBTree();
void print(int type);
void insert(int val);
private:
RBNode* root;
void preorder(RBNode*);
void inorder(RBNode*);
void postorder(RBNode*);
void levelByLevel(RBNode*);
};
... | ALGO | 0.999209 | 4.027364 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-03-14T05:34: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": "3a339479b7... |
ecccf86a-7410-4a39-b8fa-e4cfcd50e6b5 | sarthak395/Data_Structure_and_Algo_Problems | q12.cpp | /*
Given an array of integers heights representing the histogram's bar height where the width of each bar is 1, return the area of the largest rectangle in the histogram.
*/
#include "headers.h"
using namespace std;
int largestRectangleArea(vector<int>& heights)
{
int n = heights.size();
vector<int>left(n,-1)... | ALGO | 0.999907 | 6.221042 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2023-01-17T06:00: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": "d6f2d9f5d0... |
b1f6f74b-05a5-4d4e-91e5-dee66ea92b93 | NainIglesias/C- | StringExercises/Ej2.cpp | #include <iostream>
#include <string>
using namespace std;
string upperCase(string name); string lowerCase(string name); string
tittleCase(string name);
int main(){ string name {}; cout << "Name: "; getline(cin, name);
string upperName = upperCase(name); cout << "Upper name: "
<< upperName << endl; string lowe... | ALGO | 0.992587 | 4.191865 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2023-10-23T12:22: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": "cf0b7dd478... |
225cd40d-7399-4494-806c-c01625cb253f | FuChaolei/leetcode4 | 多线程读取队列数据.cpp | #include <iostream>
#include <queue>
#include <pthread.h>
#include <windows.h>
using namespace std;
queue<int> q;
pthread_mutex_t mu;
void *thread_func(void *arg)
{
int n = *(int *)(arg);
if (!q.empty())
{
pthread_mutex_lock(&mu);
cout << q.front() << " " << n << endl;
q.pop();
... | ALGO | 0.998256 | 3.844117 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-02-10T14:57:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a425cb9d2b3c... |
3fbd359f-9f17-4327-8192-b0d7a6617715 | hfinkel/llvm-project-csp | clang/lib/Frontend/CompilerInvocation.cpp | //===- CompilerInvocation.cpp ---------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | TOOL | 0.943026 | 6.296193 | {
"github_metadata": {
"branch": "csplugin",
"commit_count": 338101,
"repo_created_at": "2019-12-28T15:30:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 7,
"issues": 1,
"pull_requests": 5
},
"file_meta": {
"content_id": "dc... |
1e10368f-3594-4b1a-b2dd-f7aa094fbd2e | xManan/study | daa/hw/n_queen/main.cpp | #include <iostream>
using namespace std;
void printGrid(int **grid, int n){
for(int i=0; i<n; ++i){
for(int j=0; j<n; ++j){
cout << grid[i][j] << ' ';
}
cout << endl;
}
cout << endl;
}
bool isSafe(int **grid, int n, int row, int col){
for(int i=0; i<n; ++i) if(i !=... | ALGO | 0.999883 | 5.721544 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-08-16T07:49: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": "435ca8c312a4... |
cee111fb-153a-4fb3-a041-f0956d8ea685 | arvind-crate-7/Data-Structures | Stack day6/The Celebrity Problem(GFG).cpp | #include<bits/stdc++.h>
using namespace std;
class Solution
{
private:
bool knows(vector<vector<int>> & m ,int a,int b,int n){
if(m[a][b] == 1){
return 1;
}
else{
return 0;
}
}
public:
//Function to find if there is a celebrity in the party or... | ALGO | 0.999805 | 5.268866 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2023-03-11T02:40: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": "0a0c7a61b9... |
550a2534-53a9-4786-8cb6-38114a21132f | niklasbubeck/bumblebob | bumblebob_lateral_controller/src/feedforward.cpp | #include "../include/feedforward.hpp"
FeedForward::FeedForward(const cv::Point2d vehicle_position, const double speed, std::vector<cv::Point2d>& waypoints,
double heading)
: radius_(0)
, straight_line_(false)
, circle_direction_(1)
, look_back_(10)
, look_front_(10)
, vehicle_posit... | ALGO | 0.999884 | 6.234397 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-07-14T20:28:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7e95309dbf9... |
271a79f2-cd50-43fd-90a5-32f21d5ac6af | rustyoz/kicad | common/geometry/geometry_utils.cpp | /*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018 <NAME>, jp.charras at wanadoo.fr
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of t... | TOOL | 0.956018 | 5.989457 | {
"github_metadata": {
"branch": "master",
"commit_count": 12576,
"repo_created_at": "2016-08-27T02:27:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "aba946... |
3d4ce83d-9521-450f-bb08-d06907f4148d | tunabrain/tungsten | src/thirdparty/embree/kernels/bvh/bvh_intersector_stream.h | // ======================================================================== //
// Copyright 2009-2016 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// y... | ALGO | 0.997821 | 6.371098 | {
"github_metadata": {
"branch": "master",
"commit_count": 985,
"repo_created_at": "2014-09-15T18:38:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1798,
"forks": 172,
"issues": 14,
"pull_requests": 4
},
"file_meta": {
"content_id": "a8... |
21395114-eba9-4bc1-90d9-c4be245d9d54 | Sifathislam/PhitronAllPrograms | DSA/DATA STRUCTURE/MAIN CONCEPTS SERIAL/Binary Tree/Max_Min_Leaf.cpp | #include<bits/stdc++.h>
using namespace std;
// Create an binary treee
// Create Binary Tree class
class Node{
public:
int val;
Node *left;
Node *right;
// consturctor
Node (int val){
this->val = val;
this->left = NULL;
this->right = NULL;
}
};
Node* LevelOrderI... | ALGO | 0.999927 | 4.307344 | {
"github_metadata": {
"branch": "main",
"commit_count": 184,
"repo_created_at": "2023-03-31T21:19: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": "108a4a64af... |
344d8504-d818-4f2e-8d82-c775e00e1397 | devjit-sarkar/leet | Practice/Reverse vowels of a String/sol.cpp | class Solution {
public:
string reverseVowels(string s) {
// int count;
// for(int i=0; i<s.size(); i++)
// {
// if(s[i] == 'a'||s[i] == 'e'||s[i] == 'i'||s[i] == 'o'||s[i] == 'u'||s[i] == 'A'||s[i] == 'E'||s[i] == 'I'||s[i] == 'O'||s[i] == 'U')
// {
// ... | ALGO | 0.999858 | 6.051889 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2024-10-14T08:34:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6f360ef6c4... |
b15177c5-acad-430b-9f44-41dc85efb4b4 | nicolasasseo/ChessEngine | main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <stdlib.h>
#include <vector>
#include <tuple>
#include <chrono>
#include "print.h"
#include "initialize.h"
#include "pieces.h"
#include "eval.h"
#include "tree.h"
std::string greedy_move_external;
std::string file_name_external;
void print_result(const ... | ALGO | 0.988933 | 4.097142 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2025-02-26T02:17: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": "af7c89c3ee... |
56de7c52-522e-43f4-9f24-bd7c7f5a3949 | adobe-flash/crossbridge | llvm-2.9/tools/clang/lib/Frontend/InitHeaderSearch.cpp | //===--- InitHeaderSearch.cpp - Initialize header search paths ------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | TOOL | 0.984568 | 3.419405 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2013-06-21T20:16:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 550,
"forks": 198,
"issues": 31,
"pull_requests": 1
},
"file_meta": {
"content_id": "a1080... |
cce1c712-cf52-41ec-90f9-e6e70fcf4dfa | Rohan7690/cpp_code | LinkedListCpp.cpp | // #include<iostream>
#include<bits/stdc++.h>
using namespace std;
class Node {
public:
int data;
Node *next;
/// intialization
Node(int data){
this->data = data;
this->next = NULL;
}
};
void InsertFromHead(Node* &head ,int data){
Node* temp= new Node(data);
temp-... | ALGO | 0.999785 | 4.631383 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-02-19T17:08: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": "abfeaa97c094... |
2272bd36-17dc-4b8c-81e3-b80d13a1bd8d | glookka/pfm | LCore/cmain.h | #ifndef _cmain_
#define _cmain_
#pragma warning( disable : 4291 ) // we don't use exceptions, so who cares
#pragma warning( disable : 4018 ) // signed/unsigned mismatch
#define SafeDelete(p) { if(p) { delete (p); (p)=NULL; } }
#define SafeDeleteArray(p) { if(p) { delete[] (p); (p)=NULL; } }
#define GET_X_LPARAM(lPa... | TOOL | 0.930544 | 4.525081 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-03-18T20:57:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13250e6368... |
fa89a0bc-f815-40c4-a024-deb4a5c1eda4 | WCE-Programmers-Batch-24/WCE2k24-IT-Assignments | Assignments/Data Structures/Assignment 4/implementation_of_stack_using_arrays.cpp | #include <iostream>
using namespace std;
class Stack
{
private:
int size;
int top;
int *S;
public:
Stack(int size);
~Stack();
void push(int x);
int pop();
void display();
int isFull();
int isEmpty();
int stackTop();
};
Stack::Stack(int size)
{
this->size = size;
... | ALGO | 0.975225 | 4.950659 | {
"github_metadata": {
"branch": "main",
"commit_count": 203,
"repo_created_at": "2021-09-30T04:10:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "477e05222c... |
f2787dfb-a5e0-4102-b979-46ae37cafc55 | xqian/cpp_projects | lxb/leetcode/interleavingString.cpp | http://oj.leetcode.com/problems/interleaving-string/
/*
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.
For example,
Given:
s1 = "aabcc",
s2 = "dbbca",
When s3 = "aadbbcbcac", return true.
When s3 = "aadbbbaccc", return false.
*/
class Solution {
public:
bool isInterleave(string s1, ... | ALGO | 0.996973 | 5.282146 | {
"github_metadata": {
"branch": "master",
"commit_count": 296,
"repo_created_at": "2009-12-26T17:19:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 13,
"pull_requests": 0
},
"file_meta": {
"content_id": "a6cc9fc... |
514fff72-0b13-44f8-961b-c09052981eb0 | PeterZs/SketchMeshVR | SketchMeshVR/src/Plane.cpp | #include "Plane.h"
#include <Eigen/Geometry>
Plane::Plane(Eigen::Vector3d v0, Eigen::Vector3d v1, Eigen::Vector3d v2) {
Eigen::Vector3d vec0 = v1 - v0;
Eigen::Vector3d vec1 = v2 - v0;
normal = vec0.cross(vec1);
base = v0;
normal.normalize();
}
Plane::Plane(Eigen::Vector3d point, Eigen::Vector3d normal_) :
base(... | ALGO | 0.994533 | 6.340144 | {
"github_metadata": {
"branch": "master",
"commit_count": 387,
"repo_created_at": "2018-12-17T01:21:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3a2244f7... |
260d4a2e-33f8-47c7-a60c-8dadd2cd78fb | Liiiiiiiu/TensorRT_10_inference | code/src/PlateUS.cpp | #include "PlateUS.h"
PlateUS::PlateUS(const YAML::Node &config) : Classification(config) {}
std::vector<ClassRes> PlateUS::PostProcess(const std::vector<cv::Mat> &vec_Mat, float *output) {
// Get detailed results with additional plate recognition information
auto detailed_results = PostProcessDetailed(vec_Mat... | DATA | 0.955089 | 6.004801 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-19T02:43:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c4763ee5f80... |
4d2bee01-515a-4cfe-ab66-38e920de7dda | pradeeptosarkar/CodeChef | ARRT.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long t,n,i;
cin>>t;
while(t--)
{
cin>>n;
vector<long long> A(n), B(n);
for(i=0; i<n; i++){
cin>>A[i];
}
for(i=0; i<n; i++){
cin>>B[i];
}
... | ALGO | 0.999942 | 3.497737 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-08-15T10:21: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": "cd1409539c22... |
14fcd3f6-bc07-4f23-900f-dc0dd3bec123 | KayG2310/learning-cpp | DSA sheet/Problems on array/hard/pascal triangle.cpp | // printing ncr
#include<bits/stdc++.h>
using namespace std;
int main(){
// pascal's triangle
int n, r;
cin>>n>>r;
int p=1;
for(int i=0; i<r; i++){
p *= (n-i);
p /= (i+1);
}
// p = 1*(10/1)*(9/2)*(8/3)
cout<<p;
}
// printing nth row entirely
#include<bits/stdc++.... | ALGO | 0.999987 | 5.034619 | {
"github_metadata": {
"branch": "main",
"commit_count": 618,
"repo_created_at": "2024-05-14T18:57: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": "eb70410849... |
8f74c674-ba6a-4bfa-a22a-0cbc7cf54f1b | wisdompeak/LeetCode | Graph/1820.Maximum-Number-of-Accepted-Invitations/1820.Maximum-Number-of-Accepted-Invitations.cpp | class Solution {
int m, n, t;
vector<int> next[400];
int match[400];
public:
int maximumInvitations(vector<vector<int>>& grid)
{
m = grid.size();
n = grid[0].size();
t = m+n;
for (int i=0; i<m; i++)
for (int j=0; j<n; j++)
{
... | ALGO | 0.999982 | 5.621529 | {
"github_metadata": {
"branch": "master",
"commit_count": 8912,
"repo_created_at": "2017-03-01T10:30:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6018,
"forks": 1314,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "1... |
2a0c4791-0653-49b9-8684-70de28ed8351 | amsraman/Competitive_Programming | ACM/ECNA/2023/G.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false); cin.tie(0);
int nt, ns, rmax; cin >> nt >> ns >> rmax;
vector<pair<int, int>> trees, obs; vector<vector<int>> exists(2001, vector<int>(2001, 0));
for(int i = 0; i < nt; i++) {
int x, y; cin >> x >> y; ... | ALGO | 0.999844 | 4.340416 | {
"github_metadata": {
"branch": "master",
"commit_count": 413,
"repo_created_at": "2019-03-04T14:45:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "80b81113... |
59cd74b4-62bc-4bde-8d2f-3656d4430708 | wwwwodddd/Zukunft | dmoj/noip18p3.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, x, y, z, M, cnt;
vector<pair<int, int> > a[50020];
int dfs(int x, int y) {
vector<int> b;
for (int i = 0; i < a[x].size(); i++) {
if (a[x][i].first != y) {
int l = dfs(a[x][i].first, x) + a[x][i].second;
if (l >= M) {
cnt++;
} else {
b.push_ba... | ALGO | 0.999986 | 4.047265 | {
"github_metadata": {
"branch": "master",
"commit_count": 206,
"repo_created_at": "2018-12-31T17:17:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "caddf63... |
a5670691-95b3-4367-91a0-6c1c40c1dabc | facquah20/cpp_bootcamp | magnetism/magnetic_field_force.cpp | #include <iostream>
#include <cmath>
//function overloading
float degree2Radians(const float degree);
int main(){
// We are going to investigate how the Force exerted on a magnetic field changes with
// varying angle. From rigt hand rule the resultant force is perpendicular to the direction
// of the magnetic ... | ALGO | 0.935465 | 5.3439 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-02-13T18:10: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": "59865b7d2aaa... |
b94e400c-485f-4877-a532-20dfbd736d52 | streagle/Penn-State-CPP | CMPSC 121/LearningNotes/threads.cpp | #include <iostream>
#include <thread>
#include <chrono>
#include <mutex>
using namespace std;
mutex mtx; // Mutex for synchronizing access
bool numberPrinted = false; // Flag to check if a number was printed
// Function to print numbers from 1 to 5
void printNumbers() {
for (int i ... | ALGO | 0.981275 | 5.710742 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2025-01-16T02:13: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": "5ec01eb096e... |
94af94e7-0407-452e-9aea-b302125d6745 | devk0n/DynamicsLab | source/physics/constraints/RevoluteJoint.cpp | #include "RevoluteJoint.h"
namespace Proton {
void RevoluteJoint::computePositionError(VectorXd &phi, int startRow) const {
const auto& r1 = m_bodyA->getPosition();
const auto& r2 = m_bodyB->getPosition();
const auto& A1 = quaternionToRotationMatrix(m_bodyA->getOrientation());
const auto& A2 = quaternionToRo... | ALGO | 0.998154 | 4.777277 | {
"github_metadata": {
"branch": "master",
"commit_count": 299,
"repo_created_at": "2024-11-26T11:29:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b37878c3... |
a2a8ebfd-853b-4f69-881b-8a463ffb3fce | JanTheBeast/Graphing-Calculator | src/Calculator/MarchingSquares.cpp | #include "MarchingSquares.h"
#include <cerrno>
#include <cmath>
Function::Function(std::queue<Token>& func, float xmin, float ymin, float xmax, float ymax)
:m_Function(func)
{
SetDimensions(xmin, ymin, xmax, ymax);
ComparisonState* binaryImage = ConvertToBinaryImage();
unsigned char* cellScores = Compu... | ALGO | 0.997252 | 5.527387 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-03-27T18: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": "6fba63157661... |
424cae55-23c3-4eff-abcc-35d3ad5173fd | jadyntao/HuaWei_CodeCraft_2020 | Third_Round/Code/z17.cpp | #include<bits/stdc++.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <unistd.h>
#include <omp.h>
#include <arm_neon.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
using namespace std;
#define maxn 5000001
// #define outMAXS 400000000
#define Tnum 8
pthr... | ALGO | 0.999627 | 3.583103 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-06-06T13:28:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "68066df30... |
fd09b859-726e-4e93-9410-5df2f7a83f5f | Dhru227/CPC23 | CPC/Week78/FloodFill.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
void dfs(int row, int col, int color, int initColor, vector<vector<int>>& ans, vector<vector<int>>& image, int delRow[], int delCol[]) {
ans[row][col] = color;
int n = image.size();
int m = image[0].size();... | ALGO | 0.999015 | 6.83967 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2023-12-15T12:27: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": "2e3cd8cd6... |
833daaa9-a143-4680-812d-e26b107733b0 | anish-rajan/Cp-algos | contests/round645/d.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define mp make_pair
#define v vector
#define inp_push(no, v) \
ll no; \
cin >> no; \
v.push_back(no);
#define pb push_back
#define fi first
#define se second
#define ALL... | ALGO | 0.999915 | 4.030269 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-05-19T07:45:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d8c1803e... |
757e30ce-d5cd-4204-9eb4-8e1860a7c85d | apizon/InfoGraph | OpenGL/include/KeyframeCollection.hpp | #ifndef KEYFRAMECOLLECTION_HPP_
#define KEYFRAMECOLLECTION_HPP_
#include "GeometricTransformation.hpp"
# include <map>
# include <array>
/**
* \brief An ordered collection of keyframes.
*
* This class store the keyframes in ascending time order. For now, the
* key frames only define a geometric transformation at... | TOOL | 0.916003 | 5.044647 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2017-11-18T21:58: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": "5b1967f11... |
fe62ec40-9887-424a-8443-a98eaddc0050 | gengdd/Leetcode | 110_balancedbinarytree.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <queue>
using namespace std;
struct TreeNode{
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x):val(x),left(NULL),right(NULL){}
};
//错误
//求左子树和右子树的最大高度,比较
//class Solution {
//public:
// bool isBalanced(TreeNode* root) {
// ... | ALGO | 0.999897 | 4.862383 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-05-25T10:57: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": "4c914aad1c... |
8ecd7889-b39f-4e05-82d9-33471b2f55c8 | Harishvishwa01/leetCode | dp/rodcutton.cpp | #include <bits/stdc++.h>
using namespace std;
struct hash_pair {
template <class T1, class T2>
size_t operator()(const pair<T1, T2>& p) const {
auto hash1 = hash<T1>{}(p.first);
auto hash2 = hash<T2>{}(p.second);
return hash1 ^ hash2;
}
};
unordered_map<pair<int, int>, int,hash_pair... | ALGO | 0.999534 | 4.191334 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2024-08-13T16:08: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": "ae645167dcb... |
cfb60e26-9bef-488c-b2bf-79947366630d | dorianverna17/SD_labs | Laborator_9/undirected_graph.cpp | #include <stdio.h>
#include "undirected_graph.h"
undirected_graph_t init_undirected_graph(const size_t node_count) {
undirected_graph_t graph = {
.node_count = node_count,
.adj_matrix = (bool **)malloc(node_count * sizeof(bool *))
};
for (size_t i = 0; i < node_count; i++) {
graph... | ALGO | 0.985981 | 5.201267 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-08-25T16:00: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": "46b0516949... |
0f6862f3-6e78-4bb7-a052-4e847c8be168 | aviral0807/standard-algorithms | string-algorithms/rabin-carp.cpp | #include <bits/stdc++.h>
using namespace std;
const int kPrime = 31;
const int kMod = 1e9 + 9;
bool RabinCarp(string &text, string &pattern) {
int text_len = text.size();
int pattern_len = pattern.size();
vector<long long> prefix_hash(text_len + 1, 0);
long long prime_pow_i = 1;
for(int i = 0; i < text_len;... | ALGO | 0.999985 | 5.369088 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2020-03-16T10:36: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": "f7e050e00... |
5c8fe99c-9fda-4fc4-b67b-a65fed7f21e7 | AtuL-KumaR-00/SDE-Sheet-Challenge-Solutions | Graph/Topological Sort.cpp | #include<bits/stdc++.h>
vector<int> topologicalSort(vector<vector<int>> &edges, int v, int e) {
vector<int> ans;
vector<int> indegree(v,0);
vector<vector<int>> graph(v);
for(int i=0;i<edges.size();i++){
indegree[edges[i][1]]++;
graph[edges[i][0]].push_back(edges[i][1]);
}
queue... | ALGO | 0.999997 | 5.741606 | {
"github_metadata": {
"branch": "main",
"commit_count": 180,
"repo_created_at": "2022-06-05T06:07: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": "62c6a7fe64... |
05f66d7c-c9b0-4883-a847-99e964630404 | egelja/caelus-cml | src/libraries/sampling/sampledSet/patchCloud/patchCloudSet.hpp | /*---------------------------------------------------------------------------*\
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of CAELUS.
CAELUS is free software: you can redistribute it and/or modify it
under... | TOOL | 0.908614 | 6.613051 | {
"github_metadata": {
"branch": "master",
"commit_count": 156,
"repo_created_at": "2021-06-14T18:42:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9fe8fb78... |
141ff19a-ebee-487b-ba27-458147fe0faa | mateosbodio/tp4_eda | ejC.cpp | /*
C. Hacer una función que reciba un puntero y compruebe si el número es par o impar, y señalar la posición de memoria donde se está guardando el número.
*/#include <iostream>
void esParImpar(int* ptr) {
// Comprobar si el número es par o impar
if (*ptr % 2 == 0) {
std::cout << "El número " << *ptr <<... | ALGO | 0.98924 | 5.515357 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-10-19T19:00: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": "97b1bdc7c030... |
f83fe80f-68e0-49ad-a111-157ac401fc67 | namangarg2002/Cpp-Foundation-Course-Supreme-2.0 | codehelp/W19_Graphs/4_class4.cpp | #include <iostream>
#include <unordered_map>
#include <list>
#include <stack>
#include <vector>
#include <limits.h>
#include <set>
using namespace std;
// directed and weighted Graph
class Graph
{
public:
unordered_map<int, list<pair<int, int>>> adjList;
void addEdge(int u, int v, int weight, bool direction)
{
... | ALGO | 0.999966 | 5.356568 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-02-16T11:46: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": "5f12e4e80b04... |
7d57f276-23d7-4f6c-bda9-94f9deded803 | Rk-2005/DSA | 2690-house-robber-iv/2690-house-robber-iv.cpp | class Solution {
public:
bool check(int mid, vector<int>& nums, int k, int i) {
int n=nums.size();
vector<int>dp(n+1,0);
if(nums[0]<=mid){
dp[0]=1;
}
if(nums[1]<=mid){
dp[1]=1;
}else{
dp[1]=dp[0];
}
for(int i=2;i<n;i... | ALGO | 0.999998 | 5.533402 | {
"github_metadata": {
"branch": "main",
"commit_count": 469,
"repo_created_at": "2025-03-15T19:57:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb357e91ec... |
b6201cf7-0ea1-403b-af07-851436772e43 | Prasad2604/DSL_assignments-SE- | Mock_practise/assign_10.cpp | #include <iostream>
#include <cstring>
using namespace std;
bool Operator(char c) {
return (c == '+' || c == '-' || c == '*' || c == '/');
}
//SETTING PRECEDENCE
int precedence(char op) {
if (op == '+' || op == '-')
return 1;
if (op == '*' || op == '/')
return 2;
return 0;
}
//CONVERT... | ALGO | 0.999009 | 4.47536 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2023-09-17T15:56: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": "b35b7e511... |
e0378089-9c05-4711-8c25-aa689fd3ffde | Camithilwen/Code-Cloning-Analysis | src/llm-scripts/testing/Project_CodeNet_experimentation_dataset/data/p03064/s506902741.cpp | #include "bits/stdc++.h"
using namespace std;
#define FAST ios_base::sync_with_stdio(false); cin.tie(0);
#define LLINF ((long long) 1e18)//1234567890987654321
#define INF 1234567890ll
#define pb push_back
#define ins insert
#define f first
#define s second
#define db 0
#define EPS (1e-7) //0.0000001 the value
#defi... | ALGO | 0.999783 | 3.837367 | {
"github_metadata": {
"branch": "main",
"commit_count": 243,
"repo_created_at": "2025-06-06T16:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "3206884793... |
8062c198-1026-49fb-bda9-4811447135b2 | puhua0210/Data-final | MaxHeap_array.cpp | #include <iostream>
#include <string>
#include "stock.hpp"
#include "Vector.hpp"
using namespace std;
//col 0 1 2 3 4
// date open high low close
class MaxHeap{
private:
Vector<stock> arr;
public:
MaxHeap(){}
int size(){
return arr.size();
}
void insert(stock s) {
... | ALGO | 0.99541 | 4.066951 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-06-07T06:28: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": "b9bd79d17fa... |
10be9cff-a4c8-4b24-beef-e8d7f1d680a4 | myidpt/PFSsim | omnetpp/scheduler/SFQRC/SFQRC_old.h | /*
* SFQRC.h
*
* Created on: Nov 12, 2012
* Author: <NAME>
*/
#ifndef SFQRC_H_
#define SFQRC_H_
#define MAX_DEADLINE 1000000
#define MINUS_INF -1000000
#include "scheduler/IQueue/IQueue.h"
using namespace std;
class SFQRC_old : public IQueue {
protected:
static const int MAX_TAG_VALUE = 1000... | TOOL | 0.963517 | 5.235677 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2011-02-24T20:19:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 13,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "d5854a0... |
ae996f71-b329-4e76-8afc-0984d5cc5b6b | Denison904/ChisMetod1 | main.cpp | #include "stdio.h"
#include "math.h"
#include "conio.h"
#include "iostream"
#include <iomanip>
#define M_PI 3.1415926535897932384626433832795
using namespace std;
double grrad(double x, double m, double s)
{
x = x * M_PI / 180 + m * M_PI / 180 / 60 + s * M_PI / 180 / 360;
return x;
}
double fact(int n) {
double f = ... | ALGO | 0.998747 | 3.458395 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-10-17T15:26:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0254e0905... |
c21cc7a4-f3ee-4218-9655-21ff4caa4175 | VastoLorde95/Competitive-Programming | SPOJ/Random/NUMTSN/A.cc | #include <bits/stdc++.h>
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define foreach(it, v) for(auto it=(v).begin(); it != (v).end(); ++it)
#define _ ios_base::sync_with_stdi... | ALGO | 0.999797 | 4.449584 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2017-07-25T11:08:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 171,
"forks": 41,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "87172e... |
a117fb9d-9139-47e8-a058-1f373d3e5ae8 | UtkarshMishra12/Data-Structures-Algorithms-Level-up-Course-2021 | Linked List/Linked List (Push After a Node).cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
class Node{
public:
ll data;
Node *next;
};
void printList(Node *n){
while(n!=NULL){
cout<<n->data<<"-->";
n=n->next;
}
}
void insertAfter(Node* prev_node, int new_data) {
// 1. Check if the given prev... | ALGO | 0.999443 | 4.135386 | {
"github_metadata": {
"branch": "master",
"commit_count": 86,
"repo_created_at": "2021-05-26T08:23: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": "6cfd9aed2... |
ce452fe0-4d56-4ddc-9542-1b6b76e682c8 | austin880625/problem_solving | ZJ/b903-2.cpp | #include <stdio.h>
#include <iostream>
#include <algorithm>
#define LL long long int
#define MAXN 300000
using namespace std;
int N,M,K;
struct Node2
{
LL maxv;
Node2 *ch[2];
Node2(){maxv=0;ch[0]=ch[1]=NULL;}
};
int L2,R2;
int X,Y;LL V;
inline LL mx(Node2 *o){return o ? o->maxv : 0;}
void modify2(Node2 *... | ALGO | 0.999766 | 3.903551 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2015-09-29T21:54: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": "a36533598... |
3e58371f-ef3f-422b-a9e6-3a0fc70d4796 | ShaynaJiang/C-Practice | C/111-final2.cpp | #include <stdio.h>
#include <math.h>
int nCr(int n, int r) {
if (r == 0 || r == n) {
return 1;
} else {
return nCr(n - 1, r - 1) + nCr(n - 1, r);
}
}
void printAA(int a, int b, int n) {
printf("(%d+%d)^%d=", a, b, n);
int i;
for ( i = n; i >= 0; i--) {
int c = nCr(n, i);
... | ALGO | 0.999879 | 3.930528 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-05-04T11:31:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b464a145f36f... |
0cae11e2-8564-426c-b388-5fc536089745 | ihSomik/problem-solving | cses/Palindrome Reorder.cpp | // Palindrome Reorder
// https://cses.fi/problemset/task/1755
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin >> s;
int freq[26] = {0};
// Count the frequency of each character in the string
for (char c : s)
freq[c - 'A']++;
int oddChars(0);
for (int i =... | ALGO | 0.999999 | 5.221419 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-12-20T17:30:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b4123244884... |
7b127c1a-6c79-44a9-b45d-957d917f3143 | knightzf/review | leetcode/shortestPathToGetAllKeys/timeoutSol.cpp | #include "header.h"
class Solution {
private:
int res;
public:
int shortestPathAllKeys(vector<string>& grid) {
int m = grid.size();
int n = grid[0].size();
int startI = 0, startJ = 0;
int keyCnt = 0;
for(int i = 0; i < m; ++i)
{
for(int j = 0; j < n;... | ALGO | 0.999915 | 4.387714 | {
"github_metadata": {
"branch": "master",
"commit_count": 846,
"repo_created_at": "2013-05-15T02:50:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e0f38789... |
8234e537-6fc8-47ae-a6e1-f8a127739e24 | cegme/gatordsr | code/cpp/ER.h |
#ifndef ER_H
#define ER_H
#include "Entity.h"
#include "MentionChain.h"
#include <vector>
class ER {
friend class Entity;
private:
// All the Mention Chains in this entity
std::vector<MentionChain> chains;
// All the Entities for this ER process
std::vector<Entity> entity;
std::function<size_t()> ra... | ALGO | 0.904611 | 5.696718 | {
"github_metadata": {
"branch": "master",
"commit_count": 1219,
"repo_created_at": "2013-01-28T15:36:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 10,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a5b13... |
24a27c43-aa09-4e7a-8219-c1a81e7203b7 | Saber7X/DaiMaDaQuan | CF1539C Stable Groups.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
const int N = 2e5 + 100;
int a[N], b[N];
signed main()
{
int ans = 1;
int n, k, x;
cin >> n >> k >> x;
for (int i = 1; i <= n; i ++ ) cin >> a[i];
sort(a + 1, a + 1 + n);
for (int i = 2; i <= n; i ++ )
{
b[i - 1] = abs(a[i] - a[i - 1]);
... | ALGO | 0.999931 | 4.011775 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-03-07T09:12: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": "c3570e6380... |
469d70b7-2db1-450b-8ebe-a5a7a9cba632 | JamieSandell/CPP | FromBeginnerToBeyond/Challenges/Section008DollarCalculator/main.cpp | #include <iostream>
using namespace std;
/*
* User enters amount of dollars in cents.
* Output is then:
* dollars: x
* quarters: x
* dime: x
* nickel: x
* penny: x
*
* 1 dollar is 100 cents
* 1 quarter is 25 cents
* 1 dime is 10 cents
* 1 nickel is 5 cents
* 1 penny is 1 cent
*/
int main()
{
cout <... | TOOL | 0.989069 | 5.016001 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-03-05T20:39: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": "161a84dcb002... |
6bce2f30-e6d7-4742-8011-f071071b8b18 | Leet-Us-Code/DSA-A-Z-Practice | Sid's Levels/Level - 3/Dynamic Programming/Goldmine.cpp | class Solution{
public:
int maxGold(int m, int n, vector<vector<int>> M)
{
// code here//<NAME>
//<NAME>
//<NAME>
//<NAME>, <NAME>, <NAME>, <NAME>
int dp[n + 1][m + 1];
memset(dp, 0, sizeof(dp));
for (int j = m - 1; j >= 0; j--) {
for (int i = 0... | ALGO | 0.999959 | 4.819725 | {
"github_metadata": {
"branch": "main",
"commit_count": 837,
"repo_created_at": "2020-11-09T10:25:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 23,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e85abdd1c... |
b070d8f0-b841-4236-a5a7-d6eaa6f99558 | morphorm22/analyze | src/helmholtz/HelmholtzResidual.hpp | #pragma once
#include "ToMap.hpp"
#include "FadTypes.hpp"
#include "ScalarGrad.hpp"
#include "SurfaceArea.hpp"
#include "UtilsTeuchos.hpp"
#include "GradientMatrix.hpp"
#include "PlatoMathHelpers.hpp"
#include "ImplicitFunctors.hpp"
#include "InterpolateFromNodal.hpp"
#include "GeneralFluxDivergence.hpp"
#include "Sur... | ALGO | 0.944159 | 5.835021 | {
"github_metadata": {
"branch": "develop",
"commit_count": 3768,
"repo_created_at": "2022-03-31T22:48:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e232fa... |
767b5fa5-9963-4f32-a628-f2a5fbc115e9 | tanyagupta0201/DSA | Linked List/Copy-List-With-Random-Pointer.cpp | // https://leetcode.com/problems/copy-list-with-random-pointer/
// SOLUTION 1: USING MAP
// TC = O(N) + O(N)
// SC = O(N)
class Solution
{
public:
Node *copyRandomList(Node *head)
{
map<Node *, Node *> m; // Link old node to the new node
int i = 0;
// 1) create new nodes, fill values ... | ALGO | 0.998834 | 5.328346 | {
"github_metadata": {
"branch": "main",
"commit_count": 266,
"repo_created_at": "2021-06-19T06:34:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 11,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "79f68386... |
169a2ebe-2d20-4c54-a0c3-ba775ec73bef | sourceinsight/leetcode | cpp/Rotate_List.cc | /*
Given a list, rotate the list to the right by k places, where k is non-negative.
For example:
Given 1->2->3->4->5->NULL and k = 2,
return 4->5->1->2->3->NULL.
*/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* }... | ALGO | 0.999975 | 5.52498 | {
"github_metadata": {
"branch": "master",
"commit_count": 143,
"repo_created_at": "2014-12-16T02:53:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "26eab31b... |
911a8d95-eb7d-44fa-a2c5-4f51ffbd11e0 | R1ch1131/Progmming | 4.2.cpp | #include <iostream>
#include <vector>
#include <utility>
using namespace std;
class CustomQueue {
private:
vector<pair<int, unsigned int>> pq;
void siftUp(int index) {
while (index > 0) {
int parent = (index - 1) / 2;
if (pq[parent].first < pq[index].first) {
s... | ALGO | 0.999832 | 5.019472 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-11-03T05:46: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": "2f9560134622... |
aef74ba9-1ec4-494e-9f9b-d966fd1f3511 | patbecich/Purcell-CPP-for-Beginners | 2.17-cppConditions/cppConditions.cpp | #include <iostream>
//#include <iomanip>
using namespace std;
// we already know ==, !=, <, >, <=, >=
int main() {
int value1 = 7;
int value2 = 4;
if(value1 < 8){
cout << "Condition 1: true" << endl;
}
else {
cout << "Condtion 1: false" << endl;
}
if(value1 < 8 && value2 == 4){
cout << ... | TOOL | 0.975649 | 3.588455 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-05-01T03:34: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": "25a7cd2219... |
6f2813e5-2699-4fdd-8bf4-79e43efc51c7 | FrancsXiang/DataStructure-Algorithms | sort/bucket_sort.cpp | //bucket_sort implementation by array.
//you could learn more about the bucket_sort extension knowledge which is widely used in Hadoop,Tero_sort.
//strategy:
//1.make sure of the range of datasets.
//2.make uniform splits on the datasets.
//3.group the data into several buckets.
//4.sort on each bucket parallelly.
//... | ALGO | 0.999645 | 3.999609 | {
"github_metadata": {
"branch": "master",
"commit_count": 187,
"repo_created_at": "2020-04-13T00:11:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e89eaa5f... |
f31afc29-9747-4999-978a-61555da22807 | quocnguyenx43/object-oriented-programming | object_oriented_programming/bt04.2/bai_2.cpp | #include <iostream>
#include <cmath>
using namespace std;
class SoPhuc
{
private:
int thuc, ao;
public:
SoPhuc();
SoPhuc(int, int);
~SoPhuc();
void Nhap();
void Xuat();
float GiaTriTuyetDoi();
SoPhuc TinhTong(SoPhuc);
SoPhuc TinhHieu(SoPhuc);
SoPhuc TinhTich(SoPhuc);
SoPh... | TOOL | 0.943256 | 3.949812 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-07-24T02:37: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": "bf9cf645a9... |
b67b5abc-ce49-4b68-b498-faf0810fa5ea | BrunoLevy/geogram | src/lib/geogram/third_party/HLBFGS/HLBFGS.cpp | ///////////////////////////////////////////////////////////////////////////////
// //
// HLBFGS //
// http://www.loria.fr/~liuyang/software/HLBFGS/ ... | ALGO | 0.999979 | 5.76706 | {
"github_metadata": {
"branch": "main",
"commit_count": 1455,
"repo_created_at": "2022-02-23T14:58:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2189,
"forks": 151,
"issues": 49,
"pull_requests": 2
},
"file_meta": {
"content_id": "40f... |
5dc929d2-e7ae-475a-a9df-5eedaafe9b87 | kevinche75/algorithms_and_datastructures_itmo_spring_2020 | Part_2/P3210_DBelyakov_1604.cpp | #include <iostream>
#include <algorithm>
using namespace std;
struct sign{
long index;
long count;
};
int n;
long sum;
sign signs[10001];
int main()
{
cin >> n;
int left = 0;
int right = n-1;
for (long i = 0; i < n; i++) {
cin >> signs[i].count;
signs[i].index = i+1;
... | ALGO | 0.999994 | 3.680016 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-05-02T12:32: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": "80ddc123c0... |
6eb717a5-efba-4e6a-93ba-aa8136ef6208 | izhang05/Competitive-Programming | cf/contest/1850/a/a.cpp | /* Author: izhang
* Time: 07-21-2023 16:38:32
**/
#include <bits/stdc++.h>
using namespace std;
#if defined LOCAL || defined DEBUG
#include <debug.h>
#else
struct dbg {
template<class c>
dbg &operator<<(const c &) { return *this; }
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#endi... | ALGO | 0.999116 | 5.521651 | {
"github_metadata": {
"branch": "master",
"commit_count": 691,
"repo_created_at": "2021-01-21T17:58:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c606ee92... |
8b792e5c-e07b-4edc-87c6-5dd8b15dd6be | SaadNoor555/cp-practice | PatternMatching.cpp | //tempplate written by saad
//code by me
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<stdio.h>
#define ELIF else if
#define FOR(iterator , limit , adder) for(int iterator=0; iterator<limit; iterator+=adder)
#define PI 3.1415926535897932384626433832795
#define PB push_back
typede... | ALGO | 0.999861 | 3.479085 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2020-12-05T20:53: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": "139e0922e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.