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 |
|---|---|---|---|---|---|---|---|
70e50ece-6848-4dbc-bdcd-1f780a0bb1b8 | 54k/leetcode-rs | cpp/foxford/40/C.cpp | #include <bits/stdc++.h>
using namespace std;
class UnionFind
{
public:
UnionFind(int n) : parent(n), rank(n, 0)
{
iota(parent.begin(), parent.end(), 0);
}
int find(int x)
{
if (parent[x] != x)
{
parent[x] = find(parent[x]);
}
return parent[x];
... | ALGO | 0.999949 | 4.769602 | {
"github_metadata": {
"branch": "main",
"commit_count": 2784,
"repo_created_at": "2022-11-22T04:14:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "66d4ee07a... |
5df7f487-94d5-4003-b14e-26abc0af6e25 | tatsumack/atcoder | arc107/BQuadruple.cpp | #include <bits/stdc++.h>
#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " ... | ALGO | 0.999935 | 4.137415 | {
"github_metadata": {
"branch": "master",
"commit_count": 527,
"repo_created_at": "2018-03-12T23:22: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": "8435eb4b... |
fdf7a5b8-f606-4cf9-b049-21792f0c579b | Garrrruii/BOJ | Geom & Math/BOJ13202 Geom.cpp | //pizza arrangement
//might be r1=r2
#include <cstdio>
#include <cmath>
using namespace std;
int main() {
int T;
scanf("%d", &T);
double r3 = (3 - 2 * sqrt(2)) / (3 + 2 * sqrt(2));
while (T--) {
int A, B, K;
scanf("%d%d%d", &A, &B, &K);
double a = (double)A, b = (double)B;
double r0 =(a * b)/ (a + b + sq... | ALGO | 0.999699 | 3.835539 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2020-12-18T16:56: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": "d8db44f1e... |
51cb514b-28f8-4680-9103-418d1219dbe8 | chanfool21/Competitive-Coding | summer_love/FOCUS/Graph/topologicalsorting_kahn'salgo.cpp | #include<bits/stdc++.h>
using namespace std;
int adj[100][100];
int indegree[100];
bool top = false;
void topological(vector<int>&vec,int n)
{
queue<int>que;
int ctr = 0;
for(int i = 0; i < n; i++)
{
if(indegree[i] == 0)
{
que.push(i);
}
}
int v;
while(!... | ALGO | 0.999999 | 4.840617 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2017-09-27T11:32: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": "e38d9d0f1... |
304a0409-9505-433d-ad60-d5888f09c686 | praharshjain/Data-Structures | min_heap.cpp | #include <bits/stdc++.h>
using namespace std;
//generic implementation of Min Heap using array
template <class T>
struct node
{
T data;
struct node *left;
struct node *right;
};
template <class T>
class MinHeap
{
private:
unsigned int size;
unsigned int capacity;
T *arr;
pub... | ALGO | 0.999721 | 4.328941 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2017-01-18T12:32:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e492ed0a... |
b2898749-5709-4840-980e-1acb010ca32f | DikshantBadawadagi/DSA | chefFlower.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int numberOfTests;
cin >> numberOfTests;
while (numberOfTests--) {
int flowerCount, minimumBloom, dayCount;
cin >> flowerCount >> minimumBloom >> dayCount;
vector<int... | ALGO | 0.999939 | 4.837616 | {
"github_metadata": {
"branch": "main",
"commit_count": 413,
"repo_created_at": "2024-09-15T05:31: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": "a817b5bd33... |
3d384dff-8d8a-4f9e-aa8e-58a048de95cd | madhav2624/os | All Codes/priority(non-pre).cpp | #include <stdio.h>
int findmin1(int n,int arr[][7],int vis[]){
int min = 100000,ind;
for(int i =1;i<=n;i++){
if(min > arr[i][1] && vis[i]==-1){
min = arr[i][1];
ind = i;
}
}
return ind;
}
int findmin(int n,int arr[][7],int vis[],int ct){
int min = 10000,ind=-1;
for(int i=1;i<=n;i++){
if(vis[i]==-1 ... | ALGO | 0.999962 | 3.390966 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-02-22T02:50: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": "e25144ea295e... |
29b191a3-b4a8-4832-bfc8-aaa90fb3b760 | avikodak/algos_v2 | src/main/avikodak/sites/geeksforgeeksv1/arrays/page11/mergesortedarray.h | /****************************************************************************************************************************************************
* File Name : mergesortedarray.h
* File Location : \algos_v2\src\main\avikodak\sites\geeksforgeeks\arrays\page10\mergesortedarray.h
*... | ALGO | 0.99998 | 6.055784 | {
"github_metadata": {
"branch": "master",
"commit_count": 492,
"repo_created_at": "2014-10-09T08:32:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df8f873e... |
3e86d77c-8f15-4ef4-83d4-6b01452c8b01 | redevilsss/leetcode | 201-250/230 二叉搜索树第k小的元素.cpp | #include<iostream>
#include<stack>
using namespace std;
//230 二叉搜索树第k小的元素
/*
给定一个二叉搜索树,编写一个函数 kthSmallest 来查找其中第 k 个最小的元素。
说明:
你可以假设 k 总是有效的,1 ≤ k ≤ 二叉搜索树元素个数。
*/
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
//可以递归解决也可以用栈来实现中序遍历
//递归方法1
//get... | ALGO | 0.999998 | 5.355542 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2019-04-02T15:15:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "208875b65... |
da2c0b1d-deec-432a-815e-c2fd089b9bf3 | denis-gubar/TopCoder | TCCC 2005 Qualification Set 1-2/LandMines.cpp | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <queue>
#include <vector>
using namespace std;
// BEGIN CUT HERE
#include <Windows.h>
#pr... | ALGO | 0.999744 | 4.172844 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-12-21T13:06: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": "a5edb394fb... |
569c2858-9320-45ac-b78d-ade789aa283b | YouChenLiu/leetcode | 345.reverse-vowels-of-a-string.cpp | /*
* @lc app=leetcode id=345 lang=cpp
*
* [345] Reverse Vowels of a String
*/
// @lc code=start
#include <cctype>
#include <string>
using namespace std;
class Solution {
public:
bool isVowel(char ch) {
ch = std::tolower(ch);
return ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u';
}
st... | ALGO | 0.999708 | 6.892088 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-12-13T16:08:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f9f105906... |
9c29e04b-25d8-4be1-8b32-c72657cc093b | ishandutta2007/codeforces-p | pavement/normal/37/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int N, O, M, R, C, T, P[1005], D[1005];
bitset<1005> V;
vector<pair<int, int> > U;
main() {
V.reset();
ios::sync_with_stdio(0);
cin.tie(0);
cin >> N >> M >> R;
O = M;
for (int i = 1; i <= N; i++) cin >> P[i] >> D[i];
for (; M > 0; M = min(O, M... | ALGO | 0.999953 | 3.394871 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15: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": "34f1d7a8470d... |
d5836c06-4ff5-47c7-8a24-c58bf25c41e4 | arm-hpc-user-group/Cloud-HPC-Hackathon-2021 | Applications/Applications/memxct/src/kernels.cpp | #include "vars.h"
extern float *raypart;
extern float *raybuff;
extern int raynuminc;
extern int raynumout;
extern int mynumray;
extern int mynumpix;
extern int *raysendstart;
extern int *rayrecvstart;
extern int *raysendcount;
extern int *rayrecvcount;
extern int *rayraystart;
extern int *rayrayind;
extern int *ra... | ALGO | 0.999283 | 4.343504 | {
"github_metadata": {
"branch": "main",
"commit_count": 654,
"repo_created_at": "2021-06-07T16:00:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 31,
"forks": 59,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "90ed58e47... |
0e840ce1-6863-41b7-8b0a-a195c79af021 | AnhLM027/ICPC_PTIT-2024 | SOURCE/5C.cpp | #include<bits/stdc++.h>
#define MOD 1000000007
#define maxn 1000006
#define maxx 100000009
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
double solve(int n, int k, vector<int>& D) {
if (k == 1) {
vector<int> sortedD = D;
sort(sortedD.be... | ALGO | 0.999979 | 5.352419 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-09-10T00:50:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1db4020f0d90... |
12b13ce6-b624-4041-88bd-03f46369e3ae | dohui-son/Algorithms-Cplusplus | pre_src/src/Kwb.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 987654321;
//카카오기출-외벽점검
//팁 : make the circle linear
using namespace std;
const int INF = 987654321;
vector<int> changeStartIdx(vector<int>weak, int start, int n){
if(start == 0)return weak;
vector<int> _ret;
for(int i = start; i<weak.size(); i... | ALGO | 0.999914 | 4.084751 | {
"github_metadata": {
"branch": "master",
"commit_count": 186,
"repo_created_at": "2021-03-01T10:52: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": "82ae22b8... |
9233949a-9056-4df1-8333-43cc2930a295 | xiaoxiangyeyu-zxy/interpolation_cpp | interpolation.cpp | #include "interpolation.h"
void interpolation(double den, double energy, double(&result)[datanumber])
{
double lgden = log(den) / log(10);
double lgE = log(energy) / log(10);
int i = (lgden - lgDenmin) / dlgDen;
int j = (lgE - lgEmin) / dlgE;
double deltaden = lgden - lgDenmin - i * dlgDen;
double deltaE = lgE ... | ALGO | 0.996578 | 3.759112 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-03-14T10:38: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": "981807dfca03... |
956b950e-2e76-45eb-9863-50e8986bcdfa | 113bommy/PathRepair | variable_trace/cpp/cpp_code/cpp_incorrect/cpp_incorrect_test_160_5.cpp | #include <bits/stdc++.h>
using namespace std;
long long qpow(long long a, long long b, long long p) {
long long ret = 1;
for (a %= p; b; b >>= 1, a = a * a % p)
if (b & 1) ret = ret * a % p;
return ret;
}
long long qpow(long long a, long long b) {
long long ret = 1;
for (; b; b >>= 1, a *= a)
if (b & ... | ALGO | 0.999907 | 4.683018 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-11-11T15:46:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43139af4af4... |
97add3d9-90fd-4f56-975b-61ca60717034 | Arghyahub/Cplusplus | DP/partitionEqualSubsetSumMemoization_Better.cpp | class Solution {
bool solve(vector<int>& nums, int i, int total,vector<vector<int>> &dp)
{
if (total<0) return false;
if (i==0){
if (total - nums[i] == 0)
return true;
return false;
}
if (dp[i][total]!=-1) return dp[i][total] ;
... | ALGO | 0.999901 | 5.565544 | {
"github_metadata": {
"branch": "main",
"commit_count": 419,
"repo_created_at": "2022-04-16T18:20: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": "64773f4f7c... |
7d874248-6c8c-49f0-849b-e68cb84cfc97 | superpavelka/C-17_STL_Samples | Chapter06-Fourier/fourier.cpp | #include <iostream>
#include <complex>
#include <vector>
#include <algorithm>
#include <iterator>
#include <numeric>
#include <valarray>
#include <cmath>
using namespace std;
// Тип csignal может быть вектором, содержащим комплексные числа.Для работы с такими числами
// в STL существует класс std::complex.Функция st... | ALGO | 0.998634 | 4.706824 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2021-07-13T06:11:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b98ae4fe386... |
48392e8a-06f0-4d56-8d01-90f9975c5e2d | alpha74/iHE | Algorithms/Dynamic_Programming/Introduction_to_Dynamic_Programming_1/Odd_Even_Subarrays.cpp | // Return count of odd-even subarrays
// https://www.hackerearth.com/practice/algorithms/dynamic-programming/introduction-to-dynamic-programming-1/practice-problems/algorithm/odd-even-subarrays-72ad69db/
// <NAME>
#include <bits/stdc++.h>
using namespace std ;
#define ll long long int
#define ull unsigned long long ... | ALGO | 0.999901 | 4.47324 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-09-02T12:53:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "184e99041... |
0e4ff51a-26ee-4a1c-9ce1-2f23fb3af864 | lynliam/note | c_code_learn/cpp learn/cppege/snake/main.cpp | # include<stdio.h>
# include<graphics.h>
# include<conio.h>
# include<stdlib.h>
#define SNAKE_NUM 500
enum DIR //表示蛇的方向
{
UP,
DOWN,
LEFT,
RIGHT,
};
struct Food
{
int x;
int y;
int r;
bool flag;//定义食物是否被吃掉
DWORD color;
}food;
struct Snake
{
int size;
int speed;
int dir;
POINT coor[SNAKE_NUM];
}snake;
vo... | ALGO | 0.998082 | 4.454129 | {
"github_metadata": {
"branch": "main",
"commit_count": 220,
"repo_created_at": "2022-12-30T04:05:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f4fd3f6d1... |
0af6bbde-0924-40fd-a9ec-c2b7bc4c6066 | jhonnySarmaLegend/Striver-SDE | Day 7 : Linked List & Arrays/4_TrappingRainwater.cpp | /*
Question Link --> https://leetcode.com/problems/trapping-rain-water/description/
*/
//Good Solution --> TLE
// T.C. = O(N^2) , S.C. = O(1)
class Solution {
public:
int trap(vector<int>& height) {
//water trapped = min(maxL,maxR)-height[i]
int n=height.size();
int ans=0;
for(int... | ALGO | 0.999995 | 6.622882 | {
"github_metadata": {
"branch": "main",
"commit_count": 185,
"repo_created_at": "2025-04-10T04:36: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": "a0f7b59c47... |
db4bad9f-9b91-4ec3-b38b-3418934bc959 | apokrif6/codewars-cpp | 7kyu/fusion_chamer_shutdown.cpp | //A laboratory is testing how atoms react in ionic state during nuclear fusion. They introduce different elements with Hydrogen in high temperature and pressurized chamber. Due to unknown reason the chamber lost its power and the elements in it started precipitating
//Given the number of atoms of Carbon [C],Hydrogen[H]... | ALGO | 0.999392 | 4.46067 | {
"github_metadata": {
"branch": "main",
"commit_count": 308,
"repo_created_at": "2022-11-07T16:26:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5ed32602... |
c30cd3af-115b-42a8-bf75-acfb2533928e | WhiZTiM/coliru | Archive2/c0/d6a8a27781a122/main.cpp | #include <iostream>
#include <string>
#include <fstream>
int main()
{
//////////////////////////////////////////////////////////////
// create the test file (this is just for testing)
{
std::ofstream( "marks.txt" ) <<
"8\n"
"26 21 41 <... | TOOL | 0.926892 | 4.584222 | {
"github_metadata": {
"branch": "master",
"commit_count": 42630,
"repo_created_at": "2016-04-21T16:34: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": "23ee57... |
0e74035a-96af-45e9-869b-f86bd9a0a11c | Ahmad45123/codeforces-submissions | codeforces/1382/C2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve(vector<int> &ans, string &x) {
char curPrefix = x[0];
for(int i = 0; i < x.size(); i++) {
if(x[i] != curPrefix) {
ans.push_back(i);
curPrefix = x[i];
}
}
if(curPrefix == '1')
... | ALGO | 0.999948 | 3.444288 | {
"github_metadata": {
"branch": "master",
"commit_count": 515,
"repo_created_at": "2021-01-11T18:38:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "24779338... |
7f00bf5c-7503-4343-b9ba-1e78f6a0cd7b | MPDR200011/CAL_FEUP | cal_fp01/src/Change.cpp | /*
* Change.cpp
*/
#include "Change.h"
#include <sstream>
string calcChange(int m, int numCoins, int* coinValues) {
if (m < 1) {
return "";
}
if (m < coinValues[0]) {
return "-";
}
int minCoins[m + 1]={0};
int lastCoin[m + 1]={0};
for (int i = 0; i < numCoins; i++) {
... | ALGO | 0.988486 | 4.726588 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-03-09T14:28:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2676d2a5db... |
fcc6aef4-970c-4088-9f92-25e7da5d6387 | Sai-004/CS348-Implementation-of-Programming-Languages-Lab | Assignment 1/PassOne.cpp | #include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <sstream>
#include <algorithm>
#include <map>
using namespace std;
// Define a structure to represent an assembly language instruction
struct Instruction
{
string label;
string opcode;
string operand;
};
// Global maps f... | TOOL | 0.939918 | 4.536498 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-02-02T22:25: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": "acca0f13d701... |
327acf3c-d96a-4d0e-8ba7-176fc783551a | izhang05/Competitive-Programming | cf/contest/1567/c/c.cpp | /* Author: izhang05
* Time: 09-29-2021 14:04:27
**/
#include <bits/stdc++.h>
using namespace std;
//#define DEBUG
void setIO(const string &name) {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cin.exceptions(istream::failbit);
#ifdef LOCAL
freopen(("in" + name + ".txt").c_str(), "r", stdin);
... | ALGO | 0.999816 | 4.540735 | {
"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": "6ed86085... |
56977d17-e56c-4ba8-a58b-93a7001ea163 | balintbarna/Sokoban-AI-Semester-Project | cppsolver/src/main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <math.h>
using namespace std;
typedef vector<string> SMap;
const char CHAR_WALL = 'X';
const char CHAR_GOAL = 'G';
const char CHAR_CAN = 'J';
const char CHAR_CAN_ON_GOAL = 'j';
const char CHAR_ROBOT = ... | ALGO | 0.999769 | 4.19708 | {
"github_metadata": {
"branch": "master",
"commit_count": 129,
"repo_created_at": "2019-09-24T19:52:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f41024c2... |
17a13b52-06f2-4810-88c5-82e80c0c639b | sr-sourabh/hackerrank- | Tree Height of a Binary Tree.cpp | // https://www.hackerrank.com/challenges/tree-height-of-a-binary-tree?h_r=next-challenge&h_v=zen
#include <iostream>
#include <cstddef>
using namespace std;
class Node{
public:
int data;
Node *left;
Node *right;
Node(int d){
data = d;
left = NULL;
... | ALGO | 0.999954 | 5.139449 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2017-02-04T16:21: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": "5d1f7d1bf... |
a8132570-fd03-4a32-83e4-8cb477ebf441 | douglasichen/CP_NEW | Grouped/dmoj/ccc18s3.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
int main() {
cin.sync_with_stdio(0);
cin.tie(0);
int N,M; cin>>N>>M;
vector<vector<char>> G(N, vector<char>(M));
vector<int> start;
vector<vector<int>> cams, dirs={{1,0}, {0,1}, {-1,0}, {0,-1}}, emps;
for (int y=0; y<N; y++) {
for (int x=0; x<M... | ALGO | 0.999945 | 4.749405 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2023-01-01T05:10: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": "f40e36947f5... |
95e4af1f-5e1f-4ad4-91fe-3446f8868555 | ldm5180/aoc-2016 | src/02.cpp | #include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <boost/algorithm/string/trim.hpp>
#include <boost/optional.hpp>
using boi = boost::optional<int>;
using Keypad = std::vector<std::vector<boi>>;
class Person {
public:
Person(const Keypad &k) : keys(k) {
for (row = 0; row < s... | ALGO | 0.939312 | 5.531061 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2016-12-15T01:15: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": "57ff1c221... |
a45325f9-65ac-4413-ae6f-2b15306d0dbc | JayantGoel001/LeetCode | 0234-palindrome-linked-list/0234-palindrome-linked-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
bool isPalindrome(Lis... | ALGO | 0.999684 | 6.121202 | {
"github_metadata": {
"branch": "master",
"commit_count": 7444,
"repo_created_at": "2021-10-01T11:35:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "490209... |
b215cb90-55d3-4703-a022-90b2de6c639f | hg3994/code.cpp | 28_shortest_distance_between_two_cells_in_a_matrix__BFS.cpp | /*
<NAME> | 29th October, 2018
https://ide.geeksforgeeks.org/FRtwW9xuXI
https://www.geeksforgeeks.org/shortest-distance-two-cells-matrix-grid/
C++ program for finding the shortest distance from a source cell to a destination cell,
traversing through limited cells only. Also you can move only up, down, left and ... | ALGO | 0.999878 | 5.391412 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2018-10-18T15:31: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": "d25139666... |
41d7a9e1-4863-44b3-9e35-1b96d7635a6d | la-rubia/EDA-FIB | P49889.cc | #include <iostream>
#include <vector>
using namespace std;
using VC = vector<char>;
using VB = vector<bool>;
int n;
VC c,v;
VB cv,vv;
void back(int k, string s) {
// cout << k << ' ' << s << endl;
if(k==2*n) cout << s << endl;
for(int i=0; i<n; i++) {
if(k%2==0) {
// hay que poner con... | ALGO | 0.999949 | 3.187652 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2022-10-15T13:14: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": "536d71c3ed2... |
1d6810b3-081d-4231-b9e8-5800d0f6d353 | leggedrobotics/ocs2 | ocs2_core/src/loopshaping/dynamics/LoopshapingDynamics.cpp | /******************************************************************************
Copyright (c) 2021, <NAME>. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain t... | ALGO | 0.998974 | 7.530742 | {
"github_metadata": {
"branch": "main",
"commit_count": 7465,
"repo_created_at": "2021-07-08T07:09:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1106,
"forks": 258,
"issues": 50,
"pull_requests": 3
},
"file_meta": {
"content_id": "a0f2... |
90486d0b-7968-4b38-b945-c0ace3aeff51 | yashraj01-se/DSA | TREE/top_level_view.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
using namespace std;
struct Node
{
int data;
Node *left;
Node *right;
Node(int val)
{
data = val;
left = right = NULL;
}
};
vector<int>top_view(Node *root){
map<int,int>mpp;//vertical,value;... | ALGO | 0.999998 | 4.823872 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-07-11T20:30: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": "fb30faa487a... |
b154a887-8f79-49d7-930a-a8564f2608dc | atharvk47/DSA | Trees/Lowest Common Ancestor.cpp | #include<bits/stdc++.h>
using namespace std;
class TreeNode{
public:
int data;
TreeNode* left;
TreeNode* right;
};
TreeNode* LCA(TreeNode* root, TreeNode* p,TreeNode* q){
if(root == NULL || root == p || root == q){
return root;
}
TreeNode* LCAleft = LCA(root->left,p,q);
TreeN... | ALGO | 0.999993 | 4.866693 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2023-08-20T17:33:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6fe0d5168... |
ee8dc06e-9542-4ac4-ba61-7f9f190bd540 | udacity/self-driving-car | image-localization/community-code/roboauto/ros/src/NeuralNetworkLib/src/NeuralNetwork/Learning/BatchPropagation.cpp | /*
* Copyright 2016 <NAME>, <EMAIL>
* All rights reserved.
*
* This file is part of NeuralNetworkLib
*
* NeuralNetworkLib 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 L... | ALGO | 0.991122 | 5.323604 | {
"github_metadata": {
"branch": "master",
"commit_count": 251,
"repo_created_at": "2016-10-02T02:47:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6272,
"forks": 2112,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "261... |
0f3b91e8-77eb-483d-b139-4fd9e1143343 | neetcode-gh/leetcode | cpp/0953-verifying-an-alien-dictionary.cpp | /*
Given list of words in another language, return string such that:
Letters are sorted in lexicographical incr order wrt this language
Ex. words = ["wrt","wrf","er","ett","rftt"]
Build graph + record edges, BFS + topological sort, check cyclic
Time: O(n)
Space: O(n)
*/
class Solution {
publi... | ALGO | 0.999999 | 6.255199 | {
"github_metadata": {
"branch": "main",
"commit_count": 9682,
"repo_created_at": "2021-01-20T16:10:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6062,
"forks": 2417,
"issues": 330,
"pull_requests": 215
},
"file_meta": {
"content_id": ... |
94ccea95-519a-4983-8338-4b5d926dcc20 | its-me-bauddha/hustle-leetcode | 967-minimum-falling-path-sum/minimum-falling-path-sum.cpp | class Solution {
public:
int recSolve(vector<vector<int>>& matrix,int row,int col){
int n = matrix.size();
int m = matrix[0].size();
if(row == n-1){
return matrix[row][col];
}
int minSum = INT_MAX;
int sum =0;
sum= matrix[row][col];
if(... | ALGO | 0.999997 | 6.295858 | {
"github_metadata": {
"branch": "main",
"commit_count": 369,
"repo_created_at": "2024-03-20T14:51:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d3c5910c9... |
a13725b4-83b8-4788-909b-6cef0a815aac | macoustics/split-radix-fft | include/splitradixfft.hpp | /*
* MIT License
*
* Copyright (c) 2023 [Your Name]
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modi... | ALGO | 0.999316 | 4.693779 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2024-04-09T03:51:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "b8e64f4305c... |
2a7288c7-1365-4895-a9e3-5437bef17f47 | otavioon/COLA-2022-Tools | datasets/src/optz/codenet/2/p03775_s028429550.cpp | #include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
uint64_t N;
pair<uint64_t, uint64_t> dv(uint64_t n, uint64_t d) {
uint64_t e = 0;
while (n % d == 0) {
++e;
n /= d;
}
return make_pair(n, e);
}
map<uint64_t, uint64_t> factorize(ui... | ALGO | 0.999853 | 4.200083 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2022-06-08T12:17:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d310f94bc... |
06719e7b-c01a-4c07-8f8e-a82b22ed8201 | truemanchen/PAT- | A1059 Prime Factors (25分)/A1059.cpp | #include<iostream>
#include<map>
#include<math.h>
typedef long long ll;
using namespace std;
const int maxn = 10001;
int p[maxn], num=0;
bool isPrime(ll n) {
if (n <= 1)return false;
ll s = (ll)sqrt(1.0 * n);
for (ll i = 2; i <= s; i++) {
if (n % i == 0)return false;
}
return true;
}
void findPrime(ll n ) {
ll ... | ALGO | 0.999954 | 4.175256 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-06-30T07:12: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": "80bc10f72e... |
fd7939ce-086b-4e5b-9d00-65597da291df | jagadeeshnelaturu/codeforces_solutions | 254A.cpp | #include <iostream>
#include <map>
#include <sstream>
#include <fstream>
int main() {
std::ifstream in("input.txt");
std::streambuf *cinbuf = std::cin.rdbuf(); //save old buf
std::cin.rdbuf(in.rdbuf()); //redirect std::cin to in.txt!
std::ofstream out("output.txt");
std::streambuf *coutbuf = std::cout.rdbuf... | ALGO | 0.999656 | 3.586476 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2015-09-08T18: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": "35a13cb60c... |
bcf82383-bad3-4ad8-9aed-da14b6f2e4bb | 500a5/BSTU_LAB | Бакалавриат/2 курс 1 семестр/3 сем чьие то лабы/Алгоритмы и структуры данных/лаб 6(сдал)/lab 6/lab 6/System.cpp | #define _CRT_SECURE_NO_WARNINGS
#include "System.h"
#include "stdio.h"
#include "stdlib.h"
#include "malloc.h"
#include "processors.h"
#include "Structs.h"
#include "Turn.h"
//-------Глобальные переменные---------
Fifo fifo0;
Fifo fifo1;
Fifo fifo2;
Stack *stack;
CPU cpu;
short CountFinishTask = 0; //количество решён... | ALGO | 0.997472 | 3.168425 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2023-10-01T20:07:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a75625b4b0a... |
cd5f9b86-9897-4b7b-8077-a2e81129870f | tdsmith/celltool | celltool/numerics/stlib/ads/indexedPriorityQueue/IndexedPriorityQueueLinearSearchPartitionAdaptive.h | // -*- C++ -*-
/*!
\file ads/indexedPriorityQueue/IndexedPriorityQueueLinearSearchPartitionAdaptive.h
\brief Indexed priority queue that uses linear search.
*/
#if !defined(__ads_indexedPriorityQueue_IndexedPriorityQueueLinearSearchPartitionAdaptive_h__)
#define __ads_indexedPriorityQueue_IndexedPriorityQueueLin... | ALGO | 0.994762 | 6.867156 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-03-31T19:21:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b56798135b... |
71df9635-91a8-4511-b65d-971c1bde3904 | BiPaulEr/Modern_C_plus_plus | demo/2_New_STD/Ranges/combined.cpp | #include <iostream>
#include <iostream>
#include <vector>
#include <ranges>
#include <algorithm>
int main() {
std::vector<int> vec = { 1, 2, 3, 4, 5 };
auto combined_view = vec | std::views::transform([](int x) { return x * 2; }) | std::views::filter([](int x) { return x > 2; });
std::cout << " Combined"... | TOOL | 0.972472 | 5.947201 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2025-03-05T10:21: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": "684437f1bf1... |
589df12f-24ac-43f6-bc8a-87d9ebce6f14 | wisdompeak/LeetCode | Greedy/2565.Subsequence-With-the-Minimum-Score/2565.Subsequence-With-the-Minimum-Score.cpp | class Solution {
public:
int minimumScore(string s, string t)
{
int m = s.size();
int n = t.size();
vector<int>left(n, m);
int j = 0;
for (int i=0; i<n; i++)
{
while (j<m && s[j]!=t[i])
j++;
if (j<m)
{
... | ALGO | 0.999982 | 5.590587 | {
"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": "d... |
305c27aa-71fa-452c-9e18-56e68fd13e83 | AnastasiaGorshkova/CLAY | Task_1/Tridiagonal.cpp | #include <iostream>
#include <vector>
std::vector<double> solveTridiagonalMatrix(const std::vector<double>& a, const std::vector<double>& b, const std::vector<double>& c, const std::vector<double>& d)
{
int n = d.size();
std::vector<double> p(n);
std::vector<double> q(n);
std::vector<double> x(n);
... | ALGO | 0.999972 | 4.475199 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2024-02-05T07:42:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "8193bf94495... |
8c407222-e3e7-46d2-8504-73e3a6d29925 | katarinamolotova/algorithmic-trading | src/model/polynomial_approximation/polynomial_approximation.h | //
// Created by <NAME> on 5/26/23.
//
#ifndef ALGORITHMIC_TRADING_POLYNOMIAL_APPROXIMATION_H
#define ALGORITHMIC_TRADING_POLYNOMIAL_APPROXIMATION_H
#include <vector>
#include "../helpers/matrix.h"
#include "view/qcustomplot.h"
namespace s21 {
class PolynomialApproximation {
public:
explicit PolynomialApproximat... | ALGO | 0.962685 | 6.337756 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-07-30T13:13:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c93927437... |
c32c9e98-8f44-48c6-b023-bcd5cf6c01cd | cuom1999/CP | CF/1215/1215D/1215D.cpp | #include <bits/stdc++.h>
#define ld long double
#define sf scanf
#define pf printf
#define pb push_back
#define PI ( acos(-1.0) )
#define IN freopen("input.txt","r",stdin)
#define OUT freopen("output.txt","w",stdout)
#define FOR(i,a,b) for(int i=a ; i<=b ; i++)
#define FORD(i,a,b) for(int i=a ; i>=b ; i--)
#define INF... | ALGO | 0.999957 | 3.352479 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2020-02-24T01:23:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "b80dbb3e8... |
9fca884a-c62d-4c6b-ba03-ea306e75d0f1 | ArchanPatel890/CompetitiveProgramming | Codeforces/Official/668/668C.cpp | /*
* Note: This template uses some c++11 functions , so you have to compile it with c++11 flag.
* Example:- $ g++ -std=c++11 c++Template.cpp
*/
/******** All Required Header Files ********/
#include <bits/stdc++.h>
using namespace std;
/******* All Required define Pre-Processors and typedef Constants ***... | ALGO | 0.999912 | 3.836045 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2020-07-18T01:23:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "165d1ca04... |
d54cb4a8-b41d-4619-878c-4f96f47aeac0 | xryuseix/SA-Plag | test/training_data/plag_original_codes/tenka1_2018_d_8318569_336_plag.cpp | /*
引用元:https://atcoder.jp/contests/tenka1-2018-beginner/tasks/tenka1_2018_d
D - CrossingEditorial
// ソースコードの引用元 :
https://atcoder.jp/contests/tenka1-2018-beginner/submissions/8318569
// 提出ID : 8318569
// 問題ID : tenka1_2018_d
// コンテストID : tenka1-2018-beginner
// ユーザID : xryuseix
// コード長 : 2864
// 実行時間 : 20
*/
#includ... | ALGO | 0.999858 | 3.501979 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2021-01-20T18:36:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5a7cc11... |
492025ff-6d86-449b-a2ea-12d99f62b685 | cmse822/cmse822-ss25-ss25-cmse822-codex-ss25 | homework/homework2/code/4.13_and_4.14/isendirecvarray.cxx | /****************************************************************
****
**** This program file is part of the book
**** `Parallel programming for Science and Engineering'
**** by <NAME>, <EMAIL>
****
**** copyright <NAME> 2012-2025
****
**** MPI Exercise for Isend/Irecv, sending an array
****
****************... | ALGO | 0.99989 | 4.613328 | {
"github_metadata": {
"branch": "main",
"commit_count": 414,
"repo_created_at": "2025-01-30T15:36:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1474020d640... |
a17205ae-8d71-4560-9bd4-286901ea3d91 | JartiX/Project-Array | main.cpp | // Пользователь вводит:
// • N – кол-во элементов контейнера;
// • k – шаг выбывания элементов из контейнера.
// Элементы контейнера типа Array хранят последовательность целых чисел от 1 до N.
// Из контейнера последовательно удаляются элементы с шагом k, счет ведется с 1-го элемента.
// Когда в контейнере останется ... | ALGO | 0.99955 | 4.121311 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-02-20T07:49: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": "98b4d95c293... |
d9d28a83-2f49-4fde-90ac-abc163bbff0a | dreyus95/AVSP_SourceQualityPrediction | CodeJamCrawler/dataset/10_9644_76.cpp | # import math
def number_to_bitflag(num_bits):
x = 1
for i in range(num_bits - 1):
x = x * 2
return x
def is_power_of_two(number):
x = 1
i = 0
while x < number:
i = i + 1
x = x * 2
if x == number:
return [True,i]
return [False,i]
def main():
fname = 'A-large'
outfile = open(fname + '.out','w')
... | ALGO | 0.975322 | 4.51177 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2017-06-08T21:00:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d5802aa5... |
ff1ed59b-8bee-490d-b9df-0520f21928fc | gengar-maker/graph_theory | extremal_graph_theory/parser.cpp | #include "parser.hpp"
std::vector<size_t> getCoreNums(std::vector<std::pair<size_t, std::set<size_t> > >& inputAdjList);
Parser::Parser(std::string filename)
{
std::ifstream inputFile(filename);
if (inputFile.is_open())
{
size_t fileSize{ 0 };
std::string line;
std::getline(inputFi... | ALGO | 0.998283 | 4.53131 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2021-09-11T14:42: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": "fd8caaca9aa... |
58109dbb-9bc9-4b58-aa58-81d17dad43fe | kmjp/procon | gcj/gcj19/2_c.cpp | #include <bits/stdc++.h>
#include <sys/time.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<to;x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(... | ALGO | 0.999985 | 3.348938 | {
"github_metadata": {
"branch": "master",
"commit_count": 3966,
"repo_created_at": "2015-02-15T11:25:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 2,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "8114e0... |
b18b7251-0067-4578-8ace-2028e2d1705b | Gaelhawks-Team-230/FRC-team230-2015 | TrajectoryPlanner.cpp | /*
* TrajectoryPlanner.cpp
*
* Created on: Jan 18, 2015
* Author: <NAME>
*/
#include "WPILib.h"
#include "TalonXVI.h"
#include "TrajectoryPlanner.h"
#ifndef CALIBRATION
TrajectoryPlanner::TrajectoryPlanner(void)
{
a = 0.0;
v = 0.0;
p = 0.0;
pCmd = 0.0;
SetZeta(TEST_ZETA); //should not be changed later... | ALGO | 0.962485 | 5.31888 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-02-12T23:25:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0026011d911dd... |
137487c6-0d66-4c16-ba28-c7ca858b3cd0 | imulan/procon | aoj/vol26/2673.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pa... | ALGO | 0.999129 | 3.937172 | {
"github_metadata": {
"branch": "master",
"commit_count": 2571,
"repo_created_at": "2015-11-25T03:18:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 27,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e9259... |
5eb1b3dd-e8e9-47b2-8e64-e478f4a2af74 | Xohail69/Leetcode | Maximum Product Subarray - GFG/maximum-product-subarray.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
// Function to find maximum product subarray
long long maxProduct(vector<int> a , int n) {
// code
long long ans , mini , maxi ;
ans = mini = maxi ... | ALGO | 0.999879 | 6.110224 | {
"github_metadata": {
"branch": "main",
"commit_count": 2799,
"repo_created_at": "2021-12-24T13:17:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af1a1c3cd... |
fc3a8edb-51f1-4c50-937d-ac4b6a226922 | atenpas/gpd | include/gpd/candidate/hand_set.h | /*
* Software License Agreement (BSD License)
*
* Copyright (c) 2018, <NAME>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the... | ALGO | 0.989446 | 7.152677 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2017-05-23T01:06:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 695,
"forks": 244,
"issues": 57,
"pull_requests": 5
},
"file_meta": {
"content_id": "ac38... |
1010e8a2-2582-41ee-bea6-402bb8878bbe | ishandutta2007/codeforces-d | dzy97/normal/516/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> PI;
#define MP make_pair
#define N 200010
int d[N], h[N], n, Q;
ll s[N], bin[N];
struct Segtree{
struct segnode{
ll v1, v2;
int id;
}t[N << 2];
#define ls (x << 1)
#define rs (x << 1 | 1)
void upd(int x){
if(t[ls].v1 ... | ALGO | 0.999955 | 3.514679 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4265affe16ab... |
fc1206e9-60b9-480a-9b0e-a007ed303184 | oomph-lib/oomph-lib | demo_drivers/young_laplace/young_laplace.cc | //LIC// ====================================================================
//LIC// This file forms part of oomph-lib, the object-oriented,
//LIC// multi-physics finite-element library, available
//LIC// at http://www.oomph-lib.org.
//LIC//
//LIC// Copyright (C) 2006-2024 <NAME> and <NAME>
//LIC//
//LIC// This lib... | ALGO | 0.998798 | 5.052058 | {
"github_metadata": {
"branch": "main",
"commit_count": 1885,
"repo_created_at": "2021-03-29T15:44:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 46,
"forks": 28,
"issues": 11,
"pull_requests": 4
},
"file_meta": {
"content_id": "2676f4a... |
e5bee414-69db-452e-994d-ab43df3c0bdf | shaygeko/competitive_programming | codeforces/edu_r_122/d.cpp | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef long long ll;
const int maxn = 1e5;
const int INF = 1e9;
int n;
vi b,c;
int k;
int main(){
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int t;
cin >> t;
vi num_op(1e3+1);
nu... | ALGO | 0.999989 | 3.723768 | {
"github_metadata": {
"branch": "main",
"commit_count": 116,
"repo_created_at": "2022-01-25T04:43: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": "4bdfc930f1... |
fc3f5bd3-aeca-4928-8637-20346e2a6590 | ishandutta2007/codeforces-nonalphabetic | 4fecta/normal/1217/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int, int>
#define f first
#define s second
#define readl(_s) getline(cin, (_s));
#define boost() cin.tie(0); cin.sync_with_stdio(0)
int s, i, e;
int main() {
boost();
int q;
cin >> q;
for (; q > 0; q--) {
c... | ALGO | 0.999236 | 3.722892 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:49:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb399a1424f2... |
a28fff16-c773-4c9b-9573-25440defaa1b | jorgeUCM/FAL | Problema 23/Problema 23/Problema 23/Source.cpp |
#include <iostream>
#include <fstream>
// propios o los de las estructuras de datos de clase
// función que resuelve el problema
// comentario sobre el coste, O(f(N)), donde N es ...
int resolver(long long int num){
if (num < 10) {
return 1;
}
else {
num = num / 10;
... | ALGO | 0.999781 | 4.126234 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2021-03-01T09:51: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": "59a5de2640d... |
90aee3b2-23a3-4693-ad1f-b0a08a6a4298 | black-shadows/Cracking-the-Coding-Interview | Solutions/Chapter 19 Moderate/19.5.cpp | /*
* Q 19.5 The Game of Master is played as below:
* The computer has dour slots containing balls that are red(R),yellow(Y),green(G)or blue(B).
* For example:the computer might have RGGB(e.g.,Slot#1 is red,Slot#2 and Slot#3 are green,Slot#4 is blue).
* You,the user,are trying to guess the solution.You might,for exa... | ALGO | 0.999863 | 4.844929 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2018-10-12T17:47:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 780,
"forks": 250,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be5aa... |
614a53cc-58b1-48ce-a881-9221c1407b95 | sandialabs/GenTen | src/Genten_GCP_ValueKernels_Def.hpp | //@HEADER
// ************************************************************************
// Genten: Software for Generalized Tensor Decompositions
// by Sandia National Laboratories
//
// Sandia National Laboratories is a multimission laboratory managed
// and operated by National Technology and Engineering Soluti... | ALGO | 0.999733 | 6.465142 | {
"github_metadata": {
"branch": "master",
"commit_count": 1661,
"repo_created_at": "2023-06-13T18:01:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "db8c4f6d... |
070a76cc-4a81-45f5-aaa7-fb1c952618e3 | Pronomuos/Algorithms_and_DS_ITMO | lab9/task_D.cpp | #include <iostream>
#include <fstream>
#include <vector>
using namespace std;
void dfs1 (int v, vector<bool> &used, vector<int> &order, vector<vector<int>> &g) {
used[v] = true;
for (int el : g[v])
if (!used[el])
dfs1 (el, used, order, g);
order.push_back (v);
}
void dfs2 (int ... | ALGO | 0.999939 | 4.517447 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2020-09-09T21:57: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": "9b21fa991... |
7dab5441-0a2a-41e5-b3ea-7f87d05045d4 | ishandutta2007/codeforces-i | ilovevoi/normal/1646/D.cpp | /*#pragma GCC optimize("Ofast")
#pragma GCC optimization("unroll-loops, no-stack-protector")
#pragma GCC target("avx,avx2,fma")*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define ff first
#define ss second
#define pb push_back
#define endl "\n"
#define F(i,a,b) for(ll... | ALGO | 0.999716 | 4.182622 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39: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": "8271dc0feae2... |
6e10c07e-3f14-48ab-b463-4680551813fd | bvquoc/CP-Trainning-2021 | 0 - Contest 2020/VNOI Online 2021/z-Contestants/LD-11 Dinh Cao Minh Quan/SOCKS.cpp | #include <bits/stdc++.h>
/// kitsune
using namespace std;
#define int long long
#define fi first
#define se second
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define yn(x) ((x) ? "YES" : "NO")
typedef pair <int, int> ii;
typedef pair <int, ii> iii;
typedef array <int, 3> ar3;
template <typen... | ALGO | 0.999681 | 4.0144 | {
"github_metadata": {
"branch": "master",
"commit_count": 611,
"repo_created_at": "2020-06-03T07:47:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "082b217f... |
ad710682-2bb8-48f8-b484-ddaf11633a6d | ishandutta2007/codeforces-i | igorfardoc/normal/1379/A.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
const string t = "abacaba";
int get_am(string s) {
int am = 0;
for(int i = 0; i < (int)s.size() + 1 - t.size(); i++) {
bool ok = true;
for(int j = 0; j < t.size(); j++) {
... | ALGO | 0.999991 | 3.753606 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39: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": "838b05e778e4... |
cfdcc86d-6e69-4f90-bd0c-28dfdea06a32 | taehyungz/Algorithm | acmicpc.net/04963.cpp | #include <iostream>
#include <cstdio>
#include <utility>
using namespace std;
bool check[50][50];
int map[50][50];
int w, h;
int land;
pair<int, int> pos[8];
void DFS(int &i, int &j, int level) {
if (level == 1) land++;//처음에만 땅의 개수를 증가시킴(이후의 재귀함수는 같은 땅이다)
check[i][j] = true;
for (int k = 0; k < 8; k++) {
int y = ... | ALGO | 0.999798 | 3.844507 | {
"github_metadata": {
"branch": "master",
"commit_count": 128,
"repo_created_at": "2021-05-11T18:03: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": "30307d8c... |
92be72cf-980d-4054-9362-f359d032032a | 8fm/openw3 | dev/external/PhysX3/Source/PhysXCooking/src/hulllib.h | // This code contains NVIDIA Confidential Information and is disclosed to you
// under a form of NVIDIA software license agreement provided separately to you.
//
// Notice
// NVIDIA Corporation and its licensors retain all intellectual property and
// proprietary rights in and to this software and related documentation... | ALGO | 0.97004 | 7.011693 | {
"github_metadata": {
"branch": "main",
"commit_count": 159,
"repo_created_at": "2024-08-04T03:03: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": "9b6c6e0428... |
12e6fc33-d8e3-46c9-864d-061ca4c69545 | Wikingen/Ottos-First-Repo | Assignments/Homework/hmwk4/Q3.cpp | #include <iostream>
using namespace std;
char encryptUpper(char letter, int shift_value);
int main()
{
char letter = 'X';
int shift_value = -1;
cout << "Enter an uppercase letter to encrypt:" << endl;
cin >> letter;
cout << "Enter the encryption value: " << endl;
cin >> shift_value;
ch... | ALGO | 0.995306 | 4.490762 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-06-06T20:28: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": "8f486cf68b... |
d237fc83-b503-42b6-b129-075edc1d5576 | KrishnoMD305/Codeforces | 1791 C. Prepend and Append/Solution.cpp | // 309760152 10 Mar,2025, 07:48 PM Krishno_MD 46 ms 0 KB
/* As the final string can be made either adding 0 to start and 1 to end or 1 to start and 0 to end.
So, we can check by two pointe... | ALGO | 0.999834 | 4.849319 | {
"github_metadata": {
"branch": "main",
"commit_count": 208,
"repo_created_at": "2025-01-21T12:41:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19d8fb7327... |
cb846d08-c787-47a7-8d4c-2133451352c6 | JepsonWong/Algorithm | Array/suffix_array.cpp | /*
用数组来记录前缀和
https://blog.csdn.net/bobo1356/article/details/71105934
*/
#include <iostream>
using namespace std;
/*
N个数,要求从中选择若干个连续的数(注意每个数最多只能选一次)加起来,问能形成的最大的和。
*/
/*
int main() {
int a[100];
int sum[100] = {0};
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
if (i == 0)
sum[i] = a[i];
els... | ALGO | 0.999985 | 3.658474 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-04-17T17:57: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": "3230ce5f56... |
7f613cf6-999c-4729-a309-5d3dfa4cd67f | ishandutta2007/codeforces-t | teapotd/normal/461/E.cpp | #define _USE_MATH_DEFINES////////////////////////////////////////
#include<bits/stdc++.h>//////////////////////////////////////////
#define deb(...)/////////////////////////////////////////////////
#define DBP(...)/////////////////////////////////////////////////
#ifdef LOC//////////////////////////////////////////////... | ALGO | 0.999979 | 4.197525 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:27:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4eee4f0c64b2... |
1bce24a7-a2ad-4302-9270-d861432a2c8e | Timors123/C- | PersonLink.cpp | #include "head.h"
// 一个单链表
// 指针判空
int PointIsNULL(void* p) {
// 指针为空,停止操作
if (!p)
return 1;
return 0;
};
typedef struct Person
{
char name[10];
int age;
struct Person* next;
} Person;
// 创建节点
Person* create(Person p) {
Person* pnew = (Person*)malloc(sizeof(Person));
if (!pne... | ALGO | 0.998758 | 4.106283 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2024-01-15T08:58: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": "37a412a9c0d... |
dde6c941-4570-40e4-b441-35be9d880704 | HighonPi/Socket-programming-project | client-phase4.cpp | #include<bits/stdc++.h>
#include<dirent.h>
#include<netdb.h>
#include<arpa/inet.h>
#include <errno.h>
#include<netinet/in.h>
#include<unistd.h>
#include <sys/wait.h>
#include <signal.h>
#include<thread>
#include<algorithm> // lexicographical_compare
// #include<openssl/md5.h>
using namespace std;
//-------------------... | ALGO | 0.981838 | 3.455002 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-07-20T13:15: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": "2f965ac8b3... |
ecbcc2aa-fa9f-41df-b77f-656c075599d1 | bsdroid/ntrip | BNS/timeutils.cpp | /* -----------------------------------------------------------------------------
*
* Function : djul
*
* Purpose : computes the modified julian date (mjd) from
* year, month and day
*
* Author : <NAME>
*
* Created : 13-OCT-2001
*
* Changes :
*
* ---------------------------... | ALGO | 0.999128 | 6.58359 | {
"github_metadata": {
"branch": "master",
"commit_count": 8512,
"repo_created_at": "2018-10-30T03:08:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2851c2... |
2824c056-e0ab-4d71-a3d1-88f1870776a6 | google/earthenterprise | earth_enterprise/src/fusion/rasterfuse/vipm/procmesh.h | /*
* Copyright 2017 Google Inc.
*
* 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... | ALGO | 0.983042 | 5.837481 | {
"github_metadata": {
"branch": "master",
"commit_count": 1779,
"repo_created_at": "2017-03-20T21:40:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2699,
"forks": 891,
"issues": 252,
"pull_requests": 0
},
"file_meta": {
"content_id": "c... |
7a137b37-a3c4-47f0-9771-af18b00fe28a | sunpenta/LEETCODE | two_pointers/2.2fourSum.cpp | // 四数之和-双指针 l-18
// -1e9<=nums[i]<=1e9; -1e9<=target<=1e9
#include <bits/stdc++.h>
using namespace std;
vector<vector<int>>fourSum(vector<int>&nums,int traget);
int main()
{
vector<int> nums = {1,0,-1,0,-2,2};int target = 0; // 输入
vector<vector<int>>ans=fourSum(nums,target); // 输出:{{1,0,-1,0},{0,0,-2,2},{1,-1... | ALGO | 0.999986 | 5.014327 | {
"github_metadata": {
"branch": "main",
"commit_count": 1197,
"repo_created_at": "2023-12-20T14:23: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": "2ad89faca... |
e70f0c8d-b79a-4801-8f8b-a7c2c44dfe39 | mdakram2002/DSA | BinarySearch/searchNumber.cpp | #include <iostream>
#include <vector>
using namespace std;
//logic-->
int search(vector<int> &nums, int target)
{
int start = 0;
int end = nums.size() - 1;
while (start <= end)
{
int mid = start + (end - start) / 2;
int m = nums[mid];
if (m == target)
{
r... | ALGO | 0.9999 | 4.806315 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2024-02-27T17:36: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": "b5d0f49e0c... |
bfa4d8ec-23a4-4d80-8e61-fe2b34f00e95 | sakibchonka/my-leetcode-journey | BinarySearch/median_of_two_sorted_arrays.cpp | // Median of Two Sorted Arrays
// link: https://leetcode.com/problems/median-of-two-sorted-arrays/description/
func findMedianSortedArrays(_ nums1: [Int], _ nums2: [Int]) -> Double {
var A = nums1
var B = nums2
if B.count < A.count {
return findMedianSortedArrays(nums2, nums1)
}
let m = A.... | ALGO | 0.999914 | 6.02301 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-01-04T23:50: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": "93dff4bcf6d... |
43878aee-9c27-4ab6-baba-3170cdc36370 | gertyboy1200/CSCI_130_Garrett_Kolenbrander | homework/hw9/bronson_10.cpp | #include <iostream>
#include <iomanip>
using namespace std;
void print_matrix (int grades[][8], int number_of_rows, int number_of_coloums) {
for (int i = 0; i < number_of_rows; i++){
for (int j = 0; j < number_of_coloums; j++){
cout << grades[i][j] << fixed << setw(21);
}
cout <... | ALGO | 0.994639 | 4.532227 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2022-09-01T20:17: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": "ebe50fc6626... |
33255cd8-d28a-4dba-b7e2-1f680ef8988c | PyORBIT-Collaboration/py-orbit | src/spacecharge/LSpaceChargeCalc.cc | /////////////////////////////////////////////////////////////////////////////
//
// FILE NAME
// LSpaceCharge.cc
//
// 05/30/12
//
// DESCRIPTION
// Calculate the effects of longitudinal space charge and impedance
// on the bunch (1D) using impedance formulation
//
//////////////////////////////////////////////... | ALGO | 0.998615 | 6.012047 | {
"github_metadata": {
"branch": "master",
"commit_count": 1008,
"repo_created_at": "2016-12-07T21:31:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 29,
"forks": 39,
"issues": 7,
"pull_requests": 1
},
"file_meta": {
"content_id": "0fd02c... |
02a76d92-9d40-4735-aa6d-a54fb27e1426 | Cube219/PS | BOJ/8000~9000/8111 - 0과 1.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#define _CRT_DECLARE_NONSTDC_NAMES 0 // for using y1 as variable name
#include <iostream>
#include <cstdio>
#include <utility>
#include <algorithm>
#include <queue>
#include <vector>
using namespace std;
using ll = long long int;
constexpr int INF = 0x3f3f3f3f;
constexpr ll LNF = 0x3... | ALGO | 0.999945 | 4.515236 | {
"github_metadata": {
"branch": "main",
"commit_count": 1172,
"repo_created_at": "2021-01-20T03:42: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": "712fdf8d5... |
44b851ad-6913-41d5-9693-4cff9b1f4361 | lychanl/OpinionANN | src/NeuralNetwork.cpp | #include "../include/NeuralNetwork.h"
#include <algorithm>
#include <thread>
NeuralNetwork::NeuralNetwork(InputLayer* inputLayer, std::vector<int> neuronsOnMiddleLayers) {
layers.push_back(inputLayer);
for (int i = 0; i < neuronsOnMiddleLayers.size(); i++)
layers.push_back(new MiddleLayer(neuronsOnMiddleLayers[i]... | ALGO | 0.985412 | 4.529688 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2017-11-06T19:19:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "34d0e05fc... |
b0076537-ff0b-4c9f-9c42-c0afc7c1bf0b | JstMonika/Code | Codeforces/#669/pD.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<typename T> using vec = vector<T>;
template<typename T> using Prior = priority_queue<T>;
template<typename T> using prior = priority_queue<T, vector<T>, greater<T>>... | ALGO | 0.999953 | 3.611342 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2020-09-17T06:26: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": "9f674c6ea... |
a22e4abd-5e27-4beb-ad2e-06ec4d514dce | aplqo/exercises | luogu/02-Universal-/P1177-Quicksort.cpp | #include <iostream>
#include <utility>
using namespace std;
const int maxn = 100000;
typedef unsigned int num;
num a[maxn];
void QuickSort(int l, int r)
{
int i = l, j = r;
num m = a[(l + r) >> 1]; // Prevent from being swapped
do {
while (a[i] < m)
i++;
while (a[j] > m)
j--;
if (i <= j... | ALGO | 0.999972 | 4.24185 | {
"github_metadata": {
"branch": "master",
"commit_count": 654,
"repo_created_at": "2019-10-26T11:25: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": "10b908e1... |
51e8a50a-cf85-4bef-bf4f-c866c500d750 | maartenJacobs/Mondriaan | include/Piet.h | #ifndef PIET_H
#define PIET_H
#include <array>
#include <cassert>
#include <cstdio>
#include <exception>
#include <llvm/IR/Function.h>
#include <llvm/IR/IRBuilder.h>
#include <llvm/IR/Module.h>
#include <png.h>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
namespace Piet {
enum Di... | TOOL | 0.926254 | 6.839652 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2018-09-01T20:44: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": "910102974... |
089a6523-7714-47e2-9bf3-9756a5402ac4 | bonny2012/C | BinaryHeap_p.cpp | //BinaryHeap Example
//无法在建时直接加入n 个条木
#include<vector>
#include<iostream>
#include<string>
using namespace std;
class UnderflowException
{
};
template <typename Comparable>
class BinaryHeap
{
public:
explicit BinaryHeap(int capacity=100):array(capacity+1),currentSize(0)
{
}
explicit BinaryHeap(cons... | ALGO | 0.999198 | 3.575772 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-03-01T20:18: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": "423d590cb7... |
d965359e-d122-4d57-b733-0fd549ad89ac | ishandutta2007/codeforces-k | kostia244/normal/1129/D.cpp | // Problem: D. Isolation
// Contest: Codeforces - Codeforces Round #542 [<NAME> Thanks-Round] (Div. 1)
// URL: https://codeforces.com/contest/1129/problem/D
// Memory Limit: 256 MB
// Time Limit: 3000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("a... | ALGO | 0.999906 | 5.385695 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06: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": "838110843529... |
c8a12a22-db0e-4c31-9817-1d88c3e63026 | roj4s/hackerank_solutions | print_reverse.cpp | #include <bits/stdc++.h>
using namespace std;
class SinglyLinkedListNode {
public:
int data;
SinglyLinkedListNode *next;
SinglyLinkedListNode(int node_data) {
this->data = node_data;
this->next = nullptr;
}
};
class SinglyLinkedList {
public:
S... | ALGO | 0.999652 | 5.539861 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-07-13T18:24: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": "e250cf307... |
8f6ca2c9-adc6-4be3-945a-3d0a2e143309 | ejunjsh/bustub | src/execution/topn_executor.cpp | #include "execution/executors/topn_executor.h"
namespace bustub {
TopNExecutor::TopNExecutor(ExecutorContext *exec_ctx, const TopNPlanNode *plan,
std::unique_ptr<AbstractExecutor> &&child_executor)
: AbstractExecutor(exec_ctx), plan_{plan}, child_{std::move(child_executor)} {}
void Top... | ALGO | 0.992526 | 6.825598 | {
"github_metadata": {
"branch": "master",
"commit_count": 316,
"repo_created_at": "2022-12-21T15:57:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 240,
"forks": 44,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "89564... |
f2162185-4d55-475d-9826-70fcc679be1d | Mahdi0203/Keep-it-Beautiful_Codeforces_1841B | B. Keep it Beautiful.cpp | #include<bits/stdc++.h>
using namespace std;
#define Start ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
void solve()
{
ll q;
cin>>q;
vector<ll> v(q);
for(ll i=0; i<q; i++) cin>>v[i];
vector<ll> vres;
ll inc_min = v[0], inc_max = 0, dec_min = -1;
ll cnt = 0;
... | ALGO | 0.999978 | 3.692013 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-06-24T16:12: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": "3e178c6ca5f0... |
b98aedd4-d87a-46d1-95c8-47a4abbe09d8 | geekygirl8/Hacktoberfest_2022_DSA | C++/C++/course-schedule-ii.cpp | // Time: O(|V| + |E|)
// Space: O(|E|)
// dfs solution
class Solution {
public:
vector<int> findOrder(int numCourses, vector<vector<int>>& prerequisites) {
unordered_map<int, unordered_set<int>> in_degree, out_degree;
for (const auto& p : prerequisites) {
in_degree[p[0]].emplace(p[1]);... | ALGO | 0.999977 | 6.787817 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2022-10-01T04:19:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 63,
"issues": 2,
"pull_requests": 40
},
"file_meta": {
"content_id": "328568ee... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.