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 |
|---|---|---|---|---|---|---|---|
72134703-9f12-46eb-b516-b1be6e95ed3c | realmelan/leetcode | solutions/leetcode/insertIntoMaxTree.cpp | // insertIntoMaxTree.cpp
// leetcode
//
// Created by <NAME> on 5/31/19.
// Copyright © 2019 <NAME>. All rights reserved.
//
#include "common.h"
using namespace std;
namespace insertIntoMaxTree {
/*
// TODO: copy problem statement here
998. Maximum Binary Tree II
Medium
65
155
Favorite
Share
We are giv... | ALGO | 0.999931 | 5.745309 | {
"github_metadata": {
"branch": "master",
"commit_count": 138,
"repo_created_at": "2018-02-06T17:48:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ec8f927... |
2707ff36-b8f3-4ac4-9706-f30aa6706e3c | sidney3-comp-programming/CSES | dp/book-shop/test-book-shop.cpp |
#include <iostream>
#include <vector>
using namespace std;
#define REP(i,a,b) for(int i = a; i < b; i++)
#define pb push_back
#define mp make_pair
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
int dp[1001][100001];
int main(){
cin.tie(0)->sync_with_stdio(0);
int nbooks, dol... | ALGO | 0.999825 | 4.106415 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-11-12T01:20:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e314a76f011... |
f4dd34e4-8bea-4f84-b254-9d23e386d959 | NekoPii/Csource | 复习/复习/源.cpp | #include<stdio.h>
int Longest(char *,char *);
void Max(int length, char *CS, int *p);
#define min(a,b) a<b?a:b
char AS[2000005];
char A[2000005];
int p[2000005];
int Longest(char *A,char *AS)
{
int i = 0, a = 1;
AS[0] = '$';
while (A[i] != '\0')
{
AS[a++] = '#';
AS[a++] = A[i];
i++;
}
AS[a++] = '#';
AS[a]... | ALGO | 0.999686 | 3.281483 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-05-03T11:19: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": "7f4d5d325c... |
232ae3f8-d0f6-40a0-824a-5e88670ed070 | GoatGirl98/Walkthrough-of-ACCoding-in-BUAA | 2014级-软件学院-算法分析与设计/E1-算法练习赛/BUAAOJ40 计算几何 分治 最近点对.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;
const int N = 200005;
const double INF = 1e15;
const double eps = 1e-8;
int n;
double mind;
struct point
{
double x, y;
bool type;
bool operator<(const point &t) const { return x < t.x; }
}... | ALGO | 0.999824 | 3.946963 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2020-06-21T03:02:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 313,
"forks": 27,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "738830... |
9d0d9ea7-2ee5-4eda-8499-85fdf5b66ce3 | dmlc/xgboost | src/tree/updater_colmaker.cc | /**
* Copyright 2014-2024, XGBoost Contributors
* \file updater_colmaker.cc
* \brief use columnwise update to construct a tree
* \author <NAME>
*/
#include <algorithm>
#include <cmath>
#include <vector>
#include "../common/error_msg.h" // for NoCategorical
#include "../common/random.h"
#include "sample_position.... | DATA | 0.995506 | 6.815964 | {
"github_metadata": {
"branch": "master",
"commit_count": 7470,
"repo_created_at": "2014-02-06T17:28:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 27119,
"forks": 8796,
"issues": 415,
"pull_requests": 57
},
"file_meta": {
"content_id":... |
1e1fd615-7bc2-4bbe-ab71-88285f645ede | better-call-vee/Cpp-programming | DP-problem-01KnapsackVariations-EqualSumPartition.cpp | /*
Given an integer array nums, return true if you can partition the array into two subsets such that
the sum of the elements in both subsets is equal or false otherwise.
You can't take a number twice.
Example 1:
Input: nums = [1,5,11,5]
Output: true
Explanation: The array can be partitioned as [1, 5, 5] and [11].
Ex... | ALGO | 0.999874 | 4.987888 | {
"github_metadata": {
"branch": "main",
"commit_count": 177,
"repo_created_at": "2023-02-22T10:14: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": "30705cbee1... |
34be82e2-390b-496a-9dc9-56fe3c519685 | uzairkbrr/University | Data_Structure/Pointer/Array Reversal using Pointes.cpp | // Author: <NAME>
#include <iostream>
using namespace std;
int main() {
// Declare variables
int size;
// Input the size of the array
cout << "Enter Size for the Array: ";
cin >> size;
// Declare an array and a pointer
int arr[size];
int *ptr = arr;
// Input valu... | ALGO | 0.999135 | 5.46656 | {
"github_metadata": {
"branch": "main",
"commit_count": 613,
"repo_created_at": "2022-12-15T18:03: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": "734adc9bab... |
32717624-4d84-4b9b-85d2-f07486dee4d5 | Ashutoshjaiswal975/A2z-DSA-code | Day_10/2_subsequence.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
class Solution {
private:
void solve(string& str, string output, int index, vector<string>& ans) {
if (index >= str.size()) {
ans.push_back(output);
return;
}
// exclude
solve(str... | ALGO | 0.999653 | 5.91927 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2024-10-25T20:39: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": "c85e35ac4de... |
5afdd08d-9dec-4d12-9619-6a91a4fe95c5 | kapildd/DS-and-Algorithms | UnionFind.cpp | //
// Created by kapildd on 8/1/17.
//
#include<iostream>
#include<cassert>
#define SZ 10000
using namespace std;
int Rank[SZ], Parent[SZ];
//Find the root of the tree in which x lies
int Find(int x) {
if(Parent[x] == x) {
return x;
}
return Parent[x] = Find(Parent[x]); ///path compression
}
//J... | ALGO | 0.999983 | 4.836102 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-07-27T17:00: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": "a7305e114b... |
b68ab369-e17f-4507-a983-9c751c5fd3c7 | ucyang/AlgoEx | baekjoon/13725/rng.cpp | // References:
// https://www.codechef.com/problems/RNG - Solutions of ryuhei, theguiler
// https://discuss.codechef.com/t/rng-editorial/10068
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
using namespace std;
using namespace placeholders;
constexpr size_t P = 104857601, R = 3, K =... | ALGO | 0.999983 | 5.245351 | {
"github_metadata": {
"branch": "main",
"commit_count": 153,
"repo_created_at": "2019-10-19T08:35: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": "2885bcb7ae... |
0c55350b-8ae7-4a73-a292-aefe242def35 | ShreshthGupta2627/Data-Structure-and-Algorithms | DSA/DSA udemy/63.cpp | // Inserted in sorted array
#include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *next;
} *first = NULL;
// Create linked list
void create_linkedlist(int A[], int n)
{
Node *t, *last;
first = new Node;
first->data = A[0];
first->next = NULL;
last = first;
for... | ALGO | 0.999985 | 5.01323 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-10-26T07:03: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": "921177ea283b... |
625f8e32-969b-4aea-bd14-8d588e8d0f65 | hoafnganh/DSA | Sinh/DSA02008.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int n, k, cnt = 0;
int col[11], res[11];
int a[11][11];
vector<vector<int>> results;
void Try(int i, int sum = 0) {
if (i > n) {
if (sum == k){
cnt++;
vector<int> temp;
for (int i = 1; i <= n; i++)
temp.push_back(res[i]);
results.push_... | ALGO | 0.999839 | 3.179695 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2025-05-20T17:28:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "69d70bec68... |
c0f2865c-514b-4584-9b98-c40bcdb3d369 | naymur92/CompetitiveProgramming_or_DSA_CPP | 75_tree_dfs_find_diameter.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
vector<int> tree[N];
vector<int> depth(N);
void dfs(int node, int parent = 0) {
for (int child: tree[node]) {
if (child == parent) continue;
depth[child] = depth[node] + 1;
dfs(child, node);
}
}
int main() {
int n;
cin >> n;
for (i... | ALGO | 0.997171 | 4.200059 | {
"github_metadata": {
"branch": "main",
"commit_count": 300,
"repo_created_at": "2023-07-27T13:00: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": "0f6b7f9158... |
1fb349e0-a559-452f-aeaa-33a77ebf6fef | Gitman1989/chromium | net/ftp/ftp_util.cc | // Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/ftp/ftp_util.h"
#include <vector>
#include "base/logging.h"
#include "base/string_number_conversions.h"
#include "base/string_tokenize... | TOOL | 0.945432 | 6.71975 | {
"github_metadata": {
"branch": "views/trivial",
"commit_count": 53685,
"repo_created_at": "2011-01-17T14:40:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": ... |
42a0dd03-562e-4a28-8b48-c815bb3d8db1 | mugicha101/AdventOfCode24 | day15a.cpp | #include "./setup.h"
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
int main() {
// grid input
vector<string> grid;
string s;
while (getline(cin, s), s.size()) {
grid.push_back(s);
}
int rows = grid.size();
int cols = grid[0].size();
// find starting location
int sr... | ALGO | 0.99985 | 4.549067 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2024-12-01T21:32: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": "b90363aa6c5... |
974a6269-cbc4-4b7b-9af0-51b527cd10c8 | k15201363625/Algorithm_Training | bailianoj/past_questions/summercamp/2019/bigdatacamp/5.cpp | #include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
//线段树维护区间异或和
const int N = 1e5+10;
#define lr o<<1
#define rr o<<1|1
struct Seg{
int l,r,sum;
}tr[N<<2];
int w[N];
inline void pushup(int o){
tr[o].sum = tr[lr].sum ^ tr[rr].sum;
}
void build(int o,int l,int r){
if(l==r){
... | ALGO | 0.999977 | 4.950317 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-05-08T07:58:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "87dac7f0e7... |
c869d616-3972-44be-8fa8-d89130018813 | qwqqaqqwq00/cpp_algorithm | sort/test.cpp | /***
* @Description:
* @version:
* @Author: <NAME>
* @Date: 2023-01-16 12:51:44
* @LastEditors: Please set LastEditors
* @LastEditTime: 2023-02-18 20:46:26
*/
#include <iostream>
#include <stdlib.h>
#include "merge_sort.h"
#include "quick_sort.h"
#include "bubble.h"
#include "selection.h"
int main() {
int... | ALGO | 0.998564 | 4.885173 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-03-22T00:02: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": "95cea066769d... |
e10c26a6-813a-410e-97c1-3eb705483d02 | Jewels2001/competition-problems | CCPC2022/drunkvigenere.cc | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double PI = acos(-1.0);
#define INF 1000000000
void change(char a, int b) {
while(!isupper(a)) {
if(a < 41) {
int temp = 'A' - a;
a = 'Z' - temp;
}
}
}
int main() {
string c, k;
cin >> c >> k;
string ans = "";
... | ALGO | 0.999981 | 4.091764 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2021-08-25T01:00:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b57509a28a4... |
63953d62-c4e3-4a4a-8385-847e81a7f996 | jainaryan1310/leetcode | calculateMinimumHP.cpp | class Solution {
public:
vector<vector<int>> minHP;
int m;
int n;
int MAX = 1000000;
int solve(vector<vector<int>>& dungeon, int i, int j) {
if (minHP[i][j] != MAX) {
return minHP[i][j];
} else if (i == m - 1 && j == n - 1) {
if (dungeon[i][j] > 0) {
minHP[i][j] = 1;
} else ... | ALGO | 0.99989 | 5.199459 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-07-11T19:07: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": "97fcc96ddf63... |
f52d7347-5453-4b3a-9c63-617422422c33 | Xiangyu-Hu/SPHinXsys | src/shared/particle_neighborhood/neighborhood.cpp | /**
* @file neighboring_particles.cpp
* @author <NAME> and <NAME>
*/
#include "neighborhood.h"
#include "all_complex_bodies.h"
#include "base_particle_dynamics.h"
#include "base_particles.hpp"
namespace SPH
{
//=================================================================================================//
voi... | ALGO | 0.998868 | 6.411052 | {
"github_metadata": {
"branch": "master",
"commit_count": 5288,
"repo_created_at": "2019-05-28T17:05:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 406,
"forks": 291,
"issues": 29,
"pull_requests": 28
},
"file_meta": {
"content_id": "2... |
82d51604-2a61-4cd2-93af-361235d00eea | askanki/PG_RRT | pgrrt_3D/main.cpp | #include <iostream>
#include <fstream>
#include <cmath>
#include <chrono>
#include "Canvas.h"
#include "Tree.h"
#include "Utils.h"
std::default_random_engine generator;
int global_iter = 0;
std::tuple<Tree*, Tree*, int> build_rrt(Tree *tree, Tree *tree1){
int iterations = 0;
auto timenow = std::chrono::syste... | ALGO | 0.999848 | 3.374218 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-04-08T07:56: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": "3bb7db9b312... |
28ac9b37-14a9-4d91-b4ca-54d41f04fc01 | ahmed-mera/c-and-c-plus-plus | ordinaListe_2/header.h | #include <iostream>
#include <string.h>
#define MAX_SIZE 20
using namespace std;
class LISTA {
public:
struct nodo{
char nome [MAX_SIZE] , cognome[MAX_SIZE]; // per il nome el il cognome
struct nodo* Pnome; // puntatore per il nome
struct nodo* Pcognome; //puntatore per il cognome
};
... | TOOL | 0.98539 | 3.818817 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-12-09T20:08: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": "1627a3604... |
eac8265d-ee17-4b3e-8e62-b2909aeaef04 | DCM-UPB/QNets | src/poly/fmap/EuclideanDistanceMap.cpp | #include "qnets/poly/fmap/EuclideanDistanceMap.hpp"
#include <cmath>
// --- Helpers
double calcDistHelper(const std::vector<double> &srcv, const std::vector<double> &fixedPoint, const size_t &ndim)
{
double dist = 0.;
for (size_t i = 0; i < ndim; ++i) {
dist += pow(srcv[i] - fixedPoint[i], 2);
}
... | ALGO | 0.998916 | 6.766329 | {
"github_metadata": {
"branch": "master",
"commit_count": 460,
"repo_created_at": "2016-02-13T13:26:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d296a715... |
021c3395-9410-402c-87b6-3bdf7cae51f2 | harukaeru/CompetitiveProgramming | abc237/E/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> H(N);
for (int i = 0; i < N; i++) {
cin >> H[i];
}
vector<unordered_map<int, long long>> G(N);
for (int i = 0; i < M; i++) {
int u, v;
cin >> u >> v;
u--;
v--;
if (H[u] <= H[v]) {
... | ALGO | 0.999966 | 4.050774 | {
"github_metadata": {
"branch": "main",
"commit_count": 591,
"repo_created_at": "2021-08-28T11:14:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd79dc5a08... |
b303dd87-568b-47e9-8ca6-d0fe7e2b6bc7 | face4/yukicoder | Level3/0209.cpp | #include<iostream>
#include<cstring>
using namespace std;
int dp[101][101], dp2[101][101];
int u[101], d[101];
int main(){
int t;
cin >> t;
while(t-- > 0){
memset(dp, 0x3f, sizeof(dp));
memset(dp2, 0x3f, sizeof(dp2));
memset(u, 0, sizeof(u));
memset(d, 0, sizeof(d));
... | ALGO | 0.99995 | 3.935394 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2018-04-19T11:55: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": "f12dd5ce... |
d3f1ec98-2e28-40dc-9188-114f51440003 | yimo22/Algorithm | 백준/Gold/2665. 미로만들기/미로만들기.cc | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
using namespace std;
/* define */
#define ll long long
#define endl '\n'
typedef struct Node {
int x, y, cnt;
Node(int X, int Y, int C) : x(X), y(Y), cnt(C) {}
}Node;
constexpr int dir[4][2] = {
... | ALGO | 0.999954 | 4.171855 | {
"github_metadata": {
"branch": "master",
"commit_count": 360,
"repo_created_at": "2022-09-29T07:01: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": "368b1789... |
0b770075-d245-4779-a4c5-4117cf45e1dc | gaurav1620/Competitive-Coding | Codeforces/1345C.cpp | #include<bits/stdc++.h>
//<NAME> 2020
//codechef,codeforces : gaurav1620
//email : <EMAIL>
#define Ninja ios::sync_with_stdio(false);cin.tie(NULL);
#define fo(i,n) for(i = 0;i < n;i++)
#define rfo(i,n) for(i = n-1; n >= 0;i++0)
#define ll long long
#define watch(x) cout << (#x) << " is : " << (x) << endl
using na... | ALGO | 0.999931 | 3.915505 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-08-30T09:20:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "04a6224054... |
38799415-3fc4-4c80-8cee-088ca53995a8 | KienPT0610/COPEPTIT | DSA/dsa11027.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef double db;
using namespace std;
//JohnBelus//
struct node {
int data;
node *left;
node *right;
node(int u) {
this->data = u;
this->left = this->right = NULL;
}
};
void add(node* &T, int u) {
if(!T) T = new node(u);
else... | ALGO | 0.999845 | 4.306606 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2024-01-25T14:39:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d73bd85f3... |
e8082d41-e34d-43c3-b57d-1442b10471e3 | kidw0124/ACShoooooooooot-Teamnote | src/geometry/rotating-calipers.cpp | // get all antipodal pairs with O(n)
// calculate convex hull with O(nlgn)
void antipodal_pairs(vector<Point>& pt, vector<Point>& convex_hull) {
sort(pt.begin(), pt.end(), [](const Point& a, const Point& b) {
return (a.x == b.x) ? a.y < b.y : a.x < b.x;
});
vector<Point> up, lo;
for (const auto& p : pt) {
... | ALGO | 0.999924 | 5.409464 | {
"github_metadata": {
"branch": "main",
"commit_count": 93,
"repo_created_at": "2023-07-17T11:46: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": "00e507d85fe... |
3eaad76b-92cb-4515-9827-3721f5218926 | manojts/cns | playfair.cpp | #include <bits/stdc++.h>
using namespace std;
void generatematrix(string key,char mat[5][5])
{
int flag[26] = {0};
int x = 0, y = 0;
/* Add all characters present in the key */
for(int i=0; i<key.length(); i++)
{
if(key[i] == ' ') continue;
if(key[i] == 'j') key[i] = 'i'; // i and j are... | ALGO | 0.999972 | 3.552125 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-11-18T12:54: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": "c2b4f7b961... |
18ee7d45-aa98-46aa-955d-d102eea93ae5 | wahid6313/Dsa-Questions | Arrays2/countNumbers.cpp | // count the value first then count number first and then value and output is "1 3 2 2 1 1 1 5 2 9" store in the string
#include <iostream>
#include <string>
// #include <typeinfo>
using namespace std;
int main() {
int nums[] = {3, 2, 2, 1, 5, 9, 9};
int n = sizeof(nums) / sizeof(nums[0]);
int count = 1;... | ALGO | 0.999927 | 4.344085 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2025-02-25T15:02: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": "65fea0a0463... |
001658fe-cccb-416f-9fde-5022498e436c | ishandutta2007/codeforces-f | ftiasch/normal/1692/H.cpp | #line 1 "/home/ftiasch/Documents/shoka/util.h"
#include <bits/stdc++.h>
#define ALL(v) (v).begin(), (v).end()
using Long = long long;
using u64 = uint64_t;
struct IO {
IO() { std::ios::sync_with_stdio(false); }
template <typename T = int> T read() const {
T v;
std::cin >> v;
return v;
}
templat... | ALGO | 0.999817 | 4.106197 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43: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": "b6ef7134d9a4... |
4682bcff-3499-4030-9ddb-a93abe13f540 | kishorraguram-g/lists-in-cpp | lists/listallfun.cpp | #include <iostream>
#include <list>
#include <algorithm> // for std::find
using namespace std;
void printList(const std::list<int>& lst) {
for (const int& elem : lst) {
std::cout << elem << " ";
}
std::cout << std::endl;
}
int main() {
std::list<int> myList = {10, 20, 30, 40, 50};
std... | TOOL | 0.973795 | 6.380921 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-05-26T00:57: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": "9bfacc0e1571... |
7cd2ce4e-d9eb-4888-bc42-5d2df6f526e9 | chamini2/SPOJ | done/QUILT.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
/*
S -> A
| B
| turn(S)
| sew(S, S)
*/
typedef struct {
char** info;
int rows, cols;
} thing;
thing *newA() {
// char **a = (char**) malloc(sizeof(char*) * 2);
char **a = (char**) malloc(sizeof(char*) * 2);
a[0] = (char*) malloc(si... | ALGO | 0.994047 | 3.424467 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2015-02-16T17:18:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b8759494e... |
e2cc32e5-6a4a-4568-b29a-124443748b11 | wangyuan0225/TYUT_Computer_Class_Code | Data Structures/Experiment/05/04.cpp | /**
****************************************************************************************
* Copyright © Taiyuan University of Technology. Ltd. 1902-2024. All rights reserved.
* @BelongsProject : 05
* @File : 04.cpp
* @Author : <NAME> (wy0225)
* @Brief : 给定关键字序列{23,11,32,55,90,7... | ALGO | 0.999992 | 4.82948 | {
"github_metadata": {
"branch": "main",
"commit_count": 205,
"repo_created_at": "2022-10-23T04:55: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": "09280694f0... |
423b2710-0649-4e03-ab17-275ac6276859 | zhli-phys/LeetCode | 710_Random_pick_with_blacklist.cpp | class Solution {
public:
Solution(int n, vector<int>& blacklist) : count(blacklist.size()) {
int m = blacklist.size();
valid_n = n - m;
sort(blacklist.begin(), blacklist.end());
for (int i = 0; i < m; ++i)
count[i] = blacklist[i] - i;
}
int pick() {
... | ALGO | 0.999669 | 5.951771 | {
"github_metadata": {
"branch": "main",
"commit_count": 273,
"repo_created_at": "2021-08-09T20:35: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": "6428ae0d9e... |
d3c25ef8-c01a-46b0-9094-1336e556901c | HimanshuSingour/DSA---Full-Dynamic-Programming- | Dp on Subsequence or Subset/Memoization/Unbounded_knapsack.cpp | #include<bits/stdc++.h>
using namespace std;
int solve(vector<int> val , vector<int> wt , int W , int index , vector<vector<int>>& dp){
// base case
if(index == 0){
// if we are in index 0 the we need to think in different ways
// like, if the target is 12 and the last elemt is 4 so , for sure we c... | ALGO | 0.999975 | 4.942671 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-05-31T10:29:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d31291b93895... |
c9311b66-1dee-4bb0-a299-a9f01ec53c1a | stan-dev/math | stan/math/opencl/prim/rayleigh_cdf.hpp | #ifndef STAN_MATH_OPENCL_PRIM_RAYLEIGH_CDF_HPP
#define STAN_MATH_OPENCL_PRIM_RAYLEIGH_CDF_HPP
#ifdef STAN_OPENCL
#include <stan/math/prim/meta.hpp>
#include <stan/math/prim/err.hpp>
#include <stan/math/prim/fun/constants.hpp>
#include <stan/math/prim/fun/elt_divide.hpp>
#include <stan/math/prim/fun/elt_multiply.hpp>
#... | ALGO | 0.994137 | 7.57874 | {
"github_metadata": {
"branch": "develop",
"commit_count": 28933,
"repo_created_at": "2015-07-01T18:40:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 785,
"forks": 195,
"issues": 298,
"pull_requests": 19
},
"file_meta": {
"content_id": ... |
e2d0f545-75d5-43eb-8188-ff2a71b258d5 | ishandutta2007/codeforces-g | glebshp/normal/317/A.cpp | #include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cassert>
#include <ctime>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
const ... | ALGO | 0.999968 | 3.301415 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:55: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": "d6f55552b49d... |
f0b9efbe-28c8-438a-ada3-532eeb4a30c1 | anyatamax/MIPT_Algorithms_and_Data_strustures | 2_semester/3_contest/E.cpp | // Выведите все элементы полученного дерева в порядке возрастания.
// Формат ввода
// Вводится последовательность целых чисел, оканчивающаяся нулем. Сам ноль в последовательность не входит. По данной последовательности требуется построить дерево.
// Формат вывода
// Выведите ответ на задачу
#include <iostream>
#incl... | ALGO | 0.999967 | 5.651315 | {
"github_metadata": {
"branch": "main",
"commit_count": 119,
"repo_created_at": "2021-11-22T21:07: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": "ee937f82a2... |
635df5c5-e16a-445d-99e1-8a0c004584d2 | MultivacX/leetcode2020 | algorithms/easy/2124. Check if All A's Appears Before All B's.h | // 2124. Check if All A's Appears Before All B's
// https://leetcode.com/problems/check-if-all-as-appears-before-all-bs/submissions/
// Runtime: 0 ms, faster than 100.00% of C++ online submissions for Check if All A's Appears Before All B's.
// Memory Usage: 6.2 MB, less than 64.71% of C++ online submissions for Check... | ALGO | 0.999066 | 5.159279 | {
"github_metadata": {
"branch": "master",
"commit_count": 1856,
"repo_created_at": "2019-12-31T13:19:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c56886... |
3b56b6cf-a8a1-4f1e-9faf-854579ce8aa0 | Manav-Aggarwal/competitive-programming | GSS1.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define MAX 5000010
ll t[4*MAX], a[MAX];
ll m, n, qs, qe;
ll buildSegTree(ll arr[], ll start, ll end, ll node)
{
if(start == end)
{
t[node] = arr[start];
return t[node];
}
ll mid = (start + end)/2;
t[node] = buildSegTree(arr,... | ALGO | 0.999973 | 5.464899 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-04-04T19:40: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": "3902af8397... |
37880af1-01e7-4b27-b98c-82c984baa649 | Rumen-Nikolaev/C-pp | Tasks5/Task7-4/Task7-4.cpp |
#include <iostream>
using namespace std;
int main()
{
int arr[7] = {1, 0, 4, 4, 5, 9, 2};
int sum = 0, count = 0;
for(int i = 0; i < 6; i++)
{
for(int j = i + 1; j < 7; j++)
{
count++;
}
sum += count;
count = 0;
cout << arr[i];
}
... | ALGO | 0.998895 | 4.122287 | {
"github_metadata": {
"branch": "main",
"commit_count": 257,
"repo_created_at": "2024-06-26T15:10: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": "9620e8429c... |
9aa6844b-5828-43f9-8b2e-eaaf1871d48b | CGAL/cgal | Cartesian_kernel/include/CGAL/Cartesian/Line_2.h | // Copyright (c) 2000
// Utrecht University (The Netherlands),
// ETH Zurich (Switzerland),
// INRIA Sophia-Antipolis (France),
// Max-Planck-Institute Saarbruecken (Germany),
// and Tel-Aviv University (Israel). All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Id... | ALGO | 0.951388 | 5.640355 | {
"github_metadata": {
"branch": "master",
"commit_count": 113659,
"repo_created_at": "2014-10-01T12:22:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5443,
"forks": 1475,
"issues": 511,
"pull_requests": 136
},
"file_meta": {
"content_id... |
77bfa8a8-3e47-4acb-81fc-a50ddb00f682 | munraito/made-algo | solutions/W8_trees-1/C_kth_maximum.cpp | #include <iostream>
using namespace std;
struct Node {
int key;
unsigned char height;
int size;
Node* left;
Node* right;
Node (int k) {
key = k;
left = right = nullptr;
height = size = 1;
}
};
class BST {
public:
Node* root;
BST() {
// init empty tr... | ALGO | 0.999995 | 5.284291 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2020-12-18T18:21: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": "16c981b398a5... |
8480d580-30c7-4e8b-b7a1-a32aac941a66 | DanaYum/Cpp_Code | unit-6/stack.cpp | #include <iostream>
#include <vector>
template <typename T>
class StackBase {
private:
std::vector<T> elements;
public:
void push(T x) {
elements.push_back(x);
}
void pop() {
if (!elements.empty()) {
elements.pop_back();
} else {
std::cout << "Stack und... | ALGO | 0.999148 | 5.556379 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-01-28T15:16: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": "cd2c7e0a4e... |
f3ea4eef-176c-4f4a-85ad-95de0948e5e4 | goel-vipul/analysisOfAlgorithms | Strassen's Matrix Multiplication/strassen.cpp | #include <iostream>
#include <vector>
using namespace std;
// Define a matrix as a 2D vector of integers
typedef vector<vector<int>> Matrix;
// Adds two matrices and returns the result
Matrix addMatrices(const Matrix &mat1, const Matrix &mat2, int size) {
Matrix sum(size, vector<int>(size, 0));
for (int row ... | ALGO | 0.999992 | 5.941151 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2025-04-24T17:32: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": "42f9e4c0df7... |
23b9f1a9-8306-4135-a58a-28c16f070880 | hoonably/PS | 백준/Gold/18436. 수열과 쿼리 37/수열과 쿼리 37.cc | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define MAX 1'000'001
/*
2 l r : 짝수의 개수 출력 => r-l+1 - (홀수 개수)
3 l r : 홀수의 개수 출력
*/
int N, M;
bool arr[MAX];
vector<int> segTree;
// 구간합 초기화
int init(int node, int s, int e) {
if (s == e)
return segTree[node] = ... | ALGO | 0.999958 | 4.946953 | {
"github_metadata": {
"branch": "main",
"commit_count": 1856,
"repo_created_at": "2023-12-13T05:33:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a11dfc05... |
d76c3712-f9b1-41c5-be03-058a0075bc9a | QuincyKing/WalEngine | WalEngine/src/core/Quaternion.h | #pragma once
#include <glm/glm.hpp>
class Quaternion
{
public:
glm::vec4 que;
public:
Quaternion(float _x = 0.0f, float _y = 0.0f, float _z = 0.0f, float _w = 1.0f)
{
que.x = _x; que.y = _y; que.z = _z; que.w = _w;
}
Quaternion(const glm::vec4& r)
{
que.x = r.x; que.y = r.y; que.z = r.z; que.w = r.w;
}
... | ALGO | 0.924434 | 6.759682 | {
"github_metadata": {
"branch": "master",
"commit_count": 109,
"repo_created_at": "2018-11-08T09:06:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "29732d53... |
3b42d4bd-78b1-4317-b4ba-4d9307a1a672 | LEEHYUNDONG/codingTest | C++_preparation/Programmers/Programmers_keepSpace.cpp | #include <string>
#include <vector>
#include <iostream>
#include <cstring>
using namespace std;
int direction[4][2] = {
{1, 0},
{-1, 0},
{0, 1},
{0, -1}};
bool visited[5][5];
bool flag;
void dfs(vector<string> &place, int x, int y, int depth)
{
if (depth > 2 || flag)
{
return;
}
... | ALGO | 0.999578 | 4.664977 | {
"github_metadata": {
"branch": "master",
"commit_count": 752,
"repo_created_at": "2021-10-07T07:08: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": "48e0d016... |
44b8dca5-4de2-48a4-8ac9-3f00f8c89f9f | yunjinli/visual-slam | include/visnav/global.h | /**
BSD 3-Clause License
Copyright (c) 2021, <NAME> and <NAME>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of c... | ALGO | 0.980174 | 6.828418 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2023-02-08T01:50:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1388ea1cd... |
38186f05-10ac-43c0-94d1-0dd6275a3576 | 1020xyr/CodeSet | 代码/13.cpp | #include<iostream>
#include<stack>
#include<string>
using namespace std;
int getPro(char function) {
if (function == '*' || function == '/') {
return 3;
}
else if (function == '+' || function == '-') {
return 2;
}
else if(function == 'a'){
return 1;
}
else {
return 0;
}
}
double count(double a, double b... | ALGO | 0.998431 | 3.610471 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-06-29T03:46:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb3634451... |
9758b6aa-402c-4d2a-96a7-a8522ded32ac | yatiyr/AlgorithmProblems | include/Hard/TransitivityRelations.h | #ifndef __TRANSITIVITY_RELATIONS_H__
#define __TRANSITIVITY_RELATIONS_H__
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
struct Pair
{
int node1;
int node2;
};
bool comparePairs(const Pair& p1, const Pair& p2)
{
if(p1.node1 == p2.node1)
return p1.node2 < p2.node2;
... | ALGO | 0.999467 | 5.592852 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2021-05-13T12:41: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": "7ab48a0f886... |
e5e262e2-ebc5-48c2-bacd-49e3b0d0c972 | unc-chr/study | nowcoder/algorithm/oral_quiz_top101/BM9.cpp | /*================================================================
* Copyright (C) 2023 Goldman Ltd. All rights reserved.
*
* File:BM9.cpp
* Author:leekaihua
* Date:2023年04月12日
* Brife:
*
*/
/**
*/
#include <iostream>
struct ListNode {
int val;
struct ListNode *next;
ListNode(int value) {
... | ALGO | 0.999936 | 5.835241 | {
"github_metadata": {
"branch": "main",
"commit_count": 90,
"repo_created_at": "2023-05-09T09:59: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": "4827ada796d... |
0313d232-8f24-4de8-9fbd-9fb8a053d2d3 | kongyay/Smart-Glove | smartGlove.ino | // Pins
// Fill in the pins you used on your own setup.
// WARNING: Make sure you have resistors connected between the rows and the arduino.
#include "LedControlMS.h"
#include "pitches.h"
#define F_THUMB A0
#define F_INDEX A1
#define F_MIDDLE A2
#define F_RING A3
#define F_PINKY A4
#define SOUND 8
#define arr_len( x ... | TOOL | 0.962507 | 4.870836 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-02-17T15:02: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": "ad66563e58... |
3bb11ddc-fd4b-4a48-88a0-ee78ba7e5bbf | rakeshp-123/kidnapped_vehicle_project | particle_filter.cpp | /*
* particle_filter.cpp
*
* Created on: Dec 12, 2016
* Author: <NAME>
*/
#include <random>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <math.h>
#include <iostream>
#include <float.h>
#include <sstream>
#include <string>
#include <iterator>
#include "particle_filter.h"
using name... | ALGO | 0.975281 | 5.886813 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2018-09-13T14:26: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": "1a8afb3f4... |
b7474ed3-d160-4d41-887e-c51843204657 | namanyasaiful/c-learn | pertemuan4/latihan3.cpp | #include <iostream>
using namespace std;
int main(){
int angka[5];
int *ptr;
cout << "Masukkan 5 angka: " << endl;
for (int i = 0; i < 5; i++){
cout << "Angka ke-" << i + 1 << ": ";
cin >> *(ptr + i);
}
cout << "Angka yang Anda masukkan: ";
for (int i = 0; i < 5; i++){
... | ALGO | 0.999101 | 3.638231 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-03-13T00:08: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": "dba58bd8adbe... |
d597532b-4f4b-4eb6-8306-83eca9b742de | AudibleP/TC1031_ProyectoB_A01703259 | main.cpp | /*
Se usara unordermaps como estructura extra
*/
#include <iostream>
#include <fstream>
#include "graph.h"
using namespace std;
int main() {
Graph sus;
int option;
string start;
string destination;
float seconds;
ifstream text("amogus.txt");
cout<<"Hi"<<endl;
cout<<"This program is a ... | ALGO | 0.949705 | 3.365972 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2021-11-18T02: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": "c930abd6857... |
b3432686-6cf0-400c-ba62-ece9f3d9baa5 | ndthanh2605/LeetcodeCpp | Stack/739_DailyTemperatures/739_DailyTemperatures.cpp |
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
using namespace std;
class Solution {
public:
vector<int> dailyTemperatures(vector<int>& temperatures) {
int n = temperatures.size();
if (n == 1)
return { 0 };
stack<int> st; // store index
v... | ALGO | 0.999954 | 5.588721 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2024-09-28T15:50: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": "ded8d2aa629... |
57452faf-be0e-4e0d-8b35-974f6c86bb22 | unc-compgeom/DDAD | geometry/line.h | /*
* This file is part of DDAD.
*
* DDAD is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* DDAD is distributed in the hope th... | ALGO | 0.979903 | 3.789025 | {
"github_metadata": {
"branch": "master",
"commit_count": 156,
"repo_created_at": "2014-05-28T12:38:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 13,
"pull_requests": 0
},
"file_meta": {
"content_id": "0edac739... |
15d5c215-c08e-4c91-977a-42ed1f368a39 | little-czy/luogu | csp100/T87047/main.cpp | #include <iostream>
#include <malloc.h>
using namespace std;
typedef struct node
{
short height;
int wealth;
short appearance;
short age;
int order;
} node;
int judge_value(node * a, node * b);
bool shouldUp(node *father, node *child)
{
return (judge_value(father, child) == -1);
}
void inse... | ALGO | 0.999952 | 3.992791 | {
"github_metadata": {
"branch": "master",
"commit_count": 213,
"repo_created_at": "2020-07-04T12:07: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": "50ffecd0... |
9a9fcf04-28d0-42fc-9fe8-92bb4bc1704a | yashashvi007/100-days-of-dsa | arrays/sorting.cpp | #include <iostream>
using namespace std;
// void insertionSort(int ar[] , int n){
// }
void merge(int ar[], int l, int mid, int r)
{
int n1 = mid - l + 1;
int n2 = r - mid;
int ar1[n1];
int ar2[n2];
for (int i = 0; i < n1; i++)
{
ar1[i] = ar[l + i];
}
for (int i = 0; i < n2... | ALGO | 0.999991 | 5.321712 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-08-25T10: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": "f1962a4852c2... |
c563a575-2c15-4af9-b052-4d7cd74eaa98 | thomaszhouan/BACTG | uva1391.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5+10;
struct SAT {
int n;
vector<int> G[maxn<<1], s;
bool mark[maxn<<1];
void init(int n) {
this->n = n;
for (int i=0; i<2*n; ++i) G[i].clear();
memset(mark, 0, sizeof(mark));
}
void add_clause(int x, int xv, int y, int yv) {
... | ALGO | 0.999974 | 3.739905 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2017-08-18T12:02: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": "6c615221d... |
e7b0a7c5-9908-45f5-b6b9-9eb7b8767724 | mridult543/Long-Calculator | main.cpp | #include "BigNumber.h"
#include <iostream>
using namespace std;
int main() {
string str1,str2;
cout<<" Instructions "<<endl;
cout<<"You need to enter two number,then it will ask for your choice."<<endl;
cout<<"Enter 1 for Addition."<<endl;
cout<<"Enter 2 for Subtraction."<<endl;
cout<<"Enter 3 for... | ALGO | 0.916298 | 3.315272 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-09-12T18:49: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": "01d7bad4791d... |
f288c104-0c8d-4ad8-aa3d-9936678c6f51 | themoleyouknow/enigma | enigma.h | #include <iostream>
#include "errors.h"
using namespace std;
// Declare global constant to represent number of letter in alphabet:
int const ALPH = 26;
// Forward declaration of subclasses:
class Plugboard;
class Reflector;
class Rotor;
/* ----- Define Enigma Class ---- */
class Enigma {
friend class EnigmaMachine;... | ALGO | 0.968225 | 4.218444 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-12-17T18:31: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": "365db552d... |
f998c5e2-7fd4-4fe2-914b-7d011546e3f2 | Eicosane-2/Schemi | Schemi/src/SLE/conjugateGradientSolver.cpp | /*
* conjugateGradientSolver.cpp
*
* Created on: 2023/06/04
* Author: <NAME>
*/
#include "conjugateGradientSolver.hpp"
#include <iostream>
#include "SLEMatrixDotProduct.hpp"
std::valarray<schemi::scalar> schemi::conjugateGradientSovler::algorithm(
const std::valarray<scalar> & oldField,
const SLEMatr... | ALGO | 0.99583 | 4.797817 | {
"github_metadata": {
"branch": "main",
"commit_count": 152,
"repo_created_at": "2023-07-31T08:00: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": "86e70a5d15... |
716bba49-cc2c-45a2-a330-3242656142eb | ckrisgarrett/closures-2d | src/utils.cpp | /*
File: utils.cpp
Author: <NAME>
Date: July 26, 2012
Several functions are defined here as helper utilities to the rest of the
program.
*/
#include "utils.h"
#include <stdlib.h>
#include <math.h>
#include <gsl/gsl_integration.h>
#ifdef USE_MPI
#include <mpi.h>
#endif
/*
Implements abort for both ser... | TOOL | 0.997465 | 4.582851 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2015-06-23T17:27:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb0ff0de4... |
777d124b-50d0-4053-aa96-b821f94110a4 | Lucaweihs/SymRC | src/OrthogonalRangeQuerier.h | /***
* Copyright (C) 2016 <NAME>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distribut... | TOOL | 0.922667 | 7.206415 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2017-05-28T21:14:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc9ed7e21... |
19f702aa-f68f-4c4d-bdd7-b73c2f1cdea8 | syawacha/AtCoder | ABC/D/D_122.cpp | #include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;
ll MOD = 1000000007;
int main(){
int N;
cin >> N;
ll dp[16][N+1];
dp[0... | ALGO | 0.999944 | 4.095366 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2019-06-23T13:58:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff3bfabb2... |
9499a224-b4c1-4ea6-ae00-217ee752ea66 | ishandutta2007/codeforces-a | anta/normal/682/D.cpp | #include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
typedef vector<... | ALGO | 0.99993 | 3.244982 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "624180d7f547... |
7123f5d7-ca59-4efd-bd1e-882417ad329f | GaneshBhutekar/DSA | Queues/demo.cpp |
// approach 1 : Not Optimized one.
// #include<iostream>
// #include<vector>
// using namespace std;
// void print(vector<int> arr,int start,int last){
// for(int i = start; i<=last;i++){
// cout<<arr[i]<<" ";
// }
// cout<<endl;
// }
// void window_min_max(vector<int> arr, vector<int> &result,i... | ALGO | 0.9999 | 5.424925 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2024-10-11T19:28: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": "0d5e3c18e... |
16cdd86b-18fb-4524-907d-8c765cde1102 | dylanhdy/codebase | Contest_OI/JZ-Mar-11 GDOI/C.cpp | #include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <queue>
#include <vector>
#include <map>
#include <set>
#define MAXN 100005
#define P 998244353
#define INF 0x3f3f3f3f
#define rint register int
#define LL long long
#define LD long double
using namespace std;
int n, q, cnt, root, A[MA... | ALGO | 0.999823 | 3.785613 | {
"github_metadata": {
"branch": "master",
"commit_count": 235,
"repo_created_at": "2019-02-15T12:37:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98b9bb93... |
5598d8a9-a81f-4210-ba28-3d31e8d4d807 | krishna146/DSASheetAndSolution | 25Graph/Class/2graph_bfs.cpp | //Problem Link - https://practice.geeksforgeeks.org/problems/bfs-traversal-of-graph/1F
/* By <NAME> */
#include<bits/stdc++.h>
#include<iostream>
using namespace std;
template<typename T>
class Graph{
public:
map<T, list<T>> adjList;
void addEdge(T u, T v, bool direction){
adjList[u].push_back(v);
... | ALGO | 0.999749 | 5.032425 | {
"github_metadata": {
"branch": "master",
"commit_count": 277,
"repo_created_at": "2022-06-21T09:41: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": "2725abe7... |
17da567d-f388-4470-9952-062b882b6cff | kavanc/Intro-To-Programming | Tutorial 7 Question C.cpp | // Author: <NAME>
// Date: March 4, 2019
//Tutorial 7 Question C
#include<iostream>
#include<cmath>
using namespace std;
int main() {
double toon(2), loon(1), quart(0.25), dime(0.1), nick(0.05), pen(0.01), total;
cout << "Change required: " << endl;
cin >> total;
top:
if (total - toon >= 0) {
total = total ... | ALGO | 0.99951 | 3.430689 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-09-27T19:22:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f09e93f85... |
10ba8492-be3d-4077-a02a-f73a1c48862d | jacob-a2k/cpp0x | exe_4.33/main.cpp | // WCZYTYWNIE DANYCH Z PLIKU ZA POMOCA OPERATORA '>>'
/*
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
void wykonajOperacje( int liczba1, string napis, int liczba2 ){
if( napis == "dodac" ){
cout << liczba1 << " + " << liczba2 << " = " << liczba1 + liczba2 << endl;
... | ALGO | 0.920992 | 3.471712 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2022-04-17T07:45: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": "cb0bfc69568... |
18857ed6-5030-4182-8004-ef82dc119885 | kevinwall/Hash_Table | include/Hash_Table.inl | #include <forward_list>
#include <iostream>
#include "Hash_Table.h"
using namespace std;
template <class KeyType, class DataType, class KeyHash, class KeyEqual>
unsigned long int HashTbl<KeyType, DataType, KeyHash, KeyEqual>::FindPrime(int capacity)
{
int count = 0;
for( auto i = capacity; 1 < i && capacity <... | ALGO | 0.938838 | 5.103871 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2018-06-07T12:57: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": "960d3311c... |
3c963952-3a7c-4ae6-b635-c32245ce68d4 | bitdove/DailyLearning | A02_数据结构与算法/TreeTraversal.cpp | #include <iostream>
#include <vector>
#include <string>
#include <queue>
using namespace std;
//二叉树节点结构
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, Tre... | ALGO | 0.999973 | 5.244544 | {
"github_metadata": {
"branch": "main",
"commit_count": 109,
"repo_created_at": "2021-06-10T07:38: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": "8b242857c7... |
8f817b88-81da-408c-a51b-fa18783d4ebe | alvi-uiu/Algorithms | Level-1/4.Maths/2521. Distinct Prime Factors of Product of Array.cpp | // https://leetcode.com/problems/distinct-prime-factors-of-product-of-array/description/
#include <bits/stdc++.h>
using namespace std;
bool isPrime(int n)
{
if (n <= 1)
return false;
for (int i = 2; i * i <= n; i++)
{
if (n % i == 0)
return false;
}
return true;
}
/*-... | ALGO | 0.999914 | 5.630815 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-04-23T14:22: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": "55e45224a78... |
577e7e68-1d63-4d45-af2c-dce5b37ae894 | pedris11s/coj-solutions | lmm-p1274-Accepted-s922556.cpp | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define SD(n) scanf("%d", &n)
#define SDD(n,m) scanf("%d%d",&n,&m)
using namespace std;
typedef long long ll;
const ll MOD = 1000003;
#define MAXN 1000005
ll dp[101][101];
int dp2[101][101];
void built()
{
for(int i = 2; i <= 100; i++)
{
... | ALGO | 0.99973 | 3.544918 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-12-05T22:51:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b88610ed68... |
8f40e4c1-48e6-479f-acc6-7d48cdd848cf | luyencode/cpp-solutions | solutions/ev4OOYBF.cpp | /*
Sưu tầm bởi @nguyenvanhieuvn
Thực hành nhiều bài tập hơn tại https://luyencode.net/
*/
#include<stdio.h>
#include<conio.h>
#include<math.h>
#define MAX 100
void NhapMaTran(int a[][MAX], int &n)
{
do
{
printf("\nNhap n: ");
scanf("%d", &n);
if(n < 1 || n > MAX)
{
... | ALGO | 0.999781 | 3.301544 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2021-04-10T08:00:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 96,
"forks": 98,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "457eb6d79f... |
1d6fd2c2-941b-4750-b552-6f56f819ca8a | benjaminiserman/EpsilonNFA | EpsilonNfa.hpp | #pragma once
#include <iostream>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <functional>
namespace final_project
{
template <typename TKey, typename TLabel>
class EpsilonNfa
{
struct NfaNode
{
std::unordered_multimap<TKey, NfaNode *> edges = st... | ALGO | 0.995762 | 5.979538 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-04-28T00:47:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4739ac236962... |
6cf43856-e894-4796-9c76-44018833987e | Orang123/ACMAlgorithmExercises | 图论/tarjan图连通/双连通分量/边双连通/无向图添加最少边数构成EBC/含重边/POJ 3177 Redundant Paths.cpp | #include<cstdio>
#include<stack>
#include<cstring>
#include<algorithm>
#define N 5500
#define M 10100
using namespace std;
//ac 0ms tarjan类比求解scc来求解ebc
/*
题意:一个无向图(含重边),最少要添加几条边才能使得图中没有割边,成为边双连通图.
同一对字段之间可能已经有多个路径(含重边).
链接:http://poj.org/problem?id=3177
思路:tarjan类比求解scc求解ebc.只不过对于重边也要能使其回到父亲节点,
进而更新low[u]=min(low[u],df... | ALGO | 0.999945 | 4.137542 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2022-02-25T05:23:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d29abdbe140... |
b2b13a88-e284-41b4-97fb-ca9f8df300e1 | vahsek300501/Leetcode-Question | 416-partition-equal-subset-sum/416-partition-equal-subset-sum.cpp | class Solution {
public:
static bool subsetSumToKDynamicProgramming(int n, int k, vector<int> &arr) {
vector<vector<bool>> dp(n, vector<bool>(k + 1, false));
// Step-1: Base case
// when k == 0 that is sum is 0 then for any 0 -> n-1 the value will be true
for (int i = 0; i < n; i++) {
... | ALGO | 0.999839 | 5.890593 | {
"github_metadata": {
"branch": "main",
"commit_count": 2165,
"repo_created_at": "2021-05-13T13:58: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": "bcd6bee5c... |
51e033df-e5a8-4856-885e-b45724cf9783 | zackwoodruff/AdventOfCode2020 | day1/day1.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <set>
using std::cout;
using std::endl;
int main(){
cout << "Day 1!" << endl;
// Read input
int n;
std::vector<int> v;
std::ifstream infile("day1/day1_input2.txt");
while (infile >> n){
v.push_back(n);
}
// Part 1: Find pair of ints ... | ALGO | 0.999353 | 5.127626 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2020-12-14T18:56: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": "b726e1324... |
1522a6b2-22ab-474c-9d6a-aaf5500ec219 | chinmay17-bot/DSA-CPP | String/HARD/removeK_dup.cpp | #include <bits/stdc++.h>
using namespace std;
//Brute force solution
// bool matchKchars(string& s, char &chr, int &i, int k){
// int j = s.size()- 1;
// while(k > 0){
// if(chr != s[j--]) return false;
// k--;
// }
// return true;
// }
// string re... | ALGO | 0.999971 | 4.509967 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-10-28T19:40:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bcd01fdeb55... |
a86f4e49-7fa7-497d-99f0-72d1a7da0f0b | CodeTiger927/CodeForcesRepo | edu113/playoffrestoration.cpp | using namespace std;
#include <iostream>
#include <vector>
#include <map>
#define MOD 998244353
long long k,N,A,H,pw[33];
vector<int> eval(int n,int m) {
if(n == 1) return {1};
vector<int> res = eval(n / 2,m & ((1 << (n / 2 - 1)) - 1));
vector<int> r = eval(n / 2,(m >> ((n / 2) - 1)) & ((1 << (n / 2 - 1)) - 1));... | ALGO | 0.999943 | 3.855921 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2021-05-09T19:25:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1417dea9de4... |
ed009620-f551-4a79-a499-b42205005d87 | viren-sureja/Love-Babbar-450 | 10_stack_and_queues/20_implement_stack_using_queue.cpp | /*
link: https://practice.geeksforgeeks.org/problems/stack-using-two-queues/1#
*/
// ----------------------------------------------------------------------------------------------------------------------- //
/*
method 1
By making pop operation costly
*/
//Function to push an element into stack using two ... | ALGO | 0.999671 | 4.931268 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2021-03-21T14:17:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 356,
"forks": 169,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "b3932... |
f09e785f-e7dc-4407-b520-48c281607d7f | Arsha8Anuga/Kuliah-Polman | Praktek/Pemogramman Komputer/C++/File/Testing.cpp | #include <iostream>
#include <string>
using namespace std;
int main(){
int input;
const int LOW_VAL = 0;
const char MAX_CHAR = 'Z';
const char DEFAULT_CHAR = 'A';
char character = 65;
cout<<"Masukan Nilai : ";
cin>>input;
int decrement = input;
// for(int i = 0; i < input... | ALGO | 0.999598 | 3.599805 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2024-08-18T02:39: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": "b4793a6d7b9... |
657169e5-301a-4aaa-985c-4ebe4ec85b93 | uzzal2200/Alogorithm | Module 24 : Assignment 04/Make_It.cpp | // #include<bits/stdc++.h>
// using namespace std;
// bool solve(long long n,long long cur)
// {
// if(cur == n)
// {
// return true;
// }
// if(cur > n)
// {
// return false;
// }
// if(cur <= n)
// {
// bool op1=solve(n,cur+3);
// ... | ALGO | 0.999723 | 4.97828 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2024-06-16T13:39:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "239d4beaa15... |
9d2e698f-3ff4-4a8f-922a-63446bfa515a | vutrung203/BaiVS_code | Baihoc/94_tong_binhphuong.cpp | #include<iostream>
#include<stdio.h>
#include<conio.h>
#include<limits.h>
using namespace std;
void daysole(int n)
{
cout<<"day so le la : ";
for(int i = 0; i <= n; i++)
{
if(i % 2 == 1)
{
cout<<i<<" ";
}
}
}
void daysochan(int n)
{
cout<<endl<<"day so le la : "... | ALGO | 0.999745 | 3.341474 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2023-06-13T14:11:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b7a2a40a38... |
2f7ab10f-ded0-4e48-8c24-f57d88562dc4 | manuelprogram/Programming-Competitive | Uva Judge/469 Wetlands of Florida/main.cpp | /*
* File: main.cpp
* Author: PERSONAL
*
* Created on 26 de diciembre de 2016, 12:18 PM
*/
#include <cstdlib>
#include <stdio.h>
#include <string.h>
#include <iosfwd>
#include <cstdio>//gets
#define reiniciar(a,b) memset(a,b,sizeof(a))
using namespace std;
char m[100][100];
bool visit[100][100];
int cn, i,... | ALGO | 0.999882 | 3.550572 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-02-06T19:57: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": "ad1d8af2b... |
ae9897e2-dc01-4334-915d-863c71c45587 | icl-utk-edu/magma | src/zsytrf_nopiv_cpu.cpp | /*
-- MAGMA (version 2.0) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date
@author <NAME>
@author <NAME>
@precisions normal z -> c
*/
#... | ALGO | 0.999741 | 5.872172 | {
"github_metadata": {
"branch": "master",
"commit_count": 8870,
"repo_created_at": "2023-04-05T15:59:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 63,
"forks": 29,
"issues": 10,
"pull_requests": 1
},
"file_meta": {
"content_id": "0e35d... |
295ef6ca-f908-4204-a85f-f513e7d25962 | allenanswerzq/byteme | acwing/138/138.cc | /* created : 2020-06-06 08:01:24
* accepted : 2020-06-06 09:07:00
*/
#include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
#define all(x) (x).begin(), (x).end()
#define ll long long
void solve() {
int n; cin >> n;
list<int> li;
unordered_map<int, decltype(li.begin())> mp;
unordere... | ALGO | 0.999977 | 4.232593 | {
"github_metadata": {
"branch": "master",
"commit_count": 810,
"repo_created_at": "2017-06-16T09:27:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9633cbe6... |
f2b024a7-b201-41de-a688-54e06586edeb | ishandutta2007/codeforces-p | physics0523/normal/1495/D.cpp | #include<bits/stdc++.h>
#define inf 1072114514
#define mod 998244353
using namespace std;
using pi=vector<pair<int,int>>;
using Graph=vector<vector<int>>;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n,m;
cin >> n >> m;
int d[512][512];
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){d[i]... | ALGO | 0.999848 | 4.837241 | {
"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": "7fe6a091b070... |
3d0d868b-ee7f-422b-a97f-57913063d4e8 | mush-zhang/RegexIndexComparison | src/BEST/Index/single_threaded.cpp | #include <cstring>
#include <random>
#include <ranges>
#include <stdexcept>
#include "single_threaded.hpp"
#include "../../utils/utils.hpp"
// #include "../../utils/trie.hpp"
extern "C" {
#include "../../utils/rax/rax.h"
#include "../../utils/rax/rc4rand.h"
};
// TODO: measure the performance of rax and tri... | ALGO | 0.999286 | 3.120311 | {
"github_metadata": {
"branch": "main",
"commit_count": 570,
"repo_created_at": "2024-03-08T20:09:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "009fee9a25... |
89fa5fae-8fd4-4760-9202-bfb500d1ec48 | andreasreufer/sphlatch | src/impact_solver.cpp | #ifndef SPHLATCH_IMPACT_SOLVER_CPP
#define SPHLATCH_IMPACT_SOLVER_CPP
/*
* impact_solver.cpp
*
*
* Created by <NAME> on 10.12.09
* Copyright 2009 University of Berne. All rights reserved.
*
*/
#include "typedefs.h"
namespace sphlatch {
void getImpactSetup(
const fType _m_tar,
const fType _m_imp,
c... | ALGO | 0.999688 | 5.460775 | {
"github_metadata": {
"branch": "public",
"commit_count": 623,
"repo_created_at": "2014-02-06T21:00:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8083e3a4... |
701ad21f-f9fd-49e2-b5ad-8258819659db | elemental/Elemental | src/optimization/solvers/SOCP/affine/IPM/util.hpp | /*
Copyright (c) 2009-2016, <NAME>
All rights reserved.
This file is part of Elemental and is under the BSD 2-Clause License,
which can be found in the LICENSE file in the root directory, or at
http://opensource.org/licenses/BSD-2-Clause
*/
#include <El.hpp>
#include "../../../LP/affine/IPM/util.hpp"
n... | ALGO | 0.998809 | 4.947308 | {
"github_metadata": {
"branch": "master",
"commit_count": 3773,
"repo_created_at": "2012-05-06T08:37:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 513,
"forks": 110,
"issues": 38,
"pull_requests": 7
},
"file_meta": {
"content_id": "c64... |
776a6831-c6c1-4297-b7e1-02099be3109b | bansheewaltz/algorithmic-problems | ozon/go-02-2024-training/3.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve() {
int n;
cin >> n;
string in;
getline(cin, in);
while (n--) {
getline(cin, in);
stringstream ss;
for (int i = 0; i < in.size();) {
int res = 0;
if (i + 3 < in.size()) {
res = isalpha(in[i + 0]) &... | ALGO | 0.998426 | 3.856229 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2023-11-08T10:24: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": "f0879ee3... |
70b3c4e3-27b0-44f7-9e69-ab237d7acafa | yamate11/compprog | zOther/typical90/036/cans.cc | #include <bits/stdc++.h>
#include <cassert>
typedef long long int ll;
using namespace std;
// #include <atcoder/all>
// using namespace atcoder;
// @@ !! LIM(f:updMaxMin)
// ---- inserted function f:updMaxMin from util.cc
template<typename T>
bool updMax(T& tmax, const T& x) {
if (x > tmax) { tmax = x; return true;... | ALGO | 0.999925 | 4.778964 | {
"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": "677f99ca67... |
31a176c8-7299-4047-99a5-146566b93fb7 | CodeFarmsInc/Layout | incode/alib/doc/ctut/tmp/products.h |
// -------- data structure SINGLY LINKED RING ---------------
// EQUIVALENT OF:
// template <class Node> class products_Ring1
// ----------------------------------------------------------
#ifndef ZZ_products_RING1_INCLUDED
#define ZZ_products_RING1_INCLUDED
class Product;
typedef int (*ZZsortFun)(const void *, const ... | TOOL | 0.99824 | 5.023334 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-03-03T19:45: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": "b0fdfbfc2b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.