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 |
|---|---|---|---|---|---|---|---|
6568e4aa-475f-4828-bdf5-75876b1fe370 | devmentality/bachelors_thesis | ron/const.hpp | #ifndef ron_const_hpp
#define ron_const_hpp
#include <assert.h>
#include <sys/errno.h>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <string>
#include <utility>
#include <vector>
#include "bits.hpp"
namespace ron {
using uchar8 = unsigned char;
using uchar8_ptr = uchar8 const*;
/** Frame size or... | CONFIG | 0.915734 | 6.949989 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2021-03-28T11:15:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "28fbe9c57... |
eff2b3d0-5157-45a5-8a2c-2c2c8294e92e | rafaelGuasselli/structures | tests/minenclosingcircle.cpp |
#include <bits/stdc++.h>
using namespace std;
struct point {
double x, y;
point(double x = 0, double y = 0) : x(x), y(y) {}
static point translat;
friend double cross(const point p, const point q) {
return p.x * q.y - p.y * q.x;
}
static bool smallest_y(const point&p, const point&q){
return p.y < q.y ... | ALGO | 0.999808 | 4.262843 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2025-03-04T21:53:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "95daf20e6... |
b4836aa9-32b5-44fd-88f4-7b0d015166b4 | AhmedGsh/HumanVsGrue_GameDesign | main.cpp | /*
A virtual game, where a player navigates in a maze.
*/
#include <iostream>
#include <map>
#include <string>
#include <vector>
#include <set>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include "Thing.h"
#include "Room.h"
#include "Agent.h"
#include "Grue.h"
#include "Player.h"
using namespace std;
... | TOOL | 0.973759 | 3.063676 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-01-07T07:41: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": "8aa1241fb... |
5a0506de-2e9c-4ce0-9a0a-083bed4d6782 | matt77hias/Hieroglyph-v3 | Applications/ParticleStorm/ViewSimulation.cpp | //--------------------------------------------------------------------------------
// This file is a portion of the Hieroglyph 3 Rendering Engine. It is distributed
// under the MIT License, available in the root of this distribution and
// at the following URL:
//
// http://www.opensource.org/licenses/mit-license.ph... | TOOL | 0.940576 | 5.319858 | {
"github_metadata": {
"branch": "master",
"commit_count": 219,
"repo_created_at": "2017-06-13T11:39:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 49,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "549100... |
982f1f1b-724e-4309-a886-86bea81a54ad | mikhailperevalov/cpp-search-server | search-server/search_server.h | #pragma once
#include <algorithm>
#include <cmath>
#include <execution>
#include <list>
#include <map>
#include <set>
#include <string>
#include <string_view>
#include <tuple>
#include <vector>
#include "document.h"
#include "string_processing.h"
#include "concurrent_map.h"
const int MAX_RESULT_DOCUMENT_COUNT = 5;
... | WEB | 0.994126 | 7.273174 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2021-12-06T13:57:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b2be92c380... |
6d4140a6-66ea-4736-8e9e-3d07d9c3b475 | Randowlh/Project_ACM | code/luogu/3116.cpp | #include <bits/stdc++.h>
using namespace std;
const int inf = 0x7FFFFFFF;
typedef long long ll;
typedef double db;
typedef long double ld;
template<class T>inline void MAX(T &x,T y){if(y>x)x=y;}
template<class T>inline void MIN(T &x,T y){if(y<x)x=y;}
template<class T>inline void rd(T &x){
x=0;char o,f=1;
while(o=... | ALGO | 0.999943 | 3.590544 | {
"github_metadata": {
"branch": "master",
"commit_count": 516,
"repo_created_at": "2017-07-20T06:34:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8e7db8e... |
21bc995b-564c-4936-adf2-0a933f0e8c9f | dkhos17/Codeforces-Solutions | Harold-Finch/1169B-Pairs.cpp |
/*
* Problem: 1169B Pairs
* Author: Harold-Finch
* Date: Sunday, May 26, 2019 8:03 PM
* Status: Accepted, 467 ms, 18841600 bytes
* Language: GNU C++14
*/
#include <bits/stdc++.h>
using namespace std;
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds... | ALGO | 0.999987 | 3.703631 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-05-17T12:54: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": "e00f8f9a8750... |
c90150f9-9661-4d48-9948-53c8940e8196 | gjconwell/Advent-of-Code-2021 | Day7/Puzzle2/main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <map>
#include <cmath>
//cd /mnt/c/Users/conweg/Documents/Coding/Advent_of_Code_2021/Day7/Puzzle2
//g++ main.cpp -o main.exe -Wall
//./main.exe
int BestFit(std::vector<int> &crabs, int value) {
int min;
for (int j = 0; j < value; ... | ALGO | 0.999486 | 5.464707 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2021-12-03T19:43:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "942842c33... |
fafe45a7-6ae3-4a6e-8fd8-f86788d6e455 | karitra/cpp-playground | src/bench1.cc | #include <chrono>
#include <iostream>
#include <iterator>
#include <functional>
#include <map>
#include <random>
#include <stdexcept>
#include <set>
#include <vector>
#include <utility>
#include <cstdlib>
// #include <boost/range/adaptor/transformed.hpp>
#include <boost/range/algorithm/transform.hpp>
#include <boost/... | ALGO | 0.973597 | 5.440574 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2017-03-02T09:41: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": "7216ef0d1... |
6a70c61a-04bf-432f-95d2-37cf631353d1 | delta4d/AlgoSolution | leetcode/median-of-two-sorted-arrays.cpp | // 252ms
// O(log(m)log(n))
// binary search on both A and B
class Solution {
public:
int _kth(int A[], int m, int B[], int n, int k) {
int left(0), right(min(m-1,k)), mid;
while (left <= right) {
mid = left + ((right - left) >> 1);
int pos = lower_bound(B, B+n, A[mid]) - B +... | ALGO | 0.999999 | 5.821311 | {
"github_metadata": {
"branch": "master",
"commit_count": 154,
"repo_created_at": "2013-02-15T16:09:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca3330a4... |
405aae2f-54df-45bd-aae0-7ca4c6e77b8b | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/allpro_train/1_6989_193.cpp | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = (a); i <= int(b); i++)
#define per(i, a, b) for (int i = (a); i >= int(b); i--)
#define fir first
#define sec second
#define tct template<class type>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int maxn = 1e5, mod = 1e9 + 7;
int ... | ALGO | 0.999989 | 4.039104 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-04-28T03:59: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": "394fd429e44... |
7e076b39-3c05-4a8b-a72a-658958643394 | Edith-3000/Algorithmic-Implementations | Dynamic Programming/Pattern - Fibonacci/Fibonacci Number Algorithm.cpp | // Prob: https://leetcode.com/problems/fibonacci-number/
// Ref: https://www.youtube.com/watch?v=tyB0ztf0DNY&list=PLgUwDviBIf0qUlt5H_kiKYaNSqJ81PMMY&index=3&ab_channel=takeUforward
/***************************************************************************************************************************************/
... | ALGO | 0.999998 | 5.188148 | {
"github_metadata": {
"branch": "master",
"commit_count": 490,
"repo_created_at": "2020-07-24T04:49:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6714cc1f... |
a1434860-eb45-4aba-be56-f26b1fae069e | GersonCavalheiro/OpenMPSnapshot | May2023/RepCPP/611347127/sho_projection.hxx | #pragma once
#include <cstdio>
#include <cstdint>
#include <complex>
#include "status.hxx"
#include "sho_tools.hxx"
#include "real_space.hxx"
#include "hermite_polynomial.hxx"
#include "inline_math.hxx"
#include "constants.hxx"
#include "sho_unitary.hxx"
namespace sho_projection {
template <typename rea... | ALGO | 0.999019 | 5.855076 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-08-19T17:35:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "87ac52e953... |
10033178-2116-4ef2-a3d0-d2df69bb6f3f | Shashaank/Programming-examples | Binarytree traversals.CPP | #include<conio.h>
#include<iostream.h>
#include<process.h>
class btree{
public:
long key;
btree();
void add();
void move();
btree* Lchild;
btree* Rchild;
btree* parent;
};
btree* crnt=NULL;
struct stree{
long key;
stree* nxt;
};
stree* top=NULL;
void inorde... | ALGO | 0.999772 | 3.505945 | {
"github_metadata": {
"branch": "btrees",
"commit_count": 1,
"repo_created_at": "2013-11-01T06:11: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": "014146afc0... |
715842c4-a6ca-4cae-b41d-0114796f2465 | Joao-pedrosantos/SuperComp | aula04/atividade8.cpp | #include <iostream>
using namespace std;
int main() {
const int tamanho = 3;
int matriz[tamanho][tamanho];
int somaDiagonal = 0;
cout << "Insira os elementos da matriz 3x3:" << endl;
for (int i = 0; i < tamanho; i++) {
for (int j = 0; j < tamanho; j++) {
cout << "Elemento [" <... | ALGO | 0.999638 | 5.263146 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2024-08-14T17:40: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": "935377f7fb5... |
246eff2a-cc73-4a49-81a5-e0b316f9e3a5 | RubaiyadNoorShahriar1999/Data-Structure-Codes | 19-39529-1-LP02-DAY-02.cpp | #include<iostream>
using namespace std;
#define stack_size 10
#define array_size 100
int top= 0;
char stack[stack_size];
void push(char X)
{
if(top >= stack_size)cout<<"Overflow! \n";
else
{
stack[top]=X;
top++;
}
}
char pop()
{
char X='!';
if(top>0)
{
top--;
... | ALGO | 0.999974 | 3.989436 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-05-07T14:32: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": "21131ef034... |
0c6dd81b-3ab6-4371-aef3-7092e5f6cbb2 | Saurav-Paul/Others-Oj-problem-Solutoions-By-Saurav-Paul | SPOJ-HORRIBLE - Horrible Queries.cpp | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
class obj{
public :
long long int prop,sum;
};
using vec = vector <obj> ;
void update_tree(vec &tree,ll value, ll l , ll r , ll st , ll sp , ll node){
if(sp < l or st > r)
return ;
if(l <= st and r >= sp){
tree[node].prop += value;
tree[... | ALGO | 0.999041 | 4.935056 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2019-02-14T12:59:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e92331b... |
9e631ce2-f9de-46bd-812e-77d3f044fd40 | mihirbhatkar/todo-cpp | main.cpp | #include <iostream>
#include <string>
#include <unordered_map>
struct Task {
int id;
std::string name;
bool completed;
};
class List {
private:
std::unordered_map<int, Task> list;
int counterForID;
public:
List() : counterForID(0) {}
void printList() {
std::cout << "--------------------------" << ... | TOOL | 0.931642 | 6.006068 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-07T11:35: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": "bfeb0020c1d1... |
663f40d5-c202-4763-bf69-6077b32ea2ee | chenchienkuo9010/c-cpp-practice | wdd/cpp/stl/day06/06includes/main.cpp | #include <iostream>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
int main() {
set<int> s1{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
set<int> s2{2, 4, 6};
cout << boolalpha << includes(s1.begin(), s1.end(), s2.begin(), s2.end()) << endl;
vector<int> v1{1, 9, 4, 8, 6, 0, 3, 2};
v... | ALGO | 0.939386 | 4.519159 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-11-30T15:17:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f0224e5c43d... |
4ec68e7e-ec32-41e3-92f9-808a104c16bd | md143rbh7f/competitions | acm-icpc/southeastern-europe/08/lucky_cities.cpp | #include <cstdio>
#include <map>
#include <vector>
using namespace std;
#define foreach(i,c) for(__typeof__((c).end()) i=(c).begin();i!=(c).end();i++)
#define N 100005
vector<int> g[N];
map< int, vector<int> > _h[N], * h;
int n, m, ord[N], low[N], par[N], t, q[N];
int _sta[N], _stb[N], * sta, * stb;
bool odd[N];
i... | ALGO | 0.999901 | 4.661164 | {
"github_metadata": {
"branch": "master",
"commit_count": 628,
"repo_created_at": "2013-08-29T15:52:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3a352fe... |
a628b086-5d8d-49ee-a6cd-d52f9a38edbf | Brand-Frank/Cpp_of_BUPT_MOOC | unit02/chapter 6/TestArray.cpp | #include <iostream>
#include <array>
using namespace std;
using std::array;
void print(array<int,3>& a)
{
for(auto x : a){
cout << x << " " << endl;
}
}
int search(array<int, 3>&a, int token) {
bool exist = false;
int i = 0;
for(auto x : a){
if(x == token)
{
exist... | ALGO | 0.998072 | 4.465715 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-10-06T11:02: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": "152c3c61c... |
f41535b3-4f4c-41e5-b51f-66fdf412cc0d | ShahidAkhtar777/DS-Algo | Stack/revision.cpp | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
// Reversing Stack using 1 stack
void transfer(stack<int> &s1,stack<int> &s2,int n)
{
for(int i=0;i<n;i++)
{
s2.push(s1.top());
s1.pop();
}
}
void reverseStack(stack<int> &s1)
{
int n = s1.size();
for(int i... | ALGO | 0.999557 | 4.667274 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2023-01-29T14:36: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": "5dc374d26... |
cfc5cc1f-4411-4d7b-a7da-b9d53108f978 | SunYangtian/leetcode | Combination Sum.cpp | /*
Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target.
The same repeated number may be chosen from candidates unlimited number of times.
Note:
All numbers (including target) will be pos... | ALGO | 0.999988 | 6.458678 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2019-10-14T12:02: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": "8eb5faa47... |
7581ca8a-9bcb-4f71-9185-65bec5387a7e | ishandutta2007/codeforces-a | avinashkartik/normal/545/A.cpp | #pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include<bits/stdc++.h>
using namespace std;
#define GODSPEED ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision... | ALGO | 0.998952 | 3.555975 | {
"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": "3c15e78f8093... |
1ca0b1cd-0b16-4d35-af67-ded6135fd887 | NatanePartouche/OS_FinalProject | src/Network/Server_PL.hpp | #ifndef SERVER_PL_HPP
#define SERVER_PL_HPP
#include <thread> // For creating and managing threads.
#include <sstream> // For parsing client input commands.
#include "ActiveObject.hpp" // ActiveObject for task execution.
#include "../../src/Model/Graph.hpp" // Graph model use... | WEB | 0.923074 | 6.978773 | {
"github_metadata": {
"branch": "nouvelle_branche",
"commit_count": 8,
"repo_created_at": "2024-10-31T15:29: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": "... |
bf7d468a-4d4d-4204-85c7-e44cb99487c0 | CosminGGeorgescu/AF | lab3/6/6b.cpp | #include <fstream>
#include <vector>
#include <optional>
#include <stack>
#include <iostream>
#define INF 999999
using namespace std;
ifstream fin("grafpond.in");
ofstream fout("grafpond.out");
vector<tuple<int, int, int>> graph;
int main() {
int n, m, k, s, x, y, z;
fin >> n >> m;
int d[n + 1][n + 1]... | ALGO | 0.999979 | 4.080898 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2023-10-12T10:27: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": "52d492f6e... |
716c7571-e21a-453c-aa3c-d6b46487bbef | shan-mathi/Codeforces | 158B - Taxi GNU C++17 (64).cpp | //109978432 Mar/14/2021 19:47UTC+5.5 Shan_XD 158B - Taxi GNU C++17 (64) Accepted 156 ms 400 KB
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5+10;
int a[maxn];
bool cmp(const int& a,const int& b) {
return b<a;
}
int main(void){
int n;cin>>n;
for(int i = 0;i < n;i++) cin>>a[i];
sort(a,a+n,cmp);... | ALGO | 0.999967 | 4.136337 | {
"github_metadata": {
"branch": "main",
"commit_count": 144,
"repo_created_at": "2021-02-22T11:24:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8c2959a1f... |
79f30f38-00f3-4fd2-ae3d-68eda2ab6f0f | blair06/Algorithm | 15787.cpp | #include <iostream>
#include <vector>
#include <set>
#include<algorithm>
#include <memory.h>
using namespace std;
int n,m;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m;
vector<int> v(n+1,0);
while(m--){
int num, idx, seat;
cin >> num;
switch (num) {... | ALGO | 0.999678 | 3.99721 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2020-08-11T10:05: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": "0f822d06... |
333726fe-681b-4d37-8b13-24c342dfd67a | rithikJha/GATE-Algorithms | Searching/2. BinSearch.cpp | #include <bits/stdc++.h>
using namespace std;
int BinarySearchREC(int arr[], int l, int r, int item)
{
int mid = (l + r + 1) / 2;
if (l <= r)
{
if (arr[mid] == item)
return mid;
if (arr[mid] > item)
return BinarySearchREC(arr, l, mid - 1, item);
if (arr[mid... | ALGO | 0.999749 | 5.352677 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2021-06-25T02:14:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d293587ffc... |
4eb5a370-bcfa-456f-af0c-f44821c2d274 | rithisha/ncrwork | Data Structures/Queues/CQ.cpp | #include<iostream>
using namespace std;
struct cquu {
int f;
int r;
int *cq;
int size;
};
class cqueue
{
struct cquu qu;
public:
cqueue();
void enque(int);
int deque();
void getsize(int);
bool overflow();
bool underflow();
void display();
};
cqueue::cqueue()
{
qu.f = -1;
qu.r = -1;
qu.size = 0;
qu.cq =... | ALGO | 0.997944 | 3.530062 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2019-02-01T05:06: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": "2457df82d... |
9bc0f2ab-b80f-44a9-b840-e27ba436da19 | winds-zzf/study-datastructure | program/数据结构实验2/2015.cpp | #define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
#define OVERFLOW -1
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
typedef int Status; //将int取别名为Status
typedef struct SNode
{
char date; //结点数据域
struct SNode* next; //结点指针域
}SNode, * LinkStack;
//链栈的初始化
Status InitStack(LinkStack& S)
{
S = NUL... | ALGO | 0.999945 | 3.089826 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2024-03-12T02:29:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f35edf141... |
7f5a8263-3a8b-4c66-a4ba-e4d6521c718b | NicoMoser/EarlyDays | projectEuler/problem12.cpp | /*
The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be:
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...
Let us list the factors of the first seven triangle numbers:
1: 1
3: 1,3
6: 1,2,3,6... | ALGO | 0.99985 | 6.214316 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2015-11-06T03: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": "23f9dd7ca... |
5e8fd1cc-ccdb-45cb-9038-08bc411e9f8a | LLNL/SAMRAI | source/test/applications/Stencil/main.cpp | /*************************************************************************
*
* This file is part of the SAMRAI distribution. For full copyright
* information, see COPYRIGHT and COPYING.LESSER.
*
* Copyright: (c) 1997-2016 Lawrence Livermore National Security, LLC
* Description: Main program for SAMRAI Line... | ALGO | 0.995574 | 4.909101 | {
"github_metadata": {
"branch": "develop",
"commit_count": 3371,
"repo_created_at": "2016-03-03T22:02:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 232,
"forks": 84,
"issues": 51,
"pull_requests": 6
},
"file_meta": {
"content_id": "bd4... |
5491f8bf-8ed5-4e8f-a754-4244d2812457 | progresivoJS/LeetCode | 576. Out of Boundary Paths/better-iterative.cpp | // Time : O(m * n * N)
// Space : O(m * n)
class Solution {
private:
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int M = 1e9 + 7;
public:
int findPaths(int m, int n, int N, int i, int j) {
vector<vector<int> > dp(m, vector<int>(n));
for (int k = 1; k <= ... | ALGO | 0.999959 | 5.847728 | {
"github_metadata": {
"branch": "master",
"commit_count": 165,
"repo_created_at": "2017-11-28T11:34:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "337af7f3... |
3fdabe21-885e-4ade-84ec-6065e5cf5606 | rayyan21d/dsa | 6-Arrays/Med/NextPermutation.cpp | /*
A permutation of an array of integers is an arrangement of its members into a sequence or linear order.
For example, for arr = [1,2,3],
the following are all the permutations of arr:
[1,2,3], [1,3,2], [2, 1, 3], [2, 3, 1], [3,1,2], [3,2,1].
The next permutation of an array of integers is the next lexicographically... | ALGO | 0.999997 | 6.226444 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-08-22T18:53: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": "7d0b32b35f5e... |
ff6694aa-508b-473e-982e-7bcbd63e5472 | zzalscv2/FFEA | src/mat_vec_fns_II.cpp | //
// This file is part of the FFEA simulation package
//
// Copyright (c) by the Theory and Development FFEA teams,
// as they appear in the README.md file.
//
// FFEA 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 ... | ALGO | 0.998856 | 4.906693 | {
"github_metadata": {
"branch": "master",
"commit_count": 2443,
"repo_created_at": "2021-04-08T11:52:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "03e3820... |
aaee62cf-c281-4a6a-9476-b0bf9200a5fe | MethodJiao/OCCGraphicDemo | OpenCASCADE/math_BracketMinimum.hxx | // Created on: 1991-05-14
// Created by: <NAME>
// Copyright (c) 1991-1999 <NAME>
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Pu... | ALGO | 0.999838 | 6.675021 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-01-04T03:52:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 39,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a396f374... |
38379eb0-c1d5-4c86-94ea-64a730cf3dfb | bluster980/Leetcode-Solutions | 0129-sum-root-to-leaf-numbers/0129-sum-root-to-leaf-numbers.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999914 | 5.359209 | {
"github_metadata": {
"branch": "main",
"commit_count": 5319,
"repo_created_at": "2022-10-08T07:58:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5292bceea... |
32bacc33-4977-4a3e-9fa6-3d1abf2b1b35 | s-edupuganti/HACK-Assembler-Disassembler | Disassembler.cpp | #include <iostream>
#include <string>
#include <unordered_map>
#include <algorithm>
#include <bitset>
#include <vector>
#include <sstream>
using namespace std;
void toDecimal(string &str) {
int number;
string num;
bitset<16> binaryBitset(str);
number = (int)(binaryBitset.to_ulong());
num = to... | ALGO | 0.998981 | 3.554543 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-09-19T05:47: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": "2b2c5b006d9e... |
6a5d0f6a-68ed-42e2-99f6-b528a9b498de | Kumar-laxmi/Algorithms | C++/Greedy-Algorithm/Activity_process.cpp | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
int n;
cin>>n;
int s,e;
vector<pair<int,int>>activity;//Pair of end time,start time is inserted into vector
for(int i=0;i<n;i++)
{
cin>>s>>e;//Input start time and end time
activity.push_bac... | ALGO | 0.999982 | 4.289393 | {
"github_metadata": {
"branch": "main",
"commit_count": 2265,
"repo_created_at": "2022-10-23T02:05:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 338,
"forks": 364,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75292... |
18895f8e-c842-4c8d-87ef-77d1580f65ae | rsln-s/aggregative-coarsening-for-multilevel-hypergraph-partitioning | packages/claps/src/preconditioners/sparse_lu.cpp | //@HEADER
// ************************************************************************
//
// Claps: A Collection of Domain Decomposition Preconditioners
// and Solvers
// Copyright (2006) Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// licens... | ALGO | 0.999746 | 4.950994 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-04-04T20:05:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a85c85af79... |
e48a46f8-781e-4271-a4f4-2d1f47623978 | raincross7/code-similarity | codes/train_code/problem360/problem360_312.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
// Welcome to my source code!
// わけわからん
const int INF = 1001001001;
int main() {
int n;
cin >> n;
P red[n], blue[n];
for (int i = 0, a, b; i < n; i++) {
cin >> a >> b;
red[i] = { a, b };
}... | ALGO | 0.99952 | 4.019914 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "29191ba73181... |
f1e356d8-7b2e-4ea7-88d2-8d5829935c6a | ustcyyw/algorithm | leetcode/easy/tree/leafSimilar.cpp | /**
* @Time : 2022/4/26-11:16 AM
* @Author : <EMAIL>
* @E-mail : <EMAIL>
* @Github : https://github.com/ustcyyw
* @desc :
*/
#include<bits/stdc++.h>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNod... | ALGO | 0.999647 | 5.3408 | {
"github_metadata": {
"branch": "main",
"commit_count": 162,
"repo_created_at": "2024-11-11T07:09:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "21a878c3d8... |
7021d9ec-d25c-481f-849a-4afe0b40d194 | LogiCule/LeetCode | Medium/1004_Max_Consecutive_Ones_III.cpp | /*
Links:
https://practice.geeksforgeeks.org/problems/maximize-number-of-1s0905/1
https://leetcode.com/problems/max-consecutive-ones-iii/
Brute Force:
We can start the answer subarray from each index and go on till we get allones or atmost k 0's
and get the max of those
Two Pointer Approach:
We maintain a window and ... | ALGO | 0.999988 | 5.402771 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2022-07-05T07:15: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": "5a57eeaaeae... |
236998b9-ad97-4141-8174-d2f0dbe9a5c7 | FreeCX/bunch-of-code | other/find-a-cat/find_a_cat_v2.cpp | #include <iostream>
#include <limits>
#include <string>
#include "xorshift.hpp"
const uint32_t ascii_max = 255;
const char c_symb = 'c';
bool is_cat(uint32_t c, uint32_t a, uint32_t t) {
return char(c % ascii_max) == c_symb and char(a % ascii_max) == 'a' and char(t % ascii_max) == 't';
}
uint32_t n_vals(uint32_... | ALGO | 0.997531 | 3.512504 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2020-10-12T21:00:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee49a0fc2... |
16be34f4-17e2-4a54-ab50-c65304cfe8ca | crypto-annihilator/Array | basic_lavel/15.cpp | #include <iostream>
void sort_decreasing(double* arr, int index, int size)
{
double key;
int j;
for (int i = index + 1; i < size; ++i) {
j = i - 1;
key = arr[i];
while (j >= index && arr[j] < key) {
arr[j + 1] = arr[j];
--j;
}
arr[j + 1] = key... | ALGO | 0.999859 | 4.975529 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-07-19T15:19: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": "defb6208f9... |
3b7b1490-9c5f-4016-a74b-655d31ad579e | adnanaziz/EPIJudge | epi_judge_cpp_solutions/matrix_connected_regions.cc | #include <deque>
#include <initializer_list>
#include <queue>
#include <utility>
#include <vector>
#include "test_framework/generic_test.h"
#include "test_framework/timed_executor.h"
using std::deque;
using std::initializer_list;
using std::pair;
using std::queue;
using std::vector;
void FlipColor(int x, int y, vect... | ALGO | 0.997509 | 6.629344 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2017-12-21T06:15:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2874,
"forks": 1899,
"issues": 47,
"pull_requests": 33
},
"file_meta": {
"content_id": "... |
c7da8801-e7d3-4ca2-b5d9-4ba916255fc5 | weshoke/ofxOpenVDB | libs/OpenVDB/openvdb/tree/Util.h | ///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2012-2013 DreamWorks Animation LLC
//
// All rights reserved. This software is distributed under the
// Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
//
// Redistributions of source code must retain the abov... | ALGO | 0.954183 | 4.054783 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2014-06-03T04:47:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "16a259f9d... |
9cf881a3-ef5b-4b16-abf6-e6e3ba7ada15 | MiguelGil1/lab_1 | ejercicio_24/main.cpp | /*
. Escriba un programa que pida una número entero e imprima un cuadrado de dicho
tamaño, los bordes del cuadrado deben estar hechos con el carácter `+' y el interior debe estar vacío.
Ej: si se ingresa 4 se debe imprimir:
++++
+ +
+ +
++++
*/
#include <iostream>
using namespace std;
int main()
{
int n;
s... | ALGO | 0.999751 | 4.553236 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2021-03-16T00:29: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": "5f921133e... |
5bc5e9b1-582a-4e2a-b401-fe4e17e36c43 | Chrisstuv/Cpp_Primer_Plus | carrot.cpp | // C++ Primer Plus 第二章第二节笔记及代码 -- 2020/11/29
// carrot.cpp -- food processing program
// uses and displays a variable
// getinfo.cpp -- input and output
#include <iostream>
using namespace std;
int main()
{
int carrots; // 定义申明(defining declaration)或引用申明(reference declaration):为变量分配内存空间 -- declare an ... | TOOL | 0.958009 | 3.502381 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2020-12-20T02:40:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "968736f8f17... |
7a67a6db-c7c9-4488-b90e-960b27744b58 | Nezz7/Competitive-programming | Codeforces/#594 (Div. 2)/A.cpp | #include <bits/stdc++.h>
#define f first
#define s second
#define endl '\n'
#define LL long long
#define LD long double
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define debug(x) cerr << #x << " is " << x << endl;
using namespace std;
int const... | ALGO | 0.999921 | 3.874637 | {
"github_metadata": {
"branch": "master",
"commit_count": 110,
"repo_created_at": "2020-02-03T14:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b2eaca61... |
91536648-885d-4441-b46f-41c385b8e703 | h33p/m0dular | utils/intersect_box.h | #ifndef INTERSECT_BOX_H
#define INTERSECT_BOX_H
#include "../math/mmath.h"
struct AABBCollider
{
vec3_t start, end;
AABBCollider(vec3_t s, vec3_t e)
: start(s), end(e) {}
bool Intersect(vec3_t a, vec3_t b, vec3_t* out = nullptr);
template<size_t Y>
uint64_t IntersectSOA(const vec3soa<float, Y>& __restrict a,... | ALGO | 0.907913 | 7.271602 | {
"github_metadata": {
"branch": "master",
"commit_count": 125,
"repo_created_at": "2018-05-15T15:56:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e3872d... |
3e3c3ad2-078b-4d79-b140-1d3c2842c8cc | bianzheng123/Hierarchical-Navigable-Small-World | src/distance.hpp |
namespace MultipleHNSW {
class distance_cmp{
public:
long distance_;
int label_;
int idx_;
distance_cmp(int distance, int label, int idx): distance_(distance), label_(label), idx_(idx){}
distance_cmp(){
distance_ = 0;
label_ = 0;
idx_... | ALGO | 0.999641 | 3.818651 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-03-25T05:00:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fef6b5a0e8af... |
d71cf493-18ff-49b1-a7aa-04c3e55b5a8a | HCMY/InteletTree | Leetcode/Stack/Medium/MinimumAddtoMakeParenthesesValid.cc | /**
Given a string S of '(' and ')' parentheses, we add the minimum number of parentheses ( '(' or ')', and in any positions ) so that the resulting parentheses string is valid.
Formally, a parentheses string is valid if and only if:
It is the empty string, or
It can be written as AB (A concatenated with B), where A ... | ALGO | 0.998897 | 5.37374 | {
"github_metadata": {
"branch": "master",
"commit_count": 105,
"repo_created_at": "2019-09-05T11:11:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "221f656c... |
a786d94c-666f-4d97-9261-98a0ff218562 | kks227/BOJ | 2600/2679.cpp | #include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
const int INF = 1e9;
int N, M, S, E, c[1000][1000], f[1000][1000], dp[1000];
vector<int> adj[1000];
int onePath(int curr){
int &ret = dp[curr];
if(ret != -1) return ret;
if(curr == E) return ret = INF;... | ALGO | 0.9999 | 3.978953 | {
"github_metadata": {
"branch": "master",
"commit_count": 531,
"repo_created_at": "2016-07-26T12:54:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 66,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f907642... |
72618b3f-d5a5-4fb4-bc56-05e5b7e0ccfe | TaoSama/ICPC-Code-Library | OJ - Lightoj/1038.cpp | //
// Created by TaoSama on 2015-11-13
// Copyright (c) 2015 TaoSama. All rights reserved.
//
//#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
... | ALGO | 0.999479 | 4.040647 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2016-03-24T05:56: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": "ca716347... |
ce5331c1-654e-438c-9851-761e3e0ca031 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/05/0528/personal_submission/cf869c_md.cpp | // 0528
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
constexpr int MOD = 998244353;
constexpr int MX = 5001;
i64 q_pow(i64 x, int n) {
i64 res = 1;
for (; n > 0; n /= 2) {
if (n % 2) {
res = res * x % MOD;
}
x = x * x % MOD;
}
return res;
}
... | ALGO | 0.999984 | 5.877742 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "d1dc... |
ffc4cdae-6927-494b-8175-a7284f1d3c56 | ML-UCV/ML-CodeBert-DistinctSolutions | Raw Dataset/dmin/djikstra/train/19c55a3d-02b7-11ec-85d8-2cf05d84bfc2.cpp | #include <cstdio>
#include <algorithm>
#include <queue>
#include <cstring>
#include <iostream>
#include <cmath>
using namespace std;
const int NMAX = 1507;
const int INF = 10000000000;
const int Mod = 104659;
const double EPS = 0.00000000001;
priority_queue< pair< double, int > > q;
double D[NMAX];
int... | ALGO | 0.999927 | 3.302405 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-03-06T17:44:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0957dc40bdde9... |
d9d55f2a-05e8-4a3f-aa07-ee348b368478 | BillJJ/DMOJ | dmoj.ca-downloaded-submissions/Misc/lazy.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MM = 1e5+5;
ll a[MM], seg[MM*4], lazy[MM*4];
bool mark[MM*4];
void pushup(int i){
seg[i] = min(seg[i*2], seg[i*2+1]);
}
void pushdown(int i){
// add
seg[i*2] += lazy[i], lazy[i*2] += lazy[i];
seg[... | ALGO | 0.99998 | 6.013544 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2021-08-09T18:22: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": "5a52a3578... |
d68b3962-655d-409c-8585-3564b9ace3f4 | alexandraback/datacollection | solutions_5752104073297920_0/C++/Murat/main.cpp | #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <cassert>
#include <memory.h>
#include <ctype.h>
#include <iostream>
#include <string>
#include <complex>
#include <numeric>
#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#inc... | ALGO | 0.9893 | 3.688473 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f68bfe7e4... |
5880dd6b-63c1-43bf-bcc3-c7f04bda5fe2 | CrazyLavendar/coding | DSA/003.Map/001.map.c++ | #include<iostream>
#include<map>
using namespace std;
int main(){
map<string , int> m;
m["A"] = 1;
m["B"] = 2;
bool exits = (m.find("AA") != m.end())? true : false;
cout << exits << endl;
exits = (m.find("A") != m.end())? true : false;
cout << exits << endl;
exits = (m.find("... | ALGO | 0.967091 | 3.995155 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-02-18T18:09: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": "3d5032f2c318... |
fbdaf2d8-90c4-4f79-a725-d90e6049d2aa | Akhil404/CNS-Lab | cnslab-master/priyam/des.cpp | #include <bits/stdc++.h>
using namespace std;
unsigned long int l,r,kl,kr;
unsigned long int lkey[16],rkey[16],subkey[16];
int pc1[56] = {
1,2,3,4,5,6,7,9,10,11,12,13,14,15,
17,18,19,20,21,22,23,25,26,27,28,29,30,
31,33,34,35,36,37,38,39,41,42,43,44,45,
46,47,49,50,51,52,53,54,55,57,58,59,60,61,
62,63
};
int pc... | ALGO | 0.999888 | 3.485675 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-11-09T08:32:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec2f05352a... |
1678ad82-54af-44cc-9f43-68112d5dafe4 | HhTtLllL/algorithm | hdu/1050-2.cpp | #include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
struct node
{
int start;
int end;
};
struct node a[205];
/*int cmp(struct node a,struct node b)
{
return a.end < b.end;
}*/
int cmp(struct node a,struct node b)
{
//if(a.end != b.end)
{
return a.end < b.end;
}
//else
{
// return a... | ALGO | 0.999819 | 3.114217 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2019-08-21T10:40:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8230ffc2... |
029117ab-c2ed-4a6b-8894-ef8764bfccf0 | SlimShadys/RobotProgramming | Exercises/10 - ROS and Rviz/CPP/rp_10_scan_matcher/src/scan_matcher/include/icp/eigen_icp_2d.h | #pragma once
#include "Eigen/Geometry"
#include "eigen_kdtree.h"
using Vector2f = Eigen::Vector2f;
class ICP {
protected:
struct PointPair {
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
PointPair(const Vector2f& fixed_, const Vector2f& moving_)
: _fixed(fixed_), _moving(moving_){};
PointPair() {}
Vecto... | ALGO | 0.962377 | 6.676951 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2022-10-05T18:11: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": "43660da54... |
7a519adb-a97d-41c4-88c9-e253b219aa3a | kookjd7759/Algorithm | 백준/Bronze/31923. 마라탕후루/마라탕후루.cc | #include <bits/stdc++.h>
#define Sync ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)
#define Fixed(x) cout << fixed; cout.precision(x)
#define Interactive cin.tie(0)->sync_with_stdio(0)
#define ll long long
#define spc << " " <<
#define endl << "\n"
#define ent cout << "\n"
#define out cout <<
#d... | ALGO | 0.999987 | 3.026204 | {
"github_metadata": {
"branch": "main",
"commit_count": 2962,
"repo_created_at": "2023-08-07T12:27: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": "bd10f9c99... |
1cdf5c6a-6d41-4184-aa22-47682e76723b | santosh-sambhavani/DSA | linked-list/sum-2-nums-as-LL.cpp | /*
* The catch of the problem is to reverse both linked lists to traverse it in to reverse order
* as we can't move in reverse as arrays
*/
#include <bits/stdc++.h>
using namespace std;
/* Linked list Node */
struct Node {
int data;
struct Node* next;
Node(int x) {
data = x;
next = NULL;
... | ALGO | 0.999989 | 4.466506 | {
"github_metadata": {
"branch": "main",
"commit_count": 270,
"repo_created_at": "2021-08-06T06:32:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "53d9521501... |
2bb85d64-d981-4245-b723-b6c167c96f49 | anirudhagaikwad/CPP_Programming | Programs/55-58/two.cpp | /*
Implement a base class "Shape" with two derived classes "Circle" and "Rectangle."
Calculate and display the area of a circle and rectangle using single inheritance.
Input: Circle circle(5.0)
Output:Area of Circle: 78.5
Input: Rectangle rectangle(4.0, 6.0)
Output: Area of Rectangle: 24
*/
#include <iostream>
#inc... | TOOL | 0.994564 | 6.156862 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-07-26T04:22:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "912c32cbbde5... |
d4743e71-5b8c-4ed9-86d3-78a0a6519c04 | s-kachroo/SamsungPractice | sinkhole.cpp | /*
https://www.geeksforgeeks.org/samsung-competency-test-25-aug-19/
*/
/*
----IIT(ISM) Dhanbad----
Author: <NAME>
--samsumg coding test--
Q.There is a large plot with various sinkholes present.
Since one sinkhole can combine with another sinkhole, it is required to get
at most one sinkhole while occupying th... | ALGO | 0.999831 | 3.769192 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-08-07T11:02:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 427,
"forks": 184,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "7775a... |
62e2570c-97ff-4172-b052-cf046d006004 | bernaahad1/Data-Structures-And-Algorithms-FMI | homeworks/hw03/task03.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int findNumOfLongestSubs(vector<unsigned int> arr){
int size = arr.size();
vector<unsigned int> count;
count.push_back(arr[0]);
for (int i = 1; i < size; ... | ALGO | 0.999952 | 3.964114 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2022-02-01T08:38: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": "9ab47f8f5b7... |
6c2d2b71-fd43-438b-bef5-b43d5b034406 | Suba-Varshini/cplusplus_programs | avl2.h | #include<iostream>
#include<cstdlib>
#include<math.h>
#include "avls.h"
using namespace std;
template<class T>
AVL<T>::AVL()
{
root = NULL;
}
template<class T>
void AVL<T>::insert(const T &x)
{
insert1(x, root);
}
template<class T>
void AVL<T>::display()
{
print(root);
}
template<class T>
int AVL<T>::height (node ... | ALGO | 0.998107 | 3.088974 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-06-14T07:14: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": "cd8b966a6561... |
7e4d6906-d4fc-4696-8323-ad255100175e | Liam-Stevens/University-SVN | 2019/s1/adds/assignment8/main.cpp | #include "Sort.h"
#include "BubbleSort.h"
#include "QuickSort.h"
#include "RecursiveBinarySearch.h"
#include <iostream>
#include <vector>
using namespace std;
int main() {
//Takes inputs
int line;
int input[100];
int inc = 0;
do {
cin >> line;
input[inc] = line;
inc++;
}
//Will continue to take... | ALGO | 0.999931 | 4.401303 | {
"github_metadata": {
"branch": "master",
"commit_count": 810,
"repo_created_at": "2021-03-31T10:45:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "28b5c8f0... |
566d2ff3-f4b6-4d4a-8dad-6affb0ff8c1b | volrath/Inteligencia | gabil/gabil.h | #include <sys/stat.h>
#include <fstream>
#include <time.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#define POP_SIZE 200
#define RULES_PER_DNA 5
#define RULE_LENGTH 124
#define NUM_ATTRS_P1 6
#define NUM_ATTRS_P2 6
#define SELE... | ALGO | 0.999554 | 3.09301 | {
"github_metadata": {
"branch": "master",
"commit_count": 259,
"repo_created_at": "2009-05-06T23:40:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b29ce92a... |
faa09306-af1c-492e-8317-bab708f26616 | sy9777m/algorithm-tutoring | prime_number.cpp | #include <iostream>
int main() {
int num[1000];
int i = 0;
for (i = 0; i < 1000; ++i) {
num[i] = i + 2;
}
int length = (int)(sizeof(num) / sizeof(int));
bool isPrime[length];
for (i = 0; i < length; ++i) {
for (int j = 0; j < length; ++j) {
if (num[i] % num[j] ... | ALGO | 0.999878 | 4.331726 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-10-06T01:27:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2de563df1b... |
4ae06324-653e-46fb-aa0a-997a332088d0 | puffffy-AFK/MEPHI | sem3/lab3/Histogram.cpp | #include <iostream>
#include <vector>
#include <functional>
#include <string>
#include <random>
#include <sstream>
#include <map>
#include "CustomHashTable.hpp"
using namespace std;
template<typename T, typename K>
class Histogram {
private:
string criteriaName;
K rangeStart;
K rangeEnd;
K rangeStep... | TOOL | 0.966748 | 5.818143 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-04-11T15:12: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": "4dc84a1893c... |
71756ab9-9e6a-40c5-ae0a-0485bc842a28 | roiti46/Contest | 2013/tdpc/b.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<typename T> using Graph = vector<vector<T>>;
#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, a) REP(i, 0, a)
#define EACH(i, a) for (auto i: a)
#define ITR(x, a) for (__typeof(a.begin()) x = a.begin(); x != a.end... | ALGO | 0.999968 | 3.442468 | {
"github_metadata": {
"branch": "master",
"commit_count": 116,
"repo_created_at": "2015-05-25T09:41: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": "3751dad6... |
285f5b85-e7a3-4638-b80a-ee8e23384187 | Sarthak-rasal/Cpp-with_DSA | 21 Patterns/2_Numeric_hollow_pyra.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cout << "Enter a number ";
cin >> n;
for (int row = 0; row < n; row = row + 1)
{
// Triangle NO 1
// Triangle with spaces
for (int col = 0; col < n - row - 1; col = col + 1)
{
cout << " ";
... | ALGO | 0.999813 | 4.082934 | {
"github_metadata": {
"branch": "main",
"commit_count": 83,
"repo_created_at": "2024-12-08T17:54: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": "3d387698d2c... |
c18ebdc2-bb66-49ea-bef5-0baf876f7457 | lunarblade99/Demon | Adding_Squares.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define vi vector<int>
#define MOD 1000000007
#define setbits(x) __builtin_popcountll(x)
ll lop = 1;
ll square(ll n, ll m, ll x[], ll y[])
{
unordered_map<ll, ll> d1, d2;
for (ll i = 0; i < n; i++)
{
for (ll j = i + 1; j < n; j... | ALGO | 0.999975 | 3.344068 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-08-21T10:29: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": "130008c8bc... |
aec753c8-b5dc-47e3-ba7e-2a8c34531b77 | shashwat0105/CPP-Data-Structures-and-Algorithms | 06 (Recursion and Backtracking)/Practice Problems/14) printN-bitBinaryNumbersHavingMore1Than0.cpp | https://practice.geeksforgeeks.org/problems/print-n-bit-binary-numbers-having-more-1s-than-0s0252/1/
// Thought process is similar to previous ques
#1's >= #0's (Legal Prefix)
Use wired headset to hear
https://youtu.be/U81n0UYtk98 (<NAME>)
Start mein 1 hi rakhna padega
Also,
Choice for 1 is always available (As s... | ALGO | 0.999959 | 5.817069 | {
"github_metadata": {
"branch": "master",
"commit_count": 225,
"repo_created_at": "2021-01-23T10:22:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "a9483843... |
cd4e9edd-c4fb-4837-9ea6-1243f7d88ca8 | Shantanuv19/Data-structure | DS_code/LInked_List/Circular.cpp | //Circular
#include<iostream>
#include<stdlib.h>
using namespace std;
struct node{
int data;
struct node *next, *pre;
};
typedef struct node structure;
structure *head=NULL, *newnode=NULL, *temp=NULL;
void insert_f(int *data){
++(*data);
newnode=new structure;
cout<<"Enter data for node: ";
cin>>newnode->data;
n... | ALGO | 0.998906 | 3.580382 | {
"github_metadata": {
"branch": "main",
"commit_count": 145,
"repo_created_at": "2022-01-10T17:37: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": "3eb77aec69... |
67f0e930-8714-4c48-80f1-cfe4ffd5a0df | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Mixtral/top0-100/palindromePartition-Solution.partition/177750_DoS_Exec_Code.cpp | begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
{
pdf_gstate *gstate = pr->gstate + pr->gtop;
pdf_xobject *softmask = gstate->softmask;
fz_rect mask_bbox;
fz_matrix tos_save[2], save_ctm;
fz_matrix mask_matrix;
fz_colorspace *mask_colorspace;
save->softmask = softmask;
if (softmask ... | TOOL | 0.95838 | 4.945151 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-03-22T14:39:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d8f020fcfb9... |
84f29d80-960c-48ef-8c27-3a2bd2d4cdf0 | antleeon/antleeon-secret-santa | generation/hasher.cpp | #pragma once
#include <algorithm>
#include <string>
#include <vector>
class Hasher {
public:
static size_t Hash(const std::string& string) {
std::vector<size_t> as_numbers;
for (const auto& symb : string) {
as_numbers.push_back(symb);
}
return Hash(as_numbers);
}
static size_t Hash(std::v... | ALGO | 0.997652 | 6.804177 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-12-02T21:25: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": "adca8106c97b... |
857331ad-db28-4084-a1ed-3c75723d3f37 | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/allpro_train/0_0_9670.cpp | #include <iostream>
#include <vector>
int main() {
int n, m;
std::cin >> n >> m;
std::vector<int> permutation(n);
for (int i = 0; i < n; i++) {
std::cin >> permutation[i];
}
for (int i = 0; i < m; i++) {
int l, r, x;
std::cin >> l >> r >> x;
int target... | ALGO | 0.999999 | 5.259042 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-04-28T03:59: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": "4dcb981996d... |
efd572ac-18fc-43e9-919a-c28bacee1219 | hitoshishinso/Programs | idiot.cpp | /*Created By Hitoshi (<NAME>) Date : October 2018 :: 9:14 AM :: Windows Operating System*/
#include <bits/stdc++.h>
#define MAX 222222
#define lim 1000000007
#define ll long long
#define SQRT 1060
#define sci(a) scanf("%d", &a)
#define scl(a) scanf("%lld", &a)
#define pfi(a) printf("%d\n", a)
#define pfl(a) printf("%l... | ALGO | 0.999662 | 3.834385 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-11-09T05:37: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": "0bc654b473... |
39db2be5-a807-48f5-a389-c49f7898da69 | AlanYume/ACM-ICPC | code/poj/2046.cpp | /********* hash + BFS ************/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <set>
#include <queue>
using namespace std;
typedef long long ll;
const int MOD = 100000007;
const int kMaxN = 4;
const int kMaxM = 8;
struct State{
int step;
pair<int, int> space[kMaxN];
int num... | ALGO | 0.999812 | 3.719333 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2015-08-15T02:24:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 26,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6830a8... |
2894ea87-ea13-4338-97f1-5df67a766c79 | andweller/algorithms | Sorting/Sorting/quicksort.h | /*
File: quicksort.h
Quick Sort Implementation
Example:
const int length = 5;
int data[length] = { 3, 9, 7, 2, 1 }
quick_sort(data, length);
Result: data is now equal to { 1, 2, 3, 7, 9 }
*/
/* The MIT License(MIT)
Copyright(c) 2015 andweller
Permission is hereby granted, free of charge, to an... | ALGO | 0.999961 | 5.69039 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2015-02-19T20:00: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": "12c0824b5... |
975ab38f-8183-441b-a23b-52c1f232f799 | vivekcrox/DSA_codes | 15-Graphs/graphsTUF/01-graphImplem.cpp | #include<iostream>
using namespace std;
int main(){
// 1. Adj Matrix
//
int n, e;
cin>>n>>e;
vector<vector<int>> adj(n, vector<int>(n,0));
for(int i=0; i<e; i++){
int u, v;
cin>>u>>v;
adj[u][v] = 1; // In case of weighted graph, store the weight instead of ... | ALGO | 0.999938 | 5.152705 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2023-10-03T06:33:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6a6b413ec7... |
91d748db-f5e2-4091-a4d1-a405afabe474 | Aadarsh-Rupam-Arya/Codes | CPP/C++ in Class/Unit4/operator overloading/Unary_operators.cpp | // // #include<iostream>
// // #include<string.h>
// // #include<fstream>
// // using namespace std;
// // class Number{
// // int x , y;
// // public :
// // Number(int a , int b ){
// // x = a ;
// // y = b ;
// // }
// // void operator-(){
// // x = -x;
/... | ALGO | 0.934498 | 3.973239 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-09-14T15:04: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": "e063a0495bb7... |
67fe26e2-7dc8-4945-b9f4-afa5d89f43f2 | SamiMB22/Some-C-I-think | school work/tp8/exo.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
int n, nbr;
struct Date
{
int day;
int month;
int year;
};
struct municipality
{
string name;
Date CreationDate;
int SurfaceArea;
int Population;
};
cout << "E... | TOOL | 0.972528 | 3.54721 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-11-22T22:10:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "54bc18fc9fc0... |
9a7ddefb-18b8-45e7-ba33-54c50169d5e1 | Azruine/cpp-PS | src/solved/programmers/주식가격.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <climits>
using namespace std;
class Seg
{
private:
std::vector<int> data;
int size;
public:
Seg(){}
Seg(int n)
{
size = n;
data.assign(size << 1, INT_MAX);
}
void init(std::vector<int> v)
{
std:... | ALGO | 0.999926 | 5.184169 | {
"github_metadata": {
"branch": "main",
"commit_count": 152,
"repo_created_at": "2024-12-31T04:51:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7023b62f57... |
279c6078-9915-440a-8854-1aa4ccb416ea | AC2-K/Solutions | Main/ABC283/D.cpp | #include<bits/stdc++.h>
using namespace std;
//cout << fixed << setprecision(10);
#define rep(i, N) for(int i=0;i<(N);i++)
#define all(x) (x).begin(),(x).end()
#define popcount(x) __builtin_popcount(x)
using ll = long long;
using ld = long double;
using graph = vector<vector<int>>;
using P = pair<int, int>;
const int ... | ALGO | 0.999981 | 3.907669 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2023-01-17T14:36: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": "114ea8b9f... |
9de7b343-e045-4b33-b07a-968a3eb2d56d | lge88/kb | lc/216-combination-sum-iii/combination-sum-iii.cc | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <iterator>
#include <algorithm>
using namespace std;
class Solution {
public:
void combinationSum3Helper(
int k,
int n,
... | ALGO | 0.999594 | 5.953127 | {
"github_metadata": {
"branch": "master",
"commit_count": 211,
"repo_created_at": "2016-09-01T06:48:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8a90360... |
917d6e87-d615-4a38-b944-4097004732e3 | AniruddhSharma23/LeetCode-Solutions | Count Complete Tree Nodes.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999853 | 6.320374 | {
"github_metadata": {
"branch": "main",
"commit_count": 85,
"repo_created_at": "2022-03-26T08:50: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": "24ec0eb701a... |
ef33cf56-4315-4fe7-9d19-a9ecf557026f | edisonhello/OnlineJudge | CodeForces/609f.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int maxn = 2e5 + 10, inf = 1e9 + 1;
int n, m, a[maxn], b[maxn];
pair<pair<int, int>, int> f[maxn];
pair<int, int> mos[maxn];
struct SegmentTree {
#define M ((L + R) >> 1)
static SegmentTree mem[2000000];
static SegmentTree *ptr;
Seg... | ALGO | 0.999983 | 3.790186 | {
"github_metadata": {
"branch": "master",
"commit_count": 151,
"repo_created_at": "2017-11-03T13:41: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": "79a506b2... |
2de7d6c1-d030-4c89-87ac-9fb748e1d1e7 | akaliyas/main-group | 队列/代码和头文件/LQueue/QG_queue_main.cpp | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include"../head/LQueue.h">
typedef struct node
{
void *data; //数据域指针
struct node *next; //指向当前结点的下一结点
} Node;
typedef struct Lqueue
{
Node *front; //队头
Node *rear; //队尾
size_t ... | TOOL | 0.950858 | 3.014279 | {
"github_metadata": {
"branch": "week_1",
"commit_count": 13,
"repo_created_at": "2023-03-19T11:24: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": "c74a41dd5... |
16c56a27-a46a-4b0a-a228-68afcd1fb4f8 | salman0H/Improved-Binary-Converter | main.cpp | #include <iostream>
#include <math.h>
#include <fstream>
using namespace std;
int bianry_to_decimal(int n,bool bit[])
{
int number = 0,up = 0;
for(int i=n-1;i >= 0;i--)
{
if(bit[i])
{
number += pow(2,up);
}
up++;
}
... | ALGO | 0.998684 | 3.961782 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-12-11T07:17:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3dd9899c2d33... |
3a17989f-3226-4b49-9900-753654151038 | egartner/MR-maze-exploration | applicationsBin/MRMaze/mazegen/mazegen.h | #include <cstdio>
#include <cstdlib>
#include <vector>
using namespace std;
class Cell;
class Wall;
class Maze;
class pMaze;
class Cell{
friend class Maze;
friend class bMaze;
friend class pMaze;
int x, y;
public:
Cell(){x=0; y=0;};
Cell(int _x, int _y){x=_x; y=_y;};
~Cell();
bool inRange(Maze *maze);
int ge... | ALGO | 0.994064 | 3.735658 | {
"github_metadata": {
"branch": "master",
"commit_count": 794,
"repo_created_at": "2016-12-09T03:59: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": "b10cfaeb... |
f61e3090-56a2-4a0c-95f9-2bf8b2665177 | Soubhik752blaze/DSA | Queues/firstnegativeinwindowk.cpp | //Question :- Find the first negative element in every window of size k in a array
#include<bits/stdc++.h>
using namespace std;
vector<int> ans(vector<int> nums, int k)
{
int n = nums.size();
deque<int> dq;
vector<int> ans;
for (int i = 0; i < k; i++){
// inserting all negative elements' index i... | ALGO | 0.999991 | 5.176878 | {
"github_metadata": {
"branch": "main",
"commit_count": 372,
"repo_created_at": "2022-04-13T10:53:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02f3b6fc7f... |
7e997bb0-fc1f-4829-ba5b-7fdf525ed6a2 | M-Arimase/School-Project | home/arimase/Desktop/数据结构与算法/OpenJudge/Week8/2.cpp | #include <functional>
#include <iostream>
#include <algorithm>
using namespace std;
const int MAXN = 100010;
struct Edge {
int u, v, w;
} e[MAXN];
char BUF[MAXN];
int CNT, fa[MAXN];
int main() {
int n;
cin >> n;
for (int i = 1, u, v; i < n; i++) {
cin >> BUF;
... | ALGO | 0.999421 | 3.654696 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2017-04-06T13:58: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": "fc7728720... |
76f8e2c7-27bb-45aa-ba32-f53d05d5eb1d | adkafka/RocksDB-TSX | libtsx.cpp | #include <pthread.h> //Get paramteter types
#include <string.h> //memset
#include <stdio.h> //printf
#include <time.h> //Timespec param
#include <unistd.h> //syscall
#include <sys/syscall.h> //syscall names
#include <linux/futex.h> //futex
#include <limits.h> //INT_MAX
#include <condition_variable> //condvar class
#in... | TOOL | 0.909561 | 6.633045 | {
"github_metadata": {
"branch": "master",
"commit_count": 103,
"repo_created_at": "2017-03-27T19:42:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75f3686e... |
4ea67952-d378-4b4c-acd8-b3a9dab9d420 | OmarShamkh/competitive-programming-practise | CodeForces/29C/30526414_AC_592ms_15112kB.cpp | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef long long ll;
#define loop(n) for(int i = 0; i < (n); i++)
#define lp(x, s, e) for(int x = (s); x < (e); x++)
#define lpe(x, s, e) for(int x = (s); x <= (e); x++)
#define INGZzz cin.tie(0);cin.sync_with_stdio(0);
const int ... | ALGO | 0.999825 | 3.927289 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2021-06-23T08:56: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": "ca27146d477... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.