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 |
|---|---|---|---|---|---|---|---|
48bec48f-51e9-40ab-8874-15118bddaa59 | leeeyupeng/leeeyupeng.github.io | project/algorithm/hdu/src/4408.Minimum Spanning Tree_3.cpp | #include"hdu.h"
class Solution{
private:
vector<int> us;
int find(int index){
if(us[index] != index){
us[index] = find(us[index]);
}
return us[index];
}
int n,m,q;
int minmst;
long long ans;
vector<char> visit;
public:
struct Edge
{
int ... | ALGO | 0.999817 | 3.778218 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-02-12T02:05:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ac970a1a3... |
1fe457a8-7665-4a80-afb6-fb57426bf678 | sinewc/profun | transpose/transpose/Source.cpp | #include <stdio.h>
#define ROWS 5
#define COLS 5
void inputMatrix(int(*mat)[COLS]);
void Matrix(int(*mat)[COLS]);
void printMatrixtranspose(int(*mat)[COLS]);
int main()
{
int mat[ROWS][COLS];
inputMatrix(mat);
Matrix(mat);
printMatrixtranspose(mat);
return 0;
}
void inputMatrix(int(*mat)[COLS])
{... | ALGO | 0.999649 | 4.940071 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2020-08-23T00:49: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": "77fe90e25... |
f9f2f1f1-e96e-4ad3-8ced-118faf8fff70 | chw333/algorithm | cd2/정보올림피아드관련/정보올림피아드관련/봄캠프/2월23일 KOI모의고사/SOURCE/TREASURE.CPP | #include <fstream.h>
#include <math.h>
const int Maxn = 100;
const char Infilename[30] = "treasure.inp";
const char Outfilename[30] = "treasure.out";
int n, m;
int data[Maxn];
int back[Maxn + 1][Maxn + 1];
long table[Maxn + 1][Maxn + 1];
long min[Maxn + 1][Maxn + 1];
long max[Maxn + 1][Maxn + 1];
int input();
int tr... | ALGO | 0.999995 | 3.166545 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2016-10-31T08:05:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "64b9ca4450... |
55df0dd3-5bb9-4fd3-8a86-b274a361b93f | ishandutta2007/codeforces-a | andr1y/normal/1552/F.cpp | //ulala
//code by 255
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define pll pair<ll, ll>
#define x first
#define y second
using namespace std;
typedef long long ll;
typedef __gnu_pbds::tree<ll, __gnu_pbds::null_type, less<ll>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_updat... | ALGO | 0.999943 | 5.089417 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d7d9cdc5e52... |
7c6b9ab4-23e0-4085-9070-3a452b55f931 | cseshamim47/station | CPP/2020-2023/Old CPP/A_Hulk.cpp | // 1 I hate it
// 2 I hate that I love it
// 3 I hate that I love that I hate it
// 4 I hate that I love that I hate that I love it
//Author : <NAME> (20-44242-3) American International University Bangladesh
#include <bits/stdc++.h>
using namespace std;
#define eps 1e-12
#define MAX 10000005
#define ll long long
... | ALGO | 0.999989 | 3.390739 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2021-02-12T19:05:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b4286795... |
487bf5c9-4869-4847-af4a-62a0429e81f5 | ASHIJANKEN/CodingTest | AtCoder/ABC 042/masume.cpp | #include<iostream>
using namespace std;
long fact(long num)
{
long ret = 1;
for (int i = 1; i <= num; ++i) {
ret *= i;
}
return ret;
// if (num == 0) return 1;
// return num * fact(num - 1);
}
int main()
{
// Input numbers
long h, w, a, b;
cin >> h >> w >> a >> b;
lo... | ALGO | 0.999627 | 4.230464 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2018-04-10T17:36: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": "6be2827c1... |
c9972320-2735-4c8c-ab79-259b55cc9146 | Manaswini1832/bits_and_pieces | recur-dp.cpp | /******************************************************************************
Print all permutations of a string
*******************************************************************************/
#include <iostream>
#include <string>
#include <vector>
#include <unordered_set>
using namespace std;
vector<int> construc... | ALGO | 0.996009 | 4.364779 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-11-26T09:26: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": "36571dd03542... |
0923603f-914e-419b-aa58-7980be79bc5c | tsnest/xray-2-2011 | sources/xray/math_utils.h | ////////////////////////////////////////////////////////////////////////////
// Created : 22.05.2009
// Author : <NAME>
// Copyright (C) GSC Game World - 2009
////////////////////////////////////////////////////////////////////////////
#ifndef MATH_UTILS_H_INCLUDED
#define MATH_UTILS_H_INCLUDED
namespace xray {
nam... | ALGO | 0.984699 | 5.104562 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-06-02T17:30:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 26,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8dfb5f7ff4... |
fb67f105-cb20-4d69-98a2-51db19d79566 | ankursinha03/Competitive_Programming | algos/GRAPH/practice.cpp | #include <bits/stdc++.h>
using namespace std;
void dfs(int node, int &person, int &noise, vector<int> adj[], vector<int> &quiet)
{
if (quiet[node] < noise)
{
person = node;
noise = quiet[node];
}
for (int n : adj[node])
{
dfs(n, person, noise, adj, quiet);
}
}
vector<in... | ALGO | 0.999991 | 4.862181 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-07-31T19:11:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f98a32d03e83... |
7748be80-363f-4570-88fb-9d5dc60fa100 | DSwithSiam/Coding | HackerRank/Adventure.cpp | #include<bits/stdc++.h>
#define pi pair<int, int>
using namespace std;
const int N = 1e3+5;
int dp[N][N];
int knapsack(int n, int s, int w[], int v[])
{
if(n == 0 || s == 0)
{
return 0;
}
if(dp[n][s] != -1)
{
return dp[n][s];
}
if(w[n-1] <= s)
{
int op1 = knapsac... | ALGO | 0.999988 | 4.014615 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2023-03-31T19:17:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "95e816db8bf... |
101d9e56-4eda-4c08-afdc-8cb0000d7ce3 | changmu/StructureAndAlgorithm | POJ/3249/13337716_AC_1891MS_10440K.cpp | //not mine
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
using namespace std;
#define maxn 100005
#define maxm 1000005
struct Edge
{
int v, next;
}edge[maxm];
int n, m;
int value[maxn];
int in[maxn], out[maxn];
int head[maxn], ecount;
long long f[maxn];
bool vis[maxn];
void addedge... | ALGO | 0.99997 | 3.537765 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2015-02-08T13:48: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": "f1ae488f0... |
ab8ab442-0b58-4b34-b19f-ba79c2897c53 | chitrang6/BitHack | bit_manipulation.cpp | /*
Author: <NAME>
LinedIn: www.linkedin.com/in/chitrangtalaviya
This file contains important bit manipulation problems in C++
*/
#include <iostream>
#include <bitset>
#include <math.h>
#include <stdio.h>
using namespace std;
// Turn off kth bit in a number
int TurnoffKthBit(int num, int pos)
{
return (num & ... | ALGO | 0.944828 | 3.682407 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-04-22T22:32:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "efa8d3b0b0... |
7ae8d5a5-6fd0-4312-9cd6-9fe4efc89455 | mr-nv/deviantleak | deviant hak/features/movement.cpp | #include "movement.h"
#include "../common.h"
#include "../main.h"
#include "../interfaces.h"
#include "../math/math.h"
#include "lagcomp.h"
void movement::bunnyhop(c_usercmd * cmd)
{
if (!deviant.localplayer || !cmd)
return;
if (!(deviant.localplayer->flags() & FL_ONGROUND) && cmd->buttons & IN_JUMP && g_cfg["misc... | ALGO | 0.919028 | 4.849011 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-05-31T23:17:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74fa962cf2... |
6a534771-66db-429c-9b4c-ad631b151f30 | clatisus/ACM-ICPC-Team-Archive | training/2015-2016_Petrozavodsk_Winter_Training_Camp,_Nizhny_Novgorod_SU_Contest/H_false.cpp | #include <bits/stdc++.h>
#define MAXN (100010)
int n;
int f[MAXN];
void splay(int x, int fa) {
if (f[x] == 0) {
f[x] = fa;
return;
}
splay(f[x], x);
f[x] = fa;
}
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; ++i) f[i] = 0;
while (true) {
static char opt[4]... | ALGO | 0.999954 | 4.479019 | {
"github_metadata": {
"branch": "master",
"commit_count": 577,
"repo_created_at": "2018-06-11T16:19:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "831f4aad... |
663ae676-87d3-4ab0-9b97-0edb045f1b6e | loguntsov/kans | Расчет пластмассовых труб/Unit1.cpp | //---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
#include "mathdll.h"
#include <math.hpp>
#include <math.h>
#include <iostream.h>
#include <conio.h>
#pragma argsused
/*
int _e... | ALGO | 0.999859 | 3.261307 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2012-08-22T08:47: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": "bb06a17de9... |
77381b69-a770-47cb-a5e6-861f77fae34c | Otrebus/timus | 1990.cpp | /* 1990. Podracing - http://acm.timus.ru/problem.aspx?num=1990
*
* Strategy:
* Order all points - cameras and vertices - by their y coordinate and iterate over them; for every
* row of points sharing the same y coordinate, we find the widest space between any two adjacent
* points (and the horizontal distance to ... | ALGO | 0.999855 | 4.783177 | {
"github_metadata": {
"branch": "master",
"commit_count": 601,
"repo_created_at": "2015-07-08T14:22:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 83,
"forks": 28,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af4e4a... |
f2ccf2f3-ae99-4c73-aafc-c94374d8f2ca | marinadabova/DataStructures | hw3/favouriteNumber.cpp | #include <bits/stdc++.h>
using namespace std;
long ternarySearch(long x, long left, long right,long depth) {
if (right < left) {
return 0;
}
long mid1 = (2 * left + right + 1) / 3;
long mid2 = (left + 2 * right + 1) / 3;
if (mid1 > x) {
return ternarySearch(x, left, mid1 - 1, depth + 1);
}
if (mid2 < x) ... | ALGO | 0.999946 | 4.017733 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2022-08-09T08:16:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "59174413d0a... |
32fa4231-3e6e-42b5-a737-0fd7388409d4 | zebra314/ProgramLearn | cpe/one_star/unordered_map_test.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
vector<int> num = {1,2,5,4,3,6,5,7,9};
unordered_map<int, int> ans; // key: the value in num // value: the position of the value in num
int target = 10;
// for(int i = 0; i<num.size(); i++){
// ans[num[i]] = i;
// }
for(int j = 0... | ALGO | 0.999691 | 3.462195 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2022-02-09T09:06: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": "d988c1ae5... |
f0494ad9-dd7a-4833-8540-8b753dfad2a3 | an0520a/boj | BOJ_2342.cpp | #include <cstdio>
#include <algorithm>
#include <vector>
#include <malloc.h>
#include <memory.h>
typedef unsigned int u32;
using namespace std;
int main()
{
u32 energy[5][5] = { {0, 2, 2, 2, 2}, { 0, 1, 3, 4, 3 }, { 0, 3, 1, 3, 4 }, { 0, 4, 3, 1, 3 }, { 0, 3, 4, 3, 1 } };
vector<u32> vec;
u32 tmp = 0... | ALGO | 0.999968 | 3.490639 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2022-08-20T13:53: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": "313a043d2... |
df4383cc-ee91-47e3-9893-baeaa237f1cd | KrAbhas/green-code | codeforces/1629/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) (x).begin(), (x).end()
#define intl int64_t
#define pb(x) push_back(x)
#define unmap unordered_map
#define unset unordered_set
template<class T> bool asnmx (T& a, const T& b){return a < b? a = b, 1: 0;}
template<class T> bool asnmn (T& ... | ALGO | 0.999957 | 3.847722 | {
"github_metadata": {
"branch": "master",
"commit_count": 505,
"repo_created_at": "2021-07-23T09:57: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": "c2538e53... |
d845ec23-8085-400a-8d96-b3a5f5796c82 | egkrisz/aoc22 | day10/main.cpp | #include <algorithm>
#include <sstream>
#include <vector>
#include "../common/common.h"
// It is better to store instructions represented as their effect to register X in every cycle.
// This means noop is stored as a single 0 and addx is two instructions; a noop and the change to regX.
using instruction_t = int32_t;... | ALGO | 0.999551 | 6.620085 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2022-12-01T20:35:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e992bde92c4... |
efa9f99f-ab7c-4c7d-a533-f6c04d16e29c | miyajiro/competitive_programming | atcoder/abc152/e/e.cpp | #define TO_BE_SUBMITTED
#include <bits/stdc++.h>
// #include <atcoder/fenwicktree>
// #include <atcoder/segtree>
// #include <atcoder/lazysegtree>
// #include <atcoder/string>
// #include <atcoder/math>
// #include <atcoder/convolution>
#include <atcoder/modint>
// #include <atcoder/dsu>
// #include <atcoder/maxflow>
/... | ALGO | 0.999925 | 5.22236 | {
"github_metadata": {
"branch": "main",
"commit_count": 499,
"repo_created_at": "2020-06-20T09:19:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "c50f7aa5d5... |
1e895acb-9d74-410f-ab2e-c492bde56266 | pervejrony27/Codeforces-Solution | 1931B.cpp | //// Md.<NAME>
/// Department of CSE.
// BAIUST
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define cin1(x) cin >> x
#define cin2(x,y) cin >> x >> y
#define cin3(x, y, z) cin >> x >> y >> z
#define min3(a,b,c) min(a,min(b,c))
#define min4(a,b,c,d) min(d,min(a,min(b,c))
#define max3(a,b,c) ... | ALGO | 0.999836 | 4.540045 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2024-04-05T15:03: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": "f4e3f190aad... |
cf8624b2-7ac2-4210-bcd1-ba50dbd88da7 | JulioMelo-Classes/lista-2-rafasfz | partition/include/partition.h | #ifndef GRAAL_H
#define GRAAL_H
#include <utility>
using std::pair;
#include <iterator>
using std::distance;
#include <algorithm>
using std::sort;
#include <vector>
namespace graal {
/*!
*
* @tparam ForwardIt iterator para o range.
* @tparam UnaryPredicate o tipo de uma função bool(const T &a)
*
* @param first... | ALGO | 0.989704 | 5.913541 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2021-06-15T16:47:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8228bb55e19d... |
e715b57c-b45f-4ff7-b987-e97782998424 | smuraligit/self-test | source/listcountpair.cpp | /*
* listcountpair.cpp
*
* Created on: Apr 23, 2019
* Author: srinivasanmurali
*/
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
struct Node
{
int data;
struct Node* next;
};
void append(struct Node** headRef, int newData)
{
struct Node* new_node = (struct Node*) malloc(sizeof(struct N... | ALGO | 0.999948 | 4.934295 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-08-26T19:44: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": "7d6a25fa35... |
37e64ebf-7ed9-4343-8642-bdb1baf9772e | chat-code/leetcode-everyday | archive/202107/20210708_435/abel.cpp | // Date: Tue Nov 2 22:02:09 2021
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <utility>
#include <functional>
using namespace std;
cons... | ALGO | 0.999868 | 5.016827 | {
"github_metadata": {
"branch": "master",
"commit_count": 1880,
"repo_created_at": "2019-12-12T12:17:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e2f6f76... |
9ab10c76-bd9d-4c9f-8b24-3370f5e68af3 | TimDTTP/LearningCPP | leetcode/longestCommonPrefix/main.cpp |
#include <iostream>
#include <string>
#include <vector>
void printVector(std::vector<std::string> s) {
for (auto i : s) {
std::cout << i << '\n';
}
std::cout << '\n';
}
// comp loop
bool isLesser(std::string &a, std::string &b) {
return (a.length() < b.length());
}
// nested loop approach
class Solution... | ALGO | 0.999918 | 5.922605 | {
"github_metadata": {
"branch": "master",
"commit_count": 608,
"repo_created_at": "2023-04-07T01:50: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": "8f17336f... |
dbfa839b-553f-4cf7-a0b5-c9a8f463e5ca | xiez22/SJTU-OJ | Code/1214.cpp | #include "iostream"
#include "cstdio"
#include "cmath"
#include "cstring"
using namespace std;
template <class T>
class mQueue {
class node {
public:
T data;
node* next = nullptr;
};
node* head = nullptr,
* rear = nullptr;
size_t _size = 0;
public:
//构造函数
mQueue() {
head = new node;
rear = head;
}
... | ALGO | 0.999989 | 3.971165 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2019-01-14T12:10:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 30,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf386fb3... |
d2e4abf5-fae0-4f65-9022-d507faa2f4e0 | samkitsamsukha/Data-Structures-and-Algorithms | Stack/01_usingStruct.cpp | #include<bits/stdc++.h>
using namespace std;
struct Stack{
int top;
int* st;
Stack(int size){
top = -1;
st = new int[size];
}
void push(int x, int size){
if(top == size-1){
cout << "Stack Overflow" << endl;
return;
}
else{
... | ALGO | 0.980555 | 3.677811 | {
"github_metadata": {
"branch": "main",
"commit_count": 157,
"repo_created_at": "2024-01-19T14:58:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36b4f3c3df... |
816dda93-6d9c-48e6-8862-3b151a8819f4 | Chia-Network/chiavdf | src/gpu_integer_gcd.h | template<int size> struct fixed_gcd_res {
fixed_integer<uint64, size> gcd; //unsigned; final value of a
fixed_integer<uint64, size> gcd_2; //unsigned; final value of b. this is 0 for a normal gcd
fixed_integer<uint64, size> s; //signed
fixed_integer<uint64, size> t; //signed
fixed_integer<uint64, si... | ALGO | 0.999714 | 6.628163 | {
"github_metadata": {
"branch": "main",
"commit_count": 429,
"repo_created_at": "2020-03-10T19:34:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 61,
"forks": 70,
"issues": 1,
"pull_requests": 13
},
"file_meta": {
"content_id": "bbdb1411... |
c7d14649-4402-41a4-a8d0-642b3635dd6b | Nozdormuor/surface-mesh-generation | MeshWork/localh.cpp | #include"externalcommon.h"
#include"internalcommon.h"
namespace meshwork
{
GradingBox :: GradingBox (const double * ax1, const double * ax2)
{
h2 = 0.5 * (ax2[0] - ax1[0]);
for (int i = 0; i < 3; i++)
xmid[i] = 0.5 * (ax1[i] + ax2[i]);
for (int i = 0; i < 8; i++)
childs[i] = NULL;
father = NULL;
... | ALGO | 0.971801 | 4.285419 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-07-30T07:15:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dee51751a1... |
f6f38e79-1ca5-4b6b-96ed-946284c632cd | Osamitch/TicTac | main.cpp | #include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <limits>
#include <cmath>
#include <iostream>
void drawGameField(char*, const int&);
void gameloop(char*);
float insighttree(char*, char, char, bool, float, const int&, int);
bool checkinsightwin(char, char*,const int&);
int main()
{
char fieldmatr... | ALGO | 0.999572 | 5.224402 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2020-11-15T17:55:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dcdbdb00c973... |
939818d2-8857-457d-8a99-da37dd7787f9 | wenzhang-dev/leetcode | 130. 被围绕的区域.cc | /* bfs超时 */
class Solution {
public:
void solve(vector<vector<char>>& board)
{
int row = board.size();
if(row == 0) return ;
int col = board[0].size();
queue<pair<int, int>> que;
vector<pair<int, int>> vec;
vector<vector<bool>> isAccess;
bool isFilled = ... | ALGO | 0.999945 | 5.37558 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-12-20T03:27:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ef7caf01... |
cd6f4835-0869-42df-b57c-71205bec2585 | pranjal021/InterviewBit-solutions | LinkedList/Palindrome List.cpp | //problem : Palindrome List
void reverseList(ListNode* &head){
ListNode* curr=head;
ListNode* prev=NULL;
ListNode* n;
while(curr){
n=curr->next;
curr->next = prev;
prev=curr;
curr=n;
}
head=prev;
return;
}
bool compareList(ListNode* a,ListNode* b){
whil... | ALGO | 0.999937 | 5.387844 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2020-10-10T14:42:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5d03612f1b... |
19e0ff43-0855-40d3-86c7-e96576b7e820 | nachiketkarve/fputAGP | fputFixed/src/agp.cpp | #include "agp.hpp"
#include "standards.hpp"
// Calculate the Floquet matrix of a periodic state
double Floquet(Matrix &Floquet, const State &periodic, int seedMode, double deltaT, int iterations, double tmax, std::string integrator)
{
State x = periodic;
int N = periodic.N;
Matrix qTangent(N + 2, 2 * N);
... | ALGO | 0.999723 | 4.749657 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2025-03-11T20:03:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "99ce7ed9e0... |
467dc8e9-de73-4513-932d-14718f9f8ab5 | ishandutta2007/codeforces-u | unstoppablechillmachine/normal/466/E.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define SZ(x) (int)(x).size()
#define int ll
#define F first
#define S second
const int MOD = 1e9 + 7;
const int N = 1e5 + 10;
const int LOG = 18;
vector<int> g[N];
int up[N][LOG], mx[N][LOG],... | ALGO | 0.999971 | 4.253914 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:31: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": "59bebe796915... |
2d08a7af-2b4a-4ec7-9499-165d0c2c7fec | terzinodipaese/Codici-algoritmi | terne-counting.cpp | #include <iostream>
#include <fstream>
using namespace std;
ifstream in("input.txt");
ofstream out("output.txt");
class Terna
{
private:
float x, y, z;
public:
float getX() { return x; }
float getY() { return y; }
float getZ() { return z; }
void setX(float x) { this->x = x; }
void setY(float y) { this->y = y... | ALGO | 0.996869 | 3.635586 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-01-27T10:51:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5fb4f65ee... |
6e5e0794-2c28-42b7-80be-1d77b35cdd60 | zl90/cpp-education | src/grokking/sliding-window/max_sum_sub_array_of_size_k.cpp | using namespace std;
#include <iostream>
#include <vector>
class MaxSumSubArrayOfSizeK {
public:
static int findMaxSumSubArray(int k, const vector<int>& arr) {
int maxSum = 0, sum = 0, a = 0;
for (int b = 0; b < arr.size(); b++) {
sum += arr[b];
if (b > k - 1) {
sum -= arr[a];
a... | ALGO | 0.999586 | 6.357783 | {
"github_metadata": {
"branch": "main",
"commit_count": 335,
"repo_created_at": "2023-08-30T11:23: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": "03a9a92246... |
d898549b-22f0-4fb5-be9e-641ec0c80e47 | Fighohji/Competitive-Programming | Record/PassRecord/edu147/c.cpp | #include <map>
#include <set>
#include <array>
#include <cmath>
#include <queue>
#include <stack>
#include <tuple>
#include <cctype>
#include <cstdio>
#include <string>
#include <vector>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <functional>
#include <uno... | ALGO | 0.999717 | 4.078856 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-20T12:40: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": "39eb4e1db96e... |
460b9a48-ef23-4a59-b045-8d46987a145a | pappubishwas/GeeksForGeeks | october28_bleak_number.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
// int countSetBits(int x)
// {
// unsigned int count = 0;
// while (x) {
// x &= (x - 1);
// count++;
// }
// return count;
// }
// int ceilLog2(int x)
// {
// int c... | ALGO | 0.999684 | 5.058904 | {
"github_metadata": {
"branch": "master",
"commit_count": 148,
"repo_created_at": "2023-08-06T16:58:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19f2b123... |
1c957ae5-8afc-4912-a89c-922755b36341 | M-Ayushi/competitive-programming | codeforces/1758/C.cpp | #include <bits/stdc++.h>
#define ll long long
#define sz(x) (int)(x.size())
using namespace std;
vector<int> fact(int n, int k) {
vector<int> v;
v.push_back(k);
n = n/k;
while (n % 2 == 0) {
v.push_back(2);
n = n/2;
}
for (int i = 3; i <= n; i+=2) {
while (n % i == 0) {
v.push_back(i);
n = n/i;
}... | ALGO | 0.999953 | 4.148934 | {
"github_metadata": {
"branch": "main",
"commit_count": 568,
"repo_created_at": "2024-07-09T17:24: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": "12e9cfc05d... |
ead60b7d-135d-43f8-95f5-6f1aa7cc8ee1 | mahajanmayur06/DSA | Graph/Topological Sort/directedGraphCycle.cpp | #include <bits/stdc++.h>
using namespace std;
bool isCycle(vector<vector<int>>& adjList) {
int n = adjList.size();
vector<int> indegree (n, 0);
queue<int> q;
for (int i = 0; i < n; i++) {
for (int node : adjList[i]) {
indegree[node]++;
}
}
for (int i = 0; i < n; i++)... | ALGO | 0.999742 | 5.750422 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-02-05T18:05:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a96b7db3b96... |
90e1dc96-58e1-403d-880d-8e5dd35188ff | julapy/ofxJulapyUtils | src/ofxJulapyUtils.cpp | //
// ofxJulapyUtils.cpp
// Created by <NAME> on 16/06/2014.
//
#include "ofxJulapyUtils.h"
void ofDrawRectOutline(const ofRectangle & rect, int thickness, ofDrawRectOutlineMode mode) {
float b0, b1;
if(mode == ofDrawRectOutlineModeOuter) {
b0 = thickness;
b1 = 0;
} else if(mode == ... | TOOL | 0.930964 | 6.490387 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2011-08-07T06:42:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ebed4a11... |
9e00a03f-7bf2-4eed-986e-ddd88ffe362b | t3nsor/SPOJ | cattleb.cpp | // 2010-11-13
/*
ID: !woburn1
PROG: cattleb
LANG: C++
*/
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cassert>
using namespace std;
int main()
{
int N,R,dx,dy,vx,vy,DX,DY,VX,VY,i,cnt=0,best=0,e;
static bool inrange[100000]={0};
long long a,b,c,d; //d potentially overflows int; making a,b,c lon... | ALGO | 0.999801 | 3.655975 | {
"github_metadata": {
"branch": "master",
"commit_count": 392,
"repo_created_at": "2014-10-08T22:07:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 248,
"forks": 102,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "9230... |
66f7d7ce-944d-4f2a-ab55-aee180e80718 | bvquoc/CP-Trainning-2021 | 0 - Contest 2020/VNOI Online 2021/z-Contestants/NT-12 Huynh Thanh Quy/COOLMAC.cpp | #include<bits/stdc++.h>
#define name "COOLMAC"
#define ios ios_base::sync_with_stdio(false); cin.tie(0);
#define pii pair<int , int >
using namespace std;
const int maxn=1e5+7;
pii a[maxn];
int b[maxn];
bool d[maxn];
int n, m;
void enter()
{
cin>> m;
for(int i=1; i<=m; i++)
cin>> a[i].first>> a[i].seco... | ALGO | 0.999959 | 3.279804 | {
"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": "a6589b39... |
d106d0f5-06fd-4d29-8327-3b57b1d4b6b9 | rainbow-auto/rainbow-codes | Luogu/CF778C.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <bitset>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <queue>
#pragma GCC Optimize(2)
using i64 = long long;
#define fastread std::ios::sync_with_... | ALGO | 0.999634 | 3.245576 | {
"github_metadata": {
"branch": "master",
"commit_count": 749,
"repo_created_at": "2024-09-07T02:10:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47a20482... |
d9e3217c-fedd-4eed-b899-ae6fbc558e1d | ares-emulator/ares | ares/component/processor/wdc65816/algorithms.cpp | auto WDC65816::algorithmADC8(n8 data) -> n8 {
s32 result;
if(!DF) {
result = A.l + data + CF;
} else {
result = (A.l & 0x0f) + (data & 0x0f) + (CF << 0);
if(result > 0x09) result += 0x06;
CF = result > 0x0f;
result = (A.l & 0xf0) + (data & 0xf0) + (CF << 4) + (result & 0x0f);
}
VF = ~(A.... | ALGO | 0.993436 | 6.488185 | {
"github_metadata": {
"branch": "master",
"commit_count": 3591,
"repo_created_at": "2021-06-30T01:56:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1277,
"forks": 151,
"issues": 479,
"pull_requests": 25
},
"file_meta": {
"content_id": "... |
772ecc2a-b785-4eb1-a034-e913abb2742b | mumua666/OnlineJudge | Exercise/LuoGu/Code_2023_7_21/P1152.cpp | #include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <string>
using namespace std;
int main(void)
{
int n;
cin >> n;
int arr[n];
int diff;
cin >> arr[0];
int arr_check[n];
for (int i = 0; i < n; i++)
{
arr_check[i] = -1;
}
for (int i ... | ALGO | 0.999926 | 3.675165 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-09-13T11:41: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": "fc22293a926a... |
6f088f46-afad-4e3c-9b6f-e53269ba4b79 | tusikalanse/acm-icpc | 2019/nowcoder/0810/a.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 3010;
char a[N][N];
int d[N][N], s[N][N], s2[N][N], n, m, vis[N][N], ans;
int main() {
scanf("%d%d", &n, &m);
for(int i = 1; i <= n; ++i) {
scanf("%s", a[i] + 1);
}
for(int j = 1; j <= m; ++j) {
for(int i = 1; i <= n; ++i) {
if(a[i][j] == '0')
... | ALGO | 0.999831 | 3.459759 | {
"github_metadata": {
"branch": "master",
"commit_count": 121,
"repo_created_at": "2021-06-09T11:48: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": "37030494... |
cd3016e4-5ea8-4261-a767-cc640ecf0dbe | jennyrudemo/TNG033 | lab3/lab3_1.cpp | /********************************
* TNG033 : lab3 *
* Exercise 1 *
*******************************/
#include<iostream>
#include<fstream>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<cctype>
#include<iterator>
using pair = std::pair<std::string, i... | ALGO | 0.997582 | 4.202088 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2019-11-15T15:54: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": "56bebe3bd... |
fe2ba216-8928-48d3-b021-7232e4e32305 | rmohammedn/ds_algo | maxB.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<int> slidingMaximum(const vector<int> &A, int B)
{
int size = A.size();
int ele = A[0];
int sum{0}, max_v{0};
std::vector<int> vec;
int i = 0;
if (B <= size)
{
for (i; i<B; i++)
sum += A[i];
vec.... | ALGO | 0.999898 | 4.446204 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2022-07-05T02:56: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": "125a3b22975... |
6f3b727f-13ad-438c-baba-71489632cbf2 | kamyu104/LeetCode-Solutions | C++/super-palindromes.cpp | // Time: O(n^0.25 * logn)
// Space: O(logn)
class Solution {
public:
int superpalindromesInRange(string L, string R) {
const auto K = static_cast<int>(pow(10, (R.length() + 1) * 0.25));
const int64_t l = stol(L), r = stol(R);
int result = 0;
// count odd length
for (int k ... | ALGO | 0.999586 | 6.28888 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
3770b810-0cf5-475a-a71d-46b67f4bfeb3 | Maurycy-898/University_Projects | 6sem/Discrete_Optimization/AOD_lab03/src/graph_utils.cpp | // Graph Utils implementation
#include "graph_utils.hpp"
iList_t ssFromFile(string filename) {
iList_t sources{};
int sources_no;
bool paramsGiven = false;
std::fstream file(filename);
if (file.is_open()) {
string dump;
char lineType = 'c';
while (file >> lineType) {
switch (lineType) {
... | TEST | 0.976836 | 5.431195 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-04-11T12:18:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3a4e2c3e35... |
0ec5465a-ea21-4a4b-b2ac-d467ee914cf9 | Vishal8236/DSA-Practice-vishal8236 | Dynamic_programming/Partition Equal Subset Sum.cpp | class Solution {
public:
bool canPartition(vector<int>& nums) {
sum = accumulate(nums.begin(), nums.end(), sum);
return (sum%2==0) && solve(nums, sum/2);
}
private:
int sum = 0;
bool solve(vector<int> &nums, int sum){
int n = nums.size();
bool dp[n+1][sum + 1... | ALGO | 0.999959 | 6.213193 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2021-08-30T11:51:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02bfbb47b... |
bdb3ba0d-22dd-4220-b1b9-279889f8873e | oomph-lib/oomph-lib | demo_drivers/solid/pseudo_solid_collapsible_channel/pseudo_solid_collapsible_channel.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.996455 | 5.621881 | {
"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": "4147a3a... |
11545a60-3eee-48b4-88fc-90404e0660bf | SerbanSo/Chess-bot | v1.1/main.cpp | #include <iostream>
#include <string.h>
#include <fstream>
#include <cstdio>
// #include "define.h"
using namespace std;
int chessboard[9][9];
enum PIESE{
PION = 1,
TURN = 2,
CAL = 3,
NEBUN = 4,
REGE = 5,
REGINA = 6
};
enum ALF{
A = 1,
B = 2,
C = 3,
D = 4,
E = 5,
F = 6,
G = 7,
H = 8
};
void init_boar... | ALGO | 0.982219 | 3.881498 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-08-15T05:54: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": "847a9ac3ad... |
469ce598-989d-4a5e-8d5c-f90b65f4ee76 | MaximilianusMK/icpc-jakarta-2023 | brackets/scorer.cpp | #include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <string>
void ac() {
std::cout << "AC\n";
exit(0);
}
void wa(std::string reason="") {
std::cout << "WA\n";
if (reason != "") {
std::cout << reason << '\n';
}
exit(0);
}
int readInt(std::ifstream &ifs) {
int ret;
... | ALGO | 0.999842 | 4.358223 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-12-21T14:30: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": "e64c2e6dfc73... |
6293fbda-7da8-4652-9a2b-ea205e1d7fa7 | faramir-dev/meave | meave/ctrnn/_test/neuron-state.cpp | #include <array>
#include <boost/assert.hpp>
#include <glog/logging.h>
#include <iostream>
#include <meave/commons.hpp>
#include <meave/lib/math.hpp>
#include <meave/lib/_42.hpp>
#include <meave/ctrnn/neuron.hpp>
template<typename Float>
struct Fánach {
public:
static Float rand_float() noexcept {
return (static_ca... | ALGO | 0.937938 | 5.824933 | {
"github_metadata": {
"branch": "master",
"commit_count": 155,
"repo_created_at": "2017-12-31T16:57:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "53f4193e... |
8772f8e5-e371-4b90-a637-d8054ff89cab | fsindustry/liszt-cxx | algr/binarytree/_111/MinimumDepthOfBinaryTree.cpp | //
// Created by fsindustry on 2022/8/30.
//
#include <queue>
#include <algorithm>
#include <stack>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
... | ALGO | 0.999981 | 6.41818 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2022-06-22T16:41:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "227c3f7ab... |
ab63225b-3bfc-4549-883e-4d3ae5b399fd | marahim34/CPP-for-DSA | Pointers/3_pointer_arithmatic.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
// The name of an array (e.g., arr) in most contexts acts as a pointer to the first element of the array.
// Arrays are automatically pointers ... | ALGO | 0.999555 | 3.37359 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2024-05-19T06:59:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8477fc77705... |
a94933fb-d301-4736-88a5-9b5169235d06 | gchenfc/cable-robot | Firmware/gerry09_iLQR_t4/src/controllers/controller_tracking.h | #pragma once
#include <cstring> // memcpy
#include "controller_simple.h"
#if defined(KLAUS) || defined(DFL)
static constexpr float kSpeed = 1.0;
#endif
#if defined(AIR)
static constexpr float kSpeed = 0.04;
#endif
#ifdef HYDROPONICS
static constexpr float kSpeed = 0.1;
#endif
static constexpr float kAccel = 1.0;
sta... | TOOL | 0.920073 | 7.258065 | {
"github_metadata": {
"branch": "variant/air/main",
"commit_count": 324,
"repo_created_at": "2024-01-16T06:15:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id":... |
6b7a2322-1450-4338-97aa-7fbaaf829541 | jardeleko/C- | POO/14.cpp | #include <iostream>
#include <math.h>
#include <vector>
#include <set>
#include <map>
//my first code the of machine learning with a warnings haueha
using namespace std;
class Group{
private:
string _class;
double a, b, c, d;
public:
Group(double a, double b, double c, double d, string group){
this->a = a;
this... | ALGO | 0.991068 | 4.764216 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2019-07-10T22:07:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "65ea45dd5... |
083fa0f1-a86f-46eb-8dc1-f5ad6bdd2f55 | proprietary/sandbox | cpp/com_leetcode_problems_text_justification.cc | #include <gtest/gtest.h>
#include <algorithm>
#include <vector>
#include "test_case_helper.hpp"
class Solution {
public:
std::vector<std::string> fullJustify(std::vector<std::string>& words,
int maxWidth) {
std::vector<std::string> lines;
lines.push_back("");
fo... | TEST | 0.980254 | 7.284118 | {
"github_metadata": {
"branch": "master",
"commit_count": 159,
"repo_created_at": "2020-06-11T01: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": "30d6bf1e... |
a80bb9f1-b04b-4d66-badc-8c0acec6262e | hyjk826/baekjoon | 백준/Platinum/5615. 아파트 임대/아파트 임대.cc | // 2022-11-12
#include <bits/stdc++.h>
#define fastio \
ios_base::sync_with_stdio(0); \
cin.tie(0);
#define vi vector<int>
#define vl vector<long long>
#define vc vector<char>
#define vs vector<string>
#define pi pair<int, int>
#define pl pair<ll, ll>
#define vp vector<pi>
#define ll long long
#def... | ALGO | 0.999636 | 3.894055 | {
"github_metadata": {
"branch": "main",
"commit_count": 2540,
"repo_created_at": "2022-05-26T21:55:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2c8b0bcd... |
86fc5c89-2dbc-4eeb-844a-062de473cbf3 | Chillthrower/DAA_and_ML | DAA1/dfs.cpp | #include <stdio.h>
#include <stdlib.h>
#define MAX_VERTICES 100
void dfs(int v, int a[MAX_VERTICES][MAX_VERTICES], int visited[], int vertex)
{
visited[vertex] = 1;
for (int i = 0; i < v; i++)
{
if (a[vertex][i] && !visited[i])
{
dfs(v, a, visited, i);
}
}
}
... | ALGO | 0.999969 | 5.415757 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2024-04-05T14:36:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "80c84832a92... |
14fe3d0a-15fe-49fe-9dce-5714e63513a2 | Nipunnyka/CED05-Advance-DS | 2stack_in_1array.cpp | #include <iostream>
#include <stdlib.h>
using namespace std;
class twoStacks {
int* arr;
int size;
int top1, top2;
public:
// Constructor
twoStacks(int n)
{
size = n;
arr = new int[n];
top1 = n / 2 + 1;
top2 = n / 2;
}
// Method... | ALGO | 0.99776 | 4.282071 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-08-22T18:30:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6298f31190... |
0cf1114c-1342-4b3f-b27d-25702df2aa30 | HiImDarwin/LeetCodePraticing | 0221-maximal-square/0221-maximal-square.cpp | class Solution {
public:
// int maximalSquare(vector<vector<char>>& matrix) {
// int m = matrix.size();
// int n = matrix[0].size();
// int max = 0;
// vector<vector<bool>> tmp(m, vector<bool>(n,0));
// vector<vector<bool>> tmp2(m, vector<bool>(n,0));
// for (int i = 0; i < m... | ALGO | 0.999943 | 5.89515 | {
"github_metadata": {
"branch": "main",
"commit_count": 2145,
"repo_created_at": "2025-05-25T06:16:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23b0c6098... |
24b786aa-4e33-435c-a0ce-b18da0f4a0c1 | TISparta/online-judge-solutions | UVa/Competitive_Programming_Exercises/04-Graph/01-Graph_Traversal/06-Finding_Strongly_Connected_Components/00247.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX_V = 1010, LEN = 50;
int tc, V, E, ct, a, b, dfsCounter, numSCC, dfs_num[MAX_V], dfs_low[MAX_V];
bool vis[MAX_V];
char name[LEN], word[MAX_V][LEN];
vector <int> AdjList[MAX_V], path;
map <string, int> mp;
void dfs(int u){
dfs_low[u] = dfs_num[u] = ++dfsC... | ALGO | 0.9998 | 4.336029 | {
"github_metadata": {
"branch": "master",
"commit_count": 121,
"repo_created_at": "2017-09-10T04:52:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5517304b... |
80517dc8-2f76-471c-9a80-adc33971803b | watermelonlh/Interview-Qs | leetcode/Multiply.Strings.cpp | class Solution {
public:
string multiply(string num1, string num2) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
int l1 = num1.size();
int l2 = num2.size();
string ans = string(l1 + l2, '0');
int c = 0;
for (int i = l1 - 1; i ... | ALGO | 0.999961 | 5.46142 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2012-08-06T15:53:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c04d3fa1d... |
ad43ee2e-32cf-4a57-a9d2-247005474e25 | teojimenez/PRO1 | Examens/V37339.cc | //
//
// input:
// output:
#include <iostream>
using namespace std;
/**
* @pre n >= 0
* @post retorna cert si n és un número entrepà, fals en cas contrari
*/
bool is_sandwich(int n)
{
int bread = n % 10;
bool is_sandwich = true;
n /= 10;
if (n > 0 and n % 10 != bread)
{
int h... | ALGO | 0.999386 | 3.618007 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-09-18T13:09:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0341dbc6ef... |
eb44fcda-8d6f-4706-8084-15bff1f4ed7f | CodeWithIsmail/Competitive-Programming | Codeforces/B_Number_of_Triplets.cpp | /// *** --- || In the name of ALLAH ||| --- *** ///
/// *** --- || Author: Code_with_Ismail ||| --- *** ///
#include <bits/stdc++.h>
using namespace std;
// Data Type:
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typede... | ALGO | 0.999941 | 4.671117 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2023-03-18T16:28: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": "804ceef7a2... |
5a483e82-8604-4c0d-a0e4-946cfd6b2556 | PakinDioxide/temp | mitit/MITIT Winter 2025 Beginner Round/e.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ios::sync_with_stdio(0), cin.tie(0);
int n, q;
cin >> n >> q;
int cnt[n+5], a[n+5];
memset(cnt, 0, sizeof(cnt));
set <int> st;
for (int i = 1; i <= n; i++) cin >> a[i], cnt[a[i]]++;
for (int i = 1; i <= n; ... | ALGO | 0.999978 | 4.255705 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-12-10T10:36: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": "47236341903... |
7eed076a-9556-41b1-a7c7-ccbc6e685089 | dloibl/AOC2020 | Day8/main.cpp | #include "../utils.cpp"
#include <set>
using namespace std;
int run(vector<string> &ops, vector<int> &args, set<int> &visited, int &size, int &cursor)
{
int accumulator = 0;
int arg;
string op;
while (visited.find(cursor) == visited.end())
{
visited.insert(cursor);
op = ops[cursor]... | ALGO | 0.999935 | 5.058029 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2020-12-01T16:44: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": "9ec74bf7611... |
056ae7a7-f551-4610-a108-eaa2ec2dab27 | eaststarmmt/Algorithm | Programmers/이모티콘 할인행사.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
pair<int,int> max_res;
pair<int, int> get_res(vector<vector<int>>& users, vector<int>& emoticons, vector<int>& ratio) {
int cnt = 0; // 가입자 수 카운팅 할 변수
int res_sum = 0; // 총 구매 가격
for(vector<int> user : users) { // 사람별로... | ALGO | 0.999789 | 5.152066 | {
"github_metadata": {
"branch": "master",
"commit_count": 1152,
"repo_created_at": "2020-12-24T12:32:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "601d86b... |
4ea5ec03-9319-457b-81ab-96743ddd428d | imsaurabh1998/CodeForces | MinimumValidPath.cpp | //
// Created by SAURABH on 17-01-2020.
//
#include<bits/stdc++.h>
using namespace std;
class DirectGraph {
int V;
list<int> *adj;
int w[100][100];
map<int,int> m;
int source,destination;
public:
int minNode=INT_MAX;
DirectGraph(int v){
V=v;
adj=new list<int> [V];
}
... | ALGO | 0.999621 | 4.695806 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2019-11-05T04:43: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": "ea9f8281... |
41605943-8160-4490-abbc-bcab4c1313bd | xehoth/OnlineJudgeCodes | BZOJ/BZOJ4524-伪光滑数-堆.cpp | /**
* Copyright (c) 2016-2018, xehoth
* All rights reserved.
*
* 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 appl... | ALGO | 0.999986 | 3.987743 | {
"github_metadata": {
"branch": "master",
"commit_count": 401,
"repo_created_at": "2017-08-26T02:49:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "180b053a... |
4d53818a-a05b-48a5-a600-facdcfbcd89a | vfolunin/archives-solutions | CSES/1647.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
struct SparseTable {
vector<int> log;
vector<vector<int>> st;
SparseTable(vector<int> &a) {
log = { 0, 0 };
for (int i = 2; i <= a.size(); i++)
log.pu... | ALGO | 0.999969 | 5.274995 | {
"github_metadata": {
"branch": "master",
"commit_count": 2367,
"repo_created_at": "2017-11-27T10:19:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 5
},
"file_meta": {
"content_id": "d8ea584... |
464142bf-090c-42b3-b920-81c0b85bc7ce | MKSherbini/LeetCode | CppSolutions/CppSolutions/MaximumNumberOfMovesInAGrid.h | #pragma once
#include "stdc++.h"
using namespace std;
// https://leetcode.com/problems/maximum-number-of-moves-in-a-grid
class MaximumNumberOfMovesInAGrid {
public:
// 83 ms, faster than 17.39% : 94.75 MB, less than 5.83%
int solution(vector<vector<int>> grid)
{
int n = size(grid), m = size(grid[0... | ALGO | 0.999962 | 5.671232 | {
"github_metadata": {
"branch": "master",
"commit_count": 1038,
"repo_created_at": "2021-12-05T16:08: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": "83d814e... |
38ed36d5-116d-4154-acc4-cfd185f9f976 | rewatlok/Prepare-for-ICPC | Tasks Fest/Training 2/Day 3/Task G.cpp | // #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <cmath>
#include <climits>
#include <vector>
#include <queue>
#include <deque>
#include <array>
#include <list>
#include <stack>
#include <tuple>
#include <set>
#include <unordered_set>
#include <map>
#include <unordere... | ALGO | 0.999856 | 3.521727 | {
"github_metadata": {
"branch": "main",
"commit_count": 1429,
"repo_created_at": "2024-06-09T20:33:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea554ad99... |
02d54bad-95c1-4f32-9462-ff15127c285c | MannyUnchain3d/42-common-core | common_core/12_cpp09/module09/ex02/PmergeMe.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* PmergeMe.cpp :+: :+: :+: ... | ALGO | 0.999543 | 6.015524 | {
"github_metadata": {
"branch": "main",
"commit_count": 460,
"repo_created_at": "2022-11-03T09:21: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": "b16d65756b... |
137b43d2-27b9-4edf-9862-f12816812a28 | f-zyj/ACM | 按 OJ 分类/EOJ/f-EOJ-大学生程序设计邀请赛(华东师范大学)-B-分词/f-EOJ-大学生程序设计邀请赛(华东师范大学)-B-分词/main.cpp | //
// main.cpp
// f-EOJ-大学生程序设计邀请赛(华东师范大学)-B-分词
//
// Created by ZYJ on 2017/5/15.
// Copyright © 2017年 ZYJ. All rights reserved.
//
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;
const int MAXN = 3e5 + 10;
const int MAX_WORD_LEN = 30;
int flag[MAXN];
char s[MAXN]... | ALGO | 0.999737 | 4.008024 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2018-05-18T16:14:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 199,
"forks": 55,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "163fe7... |
487234b0-368f-4088-b616-b513ea8cc6ad | i-am-shank/Coding_Mafia | Day 18/HashTable/SingleNumber.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
// Method 2
int singleNumber2(vector<int>& nums) {
int n = nums.size(), ans;
unordered_set<int> s;
int numsSum = 0;
for(int i=0; i<n; i++) {
s.insert(nums[i]);
numsSum += nums[i];
}
int sum = 0;
unordered_set<int> :: iterato... | ALGO | 0.999984 | 4.332744 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2022-03-28T19:22:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b4300dee78... |
6e6d88df-6c34-4ade-866c-56daceadc7b0 | eXascaleInfolab/bench-vldb20 | NewAlgorithms/cpp/Algebra/CentroidDecomposition.h | //
// Created by Zakhar on 08.03.2017.
//
#include <armadillo>
#pragma once
namespace Algorithms
{
enum class CDSignVectorStrategy_2
{
ISSVBase = 1,
ISSVPlusBase = 2,
ISSVInit = 11,
ISSVPlusInit = 12,
LSVBase = 21,
LSVNoInit = 22
};
bool isValidStrategy_2(CDSignVectorStrategy_2 _strategy);
... | ALGO | 0.999842 | 6.573727 | {
"github_metadata": {
"branch": "master",
"commit_count": 607,
"repo_created_at": "2019-01-23T10:33:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 38,
"forks": 16,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c58ac2... |
ffcef641-6587-453e-afb9-84a593359117 | HETUKARIYA27/Object-Oriented-Programming-In-CPlusPlus- | ObjectOrientedProgrammingInC++/comparingbothobjectsindifferentclassusingfriendfunctionOOPS.cpp | #include<iostream>
using namespace std;
class triangle;/*USED TO INFORM THE FRIEND FUNCTION THAT CLASS TRIANGLE IS AFTER THE CLASS CIRCLE AS THIS WOULD AVOID ERRORS OF CLASS TRIANGLE NOT EXISTING WHEN WE DECLARE FRIEND FUNCTION IN CLASS CIRCLE*/
class circle{/*CLASS CIRCLE*/
float rad,pi,area;
public :/*MAKING EVERTHIN... | TOOL | 0.993118 | 5.924758 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2023-08-16T04:10: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": "467f4ce93... |
28b3e3ea-ba34-4d2d-a203-23053463b4b6 | YeshengSu/AdvancedGameTechnology | Build/Tuts_GameLogic/MazeGenerator.cpp | #include "MazeGenerator.h"
#include <nclgl\NCLDebug.h>
#include <list>
#include <algorithm>
uint RandomGridCell(uint size)
{
uint x = rand() % size;
uint y = rand() % size;
return y * size + x;
}
MazeGenerator::MazeGenerator()
: size(0)
, start(NULL)
, end(NULL)
, allNodes(NULL)
, allEdges(NULL)
{
}
MazeGen... | ALGO | 0.945067 | 5.120385 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-03-15T15:56:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08cda99ebd... |
8f951ab6-c01a-4389-90ca-6304bceacc77 | BhavyaBhalla-27/DSA-Supreme- | DSA_Sheet_Love Babbar/Arrays/2. Find maximum and minimum element in the array/Solution_gfg.cpp | // GFG Question Link - https://practice.geeksforgeeks.org/problems/find-minimum-and-maximum-element-in-an-array4428/1
struct pair getMinMax(long long int arr[], long long int n) {
struct pair p; // Making a structure named p
// Using dot (.) we can access the elements of the structure
p.min = arr[0];
p... | ALGO | 0.999878 | 5.164668 | {
"github_metadata": {
"branch": "main",
"commit_count": 513,
"repo_created_at": "2023-01-22T10:26:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 370,
"forks": 137,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "7b0080... |
90e6d0c4-ff4f-4d71-8b88-fc77fa0a47b1 | sviridov-da/Lab8Acpp | Lab1 A8/func.cpp | #include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <ctime>
#include <algorithm>
using namespace std;
class randomizer
{
private:
int min, max;
public:
randomizer(int min, int max)
{
this->min = min;
this->max = max;
srand(time(NULL));
}
int operator()()
{
if (max == mi... | TOOL | 0.937386 | 3.6707 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-09-21T15:40: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": "d17dab72b8... |
b7ce210a-f4b6-4405-b8a8-6018f7c6f06e | mayank-aggrwal/DS_and_Algorithms | square_root.cpp |
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
// 0 <= x <= 2 ^ 31 - 1
int square_root(int x) {
lli s = 0, e = x, n = x;
int ans = 0;
while (s <= e) {
lli mid = s + (e - s) / 2;
if (mid * mid > n) {
e = mid - 1;
}
else if (mid * mid ==... | ALGO | 0.999746 | 4.092783 | {
"github_metadata": {
"branch": "master",
"commit_count": 109,
"repo_created_at": "2019-04-02T14:20: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": "9e28a46c... |
b99a8caa-db7c-4f0c-8bfc-cfdaf8c1a2a5 | AkshatAggarwal14/Competitive-Programming | CodeForces/Gym/355493P22.cpp | #ifdef LOCAL
// https://github.com/AkshatAggarwal14/Competetive-Programming
#include "Akshat.hpp"
#else
#include "bits/stdc++.h"
using namespace std;
#define dbg(...)
#endif
using ll = int64_t;
auto sz = [](const auto &container) -> ll { return container.size(); };
#define all(x) (x).begin(), (x).end()
template <class ... | ALGO | 0.999982 | 5.765584 | {
"github_metadata": {
"branch": "master",
"commit_count": 850,
"repo_created_at": "2021-08-16T13:49:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f6ef9aa0... |
1e258bee-ff8b-4d4c-88a0-5b4ab030c24d | Vaa3D/vaa3d_tools | released_plugins/v3d_plugins/bigneuron_AmosSironi_PrzemyslawGlowacki_SQBTree_plugin/libs/ITK_include/itkHilbertPath.h | /*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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
*
* h... | ALGO | 0.981932 | 6.289819 | {
"github_metadata": {
"branch": "master",
"commit_count": 7983,
"repo_created_at": "2016-01-27T18:19:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 110,
"forks": 70,
"issues": 11,
"pull_requests": 12
},
"file_meta": {
"content_id": "69d... |
c7017922-793f-4fbb-a3ca-c92f6cbda3a1 | albertoventurini/Hackerrank | missing-numbers/main.cpp | #include <iostream>
#include <map>
#include <assert.h>
using namespace std;
int main()
{
int n;
cin >> n;
map<int, int> a;
int j;
for(int i = 0; i < n; i++)
{
cin >> j;
if(a.find(j) == a.end())
a[j] = 1;
else
a[j]++;
}
... | ALGO | 0.999994 | 3.257732 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2014-08-02T08:45:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2fe8793752... |
95c84682-7def-428a-962d-23b2464853fc | ahsamehx/Problem-Solving | Graphs/Greg and Graph.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define inf 1e12
signed main() {
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int n;
cin>>n;
vector<vector<int>> orgMat(n, vector<int>(n, 0));
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
... | ALGO | 0.999956 | 4.399392 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-05-07T10:38:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "206091fe597b... |
2cac48eb-f18d-4f47-bd92-7631a424ef00 | Tudor67/Competitive-Programming | LeetCode/Problems/Algorithms/#982_TriplesWithBitwiseANDEqualToZero_sol5_vector_and_submask_enumeration_O(N^2+NxMAX_NUM)_time_O(MAX_NUM)_extra_space_28ms_9MB.cpp | class Solution {
public:
int countTriplets(vector<int>& nums) {
const int N = nums.size();
const int MAX_NUM = max(1, *max_element(nums.begin(), nums.end()));
const int MAX_BIT = (int)floor(log2(MAX_NUM));
vector<int> count(MAX_NUM + 1, 0);
for(int j = 0; j < N; ++j)... | ALGO | 0.999904 | 6.016016 | {
"github_metadata": {
"branch": "master",
"commit_count": 615,
"repo_created_at": "2020-02-27T19:56:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8e8d199... |
12916d41-f582-4cd6-a136-05f71a5e3045 | micmacIGN/micmac | CodeGenere/photogram/cEqResiduIm2DPol3Id.cpp | /*Header-MicMac-eLiSe-25/06/2007
MicMac : Multi Image Correspondances par Methodes Automatiques de Correlation
eLiSe : ELements of an Image Software Environnement
www.micmac.ign.fr
Copyright : Institut Geographique National
Author : <NAME>
Contributors : <NAME>, <NAME>.
[1] <NAME>, <NAM... | ALGO | 0.995322 | 3.929099 | {
"github_metadata": {
"branch": "master",
"commit_count": 10879,
"repo_created_at": "2016-11-24T22:09:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 785,
"forks": 163,
"issues": 83,
"pull_requests": 30
},
"file_meta": {
"content_id": "6... |
376091ce-4184-4e39-ad1e-371a67cd47bf | 22thking/Baekjoon | 1600: 말이 되고픈 원숭이.cpp | #include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
int K,W,H;
int hx[8] = {1,2,2,1,-1,-2,-2,-1}; // 말이 되어버린 원숭이 움직임
int hy[8] = {-2,-1,1,2,2,1,-1,-2};
int dx[4] = {0,0,1,-1}; // 고냥 원숭이
int dy[4] = {1,-1,0,0};
int maps[203][203];
bool isused[203][203][40]; // 3차원 배열이 된 이유는 원숭이가 가는 길이 반복될 ... | ALGO | 0.999707 | 3.69912 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2022-05-26T13:51: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": "604c5224dc2... |
973956e4-b98d-4631-85f2-f5e5a326713a | ms2just4dev2tw/Leetcode | src/weekly/321-330/329/MinCostOfSplitArray.cpp |
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
class Solution
{
public:
int minCost(std::vector<int> &nums, int k)
{
std::map<int, int> timesMap{};
for (const auto &num : nums)
{
++timesMap[num];
}
int maxTimes = 0;
for (c... | ALGO | 0.999749 | 6.32324 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-05-08T04:09: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": "089a9d2e13... |
b39cec07-596a-401c-92c4-2f34061839dc | sahilbansalweb/Hacktoberfest2021 | NextPermutation.cpp | /*
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
If such an arrangement is not possible, it must rearrange it as the lowest possible order (i.e., sorted in ascending order).
Leetcode Problem No 31. Next Permutation - https://leetcode.com/problems/ne... | ALGO | 0.999777 | 5.375892 | {
"github_metadata": {
"branch": "main",
"commit_count": 451,
"repo_created_at": "2021-10-01T04:59:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 124,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f21046... |
3121a8c6-ecfb-4778-9797-746c4a1d1014 | gusbo9233/hexgrid-city-game | src/civilians/Household.cpp | #include "../../include/civilian/Household.h"
#include "../../include/civilian/Individual.h"
//constructor
Household::Household() {
initialize();
}
//destructor
Household::~Household() {
for (Individual* individual : individuals) {
delete individual;
}
}
//update the household
void Household::upd... | TOOL | 0.960488 | 5.041206 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2025-03-19T16:24: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": "ec3b873a9e2... |
40495503-3839-473a-90ae-b7310e602651 | Electronic-Waste/CSE-labs | mr_coordinator.cc | #include <string>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <string>
#include <vector>
#include <mutex>
#include "mr_protocol.h"
#include "rpc.h"
using namespace std;
#define DEBUG
#ifdef DEBUG
#define COORDINATOR_LOG(fmt, args...) \
do ... | DATA | 0.923793 | 4.406588 | {
"github_metadata": {
"branch": "lab4",
"commit_count": 45,
"repo_created_at": "2022-11-30T07:37:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d80a80e8edb... |
b46724ed-3c96-40f5-913d-6b1ea53250e2 | Bhushan9001/Data-Structure | BackTracking/RatinMaze.cpp | #include "bits/stdc++.h"
using namespace std;
bool safe(int x , int y ,vector<vector<bool>> &vis,vector<vector<int>> &m,int n){
if((x>=0 && x<n)&&(y>=0&&y<n)&&vis[x][y]==0 && m[x][y]==1) return true;
else return false;
}
void solve(int x , int y , vector<vector<int>> &m, int n , vector<string> &an... | ALGO | 0.999963 | 4.402143 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-03-15T15:07: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": "142b79c5ed... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.