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 |
|---|---|---|---|---|---|---|---|
7499a2c5-0511-431c-ae49-9d6c497a7942 | ishandutta2007/codeforces-e | enkognit/normal/1476/C.cpp | #include <bits/stdc++.h>
//#include <random>
//#include <ctime>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("avx2")
typedef long long ll;
typedef long double ld... | ALGO | 0.999891 | 4.255087 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:34: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": "7bf5ca5fb184... |
689de27c-ce70-4dbb-86b9-74eafe734fa4 | papaboo/Bifrost3D | core/Bifrost/Bifrost/Math/Distribution1D.h | // Bifrost 1D distribution.
// ------------------------------------------------------------------------------------------------
// Copyright (C) Bifrost. See AUTHORS.txt for authors.
//
// This program is open source and distributed under the New BSD License.
// See LICENSE.txt for more detail.
// ---------------------... | ALGO | 0.997135 | 6.802795 | {
"github_metadata": {
"branch": "master",
"commit_count": 2535,
"repo_created_at": "2015-11-04T19:59:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 28,
"forks": 6,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "41eb0c... |
6975bfcb-1bcf-432a-8e02-1a4f2bde79e7 | Kiterai/compro-template | tool.cpp | #include <iostream>
#include <fstream>
#include <format>
#include <filesystem>
using namespace std;
namespace fs = filesystem;
string mls(string s){
string t;
auto it = s.begin();
while(it < s.end()){
auto it2 = find(it, s.end(), '\n');
t += format("\"{}\",\n", string_view(it, it2));
... | TOOL | 0.902332 | 4.071258 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2023-02-19T05:10: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": "3c89da07e1... |
1ce328c7-6ff8-4807-a018-d42613c69f92 | escape0707/usaco_trainings | namenum.cpp | /*
ID: totheso1
LANG: C++14
TASK: namenum
*/
#include <experimental/array>
#include <fstream>
#include <iterator>
using namespace std;
static ifstream fin("namenum.in");
static ifstream fdict("dict.txt");
static ofstream fout("namenum.out");
template <typename T>
T fin_get() {
return *istream_iterator<T>(fin);
}
... | ALGO | 0.995982 | 4.536791 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2020-03-24T03:08:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a00405dcf... |
e7f4b547-f741-4c5b-a861-869f60bc08aa | ishandutta2007/codeforces-s | savinov/normal/618/D.cpp | #include <bits/stdc++.h>
#define clr(x) memset((x), 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp make_pair
#define in(x) int (x); input((x));
#define x first
#define y second
typedef int itn;
//#define next next12345
//#define prev prev12345
#define left lefdsf232
#define right ... | ALGO | 0.998999 | 3.520906 | {
"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": "5eaef215113a... |
0887b626-3a78-48e3-9bad-abab7a0936ec | AshishYUO/huffman-compression | huffman-compression.cpp | #include <cstdio>
#include <fstream>
#include <iostream>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <chrono>
#define ll unsigned long long int
/**
* @brief Huffman compression namespace
*/
namespace Huffman {
std::string HuffmanValue[256] = {""};
/// @brief structure fo... | ALGO | 0.99891 | 4.527769 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2019-04-24T07:36:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 6,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "2bd3d4ed... |
ea344165-500c-461d-81b8-a21deda4432f | rehanashraf/CodingPractice | C++/src/string/longestsubstring.cpp | //
// longestsubstring.cpp
// leetcodeXcode
//
// Created by <NAME> on 11/29/19.
// Copyright © 2019 <NAME>. All rights reserved.
//
/*
Given a string, find the length of the longest substring without repeating characters.
Example 1:
Input: "abcabcbb"
Output: 3
Explanation: The answer is "abc", with the len... | ALGO | 0.999202 | 4.916015 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2019-09-26T05:57: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": "4d1bde8a5... |
bcc94a5e-2726-43ef-b718-8af6c3eb9e62 | devangrajarora/competitive-programming | Codeforces/Practice/1108D.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define MOD 1000000007
#define fi first
#define se second
#define rep(i,a,b) for(ll i = a ; i <= b ; i++)
#define rfor(i,n,a) for(ll i = n ; i >= a ; i--)
#define pb push_back
#define endl "\n"
#define vi vector<ll>
#define fastio ... | ALGO | 0.999954 | 3.558814 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2021-03-18T09:47:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "0a0aae6266e... |
837693da-f03b-43ac-a5d5-1ec517edd304 | yhsim98/PS- | BaekJoon/연구소3.cpp | //https://www.acmicpc.net/problem/17142
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <deque>
#include <tuple>
#include <list>
#include <set>
#include <cmath>
#include <stack>
#include <map>
//#include<bits/stdc++.h>
#include<cstdio>
using namespace std;
#def... | ALGO | 0.99991 | 3.963789 | {
"github_metadata": {
"branch": "master",
"commit_count": 218,
"repo_created_at": "2020-11-05T15:26: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": "8d2663b0... |
d34310c3-6307-4574-aa93-ad1c0d5b4de5 | Parvejprv/CPP-DSA-180-Days | Day 086 Subsequence/class practices/substrings.cpp |
/*
Queston: WAP to print the substrings of a string with the help of recursion.
*/
#include<iostream>
#include<vector>
using namespace std;
void printSubstrings(string &s, int index, int n, vector<string>& ans, string &temp){
if(index == n){
ans.push_back(temp);
return;
}
// Not included
printSubst... | ALGO | 0.998839 | 5.956758 | {
"github_metadata": {
"branch": "main",
"commit_count": 214,
"repo_created_at": "2024-03-13T11:26:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd251b8c92... |
75ddb1b3-1aa5-4942-9406-6e3079b43dce | mayank171/leetcode | 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlin... | class dsu
{
vector<int> parent;
vector<int> size;
vector<int> time;
int sz;
public:
dsu(int s)
{
sz=s;
for(int i=0;i<sz;i++)
{
parent.push_back(i);
size.push_back(1);
time.push_back(0);
}
}
int findPar... | ALGO | 0.999998 | 5.353365 | {
"github_metadata": {
"branch": "main",
"commit_count": 3858,
"repo_created_at": "2021-12-24T06:36:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50075654b... |
e43fab16-fdfc-40b6-8f53-ba7be0f5724a | tanminhtran168/APPLIED_ALGORITHM_REPO | CVRPOPT.cpp | #include <bits/stdc++.h>
#define MAX 30
using namespace std;
int N; /// the number of customers
int K; /// the number of trucks
int Q; /// the capacity of each truck
int d[MAX]; /// d[i]: the demand for load of customer i
int c[MAX][MAX]; /// c[i][j]: the cost travel from client i to client j
int cost; /// the to... | ALGO | 0.999882 | 3.510115 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-07-13T03:33:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf29da411... |
9b21a1a9-6ce7-420a-822d-40fc979c5f59 | wissem18/LeetCode-Solutions | 2196-create-binary-tree-from-descriptions/2196-create-binary-tree-from-descriptions.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.999962 | 5.885919 | {
"github_metadata": {
"branch": "main",
"commit_count": 2325,
"repo_created_at": "2023-04-23T17:45:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b657e2c6a... |
c638b0d3-5b30-44f3-9d5e-31c4fb06b1eb | sjm150/ps | baekjoon/contest/1471/f.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0); ios_base::sync_with_stdio(0);
typedef pair<int, int> pi;
const int mod = 998244353;
int n, q;
cin >> n >> q;
vector<vector<int>> a(n, vector<int>(n));
for (auto &a: a) {
for (int &a: a) cin >> a;
}
vector... | ALGO | 0.999887 | 4.611746 | {
"github_metadata": {
"branch": "main",
"commit_count": 800,
"repo_created_at": "2023-02-14T08:02: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": "597fb0b7fd... |
68b64b07-30e3-45c2-837c-411ddc088582 | wuxingyu1983/HackerRank | KunduAndTree/main.cc | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
#define DEBUG 0
#define MOD 1000000007
int getRoot(vector<int> &id, int i)
{
while (i != id[i])
... | ALGO | 0.999884 | 4.103239 | {
"github_metadata": {
"branch": "master",
"commit_count": 452,
"repo_created_at": "2017-02-13T06:00: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": "fe3b94b2... |
b46bb855-7ffa-4bc9-b669-4da1b332e3ee | Garden-of-Avalon/alp-cpp | 201-300/241-Different_Ways_to_Add_Parentheses-m.cpp | // Given a string of numbers and operators, return all possible results from
// computing all the different possible ways to group numbers and operators. The
// valid operators are +, - and *.
// Example 1
// Input: "2-1-1".
// ((2-1)-1) = 0
// (2-(1-1)) = 2
// Output: [0, 2]
// Example 2
// Input: "2*3-4*5"
// ... | ALGO | 0.999886 | 6.847604 | {
"github_metadata": {
"branch": "main",
"commit_count": 614,
"repo_created_at": "2017-07-17T22:52:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "69d4bfce2f1... |
5fa232a0-9824-47c7-acd1-709eee261a59 | MAZHARMIK/Interview_DS_Algo | Bit_Magic/Maximum XOR of Two Numbers in an Array.cpp | /*
MY YOUTUBE VIDEO ON THIS Qn : https://www.youtube.com/watch?v=JS48Hp2_Z4I
Company Tags : Microsoft
Leetcode Link : https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array/
*/
/******************************************************** C++ ************************... | ALGO | 0.999945 | 6.34234 | {
"github_metadata": {
"branch": "master",
"commit_count": 5946,
"repo_created_at": "2020-07-12T13:13:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2586,
"forks": 1357,
"issues": 7,
"pull_requests": 37
},
"file_meta": {
"content_id": "... |
1a534f20-b784-4e5c-b4c0-fb12ace383c4 | dreyus95/AVSP_SourceQualityPrediction | CodeJamCrawler/dataset/08_23895_25.cpp | #include <cstdio>
#include <cstdlib>
#include <math.h>
#include <cmath>
#include <string>
#include <vector>
#include <iostream>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <sstream>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define SZ(x) (int)(x.size())
#defi... | ALGO | 0.999829 | 4.135341 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2017-06-08T21:00:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fee08719a... |
e14a9826-40b7-4cbb-b414-0b1134c08ac1 | developer-diganta/C-plus-plus-programs | bst.cpp | #include <iostream>
#include<climits>
#include<algorithm>
#include<queue>
using namespace std;
class node{
public:
int data;
node*left;
node*right;
node(int d){
data = d;
left = NULL;
right = NULL;
}
};
//Accepts the old root node & dat... | ALGO | 0.999978 | 4.810171 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2021-03-08T19:13:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc7f25e43d9... |
3ac073eb-8857-472d-b8c3-7cb25531eba4 | liupengzhouyi/LeetCode | befor202000605/014EraseOverlapIntervals/EraseOverlapIntervals.cpp | //
// Created by 刘鹏 on 2020/1/21.
//
#include <iostream>
#include "EraseOverlapIntervals.h"
int EraseOverlapIntervals::eraseOverlapIntervals(std::vector<std::vector<int>> &intervals) {
if (intervals.size() == 0 || intervals.size() == 1) {
return 0;
} else {
for (int i = 0; i < intervals.size()... | ALGO | 0.998898 | 4.979377 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2019-12-20T14:37: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": "d4c1c325f... |
76016d76-7a97-48c7-89e4-33547d5fb565 | tddPractice/BackJoon_Algorithm | 2096_내려가기/goingDown.cpp | /*
2018 Apr 7, made by Moon
*/
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n, a, b, c;
int minDP[3] = { 0 }, maxDP[3] = { 0 };
int tmp[3] = { 0 };
scanf("%d", &n);
scanf("%d %d %d", &a, &b, &c);
minDP[0] = a; maxDP[0] = a;
minDP[1] = b; maxDP[1] = b;
min... | ALGO | 0.999986 | 3.500439 | {
"github_metadata": {
"branch": "master",
"commit_count": 358,
"repo_created_at": "2017-12-19T07:11:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 5,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "83484ecf6... |
cfb76477-8dd7-4c51-be62-87a06118312e | fja0kl/LeetCode-Path | CodingInterviews/数组中的逆序对/solution.cpp | class Solution {
public:
int InversePairs(vector<int> data) {
if (data.empty()) return 0;
vector<int> copy(data.begin(), data.end());
return inversePairsCore(data, copy, 0, data.size()-1);
}
// 归并排序,同时完成逆序数统计:data也发生了修改(中间状态),copy最终结果
int inversePairsCore(vector<int>& data, vecto... | ALGO | 0.999992 | 4.904323 | {
"github_metadata": {
"branch": "master",
"commit_count": 204,
"repo_created_at": "2018-05-10T03:04: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": "9e57a87d... |
04180bcf-fb41-445c-9c66-9ebb72f4cc43 | itshirdeshk/180-Days-of-DSA | Day 107 - OOPs - 6/Code/code.cpp | #include <iostream>
#include<vector>
using namespace std;
class Area
{
public:
// Function Overloading
int calcArea(int r)
{
// Circle
return 3.14 * r * r;
}
int calcArea(int l, int b)
{
// Rectangle
return l * b;
}
};
class Complex
{
int real, img;
pu... | TOOL | 0.938093 | 5.382423 | {
"github_metadata": {
"branch": "main",
"commit_count": 276,
"repo_created_at": "2023-09-19T01:59:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 19,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8cdcabba... |
cf057170-1f9e-4157-9666-65204bdcbdae | tonywilliams1990/TSL | Examples/Problems/Rayleigh.cpp | /// Solving the Rayleigh equation //TODO - description
#include <cassert>
#include "Core"
#include "Eigenvalue"
#include "Rayleigh.h"
// enumerate the variables in the ODE
enum {phi, phid };
namespace TSL
{
namespace Problem
{
// Base flow in the complex plane
OneD_node_mesh< std::complex<double>, std::... | ALGO | 0.999903 | 4.614517 | {
"github_metadata": {
"branch": "master",
"commit_count": 120,
"repo_created_at": "2016-08-05T15:45: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": "1a50327f... |
82576a91-ec97-4f8a-a2b8-4de42b0387af | P-SUBHAM/LeetCode | Difficulty: Medium/Search Pattern (Rabin-Karp Algorithm)/search-pattern-rabin-karp-algorithm.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
// RabinKarp Algorithm using rolling hash
public:
int modexp(int b, int x, int p) {
if(x == 0) return 1;
if(x == 1) return b;
long long ans = modexp(b,x/2,p);
... | ALGO | 0.999522 | 6.092956 | {
"github_metadata": {
"branch": "main",
"commit_count": 1834,
"repo_created_at": "2022-06-10T18:59:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5ba40e4a... |
7d4a06fa-6354-4bb0-b515-fe96e32d2a29 | DBGroup-SUSTech/reverse-k-ranks | src/include/alg/SVD.hpp | //
// Created by BianZheng on 2022/3/1.
//
#ifndef REVERSE_KRANKS_SVD_HPP
#define REVERSE_KRANKS_SVD_HPP
#include <cassert>
#include <filesystem>
#include <armadillo>
#include <memory>
#define ARMA_ALLOW_FAKE_GCC
#include "alg/SpaceInnerProduct.hpp"
#include "struct/VectorMatrix.hpp"
namespace ReverseMIPS {
cl... | DATA | 0.991047 | 6.000554 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2023-12-15T10:15:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a3d337782... |
f2e99a67-b3bf-4f00-b79f-e471fcf062fc | prakharss/C-plus-plus-Programs | trie/hotel reviews IB (similiar to insertion and searching).cpp | #include<bits/stdc++.h>
using namespace std;
struct TrieNode{
bool end;
TrieNode *nextchar[26];
};
TrieNode* createNode()
{
TrieNode *n;
n=new TrieNode;
n->end=false;
for(int i=0;i<26;i++)
n->nextchar[i]=NULL;
return n;
}
void insert(TrieNode *root,string str)
{
for(int i=0;i<str.size();i++)
{
if(ro... | ALGO | 0.999176 | 3.351155 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-04-13T06:44:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6d87ad2dd... |
d5e6df53-65ee-4dcc-837a-c4b2db55270f | xushaoxiao/allinone-via-bazelmod | leetcode_cpp/src/test/cpp/0031.next_permutation/next_permutation_test.cc | // Copyright 2023, <NAME> who a personal development. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless... | TEST | 0.96606 | 6.712008 | {
"github_metadata": {
"branch": "main",
"commit_count": 185,
"repo_created_at": "2023-02-15T15:24:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 10
},
"file_meta": {
"content_id": "c74a3eeda... |
e269ddcc-2d7a-45dd-8649-ffa8acdac0a9 | jpablolucero/neo | include/NLPSCPreconditioner.templates.h | #include <NLPSCPreconditioner.h>
extern std::unique_ptr<dealii::TimerOutput> timer ;
extern std::unique_ptr<MPI_Comm> mpi_communicator ;
namespace
{
namespace NLWorkStream
{
template <int dim, typename SystemMatrixType, typename VectorType, typename number, bool same_diagonal>
cla... | ALGO | 0.981425 | 5.998499 | {
"github_metadata": {
"branch": "master",
"commit_count": 337,
"repo_created_at": "2019-11-28T15:36:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4caf7cb9... |
038c0d9e-72b0-43c7-aff5-845cc6b8796d | presmihaylov/Software-University-Courses | specialised-courses/Algorithms/04.DynamicProgramming/07.ConnectingCables/ConnectingCables.cpp | #include <iostream>
#include <stack>
#define MAX_DATA 100
using namespace std;
#ifndef _FUNCTION_PROTOTYPES
int FindMaxConnectedPairs();
int FindMaxConnectedPairsPrivate(int upperMin,
int upperMax,
int lowerMin,
int l... | ALGO | 0.999686 | 3.87031 | {
"github_metadata": {
"branch": "master",
"commit_count": 146,
"repo_created_at": "2014-10-15T15:54:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "567bcf3a... |
267c197d-2d19-4373-bf53-aa272c99b061 | Seajal222/cpp | sum using constructor overloading.cpp | //display sum of two integer values, sum of two float values, two char values using constructor overloading
#include <iostream>
using namespace std;
class SumCalculator {
public:
// Constructor for two integers
SumCalculator(int a, int b) {
cout << "Sum of integers: " << (a + b) << endl;
}
//... | TOOL | 0.947415 | 5.958779 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-10-24T06:49: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": "629f5cf6a9f... |
95995b7a-131b-4e45-8af5-bbc1261bed83 | Mylothros/Codingame | Solutions/Defibrillators Solution.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
string LON;
cin >> LON;
cin.ignore();
string LAT;
cin >> LAT;
cin.ignore();
int N;
cin >> N; cin.ignore();
string search=",";
string replace=".... | ALGO | 0.999844 | 3.729055 | {
"github_metadata": {
"branch": "master",
"commit_count": 112,
"repo_created_at": "2020-03-03T15:37: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": "ebb2ff94... |
22743018-e0e2-4df3-87f1-5fb1fe824023 | sp-nitech/SPTK | third_party/Snack/sigproc.cc | /*
* This software has been licensed to the Centre of Speech Technology, KTH
* by Microsoft Corp. with the terms in the accompanying file BSD.txt,
* which is a BSD style license.
*
* "Copyright (c) 1990-1996 Entropic Research Laboratory, Inc.
* All rights reserved"
*
* Written by: <NAME>
... | ALGO | 0.99854 | 6.560361 | {
"github_metadata": {
"branch": "master",
"commit_count": 939,
"repo_created_at": "2017-09-13T01:15:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 237,
"forks": 27,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74e0e9... |
cdd50d39-665b-42b9-b389-4d6eaf9d6e4d | ektagarg786/Coding-Ninjas-CP | Segment_Tree/Horrible_queries.cpp | /*World is getting more evil and it's getting tougher to get into the Evil League of Evil. Since the legendary Bad Horse has retired, now you have to correctly answer the evil questions of Dr. Horrible, who has a PhD in horribleness (but not in Computer Science). You are given an array of N elements, which are initiall... | ALGO | 0.999307 | 5.264699 | {
"github_metadata": {
"branch": "master",
"commit_count": 150,
"repo_created_at": "2020-03-17T13:54:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "f71326e7... |
f22b36e0-065c-4521-b1cb-9626eb294d56 | lgeorget/adventofcode2020 | 14/2.cpp | #include <iostream>
#include <fstream>
#include <regex>
#include <unordered_map>
#include <vector>
#include <string>
#include <string_view>
#include <numeric>
struct AltMask {
uint64_t negative = (uint64_t{1} << 37) - 1;
uint64_t positive = uint64_t{0};
};
using Memory = std::unordered_map<uint64_t, uint64_t>;
usin... | ALGO | 0.950499 | 5.127641 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2020-12-03T17:30: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": "f448456cb0c... |
62e521fd-0641-4329-9abe-32f28ec61707 | ishandutta2007/codeforces-z | zemen/normal/618/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define sz(x) ((int) (x).size())
#define forn(i,n) for (int i = 0; i < int(n); ++i)
#define forab(i,a,b) for (int i = int(a); i < int(b); ++i)
typedef long long ll;
typedef long double ld;
const int INF = 1000001000;
const ll INFL = 2000000000000001000;
int solve();
i... | ALGO | 0.999709 | 3.764871 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:43:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "80f9ada63f21... |
1ac9ccff-2445-4564-b9ac-82b52b911d05 | ishandutta2007/codeforces-z | zeliboba/normal/288/A.cpp | #include <cstdio>
#include <cstdlib>
#include <cassert>
#include <iostream>
#include <set>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <complex>
#include <map>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<l... | ALGO | 0.999089 | 3.066609 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:43:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "347c633c02cb... |
ae83f018-a2b7-4d9f-9678-e0f749dc01aa | Vladylcew/StudyCPP | Matrix/main.cpp | #include <iostream>
#include "matrix.cpp"
using namespace std;
template<typename T, size_t HeightCap, size_t WidthCap, class Alloc = MyAll<T>>
Matrix<T, WidthCap, HeightCap, Alloc> Transpose(Matrix<T, HeightCap, WidthCap, Alloc>&& tmp)
{
Matrix<T, WidthCap, HeightCap, Alloc> result;
for (int i = 0; i < Heigh... | ALGO | 0.986349 | 3.944186 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2022-09-08T22:19: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": "70125af7f38... |
251d6749-7afc-4407-b9ba-1268d7d65f1e | yiGmMk/coding-practicing | cpp/1371.每个元音包含偶数次的最长子字符串.cpp | /*
* @lc app=leetcode.cn id=1371 lang=cpp
*
* [1371] 每个元音包含偶数次的最长子字符串
*/
// @lc code=start
#include"leetcode.h"
class Solution {
public:
int findTheLongestSubstring(string s) {
int ans = 0, status = 0, n = s.length();
vector<int> pos(1 << 5, -1);//32 number
pos[0] = 0;
for (int ... | ALGO | 0.99987 | 5.953724 | {
"github_metadata": {
"branch": "master",
"commit_count": 656,
"repo_created_at": "2020-05-17T14:31:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 9
},
"file_meta": {
"content_id": "c23e54e5... |
08b5f6a4-8619-469b-948a-ac29cfbe1de6 | piyush1146115/Competitive-Programming | Uva Oj/11398 The Base-1 Number System.cpp | /*#include<bits/stdc++.h>
using namespace std;
int main()
{
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
long long int flag, i, j, k, ans, m, c = 0;
double temp;
string s, bin;
while(cin >> s){
if(s == "~")
break;
if(s == "#"){
... | ALGO | 0.999966 | 3.079222 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2019-09-30T18:09:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "76c6f84fd... |
15c2f37e-e2e4-48d7-959e-dcb24bb288b0 | arvindk99/Cpp | DataStructures with C++ pt2/Lab6-HashTables/Lab6-MakeupLab/HashMap.h | //
// HashMap.h
// Lab6-Makeup
// <NAME> ID:20372024
//
#ifndef HashMap_h
#define HashMap_h
#include "HashNode.h"
#include "Person.h"
#include <iostream>
#include <string>
class HashMap
{
private:
//initializing array
HashNode<Person> *table;
int hashSize;
int collisions;
int hashKey;
public:
//setting a max ... | ALGO | 0.959307 | 4.442513 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-03-26T20:33: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": "b6ef6c6859... |
f94a261c-b81d-4f01-8692-517bc2c17e61 | deviant7/SoC-CP | Linked_lists.cpp | // #include<iostream>
// #include<string>
// #include<vector>
#include<bits/stdc++.h>
using namespace std;
#define head node<string>::Head
#define tail node<string>::Tail
template<typename T>
class node{
public:
T data;
node* next;
static node* Head;
static node* Tail;
node(T val){
da... | ALGO | 0.999201 | 3.645213 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-06-07T17:09: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": "64433bd4069... |
ddb7a43d-ce03-4582-8325-5ec7d2bade2f | akhikolla/testpackages | fuzzedpackages/BMTME/src/Sample_IW.cpp | // [[Rcpp::interfaces(r, cpp)]]
// [[Rcpp::depends(RcppArmadillo)]]
// [[Rcpp::plugins("cpp11")]]
#include <RcppArmadillo.h>
// [[Rcpp::export]]
arma::mat wishart(unsigned int df, const arma::mat& S ){
// Dimension of returned wishart
unsigned int m = S.n_rows;
arma::mat Z(m, m, arma::fill::zeros);
arma::mat... | ALGO | 0.997916 | 6.21835 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-01-15T17:42:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "649cc58c34... |
6d6fbc21-77fe-4094-8993-c9e4d8669183 | komxun/Cpp-in-21-days-Part3 | Day 9 - References/returning_multiple_values_with_Pointers.cpp | // Listing 9.8 - Returning multiple values from a function
# include <iostream>
using namespace std;
short Factor(int n, int *pSquared, int *pCubed);
int main()
{
int number, squared, cubed;
short error;
cout << "Enter a number (0 - 20): ";
cin >> number;
error = Factor(number, &squared, &cubed)... | TOOL | 0.919176 | 5.635658 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2023-06-18T17:33:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63fc72ec18b... |
8ccba53d-ebb3-4bc2-9d69-1e759b6ba263 | csus4uwu/sync2024 | sol/Atcoder/abc381_d.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
auto work = [&](int x) -> int {
int res = 0;
int st = x -... | ALGO | 0.999875 | 3.993326 | {
"github_metadata": {
"branch": "main",
"commit_count": 829,
"repo_created_at": "2024-03-03T00:44: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": "4a3778d3da... |
a8eaccf6-a3e0-4926-b72c-4768af3c175e | MagicaQuartet/algorithm | baekjoon/7469.cpp | #include<cstdio>
#include<vector>
#include<algorithm>
#include<utility>
using namespace std;
#define vi vector<int>
#define pii pair<int, int>
int n, m, i, j, k;
int arr[100010];
vi seg[400010];
vi merge(vi& vLeft, vi& vRight) {
vi ret;
ret.reserve(vLeft.size()+vRight.size());
int lidx, ridx;
lidx = ridx = 0;
... | ALGO | 0.999998 | 4.34414 | {
"github_metadata": {
"branch": "master",
"commit_count": 257,
"repo_created_at": "2019-08-30T13:11: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": "2a26e60a... |
011fdc09-c775-40b0-bedc-b9b69af34e7a | yusuufaslan/Daily-LeetCode-Solutions | june/mid-level/snapshot_array_1146.cpp | /*
@author: yusuufaslan
@date: 11.06.2023
@problem: 1146. Snapshot Array
*/
class SnapshotArray {
public:
vector<map<int,int>>A;
// snap_id
int s_id = 0;
SnapshotArray(int length) {
// resizing the array to the given length
A.resize(length);... | ALGO | 0.970728 | 6.040937 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-06-03T11:11:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1ce295abf7... |
c6269ef8-53f3-450c-8cb2-16cee128cfb5 | HRF05/DMOJSolutions | ccc16j4.cpp | #pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long long unsigned llu;
typedef pair<int,int> pii;
typede... | ALGO | 0.995365 | 4.286819 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2022-08-10T03:36: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": "727e7e19a5c... |
d66ec3a2-2357-4e64-84c3-9e4d895016b9 | infinity-machine/calc_utils | Main.cpp | #include <iostream>
#include "../include/Polynomial.h"
#include <vector>
#include <map>
#include "LogFunction.h"
#include "ReciprocalFunction.h"
#include "Fraction.h"
#include <numeric>
void divider()
{
std::cout << "- - - - - - - -" << std::endl;
}
int main()
{
// Polynomial poly1({{1, 3}, {2, 2}, {1, 1}});
... | TOOL | 0.967303 | 4.483534 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2024-12-27T06:42: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": "278bdd85a56... |
2350cb53-cfea-4517-b72a-a3f269d56442 | bloodbine/42CPP | CPP09/ex02/main.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: ... | TEST | 0.913611 | 5.422222 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2023-08-08T13:19:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b34e23635... |
3205d2b7-09ff-427c-bc20-304f294b261d | gembancud/CompetitiveProgramming | hackerrank/savethequeen/a.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k;
cin >> n >> k;
vector<int> v;
for (int i = 0; i < k; i++)
{
int q;
cin >> q;
v.push_back(q);
}
sort(v.begin(), v.end(), greater<int>());
auto on = accumulate(v.begin(), v.begin() + n, 0.0);
... | ALGO | 0.999767 | 3.913996 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-12-08T07:20: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": "1149ef855f... |
46954482-6adf-4547-afb3-14104feeb7cf | xSeanliux/CompetitiveProgramming | TIOJ/1940/1940.cpp | #include <iostream>
#include <vector>
using namespace std;
const int maxN = 129;
int sg[maxN], k, n;
inline int getMex(vector<int> v){
bool has[maxN + 10];
for(int i = 0; i <= maxN; i++) has[i] = 0;
for(int x : v) has[x] = true;
for(int i = 0; i <= maxN + 1; i++){
if(!has[i]) return i;
}
... | ALGO | 0.999931 | 4.13705 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2018-11-18T06:45: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": "c02ab40bb... |
caf6e6a1-ec29-47ac-ac1b-f54363b2cbdf | Ishaan1742/CS2705-Programming-And-Data-Structures | A2/q3.cpp | #include<bits/stdc++.h>
using namespace std;
#define INF 1000000
struct Node
{
int data;
Node* left;
Node* right;
Node* parent;
Node(int data)
{
this->data = data;
left = NULL;
right = NULL;
parent = NULL;
}
};
void level_order(Node* root)
{
queue<Node... | ALGO | 0.999991 | 4.073633 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-08-09T11:35:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "976f02f6783... |
5edc625c-026f-40d8-b835-26630359ca4f | Shuja29/Tic_Tac_Toe | Tic_Tac_Toe.cpp | #include<iostream>
using namespace std;
char board[3][3]={'1','2','3','4','5','6','7','8','9'};
void show_board();
void get_x_player_choice();
void get_o_player_choice();
void player_vs_player();
void check_winner();
int main(){
show_board();
get_x_player_choice();
get_o_player_choice();
return 0;
}
void show_board... | ALGO | 0.998026 | 4.107365 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-04-01T09:55: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": "8d62ccda848e... |
bf14e5b6-8d04-495f-90f5-a48a3f5b19be | grommunio/gromox | exch/midb/cmd_parser.cpp | // SPDX-License-Identifier: GPL-2.0-only WITH linking exception
// SPDX-FileCopyrightText: 2021–2025 grommunio GmbH
// This file is part of Gromox.
#include <climits>
#include <condition_variable>
#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <memory>
#include <mutex>
#include <pol... | TOOL | 0.9354 | 4.283786 | {
"github_metadata": {
"branch": "prime",
"commit_count": 10912,
"repo_created_at": "2021-02-12T20:05:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 212,
"forks": 50,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "4cc40... |
e12c0d6c-ff62-4dd9-b84d-f22dd944faa2 | ryotaro612/at_c | src/abc293/c.cc | #ifndef ONLINE_JUDGE
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define as_int(a) static_cast<int>(a)
void rec(int r, int c, vector<vector<int>> &m, set<in... | ALGO | 0.999453 | 4.651876 | {
"github_metadata": {
"branch": "master",
"commit_count": 2006,
"repo_created_at": "2019-07-01T03:51: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": "7760e2b... |
0e4ed070-1e27-42b0-894e-175fba535cc5 | roytam1/UXP | media/highway/src/hwy/contrib/sort/vqsort.h | // Copyright 2022 Google LLC
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless requ... | ALGO | 0.99926 | 7.741977 | {
"github_metadata": {
"branch": "tracking",
"commit_count": 6357,
"repo_created_at": "2019-02-14T04:17:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 59,
"forks": 12,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "e0c... |
eee77d2d-bcfc-41c3-ad0f-8eaedcb13e69 | nitin-dhakad/DSA | Striver'sSDESheet/arrays/pascalsTraingle.cpp | /*https://leetcode.com/problems/pascals-triangle/
*/
#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> pascalTraingle(int n)
{
vector<vector<int>> arr(n);
for (int i = 0; i < n; i++)
{
arr[i].resize(i + 1);
for (int j = 0; j < i + 1; j++)
{
if (i == 0 ||... | ALGO | 0.999995 | 5.556748 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2022-06-02T07:23:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "95fa73d0833... |
01055dfb-a1ce-437d-9169-868acec867cb | Dreamgoing/hihocode | 1121.cpp | //
// Created by 王若璇 on 16/3/11.
//
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
using namespace std;
const int max_n = 10100;
const int max_m = 40400;
int color[max_n]={0};
vector<int> graph[max_n];
void init(int n){
for(int i = 0;i<=n;i++){
graph[i].clear... | ALGO | 0.999733 | 3.464735 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-04-08T08:47:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6aa2539624... |
cb3d4324-0728-40e1-8b24-953e401cccb5 | wuyuhang05/My-OI-Code | CF/500E.cpp | /*
* sto Qingyu orz
* 感谢真神sqy无私的教诲。膜时队者处处阿克,只因大师sqy在他背后。不膜大师者违背了真神的旨意,真神必将降下天谴,
* 使其天天爆零
* 我不由自主地膜拜真神sqy。
* Author: RainAir
* Time: 2019-10-21 09:55:30
*/
#include <algorithm>
#include <iostream>
#include <cstring>
#include <climits>
#include <cstdlib>
#include <cstdio>
#include <bitset>
#include <vector>
#inclu... | ALGO | 0.999959 | 4.211327 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2018-06-03T12:18:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7862f5ec... |
e119d713-2136-46ae-a62a-2b2ce0f9dc84 | ishandutta2007/codeforces-y | yuu/normal/933/C.cpp | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
const double eps=1e-6;
class point{
public:
double x, y;
point(double x=0, double y=0): x(x), y(y){}
void input(){
cin>>x>>y;
}
bool same(point P){
return (fabs(x-P.x)<eps)&&(fabs(y-P.y)<eps);
}
point operator + (const point& p) const {retur... | ALGO | 0.999707 | 4.098032 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:40:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb03660ed055... |
90946267-cf01-4a72-8198-6727f32ccdf0 | minhmax098/EmbeddedSystem_Exercise | Chuong3-Bai5/Chuong3-Bai5.ino | //Bài tập 5: thay đổi bài tập 3 sao cho đèn sáng ở cả hai đầu
//Gặp nhau ở giữa và quay ngược lại
// 2 đầu sáng, tiếp đến giữa sáng rồi tắt và ngược lại
int ledPin[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
void setup()
{
for (int i=0; i<10; i++)
{
pinMode(ledPin[i],OUTPUT); //Các chân LED là OUTPUT
digitalW... | ALGO | 0.976488 | 3.469346 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-01-08T16:11: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": "9f38baaeee... |
f128352a-f2df-4071-bb90-021113ada24c | IgnAMS/ICPC | Ejercicios/Ladder/Matematica/Line.cpp | #include<bits/stdc++.h>
using namespace std;
#define repx(i,a,b) for(int i=a; i<b; i++)
#define rep(i,n) repx(i,0,n)
typedef long long ll;
typedef pair<int,int> ii;
typedef double db;
typedef vector<ll> vi;
typedef pair<ll, ll> pll;
#define ff first
#define ss second
// g++ -std=c++11 A.cpp -o a && a <input.txt> output... | ALGO | 0.999987 | 4.190042 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2021-05-19T20:12:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e9e0374ac... |
6e8a5456-7270-4ebd-ba5f-a83da7ce07d7 | erickingcs/algorithm | leetcode/same_tree.cpp | /*
Same Tree
Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally identical
and the nodes have the same value.
*/
#include <iostream>
#include <queue>
using namespace std;
//Definition for binary tree
struct TreeNode {
... | ALGO | 0.999858 | 6.561228 | {
"github_metadata": {
"branch": "master",
"commit_count": 156,
"repo_created_at": "2013-10-18T13:29:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fee69b89... |
503e6b8c-8e5a-4506-b28a-6f45c362bc28 | Prashantkumar210/GeeksForGeeks | Difficulty: Easy/Move Last Element to Front of a Linked List/move-last-element-to-front-of-a-linked-list.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
struct Node* next;
Node(int x) {
data = x;
next = NULL;
}
};
void printList(Node* head) {
Node* temp = head;
while (temp != NULL) {
printf("%d ", t... | ALGO | 0.999588 | 5.686511 | {
"github_metadata": {
"branch": "main",
"commit_count": 292,
"repo_created_at": "2023-10-31T06:48: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": "a9e07d097d... |
d5db43e6-2bab-45fb-a62c-fd765fa3cda6 | KratosMultiphysics/KratosLegacyApplications | IncompressibleFluidApplication/custom_utilities/levelset_fluid_solver.h | /*
==============================================================================
KratosPFEMApplication
A library based on:
Kratos
A General Purpose Software for Multi-Physics Finite Element Analysis
Version 1.0 (Released on march 05, 2007).
Copyright 2007
<NAME>, <NAME>
<EMAIL>
<EMAIL>
- CIMNE (International Center f... | ALGO | 0.987711 | 3.91029 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2019-10-11T13:25:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aede56062a... |
3cd5b902-9815-4921-8cba-af7ca2bcd92f | BottleIn/Algorithm | 백준/Platinum/3860. 할로윈 묘지/할로윈 묘지.cc | #include <cstring>
#include <algorithm>
#include <queue>
#include <vector>
#include <iostream>
#include <set>
#define endl "\n"
#define MAX 900
#define ll long long
int INF = 987654321;
using namespace std;
typedef pair<int, int> pii;
int W, H, G, E;
int dx[] = { -1,1,0,0 };
int dy[] = { 0,0,-1,1 };
int dis[MAX + 1];
... | ALGO | 0.999816 | 4.087257 | {
"github_metadata": {
"branch": "main",
"commit_count": 89,
"repo_created_at": "2025-05-29T06:56: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": "07f6ab41250... |
53263539-89cb-4a67-8a3e-d095a1e72f1f | llllvvuu/meta-hacker-cup-solver | round1_logs/pass@256/Prime Subtractorization_98.cpp |
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vecto... | ALGO | 0.999613 | 4.084533 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2024-09-03T16:52: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": "c0452e78e84... |
e360346c-0985-465f-ab4f-3da348f3dd7e | TheRakibJoy/Algorithms | Data Structure/Segment Tree/*LOJ - 1085 - All Possible Increasing Subsequences with dp+segTree.cpp | #include<bits/stdc++.h>
using namespace std;
#define sz 100005
#define ll long long
map<int , int>compress;
int n,ara[sz],dp[sz],tree[4*sz];
const int mod = 1e9+7;
///Here, dp[i] means number of sequence we can make by taking a[i] must
void Update(int node,int b,int e,int pos,int val)
{
if(pos<b || pos>e)
... | ALGO | 0.999967 | 4.522728 | {
"github_metadata": {
"branch": "master",
"commit_count": 880,
"repo_created_at": "2021-12-21T07:08:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "081d91c8... |
f04d1476-c402-4800-a5c4-dd3fd3dc0aff | alex031029/LeetCode | interviews/Microsoft/FirstAttempt/Q1-2/answer.cpp | // you can use includes, for example:
// #include <algorithm>
// you can write to stdout for debugging purposes, e.g.
// cout << "this is a debug message" << endl;
int solution(string &S) {
// write your code in C++14 (g++ 6.2.0)
if(S.size()<=2)
return 0;
int ret = 0;
for(int i=0;i<S.... | ALGO | 0.999931 | 4.370937 | {
"github_metadata": {
"branch": "master",
"commit_count": 920,
"repo_created_at": "2019-12-04T06:01:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6aa22cfc... |
7701759b-d274-406c-beba-1fbec973a393 | lorenzo-ferrari/olinfo | src/segtree.cpp | #include <bits/stdc++.h>
using namespace std;
const long long N = (1 << 20);
const long long INF = 1e15;
struct lazySegment {
struct node {
long long sum = 0;
long long min = INF;
long long lazy = 0;
long long sett = INF;
node (long long a = 0, long long b = INF) {
sum = a, min = b, lazy = 0, sett = INF... | ALGO | 0.999894 | 5.086951 | {
"github_metadata": {
"branch": "main",
"commit_count": 195,
"repo_created_at": "2021-06-02T18:22:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "645968837c... |
280fbb9c-8e21-45fb-babf-0fd61938cf85 | eddie0325/leetcode | Problems/846.hand-of-straights/main.cpp | /*
* @lc app=leetcode id=846 lang=cpp
*
* [846] Hand of Straights
*/
// @lc code=start
// #define DEBUG
#include <vector>
#include <algorithm>
#include <unordered_map>
using namespace std;
class Solution
{
public:
bool isNStraightHand(vector<int> &hand, int groupSize)
{
unordered_map<int, int> coun... | ALGO | 0.999797 | 6.077869 | {
"github_metadata": {
"branch": "main",
"commit_count": 124,
"repo_created_at": "2024-05-01T16:29: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": "8a1e9db9f6... |
971e8a06-4073-433c-8393-0f854e1021f9 | AdrianGarridoPantaleon/MPA | 1º/P2/practica2.cpp | #include <iostream>
#include <time.h>
#include <stdlib.h>
using namespace std;
int insercion(int n, int *v)
{
int x, j;
for (int i = 2; i <= n; i++)
{
x = v[i];
j = i - 1;
while ((j > 0) && (v[j] > x))
{
v[j + 1] = v[j];
j -= 1;
}
v[... | ALGO | 0.999458 | 4.121645 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2023-04-22T18:00: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": "9c86d611096... |
bb3f26e2-f220-4466-b065-746bd3155736 | andrey-komarov/labs | 2-algorithms/02-lab-directed-dfs/src/C.2/shortpath.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> order;
vector<bool> used;
vector<int> color;
struct edge
{
int to, w;
edge() {}
edge(int to, int w) : to(to), w(w) {}
};
vector<edge> *g;
void dfs(int v)
{
used[v] = true;
for (size_t i = 0; i < g[v]... | ALGO | 0.999802 | 3.919552 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2012-04-14T12:49:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9de551f97... |
bebc7bb6-e68a-42de-b9a2-1f3c2e5da6f8 | Camithilwen/Code-Cloning-Analysis | src/llm-scripts/testing/Project_CodeNet_experimentation_dataset/data/p03630/s917108142.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define fore(b,c) for(int val0=b;val0<c;val0++)
#define forr(k,c,s) for(int k=c;k<s;k++)
#define pb push_back
#define mmp make_pair
#define oset(T) tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_updat... | ALGO | 0.99972 | 3.864185 | {
"github_metadata": {
"branch": "main",
"commit_count": 243,
"repo_created_at": "2025-06-06T16:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "dad2839845... |
8a6a2ccd-15ea-4da2-8373-4ab2d48fd5bf | Mtaylorr/Competitive-programming-Solutions | Gym/2023-2024 ACM-ICPC Latin American Regional Programming Contest/F.cpp | // Mtaylor
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define endl '\n';
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
void dbg_out() { cerr << ... | ALGO | 0.999982 | 3.960816 | {
"github_metadata": {
"branch": "main",
"commit_count": 1208,
"repo_created_at": "2021-07-28T20:32:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 49,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8a9f828... |
85681a3d-d21c-443c-8efc-1401eca786e7 | LuisSante/Bucket | repositorio auxiliar VSC/Algoritmos y Estructura de Datos/Laboratorio_07_Sante_Taipe_Luis_UNSA_EPCC_AED/bs_tree.cpp | #include <iostream>
#include <stdlib.h>
#include <string.h>
#include <fstream>
using namespace std;
template<class GenericClass>
class NodeQ{
public:
NodeQ* next;
GenericClass element;
NodeQ(){
next = nullptr;
element = 0;
}
NodeQ(GenericClass element){
... | ALGO | 0.996566 | 3.911919 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-04-16T15:31: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": "e32641a8f2de... |
587b0aee-f491-4e47-a369-db074e5c0e1d | OpreaStef97/Data-Structures-C- | DS_CPP/3_Stack_Queues/C8_BalancedParanthesis/main.cpp | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
bool isBalanced(const string& exp) {
stack<int> s;
for(const auto& c : exp) {
if(c == '(' || c == '[' || c == '{') {
s.push(c);
} else {
if(c == ')' && (s.empty() || s.top() != '(')) {
... | ALGO | 0.972439 | 5.989824 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-11-19T09:42: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": "e1054185dd... |
1667b957-f085-4f53-976a-d247205152fe | victor-alves/0-1KnapsackProblem | item.cpp | #include "Item.h"
Item::Item()
:mName("")
,mWeight(0)
,mValue(0)
{
}
Item::Item(const string name, const int weight, const int value)
:mName(name)
,mWeight(weight)
,mValue(value)
{
}
bool operator<(const Item &lhs, const Item &rhs)
{
return lhs.mWeight < rhs.mWeight;
}
Item * readInputFile(ifstream & file, const ... | ALGO | 0.9941 | 4.291029 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-03-04T02:23:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d1aa8db73... |
6db391de-b4f3-4125-bf31-a724973103e0 | BatesThaBeast/DataStructs | Project 6 Hash Tables/Project 6 Hash Tables/HashTable.h | /*I need: --ability to print one entry; as in a persons name, its hash value, and phone number--
--read from file the phone number list--*/
#pragma once
#ifndef HASHTABLE
#define HASHTABLE
#include "DoublyLinkedList.h"
#include <vector>
#include <iomanip>
#include <string>
class HashTable
{
private:
/*
Funtion: ... | ALGO | 0.940952 | 4.836684 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-02-17T18:03:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba70a3d87d5f... |
0d1c88ad-1e0b-4051-802a-49f77926421a | butterCR3AMY/USACO | Silver/hoofPaperScissors.cpp | #include <iostream>
using namespace std;
int n, h[100000], p[100000], s[100000], bfor, aftr, ans;
int hB, pB, sB, hA, pA, sAf;
char cur;
int main()
{
freopen("hps.in", "r", stdin);
freopen("hps.out", "w", stdout);
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> cur;
if (i > 0)
... | ALGO | 0.999541 | 3.696984 | {
"github_metadata": {
"branch": "main",
"commit_count": 136,
"repo_created_at": "2022-11-28T03:58: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": "ca09553310... |
e75537a7-b3f2-428c-8d68-18f81c8918c0 | sillysillyman/ps | 백준/Gold/2458. 키 순서/키 순서.cc | #include <iostream>
#include <vector>
using namespace std;
int N;
int cnts[501];
int visited[501];
int orders[501][501];
void dfs(int student, int direction) {
if (visited[student]) return;
visited[student] = true;
for (int i = 1; i <= N; i++) {
if (!visited[i] && orders[student][i] == direction) {
c... | ALGO | 0.999964 | 3.565349 | {
"github_metadata": {
"branch": "main",
"commit_count": 2004,
"repo_created_at": "2023-06-22T20:07:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ea291441... |
b0b627b3-8991-4726-92fc-073af8d9dc22 | coldGingerAle/HackerRank | Algorithms/Implementation/cutTheSticks.cpp | /*
The problem can be found at
https://www.hackerrank.com/challenges/cut-the-sticks
*/
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, min = 2147483647, sticksCut;
cin >> n;
sticksCut = n;
vector<int> arr(n);
for(int arr_i = 0;ar... | ALGO | 0.99998 | 4.080234 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2017-03-04T15:56: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": "e721e63d4... |
5694d1f8-2f6b-4c3f-b48a-41993e76ea65 | SamuellH12/Competitive-Programming-Algorithms | Solutions/Beecrowd/1039 - Flores de Fogo.cpp | #include <bits/stdc++.h>
#define optimize ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define ALL(x) x.begin(), x.end()
#define endl "\n"
#define ll long long
#define vi vector<int>
#define pii pair<int,int>
#define MAXN 110
#define INF 10000010
#define debug cout<<"ate aqui ok\n"
using namespace std;
... | ALGO | 0.999481 | 3.482013 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2022-04-12T18:19:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c8d67d88... |
9047ce1f-b6f9-4a96-b2cb-02fb7d50b6b1 | 20-with-Java/Part_1_FastCampus | Part1_강의자료/Ch07_이분탐색/문제별코드/2343_기타레슨/2343.cpp | #include <stdio.h>
#include <vector>
using namespace std;
bool is_possible(vector<int> &lengths, int video_length, int video_count)
{
int current_length = 0, current_count = 1;
for (auto & len : lengths)
{
if (len > video_length)
return false;
if (current_length + len > video_le... | ALGO | 0.999997 | 4.188383 | {
"github_metadata": {
"branch": "main",
"commit_count": 229,
"repo_created_at": "2023-02-17T06:14:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 15,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f7bad88db... |
937fd330-20df-4a76-8a75-f2dce5f5392b | TeaPavlovic/KiAA | vezbe/stabla/dsu.cpp | //Union-find
#include <iostream>
#include <vector>
using namespace std;
vector<int> roditelj;
vector<int> rang;
void napraviDsu(int n) {
roditelj.resize(n);
rang.resize(n, 1); //stavi svuda rang 1
for(int i=0; i<n; i++)
roditelj[i] = i;
}
int predstavnik(int a) {
int t = a;
while(roditel... | ALGO | 0.999887 | 4.646067 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-01-27T23:27: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": "d3aa8e657aa2... |
75a1ea81-dc85-4076-8c6b-f29e92e6a844 | tanmaysahay94/Algorithm | CPP/0619_flower.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
#define si(n) scanf("%d", &n)
#define sll(n) scanf("%lld", &n)
#define sull(n) scanf("%llu", &n)... | ALGO | 0.999989 | 3.822928 | {
"github_metadata": {
"branch": "master",
"commit_count": 424,
"repo_created_at": "2014-05-26T07:29:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d9335a0a... |
a00b7886-cfde-4e1b-8f74-240b4295a1e8 | Artem-studi0/OAIP_1sem | laba11/laba11/osnova2/ocnova2zaddd.cpp | //#include <iostream>
//
//int main() {
// char temp[33];
// unsigned int A, B;
// int n, p, m, q;
// setlocale(LC_ALL, "russian");
// // Ввод данных
// std::cin >> A;
// _itoa_s(A, temp, 2);
// std::cout << "Введите число A: " << temp << std::endl;
// std::cin >> B;
// _itoa_s(B, temp, 2)... | ALGO | 0.998258 | 4.816957 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-02-06T16:21:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "09ac5ac1a12b... |
6ca2f432-d5ac-4413-9152-4c03e395b4ae | jimmycao/heet | cpp/leet/others/leet_007.cpp | #include <algorithm>
#include <vector>
#include <unordered_map>
#include <iostream>
#include <iterator>
#include <string>
#include <sstream>
#include <string_view>
#include <cassert>
#include <bits/stdc++.h>
class Solution {
public:
int reverse(int x) {
assert (x >= INT_MIN && x <= INT_MAX);
lon... | ALGO | 0.999883 | 5.251589 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2024-09-21T07:38: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": "e089d44c8... |
d15de011-9419-4a5e-bc08-bac6de3c523b | Soul-8789/Online_code | CODECPH/maths1.cpp | #include<bits/stdc++.h>
using namespace std;
/*
void multiply(int *a,int &n,int no)
{
int carry=0;
for(int i=0;i<n;i++)
{
int product =a[i]*no +carry;
a[i]=product%10;
carry=product/10;
}
while(carry)
{
a[n]=carry%10;
carry=carry/10;
n++;
}
}
void big_factorial(int number)
{
int *a = new int[1000];
for(int i=0... | ALGO | 0.999858 | 3.876413 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-03-24T20:24:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b617aebcc... |
358ebcd3-b04d-4630-9d08-692269e576ab | CGAL/cgal | Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Voronoi_vertex_C2.h | // Copyright (c) 2015 Università della Svizzera italiana.
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : <NAME>, <NAME>, <NAME>
//<EMAIL>, <EMAIL>, <EMAIL>
#ifndef CGAL_SEGMENT_D... | ALGO | 0.989998 | 5.96656 | {
"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... |
8a6f9976-387c-42ed-b77c-0473adedd8c3 | yoshikipom/atcoder | abc/003/d.cpp | #include <iostream>
#include <vector>
using namespace std;
typedef long long int ll;
long nCr(ll n, ll r) {
vector<ll> v1, v2;
v2.push_back(1);
for (size_t i = 0; i < n; i++) {
v1 = v2;
for (size_t i = 0; i < v1.size() - 1; i++) {
v2[i + 1] = (v1[i] + v1[i + 1]) % 1000000007;
}
v2.push_bac... | ALGO | 0.999138 | 5.118118 | {
"github_metadata": {
"branch": "master",
"commit_count": 161,
"repo_created_at": "2018-12-02T02:06: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": "f7158959... |
d1f56f0a-15f4-45c5-b145-129caffe11fa | jpilet/anemomind | src/server/math/SubdivFractalsDemo.cpp | /*
* Created on: 2014-
* Author: <NAME> <<EMAIL>>
*/
#include <random>
#include <server/plot/extra.h>
#include <server/math/SubdivFractals.h>
#include <server/common/ArgMap.h>
#include <server/common/LineKM.h>
#include <limits>
using namespace sail;
using namespace sail::SubdivFractals;
typedef Fractal<1> F... | ALGO | 0.994553 | 5.820925 | {
"github_metadata": {
"branch": "master",
"commit_count": 5987,
"repo_created_at": "2013-11-04T11:18:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 2,
"issues": 46,
"pull_requests": 7
},
"file_meta": {
"content_id": "1cdbc... |
38d0ee06-b861-4221-8b5b-ef89c7c51e7d | OST-Stud/EmbSW2 | praktika/900-Praktika/prak03/Loesung/QuickSortFast/src/QuickSortFast.cpp | //==================================================
// Name : QuickSortFast.cpp
// Author : <NAME>
// Version :
// Copyright : (c) <NAME>
// Description : Fast Quicksort
//================================================
#include <iostream>
#include "StopWatch.h"
#include "List.h"
using namespace st... | ALGO | 0.999768 | 5.227527 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2013-07-17T11:53:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a7153d5f... |
04a37eaf-0b87-4622-8c33-690efbe5fba5 | Pkataki/Problem_Solving | spoj/GREED2.cpp |
#include <bits/stdc++.h>
using namespace std;
#define REP( i, n ) \
for ( int i = 0; i < (n); i++ )
typedef long long int64;
const int
MAXN = 502,
MAXE = 100000,
oo = (int)1e9;
int T, V, L, E;
int src, snk, sol;
int cant[MAXN];
int best[MAXN];
int from[MAXN];
int head[MAXN];
struct edge {
int u, v, w, cap, ne... | ALGO | 0.999944 | 4.216045 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-11-27T18:35: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": "6448f3fea7... |
b8dd29f6-cf4d-4873-97da-ed48a7d91024 | GersonCavalheiro/OpenMPSnapshot | May2023/RepCPP/263028232/Matmul.hpp | #pragma once
#if TML_HAS_TBB
#include <tbb/task.h>
#include <tbb/parallel_for.h>
#include <tbb/blocked_range.h>
#include "../../../base/MatmulBase.hpp"
namespace tml
{
namespace eager
{
namespace details
{
namespace backend
{
template<typename Scalar>
struct matmul_backend<Scalar, TBB>
{
TML_STRONG_INLINE Scalar Mult... | ALGO | 0.984755 | 6.742549 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-08-19T17:35:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a4f1627e81... |
5e4909af-1a78-4968-a7fa-33fa8e4b980f | AbdullaKhan01/LeetCode_Codes | 1824. Minimum Sideway Jumps.cpp | //TC O(3*3*n) = O(n) SC = O(1) of optimized Approach
class Solution {
public:
int solve(vector<int> &obstacles,int currRow,int currLane){
int n=obstacles.size()-1;
if(currRow == n){
return 0;
}
if(obstacles[currRow+1]!=currLane){
return solve(obstacles,currRow... | ALGO | 0.999908 | 5.032864 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2023-08-27T18:18: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": "ccaa1957939... |
98fb9f63-1f36-41a6-9b7f-d7a5ee27e1e9 | Iliaromanov/Algos-and-DataStructs-Practice | NeetCode_Roadmap/cp_list_w_rand_ptr.cpp | /*
// Definition for a Node.
class Node {
public:
int val;
Node* next;
Node* random;
Node(int _val) {
val = _val;
next = NULL;
random = NULL;
}
};
*/
class Solution {
public:
Node* copyRandomList(Node* head) {
if (!head) return nullptr;
map<Node*, N... | ALGO | 0.996959 | 5.555051 | {
"github_metadata": {
"branch": "main",
"commit_count": 420,
"repo_created_at": "2021-08-11T21:58:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "690c8ac0c7... |
97fbefad-e2a3-4994-81af-8f2cb2c5b3e1 | henrique4d/Competitive | tremdle/tremdle1/d.cpp | #include <bits/stdc++.h>
using namespace std;
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { os << "{"; for (typename vector<T>::const_iterator vi = v.begin(); vi != v.end(); ++vi) { if (vi != v.begin()) os << ", "; os << *vi; } os << "}"; return os; }
template<typename A, typename B> ostr... | ALGO | 0.999748 | 4.639374 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2022-04-10T00:27: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": "294fcb7af... |
4847bf34-01a4-457b-af6b-6fac3aaccd5b | rajroushan95/BiMap-cpp | BiMap.h | #ifndef _CUSTOM_BIMAP_H_
#define _CUSTOM_BIMAP_H_
#include <set>
#include <stdexcept>
template <typename K, typename V>
class BiMap
{
private:
class Key;
class Value
{
public:
V item;
Key<K,V> *key;
Value(V item){
this->item = item;
}
};
class ... | ALGO | 0.978828 | 5.806573 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-03-16T15:29: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": "05e071c5c1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.