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 |
|---|---|---|---|---|---|---|---|
20a47b72-d4a9-4c9c-90b0-ee688eaae0cb | Chiki1601/Hackerearth-Solutions | Algorithms/Sorting/Quick Sort/Earth and The Meteorites.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
long long int t;
cin >> t;
while(t--)
{
long long int n, m, q;
cin >> n >> m >> q;
long long int a[q + 2], b[q + 2];
for(long long int i = 0; i < q; i++)
cin >> a[i] >> b[i];
... | ALGO | 0.999695 | 3.163373 | {
"github_metadata": {
"branch": "main",
"commit_count": 1808,
"repo_created_at": "2022-09-09T09:13:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 2,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "480d7f3b... |
b3800fe0-be75-4937-9ab3-a190ccf0188b | fiji-hpc/hpc-datastore-cpp | static_i3dlib/includes/i3d/fastlevelset/nha_domain_initializer.h | /*
* i3dlib - image manipulation library
*
* Copyright (C) 2000-2006 Centre for Biomedical Image Analysis (CBIA)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* vers... | ALGO | 0.987885 | 7.175478 | {
"github_metadata": {
"branch": "main",
"commit_count": 116,
"repo_created_at": "2022-07-01T09:05:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5b7c97e362... |
25eb985d-1495-49ce-8813-dbf8c79bfb8f | faishol01/cp-solution | codeforces/999E.cpp | ////////////////////////////////////////////////
// //
// Author: <NAME> //
// //
////////////////////////////////////////////////
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
... | ALGO | 0.999851 | 3.888202 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2016-12-29T03:14:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec94e3830... |
1fa0d553-c9ad-42f8-827c-e7849fb432fe | vladutpiele/temaPOO2nd | Campionat.cpp | //
// Created by <NAME> on 6/2/2024.
//
#include "Campionat.h"
int Campionat::nrEchipe = 0;
int Campionat::nrJucatori = 0;
std::vector<Echipa> Campionat::echipe;
Campionat::Campionat(const std::vector<Echipa>& _echipe) {
echipe = _echipe;
}
[[maybe_unused]] void Campionat::adaugaJucator() {
nrJucatori++;... | TOOL | 0.904628 | 4.886587 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2024-06-02T19:47: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": "e2ecef61d93... |
13e2d341-a2d5-4f95-9c15-e69ea815ec44 | TDFolk/3D-maze | Pathfinder.cpp | #include "Pathfinder.h"
Pathfinder::Pathfinder() {
srand(time(0));
}
Pathfinder::~Pathfinder() {}
/*
* getMaze
*
* Returns a string representation of the current maze. Returns a maze of all 1s if no maze
* has yet been generated or imported.
*
* A valid string representation of a maze consists only of 125 1s and 0s ... | ALGO | 0.996478 | 4.714679 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-12-19T10:32:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8aa5870f51... |
93049700-22d9-424f-841f-f74720912916 | eternity6666/life-in-acm | practive/HDU/Problem/finished/2049.cpp | #include <bits/stdc++.h>
#define fei(a, b) for(int i = a; i <= b; i++)
#define fej(a, b) for(int j = a; j <= b; j++)
#define fni(a, b) for(int i = a; i < b; i++)
#define fnj(a, b) for(int j = a; j < b; j++)
using namespace std;
const int maxn = 100 + 5;
int c, n, m;
long long a[25];
long long b[25];
int main()
{
... | ALGO | 0.999915 | 3.874062 | {
"github_metadata": {
"branch": "master",
"commit_count": 237,
"repo_created_at": "2018-04-03T15:40: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": "16b3f9e5... |
b7c50d17-6ad9-4f8e-bd4e-4e948570ce5a | kksoo0131/Study | 백준/Silver/2156. 포도주 시식/포도주 시식.cc |
// ㅈㅈ 구글링 , 두개비교까지는 했는데 세개비교하는걸 생각못한듯 두개비교로 반례에서 막힘
// dp[0] = arr[0] = 0
// dp[1] = arr[1]
// dp[2] = arr[1] + arr[2]
// 3번 잔에서의 경우의수는
// arr[1] + 0 + arr[3]
// 0 + arr[2] + arr[3]
// a[1] + a[2] + 0
// 결국
// dp[n-3] + arr[n-1] + arr[n]
// dp[n-2] + arr[n]
// dp[n-1] -> 내가 생각 못한 부분
// 이미 n-1에서 한 결과가 더크다면 n을 더해서는 안... | ALGO | 0.999986 | 4.670916 | {
"github_metadata": {
"branch": "main",
"commit_count": 696,
"repo_created_at": "2023-01-17T06:12: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": "79d720b1a7... |
4f007735-e314-46c0-9037-e19fe74f0e75 | HarpsealCC/note | 学习笔记/面试/代码片段/reverselist.cpp | /**
* @file reverselist.cpp
* @brief
* @author liuchengzhuo (<EMAIL>)
* @version 1.0
* @date 2023-12-13
*
* @copyright Copyright (c) 2023
*
* @par 修改日志:
* <table>
* <tr><th>Date <th>Version <th>Author
* <tr><td>2023-12-13 <td>1.0 <td>liuchengzhuo
* <th>Description
* <td>内容
* 面试题24 反转链表
* 定义一个函... | ALGO | 0.99995 | 5.581498 | {
"github_metadata": {
"branch": "master",
"commit_count": 165,
"repo_created_at": "2023-12-18T14:11: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": "e7f9f65d... |
bb191d19-8fbc-4c95-927f-a114c9595adf | Niladree60/LeetCodeSolutions | LeetCode542.cpp | class Solution {
public:
vector<vector<int>> updateMatrix(vector<vector<int>>& mat) {
int n = mat.size() , m = mat[0].size(), level = 0;
vector<vector<int>> vis(n, vector<int>(m, 0));
vector<pair<int, int>> dir = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
queue<pair<int,int>> q;
... | ALGO | 0.99998 | 6.05328 | {
"github_metadata": {
"branch": "main",
"commit_count": 405,
"repo_created_at": "2023-11-04T05:47: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": "035220bef3... |
90f9d672-67b1-4c77-91ec-b31042a4ba92 | larry-do/algorithm_contest_in_cpp | contest_6/llllll.cpp | #include <bits/stdc++.h>
#define Loop(i,a,b) for(int i = (a); i <= (b); i++)
#define REP(i,a) for(int i=0,_a=(a); i<_a; ++i)
#define RESET(c,val) memset(c,val,sizeof(c))
#define sz(a) int(a.size())
using namespace std;
int n, m, mark[1009];
vector<int> adj[1009], cl[2];
bool dfs(int u, int color = 1) {
mark[u] = ... | ALGO | 0.999971 | 4.456291 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2017-07-22T22:18:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d452299f2... |
987e6851-f0a9-495f-b327-648513053de6 | preranarao03/DSA | HASHING/hash_number_count.cpp | // The max size of int array declared in main function is 10^6
// But if the int array is declared globally, the size of array can be 10^7.
// if the size declared is greater than the limits, it will cause segmentation fault
#include <iostream>
using namespace std;
// to get frquency of numbers in an array using hash... | ALGO | 0.997017 | 4.415147 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-06-02T07:57: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": "755317f3350c... |
43ee520b-e2b6-4df2-acf4-6dc78f5a15eb | Volgarenok/spbspu-labs-2024-aap-a | timofeev.maxim/P3/main.cpp | #include <iostream>
#include <fstream>
#include <cstdlib>
#include <cstring>
#include "input_matrix.h"
#include "output_matrix.h"
#include "cut_to_square.h"
int main(int argc, char** argv)
{
if (argc > 4)
{
std::cerr << "Too many arguments\n";
return 1;
}
else if (argc < 4)
{
std::cerr << "Not en... | ALGO | 0.979658 | 4.453092 | {
"github_metadata": {
"branch": "master",
"commit_count": 8754,
"repo_created_at": "2024-10-01T15:31:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 52,
"issues": 0,
"pull_requests": 16
},
"file_meta": {
"content_id": "df708... |
0170531f-a6c8-4034-a0ef-b87ea2521515 | Moaaz-Mahmoud/Problems | SPOJ/C++/PCOUNT.cpp | #include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <string.h>
#include <cstring>... | ALGO | 0.999331 | 4.317335 | {
"github_metadata": {
"branch": "master",
"commit_count": 164,
"repo_created_at": "2021-01-15T19:37: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": "2ca42cd7... |
c47b369c-58a7-448b-b504-030bca5b61ac | maniero/SOpt | CPP/Algorithm/GetDataLoop.cpp | #include <iostream>
using namespace std;
int main() {
int totalempresa = 0;
while (1) {
int valordomes1, valordomes2, valordomes3;
cout << "valor do mes 1:";
cin >> valordomes1;
if (valordomes1 == 0) break;
cout << endl << "valor do mes 2:";
cin >> valordomes2;
... | TOOL | 0.952476 | 4.188703 | {
"github_metadata": {
"branch": "master",
"commit_count": 6553,
"repo_created_at": "2017-01-11T11:19:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1968,
"forks": 189,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca... |
374f4693-a998-4f7f-bc7f-d79de9b77b44 | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/allpro_train/1_10470_0.cpp | #include <bits/stdc++.h>
using namespace std;
mt19937 mt(48);
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
using ld = long double;
templa... | ALGO | 0.999492 | 4.467469 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-04-28T03:59:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d991e23b4cf... |
532f9a17-7d05-42da-b5dc-b896ec494b3e | rising-stark/CP_Practice | Codeforces/545C.cpp | #include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vector<int> >
#define vvll vector<vector<ll> >
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vpii vector<pair<int, int> >
#define vpll vector<pair<ll, ll> >
#define endl "... | ALGO | 0.99987 | 3.405885 | {
"github_metadata": {
"branch": "master",
"commit_count": 345,
"repo_created_at": "2020-04-09T01:05:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e47c157... |
ea3c626d-85ef-48fa-8992-3b2e9c76c053 | Thomaw/Project-Euler | 600-700/638.cpp | #include <iostream>
//a^b mod m
uint64_t pow(uint64_t a, uint64_t b, uint64_t m){
if(b == 0) return 1;
if(b == 1) return a%m;
uint64_t t = pow(a, b/2, m);
if(b%2 == 0) return (t*t)%m;
else return (a*((t*t)%m))%m;
}
int main(){
int p = 1000000007;
int sum = 0;
int powten ... | ALGO | 0.999533 | 4.244695 | {
"github_metadata": {
"branch": "main",
"commit_count": 166,
"repo_created_at": "2021-09-19T16:34:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6b2243ac50... |
4d1f138e-b2db-4306-a429-96a07f479f27 | Rkhan2026/AMU_MCA_Sem---1_Lab_2024-25 | Week - 9/4#/4#.cpp | #include<iostream>
using namespace std;
void swap_value(int a,int b){
int temp=a;
a=b;
b=temp;
cout<<"\na : "<<a;
cout<<"\nb : "<<b;
}
void swap_reference(int &a,int &b){
int temp=a;
a=b;
b=temp;
cout<<"\na : "<<a;
cout<<"\nb : "<<b;
}
int main(){
int a,b,ch;
... | ALGO | 0.977276 | 4.71917 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-09-24T13:29: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": "3fe3d8be950... |
b243a6c9-e324-4853-ae38-ef0b2ff60f51 | rowrowape/2DDynamicArrayRealization | main.cpp | #include <iostream>
#include <exception>
using namespace std;
struct BadBorderException : exception {
};
struct MemoryLimitExceded : exception {
};
struct arr {
double **base;
int d1Lower, d1Higher, d2Lower, d2Higher;
arr() {
this->d1Lower = 0;
this->d2Lower = 0;
this->d1Higher... | ALGO | 0.989529 | 3.917255 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2015-12-13T08:16: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": "b0c31a4ee... |
952ff95c-0d23-4c17-9653-b1e82d7d2b0c | yashparmar15/Cpp-Codes | Allocate_Mailboxes.cpp | /*Given the array houses and an integer k. where houses[i] is the location of the ith house along a street, your task is to allocate k mailboxes in the street.
Return the minimum total distance between each house and its nearest mailbox.
The answer is guaranteed to fit in a 32-bit signed integer.
Example 1:
In... | ALGO | 0.999992 | 5.879234 | {
"github_metadata": {
"branch": "master",
"commit_count": 831,
"repo_created_at": "2020-06-30T16:20:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d78b8cec... |
beceffa1-3e21-4a55-81ab-78226e7f009c | tempure/algorithm-advance | OJ/codeforces/723_div2/c1_dp.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
typedef vector<int> vi;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
mt19937 mrand(random_device{}());
const ll mod = 1000000007;
int rnd(int x) {... | ALGO | 0.999883 | 4.139209 | {
"github_metadata": {
"branch": "master",
"commit_count": 1297,
"repo_created_at": "2020-11-16T08:58:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5b8d14... |
87b2a34c-866e-4132-8b96-c69b17f78607 | anujbansal16/APS-Assignment2 | 2018201096-aps/2018201096_5-2.cpp | #include<bits/stdc++.h>
using namespace std;
class stringBuilder
{
public:
std::vector<const char *> v;
};
void printStringBuilder(stringBuilder s){
for (int i = 0; i < s.v.size(); ++i)
{
cout<<s.v[i];
}
cout<<endl;
}
stringBuilder stringInitialze(const char *c){
stringBuilder s... | ALGO | 0.999912 | 4.809267 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-10-07T12:29: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": "7ee77c80cf... |
2c3366bd-1841-4ae0-b475-9b4f3b42ff01 | Dabhi-Pratik/CPP | 08__C++__CRUD/crud.cpp | #include<iostream>
using namespace std;
int main(){
int choice,pos,ele,size;
cout <<"Size: ";
cin >>size;
int arr[100];
for(int i=0; i<size; i++){
cout<<"arr["<< i << "]: ";
cin>>arr[i];
}
while( choice != 0){
cout << "-------------------------" << ... | TOOL | 0.990035 | 3.693855 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2025-06-03T05:28:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7905944887b... |
de3c2f94-3126-49e8-a5c4-37d1bc56c8ea | jstanco/MonteCarlo-Methods | monte_carlo_methods/include/graph.hpp | //created by <NAME> 7.14.18
/// Std lib headers
#include <queue>
#include <functional>
#include <vector>
#include <limits>
/// User defined headers
#include "help.hpp"
#include "timer.hpp"
#include "signal.hpp"
#ifndef GRAPH_H
#define GRAPH_H
typedef arma::vec graph_signal;
typedef std::pair<size_t, double> my_pair... | ALGO | 0.996499 | 4.437666 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2018-05-28T18:00:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51a01a378... |
2cc94b61-c282-4284-ab1d-6fe3c0b42203 | abhishekGarg26/Strivers-SDE-Sheet-Challenge-2023 | Binary Tree/Top View of Binary Tree.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node {
int val;
Node *left;
Node *right;
Node() : val(0), left(nullptr), right(nullptr) {}
Node(int x) : val(x), left(nullptr), right(nullptr) {}
Node(int x, Node *left, Node *right) : val(x), left(left), right(right) {}
};
class Solut... | ALGO | 0.999997 | 5.105222 | {
"github_metadata": {
"branch": "main",
"commit_count": 306,
"repo_created_at": "2023-06-12T07:45:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3903e8b8e0... |
1826e5ff-d588-46ba-bc22-97e59e687a68 | Manish-kasera/C-Complete | tut65.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
// //Template with Multiple Parameter
// template <class T1, class T2>
// class Sum
// {
// protected:
// T1 x;
// T2 y;
// public:
// Sum(T1 a, T2 b)
// {
// x = a;
// y = b;
// }
// void printS... | ALGO | 0.980053 | 4.792726 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-10-08T14:27: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": "ade179e01a... |
9d3e9f84-6a64-4bb0-8741-5dc2252ac3f5 | yamate11/compprog | abc/abc226/g/cans.cc | #include <bits/stdc++.h>
#include <cassert>
typedef long long int ll;
using namespace std;
// #include <atcoder/all>
// using namespace atcoder;
#define REP2(i, a, b) for (ll i = (a); i < (b); i++)
#define REP2R(i, a, b) for (ll i = (a); i >= (b); i--)
#define REP(i, b) REP2(i, 0, b)
#define ALL(coll) (coll).begin(), (... | ALGO | 0.999864 | 5.433247 | {
"github_metadata": {
"branch": "main",
"commit_count": 219,
"repo_created_at": "2021-03-11T06:12:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf8369676a... |
a8544bf7-5766-4268-899c-3b29a6a9a313 | dr0pdb/competitive | uva/Chapter 5/p10738.cpp | #include<bits/stdc++.h>
#define ABS(a) ((a < 0) ? ((-1)*(a)) : (a))
#define F(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define RF(i,a,b) for(int i = (int)(a); i >= (int)(b); i--)
#define MIN3(a,b,c) (a)<(b)?((a)<(c)?(a):(c)):((b)<(c)?(b):(c))
#define MAX(a,b) (a)>(b)?(a):(b)
#define MIN2(a,b) (a)<(b)?(a):(b)
#de... | ALGO | 0.998979 | 3.321999 | {
"github_metadata": {
"branch": "master",
"commit_count": 86,
"repo_created_at": "2017-02-15T19:13: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": "02c2fa56d... |
a3df1db2-0172-4c75-a0e0-e985920474d1 | satyajeet-rajupali/DSA_Sheet_By_Love_Babbar_Solutions | Tree/Question25.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
Node *left, *right;
int data;
};
Node *createTree()
{
Node *root = new Node;
int x;
cout << "Enter root node:\n";
cin >> x;
root->data = x;
root->left = nullptr;
root->right = nullptr;
queue<Node *> q;
q.emplace(r... | ALGO | 0.999973 | 4.402249 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2021-05-05T03:04: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": "9b75d6136... |
d715d74d-16e4-498b-85d1-f01ed78b3d3d | knakul853/myprogram | suffix_copy.cpp | #include<bits/stdc++.h>
using namespace std;
#define MAXN 65536
#define MAXLG 17
char A[MAXN]; // input string
struct entry
{
int nr[2];
int p; // keep track of index of suffix that is our final ans:
} L[MAXN]; //nr[0]rank of 1st element nr[1] rank of next element
int P[MAXLG][MAXN];// p[i][j] represent rank of jth ... | ALGO | 0.999982 | 3.464686 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-08-22T09:28:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3a15c2263... |
0de81d1a-602d-4b6e-b2b9-534b8422c096 | AkashYadavak/DSA-Course | Segmented_Sieve.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
// cal. the prime_num from 1 till n
vector<int> SeivePrime(int upper_limit)
{
int n = sqrt(upper_limit);
vector<bool> primes(n + 1, true);
vector<int> prime_num;
for (int i = 2; i <= n; i++)
{
if (primes[i] == tr... | ALGO | 0.999794 | 4.615533 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2023-06-25T10:02: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": "0cb536e5a57... |
7289a940-a594-4a7f-ba62-7858b5f2771a | abraham-john-paul/DesignPatternStudy | proxy_pattern.cpp | #include <iostream>
#include <memory>
#include <string>
#include <algorithm>
using namespace std;
struct ITextParser {
virtual ~ITextParser() {}
virtual int getWordCount() = 0;
};
struct TextParser : ITextParser {
string mTextContent;
TextParser(string text) : mTextContent(move(text)) {} // Let this ... | TOOL | 0.977724 | 5.374362 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2020-12-22T12:06: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": "c9da55408... |
70f13c1d-2a9a-4d14-9d62-8e3bb4a634f7 | lucianovr/competitive-programming | URI/1786.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define rep(i, a, b) for (int i(a); i < (b); i++)
#define debug(x) cout << #x << " = " << x << "\n";
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
int main() {
char d[10];
int sz;
while (gets(d)) {
int ... | ALGO | 0.999818 | 3.486183 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-05-28T00:31:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c049a1415... |
dc57be91-c627-4288-a07f-4a7ca637b107 | Johan123411/Algorithms | Lab3/medianHeaps.cpp | #include <iostream>
#include <climits>
#include "medianHeaps.h"
#include "minHeap.h"
#include "maxHeap.h"
using namespace std;
medianHeaps::medianHeaps(int cap) //Constructor
{ //initializing the member variables
maxH=new maxHeap(cap);
minH=new minHeap(cap);
}
medianHeaps::~medianHeaps() //Destructor
{
d... | ALGO | 0.999877 | 4.238639 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-09-24T20:22: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": "66df3f62de... |
aeb18db6-2662-4d83-95e7-63fb355b9c7f | pavelsaladkou/magic_square | magic_square.cpp | /*--- Magic square ------------------------------------------
Program to check if a n * n matrix is a magic square and to
generate an odd magic square.
Created by <NAME>, January 2019
----------------------------------------------------------*/
#include <iostream>
#include <iomanip>
using namespace std;
con... | ALGO | 0.998823 | 5.273789 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-01-27T00:00: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": "ed2fc196ab... |
9970978e-eab2-4cac-933c-90be8d317aa1 | hmursaleen/Algorithm-codes | Find Primes in range [L,R].cpp | ///Author : Mursaleen
///Date :
///Problem topic : (practice) Find primes in range [L,R];
///Verdict :
///Platform :
///--------------------------------------------------------///
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define show(x) cout << #x << " : " << x << endl
ll L, R, i, j;
int mai... | ALGO | 0.999884 | 4.411729 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-01-24T14:17: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": "927db04be046... |
e06cd79b-04dd-4001-a8cc-3797f9c28cba | AmieOliveira/SistemasDistribuidos | Semaforo/semaphore.cpp | #include <iostream>
#include <fstream>
#include <thread>
#include <vector>
#include <cmath>
#include <semaphore.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <time.h>
using namespace std;
//--------------------------------
sem_t* semaphoreMutex;
sem_t* semaphoreConsumers;
sem_t* semaphoreProducers;
int produ... | ALGO | 0.994437 | 4.350859 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2019-03-27T21:44:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47c4424fa... |
cbac5a21-d05d-4a1a-8fbd-2a914221b145 | reisenx/2110211-INTRO-DATA-STRUCT | G66 CP Quiz/G66 Quiz 01/Booking/d66_q1a_booking.cpp | #include<iostream>
#include<set>
using namespace std;
int N,M;
set<pair<string,string>> tickets;
int main()
{
// Make std::cin and std:: cout faster
ios_base::sync_with_stdio(false); cin.tie(0);
// Input tickets
cin >> N >> M;
while(N--)
{
string flight, seat;
cin >> flight >> s... | ALGO | 0.999853 | 4.747135 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2024-08-16T08:20:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ebf311a93d6... |
afa1541b-a724-42a9-9f68-9e1e6e6ebbe4 | li1553770945/DataStructClassDesign | 7排序算法比较/7排序算法比较.cpp | ////[问题描述]
////利用随机函数产生n个随机整数(n = 500,1000,1500,2000,2500,…, 30000),利用直接插入排序、折半插入排序、希尔排序(对于不同数量的数据,生成不同的增量序列)、起泡排序、快速排序、选择排序、堆排序、两路归并排序(非递归)8种方法进行排序,统计每一种排序所需要的比较次数以及移动次数。
////[基本要求]
////(1) 原始数据随机生成。
////(2) 对于不同的数据规模,显示每种排序所需的比较次数以及移动次数。
////(3) 分析每一种排序算法的特点
//
//#include <iostream>
//#include <time.h>
//const int ma... | ALGO | 0.998884 | 4.697158 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-12-30T13:26:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b44388b811... |
597a7ba8-b2a3-40f4-af7a-505f1ed712b6 | convict-git/sport_coding | practise_3xc3pt10n/onlinejudge.org/UVa_Online_Judge/357_Let_Me_Count_The_Ways/357_Let_Me_Count_The_Ways.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define IOS ios_base::sync_with_stdio(false); cin.tie (nullptr)
#define PREC cout.precision (1... | ALGO | 0.999736 | 4.4019 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2019-10-15T14:17:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7211c37af... |
a2b95035-f99c-4bf7-a90e-68a16cb5f5b3 | FeiPingWang/LeetCode | LinkList/lt_143.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
void reorderList(ListNode* head) {
if(head == NULL)
return;
ListNode* laterHalf = NULL;
ListNode... | ALGO | 0.999988 | 5.679043 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2016-04-17T02:32: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": "a46d45db1... |
e351b2bb-e977-4425-97e2-3949fe201f82 | Ashirwad-Mishra/DSA | insertion+sort.cpp | #include<bits/stdc++.h>
using namespace std;
void shift(int i, int A[])
{
A[i+1] = A[i];
}
int main()
{
int A[7] = {7, 3, 5, 2, 8, 9, 1};
for (int i = 1; i < 7; i++)
{
int temp = A[i];
if (temp < A[i-1])
{
int j = i - 1;
while (A[j] > temp && j >= 0) //... | ALGO | 0.999994 | 5.083053 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-10-27T18:52: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": "28e568e89717... |
72b29ec4-8b55-4489-b2c7-e8e2cc2db2f8 | subarctic-blast/ya-cpp-developer-course | preliminary_course/theme_3/lesson_7/exercise_4.cpp | /* Урок 7: Ходим по кругу — цикл for
*
* Задание 4
*
* В векторе строк some_vector найдите самую длинную строку и её индекс. Выведите её в соответствии с форматом выходных
* данных. Если несколько строк имеют одинаковую длину, выведите первую из них.
* Выведите текст: Longest string "{строка}" at index {индекс}, ... | ALGO | 0.981751 | 4.655573 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2024-11-25T20:04:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11a3285dfd1... |
da22b501-9a4e-4cb5-906e-70a0852f7f6e | greenthings/The-Algorithms-and-Data-Structures | c++/sorting_algorithms/MergeSort.cpp | #include "MergeSort.h"
#include "../common/common.h"
#include <cstdio>
#include <iostream> // cout
#include <stdio.h>
#include <vector>
using namespace std;
// we can use just arr but we used vector, bc it is flexible.
// assuming we used a static array, we have to initialize its size at first.
// but we dont wanna ... | ALGO | 0.999963 | 5.485102 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2024-02-16T10:49:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "05f0951549b... |
93e572bf-3f50-4da2-b9bf-489b8d884040 | ishandutta2007/codeforces-n | natsugiri/normal/444/B.cpp | #include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
typedef long long LL;
//x is 64-bit variable;
LL x;
int d, n;
int a[111111], b[111111], c[111111];
LL getNextX() {
x = (x * 37 + 10007) % 1000000007;
return x;
}
void initAB() {
... | ALGO | 0.999905 | 3.438168 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:35: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": "c551fc5713fc... |
5c01340c-f9b5-4634-898e-863211402332 | vicen/test | thirdparty/compact_test/controller.cpp | // Standard includes
#include <fstream>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
// For converting WGS84 <-> LTP coordinates
#include <GeographicLib/Geocentric.hpp>
#include <GeographicLib/LocalCartesian.hpp>
// COntroller constants
#define _X 0
#define _Y 1
#defi... | ALGO | 0.988081 | 4.547184 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-12-17T13:11:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f89e5a701... |
326c62a4-6e72-41ce-959b-ca542a8a1702 | romaad/leetcode_lintcode | lint/188 - insert five.cpp | class Solution {
public:
/**
* @param a: A number
* @return: Returns the maximum number after insertion
*/
int InsertFive(int a) {
// write your code here
bool sign = (a < 0);
bool dirt = false;
string x = to_string(a > 0 ? a : -a);
for(int i =0 ; i < x.siz... | ALGO | 0.999584 | 4.737119 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2021-05-15T02:02: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": "e8de3ec8025... |
27ce097a-64a9-451c-8d87-8fcf67387b62 | Adambees/Program-1 | Program 1/WordTree.cpp | #include "WordTree.h"
/*
Class WordTree
*/
WordTree::WordTree()
{
this->root = NULL;
}
WordTree::~WordTree()
{
this->emptyWordTree();
}
void WordTree::add(std::string wordToAdd) {
if (this->root == NULL) {
this->root = new WordNode(wordToAdd);
}
else {
addHelper(wordToAdd, this->root);
}
}
void WordTree::... | ALGO | 0.981324 | 3.647893 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-04-12T23:28:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "592c11cc7c... |
398a53b2-b6f4-4f76-8377-f8f24f70b504 | SeanCampbell/WordAnalysis | vxl_src/contrib/brl/bseg/boxm/algo/rt/boxm_pre_infinity_functor.h | #ifndef boxm_pre_infinity_functor_h
#define boxm_pre_infinity_functor_h
//:
// \file
#include <boxm/boxm_apm_traits.h>
#include <boxm/basic/boxm_raytrace_function.h>
#include <boxm/sample/boxm_rt_sample.h>
#include <boxm/sample/algo/boxm_mog_grey_processor.h>
#include <boxm/sample/algo/boxm_simple_grey_processor.h>
#in... | ALGO | 0.996866 | 6.009871 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2016-02-16T04:49:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6760c5de... |
da0d2424-8b10-4885-8d90-3674c522218e | anmolgera/Leetcode_Solutions | AG_Leetcode/problems/reverse_nodes_in_k-group/solution.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 *reverseBefore... | ALGO | 0.999994 | 6.04788 | {
"github_metadata": {
"branch": "main",
"commit_count": 1034,
"repo_created_at": "2022-09-10T20:51:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aadf61697... |
9867a7b5-28de-468a-ad5a-83f167ae05ef | Damage233/JData | code/synchroSearch.cpp | #include "stdafx.h"
#include "logistics.h"
#include "population.h"
#include "synchroSearch.h"
#include <iostream>
#include <vector>
#include <sstream>
#include <algorithm>
#include <string>
using namespace std;
//初始化vector<CarRoute> result
vector<CarRoute> initResult()
{
vector<CarRoute> result;
CarRoute car;
ca... | ALGO | 0.993693 | 3.23526 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-08-17T03:43:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 7,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "289420371... |
c4e77760-22a9-4a50-bb62-3cb49da2758a | Amirtaha-Afkhami-Goli/codeforces-solutions | 2000.C.NumericStringTemplate.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
long long t;
cin >> t;
while (t--)
{
long long n, m;
cin >> n;
long long arr[n];
for (auto i : arr)
cin >> i;
cin >> m;
while (m--)
{
string s;
cin >> s;
if (s.size() != n)
{
cout << "NO"... | ALGO | 0.999797 | 4.267686 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-02-24T19:50: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": "163e3b56df5d... |
4ef2883f-c4e8-4551-afb3-30a3c6d137a0 | GuoxiaWang/leetcodepractice | 378/solve1.cpp | //Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix.
//
//Note that it is the kth smallest element in the sorted order, not the kth distinct element.
//
//Example:
//
//matrix = [
// [ 1, 5, 9],
// [10, 11, 13],
// [12, 13, 15]
//]... | ALGO | 0.999992 | 6.923583 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2018-07-15T13:17: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": "ae6fedc62... |
a81edc3d-cdba-4543-8619-9dac03c3c4ff | rainlee/leetcode-jecklee | LongestCommonPrefix.cpp | /***
* 法1:纵向比较
* 从0开始,对每个位置,比较所有的字符串,直到遇到一个不匹配
***/
/*
class Solution {
public:
string longestCommonPrefix(vector<string> &strs) {
if (strs.empty())
return "";
for (int j = 0; j < strs[0].size(); ++j) // horizontal
for (int i = 1; i < strs.size(); ++i) // vert... | ALGO | 0.999926 | 5.644811 | {
"github_metadata": {
"branch": "master",
"commit_count": 184,
"repo_created_at": "2014-05-27T16:30:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "898aae49... |
4caba952-45e5-41c9-86d3-72635c77957a | Freedom911/Practice | datastructures/list/onceAgain/LLMergeSort.cpp | /**
* https://takeuforward.org/linked-list/sort-a-linked-list
*
* Given A linked list we need to sort
*
* We shall use Merge Sort
*
* Solution
* Basically merge sort keeps diving the array into 2 parts
* then when only one element is there it merges there
* So We alread have the conceptof merging two list
*... | ALGO | 0.999989 | 5.598317 | {
"github_metadata": {
"branch": "master",
"commit_count": 202,
"repo_created_at": "2021-03-10T12:14: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": "c894ecc0... |
16bbfbf2-39c5-475e-9629-b094edc0800d | Manojkapure100/DSA | Product_of_array_except_self.cpp | #include<iostream>
#include<vector>
#include "utils.h"
using namespace std;
vector<int> getProductOfArrayExceptSelf(vector<int> arr){
vector<int> ans = {};
for (int i = 0; i < arr.size(); i++)
{
int product = 1;
for (int j = 0; j < arr.size(); j++)
{
if(i!=j){
... | ALGO | 0.999853 | 5.756979 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2025-06-30T18:06: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": "268cab77e8e... |
d2df1875-58ed-43b3-93e1-0da47d50c138 | surajmate007/700_Topicwise_DSA_Solved_Problems | 01_Arrays/30_Smallest_Subarray_with_sum_greater_than_a_given_value.cpp | // easiest sliding window solution:
int smallestSubWithSum(int arr[], int n, int x){
int sum = 0; int i=0; int j=0; int ans = INT_MAX;
while(j < n){
sum += arr[j];
j++;
while(sum > x){
ans = min(ans, j-i);
sum -= arr[i];
i++;
}
}
retur... | ALGO | 0.999988 | 6.03725 | {
"github_metadata": {
"branch": "main",
"commit_count": 1014,
"repo_created_at": "2022-05-10T03:42:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81d6385f6... |
98c1da19-5ed5-483b-b451-acad1aa79dd0 | raresionut1/ETH-HS-2021-AlgoLab | src/first_hit.cpp | ///1
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <typeinfo>
using namespace std;
typedef CGAL::Exact_predicates_exact_constructions_kernel K;
typedef K::Point_2 Point;
typedef K::Ray_2 Ray;
typedef K::Segment_2 Segm... | ALGO | 0.999932 | 4.130862 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2021-10-05T09:28:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98d399ba4... |
27152227-5057-4548-a1f7-919b8f1fd36f | Kiritow/OJ-Problems-Source | HDOJ/5074_autoAC.cpp | #include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <time.h>
using namespace std;
int a[100][100];
int dp[110][55];
int b[110];
int main()
{
int T;
int n,... | ALGO | 0.999971 | 3.244131 | {
"github_metadata": {
"branch": "master",
"commit_count": 939,
"repo_created_at": "2016-04-10T01:06:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d991c3b... |
32280161-6752-4664-a2f5-a5ae83137c0d | Daibingh/MyAlgoLearning | 算法与数据结构/cpp_leetcode/179 最大数/main.cpp | #include "utils.hpp"
using namespace std;
/*
给定一组非负整数,重新排列它们的顺序使之组成一个最大的整数。
示例 1:
输入: [10,2]
输出: 210
示例 2:
输入: [3,30,34,5,9]
输出: 9534330
说明: 输出结果可能非常大,所以你需要返回一个字符串而不是整数。
*/
// 这种方法有点麻烦,但是好像更快点
class Solution {
static bool comp(const string& s1, const string & s2) {
return stol(s1+s2) < stol(s2+s1);
... | ALGO | 0.999838 | 5.42543 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-09-12T06:35: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": "4bf2d1889... |
07b536e2-ea73-4d13-80d6-36decab38105 | anju-chhetri/Algorithms | DSA/infix_prefix.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <stack>
#include <string>
using namespace std;
stack<char> convert_postfix(string);
int main(){
stack<char> POSTFIX;
string infix_expression = "(A+B^C)*D+E^5";
reverse(infix_expression.begin(), infix_expression.end());
for(int i=0;i<infix_expression.length();i++){... | ALGO | 0.999906 | 5.026052 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2021-10-30T05:23:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e911775d7... |
ef4c13b3-c134-4f81-9dd1-a8a74b1acad2 | Divyanshu9794/GFG_POTD | Difficulty: Easy/Split Linked List Alternatingly/split-linked-list-alternatingly.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
struct Node* next;
Node(int x) {
data = x;
next = NULL;
}
};
// } Driver Code Ends
/*
struct Node
{
int data;
struct Node* next;
Node(int x){
data = x;
next = NUL... | ALGO | 0.999788 | 5.58704 | {
"github_metadata": {
"branch": "main",
"commit_count": 1538,
"repo_created_at": "2023-04-22T04:24:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "052ff75ee... |
2c2a0d2d-b0c4-4eed-9171-abe9d0e30730 | mikuloveSSY/algorithm-learning | 3月华为智能基座月赛/3_博弈+dp?!.cpp | #include<iostream>
using namespace std;
/*关键在于‘谁能获胜’与‘字符串’的内在联系是什么?
1:一开始就是回文串,则科小花获胜
2:一开始不是回文,则对于某一中间状态:
无论删首还是尾留下的都是回文:
对方必胜
删一头留下的是回文;
那么为了不输,必须删另一头(即组成回文的那部分)
(注意:
对于“aa...aa”这种情况,显然是包含于删一头的情况里的
因此不可能最后出现“aa..a”但双方还在进行的情况
)
但是,根据数据规模,递归判断最坏情况是10^11次超时,显然需要优化
... | ALGO | 0.99943 | 3.593124 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-07-07T08:58: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": "72bc05241963... |
438de4e3-8268-420c-850b-840c726a37ec | Yupdown/PScpp | bojc++/breadth-first_search.cpp | #include <bits/stdc++.h>
#define FASTIO() cin.tie(0),cout.tie(0),ios::sync_with_stdio(0)
using namespace std;
constexpr int NMAX = 1;
constexpr int MMAX = 1;
int table[NMAX][MMAX];
int memo[NMAX][MMAX];
int main()
{
FASTIO();
int n, m;
cin >> n >> m;
for (int i = 0; i < n * m; ++i)
cin >> table[i / m][i % m... | ALGO | 0.999855 | 4.260162 | {
"github_metadata": {
"branch": "main",
"commit_count": 209,
"repo_created_at": "2022-09-16T06:08: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": "9b6caab8b9... |
6ffbe8d3-a7ac-4585-a278-ac38283a2324 | miya930/competitive_programming | algorithm/00.AtCoder/00.ABC/07_351-400/ABC398A.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, fi, n) for (int i = fi; i < n; i++)
using ll = long long;
using pii = pair<int,int>;
constexpr int inf = 1001001001;
constexpr ll infl = 1LL << 62;
constexpr int dx[] = {1, 0, -1, 0};
constexpr int dy[] = {0, 1, 0, -1};
template<class T> bool chmax(T &a, T b)... | ALGO | 0.999923 | 3.947401 | {
"github_metadata": {
"branch": "main",
"commit_count": 114,
"repo_created_at": "2021-04-18T01:17: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": "1903a69195... |
b8067d46-ab78-49b2-af7c-d917fc3ecf11 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/05/0527/personal_submission/cf835d_Lu_xZ.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int N = 5005;
ll f[N][N], res[N], n;
string s;
int main() {
cin.tie(0)->sync_with_stdio(0);
cin >> s, n = s.length();
for(int i = 0; i < n; ++ i) f[i][i] = 1, ++ res[1];
for(int len = 2; len <= n; ++ len) {
for(int i = 0; i + len - ... | ALGO | 0.999969 | 3.518101 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "aa02... |
6469dbc9-88c7-410f-8ea6-76249f25443c | f-zyj/ACM | ACM 模板代码/f-区间最大频率/f-区间最大频率/main.cpp | //
// main.cpp
// f-区间最大频率
//
// Created by ZYJ on 16/7/23.
// Copyright © 2016年 ZYJ. All rights reserved.
//
#include <iostream>
/*
* 求区间中数出现的最大频率
* 方法一:线段树.
* 先离散化。因为序列是升序,所以先将所有值相同的点缩成一点。这样n规模就缩小了。建立一个数据结构
* 记录缩点的属性:在原序列中的值id,和该值有多少个num比如序列
* 10
* -1 -1 1 1 1 1 3 10 10 10
* 缩点后为:下标 1 2 3 4
* ... | ALGO | 0.999962 | 4.533177 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2018-05-18T16:14:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 199,
"forks": 55,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f9d40... |
ca1c9650-5d1a-43d7-9288-1bed72548642 | lhwlord/CPP_coding | 문장 매치.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
// 한 문장에서 다른 문장으로 가기 위한 최소비용을 계산한다.
// 특정 문자를 다른 문자로 바꾸는 스왑, 혹은 추가/삭제의 3가지 연산이 가능하다.
int main(void)
{
string a, b, route;
char c[50] = {'\0',}; // 스트링 받기용 임시객체
scanf(... | ALGO | 0.999976 | 3.154159 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2021-10-18T03:19:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b0f8ea98... |
fec3ba07-2546-4b17-a11f-a65d0f5b49ba | YIM2UL2ET/Problem_Solving | 백준/Silver/27922. 현대모비스 입사 프로젝트/현대모비스 입사 프로젝트.cc | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
struct lectore {
int a, b, c;
};
int main(void) {
int N, K, temp, ans;
cin >> N >> K;
vector<lectore> lectures(N);
for (auto &lec : lectures) {
cin >> lec.a >> lec.b >> lec.c;
}
ans = 0;
temp = 0;
sort(lectures.be... | ALGO | 0.99989 | 4.257432 | {
"github_metadata": {
"branch": "main",
"commit_count": 441,
"repo_created_at": "2023-05-08T14:35: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": "5759fa52e8... |
1a15952b-e298-4be4-b88f-2331955d404d | buihuytu/Ki2_Nam2 | PTTKTT/Buoi6/dem_so_duong_di_trong_bai_moi_con_duong_ve_0.cpp | // dem so duong di ve 0 trong bai moi con duong ve 0
// Su dung chia de tri va de quy co nho
/*
n = a*b, a <= b
m = (a-1)*(b+1) = ab - (b-a+1) <= n-1
/ 96
108 - 100 - 96
\ 81
*/
/*
s=11, x=4.
s+=x%12 -> 13
s=(s+x)%12 -> 12
*/
#include<bits/stdc++.h>
using namespace std;
long long M = 1e9+7;
unordered_map<int, lon... | ALGO | 0.999944 | 4.857409 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-01-13T07:57: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": "6e4a071681b5... |
13ea8204-83af-4379-bfde-f994b6635d6b | Kisna2512/Dynamic-Programming | Frog_jump.cpp | #include <bits/stdc++.h>
using namespace std;
int solve(int ind, vector<int> &v)
{
if (ind == 0)
{
return 0;
}
int left = solve(ind - 1, v) + abs(v[ind] - v[ind - 1]);
int right = INT_MAX;
if (ind > 1)
{
right = solve(ind - 2, v) + abs(v[ind] - v[ind - 2]);
}
return... | ALGO | 0.999991 | 4.705762 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2022-12-03T07:53: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": "48efb8d7d52... |
c97a5acf-83f2-451e-89ec-d14ec4a70356 | BhavyaBhalla-27/DSA-Supreme- | Stacks_ClassII_26th April 2023/Q2_Reverse_a_Stack.cpp | #include<iostream>
#include<stack>
using namespace std;
void solve(stack<int>&s,int target){
// Base case -> stack empty or not
if(s.empty()){
s.push(target); // simply push the target
return;
}
// Fetch top element
int topElement = s.top();
s.pop();
// recursive call for nex... | ALGO | 0.999968 | 5.101728 | {
"github_metadata": {
"branch": "main",
"commit_count": 513,
"repo_created_at": "2023-01-22T10:26:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 370,
"forks": 137,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "d51f59... |
69b9e174-7f97-4842-8b0e-b0afa87700b3 | OpenCAEPlus/ocptoolkit_poro_petsc_solver | src/preSolver.cpp | //
// preSolver.cpp
//
//
// Created by <NAME> on 6/26/14.
//
//
#include "PETScSolver.h"
PS_SLL preSolver(Mat &A, Vec &b, Vec &x, bool zeroGuess, PS_SLL solverType)
{
KSP ksp; /* linear solver context */
PC pc;
PetscInt its;
PetscErrorCode ierr;
/* - - - - - - - - - - - - - - - - - - - - - - ... | TOOL | 0.990281 | 5.211891 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-11-30T13:34:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4caf80239b6f... |
465ca1a0-48d9-4f2b-803d-fa377eb4ee56 | Nipun4338/Solved-Programming-Problems | CodeForces/285/b/65271438.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long llu;
const ll inf = 1e9;
const ll mod = 1e9 + 7;
const double eps = 1e-8;
const ll MAX = 1e7 + 20;
#define fast ios_base:: sync_with_stdio( false ); cin.tie(0); cout.tie(0);
#define eb emplace_back
#define em ... | ALGO | 0.999868 | 3.14154 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-07-29T12:52: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": "b4dd78f4b... |
e316228d-1c4f-43c0-a75f-96bbd0bca818 | hulikau/Homework | 3SEM/HW2/1/network.h | #pragma once
#include "computer.h"
#include <QVector>
#include <QSet>
class Network
{
public:
Network();
~Network();
/**
* @brief addNewComputer - adding new computer to network
* @param comp - new computer
*/
void addNewComputer(Computer *comp);
/**
* @brief addEdge - add edge... | ALGO | 0.998403 | 3.646459 | {
"github_metadata": {
"branch": "master",
"commit_count": 180,
"repo_created_at": "2013-12-09T12:47: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": "465a0b5d... |
83eedd7c-30c3-46c3-ab21-626dcd6f4084 | octavioromagnoli/homework-1 | Ej_1/1.cpp | #include "1.h"
#include <iostream>
using namespace std;
int main() {
cout<<"### EJERCICIO 1 ### \n Consigna a) \n";
int n;
cout << "Ingrese la dimension de su matriz cuadrada:";
cin >> n;
int** matrix = create_matrix(n);
// imprimo la matriz en forma cuadrada para que el usuario la pueda ver
cout << "S... | ALGO | 0.936121 | 3.799616 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2025-03-10T15:36: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": "6a4a12d3fd0... |
1ec17413-2f73-411b-a7b0-ae91ab28ffbb | Hikari9/UVa | 11418 - Clever Naming Patterns.cpp | /**
UVa 11418 - Clever Naming Patterns
by <NAME>
Submitted: Feb 27, 2014
Accepted 0.019s C++
Edmond's Karp (maxflow)
*/
#include <iostream>
#include <cstring>
#include <cctype>
#include <queue>
#include <algorithm>
#define INF 2147483647
using namespace std;
void normalize( string& s ){
transform( s.begin(), s.... | ALGO | 0.999863 | 3.834156 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2016-01-03T04:44:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13882f94... |
55c41168-cfa6-4031-9b65-fe1020fb9b91 | fpcsong/ACM_templates | Segment_Tree.cpp | //传统自上而下的线段树
//poj3468
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
const int maxn = 2e7 + 10;
struct node
{
int l, r;
long long ad, sum; //lazy
} tree[maxn];
int posmap[maxn]; //保存原始数据对应的节点,这样单点更新的时候可以少一次树上的递归
void pushup(int rt)
{
tree[rt].sum = tree[rt << 1].sum + tree[... | ALGO | 0.999629 | 4.123106 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-12-18T08:47:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "efe7c21416... |
40229878-508e-40fa-b37e-5499612676eb | FatosRama/LeetCode-Solution-Codes | 1678.Goal Parser Interpretation-SolutionCode.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
cout << endl << "1678. Goal Parser Interpretation" << endl << endl << "You own a Goal Parser that can interpret a string command. " << endl << "The command consists of an alphabet of \"G\", \"()\" and/or \"(al)\" in some order. ... | ALGO | 0.999548 | 4.285729 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-01-10T14:08: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": "5b02d6381e49... |
077b1473-0d89-41b9-a609-6c17ab630b25 | mathhat/unik4660 | visualization/read.cpp | #include "fstream" /*writes to file*/
#include "hdf5.h" /* reads from .h5 files*/
#include "iostream" /* cout, endl */
#include <stdlib.h> /* srand, rand */
#include <string> //stringsss
#include <string.h> //memcpy
#include <math.h> /* sqrt */
#define FILE "isabel_2d.h5... | ALGO | 0.964157 | 3.507118 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-03-28T21:39: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": "07375cbbc3... |
3a1dab46-d9bc-433d-a807-10848f9e7e89 | abhiranjankumar00/CodeForces | 80/tmp.cpp | //%%%%%%%%%%%%
//%%%%lost%%%%
//%%%%%%%%%%%%
#include <iostream>
#include <ctime>
#include <vector>
#include <list>
#include <queue>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <cassert>
#include <utility>
#inc... | ALGO | 0.99998 | 3.383908 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2013-08-18T20:06:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e77c4f18f... |
4a05b049-5e72-451c-be41-4ce18ceabb16 | harryadav3/dsacp | pepcoding/10.Heap/babarheap.cpp | #include <bits/stdc++.h>
using namespace std;
class heap {
public:
int arr[100];
int size = 0;
heap() {
arr[0] = -1;
size = 0;
}
void insert(int val) {
size = size + 1;
int index = size;
arr[index] = val;
while(index > 1 ) {
i... | ALGO | 0.996571 | 3.549653 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-01-29T18:06: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": "c11515cd7d3... |
32d9ed8e-3a0f-4292-9101-b3c35956641b | hanwool26/solve_codetest | 인프런코테강의/톰과제리.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int N;
pair<int, int> start;
pair<int, int> finish;
int map[100][100];
int visit[100][100];
enum {
UP,
DOWN,
LEFT,
RIGHT
};
int dir_x[] = { -1, 1, 0, 0 };
int dir_y[] = { 0, 0, -1, 1 };
typedef struct node {
int x;
int y;
int dir;
... | ALGO | 0.999975 | 4.085277 | {
"github_metadata": {
"branch": "main",
"commit_count": 457,
"repo_created_at": "2021-02-24T02:41:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23cbfd3a5b... |
30944c59-eabe-4759-915b-2af4c712cc06 | ishandutta2007/codeforces-i | ismagilov.code/normal/1112/B.cpp | #include <bits/stdc++.h>
#define int long long
#define ld long double
#define fs first
#define sc second
#define vc vector
#define pr pair
#define mp make_pair
#define pb push_back
#define len(v) (int)v.size()
#define all(v) v.begin(), v.end()
#pragma GCC optimize("Ofast")
using namespace std;
const int INF = 2e9;
... | ALGO | 0.999831 | 3.675985 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6783efdde99... |
49bca141-aedb-4bf1-9f85-152222f83ecf | Yawning/obfsclient | src/schwanenlied/pt/scramblesuit/prob_dist.cc | /**
* @file prob_dist.cc
* @author <NAME> (yawning at schwanenlied dot me)
* @brief ScrambleSuit Probability Distribution (IMPLEMENTATION)
*/
/*
* Copyright (c) 2014, <NAME> <yawning at schwanenlied dot me>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* m... | ALGO | 0.991074 | 6.530689 | {
"github_metadata": {
"branch": "master",
"commit_count": 121,
"repo_created_at": "2014-02-03T02:31:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 31,
"forks": 13,
"issues": 7,
"pull_requests": 2
},
"file_meta": {
"content_id": "8475e0... |
200085b1-d1dd-400a-8a32-653581d2f404 | ritwishi/Data_Structure_and_Algorithms | Binary search tree/Search in BST/itreative_search_bst-1.cpp | #include <bits/stdc++.h>
using namespace std;
struct node
{
int data;
node *left;
node *right;
node(int data)
{
this->data = data;
this->left = NULL;
this->right = NULL;
}
};
bool search(node *root, int x)
{
while (root != NULL)
{
if (root->data == ... | ALGO | 0.999992 | 4.705343 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-07-27T07:13: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": "9b5656905f7... |
9be3fabd-e3eb-4adc-899f-039461d7fdc7 | Carfi-Fondamenti-Informatica/03-ricerca-nome-5059968 | main.cpp | #include <iostream>
using namespace std;
int main() {
char lista_nomi[3][5] = {"", "", ""};
char nome[5] = {""};
cin >> lista_nomi[0];
cin >> lista_nomi[1];
cin >> lista_nomi[2];
cout << endl;
cin >> nome;
if (nome[0] == lista_nomi[0][0] and nome[1] == lista_nomi[0][1] and nome[2] == lis... | ALGO | 0.999871 | 3.125035 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-04-20T07:24:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7392a8ce93817... |
aeddef5b-5d56-4e4e-9daa-15364ab77a89 | LiuYu0521/lintcode | 二叉树/85.在二叉查找树中插入节点.cpp | /**
* Definition of TreeNode:
* class TreeNode {
* public:
* int val;
* TreeNode *left, *right;
* TreeNode(int val) {
* this->val = val;
* this->left = this->right = NULL;
* }
* }
*/
class Solution {
public:
/**
* @param root: The root of the binary search tree.
... | ALGO | 0.999997 | 5.736887 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2017-06-26T11:04:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "72a0419a... |
afa4d41b-d706-423c-95d9-6c74b8a47c4b | chinudev/hacker | algo/graph/roads.cpp | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#inc... | ALGO | 0.999845 | 3.338718 | {
"github_metadata": {
"branch": "master",
"commit_count": 146,
"repo_created_at": "2017-05-11T18:46:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f819a4b6... |
48477f9b-eb15-48e5-9998-9860a89d4b20 | chenlu11/ETH-Algorithms-Lab---AS16 | week7/maximize.cpp | #include <iostream>
#include <cassert>
#include <CGAL/basic.h>
#include <CGAL/QP_models.h>
#include <CGAL/QP_functions.h>
using namespace std;
// choose exact floating-point type
#ifdef CGAL_USE_GMP
#include <CGAL/Gmpzf.h>
typedef CGAL::Gmpzf ET;
#else
#include <CGAL/MP_Float.h>
typedef CGAL::MP_Float ET;
#endif
// ... | ALGO | 0.998713 | 3.343966 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-11-21T10:29: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": "e8a324e82a... |
bce32b62-cb85-46c4-8bf6-9fda6732866d | Seungchan0325/baekjoon | solutions/1071_0.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 55;
int n;
vector<int> arr;
int main() {
cin >> n;
arr.resize(n);
for(int i = 0; i < n; i++) cin >> arr[i];
sort(arr.begin(), arr.end());
for(int i = 1; i < n; i++) {
if(arr[i-1] + 1 == arr[i]) {
if(arr.back() ==... | ALGO | 0.999996 | 4.330263 | {
"github_metadata": {
"branch": "main",
"commit_count": 795,
"repo_created_at": "2023-12-31T15:30: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": "0425e6818a... |
6ecd5bdb-8225-4a83-b01f-e3aef3e31d5e | t4ichi/AtcoderAnswers | abc287/d.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string s, t;
cin >> s >> t;
int s_size = s.size();
int t_size = t.size();
vector<bool> a(s_size+1),b(s_size+1);
a[0] = true;
b[0] = true;
auto isMatch = [&](int i){
if(s[i] == t[i] || s[i] == '?' || t[i] == '?')... | ALGO | 0.999996 | 3.960213 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2022-10-29T08:34: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": "e999358f86c... |
41d6e659-f11d-4115-9219-b79d22bc75a9 | wy-luke/LeetCode | 812.最大三角形面积.cpp | /*
* @lc app=leetcode.cn id=812 lang=cpp
*
* [812] 最大三角形面积
*/
// @lc code=start
class Solution {
public:
double largestTriangleArea(vector<vector<int>> &points) {
int n = points.size();
double res = 0;
for (int i = 0; i < n - 2; ++i) {
for (int j = i + 1; j < n - 1; ++j) {
... | ALGO | 0.999969 | 6.848772 | {
"github_metadata": {
"branch": "main",
"commit_count": 421,
"repo_created_at": "2021-11-24T11:29:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a203fc1af1... |
625cf08f-f2a7-4812-b513-261a774fbbd6 | tjdbssy137/sbs_202402 | homework/20240529_01/WindowsGame/CommonFunction.h | #pragma once
//즐겨쓰는 함수들을 추가해줄거에요.
namespace Collision
{
bool PtInRect(POINT pt, RECT rect);
bool PtInRect(int ptX, int ptY, int x1, int y1, int x2, int y2);
bool RectInRect(RECT rect1, RECT rect2);
bool CircleInCircle(Vector2 pos1, float radius1, Vector2 pos2, float radius2);
bool RectInCircle(CenterRect rect, ... | TOOL | 0.971675 | 5.402129 | {
"github_metadata": {
"branch": "main",
"commit_count": 184,
"repo_created_at": "2024-02-07T11:25: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": "55ca3f8c28... |
9e464b47-d1b9-4aed-8b61-fc8f661c5e8a | amansaxena1/Leetcode | 1410-html-entity-parser/1410-html-entity-parser.cpp | class Solution {
public:
string entityParser(string text) {
map<string, char>mp;
mp["quot"] = '"';
mp["apos"] = '\'';
mp["amp"] = '&';
mp["gt"] = '>';
mp["lt"] = '<';
mp["frasl"] = '/';
int f = 0;
string temp="",ans="";
for(int i=0;i<te... | ALGO | 0.992096 | 4.253269 | {
"github_metadata": {
"branch": "main",
"commit_count": 859,
"repo_created_at": "2022-02-17T14:51:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b8f599545... |
5713cb74-cce9-43bd-811b-a80bd115d000 | laxminagln/obstacle-sensor | ultrasonic/ultrasonic.ino | const int pingPin = 2;
const int echoPin = 3;
const int in1 = 4;
const int in2 = 5;
const int in3 = 6;
const int in4 = 7;
const int enA = 10;
const int enB = 11;
int duration, distance;
void setup()
{
Serial.begin(9600);
pinMode(pingPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(in1,OUTPUT);
pinMode(in2,O... | TOOL | 0.931809 | 4.514431 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-03-22T19:13: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": "523f1a43a... |
7a64f85b-3dbf-4351-be53-5d7abd726e0e | csobaistvan/VisSimFramework | Source/Core/BVH.h | #pragma once
////////////////////////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////////////////////////
#include "PCH.h"
#include "Constants.h"
namespace BVH
{
//////////////////////////////////////////////////////////////////////... | ALGO | 0.952446 | 5.838142 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2024-01-11T11:45:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "88b8f8ff2c... |
06d4365a-4eb5-4c3a-b068-6cf033df27f8 | HackintoshwithUbuntu/BigRepo | competitive/c++/z.aio/2021/space2.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
freopen("spacein.txt", "r", stdin);
freopen("spaceout.txt", "w", stdout);
int n,f;
cin >> n >> f;
vector<pair<int, int>> fuel(n);
for(int i = 0; i < n; i++){
int ... | ALGO | 0.999996 | 3.911685 | {
"github_metadata": {
"branch": "master",
"commit_count": 109,
"repo_created_at": "2020-09-20T02:54: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": "61b71881... |
93ac16a1-5bd7-4c27-9b0d-e58913861354 | jeremykvlim/kattis | open/vjestica.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<vector<int>> freq(n, vector<int>(26, 0));
for (int i = 0; i < n; i++) {
string s;
cin >> s;
for (char c : s) freq[i][c - 'a']++;
}
... | ALGO | 0.999979 | 3.939452 | {
"github_metadata": {
"branch": "main",
"commit_count": 4387,
"repo_created_at": "2023-11-17T12:14:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b5b4988b... |
08f0601e-dab5-4b64-8cc1-0f958dcbd427 | JimmyWang0417/Algorithm-Competitive-Codes | 一本通/1521.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
#define re register
#define ll long long
using namespace std;
const int oo = 1e9, M = 1e5 + 5;
int n, m,
num_edge, head[M],
dfn[M], low[M], st[M], top,
root, dfstime,
bt, cnt;
bool gedian[M];
struct Edge
{
int next, to;
} edg... | ALGO | 0.999927 | 3.671089 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2019-08-30T06:36:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a3d6acf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.