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 |
|---|---|---|---|---|---|---|---|
dd13a389-7d36-4c25-a7fe-a04c2e60cef9 | Coach-Academy/Winter-1-2023 | Level 3 Class 1/Practice G1/Week 01/Problem C.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 6;
// Tri-state visited => (0 => unvisited, 1 => stack, 2 => visited and out of stack)
int state[N], in_deg[N];
bool visited[N];
vector<int> g[N];
bool is_cyclic(int u) {
++state[u];
for (int v : g[u])
if (state[v] == 1 or (state[v] ==... | ALGO | 0.999949 | 4.538821 | {
"github_metadata": {
"branch": "main",
"commit_count": 669,
"repo_created_at": "2023-10-02T17:17:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b4b96c0b90... |
730cb574-ee21-482f-bdd0-4fe319e46b4f | KausikN/BTech_OS_Files | Assignments/Assignment_Threading/ExternalSort_Quick.cpp | #include <bits/stdc++.h>
using namespace std;
int arr[1000];
struct data
{
int beg;
int end;
};
int run_size;
struct MinHeapNode
{
int element;
int i;
};
void swap(MinHeapNode* x, MinHeapNode* y);
class MinHeap
{
MinHeapNode* harr;
int heap_size;
public:
MinHeap(MinH... | ALGO | 0.998601 | 4.118548 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2019-09-05T11:34:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab3d52707... |
353d5f91-5968-4569-bec2-a0831561624e | HowardChengUleth/Contest | kattis/prozor.cc | #include <bits/stdc++.h>
using namespace std;
char grid[100][100];
int csum[100][100];
int main()
{
int R, S, K;
cin >> R >> S >> K;
for (int i = 0; i < R; i++) {
for (int j = 0; j < S; j++) {
cin >> grid[i][j];
}
}
for (int i = 0; i < R; i++) {
for (int j = 0; j < S; j++) {
csum[... | ALGO | 0.999924 | 3.654949 | {
"github_metadata": {
"branch": "master",
"commit_count": 600,
"repo_created_at": "2020-05-11T16:38:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "95d7f0df... |
b79c2e76-9a6c-4cd3-a5a3-3598ed0a533d | sihuan/OpenJudge | QuestionAns/wfb/2054.cc | #include <iostream>
using namespace std;
class Data {
private:
int d_;
public:
Data() {d_=0; cout<<"Data's default constructor."<<endl;}
Data(int d) {d_=d; cout<<"Data "<<d<<" is created."<<endl;}
~Data() {cout<<"Data "<<d_<<" is erased."<<endl;}
int getValue() {return d_;}
void setValue(int ... | ALGO | 0.998573 | 3.67686 | {
"github_metadata": {
"branch": "master",
"commit_count": 121,
"repo_created_at": "2019-11-11T03:41:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 38,
"forks": 17,
"issues": 1,
"pull_requests": 3
},
"file_meta": {
"content_id": "141b16... |
5d6211e4-d307-4d34-9b6c-7ee130b1bc89 | savagecarol/c- | practice/div2practice4.cpp | /* code by savagecarol */
#include <bits/stdc++.h>
using namespace std;
/* predefined value */
#define yes() cout << "YES"
#define no() cout << "NO"
#define one() cout << "1"
#define zero() cout << "0"
#define ll long long int
#define mp make_pair
#define fi first
#define se second
#define pb push_back
/* loops */
#... | ALGO | 0.999921 | 3.565532 | {
"github_metadata": {
"branch": "master",
"commit_count": 213,
"repo_created_at": "2020-07-18T02:19:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74d1d01a... |
f13a793c-8f46-4c95-a10b-813b82dbd050 | ritikasrv12/DSA-LeetCode | Hard/Tree/Distribute coins in binary tree.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.999995 | 6.133941 | {
"github_metadata": {
"branch": "main",
"commit_count": 467,
"repo_created_at": "2023-03-08T18:26: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": "4cb014460e... |
b9caf4db-0826-4b6f-a0b7-6f67993950e7 | sainirajat/AdvanceAlgorithm | WorkingWithArrays/RamuNeedHelp.cpp | // problem link --> https://hack.codingblocks.com/contests/c/452/104
#include<iostream>
using namespace std;
int findMin(int n,int m){
if(n<m){
return n;
}
else{
return m;
}
}
int findMyCost(){
int c[4];
for(int i=0;i<4;i++){
cin>>c[i];
}
int n,m;
cin>... | ALGO | 0.998584 | 3.375601 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2018-06-09T18:44: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": "c3294c4b5... |
bcfb870e-017b-458e-9a71-23dfed1a8840 | Kuuo/PAT-Practise | Advanced Level/1124 - 1135/1128/main.cpp | #include <bits/stdc++.h>
using namespace std;
int k, n;
int board[1002][1002];
int isvalid(int n) {
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; j++) {
if (!board[i][j]) continue;
for (int l = -1; l <= 1; l++) {
for (int m = -1; m <= 1; m++) {
... | ALGO | 0.999792 | 3.911625 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-08-23T08:54: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": "9c5e2818e8... |
abef7b1d-781a-4ce3-b8e4-75859767c53a | voreen-project/voreen | voreen/modules/flowsimulation/ext/openlb/src/functors/lattice/blockMin2D.h | /* This file is part of the OpenLB library
*
* Copyright (C) <NAME>
* E-mail contact: <EMAIL>
* The most recent release of OpenLB can be downloaded at
* <http://www.openlb.net/>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License... | ALGO | 0.907594 | 5.498562 | {
"github_metadata": {
"branch": "main",
"commit_count": 2506,
"repo_created_at": "2024-10-29T14:44:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 18,
"forks": 7,
"issues": 17,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a6841e2... |
77aab231-6024-40f5-81c5-930445e1fccb | CalebDepatie/lsystem | main.cpp | #include <GL/glew.h>
#define GLFW_DLL
#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtx/vector_angle.hpp>
#include <string>
#include <string_view>
#include <tuple>
#include <stack>... | TOOL | 0.944218 | 5.663774 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2023-02-27T01:50: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": "37c785222... |
6e43963a-a478-485f-a645-a9babf7d1559 | yezhejack/leetcode | MinimumHeightTrees/MinimumHeightTrees.cpp | //
// main.cpp
// MinimumHeightTrees
// 每次讲入度为1的删除,然后调整所有节点的入度
// 当最后剩下1个或两个点的时候,这个就是最后的答案了
// Created by 叶哲 on 16/5/14.
// Copyright © 2016年 叶哲. All rights reserved.
//
#include <iostream>
#include <stdio.h>
#include <vector>
#include <iterator>
#include <queue>
using namespace std;
class Solution {
public:
... | ALGO | 0.999873 | 4.939037 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2015-07-08T13:10: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": "3a6d4a275... |
611cb964-73f0-4e1f-a706-edf333e95727 | ftiasch/mithril | 2013-06-29/E.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <complex>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <c... | ALGO | 0.999961 | 3.564774 | {
"github_metadata": {
"branch": "master",
"commit_count": 162,
"repo_created_at": "2012-07-17T06:58:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "4804675... |
f97e87b2-e981-4676-9bab-26302229a707 | vineethkumart/snippet | Array/array_rotation.cpp | #include <iostream>
#include <cassert>
using namespace std;
void reverse(int* a, int start, int end)
{
while (start <= end) {
std::swap(a[start++], a[end--]);
}
}
void rotate_1(int *a, int n, int k)
{
reverse(a, n-k, n-1);
reverse(a, 0, n-k-1);
reverse(a, 0, n-1);
}
void rotate_2(int *a,... | ALGO | 0.999964 | 5.23209 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2015-12-03T02:04: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": "9723501ec... |
3cf5bb16-c834-449a-9d6c-1eaed8ebf80d | dev-area/C-CPP | design patterns/builder1.cpp | #include<deque>
#include<vector>
#include<iostream>
using namespace std;
class Array {
public:
virtual void traverse() = 0;
};
class OneEnded : public Array {
public:
friend class BuilderOne;
void traverse()
{
for (i=0; i < lst.size(); i++)
cout << lst[i] << ' ';
cout << endl;
}
p... | TOOL | 0.984753 | 4.565658 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-03-27T14:08: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": "adff34ea33... |
2eaa71d8-205e-48b0-86df-4a587e3787af | yuki-koyama/mathtoolbox | src/l-bfgs.cpp | #include <cassert>
#include <cmath>
#include <list>
#include <mathtoolbox/l-bfgs.hpp>
#include <mathtoolbox/strong-wolfe-conditions-line-search.hpp>
namespace
{
struct LBfgsEntry
{
const Eigen::VectorXd s;
const Eigen::VectorXd y;
const double gamma;
const double ... | ALGO | 0.999982 | 6.56582 | {
"github_metadata": {
"branch": "master",
"commit_count": 596,
"repo_created_at": "2018-04-14T14:30:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 274,
"forks": 38,
"issues": 15,
"pull_requests": 0
},
"file_meta": {
"content_id": "64c6... |
d60e872f-41a4-4b0c-ac27-fe696e71c0e7 | hvsrathore10/DSA_SelfPaced-gfg | 16_binarySearchTree/pairSum.cpp | // Problem : Given a Balanced Binary Search Tree and a target sum, write a function that returns true
// if there is a pair with sum equals to target sum, otherwise return false.
#include<iostream>
#include<unordered_set>
using namespace std;
struct Node{
int data;
Node *left,*right;
Node(int d){
... | ALGO | 0.999994 | 5.366544 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-06-16T11:57: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": "39b7fbbcd0e... |
664722cd-5b7f-4f93-ae83-2b24dec19da9 | iakshatgandhi/Getting-Started-With-Cpp | MTE/smallestpositive.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <vector>
using namespace std;
// Function to partition positive and non-positive elements
int partition(vector<int>& arr) {
int idx = 0;
for (int i = 0; i < arr.size(); ++i) {
if (arr[i] > 0) {
swap(arr[i], arr[idx]);
++idx;
... | ALGO | 0.999935 | 4.366258 | {
"github_metadata": {
"branch": "master",
"commit_count": 145,
"repo_created_at": "2022-06-22T19: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": "15dad1d1... |
f184d559-a429-419d-ac16-636762427939 | Abhaya0321/Array | lab5 q3.cpp | #include<iostream>
using namespace std;
float klarge(float array[], int length, int k) {
bool flag=true;
float temp;
while(flag) {
flag = false;
for (int i=0; i < length; ++i) {
if (array[i+1] > array[i]) {
temp = array[i+1];
array[i+1] = array[i];
array[i] = temp;
flag = true;
}
}
}
... | ALGO | 0.999881 | 4.18987 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-10-13T17:18:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2fb613e2ca... |
2331bf28-33b7-42ea-9260-6d44ed6e2c26 | GilgameshxZero/altair | cses/1092.cpp | #if defined(__GNUC__) && !defined(__clang__)
#pragma GCC target("avx", "avx2", "fma", "bmi", "bmi2", "popcnt", "lzcnt")
#pragma GCC optimize("Ofast", "unroll-loops")
#endif
#include <bits/stdc++.h>
using LL = long long;
using LD = long double;
using namespace std;
#define RF(x, from, to) \
for (LL x(from), _to(to),... | ALGO | 0.999863 | 3.68334 | {
"github_metadata": {
"branch": "master",
"commit_count": 485,
"repo_created_at": "2021-08-08T21:45:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d7c79c2b... |
db154fcb-d808-4614-b507-4e3265b83c3f | netpipe/IrrlichtDemos | WIPS/Physics/newton-boids/main.cpp |
#include "NewtonBoid.h"
#include "NewtonLeader.h"
#include "main.h"
#include <stdlib.h>
#include <time.h>
#include <vec3.h>
#include "NewtonLump.h"
#include "mathutils.h"
//////////////////////// globals ////////////////////////////////////
using namespace OpenSteer;
const Vec3 Vec3::zero;
const Vec3 Vec3::side;
co... | TOOL | 0.996242 | 3.81779 | {
"github_metadata": {
"branch": "master",
"commit_count": 635,
"repo_created_at": "2013-05-30T21:24:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 35,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0083c5... |
67a81458-2c0e-4c12-bb92-ae889ff47743 | kamrulashraf/Vjudge-mixed- | UVA/10003/5954110_AC_1750ms_0kB.cpp | #include <bits/stdc++.h>
#define rep(i,x,y) for(int i = x ; i< y ; i++)
#define inf 10000000
using namespace std;
int a[55],dp[1000][1000], n;
int call(int b , int e){
bool flag = 0;
if(dp[b][e] != inf) return dp[b][e];
for(int i = 0 ; i< n ; i++){
int v = a[i];
if(v > b && v < e){
... | ALGO | 0.999897 | 3.398628 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-10-03T16:12: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": "fd2b165b54... |
a9aff129-e992-4b88-b132-00634b64d983 | moad6127/Study_Cpp | CodingTestAlgorithm/Week7/Week7_Q_1344/main.cpp | #include <bits/stdc++.h>
using namespace std;
bool Prim[24];
double A, B, dp[24][24][24];
double Func(int idx, int x, int y)
{
if (idx == 18)
{
return Prim[x] || Prim[y] ? 1.0 : 0.0;
}
if (dp[idx][x][y] > -0.5)
{
return dp[idx][x][y];
}
dp[idx][x][y] = 0;
dp[idx][x][y] += Func(idx + 1, x, y) * (1 - A) * ... | ALGO | 0.999019 | 3.786403 | {
"github_metadata": {
"branch": "master",
"commit_count": 511,
"repo_created_at": "2023-05-20T09:33: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": "55e99d81... |
12a512ac-d957-452d-95ad-678929f9a7b4 | ehnryx/acm | acpc-2022/a.cpp | #include <bits/stdc++.h>
using namespace std;
//%:include "utility/fast_input.h"
//%:include "utility/output.h"
%:include "graph/graph_list.h"
%:include "graph/dijkstra.h"
using ll = long long;
using ld = long double;
constexpr char nl = '\n';
constexpr int MOD = 998244353;
constexpr ld EPS = 1e-9L;
random_device _... | ALGO | 0.999714 | 4.401451 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2018-05-03T04:18:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b0711fdf... |
a929111f-c5ee-41f6-95ca-8a2b0a18f3bf | brummer10/guitarix | trunk/tools/ampsim/circuit/circuit.hpp | #include <nvector/nvector_serial.h>
/* Accessor macro */
#define Ith(v,i) NV_Ith_S(v,i)
const int fs = 96000;
//const int fs = 8*44100;
struct Dim {
double lower, upper;
int size, stride;
inline double point(int i) { return lower + ((upper-lower) / (size-1)) * i; }
inline double point(double i)... | ALGO | 0.968884 | 5.212383 | {
"github_metadata": {
"branch": "master",
"commit_count": 4275,
"repo_created_at": "2020-01-26T05:10:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 390,
"forks": 40,
"issues": 28,
"pull_requests": 1
},
"file_meta": {
"content_id": "24d... |
fd417141-bdaa-4b32-ab7d-881a41e936c8 | ishandutta2007/codeforces-a | andr0901/normal/1117/A.cpp | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define forn(i, s, f) for (int i = s; i < f; i++)
#define pii pair <int, int>
#define fs first
#define sc second
#define pb push_ba... | ALGO | 0.999883 | 3.658295 | {
"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": "39a254018604... |
40881a0b-34ae-4476-b6ae-055184b2e471 | RanjitChavan7399/DSA_Assignments | 123B1B103_Ranjit_Merge (1).cpp | #include<iostream>
using namespace std;
class Student{
public :
int Roll_No;
float CGPA;
string Name;
Student(){
Roll_No = 0;
CGPA = 0.0;
Name = " ";
}
void get_data(){
cin>>Roll_No>>Name>>CGPA;
}
void display_data(){
cout<<"Roll : "<<Roll_No<<endl;
cout<<"Name... | ALGO | 0.999622 | 4.359075 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2024-09-30T13:48: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": "fdb5d7fccca... |
e9ce5111-5952-48ec-90db-0129ba789648 | yangxy01/my-program | Class_String_test/Class_String_test/test.cpp | #define _CRT_SECURE_NO_WARNINGS 1
//input one line, find out words
#include <iostream>
#include <string>
using namespace std;
//求给定字符串中无重叠最长重复子字符串的长度
int main()
{
int getmaxlength(string); //function
string str;
int t;
cin >> t;
cin.ignore(10, '\n');
while (t--)
{
getline(cin, str); //input
cout... | ALGO | 0.999036 | 3.920988 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2020-11-08T13:04: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": "0660f7738ed... |
f3c22716-69cf-44c4-944e-769710dfd181 | Ayusht777/100-DAYS-OF-CODE-CHALLENGE | DAY-061/DAY-061--03.cpp | // Day - 61 of 100dayofcode [15/09/2022 Thrusday]
#include <iostream>
/// increment / dercemnet opertor
using namespace std;
int main(){
int c {1};
cout << c <<endl;
c = c +1;
cout << c << endl;
//or
c++;
//or
cout << c << endl;
++c;
//or
cout << c <<endl;
float a {10.1};
cout <<... | TOOL | 0.988913 | 3.595591 | {
"github_metadata": {
"branch": "main",
"commit_count": 298,
"repo_created_at": "2022-07-14T16:51:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1ec951cdf... |
3d997c7c-52ad-4827-ab84-fde37c34ecc7 | axelu/leetcode | cpp/02000-02499/detonatethemaximumbombs.cpp |
// 2101. Detonate the Maximum Bombs
// https://leetcode.com/problems/detonate-the-maximum-bombs/
class Solution {
private:
int dfs(vector<int> g[], int u, int seen[]) {
if( seen[u] )
return 0;
seen[u] = 1;
int ret = 1;
for(auto& v : g[u] )
ret += dfs(g,v... | ALGO | 0.999846 | 5.602027 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2021-04-08T21:22: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": "329f2c3e087... |
e401f819-3f94-4eba-bb14-5231815383e5 | Wonjyeon/SW-Expert-Academy | SWEA/SWEA/5644 무선 충전.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef pair<int, int> pa;
struct BC {
int x, y, c, p;
};
int T, M, A, dir, ans = 0;
int dx[5] = { 0,0,1,0,-1 };
int dy[5] = { 0,-1,0,1,0 };
pa pA[101], pB[101];
BC battery[8];
bool cmp(int a, int b) {
return battery[a].p > battery[b].p... | ALGO | 0.999836 | 3.882631 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2020-03-21T13:23: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": "e0bfc7897... |
1534d13e-0a70-47a7-b526-feb48435796f | 3l-d1abl0/leetcode | 2719-count-of-integers/2719-count-of-integers.cpp | class Solution {
public:
int MOD = 1e9+7;
int memo[23][2][200];
void subtract(string &num){
int N = num.size();
for(int i=N-1; i>=0; i--){
if(num[i]=='0')
num[i]='9';
else{
num[i]--;
... | ALGO | 0.999873 | 5.420797 | {
"github_metadata": {
"branch": "main",
"commit_count": 4227,
"repo_created_at": "2022-03-18T10:20: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": "7798d1d34... |
004dc5fc-0c51-4311-90bc-f5bfa8b67cd5 | mcygorek/ACE | src_exec/tools/PTB_transfer_env_ops.cpp | #include "ProcessTensorBuffer.hpp"
#include "Parameters.hpp"
#include "DummyException.hpp"
#include <iostream>
#include <fstream>
#include <Eigen/Dense>
using namespace ACE;
int main(int args, char** argv){
Parameters param(args, argv);
std::string read_PT=param.get_as_string_check("read_PT");
std::string mult... | TOOL | 0.944653 | 4.551321 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2021-01-07T22:13:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "722334a9... |
10050f70-536a-4a16-bfe1-8b21ccddae9d | ishandutta2007/codeforces-l | lqs2015/normal/1747/E.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 15000010, mod = 1e9 + 7, iv = (mod + 1) >> 1;
int jc[maxn + 10], injc[maxn + 10], test, n, m, f[11111111], g[11111111], ans, h[11111111];
int binpow(int a, int t)
{
int res = 1, p = a;
for (int i = t; i; i >>= 1)
{
if (i & 1) res = 1ll *... | ALGO | 0.999956 | 4.500788 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:17:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8668bc06dac7... |
f1ccd5c0-a8d3-420b-a72a-52b4e77f871f | RSKELT0N/Problems | leetcode/kthSmallestInBST.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.999998 | 5.45242 | {
"github_metadata": {
"branch": "master",
"commit_count": 105,
"repo_created_at": "2020-05-07T19:31: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": "bbb06b5e... |
a18bdc72-e98b-4653-bb49-f9d320dd574b | ha7890846/DSA_with_Cpp | Problems/Stacks/LastEleToBegining/LastToBegin.cpp | #include<iostream>
#include<stack>
using namespace std;
void insertAtBegin(stack<int>&s, int& value){
// Base case
if(s.empty()){
//If stack is empty push value at begin..
s.push(value);
return;
}
// Store the top item of stack..
int temp = s.top();
// pop item from stack... | ALGO | 0.999142 | 4.667195 | {
"github_metadata": {
"branch": "main",
"commit_count": 199,
"repo_created_at": "2023-10-04T15:24:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8f624be74... |
220ca511-f0fa-4966-94ef-85d88d2ee9cc | beratkirik/CPP-Programming-for-Financial-Engineering | Practice/Level9/Exercises/Group E2/Group E2/UtilitiesDJD/CompileTimeVectorsAndMatrices/MatrixVectorSpace.hpp | // MatrixVectorSpace.hpp
//
// Numeric Matrix class.
// This is a COMPILE-TIME Matrix class for numerical data.
//
// (C) Datasim Component Technology 1999-2007
#ifndef MatrixVectorSpace_hpp
#define MatrixVectorSpace_hpp
#include "UtilitiesDJD/CompileTimeVectorsAndMatrices/VectorSpace.cpp"
template <typename V,int... | TOOL | 0.916466 | 4.789638 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-01-30T12:45:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 69,
"forks": 44,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a791a202... |
fa3e84ed-fb58-4260-b91d-5e75a0049dfb | mortal123/code-jam | Online Judge/BZOJ/3522/code.cpp | #include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
using namespace std;
const int N = 5555;
vector<int> e[N];
int n, cnt[N], limit;
long long ans = 0;
int path[N];
void dfs(int dep, int x) {
path[dep] = x;
if (dep && dep % 2 == 0 && x < limit) {
cnt[path[dep / 2 + 1]]++;
}
int total ... | ALGO | 0.999694 | 3.852709 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2014-11-28T09:12: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": "dbf0d26798... |
76590d8b-03ee-4497-b31e-ca6c6f15a902 | choijaewon323/PS | 백준/Gold/2589. 보물섬/보물섬.cc | #include <iostream>
#include <queue>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
char matrix[50][50];
vector<vector<int>> visited;
int r, c;
int dy[] = { -1, 0, 1, 0 };
int dx[] = { 0, -1, 0, 1 };
bool inRange(int y, int x)
{
if (0 <= y && y < r && 0 <= x && x < c)
{
return tru... | ALGO | 0.999815 | 4.45509 | {
"github_metadata": {
"branch": "master",
"commit_count": 829,
"repo_created_at": "2021-09-04T02:57:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe764509... |
481c4e13-2812-4e3c-8332-62c857185832 | zL1nX/LeetCode | superEggDrop.cpp | /*
给你 k 枚相同的鸡蛋,并可以使用一栋从第 1 层到第 n 层共有 n 层楼的建筑。
已知存在楼层 f ,满足 0 <= f <= n ,任何从 高于 f 的楼层落下的鸡蛋都会碎,从 f 楼层或比它低的楼层落下的鸡蛋都不会破。
每次操作,你可以取一枚没有碎的鸡蛋并把它从任一楼层 x 扔下(满足 1 <= x <= n)。如果鸡蛋碎了,你就不能再次使用它。如果某枚鸡蛋扔下后没有摔碎,则可以在之后的操作中 重复使用 这枚鸡蛋。
请你计算并返回要确定 f 确切的值 的 最小操作次数 是多少?
示例 1:
输入:k = 1, n = 2
输出:2
解释:
鸡蛋从 1 楼掉落。如果它碎了,肯定能得出 f = 0 。
否则... | ALGO | 0.999905 | 6.04393 | {
"github_metadata": {
"branch": "main",
"commit_count": 779,
"repo_created_at": "2020-10-07T12:23: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": "7d9b68744b... |
e0a6b250-79d6-460e-870e-06564adc5b98 | manoflearning/cp-codes | Universal Cup/The 3rd Universal Cup. Stage 4: Hongō/q.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll INF = 1e18;
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
cin.tie(NULL); cout.tie(NULL);
ios_base::sync_with_stdio(false);
int n; cin >> n;
vec... | ALGO | 0.999943 | 3.883309 | {
"github_metadata": {
"branch": "main",
"commit_count": 1899,
"repo_created_at": "2020-08-06T14:38: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": "836f71d48... |
a9372716-e0c8-48a2-96ad-7bdbb9959680 | MSCohagan/CSCI-2270---Data-Structures | Assignment_5/Assignment5.cpp | #include <iostream>
#include "HW5-MovieTree.hpp"
#include <string>
#include <sstream>
#include <fstream>
using namespace std;
// Assignemnt 5
// <NAME>
// October 2018
MovieTree::MovieTree(){
root = nullptr;
};
//In order traversal helper function
void destructorHelper(MovieNode* currentNode){
if(currentNode!... | TOOL | 0.99441 | 3.475419 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-01-24T09:47: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": "0694314f2... |
41fd8352-6626-4e9c-9c77-7e7182972f88 | JustAnAverageGuy/ideal-enigma | practice/archives/csoc23/week_1/bitwise/R_2_doors.cpp | // #define MOD 1e9 + 7
// #define fo(i, n) for (int(i) = 0; (i) < (n); ++(i))
// #define print(k) cout << (k) << '\n';
// #define fast() \
// ios_base::sync_with_stdio(false); \
// cin.tie(NULL)
// #define pb(x) push_back(x)
// #define nl '\n'
// #include <bits/stdc++.h>
// typedef long l... | ALGO | 0.999929 | 4.411727 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2023-12-19T11:57: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": "58a1e8583a6... |
99d7d8be-e286-40c3-8230-7b1a03f3019f | KokosTech/OOPs | hw/SMALL/10-03-22_library/Library.hpp | #pragma once
#include <iostream>
#include "Book.hpp"
using namespace std;
class Library{
//Array of books, books count, array size, capacity
Book* books;
size_t size, capacity;
/**
* @brief Resizing the array with double capacity. Resize is private method because it is used only by the addition... | TOOL | 0.978557 | 5.06508 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2022-02-11T06:52: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": "e915b6e0581... |
c6aa0efe-0558-4c29-bb37-501a360e9ab2 | raghuvanshraj/Competitive-Programming-Archive | Coding Ninjas/inv_count_practice.cpp | #include <bits/stdc++.h>
using namespace std;
long long merge(int arr[], int l, int m, int r)
{
int invCount = 0;
int eltLeft = m-l+1;
int eltRight = r-m;
int *tempL = new int[eltLeft];
int *tempR = new int[eltRight];
for (int i = 0; i < eltLeft; ++i)
{
tempL[i] = arr[i+l];
}
for (int i = 0; i < eltRight... | ALGO | 0.999955 | 4.81463 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2020-09-15T07:44: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": "5a00dec1d... |
2990111b-ef51-46a7-85dd-b4e1267f425d | tangjz/acm-icpc | leetcode/1001-2000/1354-construct-target-array-with-multiple-sums.cpp | class Solution {
public:
bool isPossible(vector<int>& target) {
typedef long long LL;
LL sum = 0;
int pos = 0;
priority_queue<pair<int, int> > que;
for(int x : target) {
sum += x;
que.push({x, pos++});
}
while(!que.empty()) {
... | ALGO | 0.999923 | 4.626647 | {
"github_metadata": {
"branch": "master",
"commit_count": 293,
"repo_created_at": "2013-10-06T18:57:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 45,
"forks": 13,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "9992f8... |
518acbbc-34bb-40ec-a1bd-4166315e0ffd | HeroJho/BaeckJoon | 백준/Silver/2346. 풍선 터뜨리기/풍선 터뜨리기.cc | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int solution(string word) {
int answer = 0;
return answer;
}
bool Visited[1001] = { false };
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N;
cin >> N;
vector<int> Inputs;
Inputs.push_ba... | ALGO | 0.999997 | 3.949104 | {
"github_metadata": {
"branch": "main",
"commit_count": 626,
"repo_created_at": "2023-03-20T03:54: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": "ccec8fd4d9... |
115a7c49-5b12-4874-a42e-0292275c2fb7 | mijanurm21/GFG-Solutions | Hard/Vertex Cover/vertex-cover.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution{
public:
int vertexCover(int n, vector<pair<int, int>> &edges) {
// code here
int ans=n;
for(in... | ALGO | 0.999962 | 5.544652 | {
"github_metadata": {
"branch": "main",
"commit_count": 320,
"repo_created_at": "2023-12-13T07:19: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": "b89fe163e0... |
1efc2811-1b00-435c-9774-e1f1f716c962 | RituparnaPadira/hacktoberfest | algorithms/c++/FloydWarshall.cpp | //Floyd-Warshall is a DP algorithm that gives shortest path between each pair of vertices in directed graph in O(n^3) time complexity
/**
Input constraints:
In a graph of n vertices. Vertices are numbered from o to n-1
**/
#include<bits/stdc++.h>
using namespace std;
#define INF INT_MAX
void printShortestDistance(vec... | ALGO | 0.99997 | 4.660035 | {
"github_metadata": {
"branch": "master",
"commit_count": 234,
"repo_created_at": "2021-10-02T07:39:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 26,
"issues": 3,
"pull_requests": 4
},
"file_meta": {
"content_id": "17cc79a... |
197583eb-46dc-4c96-b5f5-2cbd3d004900 | maruf-rahad/codeforces | B. Maximum Product.cpp | #include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define Fin freopen("input.txt","r",stdin)
#define Fout freopen("output.txt","w",stdout)
#define Precision(a) cout << fixed << setprecision(a... | ALGO | 0.999962 | 3.512166 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2020-09-04T14:06:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d422ebe7d... |
f69c185d-9e57-4529-90af-113afe698259 | Orcuslc/Learning | LeetCode/385. Mini Parser.cpp | /**
* // This is the interface that allows for creating nested lists.
* // You should not implement it, or speculate about its implementation
* class NestedInteger {
* public:
* // Constructor initializes an empty nested list.
* NestedInteger();
*
* // Constructor initializes a single integer.
* ... | ALGO | 0.962682 | 6.05781 | {
"github_metadata": {
"branch": "master",
"commit_count": 674,
"repo_created_at": "2015-12-02T15:27:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d6252713... |
f3e28333-5576-4376-8c2d-3b67fd845292 | Superm4n97/competetive-programming | Codeforces vol 01/20C.cpp | #include<bits/stdc++.h>
#define ll long long int
#define inf 100000000000000
#define maxn 100005
#define pb push_back
using namespace std;
vector < ll > G[maxn] , W[maxn];
ll n,m , cost[maxn];
map < pair < ll , ll > , ll > mp;
ll dijkstra()
{
priority_queue < pair <ll,ll> > pq;
pq.push({0,1});
cost[1] =... | ALGO | 0.99996 | 3.600097 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-12-16T18:34:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3942fae755... |
41cf110a-7dde-40e2-8fa3-4264d89bb6cd | AryanTapre/DSA | 04_CharArray&Strings/23_string_compression_leetcode.cpp | // leetcode : 443
#include<vector>
#include<algorithm>
#include<iostream>
using namespace std;
int compress(vector<char>& s) {
int index = 0;
int prev = 0;
int count = 1;
for(int i=1; i<s.size(); i++) {
if(s[prev] == s[i]) {
count++;
}
else {
s[index++] ... | ALGO | 0.999968 | 4.568743 | {
"github_metadata": {
"branch": "master",
"commit_count": 233,
"repo_created_at": "2024-05-02T10:22:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "403ac52b... |
e3941bca-b876-491c-8686-2ed3b1887c23 | sebastianmyrback/mpi-fem | src/poisson.cpp | #include "../include/poisson.hpp"
namespace serial_poisson
{
Poisson1D::Poisson1D(const double a, const double b, const int nintervals)
: mesh(a, b, nintervals),
psi(),
qr(quadrature::midpoint),
dofs_per_cell(psi.ndof),
n_quad_pts_per_cell(qr.n)
{
bc.g = u;
... | ALGO | 0.999499 | 5.716711 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2024-04-10T13:36: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": "4721e8cadae... |
3fdf23db-52cc-484f-981e-19297dd42911 | devgoel2004/codeforces-questions | contest 7/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define endl '\n'
#define F first
#define S second
#define range(a,i,n) for(int i=a;i<n;i++)
#define M 10e7
#define e end
#define b begin
bool isEven(int x){
return (!(x&1));
}
void solve(){
ll a,b,c;
cin>>a>>b>>c;
bo... | ALGO | 0.99998 | 5.080574 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-09-16T07:00:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3bb207f6e8e7... |
b5073578-36ec-4b69-9002-f60af800c640 | ddemidov/amgcl_benchmarks | distr_mem/navier-stokes/amgcl_sdd.cpp | #include <iostream>
#include <iterator>
#include <iomanip>
#include <fstream>
#include <vector>
#include <numeric>
#include <cmath>
#ifdef _OPENMP
#include <omp.h>
#endif
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/foreach.hpp>
#include <boost/range/iterator_... | ALGO | 0.999372 | 4.989471 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2017-10-12T06:57:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "20031f75f... |
5342099b-48a5-4bc4-8856-06b867198490 | rkeatin3/ToyProblem | SimpleEKF.hpp | #ifndef SIMPLE_EKF
#define SIMPLE_EKF
#include "Types.hpp"
#include "ClockStateModel.hpp"
#include "ClockMeasurementModel.hpp"
namespace ToyProblem{
/**
* Simple functor for running filter at each timestep. This class contains no state (like the filter
* provided in the Matlab code)).
*/
class SimpleEKF
{
public... | ALGO | 0.915211 | 7.248705 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-05-22T06:54: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": "c9fc989548... |
b0e59fd5-de46-46ca-b25a-411f45f5ebcd | cseshahriar/phitron-batch-05 | bundle-course-3-basic-ds/module-08-mid-term/search.cpp | #include <bits/stdc++.h>
using namespace std;
class Node {
public:
long long int val;
Node* next;
Node(long long int val) {
this->val = val;
this->next = NULL;
}
};
void insert_at_tail(Node *&head, Node *&tail, long long int val) {
Node *newNode = new Node(val);
if... | ALGO | 0.999466 | 4.518559 | {
"github_metadata": {
"branch": "main",
"commit_count": 153,
"repo_created_at": "2024-03-29T13:41: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": "39a27bd624... |
5084b75f-e1a2-4e28-a504-cc31550b1e73 | Aaanchalsingh/Leetcode | 1025-minimum-cost-for-tickets/minimum-cost-for-tickets.cpp | class Solution {
public:
int solve(int i, vector<int> v, vector<int> cost, vector<int>& dp) {
if (i > v[v.size() - 1])
return 0;
if (dp[i] != -1)
return dp[i];
if (find(v.begin(), v.end(), i) == v.end())
return solve(i + 1, v, cost,dp);
int one = ... | ALGO | 0.999812 | 5.004857 | {
"github_metadata": {
"branch": "main",
"commit_count": 1536,
"repo_created_at": "2023-10-15T08:21: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": "5bb14e88e... |
1ae083d4-b979-4759-b2bc-b1530fce4ae8 | voldermort/spoj | HS09APR.cpp | #if defined(_MSC_VER)
#define _CRT_SECURE_NO_WARNINGS
#include <boost/typeof/typeof.hpp>
#define typeof BOOST_TYPEOF
#endif
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdli... | ALGO | 0.999582 | 3.472259 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2012-01-27T23:11:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ded659b43... |
3ac6c54f-3e09-40e4-ad3f-4f04826bab2d | ZacharyHandel/CS-255 | Assignment 1 Robin.cpp |
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
const int maxSt = 100;
int fileRead(string[], int[]);
void filePrint(string[], int[], int);
void selectionSort(string[], int[], int num);
int linearSearch(int[], int, int);
int main()
{
int numStudents;
string studentName... | TOOL | 0.921538 | 3.667179 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-08-21T18:14: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": "21c2627f7e... |
37b877cb-dd40-4a58-a1c8-bd6a7b5727f6 | AnkitaDhagate/OOP | linklist.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
typedef struct node
{
int info;
struct node *next;
}node;
class list
{
node *head;
public :
void addnode();
void insertAfter();
void show();
void deletenode();
public : list()
{
head=NULL;
... | ALGO | 0.9934 | 3.830668 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-05-10T09:14: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": "37c2ce0c3e44... |
f2db4974-d166-46d2-b647-af9be43b0c6d | vladiant/ImageDeblurring | Samples/Noise/rlnoiseg/main.cpp | /*
* Simple program to create
* space variant motion blurr
* Richardson Lucy algorithm
* with partial sums
* Gaussian distribution assumed
* and noise is added
*/
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/core/mat.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc... | ALGO | 0.986086 | 4.885605 | {
"github_metadata": {
"branch": "main",
"commit_count": 121,
"repo_created_at": "2021-12-22T22:24: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": "6956066520... |
45444ad3-6eab-45db-bf83-f22353a7a8a4 | banimania/CompetitiveProgramming | KATTIS/CrashingRobots.cpp | #include <bits/stdc++.h>
using namespace std;
struct Robot {
int x, y;
char dir;
int id;
};
struct Instruction {
int id;
char action;
int repeat;
};
map<char, pair<int, int>> dirs = {{'N', {1, 0}}, {'S', {-1, 0}}, {'E', {0, 1}}, {'W', {0, -1}}};
map<char, char> turnRight = {{'N', 'E'}, {'E', 'S'}, {'S',... | ALGO | 0.999879 | 4.198229 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2025-01-31T20:06:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8378af5bd3... |
12b5201f-8e80-412c-b0fc-891961fef2e8 | maryskar/spbspu-labs-2023-aads-904-a | aksenov.egor/S1/helpFunctions.cpp | #include "helpFunctions.h"
#include "stringToInfix.h"
#include "convertToPostfix.h"
#include "solvePostfixExpr.h"
#include <stack.h>
#include <queue.h>
bool aksenov::isNumeric(std::string const &str)
{
char* p = nullptr;
std::strtol(str.c_str(), &p, 10);
return *p == 0;
}
bool aksenov::isOperator(std::string oper... | ALGO | 0.999722 | 4.513704 | {
"github_metadata": {
"branch": "master",
"commit_count": 5308,
"repo_created_at": "2024-02-09T14:14: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": "b6873d2... |
d56c0156-89d2-4891-8bbd-ec4da4d2706b | Apress/design-patterns-in-modern-cpp | Behavioral/Strategy/StrategyCodingExercise.cpp | #include <iostream>
#include <vector>
#include <complex>
#include <tuple>
using namespace std;
struct DiscriminantStrategy
{
virtual double calculate_discriminant(double a, double b, double c) = 0;
};
struct OrdinaryDiscriminantStrategy : DiscriminantStrategy
{
double calculate_discriminant(double a, double b... | ALGO | 0.997448 | 6.05532 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-04-17T11:49:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 559,
"forks": 194,
"issues": 3,
"pull_requests": 1
},
"file_meta": {
"content_id": "fd1217f... |
9fe23edd-46fe-4fe0-8593-f800d31acce6 | harshRishi/DSA | DSA ninja/stacks/StackUsingLL.cpp | #include <iostream>
using namespace std;
template <typename T>
class Node // this is our template type Node
{
public:
T data;
Node<T> *next;
Node(T data)
{
this->data = data;
next = NULL;
}
};
template <typename T>
class Stack
{
Node<T> *head; // this should be private
int... | ALGO | 0.998761 | 4.648899 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-05-13T10:25: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": "e0243369a6a2... |
de264d9f-ccdc-4245-9af2-f9f1250582eb | NamYunje2002/algorithm | Boj_C++/14497.cpp | #include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
int main() {
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int n, m; cin >> n >> m;
pair<int, int> J, C;
cin >> J.X >> J.Y >> C.X >> C.Y;
J.X--; J.Y--; C.X--; C.Y--;
vector<string> board(n);
vector<vector<in... | ALGO | 0.999875 | 4.230293 | {
"github_metadata": {
"branch": "main",
"commit_count": 195,
"repo_created_at": "2024-03-08T07:03: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": "b1ef2fd66a... |
dfb6bf0f-9d8a-4cea-88e8-4ff44e1e548c | maxjtwelftree/cp | leetcode/118-pascals-triangle/pascals-triangle.cpp | class Solution {
// An Weng Dong Solution, watched video but
// likely need to go over it more
public:
vector<vector<int>> generate(int numRows) {
vector<vector<int>> a(numRows);
// configures to the same as the triangle^^^^
// iterate over with i
for (int i = 0; i... | ALGO | 0.99995 | 5.933488 | {
"github_metadata": {
"branch": "main",
"commit_count": 2257,
"repo_created_at": "2023-07-18T13:17:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c4339ed7... |
670a95d3-55ef-4163-8522-a0f2db91d169 | dhrubajyotinath6/Preparation | DSA/TOPICS/STACK && QUEUE/739. Daily Temperatures.cpp | /*
Given an array of integers temperatures represents the daily temperatures,
return an array answer such that answer[i] is the number of days you have to wait
after the ith day to get a warmer temperature. If there is no future day for which this is possible,
keep answer[i] == 0 instead.
Example 1:
Input: tem... | ALGO | 0.999988 | 5.977281 | {
"github_metadata": {
"branch": "master",
"commit_count": 465,
"repo_created_at": "2022-01-24T17:01:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a01480a... |
f661b992-1461-4f31-8a8e-dc9544745ef9 | zdevito/ATen | aten/src/ATen/ParallelOpenMP.h | #pragma once
#include <ATen/ATen.h>
#include <cstddef>
#include <exception>
#ifdef _OPENMP
#define INTRA_OP_PARALLEL
#include <omp.h>
#endif
namespace at {
template <class F>
inline void parallel_for(
const int64_t begin,
const int64_t end,
const int64_t grain_size,
const F& f) {
TORCH_CHECK(grai... | TOOL | 0.916425 | 6.654281 | {
"github_metadata": {
"branch": "master",
"commit_count": 8655,
"repo_created_at": "2017-06-20T23:50:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 703,
"forks": 128,
"issues": 68,
"pull_requests": 0
},
"file_meta": {
"content_id": "78... |
1c5dc3cc-d684-46ab-b9f2-e23b3936fef2 | YenNhi392/dsa1 | [BST] Xóa node.cpp | #include <iostream>
using namespace std;
struct node
{
int info;
node* left, * right;
};
typedef node* Tree;
node* getNode(int x)
{
node* p = new node;
if (p == NULL) {
return p;
}
p->info = x;
p->left = p->right = NULL;
return p;
}
void insertNode(Tree& t, int x)
{
if (t... | ALGO | 0.99997 | 3.786833 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2025-06-26T17:23: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": "d740cd979d... |
6048e66b-8fe4-4f33-8f2b-1dbaa12741f8 | nete64/BOJ | C++20/백준/Silver/8979. 올림픽/올림픽.cc | #include <iostream>
#include <algorithm>
using namespace std;
struct C {
int i,a,b,c;
};
bool cmp(C& A, C& B)
{
if (A.a == B.a && A.b == B.b)
return A.c > B.c;
else if (A.a == B.a)
return A.b > B.b;
return A.a > B.a;
}
C arr[1002];
int main()
{
ios_base::sync_with_stdio(false);
... | ALGO | 0.999949 | 3.827155 | {
"github_metadata": {
"branch": "main",
"commit_count": 1272,
"repo_created_at": "2024-09-15T01:56: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": "496006a5e... |
371d501e-2210-4f26-87d0-27292b9c7165 | ishandutta2007/codeforces-c | clovers/normal/1553/E.cpp | /*
the vast starry sky,
bright for those who chase the light.
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define mk make_pair
const int inf=(int)1e9;
const ll INF=(ll)5e18;
const int MOD=998244353;
int _abs(int x){return x<0 ? -x : x;}
int add(int x,int y){x+=y; ret... | ALGO | 0.999956 | 3.500011 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17: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": "5321fed8dd31... |
d931318a-2186-46e2-b5d9-899676d0a931 | GitGuru420/Basic-Data-Structures | Week-02 (Linked List)/Module-8 (Assignment-2)/P5_Remove_Duplicate.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int value;
Node *next;
Node(int value)
{
this->value = value;
this->next = NULL;
}
};
void insert_at_tail(Node *&head, Node *&tail, int value)
{
Node *newNode = new Node(value);
if (head == NULL)
{
... | ALGO | 0.999935 | 4.786836 | {
"github_metadata": {
"branch": "main",
"commit_count": 302,
"repo_created_at": "2024-12-07T20:15: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": "e38a4efd02... |
9816acaa-ed7a-4a69-a3f9-32220619a338 | shariarhossain17/contest_practice | judge/codeforces/div_3/different_array.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define newLine cout << "\n"
#define pb push_back
#define vi vector<int>
#define Yes cout << "YES\n"
#define No cout << "NO\n"
#define array_input_int(a, o, n) \
for (int i = o; i < n; i++) \
{ \
cin >> (a[i]... | ALGO | 0.999984 | 4.181885 | {
"github_metadata": {
"branch": "main",
"commit_count": 165,
"repo_created_at": "2023-10-01T13:53: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": "8e611e33cb... |
bf3d8c6b-f18b-465a-aba8-b7b935fe548d | cai-mj/object_recognition | object_recognition.cpp | #include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/nonfree/features2d.hpp"
#include "opencv2/legacy/legacy.hpp"
#include "opencv2/ml/ml.hpp"
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
using namespace std;
usi... | ALGO | 0.947096 | 4.489386 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2013-06-05T13:39:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "459b9c99ff... |
4e1ae869-370e-4c56-8839-44fbd1a21536 | 5401j/HoughPlane | src/HoughPlaneOMP.cpp | #include "../inc/HoughPlane.hpp"
#include <fstream>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <omp.h>
#include <vector>
#include <cstdlib>
#include <array>
#include <atomic>
// #include<execution>
// #include<numeric>
using namespace std;
#define PI 3.14159265
// auto policy=std::execution::p... | DATA | 0.977409 | 3.673366 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-10-10T15:38: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": "a5779cc41ea1... |
3d4c54f9-8e65-49a0-b626-74344edd6b50 | virennarang/Data-Structures | Exp 4.cpp | #include<iostream>
using namespace std;
class linkedlist
{
int size;
struct node
{
int info;
struct node *next;
};
struct node *start=NULL;
struct node *new_node;
struct node *ptr;
public:
void create_ll()
{
cout<<"enter the size\n";
cin>>size;
cout<<"enter th elements in linked list\n";
... | ALGO | 0.999366 | 3.344797 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-10-15T18:19: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": "9d7b437af9... |
f5131264-caa6-4515-97b6-4daedf34fcc3 | ml1150258/CSC_CIS_17C | Class/MergeSort/Merge_V5/main.cpp | /*
* File: main.cpp
* Author: Dr. <NAME>
* Created on April 8th, 2021 1:19 PM
* Purpose: Create a Recursive sort
* Speed the process up by creating
* a structure with working space
*/
//System Libraries
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
//User Lib... | ALGO | 0.999953 | 5.220327 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2023-02-15T16:15:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "696b137ab... |
78a787fe-d9f3-438f-9275-6b49e747a146 | travelbeeee/ProblemSolving | Programmers/2021DevMatching_다단계칫솔.cpp | #include <string>
#include <vector>
#include <map>
using namespace std;
int ind, p[10001], gain[10001];
map<string, int> sellerMap;
void setSellerMap(vector<string> enroll) {
sellerMap.insert({ "-", ind++ });
for (int i = 0; i < enroll.size(); i++)
sellerMap.insert({ enroll[i], ind++ });
}
void setP... | ALGO | 0.997156 | 4.063123 | {
"github_metadata": {
"branch": "master",
"commit_count": 349,
"repo_created_at": "2020-08-08T04:24: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": "b79361b4... |
a052b526-aef1-44c8-9f21-3f6ba6e3af27 | itsamankrsingh/LeetCode | test.cpp | #include <bits/stdc++.h>
using namespace std;
void inputOutput()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
using namespace std;
int main()
{
inputOutput();
int n;
cin >> n;
vector<int> v;
for (int i = 0; i < n; i++)
{
... | ALGO | 0.999877 | 3.378561 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2022-09-08T15:56:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf6d8fb37... |
3a7aee10-34dd-4cbe-a58e-1cc81a47b58d | Mantevo/miniTri | triangleCounting/linearAlgebra/LH/openmp/CSRMatrix.cc | //@HEADER
// ************************************************************************
//
// miniTri v. 1.0
// Copyright (2016) Sandia Corporation
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this softw... | TOOL | 0.910548 | 5.045614 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2016-08-01T17:25:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 8,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "01119d3ce1... |
61e03eed-6017-4316-bd44-b918add94ce7 | trinhminhtriet/leetcode | solutions/0600-0699/0663.equal-tree-partition/Solution.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.999866 | 6.071299 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2024-12-09T17:55:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 34,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ef080... |
e66de1f8-2953-4a21-906b-21ef5da3373d | huihut/interview | Problems/RoundRobinProblem/MatchTable.cpp | #include <iostream>
#include <math.h>
using namespace std;
// 循环赛日程安排函数声明
void MatchTable(int k, int n, int **table);
int main()
{
int n = 0, k = 0;
// 用户界面
cout << "---------------- 循环赛日程安排问题 ----------------" << endl;
cout << "请输入k(k>=0),构成 n=(2^k) 个选手的循环赛" << endl;
// 输入k值
cin >> k;
// 判断输入数据合法性,包括检查输入是... | ALGO | 0.999401 | 4.596922 | {
"github_metadata": {
"branch": "master",
"commit_count": 372,
"repo_created_at": "2018-02-09T09:49:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 36377,
"forks": 8072,
"issues": 24,
"pull_requests": 2
},
"file_meta": {
"content_id": "... |
cf1fe049-870d-45a3-bd1f-dc180cc6d984 | wilmercastrillon/Ejercicios-Uva-Judge-Online | Competitive Programming 3/Mathematics/Number Theory/10680 LCM.cpp | #include <bits/stdc++.h>
#define forr(i, n) for(int i = 0; i < n; ++i)
#define forab(i, a, b) for(int i = a; i < b; ++i)
using namespace std;
typedef long long int lli;
int m = 1000010, primo[1000020];
vector<lli> p; int lim = sqrt(m)+1;
map<lli, int> mapa;
void criba(){
memset(primo, 0, sizeof(primo));
f... | ALGO | 0.999889 | 3.869518 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2017-03-08T02:46: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": "fc348277b... |
5171ff18-4d3a-475d-aabc-db44011001b8 | ElizabethZim/Elf-Village | main.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;
const int count_trees = 5;
class Branch{
private:
Branch *parent = nullptr;
vector <Branch*> children;
string elfName = "None";
public:
vector <Branch*> get_children(){
return children;
};
void set_children(B... | ALGO | 0.999608 | 4.069658 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-02-28T14:54: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": "5db36b085a2d... |
60a7f353-6a86-4160-a050-94c29bd6630a | tangjz/acm-icpc | 51nod/1671.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
const int maxn = 1000010, INF = 0x3f3f3f3f;
int n, m, l[maxn], r[maxn];
int main()
{
while(scanf("%d%d", &n, &m) == 2)
{
for(int i = 0; i < m; ++i)
{
scanf("%d%d", l + i, r + i);
if(l[i] > r[i])
swap(l[i], r[i]);
}
int L = 0, R = n - 1;
w... | ALGO | 0.999988 | 3.493931 | {
"github_metadata": {
"branch": "master",
"commit_count": 293,
"repo_created_at": "2013-10-06T18:57:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 45,
"forks": 13,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "88ec17... |
3fa89492-9704-4236-9ded-c28fe2ea7bd7 | thepratholic/Competitive-Programming | Codeforces/Codeforces Contests/Educational Codeforces round 175 Div 2/C_Limited_Repainting.cpp | #include <bits/stdc++.h>
using namespace std;
// Macros for faster coding
#define int long long
#define all(x) x.begin(), x.end()
#define pb push_back
#define endl '\n'
#define fast_io ios::sync_with_stdio(false); cin.tie(nullptr);
// Debugging Macros
#define debug(x) cerr << #x << " = " << (x) << endl;
void solve()... | ALGO | 0.999953 | 5.34241 | {
"github_metadata": {
"branch": "main",
"commit_count": 742,
"repo_created_at": "2024-08-27T07:24: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": "2fc66d928e... |
f4ffe30a-1216-4144-93d8-757779725085 | huynguyen1212/contest | contest5/13.13.cpp | #include <bits/stdc++.h>
using namespace std;
// thuat toan
// tim day ugly noi vao 1, 2, 3, 5 den n
// so tiep theo trong day can tim la boi nho nhat cua cac so 2, 3, 5
// n-1 la do bat dau ugly ti 0, ugly can tim la boi cua mot trong ba so 2,3,5
long long Ugly(int n) {
long long ugly[n];
long long i2 = 0, i3 = ... | ALGO | 0.999957 | 4.76632 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-11-01T19:04: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": "f4068fb41d... |
3aae12c3-17c9-4164-8d6c-8bed7bbccd50 | rishabhagg7/Coding-Ninjas-Introduction-to-Cpp-and-Data-Structure-in-Cpp | Introduction to Cpp/Lecture 10 Character Arrays and 2D Arrays/Highest_Occuring_Character.cpp | /*
For a given a string(str), find and return the highest occurring character.
Example:
Input String: "abcdeapapqarr"
Expected Output: 'a'
Since 'a' has appeared four times in the string which happens to be the highest frequency
character, the answer would be 'a'.
If there are two characters in the input string with t... | ALGO | 0.999987 | 5.067936 | {
"github_metadata": {
"branch": "main",
"commit_count": 290,
"repo_created_at": "2022-08-17T11:55:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea47d1e3db... |
712b8f2d-5beb-4d8b-9f60-c174b9539012 | ufz/ogs5 | GCC/eqbrm.h | /**
* \copyright
* Copyright (c) 2020, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include <iostream>
#include <iomanip>
#include <math.h... | ALGO | 0.964756 | 3.79145 | {
"github_metadata": {
"branch": "master",
"commit_count": 598,
"repo_created_at": "2015-08-26T08:13:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 45,
"forks": 97,
"issues": 19,
"pull_requests": 3
},
"file_meta": {
"content_id": "1c3d88... |
8f54a749-c18a-448d-abf2-eb6dd58b1119 | TolosaAngel/Codeforces | CodeForces/GNU C++20 (64)/48A | Rock-paper-scissors/183819749.cpp | #include <bits/stdc++.h>
using namespace std;
#define forsn(i,s,n) for(int i = int(s); i<int(n); i++)
#define forn(i,n) forsn(i,0,n)
#define dforsn(i,s,n) for(int i = int(n-1); i>=int(s); i--)
#define dforn(i,n) dforsn(i,0,n)
#define DBG(x) cout<<#x<<" = "<<x<<endl;
#define ioFast ios_base::sync_with_stdio(false);c... | ALGO | 0.999988 | 3.93204 | {
"github_metadata": {
"branch": "main",
"commit_count": 301,
"repo_created_at": "2023-03-08T11:09: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": "37bbb870a6... |
b7167ab9-82d1-460f-9a3f-ba1d40ffb6c0 | GwonilJoo/Samsung_SDS_Algorithm | 6_Graph1/E.cpp | // 2458 키 순서
/*
강사님 방법
나보다 키가 큰 노드 + 나보다 키가 작은 노드 + 자기 자신 = 노드 개수 -> 나의 키가 몇번째인지 정확히 알 수 있다!
*/
#include<cstdio>
#include<vector>
#include<cstring>
using namespace std;
int N, M, answer, visited_cnt, visited_rev_cnt;
bool visited[510], visited_rev[510];
vector<int> adj[510], rev[510];
void dfs(int cur){
if(visite... | ALGO | 0.999974 | 3.480023 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2021-01-11T14:22: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": "e7d174d1f... |
46d1350f-45da-4e39-9929-e1d7ec71d4cb | Saviour1001/Competetive | CNIL/daosihd.cpp | #include <bits/stdc++.h>
using namespace std;
vector<long long> rectangularSquare(int n, vector<vector<int>> mat, int q, vector<vector<int>> query)
{
vector<long long> ans;
for(int k=0;k<q;k++)
{
int x=query[k][0];
int y=query[k][1];
int l=query[k][2];
int b=query[k][3];
... | ALGO | 0.999481 | 4.459318 | {
"github_metadata": {
"branch": "main",
"commit_count": 122,
"repo_created_at": "2021-01-14T17:00:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "431d270b54... |
3ddde3af-6a25-45f7-9a2c-508a2069a9a7 | naburov/HeatEquation2D | HeatEquation2D/Source.cpp | #define min(x,y) (((x) < (y)) ? (x) : (y))
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <iostream>
#include <iomanip>
#include <sstream>
#include "Consts.h"
#include "Functions.h"
int main()
{
auto xDelta = a / nCols;
auto yDelta = b / nRows;
auto timeDelta = min(xDel... | ALGO | 0.99194 | 4.032341 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-03-07T14:20:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "06bc1098c1... |
ff0a2aed-62d6-4bbf-b180-b029a2cea919 | avcopan/MPACK | mlapack/library/Cggglm.cpp | /*
* Copyright (c) 2008-2010
* <NAME>
* All rights reserved.
*
* $Id: Cggglm.cpp,v 1.5 2010/08/07 04:48:32 nakatamaho Exp $
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of... | ALGO | 0.999814 | 4.189146 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2019-12-18T18:49:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f4203e18c... |
66cc38f6-ccfb-4fbf-9939-842e07190c73 | leedavid/NewGG | I_GGX64/move.cpp | #include "chess.h"
#include <cassert>
#include <cstring>
#include <iomanip>
#include <string>
#include <sstream>
#include "move.h"
//#include "s_piece.h"
#include "position.h"
#include "search.h"
#include "movegen.h"
using std::string;
namespace {
//const string time_string(int milliseconds);
//const string score... | ALGO | 0.963667 | 5.426351 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2020-05-10T11:57:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 46,
"forks": 38,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ebae5d... |
2813a51c-9c08-442c-a37a-fa76c487de6a | idvr/pacs | Exercises/old_list/Esercitazioni_0708_e_preced/8/es/2/src/fpsolve.hpp | /*!
\file fpsolve.hpp
\brief Iterative fixed point algorithm for root finding
\author <NAME>
\date 12/15/2006
*/
#ifndef __FPSOLVE_HPP
#define __FPSOLVE_HPP 1
#include <iostream>
namespace FixedPoint {
/*!
\struct ResType
\brief Type for result
*/
struct ResType {
double val; /*!< \f$f(... | ALGO | 0.999955 | 6.037693 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2012-10-08T02:28:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 111,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c354822... |
7cedf6bb-87a7-49e3-9f8d-010e2ccad8b7 | rawagiha/cpp_primer | algorithms_otsuki/chapter_05/code_5.8_v2.cpp | #include <vector>
#include <string>
#include <iostream>
#include <algorithm>
template <typename T>
void choose_smaller(T& a, T b)
{
if (b < a) a = b;
}
void show(const std::vector<std::vector<int>>& memo)
{
for (auto col : memo)
{
for (auto elem : col)
{
std::cout << elem << "... | ALGO | 0.999998 | 5.077157 | {
"github_metadata": {
"branch": "master",
"commit_count": 319,
"repo_created_at": "2023-10-30T16:03: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": "e374c662... |
4aaa9450-df75-40f9-83f3-1f19bd316e86 | AxonDragonScale/Algorithms | Greedy/Distribute Candy.cpp | // https://www.interviewbit.com/problems/distribute-candy/
// First give all kids 1 candy.
// Iterate and make sure kids with more rating than their left neighbour have 1 more candy than them
// Iterate Backward and make sure kids with more rating than their right neighbour have more candy than them (if they
// alread... | ALGO | 0.999998 | 5.237012 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2018-08-23T14:08:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5ae16502... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.