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 |
|---|---|---|---|---|---|---|---|
b7d7329e-44ad-477e-90ba-ebd37356947f | roy4801/FJU_ElPsyCongroo | codebook/Graph/ShortestPath/floyd_warshall_test.cpp | /*
* Floyd warshall algorithm test
* Team: FJU_ElPsyCongroo
*/
#include "floyd_warshall.h"
#define TESTC ""
#define PROBLEM "floyd"
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
int main()
{
#ifdef DBG
freopen(PROBLEM TESTC ".in", "r", stdin);
freopen(PROBLEM ".out", "w", stdout);
#e... | ALGO | 0.999485 | 3.936359 | {
"github_metadata": {
"branch": "master",
"commit_count": 233,
"repo_created_at": "2018-07-04T08:41:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 12,
"pull_requests": 0
},
"file_meta": {
"content_id": "dcec50d... |
9e077489-4d6c-4289-9bce-5c118941203d | ReadyTalk/avian | src/main.cpp | /* Copyright (c) 2008-2015, Avian Contributors
Permission to use, copy, modify, and/or distribute this software
for any purpose with or without fee is hereby granted, provided
that the above copyright notice and this permission notice appear
in all copies.
There is NO WARRANTY for this software. See l... | TOOL | 0.957992 | 5.226574 | {
"github_metadata": {
"branch": "master",
"commit_count": 4775,
"repo_created_at": "2012-05-04T18:18:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1232,
"forks": 173,
"issues": 35,
"pull_requests": 3
},
"file_meta": {
"content_id": "a1... |
a5553b1e-7149-4095-b8fa-f8874d5c4a12 | Dharamveer21/Data-Structures-and-Algorithms | Crucial Problems/Intersection of Two Arrays.cpp | #include <bits/stdc++.h>
using namespace std;
/*
Approach -- Here we can sort first array & use binary search to find a each element of second array in present
in first array . We can store the elements in a set to store unique elements .
But we can use a more space optimised approach , we can sort both arrays & use ... | ALGO | 0.999998 | 6.041053 | {
"github_metadata": {
"branch": "main",
"commit_count": 204,
"repo_created_at": "2023-11-13T10:48: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": "c7e7d3d6f3... |
38fabfe6-d3e1-424d-b8dc-a51c99ad54b1 | Hoff22/CompetitiveProgramming | MISC/GEMA2018/Contest DP/C.cpp | #include <bits/stdc++.h>
#include <string>
#define N 100
#define MOD (1000000000 + 7)
using namespace std;
long long dp[N+1][N+1][N+1];
long long solve(int a, int b, int c){
if(a == 0 or b == 0 or c == 0){
return dp[a][b][c] = 1;
}
if(a < 0 or b < 0 or c < 0){
return 0;
}
if(dp... | ALGO | 0.999985 | 4.973654 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2024-10-24T23:39: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": "8a6f8a58594... |
979c6538-8d3b-464e-a357-0f9d64273009 | SuperBigFive/Charming_XCPC | Codeforces/Div3/820div3/B.cpp | #include <bits/stdc++.h>
#define ll long long
#define int ll
using namespace std;
const int maxn = 1e6 + 5;
int t, n;
int vis[maxn];
string s;
void init () {
for (int i = 0; i <= n; ++i) vis[i] = 0;
}
void charming () {
init ();
cin >> n;
cin >> s;
string ans;
char ch[27];
for (int i = 1; i <= 26; ++i) {
ch... | ALGO | 0.999946 | 4.573848 | {
"github_metadata": {
"branch": "main",
"commit_count": 86,
"repo_created_at": "2023-03-06T12:05:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c1129eb1e5... |
15b30294-9b92-489b-aa67-b376e9736bcd | apsallid/PandoraPFANew | v00-09/FineGranularityContent/src/Clustering/ForcedClusteringAlgorithm.cc | /**
* @file PandoraPFANew/FineGranularityContent/src/Clustering/ForcedClusteringAlgorithm.cc
*
* @brief Implementation of the forced clustering algorithm class.
*
* $Log: $
*/
#include "Pandora/AlgorithmHeaders.h"
#include "Clustering/ForcedClusteringAlgorithm.h"
using namespace pandora;
StatusCode Fo... | ALGO | 0.980973 | 6.624743 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-10-27T09:58:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "361b72cdeb... |
8abfdff5-8bca-482f-b374-29c0c2b160a9 | lengocdinhtri/LeNgocDinhTri_Buoi2 | Bai1_phan2/Bai1_c7.cpp | #include <stdio.h>
#define SIZE 15
void Swap(int *a, int *b) {
int temp = *a;
*a = *b;
*b = temp;
}
int Partition(int arr[], int low, int high) {
int pivot = arr[high];
int i = (low - 1);
for (int j = low; j < high; j++) {
if (arr[j] < pivot) {
i++;
Swap(&arr[i], &arr[j]);
}
}
Swap(&arr[i + 1], &ar... | ALGO | 0.999986 | 4.998974 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-07-17T10:09:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc33bb685ed6... |
ba8e6dab-5076-4458-b995-17ed6b59dd05 | Unsigned-Long/slam-tricks | st8-nms/src/include/nms.hpp | #ifndef NMS_HPP
#define NMS_HPP
#define FORMAT_VECTOR
#include "artwork/logger/logger.h"
#include "opencv2/opencv.hpp"
#include <cmath>
namespace ns_st8 {
static std::vector<ushort> nms1d(const std::vector<float> &vals, const ushort hws) {
std::vector<ushort> max;
ushort ws = 2 * hws + 1;
for (int i = 0... | ALGO | 0.973795 | 6.059874 | {
"github_metadata": {
"branch": "master",
"commit_count": 166,
"repo_created_at": "2022-04-28T09:56:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 89,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b7dd2... |
48145cd0-679b-4303-97dd-f617f76d249c | shubhamgyd/mission_TCS | OA/Amazon/Questions/9_Virtual_Private_Server.cpp | /*
The virtual private server on Amazon's Web Service cloud is used to run programs that help
perform calculations on large data sets. Recently, the performance of some programs has degraded.
Technical support has recommended that processes that consume a lot of main memory should be deleted.
Unfortunately, the comman... | ALGO | 0.999993 | 4.425725 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2023-09-16T13:42: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": "0ba033455... |
0da4a99a-823a-4534-b433-3cab06f0bfc1 | kahdichienja/machine_learning_mnist_dataset_cpp_practice | practice/bubble_sort.cpp | #include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <sstream>
#include <ctime>
#include <cmath>
class Singleton
{
private:
static Singleton* instance;
Singleton(){}
public:
static Singleton* getInstance(){
if (!instance)
{
instance = new Singleton... | ALGO | 0.951248 | 4.258463 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-11-07T19:10: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": "48c00b3bd056... |
6ea635db-ac30-4e67-b635-392154e36659 | ishandutta2007/codeforces-h | hogloid/normal/217/E.cpp | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<vector>
#include<list>
#define REP(i,m) for(int i=0;i<m;++i)
#define REPN(i,m,in) for(int i=in;i<m;++i)
#define ALL(t) (t).begin(),(t).end()
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define dump(x) ce... | ALGO | 0.999992 | 3.109397 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01: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": "456379cbdd87... |
c594d1aa-acf0-4680-9525-56b28cb4c52d | Charly52830/ICPC | Strings/Aho-CorasickBase.cpp | /**
* <NAME>
*
* source: https://cp-algorithms.com/string/aho_corasick.html
*/
#include<string.h>
#include<vector>
#include<iostream>
using namespace std;
const int alphabet_size = 26;
struct Vertex {
int transitions[alphabet_size];
int suffix_link = -1, exit_link = -1;
bool leaf = false;
int parent = -1;
... | ALGO | 0.999978 | 4.353227 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2019-06-25T22:38:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "423d3cfd4... |
6c00e9bc-452f-4877-b442-e8ddac202768 | Soledad89/Ubuntu_Documents | ML_GVIDMW/5.13update/complex.cpp | //#include "stdafx.h"
#include "complex.h"
inline complex complex::operator +(const complex &c)
{
return complex(real + c.real, imag + c.imag);
}
inline complex complex::operator -(const complex &c)
{
return complex(real - c.real, imag - c.imag);
}
inline complex complex::operator *(const complex &c)
{
... | ALGO | 0.900905 | 3.351511 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-05-24T14:26:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd91bebe8b... |
bbb394b0-e182-4a92-a2c8-1b54455425c6 | nguyenhien1994/c10k-problem | main.cpp | #include <bits/stdc++.h>
#include <netdb.h>
#include <signal.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include "BlockingQueue.h"
#include "Expression.h"
#define BUFFERSIZE (8 * 1024)
/* Used by acceptorb threads */
typedef struct {
int nbrCores;
int sockFd;
int nbrThreads;
} ... | WEB | 0.95304 | 5.367603 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-09-25T10:44: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": "053a567226... |
906b169d-cc06-46f6-bb5e-631488bf0f09 | Shell-Wataru/AtCoder | kakomon/arc106_c.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <limits>
#include <cmath>
#include <iomanip>
#include <functional>
#include <random>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using ll = long long;
int main()
{
... | ALGO | 0.999564 | 3.378777 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2017-04-23T13:44: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": "f8bb31c73... |
74522c79-69d6-4404-b586-bc23b75c528c | yijunyu/demo | datasets/github_cpp_10/1/77.cpp | #include "breadth_first_search.hpp"
BreadthFirstSearch::BreadthFirstSearch()
{
searchGraph = nullptr;
start = nullptr;
endCount = nowCount = 0;
}
BreadthFirstSearch::BreadthFirstSearch(EmbeddedGraph* _graph)
{
searchGraph = _graph;
start = nullptr;
endCount = nowCount = 0;
}
BreadthFirstSearc... | ALGO | 0.996922 | 4.523269 | {
"github_metadata": {
"branch": "master",
"commit_count": 162,
"repo_created_at": "2019-03-16T07:13:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83c5eda8... |
ce4bd4aa-4cdb-412b-a2af-3b6494fa01bb | msung99/Algorithm_AND_Implementation | 링크드리스트/W2_P4.cpp | #include <iostream>
#include <string>
using namespace std;
struct node {
node* next;
node* prev;
int data;
};
class doublyLinkedlist {
private:
int listSize;
node* head;
node* tail;
public:
doublyLinkedlist();
void print();
void append(int data);
void delection(int idx);
void print_reverse();
void max();
... | ALGO | 0.995187 | 4.291955 | {
"github_metadata": {
"branch": "main",
"commit_count": 964,
"repo_created_at": "2022-03-05T04:18: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": "6966306992... |
1d2db69f-20ea-4157-9fa5-42e4f7a2311d | RosettaCommons/rosetta | source/src/protocols/kinematic_closure/perturbers/FragmentPerturber.cc | // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// (c) Copyright Rosetta Commons Member Institutions.
// (c) This file is part of the Rosetta software suite and is made available under license.
// (c) The Rosetta software is developed by the co... | ALGO | 0.967794 | 6.132524 | {
"github_metadata": {
"branch": "main",
"commit_count": 11737,
"repo_created_at": "2023-11-17T16:42:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 296,
"forks": 100,
"issues": 27,
"pull_requests": 9
},
"file_meta": {
"content_id": "088f... |
f972b957-b5bf-4440-b655-29754662ba80 | xccoco/wodecode | ABC_248_Ex_Beautiful_Subsequences.cpp | #include <iostream>
#include <algorithm>
#include <math.h>
using namespace std;
const int N = 150005, M = 400;
int n, mxn, k, len;
int w[N];
#define ll(x) max(x * len, 1)
#define rr(x) min(x * len + len - 1, n)
long long ans = 0;
long long ton[M][N], p[N], a[N];
void add(int l, int r, long long val) {
int cl = l ... | ALGO | 0.999984 | 3.767154 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-08-11T11:07: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": "1bdeade8db... |
83609bbe-596f-4f8e-b0b1-411505c5d802 | zhangru-ng/hacker-rank | Algorithms/DynamicProgramming/Knapsack.cc | #include <climits>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int t;
cin >> t;
while (t--) {
int n, k;
cin >> n >> k;
vector<int> v(n);
for (int i... | ALGO | 0.999985 | 4.157253 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2016-01-25T20:25: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": "61cd3379e... |
7a028bdd-b0fb-441a-85f6-6f04092e0a28 | will-conrad/CPProjects | Assignments/Projects/slotMachine.cpp | #include<iostream>
using namespace std;
//getEmoji(n) returns the correct emoji for the number passed to it.
string getEmoji(int n) {
string cherry, orange, melon, output; //Inits
//Unicode for emojis
cherry = "\U0001F352";
orange = "\U0001F34A";
melon = "\U0001F349";
if (n == 1) { //1 - Orange
output = o... | TOOL | 0.908029 | 4.855912 | {
"github_metadata": {
"branch": "main",
"commit_count": 85,
"repo_created_at": "2021-03-16T12:29: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": "ee33613e7aa... |
579e14ac-761e-4c1d-a6bf-7158307fb231 | alexanderkoo04/cmplrsp24 | A3/Question 1.cpp | #include <bits/stdc++.h>
std::vector<std::string> reserved = {"while", "for", "switch", "do", "return"};
std::string inputStr;
bool number(std::string string) {
for (auto i : string) {
if (!isdigit(i)) {
return false;
}
}
return true;
}
bool reserve(std::string string) {
a... | ALGO | 0.979993 | 3.471839 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-28T03:07:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13446a8b64e0... |
d7117223-2e2e-4ebc-add1-9ad224d383e0 | devanshu-73/TOPS_CPP | Matrix.cpp | #include<iostream>
using namespace std;
int main()
{
int a[3][3], b[3][3], c[3][3];
cout<<"Matrix Multiplication ";
cout<<"------- Enter Matrix : 1 -------"<<endl;
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
cin>> a[i][j];
}
}
// for(int i=0; i... | ALGO | 0.99932 | 3.464183 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2023-02-21T10:15:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d20ccde0fa... |
df36fef5-8025-4a6a-a208-d5001bf0264e | pacha2880/competitive_programming_codes | D. Blocking Elements.cpp | #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <ext/rope>
#define int ll
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)a.size()
#define eq(... | ALGO | 0.999948 | 4.810027 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2022-10-18T22:33: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": "013dccb83fa... |
46183e48-fcd8-4ae3-89be-ab8a1425f69d | nemishzalavadiya/Programe | Advance Structures/BST_Traversal/pathsum.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.999972 | 5.744587 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2020-06-16T06:01:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d3710a63d... |
b78e7f1d-116d-4a36-a0e2-21d38e03f7c7 | TiredAce/MyNotion | Data Structures and Algorithms/Algorithm_set/栈与队列/1_3_1_1.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <stack>
using namespace std;
const int N = 1e5 + 10;
char str[N], n;
int cal(int a, int b, char op)
{
if (op == '+') return a + b;
if (op == '-') return a - b;
if (op == '/') return a / b;
if (op == '*') return a * b;
}
int suf_ca... | ALGO | 0.99965 | 3.624098 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2023-01-15T02:24:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f6b1dd4c... |
fed736ec-9603-40dd-8037-6b75ce6979fc | ssbadjate02/Competetive-Programming | C_Nested_Segments.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define FASTIO ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define all(x) (x).begin(),(x).end()
#define ss second
#define ff first
template<typename T,typename T1>T amax(T &a,T1 b... | ALGO | 0.999997 | 3.767607 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-03-20T05:19: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": "f35adb6a27... |
464e8737-096f-41aa-92e8-f941edc82734 | DreamZhou/Cpp_Primer_Plus-six-edition | ch08/08_04/main.cpp | #include <iostream>
#include<cstring>
struct stringy
{
char* str;
int ct;
};
void set(stringy & stry, const char *chars);
void show(const stringy &stry, size_t t = 1);
void show(const char *chars, const size_t t = 1);
int main()
{
stringy beany;
char testing[] = "Reality isn't what it used to be.";
... | TOOL | 0.987591 | 3.384935 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2017-05-30T10:19: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": "66d4e67ec... |
b8e9ed0a-de36-4073-b72f-4793efdf0b66 | ds-sww/codebase | 13307130498/assignment5/B.cpp | #include<iostream>
#include<stack>
using namespace std;
int current(char c){
switch (c){
case '^': return 4;
case '*':
case '/': return 2;
case '+':
case '-': return 1;
}
}
int instack(char c){
switch (c){
case '^': return 3;
case '*':
case '/': return 2;
case '+':
case '-': return 1;
case '(': return 0;... | ALGO | 0.999914 | 3.840195 | {
"github_metadata": {
"branch": "master",
"commit_count": 1055,
"repo_created_at": "2014-09-18T15:21:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 31,
"issues": 1,
"pull_requests": 10
},
"file_meta": {
"content_id": "0b94e... |
4827c796-c3e9-42d3-8859-68739388b2e7 | jromero132/online-judges-problem-solutions | VJudge/LightOJ/1096/1096.cpp | // Problem name: nth Term
// Problem link: https://vjudge.net/problem/LightOJ-1096
// Submission link: https://vjudge.net/solution/18055403
#include <bits/stdc++.h>
#define pb push_back
#define endl '\n'
using namespace std;
typedef vector<int> vi;
typedef vector<vi> matrix;
matrix multiply(matrix &a, matrix &b, i... | ALGO | 0.99988 | 4.197571 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2021-09-24T15:56:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b1fd6fbf... |
2584bec7-b7a8-44a1-9842-8970fa18362b | Canas/eigenfaces | src/eigenfaces.h | #pragma once
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <vector>
/* getEigenFace - Obtiene {numComp} componentes de la matriz de vectores propios {input} con la matriz {A} que son imagenes normalizadas */
cv::Mat getEigenFace(cv::Mat eigenVec, cv::Mat A, unsigned int numComp);
/... | ALGO | 0.990635 | 5.297566 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2015-07-23T08:14:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7aa904eb4... |
a7a07d5c-0d25-440d-9e43-b36fd585cf2d | sangwoo0727/Algorithm | DynamicProgramming/Algospot_JUMPGAME.cpp | #include <iostream>
#include <cstring>
using namespace std;
int check[101][101];
int board[101][101];
int N;
int jump(int n, int m) {
int k = board[n][m];
if (n == N - 1 && m == N - 1) return 1;
if (n > N - 1 || m > N - 1) return 0;
int& ret = check[n][m];
if (ret != -1) return ret;
return ret = (jump(n + k, m)... | ALGO | 0.999988 | 5.557736 | {
"github_metadata": {
"branch": "master",
"commit_count": 1100,
"repo_created_at": "2019-01-02T16:17:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a73122d... |
1622327a-77bb-44e1-9925-8b81d65b877a | vivaswat19/Competetive-Archive | CodeChef/Starter30/E.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <limits.h>
#include <queue>
#include <math.h>
using namespace std;
#define ll long long
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
vector<int> arr1(n, 0);
vector<int> arr2(n, 0);
... | ALGO | 0.999955 | 3.641003 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-01-05T18:17:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11b21355a226... |
8630f61a-beec-4164-90b6-0a3ef9e456c6 | lmontigny/MPI | ETH_course/simpson5.cpp | // Example codes for HPC course
// (c) 2012 <NAME>, ETH Zurich
#include "simpson.hpp"
#include <cmath>
#include <iostream>
#include <mpi.h>
// The function to integrate
double func(double x)
{
return x * std::sin(x);
}
int main(int argc, char** argv)
{
MPI_Init(&argc,&argv);
int size;
int rank;
MPI_Comm... | ALGO | 0.989859 | 5.265139 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2017-10-29T13:19:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d4554bd1... |
ec804f3b-110d-425c-8dd2-0d9c134803ce | NinaKate/CCR | src/HW3/P1/src/P1P3a.cpp | #include <mpi.h>
#include <stdio.h>
#include <cmath>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <math.h>
#include <vector>
#include <sstream>
#include "errchk.hpp"
using namespace std;
vector<float> compsq(float real,float imag){
float rsq = real*real-imag*imag;
float imsq = 2*real*imag;
v... | ALGO | 0.999702 | 4.715328 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2017-10-02T21:24: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": "098aa5fd... |
32f350db-23ea-4a74-84bc-9be53bc1447d | farid-1604045/leetcode-solutions | 0088-merge-sorted-array/0088-merge-sorted-array.cpp | class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
vector<int> left_half(m);
vector<int> right_half(n);
for (int i = 0; i < m; ++i)
left_half[i] = nums1[i];
for (int j = 0; j < n; ++j)
right_half[j] = nums2[j];
... | ALGO | 0.999964 | 5.398651 | {
"github_metadata": {
"branch": "main",
"commit_count": 785,
"repo_created_at": "2024-05-28T04:46:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d536daf0b2... |
63a4efa8-d8d2-4f57-986d-ce184076b79b | shivam-modi/algos | graphs/bellmanford.cpp | // Directed graph only, we have to make undirected graph as bidirected graph to run this algo (having no negative edge)
// helps to detect negative edge cycle
// helps when there is negative edge
// single source shortest path to every node
// have to run the relxtaion to v-1 times because atmost v-1 nodes have no de... | ALGO | 0.999906 | 5.898203 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2023-05-15T02:52: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": "09f98b8a5... |
fc7cef1b-1228-43f9-a7e8-6212e23b3cbc | Porwal-Hemant/codeforces_900 | mul2Div6.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define debug(x) cout << #x << " = " << x << endl
// int solveDiv6( int n )
// {
// int num = n ;
// while( num % 6 == 0 )
// {
// num = num / 6 ;
// }
// return num ;
// }
void solve... | ALGO | 0.999877 | 3.941448 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-03-08T16:32: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": "8dd702c9a911... |
e041cf3d-227d-46ba-b992-d0617fe750d7 | OxDuke/Bilevel-Planner | third_party/mosek/9.0/tools/examples/fusion/cxx/TrafficNetworkModel.cc | //
// Copyright: Copyright (c) MOSEK ApS, Denmark. All rights reserved.
//
// File: TrafficNetworkModel.cc
//
// Purpose: Demonstrates a traffic network problem as a conic quadratic problem.
//
// Source: <NAME>, "Convexity Checking in Large-Scale Optimization",
// OR 53 --- Nottingham 6-8 Septembe... | ALGO | 0.990268 | 5.913415 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2019-05-07T18:14:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 39,
"forks": 10,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5f518b... |
e6ef9548-1ff7-4e27-b8a8-b4e8f9470253 | Fadoua-Charkaoui/adventOfCode | 2019/02/02.cpp | #include <iostream>
#include <fstream>
#include <vector>
class computer
{
private:
int counter = 0;
std::vector<long> list_int;
public:
void fill_list()
{
std::ifstream infile("input.txt");
std::string line;
int pos;
std::string token;
infile >> line;
... | ALGO | 0.999628 | 4.234263 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2020-06-03T17:00:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d7207e199... |
5a3b162a-c917-46b5-be60-72268419985d | Zhuangpx/ACM_XCPC_CP | Problem/code/常规/2022.1_智乃酱的子集与超集.cpp | /*
* @Autor: <NAME> ( Zhuangpx )
* @Date: 2022-01-28 00:53:41
* @LastEditors: <NAME> ( Zhuangpx )
* @LastEditTime: 2022-02-13 16:37:47
* @FilePath: \apricitye:\桌面\ACM\Problem\code\常规\2022.1_智乃酱的子集与超集.cpp
* @Description: Zhuangpx : Violet && Apricity:/ The warmth of the sun in the winter /
*/
#pragma GCC optimi... | ALGO | 0.999798 | 4.073599 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-04-24T17:35: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": "e150d03a1a7... |
13444786-9048-4140-a2eb-35eefd4df3a5 | kaloronahuang/KaloronaCodebase | Contests/Nowcoder-OI-Monthly-12/C.cpp | // C.cpp
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 200;
int ch[int(1e7) + 200][2], ptot = 1, prefix[MAX_N], n, seq[MAX_N];
void insert(int x)
{
int p = 1;
for (int i = 30; i >= 0; i--)
{
int bit = (x >> i) & 1;
if (ch[p][bit] == 0)
ch[p][bit] = ++p... | ALGO | 0.999977 | 4.232945 | {
"github_metadata": {
"branch": "master",
"commit_count": 554,
"repo_created_at": "2018-11-02T01:32:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b3f86f... |
53a8fcd6-28a9-4a23-bfa3-714c3cbf7bdb | dreyus95/AVSP_SourceQualityPrediction | CodeJamCrawler/dataset/14_16300_18.cpp | #include "cstdio"
#include "iostream"
#include "cmath"
#include "cstring"
#include "algorithm"
#include "queue"
#include "set"
#include "deque"
#include "stack"
#include "map"
#include "vector"
#include "ctime"
#include "cassert"
#include "cctype"
#include "cstdlib"
#include "bitset"
#include "iomanip"
#include "list"
... | ALGO | 0.991435 | 3.349263 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2017-06-08T21:00:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "095861ccb... |
b0c854ae-6a3b-4558-9d0d-42a7ec2f88fd | Johniel/contests | codeforces/382div2/B/main.cpp | #include <bits/stdc++.h>
#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))
using namespace std;
typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;
template<typename P, typename Q>
ostream& operator << (ostream& os, pair<P, Q> p)
{
os << "(" << p.first <<... | ALGO | 0.999222 | 3.994241 | {
"github_metadata": {
"branch": "master",
"commit_count": 2608,
"repo_created_at": "2015-12-28T16:38: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": "cc43a0a... |
46da7963-935f-42a6-88ef-e51683359038 | Seann0425/LeetCode | finished/1448. Count Good Nodes in Binary Tree.cpp | #include <bits/stdc++.h>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
struct TreeNode {
int val;
TreeNode *left;
TreeNode *righ... | ALGO | 0.999882 | 5.645175 | {
"github_metadata": {
"branch": "main",
"commit_count": 659,
"repo_created_at": "2024-05-02T09:26: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": "82a125e1ea... |
c5736048-ee94-41bc-a920-9a29bc97ea6b | aasthamuskan/cpp | c++/linked list/insertion.cpp | #include <iostream>
using namespace std;
// Node class represents each node in a linked list
class Node {
public:
int data;
Node* next;
Node(int value) {
data = value;
next = nullptr;
}
};
// LinkedList class to manage the linked list
class LinkedList {
public:
Node* head;
Li... | ALGO | 0.99874 | 6.587742 | {
"github_metadata": {
"branch": "main",
"commit_count": 89,
"repo_created_at": "2024-05-31T10:34:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be9b88ec5c9... |
2cf4568b-479d-4c64-813a-19e9f671e35d | YttriumWillow/OI | Problems/P9575.cpp | #include <bits/stdc++.h>
#define i64 long long
#define endl '\n'
#define qwq puts("fzy qwq ~");
using namespace std;
const int N = 1e5 + 10;
int n, a[N], d;
int cnt, c0, c1;
int res[N];
inline void solvex()
{
cout << 1 << endl;
for (int i = 1; i <= n; ++i)
cout << (i & 1);
}
int main()
{
ios::sync_with_stdi... | ALGO | 0.99975 | 3.462932 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2023-08-30T03:08:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "776075ad6fc... |
2baf8fa9-3308-4ced-b662-a2ca659657e1 | vdusek/VUT_FIT | mitai-sem3/gal/src/graphUtils.hpp | /**
* @file graphutils.hpp
* @brief Graph utilities.
* @author <NAME>, <<EMAIL>>
* @date 12-09-2020, last rev. 12-15-2020
*/
#ifndef GRAPHUTILS_INCLUDED
#define GRAPHUTILS_INCLUDED
#include "matrix.hpp"
namespace GraphUtils {
/**
* @brief Computes graph of the input graph in the form of adjacency matrix.
*
*... | ALGO | 0.999833 | 6.389592 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2018-06-23T09:18:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b47d5bf28... |
d55a22ae-a182-4c34-b0c8-4913a8ffec28 | NgTienHungg/PTIT-Source | SPOJ PTIT/P146SUMB.cpp | // https://www.spoj.com/PTIT/problems/P146SUMB/
// P146SUMB - ROUND 6B - Tập vẽ
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
for (int i = 0; i <= n; i++)
{
for (int j = 0; j < n - i; j++)
cout << " ";
for (int j = 0; j <= i; j++)
... | ALGO | 0.999992 | 4.002505 | {
"github_metadata": {
"branch": "main",
"commit_count": 106,
"repo_created_at": "2021-07-04T02:14:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 130,
"forks": 36,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c59eef6... |
997a9f9b-00ee-40df-b76f-6a5a74345e78 | BrArroyo/Asignatura_de_AEDA | Practicas/Practica_07_arbol_binario_busqueda/include/ABB.h | /**
* Archivo ABB.h: clase plantilla ABB
*
* Universidad de La Laguna
* Escuela Superior de Ingenieria y Tecnologia
* Grado en Ingeniería Informática
* Asignatura: Algoritmos y Estructura de Datos Avanzados
* Curso: 2º
* Práctica 07: Implementación de árboles binarios de búsqueda
*
* @author <NAME>
* @email... | ALGO | 0.999888 | 4.736602 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2022-03-01T15:36:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c646b63b... |
1d33b79e-14da-4696-b797-815d0b0777af | brownspy1/Phitron | Semister 02/Data Structure/Week 03/Mid Term Exam/Queries_Again.cpp | #include <iostream>
using namespace std;
class Node
{
public:
Node *prev;
int value;
Node *next;
Node(int value)
{
this->prev = NULL;
this->value = value;
this->next = NULL;
}
};
int count(Node *Head);
void insert_Head(Node *&Head, Node *&Tail, int Value);
void insert_... | ALGO | 0.99958 | 4.088844 | {
"github_metadata": {
"branch": "main",
"commit_count": 552,
"repo_created_at": "2024-04-23T17:31: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": "fb7bbb656a... |
16fac2cb-5f59-43cc-8e5e-b26f464f8e24 | junpfeng/algorithm | DP_and_tx/backbag.cpp | /*************************************************************************
> File Name: backbag.cpp
> Author:
> Mail:
> Created Time: 2019年06月14日 星期五 21时37分37秒
> n个重量和价值分为为wi和vi的物品集合里面,挑选总重量不超过W的物品集合
> 求所有方案中挑选价值总和最大值
> 输入:商品数量n、每个商品的重量和价值、被挑选的总重量w
****************************************************... | ALGO | 0.999997 | 4.5438 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-02-17T05:09:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ecfe7e100b... |
9007b56a-8709-4378-843d-a2868482eaa5 | YvanMokwinski/WGRID | src/include/bms_template_shape_lagrange.hpp | #pragma once
#include "bms_template_shape_lagrange_splz.hpp"
template<wmesh_int_t ELEMENT_,
typename T>
struct bms_template_shape_lagrange
{
static inline wmesh_status_t eval(wmesh_int_t degree_,
const_wmesh_int_p diff_,
wmesh_int_t c_storage_,
wmesh_int_t c_m_,
... | ALGO | 0.991792 | 5.893931 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2020-04-25T06:39: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": "e2f73d7a4... |
b1af0486-9235-48c2-95cf-d9064263aada | hyattden/Programming-Practice | uva/uva_674.cpp | /* UVa problem: 674
*
* Topic: Dynamic Programming
*
* Level: easy
*
* Brief problem description:
*
* Given n, find how many ways to create that number with specified coin values
*
* Solution Summary:
*
* Just specify array which stores the number of ways to create given n for any n
*
* Used Resourc... | ALGO | 0.999648 | 4.118506 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-07-07T01:53:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b36467aa3... |
e6c0c389-877d-401b-96fe-79f91356eaf4 | vikkastiwari/competitive-coding-questions | challenge/4-binary-search/1-BS-1D/10-min-in-rotated-sorted-array.cpp | #include <bits/stdc++.h>
using namespace std;
// Find min in rotated sorted array
/**
* @brief search element more optimized
* TC: O(logn)
* SC: O(1)
*
* @param arr
* @param target
* @return * int
*/
int findMinElement(vector<int> arr){
int low = 0 , high = arr.size()-1;
int minVal = INT_MAX;
... | ALGO | 0.999982 | 5.519654 | {
"github_metadata": {
"branch": "main",
"commit_count": 394,
"repo_created_at": "2021-02-24T10:07: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": "7a85c74194... |
dc039128-6643-4376-a57c-7a04e2e1b225 | Pavithran17/Infix_to_postfix | infixtopostfix.cpp | #include <iostream.h>
#include <string.h>
#include <ctype.h>
#include <conio.h>
const int MAX=50;
class infix
{
private:
char target[MAX], stack[MAX]; char *s, *t; int top;
public:
infix();
void push(char c);
char pop();
void convert(char *str);
int priority (char c);
... | ALGO | 0.999934 | 4.023815 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-09-23T13:06: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": "51615b2b09c7... |
26d240af-7936-4f7f-bd5b-3583c5cb4952 | lemoneid/1.do-exercises | Algorithm/LeetCode/54.螺旋矩阵.cpp | /*
* @lc app=leetcode.cn id=54 lang=cpp
*
* [54] 螺旋矩阵
*/
// @lc code=start
class Solution {
public:
vector<int> spiralOrder(vector<vector<int>>& matrix) {
int left = 0, right = matrix[0].size() - 1;
int up = 0, down = matrix.size() - 1;
vector<int> ans((right + 1) * (down + 1));
... | ALGO | 0.999993 | 6.843995 | {
"github_metadata": {
"branch": "master",
"commit_count": 169,
"repo_created_at": "2020-04-28T11:59: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": "c5c0505c... |
56eb4624-8858-4b0d-94e6-73ede326aca8 | yuiop8747/ps | scpc/2019SCPC_3.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <vector>
#include <set>
#include <stack>
#include <functional>
#include <queue>
#include <math.h>
#include <memory.h>
int readInt();
long long readLong();
long long x, y;
void GatherInput() {
x = readLong();
... | ALGO | 0.999886 | 3.689415 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2020-11-14T09:40: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": "bbae6a6df... |
5f954fe8-575c-4756-9278-fc1392aeccad | riishapKumar/cpp-Algorithm-Examples | include/SegmentsIntersect.hpp | //
// algorithms - some algorithms in "Introduction to Algorithms", third edition
// Copyright (C) 2018 lxylxy123456
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either ver... | ALGO | 0.999248 | 5.706836 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-07-25T23: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": "898e12aae45e... |
4d6804e3-61c9-48e6-89a5-06e132776341 | Klightsey/CS-1-Fall-2019 | CS 1 Fall 2019/Final Project/Final Project/Source.cpp | #include "functions.h"
#include "GlobalsConstants.h"
#include <fstream>
#include <iostream>
#include <string>
#include <conio.h>
using namespace std;
string OpenFileName = "";
//************************************************
//Function to display a message and prompt user to continue
//*****************************... | TOOL | 0.949052 | 3.822842 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-02-06T16:28:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e8916f66d... |
030ff7e0-2bce-45a3-ad08-6632ab54a695 | SimeonHristov99/FMI_Semester_2 | Object-Oriented-Programming/Week1/Seminar/Solution.cpp | #include "pch.h"
#include <iostream>
#include <iomanip>
const int NAME = 28;
const int MAX_PRISONERS = 28;
struct Prisoner
{
int ID;
char name[NAME];
int timeLeft; //in years
};
struct Prison
{
char name[NAME];
Prisoner* ptrPrisoners[MAX_PRISONERS];
void printPrison(Prison& prison, int size);
void sortptrTabl... | ALGO | 0.989786 | 3.977992 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2019-03-10T12:29: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": "08643cd1a... |
d9664306-2b7e-4b6d-a179-d729eb8c79fb | MiichaelD/c_cpp | youtube/Tetris/Matrix.h | /*
Description: Design the game of Tetris.
Programmer: <NAME>
Date: Sep 12, 2016.
*/
#include <iostream>
#include <vector>
template<class T>
using Matrix = std::vector<std::vector<T>>;
template<class T>
Matrix<T> createMatrix(uint32_t size){
return Matrix<T>(size, std::vector<T>(size));
}
template<class T>
M... | ALGO | 0.986605 | 5.808125 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2016-03-06T00:23:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6b263efd... |
cdef797f-af55-46d7-9c6e-296ae5993eaa | fahadahbd/DSA | Binary Search/contaainEvenNumberOfDigits.cpp | /*
Given an array nums of integers, return how many of them contain an even number of digits.
Example 1:
Input: nums = [12,345,2,6,7896]
Output: 2
Explanation:
12 contains 2 digits (even number of digits).
345 contains 3 digits (odd number of digits).
2 contains 1 digit (odd number of digits).
6 contains 1 digit ... | ALGO | 0.999757 | 5.836995 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2022-06-11T23:45:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec7aa57a4... |
1fa21fa2-e7a2-480f-ba31-f7037adf1b24 | DraSoGo/Competitive_Programming | Other/0280_C-Vacation.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int n,k;
cin >> n;
int A[n][3],DP[n][3];
int ans = 0;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < 3; j++)
{
cin >> A[i][j];
if (i == 0)
... | ALGO | 0.999972 | 3.895174 | {
"github_metadata": {
"branch": "main",
"commit_count": 150,
"repo_created_at": "2024-03-17T07:23:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d046fbd996... |
fae9a7cc-5d2a-4197-aff2-f9f13161b67c | angel-utn/programacion1-20242c | Semana 08/Martes/ejemplo02.cpp | #include <iostream>
using namespace std;
/// dracula theme for code::blocks
/**
Hacer un programa que determine si un número ingresado es primo o no.
*/
bool esPrimo(int n);
void muestrarPrimosEntreRango(int inicio, int fin);
int main()
{
int inicio, fin;
cout << "Ingrese inicio: ";
cin >> inicio;
... | ALGO | 0.994808 | 3.922317 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2024-08-05T11:37:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a587b035eb8... |
abe45dd2-b302-48cc-ae81-3537095a61c5 | hjiang13/LLM4IR | results/Task2_IR_Decompilation/DecompiledResuts_Human_x_164_O1/Gemma_Huamn_x_164_O1_decompiled/CPP_25.cpp | ```c
#include <stdlib.h>
typedef struct _Vector_base {
struct _Vector_base_impl_data {
int* _M_start;
int* _M_finish;
int* _M_end_of_storage;
} _M_impl;
} std_vector;
void factorize (std_vector *result, int n) {
int i = 0;
int divisor = 2;
int *start = (int*)malloc(sizeof... | ALGO | 0.998287 | 5.088728 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-05-21T20:32:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c12445635e... |
8a4b5c52-f4e7-4d04-bf6c-aa2752a5c7f1 | bharat787/DSA | addTwoNumber.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* addTwoNumbe... | ALGO | 0.99995 | 6.304708 | {
"github_metadata": {
"branch": "master",
"commit_count": 163,
"repo_created_at": "2020-07-08T13:44: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": "ff996b27... |
12c15509-3ee9-4124-a5c1-917a2866f0e8 | gilbertoalexsantos/judgesolutions | Solved/UVA/@UVA 12125 - March of the Penguins/12125 - March of the Penguins.cpp | //Author: <NAME>
//Website: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3277
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <queue>
#include <cmath>
#include <map>
using namespace std;
typedef pair<int,int> ii;
... | ALGO | 0.999698 | 3.22762 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2014-12-30T06:33: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": "053e8576e... |
4aa6bfeb-06f9-435f-b8bf-587858b6f87c | qqricky/XCPC_Tranning | PTAK.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N=1e5+10;
unordered_map<string,int>du;
map<string,vector<string> >mp;
unordered_map<string,int>lev;
set<string>s;
vector<string>ans[100000];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin>>... | ALGO | 0.999817 | 3.466444 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-11-23T06:42: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": "df4f56c951... |
78f92210-2884-423d-981b-c4c0945cacdf | MatthieuGA/CNA-game-of-stone | src/Oriented_Graph.cpp | /*
** EPITECH PROJECT, 2025
** Game of stones
** File description:
** Oriented Graph
*/
#include "Oriented_Graph.hpp"
Oriented_Graph::Oriented_Graph()
{
}
Oriented_Graph::~Oriented_Graph()
{
}
void Oriented_Graph::add_plottings(std::string node1, std::string node2)
{
nodes[node1]->plotting_against.push_back(nod... | ALGO | 0.937096 | 4.372506 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2025-03-03T09:23: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": "32e3af8bce8... |
4bacabeb-997d-485a-9d58-603fbe1b612c | dreamsxin/example | algorithm/算法的乐趣代码/code07/gs4/gs4.cpp | // gs4.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
//#include <cstdio>
//#include <cstring>
#include <algorithm>
//using namespace std;
const int UNIT_COUNT = 5;
const int INFINITE = 100000000; // 相对无穷大
typedef struct tagPartner
{
char *name; //名字
int weight[UNIT_COUN... | ALGO | 0.999369 | 3.776757 | {
"github_metadata": {
"branch": "master",
"commit_count": 2757,
"repo_created_at": "2014-12-02T09:30:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 184,
"forks": 51,
"issues": 1,
"pull_requests": 5
},
"file_meta": {
"content_id": "d567... |
777aee23-928f-489a-adc5-d79c28481c85 | RomantsovS/Sadgewick | 02_Principles_of_algprithms_analysis/2-Analitycs.cpp | #include <iostream>
#include <list>
#include <string>
#include <forward_list>
#include <algorithm>
#include <functional>
#include <iterator>
#include <fstream>
#include <sstream>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <tuple>
#include <regex>
#include <random>
#include ... | ALGO | 0.99068 | 3.94594 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2019-04-06T05:43: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": "96fddc2a9... |
18295b7c-a093-45c5-b16e-cce802c66f25 | trdln/First-Main-folder-of-PP1-2 | PROgrammer/fd.cpp | #include <bits/stdc++.h>
using namespace std;
string s,s1,s2;
int n,n1,cr,cnt,sum;
float ans;
map<pair<string,string>,float> m1;
vector <pair<pair<string,string>,float> > v;
bool cmp(pair<pair<string,string>,float> p,pair<pair<string,string>,float> p1)
{
if(p.second > p1.second)
{
return false;
}
... | ALGO | 0.998621 | 3.707695 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2021-01-26T12:40: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": "3dd43d191f4... |
682bfd26-283d-488f-8ec4-e943a1ebeb4d | shenchi/Octree | src/Octree.h | #pragma once
#include "Vector3.h"
#include "AABB.h"
#pragma pack(push, 4)
struct NodeBoundingBox
{
vec3 center;
float halfSize;
inline operator AABB() const { return AABB(center, halfSize); }
};
#pragma pack(pop)
template<typename T>
struct OctreeData
{
OctreeData<T>* next;
T* object;
//
inline const AAB... | ALGO | 0.966051 | 5.516968 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2016-10-28T20:24:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f0c9f2691... |
d31925ee-f40c-4bd7-8377-757ae37eae05 | Phoenix-Xie/algorithm_training | 2018.3.28/sudoku_POJ2676.cpp | #include <stdio.h>
#include <bitset>
using namespace std;
int line[10];
int colum[10];
int maxti[10];
int m[11][11];
int point[90][2];
int addbit(int x, int & n){
switch(x){
case 1:
n = n & 0x1;
break;
case 2:
n = n & 0x2;
break;
case 3:
n = n & 0x4;
break;
case 4:
n = n & 0x8;
brea... | ALGO | 0.999312 | 3.922055 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-05-29T12:00: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": "fd62167471... |
19a1ffab-6ffa-40a5-814a-f54701fac835 | souffle-lang/ppopp19 | souffle_doop/souffle/src/UnionFind.h | /*
* Souffle - A Datalog Compiler
* Copyright (c) 2017 The Souffle Developers. All Rights reserved
* Licensed under the Universal Permissive License v 1.0 as shown at:
* - https://opensource.org/licenses/UPL
* - <souffle root>/licenses/SOUFFLE-UPL.txt
*/
/*********************************************************... | ALGO | 0.973094 | 7.20686 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-01-07T06:51:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e46f19fb19c... |
84fcccb0-9322-4443-971f-6fe06d3cdc6f | irajvardhan/hell-vim | tree_inorder_using_min_next.cpp | #include<iostream>
using namespace std;
typedef struct Node{
struct Node* left;
struct Node* right;
int val;
}Node;
Node* newNode(int val){
Node* node = new Node();
node->left = NULL;
node->right = NULL;
node->val = val;
return node;
}
// returns min value node in BST
Node* findMin(Node* root){
if (... | ALGO | 0.999985 | 4.351645 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-09-26T03:46: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": "457ede57c5... |
6dda73db-1b93-41ed-a742-b18fa0600efb | SajalRuhela017/CPP_Programs | Codeforces/Round #881/D.cpp | /** ॐ
* author : rhsajal_017
**/
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define int long long
const int N = 8e5 + 6;
vector<int> b(N);
int a[N], m;
void func(int x, int y = -1)
{
if(x != 1 && b[x].size() == 1)
a[x] = 1;
for(auto i: b[x])
{
if(... | ALGO | 0.999843 | 4.675498 | {
"github_metadata": {
"branch": "main",
"commit_count": 242,
"repo_created_at": "2022-12-19T14:18:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cdd78883f8... |
90fb68d3-0e8d-4990-860a-29faea2f3d39 | AmritAnand9811/cpp | i.cpp | // insertion sort
#include <iostream>
using namespace std;
int main()
{
int array[6], n;
cout << "Enter the number of elements: ";
cin >> n;
cout << "Enter the elements: ";
for (int i = 0; i < n; i++)
{
cin >> array[i];
}
// Insertion Sort
for (int i = 1; i < n; i++)
... | ALGO | 0.999858 | 5.064833 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-08-02T18:14: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": "2d63bedf87eb... |
b2220129-edb8-4b2d-9db9-4f687a11b6a4 | fmorenovr/ComputerScience_UNI | CC262-Algoritmos/Tree/Binary-Tree/Red-Black/rbtree.cpp | #include <iostream>
#include <stdio.h>
using namespace std;
int power(int x , int y){
if(y==0)
return 1;
return x*power(x,--y);
}
struct node{
int key;
node* right;
node* left;
node* parent;
char color;
};
struct t{
node* root;
node* nil;
};
node* NIL = new node;
node* newNode(int ikey){
node* z = n... | ALGO | 0.999465 | 3.723908 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-04-23T05:42:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3f2a1f2... |
524a5d7f-34b3-4b16-9b42-0fe4ab592ebd | catboost/catboost | contrib/libs/cxxsupp/libcxxmsvc/include/__algorithm/move_backward.h | //===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | ALGO | 0.998182 | 7.799 | {
"github_metadata": {
"branch": "master",
"commit_count": 49562,
"repo_created_at": "2017-07-18T05:29:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8472,
"forks": 1231,
"issues": 604,
"pull_requests": 23
},
"file_meta": {
"content_id":... |
834558ca-06a6-4f94-8212-2ffaa6d150ed | myunbin/algorithm-BOJ | Code/2623.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
const int MAX = 1001;
int N, M, inDegree[MAX];
vector<int> adj[MAX];
void topoSort(){
int result[MAX];
queue<int> Q;
for (int i = 1; i <= N; i++){
if (inDegree[i] == 0) Q.push(i);
}
for (int ... | ALGO | 0.999998 | 4.843799 | {
"github_metadata": {
"branch": "master",
"commit_count": 510,
"repo_created_at": "2020-03-10T16:50: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": "58701a41... |
127cfe75-e0c6-484a-aecc-2100bed5ec11 | TakefumiYamamura/programming_contest | agc5-c.cc | #include <iostream>
using namespace std;
int check_max(int n, int a[]){
int max = 0;
for (int i = 0; i < n; ++i)
{
if (a[i] > max)
{
max = a[i];
}
}
return max;
}
int main(){
int n;
int a[101];
int check[101] = {0};
cin >> n;
for (int i = 0; i < n; ++i)
{
cin >> a[i];
}
int max = check_max(n,... | ALGO | 0.999894 | 3.456169 | {
"github_metadata": {
"branch": "master",
"commit_count": 266,
"repo_created_at": "2015-09-26T16:01:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 41,
"pull_requests": 0
},
"file_meta": {
"content_id": "3af2a2a... |
864450c7-1a13-4c59-aad9-978a8aae941a | TurtleShip/ProgrammingContests | Solutions/UVa/403/403.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define pb(x) push_back(x)
int max_N = 60;
char page[65][65];
// I copied this array from
// http://online-judge.uva.es/board/viewtopic.php?f=5&t=5118
// I didn't want to waste time typing this.
// It would've been nice if UVa provided ... | ALGO | 0.996246 | 3.191743 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2014-04-19T08:12:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6fb610e3... |
a945f271-1329-4baa-a6a9-7c493e90e83a | codeza-ai/design-and-analysis-of-algorithms | MaxSubarraySum.cpp | #include <limits.h>
#include <iostream>
#include <stdbool.h>
using namespace std;
int max(int a, int b){
return a>b?a:b;
}
int max(int a, int b, int c){
return max(a, max(b, c));
}
int maxCrossingSum(int arr[], int l, int m, int h){
int sum = 0;
int left_sum = INT_MIN;
for(int i = m;i>= 0;i--){
... | ALGO | 0.999903 | 4.739691 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-03-01T05:39: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": "963427b9356... |
e4621a2f-7bcd-4d4d-9440-ac258f41c1f9 | rumblefool/Far_Behind | Finalized_Codes/Strings/Aho_Corasick.cpp | const int K = 26;
// remember to set K
struct Vertex {
int next[K]; bool leaf = false;
int p = -1;char pch;
int link = -1;
int go[K];
Vertex(int p=-1, char ch='$') : p(p), pch(ch) {
fill(begin(next), end(next), -1);
fill(begin(go), end(go), -1);
}
};
vector<Vertex> aho(1);
vo... | ALGO | 0.999868 | 3.640629 | {
"github_metadata": {
"branch": "master",
"commit_count": 332,
"repo_created_at": "2018-10-13T18:38:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e31fa90e... |
2ceb12ed-1ae4-4e48-9d1e-c441f806aced | Atharv-09/OLD_DSA | Leet/ConttainerWithMaxWater.cpp | #include<bits/stdc++.h>
using namespace std;
void findMaxWater(vector<int> height){
int n = height.size(); // 9
int l = height[0];// 0
int h = height[n-1]; // 8
// int k = n-1;
int minHei=0,ans=0,maxWater=0;
for(int i=0;i<n;i++){
if(l<h){
minHei = ... | ALGO | 0.999861 | 4.19721 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-13T04:12: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": "307d80985512... |
60b11660-cec3-45ce-87f3-237dce28f67a | zxyDEDIRE/ACM_CODE | 牛牛/牛客竞赛字符串专题班Hash/C.cpp | /*
嵌套变量重复
特殊样例 0 1 2 n
数组越界
开long long
*/
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
using ull=unsigned long long;
using ll=long long;
using pii=pair<int,int>;
const int dx[]={0,0,1,-1,1,-1,1,-1};
const int dy[]={1,-1,0,0,1,-1,-1,1};
const int mod=998244353;
const int inf=0... | ALGO | 0.999931 | 3.731208 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2023-12-11T12:46:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a8351cd3... |
5d78cfb6-fc65-4344-9d11-b9851740b9d9 | firewood/topcoder | atcoder/abc_075/d.cpp | // D.
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long LL;
typedef pair<LL, LL> LLLL;
int main(int argc, char *argv[])
{
LL n, k;
cin >> n >> k;
vector<LLLL> v;
for (LL i = 0; i < n; ++i) {
LL x, y;
cin >> x >> y;
v.push_back(LLLL(x, y));
}
sort(v.begin()... | ALGO | 0.999929 | 3.633007 | {
"github_metadata": {
"branch": "master",
"commit_count": 4451,
"repo_created_at": "2011-04-18T02:33:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb63bd... |
75d3faf1-b00a-42c4-aafb-e881a0fb1260 | AbhiKangane/DSA_in_CPP | Graph/Topological_sort.cpp | // topological sort: It can't apply on cyclic group
// linear ordering of vertices such that for every edge(u,v), u is always appears before the v
// this is find by using Kahn's algorithm
#include<iostream>
#include<unordered_map>
#include<vector>
#include<list>
#include<queue>
#include<stack>
using namespa... | ALGO | 0.999998 | 5.970917 | {
"github_metadata": {
"branch": "main",
"commit_count": 190,
"repo_created_at": "2023-08-12T10:42:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "684ca26c3e... |
fedfef87-375a-412c-baa4-b94a6051ad5a | Mzhangry/code_MzhangRy | 比赛/2023国庆模拟/D4/C.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int read() {
int x = 0, w = 1;
char c = 0;
while (c < '0' || c > '9') {
if (c == '-') w = -1;
c = getchar();
}
while (c >= '0' && c <= '9') {
x = x * 10 + c - '0';
c = getchar();
}
return x *... | ALGO | 0.999946 | 3.983855 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2022-07-20T00:59: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": "cc15873f6... |
e44e44db-48b8-4a60-8413-d5429c0bc09a | pravahanj/Data_Structure-and-Algorithm-CodingNinjas.com | Tries and Huffman Coding/Auto complete.cpp | /*
Auto complete
Given n number of words and an incomplete word w. You need to auto-complete that word w.
That means, find and print all the possible words which can be formed using the incomplete word w.
Note : Order of words does not matter.
Input Format :
The first line of input contains an integer, that denotes t... | ALGO | 0.999716 | 5.245685 | {
"github_metadata": {
"branch": "main",
"commit_count": 223,
"repo_created_at": "2021-10-30T09:49:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 34,
"forks": 26,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "1049751c... |
dbc0875e-81bd-4c92-8050-b5a9eca5166c | SEEWON/Algorithm | BOJ/2108.cpp | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
vector<int> v;
vector<int> freq_v;
//-4000~4000의 배열
int arr[8001] = {0};
int main(void) {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
cin >> t;
int avg = 0;
for (int i = 0; i < t; i++... | ALGO | 0.999804 | 3.684726 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2021-09-02T02:05: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": "228faeb0c... |
fc05b670-b393-416e-8bd4-71a74e85681b | siddhanttomar2003/CP | 1905-count-sub-islands/1905-count-sub-islands.cpp | class Solution {
public:
void dfs2(int sr, int sc, map<pair<int, int>, int>& is_visited2,
vector<vector<int>>& grid2, map<pair<int, int>, int>& is_visited,
int n, int m, bool& check) {
if (is_visited.find({sr, sc}) == is_visited.end()) {
check = false;
}
... | ALGO | 0.999796 | 5.912041 | {
"github_metadata": {
"branch": "main",
"commit_count": 3377,
"repo_created_at": "2023-10-03T09:03: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": "585d79b84... |
84bb868c-1b6b-4a20-bd80-4a8de2451e83 | nya3jp/icpc | uva/solved/105/10516.cc | /*
* 固定長整数クラス
* 扱えるのは非負の数のみ!
*/
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
#define IL inline
#define FBO friend inline bool operator
template<int N>
struct integer {
typedef unsigned int I;
typedef long long int II;
typedef integer<N> T;
typedef const T& CRT;... | ALGO | 0.999618 | 3.930533 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2012-05-15T15:59:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1dc2a98141... |
d88f5558-c7e5-4f87-ad51-81f6a2db04da | anuwu/Competitive-Programming | GeeksForGeeks/longest_palindromic_substring.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
void lps (string &A)
{
int i, j, l, pallen, pali, palj, L = A.length();
vector<vector<bool>> dp (L, vector<bool> (L, false)) ;
pallen = 1 ;
pali = palj = 0 ;
for (i = 0 ; i < L ; i++)
dp[i][i] = true ;
for... | ALGO | 0.999858 | 4.727202 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2020-06-20T18:49:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fddbf6fbb... |
7c035eae-2c3b-445e-8738-339578218638 | Sanketniza/DSA-With-CPP | DSA With Sanket/Graph/Questions Practice/22_Creating_Print.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
vector<vector<int>> printAdjacency(int node , int edge , vector<vector<int>> &edges) {
vector<vector<int>> adj(node);
for(int i = 0; i < edge; i++) {
int u = edges[i][0];
int v = edges[i][1];
adj[u].push_back(v);
... | ALGO | 0.999902 | 4.8301 | {
"github_metadata": {
"branch": "main",
"commit_count": 663,
"repo_created_at": "2024-08-17T07:19:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "233324b30a... |
37220c37-44d5-418b-bb1a-5671858a7cb9 | lcy960729/Algorithm_Solution_Collection | Baekjoon/BruteForce/1007.cpp | //
// Created by LeeChanYoung on 2020/12/30.
//
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>
#define pii pair<int, int>
#define ll long long
#define Int_MAX 1e9
#define LL_MAX 3e18
using namespace std;
int main() {
#ifdef LOCAL
freopen("input.txt", "r", stdin);
#... | ALGO | 0.99985 | 5.274056 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2020-10-19T13:03:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6a17322e2f... |
e1eaa3b2-4323-4264-b0f6-67b0993a73ea | Tot3nab3rmoot/DataCompression | HTree.cpp | #include <iomanip>
#include "HTree.h"
using namespace std;
HTree::HTree(string fileName) : bitStr(fileName, "") {
root = new Node();
int nLength = (int)fileName.find('.');
int remove = fileName.length() - nLength;
std::string newFile = fileName.replace(nLength, remove, ".puff");
outFile.open(newFile, std::fstr... | ALGO | 0.934391 | 3.577698 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-04-22T20:58: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": "4ec6edbe0a... |
12e851d7-0d21-45a3-b1f3-bf9f5fe70038 | psk18002/CSE-3150---Labs | Lab_7_Cos_Dist_Varied_Size_Vectors/Lab_7.h | #ifndef _LAB_7_H_
#define _LAB_7_H_
#include <iostream>
#include <cmath>
#include <vector>
#include <ostream>
#include <string>
#include <istream>
#include <sstream>
#include <fstream>
using namespace std;
template<typename T>
ostream & operator << (ostream& os, const vector<T> & vec) {
os << "( ";
for (T va... | ALGO | 0.972148 | 4.922428 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-01-24T18:23: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": "197f14fedbf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.