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 |
|---|---|---|---|---|---|---|---|
01a691c8-e9cf-4672-ab4f-8a9b18e1bd9c | tekiOh/algorithm-quiz | baekjoon/3190_2.cpp | //
// Created by vkdne on 2018-10-19.
//
#include <iostream>
#include <queue>
using namespace std;
int N, K, L;
//뱀지도 : 1 -> 사과, 2 -> 뱀
int map[101][101];
//방향지도
int direction[101][101];
//4방향 : 상우하좌
int dx[5] = {0,0, 1, 0, -1};
int dy[5] = {0,-1, 0, 1, 0};
queue<pair<int, char>> q;
void printMap(){
for(int i = ... | ALGO | 0.99994 | 4.327412 | {
"github_metadata": {
"branch": "master",
"commit_count": 199,
"repo_created_at": "2018-02-01T12:12:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1cdaf39... |
a0c18e25-dc34-4c1a-89e9-4972a9bdd181 | Ahmed-Mohmed-Sakr/Cryptography | Playfair-Encrypt-Decrypt.c++ | #include<bits/stdc++.h>
#define Sakr_ ios_base :: sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0);
#define ll long long
using namespace std;
/**
* by:<NAME> (sakr_) with AZA ;
* freopen("input.txt","r",stdin);
* freopen("output.txt","w",stdout);
* __builtin_popcountll();
**/
char matrix[6][6];
map<char,pair<in... | ALGO | 0.999835 | 4.469519 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-05-30T05:42:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1322f1d82e4... |
781f52d3-e575-402b-9c7e-f39eb497d193 | ThanhDuy203/Codeforces | 144A.cpp | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main(){
int n; cin >> n;
vector <int> arr;
int Min = INT_MAX, pos_min = 0;
int Max = INT_MIN, pos_max = 0;
for (int i = 0; i < n; i++){
int x; cin >> x;
if (x <= Min) {
if (x < Min){
Min = x;
pos_min = i;
} else if (pos_min < i) ... | ALGO | 0.999987 | 3.902024 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-01-19T03:53:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7caebb570386... |
a541ee33-d7a6-4614-9078-e6426e161c7d | Niceforester/complex-gdp | erw_euklid.cpp | #include <iostream>
#include <vector>
//#include <iomanip>
int euklid(int a, int n)
{
std::vector<int> i_feld;
std::vector<int> n_feld( {a} );
std::vector<int> a_feld( {n%a} );
std::vector<int> q_feld( {n/a} );
// int r;
for(int i = 0; a_feld.back()>0; i++)
{
i_feld.push_back( i );
//r = n%a;
... | ALGO | 0.999835 | 5.117627 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-02-07T15:33: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": "610186975a... |
0eef3a12-6c0d-46f9-bcdb-047242532758 | miyou379/beingBeatenCompetitiveCoding | atc/abc/351/b.cpp | #pragma GCC optimize(3) // O3 optimize
#include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
// Note that it's virtually < 2^31
const int INF = 0x3f3f3f3f;
const double eps = 1e-7;
const int M1 = 1000000007;
const int M2 = 998244353;
// Note that lfor requires indeed integ... | ALGO | 0.998875 | 3.294558 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-05-13T04:28: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": "abc1e3c7abb8... |
36734fd9-51f9-406f-b9f2-946550f14f0f | Andrei0872/how-it-started | first-problems-solved/de-cate-ori-apare-un-el-rec.cpp | // Written at: 17 nov 2017
#include <iostream>
using namespace std;
int n,a[20];
/*Functie recursiva pt de cate ori apare o valoare intreaga x intr-un vector a cu n elemente intregi*/
void citeste(int i){
if( i!=0) citeste (i-1);
cout<<i<<" : ";
cin>>a[i]; }
int nrap(int a[], int n, int x){
if(n==-1) return 0;
else ... | ALGO | 0.999649 | 3.495202 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2021-08-10T21:14: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": "465466a0e... |
4ca35dd2-22af-4b23-8231-c7482279080b | manwar/perlweeklychallenge-club | challenge-299/ulrich-rieke/cpp/ch-2.cpp | #include <vector>
#include <string>
#include <sstream>
#include <utility>
#include <iostream>
#include <map>
#include <cstdlib>
#include <set>
#include <algorithm>
std::vector<std::string> split( const std::string & text , char delim ) {
std::istringstream istr { text } ;
std::vector<std::string> tokens ;
std... | ALGO | 0.999772 | 4.95071 | {
"github_metadata": {
"branch": "master",
"commit_count": 44412,
"repo_created_at": "2019-03-30T01:15:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 194,
"forks": 332,
"issues": 5,
"pull_requests": 4
},
"file_meta": {
"content_id": "63... |
7c924ea5-5d6d-4a55-9d83-e77fe11f93df | phnam24/DSA-PTIT | ThucHanh/Thi thu 2/Hoan_vi.cpp | #include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define test int t; cin >> t; while(t--)
#define nhap(a) for ( auto &i : a ) cin >> i
using namespace std;
int mod = 1e9 + 7;
int n, m;
int a[15], mark[15];
vector<vector<int>> v;
void in()
{
vector<int> tmp;
for(int i = 1; i <= n; i++)
{
... | ALGO | 0.999973 | 3.785728 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-01-30T14:47:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0633e2bb7e3... |
660e88a1-1ffd-4449-9466-ce7622f9a1c2 | Ujjwalmittal1907/data-structure-and-algorithm | c++/h recursion/10subset_sum.cpp | #include<iostream>
#include<vector>
using namespace std;
void findsum(vector<int> arr , int index , int n, vector<int> &ans , int sum){
if(index == n){
ans.push_back(sum);
return ;
}
findsum(arr , index+1 , n , ans ,sum);
// sum add ker
findsum(arr , index+1 , n ,ans,sum+arr[in... | ALGO | 0.999658 | 5.383996 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2023-07-27T13:11: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": "113def3e63... |
48e867b0-3fc6-429e-ad96-bc726824af16 | upesacm/21DaysOfCode-2023 | C&C++/Garima Hansa/Quizzes/Quiz3_3.cpp | /*
In the ever-evolving realm of quantum computing, the challenge lies in creating a cutting-edge quantum algorithm that efficiently detects a given word within a 2D matrix quantum crossword puzzle. This algorithm must explore all directions, including reverse options, using the power of quantum principles like superpo... | ALGO | 0.999993 | 6.169844 | {
"github_metadata": {
"branch": "main",
"commit_count": 3524,
"repo_created_at": "2023-06-30T09:19:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 101,
"issues": 0,
"pull_requests": 10
},
"file_meta": {
"content_id": "f01e0b2... |
2b4e269a-48b5-4a30-82a3-6a7d3f40b070 | ArshiaP/coding | GFG/greedy/MinimumSpanningTree.cpp | // https://practice.geeksforgeeks.org/problems/minimum-spanning-tree/1
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
// asu code
int spanningTree(int V, vector<vector<int>> adj[]) {
vector<int> visited(V, 0);
int min = INT16_MAX;
int v1 = 0;
int v2 = 0;
for (int i = 0... | ALGO | 0.999967 | 5.633604 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2022-02-14T14:04: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": "efb784401... |
32eea430-b6f7-4211-8e7c-4fd3273eb221 | seungwonB/SW_Expert_Acamedy | D3/4751.cpp | #include<iostream>
using namespace std;
int main(int argc, char** argv)
{
int test_case, T;
string str;
cin >> T;
for(test_case = 1; test_case <= T; ++test_case)
{
string s1 = "..#..";
string s1_1 = ".#..";
string s2 = ".#.#.";
string s2_1 = "#.#.";
string s3 = "#.";
string s3_1 = ".#.";
cin >> s... | ALGO | 0.999506 | 3.181104 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2022-01-06T07:14:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d12b2c4b... |
eafb8208-1c2a-4481-a3a3-ebe66e0c1ab9 | leewoongi/Algorithm | BackJoon/2468/dong/boj_2468.cc | #include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
int n, m;
int arr[101][101];
bool visit[101][101];
int cnt = 0;
int result = 0;
int max_h = 0;
int dir_x[4] = { -1,0,1,0 };
int dir_y[4] = { 0,-1,0,1 };
typedef struct NODE {
int x;
int y;
}node;
queue<node> q;
void inspect(int h) {
for (in... | ALGO | 0.999754 | 4.27818 | {
"github_metadata": {
"branch": "master",
"commit_count": 331,
"repo_created_at": "2019-11-26T16:48:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 21,
"pull_requests": 0
},
"file_meta": {
"content_id": "3908623... |
82d819e1-b74b-411d-9b17-ead2b81c4c13 | ChunmingGu/mne-cpp-master | applications/mne_scan/plugins/epidetect/fuzzymembership.cpp | //=============================================================================================================
/**
* @file fuzzymembership.cpp
* @author <NAME> <<EMAIL>>;
* <NAME> <<EMAIL>>
* @version 1.0
* @date January, 2017
*
* @section LICENSE
*
* Copyright (C) 2017, <NAME> and <NAME>. All ri... | ALGO | 0.97289 | 5.906945 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-03-11T00:20:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43331ebcac... |
44a755e4-a626-49f2-ab58-062a88c744f7 | anvnh/CP | Codeforces/2021_UCF_Local_Programming_Contest/A.cpp | /**
Author: anvnh
RyeNyn
**/
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define anvnh signed main(void)
template <typename T>
void print(const T& t) {
for (const auto& element : t) {
std::cout << element << " ";
}
st... | ALGO | 0.999597 | 3.629564 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-03-08T16:04:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73d17f0ea97... |
be729a31-66f5-4064-8c42-75e5013f359c | Levrero/Algorithms | randomized_selection/randomized-selection.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <time.h>
// partition function
void partition(std::vector<int> &vector, int &pivot)
{
int temp = vector[pivot];
vector[pivot] = vector[0];
vector[0] = temp;
int ii = 1;
for (int jj = 1; jj < vector.size(); ++jj)... | ALGO | 0.999961 | 5.2314 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2020-05-02T12:30: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": "e24c52cb2... |
e491b640-f653-4135-a002-74dc27b6ba57 | YingHN/Projects | Code/SourseCode/USACO-2022/test2/#1/A.cpp | /*
## [Problem](http://usaco.org/index.php?page=viewproblem&cpid=1263)
## Hint
本题是**哲学**题.
### 核心性质
对于"管辖到同品种的所有奶牛"的领袖,
! 每个品种只有一个且定是从左到右第一个该品种奶牛.
(可能不存在)
> 例如(SimpleInput1): 品种H的领袖"管辖到同品种的所有奶牛", 这位领袖一定唯一(id=2)
因此统计能管辖到所有奶牛的领袖对(p,q)共有两种情况:
1. p,q均能管辖到同品种的所有奶牛(只有一对);
2. q能管辖同品种的所有奶牛, p能管辖到q(有很多对);
*/
#inc... | ALGO | 0.999847 | 3.262948 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-01-30T08:47: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": "f4130fafdf7... |
e2f65af8-5864-4e36-ab72-dc9d0ab548e7 | gespo89/USACO | Section02.03/prefix/prefix.cpp | /*
ID: gespo891
PROG: prefix
LANG: C++11
*/
#include <fstream>
#include <algorithm>
#include <iostream>
using namespace std;
bool dp[200001] = {true};
vector<string> prims;
string sequence;
int main() {
int count = 0;
ifstream fin ("prefix.in");
ofstream fout ("prefix.out");
string s;
fin >> s;
... | ALGO | 0.999556 | 3.754306 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2015-04-06T16:52: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": "b6145697e... |
88d22e76-c533-43f6-bf8f-259d442d3326 | mongodb/mongo | src/third_party/boost/libs/numeric/ublas/include/boost/numeric/ublas/blas.hpp | // Copyright (c) 2000-2011 <NAME>, <NAME>, <NAME>
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// The authors gratefully acknowledge the support of
// GeNeSys mbH & Co. KG in producing this work.
... | TOOL | 0.919826 | 6.792781 | {
"github_metadata": {
"branch": "master",
"commit_count": 90314,
"repo_created_at": "2009-01-15T16:15:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 27329,
"forks": 5655,
"issues": 0,
"pull_requests": 82
},
"file_meta": {
"content_id": ... |
718e5f9e-1775-40da-bc9d-65b00552053d | Jiwon-Woo/BOJ | 백준/Silver/1926. 그림/그림.cc | #include <iostream>
#include <deque>
using namespace std;
int n, m;
int paper[500][500];
int check[500][500];
pair<int, int> tool[4] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
int bfs(pair<int, int> coordi)
{
int size = 1;
deque<pair<int, int>> q;
q.push_back(coordi);
check[coordi.first][coordi.second] = 1;
while ... | ALGO | 0.999796 | 4.126734 | {
"github_metadata": {
"branch": "main",
"commit_count": 115,
"repo_created_at": "2022-09-11T15:14: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": "50e547a744... |
e7dcdc99-2594-42bb-b450-b8a5e940d4b6 | JoelGunawan/competitive-programming | codeforces/1900-1999/1907/e.cpp | // header file
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
// pragma
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
// macros
#define endl "\n"
#define ll long long
#define mp make_pair
#define ins insert
#define lb lower_bound
#define pb pu... | ALGO | 0.999568 | 4.598797 | {
"github_metadata": {
"branch": "main",
"commit_count": 665,
"repo_created_at": "2021-06-06T04:24:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "27ed580a51... |
646d9a72-8669-4325-8f12-57eff38f66b6 | Kafi-Sq/Learning | C++/Projects/robot.c++ | #include <iostream>
#include <ctime>
#include <cstdlib>
#include <thread>
#include <mutex>
using namespace std;
char space[17] = { 'o', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-' };
int stepClock = 1;
int bombClock = 0;
int moveb1 = 0;
int robot;
int Bomb1, Bomb2;
int GoldBar1, Go... | ALGO | 0.981019 | 3.144091 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2022-10-08T22:03:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d60622d1b... |
90fb1dad-ea3d-4381-aca5-4abd5d929984 | NTDLS/Fortitude-HTTP | Source/Service/Source/CCustomFilters.cpp | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright © NetworkDLS 2002, All rights reserved
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO... | TOOL | 0.950189 | 5.179647 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2018-04-10T00:45: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": "d1f19e46a... |
7292605b-b82b-49c7-ade3-6183654e420a | MilkClouds/Competitive-Programming | Codeforces/1656F.cpp | #include <bits/stdc++.h>
#define rep(i,a,b) for(int i = (a); i < (b); i++)
#define rep2(i,a,b) for(int i = (b) - 1; i >= (a); i--)
#define cinA(A, N) rep(i, 0, N) cin >> A[i];
#define coutA(A, N) rep(i, 0, N) cout << A[i] << " ";
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define eb emplace_back
#define... | ALGO | 0.999873 | 4.227909 | {
"github_metadata": {
"branch": "main",
"commit_count": 3514,
"repo_created_at": "2021-02-23T16:44: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": "dec31620b... |
95ae1d2a-90e7-468f-8b90-1da5b873a036 | xtactis/competitiveprogramming | atcoder/agc005/A.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif
void init() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
}
const int N = 2e5+23;
int p[N];
void solve() {
string s, q; cin >> q;
for (bool chan... | ALGO | 0.99969 | 3.549325 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-07-20T12:25: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": "f52969c2cff5... |
882525b3-8c6d-4f7a-a821-ef70d9a169e7 | nikolovjovan/reproflop | src/cpu/examples/mri-gridding (Parboil)/StrongReproducibility/main.cpp | /***************************************************************************
*
* (C) Copyright 2010 The Board of Trustees of the
* University of Illinois
* All Rights Reserved
*
***************************************************************************/
... | ALGO | 0.972663 | 3.131967 | {
"github_metadata": {
"branch": "master-thesis",
"commit_count": 58,
"repo_created_at": "2020-08-03T08:41:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "3b... |
82a2e6e7-a85f-4bb0-b6b3-449d40c71e45 | xtaci/libkcp | matrix.h | //
// Created by 理 傅 on 2016/12/30.
//
#ifndef KCP_MATRIX_H
#define KCP_MATRIX_H
#include <vector>
#include <memory>
#include "galois.h"
using row_type = std::shared_ptr<std::vector<byte>>;
struct matrix {
// newMatrix returns a matrix of zeros.
static matrix newMatrix(int rows, int cols);
// IdentityM... | ALGO | 0.955808 | 5.356188 | {
"github_metadata": {
"branch": "master",
"commit_count": 275,
"repo_created_at": "2016-07-10T13:51:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 319,
"forks": 122,
"issues": 2,
"pull_requests": 3
},
"file_meta": {
"content_id": "29d9... |
5451a23b-7d64-4cd9-b392-04e01c9c789d | mass-hit/DB-system | src/execution/nested_loop_join_executor.cpp | //===----------------------------------------------------------------------===//
//
// BusTub
//
// nested_loop_join_executor.cpp
//
// Identification: src/execution/nested_loop_join_executor.cpp
//
// Copyright (c) 2015-2021, Carnegie Mellon University Database Group
//
//===-------------------... | ALGO | 0.964964 | 6.953227 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2024-08-29T08:03: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": "2e7ff4222... |
64db5a2a-4bd5-4258-841c-135b6e4c5c18 | AlanYume/ACM-ICPC | code/poj/3155/3155(初步算法).cpp | //胡伯涛论文4.2节 初步算法,复杂度:O(logN * MaxFlow(n + m, n + m))
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<queue>
using namespace std;
typedef pair<int, int> P;
const int MAXN = 1000 << 1;
const int MAXM = 1000 << 3;
const double INF = 1e9;
const double EPS = 1e-6;
int n, m;
P p[1000 + 16];... | ALGO | 0.999988 | 3.390928 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2015-08-15T02:24:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 26,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "90500eb... |
e8c8268f-d9f8-4bfd-b223-054c255be5b4 | mjenrungrot/competitive_programming | UVa Online Judge/v126/12694.cc | /*=============================================================================
# Author: <NAME> - https://github.com/mjenrungrot/
# FileName: 12694.cc
# Description: UVa Online Judge - 12694
=============================================================================*/
#include <bits/stdc++.h>
... | ALGO | 0.999694 | 3.988409 | {
"github_metadata": {
"branch": "master",
"commit_count": 258,
"repo_created_at": "2015-11-17T04:41:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "09d3e90e... |
142eb8e4-efcd-422b-8691-27b0c61a66ef | ishandutta2007/codeforces-p | prabowo/normal/1366/C.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 33;
int n, m;
int a[N][N];
int cnt[N*2][2];
int solve() {
scanf("%d %d", &n, &m);
for (int i = 0; i < n+m; ++i) cnt[i][0] = cnt[i][1] = 0;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
int r = min(i+j, n+m-2-i-j);
int ... | ALGO | 0.999932 | 3.584228 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15: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": "a7ba1e799e31... |
796af536-acae-4a2c-bab4-f818a0f2595e | qblays/scheme_approx | common.cpp | #include "common.h"
void fill_system_for_V(arr_t &a, arr_t &b, arr_t &c, arr_t &V_next, arr_t &V_curr, arr_t &H_next, arr_t &H_curr, int n, const data &d, double (*f) (double, double, const data&))
{
int M = d.M;
double tau = d.tau;
double h = d.h;
double gamma = d.gamma;
double mu = d.mu;
a[0] = 0;
b[0]... | ALGO | 0.999972 | 3.505353 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2020-11-08T12:39: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": "831d73d05b6e... |
f202da26-d786-4fd5-a32a-40bfae662729 | bizkut/warz-client | External/NaturalMotion/morpheme/SDK/euphoriaCoreBehaviours/Implementation/ArmSwingImpl.cpp | /*
* Copyright (c) 2011 NaturalMotion Ltd. All rights reserved.
*
* Not to be copied, adapted, modified, used, distributed, sold,
* licensed or commercially exploited in any manner without the
* written consent of NaturalMotion.
*
* All non public elements of this software are the confidential
* information of NaturalM... | TOOL | 0.915219 | 5.064756 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2015-12-20T14:48:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 17,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "68d6c3b7... |
e57837e0-da83-44d0-818d-76e1716b8b94 | ishandutta2007/codeforces-n | normie28/normal/601/C.cpp |
// Problem : <NAME> and the n-thlon
// Contest : Codeforces - Codeforces Round #333 (Div. 1)
// URL : https://codeforces.com/problemset/problem/601/C
// Memory Limit : 256 MB
// Time Limit : 1000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
/*
A Submission by $%U%$
at time: $%Y%$-$%M%$-$%D%$ $%... | ALGO | 0.995769 | 3.480726 | {
"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": "d76016dc2f67... |
15178ac7-8130-457d-9bbb-2cf04d5e7c37 | jczh98/Algorithm | training/XXI Ural Championship/sol/d.cpp | #include <string.h>
#pragma comment(linker,"/STACK:64000000")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <cmath>
#include <map>
#include <set>
#include <ctime>
#include <algorithm>
#include <memory.h>
#include <stdio.h>
#include <stdlib.h>
#includ... | ALGO | 0.999965 | 3.668607 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2016-07-02T08:52:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e9bc23b58... |
856f3823-0eca-41f1-8ba3-dcaca07e8f4a | ishandutta2007/codeforces-c | chemthan/normal/601/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); i--)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
... | ALGO | 0.999914 | 3.262247 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81e991387b32... |
4188a79c-a373-44d6-985a-e474fd3b2061 | atharvguptaaa/dsa | 13Heap/01HeapImplement.cpp | #include<bits/stdc++.h>
using namespace std;
class heap{
public:
int arr[100];
int size;
//constructor
heap(){
arr[0]=-1;
size=0;
}
void insert(int v){
size++;
int index=size;
arr[index]=v;
// Heapify-up: Restore the max-heap property
... | ALGO | 0.999919 | 4.001824 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2023-12-15T19:24:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "127fbf54115... |
11436cbe-e3c7-45a3-b2ee-9cbe89f1f056 | DangdangBase/BOJ-Code | Solved/Silver/7576.cpp | #include <bits/stdc++.h>
using namespace std;
int N, M;
int tomatos[1010][1010];
int ret;
struct tomato_state{int y, x, t;};
queue<tomato_state> q;
int actions[4][2] =
{
0, 1,
0, -1,
1, 0,
-1, 0
};
int main()
{
cin.tie(0);
ios_base::sync_with_stdio(0);
cin >> M >> N;
for(int i=0; i<... | ALGO | 0.999986 | 3.956238 | {
"github_metadata": {
"branch": "master",
"commit_count": 201,
"repo_created_at": "2020-04-25T13:05: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": "ade45a59... |
100eaa89-c51f-46a0-8573-47cde5702a9a | ishandutta2007/codeforces-s | scott_wu/normal/1010/A.cpp | #include <iostream>
#include <iomanip>
#include <fstream>
#include <map>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <ctime>
using namespace std;
typedef long long ll;
const int MAXN = 1100;
int N, M;
int A[MAXN], B[MAXN];
vector <int> v;
bool works (double d)
{
double vs = d... | ALGO | 0.999956 | 3.269412 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07: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": "ae819f9f52eb... |
15f6527d-a266-40d4-934b-162b637c7498 | Gaurang03/DSA-Questions | DPP4/3_rod_cutting.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
const long long ONE_SIXTH = 166666668;
ll dp[1001][1001];
int32_t main()
{
ll n;
cin >> n;
ll val[n], wt[n];
for (ll i = 0; i < n; i++)
cin >> val[i];
for (ll i = 0; i < n; i++)
cin >> wt[i];
... | ALGO | 0.999991 | 4.281919 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-03-12T09:20: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": "6e2eb6d21304... |
db1e97a7-2f23-4c0c-a703-237dfe5e005c | SSAFY-BLUE/BOJ | week3/승록/2502.cpp | // 첫 날 떡의 개수를 a, 둘째 날 떡의 개수를 b라고 하면 세 번 째 날부터 각각 fibo[D - 3] * a + fibo[D - 2] * b개의 떡을 주게 된다.
// D까지의 피보나치 수열을 구한 뒤, a와 b를 구해주면 된다.
#include <bits/stdc++.h>
using namespace std;
int D, K;
int fibo[40];
int main() {
cin.tie(0) -> sync_with_stdio(0);
cin >> D >> K;
// 피보나치 수열 구하기
fibo[0] = 1;
fibo... | ALGO | 0.99997 | 3.979841 | {
"github_metadata": {
"branch": "main",
"commit_count": 237,
"repo_created_at": "2024-07-16T14:38:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b71d5130ce1... |
8348c956-eeab-465f-8b85-3517066e73f7 | Hunterdii/GeeksforGeeks-POTD | February 2025 GFG SOLUTION/February-07.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// Tree Node
class Node {
public:
int data;
Node* left;
Node* right;
Node(int val) {
data = val;
left = right = NULL;
}
};
// } Driver Code Ends
/*
// Tree Node
class Node {
public:
int data;
Node* l... | ALGO | 0.999636 | 6.617321 | {
"github_metadata": {
"branch": "main",
"commit_count": 3732,
"repo_created_at": "2024-03-09T09:48:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 202,
"forks": 54,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cfe7dd... |
3f142fc9-2ff9-45d1-9746-fd75c8192661 | irina-wang/Maya | TestExamples/closestPointOnCurvePlugin.cpp | // File: closestPointOnCurveStrings.cpp
// HEADER FILES:
#include "closestPointOnCurveCmd.h"
#include "closestPointOnCurveNode.h"
#include "closestPointOnCurveStrings.h"
#include <maya/MFnPlugin.h>
// Register all strings used by the plugin C++ source
static MStatus registerMStringResources(void)
{
MString... | TOOL | 0.907243 | 6.894853 | {
"github_metadata": {
"branch": "main",
"commit_count": 118,
"repo_created_at": "2022-06-25T23:38: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": "4fa4bb137d... |
91ce8eda-229e-46b9-bcf0-c458075d90af | Doebe/workplace | UVA/Graph/SingleSourceShortestPath/11101MallMania/11101MallMania.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX_INT = std::numeric_limits<int>::max();
const int MIN_INT = std::numeric_limits<int>::min();
const int INF = 1000000000;
const int NEG_INF = -1000000000;
#define max(a,b)(a>b?a:b)
#define min(a,b)(a<b?a:b)
#define MEM(arr,val)memset(arr,val, sizeof arr)
#defi... | ALGO | 0.999745 | 3.883254 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-01-25T19:03: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": "97e3ee65d8... |
dfc8a33a-04a9-4f94-8bc9-e732226ecb61 | Adnan-Nafess/90-Days-DSA-Challenge | Week-2/04-find-last-occurrence.cpp | #include <iostream>
using namespace std;
// Function to find the missing number in an array of size n
int findLastOccurrence(int arr[], int n, int target) {
int start = 0;
int end = n - 1;
int ans = -1; // Default answer if not found
while (start <= end) {
int mid = start + (end - start) / 2;
... | ALGO | 0.999022 | 6.415133 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2025-07-07T05:58: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": "b5f53989671... |
02314a38-c038-46bc-89a7-bb8f0b44aee8 | pranayharjai7/LeetCode | Problems/SudokuSolver.h | #ifndef LEETCODE_SUDOKUSOLVER_H
#define LEETCODE_SUDOKUSOLVER_H
#include <vector>
class SudokuSolver {
public:
bool checkIfValid(std::vector<std::vector<char>> &board, int row, int col) { //O(n)
char currVal = board[row][col];
for (int y = 0; y < board[row].size(); ++y) { //check for same va... | ALGO | 0.994541 | 6.671897 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2025-04-13T20:50: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": "8b8dc82060... |
624ca13a-858e-4ddd-9407-9663e1bbb292 | Eckry/Problems | codeforces/2065F/2065F.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define optimize() \
cin.tie(0); \
cin.sync_with_stdio(0); \
ios_base::sync_with_stdio(0); \
cout.tie(0);
void solve()
{
int n;
cin >> n;
vector<vector<int>> adj(n + 1, vector<int>());
vector<int> a... | ALGO | 0.999982 | 4.513033 | {
"github_metadata": {
"branch": "main",
"commit_count": 439,
"repo_created_at": "2023-11-09T02:31: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": "3a2680c3fe... |
f72ed484-ff70-451f-855d-a24d71764e1d | uchihaada/DS-ALGORITHM | linkedList/0146-lru-cache/0146-lru-cache.cpp |
class LRUCache {
public:
class node{
public:
int key;
int val;
node*next;
node*prev;
node(int _key,int _val){
key=_key;
val=_val;
}
};
node*head=new node(-1,-1);
node*tail=new node(-1,-1);
int cap;
unordered_ma... | ALGO | 0.999797 | 5.941642 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2023-03-20T06:48:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4528e73021b... |
362ff976-f4b1-47ae-82e7-e1141cc079c7 | CherryGS/ACM | _cf/contest/1549/e.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef const int& cint;
const int mod = 1e9+7;
const int inf_int = 0x7fffffff;
const ll inf_ll = 0x7fffffffffffffff;
const double ept = 1e-9;
ll n, q;
ll to[3003000];
ll ans[3003000];
ll inv[3003000];
ll ksm(ll bs, ... | ALGO | 0.99993 | 3.789189 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2021-10-29T11:11: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": "8c9b7efd1... |
b9c2e866-5ae4-404e-b278-19efca2b8c75 | ThevinduFernando2003/githubproject1 | HackerRank/Algorithms/Algorithm/dayProgrammer.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
/*
* Complete the 'dayOfProgrammer' function below.
*
* The function is expected to return a STRING.
* The function accepts INTEGER year as parameter.
*/
string dayOfProgrammer(int year) {
string resul... | ALGO | 0.99975 | 5.438795 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-02-02T08:45: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": "2c35fc241d99... |
98e266c4-3cec-4718-8f3d-011c1d5d23fe | Divishax/DSA | 2D Arrays/vectors.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(){
// // int arr[5];
// vector<int> v;
//vector<int> v(5);
//vector<int> v(5,-1);
// // insert
// v.push_back(4);
// v.push_back(8);
// v.push_back(12);
// v.push_back(11);
// v.push_back(4);
// cout << v.... | ALGO | 0.990613 | 3.935692 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2024-01-24T11:53:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7fcc3aff73c... |
365d7ace-be49-4851-b4e1-c10796854ffc | ov-wagle/DataStructuresAndAlgorithms | CPP/1-D-Array/pattern.cpp | #include <iostream>
using namespace std;
int main() {
/*********************************
1
11
111
1001
11111
100001
*********************************/
int numOfRows, currentRow = 1, i;
cout << "Enter number of rows of pattern to get printed\n";
cin >> numOfRows;
while (currentRow <= numOfRow... | ALGO | 0.999897 | 4.849568 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2021-07-07T07:57: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": "04691996b7f... |
3c83f59b-165d-4278-9756-9b2dc7845e65 | mc-cari/Competitive-Programming | Contests/TC Arg/Day 1/G.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vl vector<ll>
#define rep(i, n) for(int i = 0; i<(int)n; ++i)
const int mxN = 1e5 + 2;
vl AccA, AccB, A, B;
int n1, n2;
ll cost(ll m) {
auto itl = lower_bound(A.begin(), A.end(), m) - A.begin();
auto itr = lower_bound(B.begin(), B.end(),... | ALGO | 0.999992 | 3.542794 | {
"github_metadata": {
"branch": "master",
"commit_count": 508,
"repo_created_at": "2019-11-18T22:16:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5a99677... |
f6210a14-5e2e-4ab7-83ad-ba391837299b | adeantoni/lab_algoritma_pemrograman | Pertemuan_12/Implementasi.cpp | //Implementasi Program Linked - Stack
#include <iostream>
#include <stdlib.h>
using namespace std;
struct node {
int info;
node *next;
} *top, *newptr, *save, *ptr;
node *createnewnode(int);
void push(node *);
void display (node *);
int main ()
{
//clrscr;
int inf;
char ch = 'y';
top = NULL;
while (ch ==... | ALGO | 0.99922 | 4.570284 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-12-14T05:16:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a66c08673... |
113ceafb-0d46-4564-91c3-57068639391e | jawdan-dev/LeetCode | Solutions/2096.StepByStepDirectionsFromABinaryTreeNodeToAnother.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.999999 | 5.855374 | {
"github_metadata": {
"branch": "main",
"commit_count": 149,
"repo_created_at": "2024-03-30T17:13: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": "9f72c93053... |
1a8bcfc4-5d48-4848-b0ca-0b8942ae1938 | dhritia/augmented-reality | robustFeatures.cpp | /*
<NAME>
Date: March 2, 2025
robustFeatures: This file displays video stream and corners in the pattern found using Harris features.
*/
#include <cstdio>
#include <cstring>
#include <cmath>
#include <opencv2/opencv.hpp> // the top include file
#include "processing.h"
// reading an image (path on command line), modify... | ALGO | 0.905592 | 4.922539 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-06-03T20:56: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": "e9055566b5a5... |
5a578b94-de3a-4f72-ac89-961f2305ebba | izaxs/algo | cxxcode/src/0541.cpp | #include "common.hpp"
namespace leetcode {
using namespace utilities;
string reverseStringV2(string s, int k) {
bool rev = true, stop = false;
int lo = 0, hi = 0;
do {
if (lo + k >= s.size()) {
stop = true;
hi = s.size() - 1;
} el... | ALGO | 0.999827 | 6.267049 | {
"github_metadata": {
"branch": "master",
"commit_count": 525,
"repo_created_at": "2020-09-01T06:49:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3bb05d3b... |
aca9d1b8-8b68-445e-9847-7920236130f5 | TzeHimSung/AcmDailyTraining | Codeforces_Contest/EduRound_82_div2/d.cpp | /* basic header */
#include <bits/stdc++.h>
/* define */
#define ll long long
#define dou double
#define pb emplace_back
#define mp make_pair
#define sot(a,b) sort(a+1,a+1+b)
#define rep1(i,a,b) for(int i=a;i<=b;++i)
#define rep0(i,a,b) for(int i=a;i<b;++i)
#define eps 1e-8
#define int_inf 0x3f3f3f3f
#define ll_inf 0x7... | ALGO | 0.999783 | 3.277916 | {
"github_metadata": {
"branch": "master",
"commit_count": 667,
"repo_created_at": "2018-11-29T13:29:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40f3406b... |
6ae7bfc0-43ab-4ac9-9b7b-15a6bc881e16 | bdthanh/Kattis | cutinline.cpp | #include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <list>
using namespace std;
int main() {
long n; cin >> n;
list<string> queue;
for (long i =0; i < n; i++) {
string name; cin >> name;
queue.push_back(name);
}
... | ALGO | 0.999823 | 3.741635 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-09-20T03:15: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": "619ead04d7d... |
7e71d3ca-71cc-4a56-b515-3cd5934dfcef | ilboglions/AlgoLab-2023 | Week9/Canteen/src/main.cpp | #include <iostream>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/cycle_canceling.hpp>
#include <boost/graph/find_flow_cost.hpp>
#include <boost/graph/successive_shortest_path_nonnegative_weights.hpp>
#define COSTS_RANGE 20
using traits =
boost::adjacency_list_traits<boost::vecS, boost::vecS, boos... | ALGO | 0.999322 | 3.904177 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2023-10-14T17:23: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": "1072f2da978... |
f4ab7a80-c359-4f8f-9ed8-68774e513b7b | gzc/CLRS | C09-Medians-and-Order-Statistics/exercise_code/second-smallest.cpp | /*************************************************************************
> File Name: second-smallest.cpp
> Author: Louis1992
> Mail: <EMAIL>
> Blog: http://gzc.github.io
> Created Time: Sun May 24 09:32:14 2015
************************************************************************/
#include<iostream>
#includ... | ALGO | 0.999998 | 4.499613 | {
"github_metadata": {
"branch": "master",
"commit_count": 707,
"repo_created_at": "2013-12-03T08:07:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9559,
"forks": 2747,
"issues": 65,
"pull_requests": 20
},
"file_meta": {
"content_id": "... |
1ed784c6-3cf4-4cf8-bfe3-caa513f65274 | Zhefan-Xu/Intent-MPC | trajectory_planner/include/trajectory_planner/third_party/ACADO/acado/constraint/point_constraint.cpp | /*
* This file is part of ACADO Toolkit.
*
* ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
* Copyright (C) 2008-2014 by <NAME>, <NAME>,
* <NAME>, <NAME>, <NAME>.
* Developed within the Optimization in Engineering Center (OPTEC)
* under supervision of <NAME>. All rig... | ALGO | 0.909648 | 3.738997 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2025-03-16T02:42:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 219,
"forks": 21,
"issues": 8,
"pull_requests": 1
},
"file_meta": {
"content_id": "1fdcc0b6... |
d2b54bed-4438-40cd-b9b3-63da59963717 | josecoliveira/maratona | codeforces/1282a.cpp | #include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
int main(){ _
int t;
int a, b, c, r;
int r1, r2;
int unav;
int temp;
cin >> t;
for (int i = 0; i < t; i++) {
cin >> a >> b >> c >> r;
r1 = c - r;
r2 = c + r;
if (a > b) {
temp = a;
a = b;
... | ALGO | 0.999855 | 3.815825 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2018-03-13T11:50: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": "d11d3a029... |
bd16212e-de72-49e9-b10a-5016f09f40a7 | mk-isos/Algorithms_Cpp | coding_test/0x04강 - 연결 리스트/0x04강-BOJ/1158_3.cpp | //제일 마음에 든다.
// Authored by : haneulkimdev
#include <bits/stdc++.h>
using namespace std;
int main(void) {
ios::sync_with_stdio(0);
cin.tie(0);
int n, k;
cin >> n >> k;
queue<int> Q;
for (int i = 1; i <= n; i++) Q.push(i);
cout << '<';
while (!Q.empty()) {
for (int i = 0; ... | ALGO | 0.999983 | 3.908988 | {
"github_metadata": {
"branch": "master",
"commit_count": 503,
"repo_created_at": "2024-06-27T13:14: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": "ee54e15c... |
64bf1edc-c0de-4879-8b0d-ded9777b20b4 | heyuhhh/ACM | contests/2020多校联合训练/杭电/题解/杭电ACM多校2020-1/2020 MUTC KUT Round/Correct/math-is-simple.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e8 + 1;
const int M = 1e4 + 1;
const int P = 998244353;
int r[N], p[M];
vector<int> primes;
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
for (int i = 1; i < N; i++) r[i] = i == 1 ? 1 : r[P % i] * 1LL * (P - P / i) % P;
for (int i = 1;... | ALGO | 0.999949 | 4.929007 | {
"github_metadata": {
"branch": "master",
"commit_count": 693,
"repo_created_at": "2019-11-25T06:31:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "603d364b... |
debcbe9f-f839-4070-b994-366290826e86 | georgerapeanu/c-sources | cascaval.cpp | #include <cstdio>
#include <iostream>
#include <set>
using namespace std;
FILE *f = fopen("cascaval.in","r");
FILE *g = fopen("cascaval.out","w");
const long long IS_QUERRY = -1;
struct linear_function_t{
long long a,b;
mutable set<linear_function_t> :: iterator nxt;
mutable bool is_last;
linear_function_t(){... | ALGO | 0.999003 | 3.787351 | {
"github_metadata": {
"branch": "master",
"commit_count": 177,
"repo_created_at": "2018-08-15T14:37:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fecb289d... |
5e1f43a8-5b5e-4c02-b93f-6ae9b5e6897b | bogdan-lab/Algorithm_puzzles | Tasks/CF_task_1475C.cpp | #include <algorithm>
#include <functional>
#include <iostream>
#include <sstream>
#include <tuple>
#include <utility>
#include <vector>
void Solution(std::istream& input = std::cin);
void RunTests();
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
// RunTests();
Solution(std::cin);
... | ALGO | 0.999958 | 4.105728 | {
"github_metadata": {
"branch": "master",
"commit_count": 618,
"repo_created_at": "2020-09-09T18:59: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": "51fae5c1... |
4c75db9b-c652-40ad-8bb1-f5448bb30ebc | junhyoung/Algorithm | ICPC_I_Qindex.cpp | /*********************************************************
국민대학교 컴퓨터공학과 20123425 최준형
문제: ICPC I Q-index
*********************************************************/
#include<iostream>
#include<fstream>
#include<algorithm>
using namespace std;
bool cmp(int a, int b) {
return a > b;
}
int main() {
int numcases;
ifstrea... | ALGO | 0.999771 | 4.038372 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2016-09-07T13:00: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": "399986b10... |
9b269ded-d902-419b-92f1-45cdfc2e723b | riggspc/exercises | algorithms/change_with_least_coins/solution.cpp | #include <iostream>
#include <vector>
using std::cout;
using std::vector;
// Enter any assumptions you're making about the problem or any notes you want taken into account here
/*
Time complexity: O(n) where n is the target number of cents. In reality it'll be much less than this but it will scale
with the si... | ALGO | 0.998715 | 5.951009 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2014-06-22T21:34:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "0476e454f... |
01abec90-d3dc-4763-8f30-886e030004e9 | ayc92/RayTracer | Code/readfile.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <deque>
#include <stack>
#include <vector>
#include <GL/glew.h>
#include <GL/glut.h>
#include "Transform.h"
#include "readfile.h"
#include "RayTracer.h"
void printMat (const mat4 puttr) {
std::cout << puttr[0][0] << " " << puttr[0][... | TOOL | 0.94193 | 3.819363 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2013-03-07T11:00: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": "66136bed33... |
86eae514-b563-4ef8-a820-606c3e8d47eb | ks1ksi/ps | 백준/Gold/16920. 확장 게임/확장 게임.cc | #include <bits/stdc++.h>
using namespace std;
int N, M, P;
int sn[10];
int sc[10];
int arr[1000][1000];
int dy[4] = {1, -1, 0, 0};
int dx[4] = {0, 0, 1, -1};
bool check_safe(int y, int x) {
return (y >= 0 && y < N && x >= 0 && x < M);
}
bool bfs(int player, queue<pair<int, int>> &q) {
int cnt = sn[player];
... | ALGO | 0.999936 | 4.571965 | {
"github_metadata": {
"branch": "master",
"commit_count": 198,
"repo_created_at": "2023-01-10T05:36: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": "01f9b324... |
0205b2f1-dc1d-4799-bcc2-f850a12fa7e2 | Naateri/ADA | practica-1909.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
#define MAXI 1000000
using namespace std;
typedef vector<int> int_vec;
//helpful functions
void fill_vec(int_vec& A, int size, int max = MAXI){
srand( time(NULL) );
for (int i = 0; i < size; i++){
A.push_back( rand() % max );
}
}
void ... | ALGO | 0.999091 | 4.310503 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2018-09-05T01:38: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": "ea394a9f2... |
d3292f99-9077-444b-9ffc-38acea15caa9 | yingluosanqian/chh-graduation | Source/DataSet/atcoder/abc204/abc204_c.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 2010;
int h[N], e[N], ne[N], idx;
bool st[N];
int cnt;
void add(int a, int b) {
e[idx] = b, ne[idx] = h[a], h[a] = idx++;
}
void bfs(int u) {
queue<int> q;
q.push(u);
st[u] = true;
while (q.size()) {
int t =... | ALGO | 0.999814 | 3.398171 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-05-25T12:59: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": "c0e3d8d36b... |
33b7969f-1f4a-4fc7-bb34-5377d309913b | mahadi-cse-21/Codeforces | AF_bruteforce.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long m, q;
cin >> m >> q;
string mov[m];
for (long long i = 0; i < m; i++)
{
cin >> mov[i];
}
while(q--)
{
string s;
cin >> s;
long... | ALGO | 0.999745 | 4.112092 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2025-02-18T01:37: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": "98c7fd2db66... |
4c7ff2c7-0378-4cfa-ad08-c4bed893d9f8 | josuealeman17/Estructura-de-Datos-Grupo-1 | Deber 1. Ejercicios Propuestos/8.4.10/Arreglo.h | #pragma once
#include <iostream>
using namespace std;
template <class T>
class Arreglo {
private:
int dimension;
T* arr;
public:
Arreglo(int);
void imprimir();
void ingresar();
int calcularMediana();
bool estaVacio();
void ordenar();
void intercambiar(T&, T&);
T* getArr();
};
template<class ... | ALGO | 0.998396 | 5.218251 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2021-12-23T02:17: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": "c3ab3980413... |
f6c0838d-8b88-4605-9036-764e7f3d1d16 | mashmool0/SBU-DS-Course | list_with_cpp/list_array.cpp | #include <iostream>
using namespace std;
template <typename T>
class Node
{
public:
T data;
Node *next;
// Constructor
Node(T value)
{
data = value;
next = nullptr;
}
};
// List class to manage the linked list
template <typename T>
class List
{
private:
Node<T> *head; // P... | ALGO | 0.999612 | 6.15623 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2024-10-21T12:24: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": "dbed1e158... |
6c287e0a-12db-4337-a98e-5ce5707d7af2 | 42somoim/42somoim5 | gim/personal/backtracking/외판원_순회2.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
#define MAX 10 + 1
int N, ret = 10000001;
int arr[MAX][MAX];
int dp[MAX];
bool visit[MAX];
void make_min_ret(int idx) {
if (idx == N) {
int sum = 0;
for (int i = 0; i < N - 1; i++)
sum += arr[dp[i]][dp[i +... | ALGO | 0.999951 | 3.427584 | {
"github_metadata": {
"branch": "main",
"commit_count": 407,
"repo_created_at": "2020-10-02T06:28:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c41e0821993... |
2f77f3f3-7280-4bdb-888f-86512cff336f | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/ai_code/train/0_0_7182.cpp | #include <iostream>
#include <string>
#include <unordered_set>
#include <unordered_map>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
string s;
cin >> s;
unordered_set<string> substrings;
unordered_map<int, int> letter_counts;
for(int i=0; i<n; i++) {
le... | ALGO | 0.999841 | 3.951696 | {
"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": "6a610548b0e... |
a63e9c5d-181c-455e-ba5a-04418626abf2 | humanwhoexplores/CodeChef-codes- | chef_BESTBATS.cpp | #include<stdio.h>
using namespace std;
int fac(int);
void sort(int *);
int main()
{
int score[11],n,i,j,num,f,temp,ans,l_count=0,r_count=0,g,t_count,ret1,ret2,ret3;
//printf("\n enter the number of test cases");
scanf("%d",&n);
for(j=0;j<n;j++) // n denotes the number of test cases
{ l_count=0;... | ALGO | 0.998235 | 3.054434 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-03-01T07:14: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": "74b54e1487... |
1fda977f-eec3-4f4c-89ac-fface239ea24 | sunyw99/Educative | Grokking the Coding Interview/SlidingWindow/String-Anagrams.cpp | using namespace std;
#include <iostream>
#include <string>
#include <unordered_map>
#include <vector>
class StringAnagrams {
public:
static vector<int> findStringAnagrams(const string& str, const string& pattern) {
vector<int> resultIndices;
// TODO: Write your code here
int windowStart... | ALGO | 0.999869 | 6.307616 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-09-16T07:05: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": "5ce24fd6de60... |
38acd37c-37fc-4918-8841-a295b1dc1fab | Doarakko/competitive-programming | atcoder/arc004_a.cpp | #include <iostream>
#include <iomanip>
#include <vector>
#include <math.h>
#define P pair
#define X first
#define Y second
using namespace std;
using ll = long long;
int main(int argc, const char *argv[])
{
int n;
cin >> n;
vector<P<int, int>> v(n);
for (int i = 0; i < n; i++)
{
cin >> v[... | ALGO | 0.999687 | 3.908436 | {
"github_metadata": {
"branch": "master",
"commit_count": 453,
"repo_created_at": "2018-07-08T07:39: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": "6beae280... |
8cd5818e-d646-441e-b237-6457d87704d5 | SWEG-2015EC-Batch/Byte-Bandits | ETS1444_15_Yohannes_Muluken/Activity 4.2/2D Array/5-Friends.cpp | // Count no of friends represented
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
int num, count = 0;
cout << "for how mamy people do you want to check friendship: ";
cin >> num;
char friends[num][num];
for (size_t i = 0; i < num; i++)
{
for (size_t j = 0; j ... | ALGO | 0.998106 | 4.039189 | {
"github_metadata": {
"branch": "main",
"commit_count": 305,
"repo_created_at": "2023-11-01T17:28:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a153244e26... |
3932b8bf-2221-4db7-a3e1-bf8a4f3e1e52 | Nimish-Jain/DSA-Practice | Dynamic Programming/424. LongestRepeatingSubsequence.cpp | //Code :: <NAME>
#include<bits/stdc++.h>
#define endl "\n"
using namespace std;
int LCS(string x, string y, int m, int n) {
int dp[m + 1][n + 1];
for (int i = 0; i < m + 1; i++) {
for (int j = 0; j < n + 1; j++) {
if (i == 0 or j == 0)
dp[i][j] = 0;
}
}
for (int i = 1; i < m + 1; i++) {
for (int j =... | ALGO | 0.999935 | 4.129811 | {
"github_metadata": {
"branch": "master",
"commit_count": 206,
"repo_created_at": "2020-12-28T14:54: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": "550b168c... |
259ee821-573b-4db1-99a2-d64b3d5165c5 | keqhe/leetcode | google_list/leetcode336.cpp |
/*
http://www.cnblogs.com/grandyang/p/5272039.html
这道题给我们了许多单词,让我们找出回文对,就是两个单词拼起来是个回文字符串,我最开始尝试的是brute force的方法,每两个单词都拼接起来然后判断是否是回文字符串,但是通过不了OJ,会超时,可能这也是这道题标为Hard的原因之一吧,那么我们只能找别的方法来做,通过学习大神们的解法,发现如下两种方法比较好,其实两种方法的核心思想都一样,写法略有不同而已,那么我们先来看第一种方法吧,要用到哈希表来建立每个单词和其位置的映射,然后需要一个set来保存出现过的单词的长度,算法的思想是,遍历单词集,对于遍历到的单词,我们对其翻转一下,... | ALGO | 0.999845 | 5.521079 | {
"github_metadata": {
"branch": "master",
"commit_count": 267,
"repo_created_at": "2015-12-22T02:14: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": "c6914895... |
18dea101-c2a5-4d6f-9c57-5398d4e099ac | jyi2ya/dungeon_of_unique_studio | t1/set/bst.cpp | #ifndef RBT_CPP_
#define RBT_CPP_
#include <string>
template <class T>
class rbt {
private:
struct node;
struct edge {
enum {
red, black
} color;
struct node *dst;
edge()
{
color = red;
dst = NULL;
}
edge(int c, struct node *d)
{
color = c;
dst = d;
}
};... | ALGO | 0.993267 | 4.305872 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2021-10-23T10:42:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "298411c0d... |
ad62924d-287b-42a2-b220-b15a1c54b7d1 | Ishaan-11/Launchpad | hackerblocks3/EXPAND THE POND.cpp | /*
EXPAND THE POND
You are given a matrix with N rows and M columns.
Each cell is either dry or has water.
We say that two cells are neighbours if they share one of their four sides.
A pond is a maximal subset of cells containing water such that any cell is accessible
from any other cell by moving only along neighbours... | ALGO | 0.999932 | 4.756159 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-05-03T15:13:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2ae2cbfa61... |
5b022b31-a278-4d29-91fe-04814c51c398 | mrinaald/coding-practice | Codeforces/A2OJ/Ladders/0_1299/Done/58A.cpp | #include <iostream>
using namespace std;
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define pb push_back
#define mp make_pair
typedef long long int llong;
typedef unsigned long long int ullong;
typedef unsigned long int ulong;
typedef unsigned int uint;
int main(){
// - Use cin, cout f... | ALGO | 0.99994 | 3.459322 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2020-10-04T08:47: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": "6db6093e499... |
62e62e82-7f4f-4172-8de9-8c140e27fad0 | Shikhajaiswar/DSA | Hashmap/question1.cpp | // Ninja is given an array of integers that contain numbers in random order. He needs to write a program to find and return the number which occurs the maximum times in the given input. He needs your help to solve this problem.
// If two or more elements contend for the maximum frequency, return the element which occur... | ALGO | 0.999971 | 4.193851 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-10-11T18:47: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": "0b618987bb... |
f02ec645-5d87-4d59-9862-32ad34edcf0d | takami228/atcoder | abc/086/c.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;
int main(){
int n;
cin >> n;
int t = 0;
int x = 0;
int y = 0;
bool ans = true;
for(int i = 0;... | ALGO | 0.999934 | 4.492036 | {
"github_metadata": {
"branch": "master",
"commit_count": 90,
"repo_created_at": "2019-03-27T12:53: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": "336d4c5da... |
6ce25dca-4396-4c07-b9ed-4d774c6f823d | GX3497/-Completed-Projects- | Lab04PayCalcLoop.cpp | // Project Name: Lab 04 Payment Calculations Loop
// Date Written: September 27, 2022
// Description: Calculates how much income would be earned with different pay levels for hourly income with time and a half on hours worked over 40
//Tells you how much you made in how many hours inputted with included pay level and ... | ALGO | 0.995088 | 3.172655 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-03-31T19:55: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": "e15b1a76ad83... |
f7fec956-e93b-49d5-8e8f-f9a4dc90735c | SdobnovE/Popov_1sem | main.cpp | #include<stdio.h>
#include<math.h>
#include<iostream>
#include<vector>
#include <algorithm>
using namespace std;
const double Mu = 0.01;
const double C = 10;
const double X = 10;
const double T = 1;
const int N = 6000;//по t
const int M = 6000;// по x
const double t = T / N;
const double h = X / M;
const double EPS =... | ALGO | 0.9999 | 3.335193 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2019-11-06T22:22: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": "9ad90c916... |
c4e2d29b-25c6-42dc-95ea-6775114a5bb4 | zwh-sdu/datastructure | source/exp8_1.cpp | #include <iostream>
#include <string>
using namespace std;
template <class T>
class Hash;
template <>
class Hash<int>
{
public:
size_t operator()(const int theKey) const
{
return size_t(theKey);
}
};
template <class K, class E>
class hashTable
{
public:
hashTable(int theDivisor = 16);
~has... | ALGO | 0.999909 | 4.165564 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-11-03T08:40: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": "ffcb9b013ac9... |
5518f600-8f27-40a7-8c65-5c4bc9b316d6 | andreflabr/EstudoCC | AED 2/Lista/exercicio 2.cpp | #include<bits/stdc++.h>
/////////////////////////////////////////////////////////////////////////////////
typedef struct Nodo {
int numero;
struct Nodo *pProximo;
};
struct Nodo *pInicio=NULL;
/////////////////////////////////////////////////////////////////////////////////
void remover(int e){
bool flag=fals... | ALGO | 0.984451 | 3.976505 | {
"github_metadata": {
"branch": "master",
"commit_count": 137,
"repo_created_at": "2021-10-19T14:07:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da94dc5b... |
784ad980-93d1-4859-bbc4-2e0c011ebf9d | sywrah/Tecnologo-ADS | Estrutura de Dados/ArvoreBinariaPesquisa.cpp | #include<stdio.h>
#include<iostream>
#include<stdlib.h>
using namespace std;
class No{
public:
int info;
No *esq;
No *dir;
No(int n,No *e,No *d){
info = n;
esq = e;
dir = d;
}
};
class Arvore{
public:
No *raiz;
Arvore(){
raiz = NULL;
}
void imprime(No *n){
if (raiz == NULL){
... | ALGO | 0.999915 | 3.553274 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2018-02-26T01:14:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe4957161... |
fbbe6ac2-0539-4064-8d43-3c6afbaa4bb6 | Aqendo/olproga | tinkoff/segtree_1/A.cpp | #include "bits/stdc++.h"
using namespace std;
#define int long long
#ifdef SEREGA
#include "/home/ser/olproga/debug.h"
auto freopen_input_result_ = freopen(INPUT_PATH, "r", stdin);
// auto freopen_output_result_ = freopen("output.txt", "r", stdout);
#endif
#ifndef SEREGA
#define printf(...)
#define debug(...)
#endif
... | ALGO | 0.999988 | 5.400341 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2024-09-05T16:33: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": "3e8b79f0239... |
9d197ca0-8178-440f-9d65-5c9ca47e3e5f | wzrabbit/algorithm-practice | BOJ/♣ 24000~24999/24474_Intercastellar.cpp | #include <iostream>
typedef long long ll;
using namespace std;
ll castella[200001];
ll prefix[200001];
int main() {
cin.tie(0)->sync_with_stdio(0);
int N;
cin >> N;
for (int i = 1; i <= N; i++) {
cin >> castella[i];
ll cur_count = 1;
while (castella[i] % 2 == 0) {
... | ALGO | 0.999916 | 4.168301 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2022-01-21T10:44:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94011f6653c... |
9f792e0e-5b92-4b19-8e2f-2e809166dcf6 | dhawalmahajan/CPP-DSA-Practice | Graphs/dfs-topological-sort.cpp | #include <bits/stdc++.h>
using namespace std;
void dfs(int node, vector<vector<int>> &adj, vector<bool> &visited, stack<int> &s)
{
visited[node] = true;
for (int neighbor : adj[node])
{
if (!visited[neighbor])
{
dfs(neighbor, adj, visited, s);
}
}
s.push(node);
}
... | ALGO | 0.999996 | 6.040071 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2025-04-05T10:59: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": "058be0918... |
f90bbe6c-e90d-4647-89a9-f88bdf5e28ad | BachiLi/lajolla_public | src/materials/roughdielectric.inl | #include "../microfacet.h"
Spectrum eval_op::operator()(const RoughDielectric &bsdf) const {
bool reflect = dot(vertex.geometric_normal, dir_in) *
dot(vertex.geometric_normal, dir_out) > 0;
// Flip the shading frame if it is inconsistent with the geometry normal
Frame frame = vertex.shad... | ALGO | 0.977301 | 6.64451 | {
"github_metadata": {
"branch": "main",
"commit_count": 350,
"repo_created_at": "2021-12-26T17:36:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 97,
"forks": 57,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "9da9155c... |
8ecc81a2-5e52-47a0-a557-ca335d840162 | 111qqz/ACM-ICPC | codeforces/#120/C.cpp | /* ***********************************************
Author :111qqz
Created Time :2016年03月24日 星期四 12时24分42秒
File Name :code/cf/#120/C.cpp
************************************************ */
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#in... | ALGO | 0.999834 | 3.242984 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2017-07-27T12:09:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d6827ef74... |
a9f7bab0-b9bb-41b6-9c45-b9c6f7b35102 | syahmifauzi/CP | Online-Judges/Kattis/trik.cpp | #include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; ++i)
#define dbg(x) cout << (#x) << " is " << x << endl
using namespace std;
string s;
int res = 1;
int main()
{
cin >> s;
rep(i, 0, s.length()) {
if (s[i] == 'A' && res != 3)
res = res == 1 ? 2 : 1;
else if (s[i] == 'B' && re... | ALGO | 0.99991 | 3.480324 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2020-06-12T01:37: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": "8be73ffbb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.