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 |
|---|---|---|---|---|---|---|---|
ef354a8e-d181-4994-95b0-98d541dbdee9 | the-macson/DSA-Self-Pcaed | Array/Problems/5_MaxAndSecondMax.cpp | // { Driver Code Starts
//Initial Template for C++
// CPP code to find largest and
// second largest element in the array
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
/* Function to find largest and second largest element
*sizeOfArray : number of el... | ALGO | 0.999868 | 5.547798 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-05-24T07:24:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b332c7c4208... |
54b5735d-5784-401d-9319-22ad3a73d0e6 | tejaswi0310/LEETCODE | Find all pairs with a given sum - GFG/find-all-pairs-with-a-given-sum.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
vector<pair<int,int>> allPairs(int a[], int b[], int n, int m, int x)
{
// vector<pair<int,int>>res;
// sort(a,a+n);
// sort(b,b+m);
// int i=0,j=0;
... | ALGO | 0.999893 | 5.402872 | {
"github_metadata": {
"branch": "main",
"commit_count": 771,
"repo_created_at": "2021-08-01T15:24:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6599844829... |
85b8a9d5-1bc0-426d-a190-6ae82c5de6b5 | jri8/BTree | BT.h | #pragma once
#include "Node.h"
#include <cmath>
#include <algorithm>
using std::cout;
using std::endl;
template <class T>
class BT
{
private:
void insert(T e, Node<T>* &x, Node<T>* &parent);
void split(T e, Node<T>* &x, Node<T>* &parent);
void printOrder(Node<T>* &x);
void printLevel(Node<T> *&x, int level);
b... | ALGO | 0.999173 | 3.66482 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-10-18T13:15: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": "53f5ec872c... |
7f024d82-d986-488b-9558-c2518dd22c30 | Yoo-4x/seetafaceAndroidSdk | TenniS/src/backend/base/element_wise_reduce.cpp | //
// Created by kier on 2019/1/28.
//
#include <backend/base/element_wise_reduce.h>
#include "backend/base/element_wise_reduce.h"
#include "utils/assert.h"
#include "runtime/stack.h"
#include <numeric>
namespace ts {
static inline void front_append_ones(Shape &shape, int count) {
Shape ones(count, 1);... | TOOL | 0.955369 | 5.889994 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-09-04T12:54:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa1a437e71c2... |
ccbffb07-92df-4b9b-88cd-24891c5a3e50 | oasis63/cpp_codes | TodoProblems/3598_leetcode.cpp | #include <bits/stdc++.h>
#include "UTILS/helper.h"
using namespace std;
// This is correct ,, need to understand the logic again and then submit
class Solution {
public:
int lcp(const string& a, const string& b) {
int len = min(a.length(), b.length());
int ans = 0;
for (int i = 0; i < len; i++) {
... | ALGO | 0.999946 | 4.808735 | {
"github_metadata": {
"branch": "develop",
"commit_count": 66,
"repo_created_at": "2021-11-13T17:54:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a81d37336... |
cd0d5058-0d2d-46f5-bae2-a7532b1f72ed | pvs-hd-tea/23ws-PerfTuner | Product/Snippets/snippet5_opt.cc | #include <immintrin.h>
__m256i vec1,vec2; // define variables only once outside the loop
int vec_size = 8; // since the AVX register can hold 8 integers
int i = 0;
for (; i <= n - vec_size; i += vec_size) // head loop (optimized using AVX)
{
vec1 = _mm256_loadu_si256((__m256i*) &A[i]); // load necessary va... | ALGO | 0.999981 | 5.313208 | {
"github_metadata": {
"branch": "main",
"commit_count": 150,
"repo_created_at": "2023-10-27T13:34:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "39629e286f1... |
4fe7fb29-3cf5-4c07-958b-b2edef56976a | ydb-platform/ydb | contrib/libs/grpc/src/core/ext/xds/xds_routing.cc | //
//
// Copyright 2021 gRPC authors.
//
// 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 required by applicable law or agree... | ALGO | 0.969928 | 7.389439 | {
"github_metadata": {
"branch": "main",
"commit_count": 35208,
"repo_created_at": "2022-02-07T14:52:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4512,
"forks": 701,
"issues": 2263,
"pull_requests": 682
},
"file_meta": {
"content_id": ... |
42983ebb-1b2c-4ac3-a008-0543db23765f | akdemironur/adventofcode2024 | src/day03.cpp | #include <algorithm>
#include <fstream>
#include <iostream>
#include <regex>
#include <string>
struct Instruction {
size_t position;
std::string type;
int num1;
int num2;
};
struct Pattern {
std::regex regex;
std::string type;
};
std::array<Pattern, 3> patterns = {
{{std::regex("mul\\((\\d+),(\\d+)\\)... | ALGO | 0.999406 | 5.840602 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-12-08T21:12: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": "0adcade4bdcd... |
a2188297-69bc-47f6-99d3-b18473908544 | MijaTola/Codeforce | 281B.cpp | #include <bits/stddc++.h>
using namespace std;
int main() {
int x, y, n, a, b;
long double mn = 1e9, t;
cin >> x >> y>>n;;
t= x / (long double) y;
++n;
for (int i = 1; i < n; ++i) {
if (abs(t- floor(t* i) / i) < mn) {
b = i;
... | ALGO | 0.999824 | 4.77976 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2015-10-31T01:44: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": "023cd19f7f... |
6f99458d-3b9e-4cc5-8109-dc12d3f61072 | nijesmik/42seoul-algorithm-study | seoson/week9/17086.cpp | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
int N, M;
int board[50][50];
int visited[50][50];
queue<pair<int, int>> q;
vector<int> vec;
int dx[8] = {1, -1, 0, 0, 1, 1, -1, -1};
int dy[8] = {0, 0, 1, -1, 1, -1, 1, -1};
int ans = 2147483647;
int main()
{
cin.tie(0);
ios::sync_with_stdio(... | ALGO | 0.99993 | 4.3156 | {
"github_metadata": {
"branch": "main",
"commit_count": 462,
"repo_created_at": "2023-12-23T12:09:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 5,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "e317390279... |
bfb4f6a8-f02e-4b46-9ae5-c8454e6948d5 | m1zu/fibermatCharacterization | main.cc | #include "Helpers.hh"
#include <TApplication.h>
#include <TVirtualFitter.h>
double medianLightYield(TH1D* h)
{
return TMath::Median(h->GetNbinsX(), &(h->GetArray()[1])); //full range
//return TMath::Median(56, &(h->GetArray()[261])); //shortRange
}
double meanLightYield(TH1D* h)
{
double mean=0;
int n = h->G... | TEST | 0.924175 | 3.844437 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2018-01-03T14:10: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": "01f5e916f... |
88837996-c019-443d-973f-be5cbf302474 | JanaranjaniPalaniswamy/codetestparticlefilter | inc/ParticleFilter.h | #ifndef _PARTICLE_FILTER_H_
#define _PARTICLE_FILTER_H_ _PARTICLE_FILTER_H_
#include "Particle.h"
#include <vector>
#include <random>
using std::vector;
class ParticleFilter
{
public:
/*
*Sample particle filter from a normal distribution
*define by the following standard deviations.
*Adapt those value... | ALGO | 0.952242 | 6.150696 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-02-11T10:28:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c2505c676... |
6dea4ab6-dc7e-4bf0-a524-590d376a9807 | blakediamond/CS16 | hexadecimal.cpp | #include<iostream>
#include<fstream>
#include<math.h>
#include<string>
#include<cstdlib>
#include<cmath>
using namespace std;
int P; //global, used to find power
//void to_int(string&[],int&[]) //changes the characters in the inputted strings to integers
//void to_hex(int&[], string&[]) //changes integers back ... | ALGO | 0.999263 | 3.918942 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-10-23T23:41: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": "a6ab5888d... |
dd365906-73b6-49de-a664-78bfa3bec995 | w790/prog-7 | tasks/task3.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <algorithm>
#include "task3.h"
std::string solve_the_equation(std::string s) {
int number = 0;
int numberx = 0;
int iteration_numberx_or_number = 0;
int flag = 1;
int REDflag = 1;
bool digitsscan=false;
for(int i=0;i<size(s)+... | ALGO | 0.999641 | 3.769563 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-23T20:07: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": "5533150cb472... |
d18bcc6c-f390-40cb-a0e2-8a61b499441d | KatyT12/Leetcode | 542 - 01 Matrix.cpp | class Solution {
public:
vector<vector<int>> ret = {};
vector<vector<int>> vecs = {{1,0}, {0,1}, {-1,0}, {0,-1}};
queue<pair<int,int>> start_from = {};
int m,n;
vector<vector<int>> updateMatrix(vector<vector<int>>& mat) {
int m = mat.size(); n = mat[0].size();
ret.assign(m, vector<i... | ALGO | 0.999965 | 5.941822 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2023-07-15T17:26: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": "514d62bc1... |
6e86ee5d-5918-43d7-9c8d-4c51f8fb5bd8 | IoplachkinI/competitive | divide-and-conquer/the-monkey-and-the-oiled-bamboo.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
int cnt = 0;
while (t--){
cnt++;
int n, maxdiff = 0;
cin >> n;
vector<int> v (n + 1);
v[0] = 0;
for (int i = 1; i <= n; i++){
cin >> v[i];
if (i > 0 && v[i... | ALGO | 0.999691 | 3.365129 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-07-03T22:07: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": "4b3bdc146b93... |
85a0069e-c347-41a1-b911-f8b2cf370dc8 | cos65535/ICPCLibrary | Structure/SegmentTree2.cpp | struct Node {
int lower;
int upper;
Node() {;}
Node(int lower, int upper)
: lower(lower), upper(upper) {;}
};
inline Node Merge(Node left, Node right) {
return Node(min(left.lower, right.lower), max(left.upper, right.upper));
}
struct SegmentTree {
static const int MAX_DEPTH = 18;
static const int S... | ALGO | 0.999336 | 4.429815 | {
"github_metadata": {
"branch": "master",
"commit_count": 126,
"repo_created_at": "2011-08-20T18:17:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa8b4b4... |
081e0834-8c92-4024-8713-444df13f8293 | hennylee/Problem-Solving | 11_05.cpp | /***********************
* date : 2022-03-02
* topic : greedy
* feedback :
* time : 30 min
************************/
#include<iostream>
#include<vector>
using namespace std;
int main_11_05()
{
int n; // 볼링공의 갯수
int m; // 공의 최대 무게
cin >> n >> m;
int cnt = n * (n-1) / 2;
vector<int> ball(n); // 입력받은 ... | ALGO | 0.999997 | 4.053658 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2022-02-09T09:37:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8bcacd4c83... |
526a832a-c5ff-42a4-8f77-cfe4829c99cd | chiku/Find-pi | c++/approx_pi_reporter.cc | #include <iostream>
#include <fstream>
#include <iomanip>
#include <cmath>
#include <utils.h>
#include <approx_pi_reporter.h>
const int EstimatePi::ApproxPiReporter::REPEATS() const
{
return 1000;
}
void EstimatePi::ApproxPiReporter::generate()
{
ApproxPiFinder finder(sample_size);
finder.evaluate();
... | ALGO | 0.956241 | 6.109118 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2011-07-02T07:58:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "15c2189e3... |
9a6bfdff-e592-4e4c-873d-5d73c9258f31 | mud2man/LeetCode | C++/230.ProductofArrayExceptSelf/main.cpp | /* Complexity: O(n)
* 1. Generate product from right
* 2. Generate product from left
* 3. ans[i] = productFromRight[i + 1] * productFromLeft[i - 1];
* ex: input: [1, 2, 3, 4]
* right: [24,24,12,4]
* left: [1, 2, 6, 24]
* answer:[24,12,8, 6]
*/
#include <iostream>
#include <vector>
using namespace... | ALGO | 0.999997 | 5.563297 | {
"github_metadata": {
"branch": "master",
"commit_count": 1741,
"repo_created_at": "2016-07-14T07:27:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "55bb93c... |
8951081e-35ae-4588-a1ff-5d6e07653f84 | IshanGarg123/Love-Babbar-Coding-Course | Love Babbar/DP3/Lec-122/C++3.cpp | // GFG
// Dice throw
// Tabulation
// T.C. = O(M*X) S.C = O(M*X);
#include <iostream>
using namespace std;
#include <limits.h>
#include <vector>
long long noOfWays(int M, int N, int X)
{
// code here
vector<vector<long long>> dp(N + 1, vector<long long>(X + 1, 0));
dp[0][0] = 1;
for (int i = 1; i <... | ALGO | 0.999971 | 4.800411 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-10-03T09:44: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": "1a94c992f6ce... |
e4be8a9a-e1da-4a58-ac1d-98a78e31a437 | 0xiamsanj/DSA | DSA/Linked_List/4_Merge_Sorted_Linked_List.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
class Node
{
public:
T data;
Node *next;
Node(T data)
{
next = NULL;
this->data = data;
}
~Node()
{
if (next != NULL)
{
delete next;
}
}
};
Node<int> *solve(Node<i... | ALGO | 0.999995 | 5.534888 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2023-02-15T06:18:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be9aa0101eb... |
d07a9013-8140-4cbc-a2ff-343047d2d8d5 | nyan101/CompetitiveProgramming | Codeforces/Educational Codeforces Round 60 (Div. 2)/E.cpp | // http://codeforces.com/contest/1117/problem/E
#include <cstdio>
#include <tuple>
#include <vector>
#include <algorithm>
#include <cstring>
#include <set>
using namespace std;
typedef long long llint;
int n;
char ss[10005], rs[10005];
char s1[10005], s2[10005], s3[10005];
int a[17580];
set<int> S[17580];
int mai... | ALGO | 0.999975 | 3.355917 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-01-27T08:41: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": "05609cee4... |
c7fb73a4-1bba-4b5a-8201-bbf823f7479f | JoseCarioca/EDNL | Practica5/ej2InstertarminMax.hpp | //
// Created by epicg on 17/04/2024.
//
#ifndef PRACTICA5_EJ2INSTERTARMINMAX_HPP
#define PRACTICA5_EJ2INSTERTARMINMAX_HPP
#include "../AbinVec1.hpp"
#include <cmath>
/**
* No se si hacer un tad minmax... de momento que cumpla la precondicion
* Precondicion: Es un arbol min-max y no esta ya metido?
*/
template <ty... | ALGO | 0.999889 | 5.869338 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-02-14T09:28: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": "d47ace80213... |
835403ed-c346-4834-a6f3-a48d242cea60 | saul-goodman-lja/CPPLearning | cpp/searchEngine/src/online/KeyRecommander.cc | #include "../../include/online/KeyRecommander.hh"
#include "../../include/online/Dictionary.hh"
#include "../../include/online/TcpConnection.hh"
#include "../nlohmann/json.hpp"
#include "../../include/online/ProgressCache.hh"
#include "../../include/online/CacheManager.hh"
#include "../../include/online/DoubleCacheMana... | ALGO | 0.97521 | 3.914086 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-06-25T06:44:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5bae2139527... |
2f7348df-1388-4073-94fa-de51934a32bb | abshir24/CS131_HomeWork | HW6/Pt4.cpp | /*
<NAME>
8-13-2018
HW6
*/
#include <iostream>
#include<string>
#include<cmath>
#include<iomanip>
#include <iostream>
using namespace std;
int getTotal(int[][7],int size);
int getAverage(int[][7],int size);
int getHighestFood(int[][7],int size);
int getLowestFood(int[][7],int size);
int main()
{
int mon... | ALGO | 0.991526 | 3.790259 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2018-07-09T23:48:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a360f1ced... |
452ce2a8-fae5-4373-b790-0c5dbc8aff16 | victor-armegioiu/Algo-stuff | 1247.cpp | #include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
void print_path(int i, int j, const vector<vector<int>> &parents)
{
if (i != j) print_path(i, parents[i][j], parents);
cout << char(j + 'A') << " ";
}
int main()
{
ios_base::sync_with_stdio(false);
vector< vector<pii> > g;
vector< vector<i... | ALGO | 0.999961 | 3.937376 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2017-09-29T00:12: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": "267087fb9... |
162ca901-992f-4a78-800b-8ef820e0c1be | FangGet/BundleFusion_Ubuntu_Pangolin | include/FreeImage/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_length_cost.h | // Copyright (c) 2006 GeometryFactory (France). All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// 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... | TOOL | 0.976724 | 6.343015 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-06-29T03:53:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 132,
"forks": 34,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d51870... |
869bf681-fb61-4084-a616-8fb6ddf7d3be | ce39906/self-practices | leetcode/binarySearchTreeIterator.cpp | /*************************************************************************
> File Name: binarySearchTreeIterator.cpp
> Author: ce39906
> Mail: <EMAIL>
> Created Time: 2018-11-20 19:32:49
************************************************************************/
/**
* Definition for binary tree
* stru... | ALGO | 0.999983 | 5.971735 | {
"github_metadata": {
"branch": "master",
"commit_count": 128,
"repo_created_at": "2018-07-30T07:01:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ff1539... |
f48325d6-bea9-483e-960b-c1a69c6c82d1 | migue0418/Informatica-UGR | Universidad de Granada/Metodología de Programación/Practica 5/include/Bigrama.h | /**
* @file Bigrama.h
* @author DECSAI
*/
#ifndef BIGRAMA_H
#define BIGRAMA_H
/**
* @class Bigrama
* @brief Gestión individual de bigramas: pares de letras consecutivas de un texto y su frecuencia asociada dentro del texto
*/
class Bigrama {
public:
/// @brief Constructor base
Bigrama();
/*... | ALGO | 0.988049 | 4.834264 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-02-11T11:14:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "05735b231fd... |
7b7cbd17-6606-417b-b279-85b83a5e5cb3 | willtaehwan/Algorithm | 백준/Platinum/10217. KCM Travel/KCM Travel.cc | #include <iostream>
#include <vector>
#include <queue>
#include<algorithm>
#define INF 1e9
#define MAX 10001
using namespace std;
struct Node {
int end;
int cost;
int time;
};
int T, N, M, K;
int dist[MAX][105] = { 0, };
vector<Node> v[105];
int dp(int nowCost, int nowNode) {
int ret = dist[nowCost][nowNode];
... | ALGO | 0.999799 | 3.467875 | {
"github_metadata": {
"branch": "main",
"commit_count": 562,
"repo_created_at": "2023-09-03T03:26:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c58931f77d... |
f56a246a-1ba8-45b6-ac77-936020d6a7cd | jlafiandra6/CacheSimulator | cachesim_driver.cpp | #ifdef CCOMPILER
#include <stdio.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#else
#include <cstdio>
#include <cinttypes>
#include <cstdlib>
#include <cstring>
#endif
#include <unistd.h>
#include "cachesim.hpp"
void print_help_and_exit(void) {
printf("cachesim [OPTIONS] < traces/file.trace\n"... | TOOL | 0.920316 | 5.083973 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-07-23T01:52: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": "9085a3b981... |
9afb6caf-8d83-4e87-a467-f6971dfa4306 | kobeallen/Leetcode | Copy List With Random Pointer.cpp | /**
* Definition for singly-linked list with a random pointer.
* struct RandomListNode {
* int label;
* RandomListNode *next, *random;
* RandomListNode(int x) : label(x), next(NULL), random(NULL) {}
* };
*/
class Solution {
public:
RandomListNode *copyRandomList(RandomListNode *head) {
//... | ALGO | 0.9994 | 4.436345 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-02-17T08:50: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": "38e1bc3833... |
5bae95d1-f848-4ce0-b49d-36e4b4902413 | Ryotaro25/lil_tanuki | src/move_generator.cpp | #include "direction.h"
#include "move.h"
#include "move_generator.h"
#include "position.h"
std::vector<Move> MoveGenerator::GenerateMoves(const Position& position) {
std::vector<Move> moves;
std::vector<Move> non_capture_promotion_moves;
std::vector<Move> non_capture_non_promotion_moves;
Color side_to_move = ... | ALGO | 0.990046 | 5.589981 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-05-15T12:25: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": "87ba5d78499... |
2dab76b8-a46a-43e7-8a68-0e3948b0730b | fulforget/amd-780m-setup | AMD/ROCm/5.7/include/rocprim/device/detail/device_segmented_radix_sort.hpp | // Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights... | ALGO | 0.999851 | 7.734447 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-08-29T15:43:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b0af493f77e... |
0add891d-6a23-41c4-948c-a404284f4aba | ayatsuliak/LNU_Algorithms_And_Data_Structures | Polish notation/Polish notation/PolishNotation.cpp | #include<iostream>
#include <stack>
#include<cmath>
#include<string>
#include <iomanip>
#define tg(x) (sin(x)/cos(x))
using namespace std;
int IsOperator(char ch)
{
if (ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '^')
{
return 2;
}
if (ch == 's' || ch == 'c' || ch == 't')
{
return 1; ... | ALGO | 0.999658 | 3.973552 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-01-10T19: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": "da14411d41a6... |
4a2ca72b-e89f-4165-9dbd-4ccf29bcf6ca | Abhishek-Sharma-1999/LeetCode-Solutions | Partition Equal Subset Sum - GFG/partition-equal-subset-sum.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution{
public:
int solve(int index,int arr[],int N,int target) //Recursion
{
// base-case
if(index>=N){
return 0;
... | ALGO | 0.999794 | 5.728363 | {
"github_metadata": {
"branch": "main",
"commit_count": 2006,
"repo_created_at": "2022-08-03T14:12:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c62e874d1... |
414921e1-6477-4351-968c-880aafb47f56 | le-incroyable1-dev/competitiveProgramming | hotelReviews.cpp | #include <bits/stdc++.h>
using namespace std;
//Trie
class tn{
public:
tn *next[26];
bool end;
tn(){
for(int i = 0; i < 26; ++i) next[i] = NULL;
end = false;
}
};
void insert(tn *root, string word){
tn *cur = root;
for(int i = 0; i < word.length(); ++i){
if(cur->nex... | ALGO | 0.999636 | 3.771305 | {
"github_metadata": {
"branch": "main",
"commit_count": 463,
"repo_created_at": "2021-04-19T05:06:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "80c5cb1944... |
6e37b01c-cb34-492a-b545-f5e3078c5016 | kylekaplan/Algo-project-2 | candy.cpp | /*
* Authors: <NAME>, <NAME>, <NAME>
* Date: 3/31/2018
* Project: Dynamic Programming
* Description: In this file, we developed an algorithm to count the number of unique arrangements of
* pieces of candy. The algorithm takes in 3 parameters, the size of the candy sampler, the number of
* different square candies... | ALGO | 0.999805 | 5.02078 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-03-27T22:27: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": "d4237f0665... |
8a029e9c-300f-497f-b4e5-9a0cb5b4d86e | bryan277/cs37 | oldMacDonald/program.cpp | #include<iostream>
#include<string>
using namespace std;
float MinGP(int yield , float bushel, float cPA);
float AvgGP(float maxGP, float minGP);
int main()
{
float cPA, bushel, increase, minGP, maxGP, avgGP;
int yield;
string cropName;
cout << "Enter crop name: ";
getline(cin, cropName);
... | ALGO | 0.985098 | 4.269642 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-01-20T23:56:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e760855247... |
6bf8c982-119c-42ef-b90a-f6016886fbed | sagi-z/CanvasCV | tutorials/tut_shapes_code.cpp | #include <iostream>
#include <stdexcept>
#include <opencv2/objdetect.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/video.hpp>
#include <opencv2/videoio.hpp>
using namespace cv;
using namespace std;
// CanvasCV change#1 - include and namespace
#in... | TOOL | 0.932576 | 6.504826 | {
"github_metadata": {
"branch": "master",
"commit_count": 158,
"repo_created_at": "2017-01-15T14:09:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "95f5bd0... |
b97111e7-1eec-4e15-82a5-00c9b7c3c6a1 | btabram/AdventOfCode2020 | 03/main.cpp | #include <fstream>
#include <iostream>
#include <string>
#include <vector>
using Map = std::vector<std::vector<char>>;
Map read_input()
{
std::ifstream input("input.txt");
Map grid;
std::string line;
while (std::getline(input, line))
{
grid.emplace_back(line.cbegin(), line.cend());
}
... | ALGO | 0.999974 | 6.061031 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2020-12-03T21:05: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": "c8301998f33... |
d3ec5181-22cf-4fa9-b958-67ca9940df32 | jakolsz11/Polski_spoj | Łatwe/xx. jasia problemy z zegarem/zneta.cpp | #include <iostream>
using namespace std;
int count_clock_matches(string start_time, string end_time) {
int count = 0;
int start_hour = stoi(start_time.substr(0, 2));
int end_hour = stoi(end_time.substr(0, 2));
int start_minute = stoi(start_time.substr(3, 2));
int end_minute = stoi(end_time.substr(... | ALGO | 0.998981 | 5.320507 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-04-20T10:38: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": "dc46240d4f... |
f6266389-b094-49ca-ab92-9e0e570c2bfc | developer-bin/algorithm | boj/boj_1890.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <queue>
#include <map>
#include <vector>
#include <cmath>
#include <set>
#include <stack>
#include <bitset>
#define MIN_VALUE -200000000
#define MAX_VALUE 200000000
#define MOD 9901
#define ll long long
using namespace std;
int n;
in... | ALGO | 0.999964 | 4.209834 | {
"github_metadata": {
"branch": "master",
"commit_count": 894,
"repo_created_at": "2020-04-22T15:47: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": "0248c20b... |
8e2590de-f9c9-4e96-a884-8c20fcef8bc7 | prajvalpase06/DSA | Arrays/count_inversions.cpp | #include <bits/stdc++.h>
using namespace std;
long long int mergesort1(long long arr[], int l, int h)
{
long long temp[h];
return mergesort(arr, temp, l, h);
}
long long merge(long long arr[], long long temp[], int l, int m, int h)
{
long long invcount = 0;
int i = l;
int j = m;
int k = l;
... | ALGO | 0.999954 | 4.367696 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2022-05-10T07:12: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": "d62df83b976... |
cb5200d5-38e6-4be8-85bc-67a51dd63447 | tomek-o/tSIP | webrtc/webrtc/modules/audio_processing/splitting_filter.cc | /*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... | ALGO | 0.997778 | 7.028072 | {
"github_metadata": {
"branch": "master",
"commit_count": 902,
"repo_created_at": "2018-09-15T13:11:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 174,
"forks": 38,
"issues": 11,
"pull_requests": 0
},
"file_meta": {
"content_id": "71d3... |
550aff09-b42e-4349-be55-a1959f90a00f | martaajonees/EDNL | Grafos/Práctica 7/Actividad 6/main6.cpp | int main() {
int numCiudades = 4;
// Crear los grafos de costos para cada medio de transporte
GrafoP<int> bus(numCiudades);
GrafoP<int> tren(numCiudades);
// Rellenar los grafos de costos con los valores correspondientes
// Rellenar el grafo de costos en bus
bus[0][1] = 2;
bus[0][2] =... | ALGO | 0.999548 | 4.639792 | {
"github_metadata": {
"branch": "main",
"commit_count": 239,
"repo_created_at": "2023-04-24T16:58: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": "fdf5fd4175... |
b92fafd6-c014-4470-aa0e-a55995b8d6d9 | tlgns1212/C-Workspace | ProgrammersCoding/[1차] 프렌즈4블록.cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
int solution(int m, int n, vector<string> board) {
int answer = 0;
bool visited[31][31] = {false, };
bool isRemove = true;
while(isRemove){
isRemove = false;
for(int i = 1; i < board.size(); i++)... | ALGO | 0.999909 | 5.171956 | {
"github_metadata": {
"branch": "main",
"commit_count": 362,
"repo_created_at": "2021-11-14T23:05: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": "aa8facd81b... |
cece5183-8066-43ca-bec8-64a0e18c031a | 70N618/CPP02 | ex03/srcs/bsp.cpp | #include "Fixed.hpp"
#include "Point.hpp"
#include <cmath>
#include <cstdlib>
#include <sys/types.h>
static bool check_all_segments(float x1, float y1, float x2, float y2, float x3, float y3, float X, float Y);
static bool is_point_on_segment(float x1, float y1, float x2, float y2,float X, float Y);
static float calcu... | ALGO | 0.998881 | 5.702882 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-04-25T10:19: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": "52a6987a256... |
5325ed67-2996-4e0a-a928-e9f68ed0fe47 | Vishwakant-coder/100-Day-Coding-Challenge | 13-10-2024/Expression contains redundant bracket or not.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int checkRedundancy(string s) {
// code here
stack<char>S;
for (int i=0; i<s.length(); i++){
char ch= s[i];
if(ch=='(' or ch=='+' or ch=='-' or ch==... | ALGO | 0.999129 | 4.82883 | {
"github_metadata": {
"branch": "main",
"commit_count": 124,
"repo_created_at": "2024-08-08T17:36: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": "ca4c0e013f... |
a77814da-96ed-49b5-adf7-f3a016d17d51 | Sudhanshu3314/Patterns-of-questions-asked-in-Array-1 | q3_AbsoluteDiff.cpp | /* Programmer = <NAME>
Topic = Assignment Question
Purpose = Given a vector arr[] sorted in increasing order of size n and an integer x, Find if there exists a pair in the array whose absolute difference is exactly x.
Given n > 0 which is size > 0
Input : arr =[5,10,15,20,26] x = 10
Output : Yes
Input : arr = [ 5,6... | ALGO | 0.999988 | 5.300108 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-08-27T12:31: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": "4c0f7b2c1f42... |
c107a7d4-1371-43d1-99dc-257e480fcf1f | ParkhiyaParth/CPP-Programming | CodeForces/Problems/Codeforces Round 981 (Div. 3)/C_Sakurako_s_Field_Trip.cpp | #include <iostream>
#include <bits/stdc++.h>
#define ll long long
using namespace std;
void solve()
{
ll n;
cin >> n;
vector<ll> a(n);
for (ll i = 0; i < n; i++)
{
cin >> a[i];
}
int sz = (n + 1) / 2;
vector<vector<ll>> dp(sz, vector<ll>(2, 0));
for (int i = 1; i < sz; i++)
... | ALGO | 0.999898 | 4.394699 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-12-27T06:44: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": "bca3fb8ed2d... |
21b020ed-8919-48ce-a1e4-8d41e813d0c8 | dnbaker/sketch | include/blaze/blaze/math/expressions/DMatTSMatMultExpr.h | //=================================================================================================
/*!
// \file blaze/math/expressions/DMatTSMatMultExpr.h
// \brief Header file for the dense matrix/transpose sparse matrix multiplication expression
//
// Copyright (C) 2012-2020 <NAME> - All Rights Reserved
//
// Th... | ALGO | 0.972516 | 6.673167 | {
"github_metadata": {
"branch": "main",
"commit_count": 1275,
"repo_created_at": "2016-11-21T19:41:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 155,
"forks": 14,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "2311ec... |
7dfd1143-a1e0-4029-b98c-991365a174e4 | minsukchang/beliefbox | src/algorithms/ContinuousPolicy.cc | // -*- Mode: c++ -*-
// copyright (c) 2012 by <NAME> <<EMAIL>>
// $Revision$
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it unde... | ALGO | 0.922373 | 5.897063 | {
"github_metadata": {
"branch": "master",
"commit_count": 1217,
"repo_created_at": "2015-04-01T07:14:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b1df50... |
d309b1e5-b9e7-4b8d-8eb6-d41992a62bfc | jkleejklee/Algorithm | 3468/main.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
const int N = 100005;
struct SegmentTree
{
int p;
int r;
long long k;
long long s;
SegmentTree() {}
SegmentTree(int a, int b) : p(a), r(b), k(0) {}
} T[3 * N];
int A[N];
long long ans;
void build(int x, int p, int r)
{
T[x] = ... | ALGO | 0.999952 | 5.078298 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2021-01-08T11:52:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db308f632... |
49ba93fb-3281-4c24-9faa-518ddc6d52dc | aryarajnishu/DSA-leetcode | 2127.cpp | #include <iostream>
#include <vector>
#include <unordered_set>
#include <stack>
#include <algorithm>
using namespace std;
void dfs(int node, vector<vector<int>> &adj, vector<bool> &visited, vector<bool> &recStack, vector<int> ¤tCycle, vector<int> &maxCycle) {
visited[node] = true;
recStack[node] = true;... | ALGO | 0.999876 | 6.111618 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-10-11T05:26:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cdc79abcb939... |
b59d0288-1cee-4600-94c4-42b8fc0f9ec3 | abdelaleem024/competitive-programming | Solutions/Codeforces Gym Solutions/2014-2015 ACM-ICPC Pacific Northwest Regional Contest (Div. 2)/T - Runes.cpp | /*
Author : <NAME>
Codeforces Handle : [Abdelaleem](https://codeforces.com/profile/Abdelaleem)
Link To Gym : https://codeforces.com/gym/101653
*/
#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define int long long
int solve(string s, int d) {
for (char &i: s)if (i ==... | ALGO | 0.999909 | 4.187251 | {
"github_metadata": {
"branch": "main",
"commit_count": 531,
"repo_created_at": "2021-11-17T18:36:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 53,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83f3e48c1... |
c41ea76e-3df2-4dab-a504-eaec9a950012 | Kitware/VTK | Rendering/Volume/vtkBlockSortHelper.h | // SPDX-FileCopyrightText: Copyright (c) <NAME>, <NAME>, <NAME>
// SPDX-License-Identifier: BSD-3-Clause
/**
* @brief Collection of comparison functions for std::sort.
*
*/
#ifndef vtkBlockSortHelper_h
#define vtkBlockSortHelper_h
#include "vtkCamera.h"
#include "vtkDataSet.h"
#include "vtkMatrix4x4.h"
#include "v... | ALGO | 0.999461 | 7.271552 | {
"github_metadata": {
"branch": "master",
"commit_count": 94968,
"repo_created_at": "2010-04-27T15:12:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2910,
"forks": 1246,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9... |
5b69a2a7-5b2b-4cff-820f-fe141decadf6 | qdcampagna/BTODSTARLNUNP_EVTGEN_Model | src/EvtGenModels/EvtCBTo3piP00.cpp |
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* ... | TOOL | 0.970204 | 5.981326 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2022-03-12T20:42:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0bfd57f02e5... |
aa9ab535-014e-415c-86d8-04d5593e3a66 | sudikshasharma/data-structures-and-algorithms-cpp | LinkedList/LinkedListOperations_ListStl.cpp | /*
Cpp program to create a linked list and implement its basic operations like insertion, deletion etc. using oop.
The given program is written in the way the actual class 'List' is defined in stl.
*/
#include <iostream>
// Forward declaration (of List class) to avoid errors (as List class is defined after Node cla... | ALGO | 0.997806 | 5.985862 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2020-05-18T11:47: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": "77db0a7d9... |
bcc29305-46bb-4dbb-b20d-be746eece657 | TIWTIW/causual-project | TinySTL/Include/sequence_container/zft_list.h | #ifndef _ZFT_LIST_H
#define _ZFT_LIST_H
#include "../memory/zft_construct.h"
#include "../memory/zft_default_alloc.h"
#include "../memory/zft_simple_alloc.h"
#include "../memory/zft_uninitialized.h"
#include "../iterators/zft_iterator.h"
namespace zft
{
//list node
template <class T>
struct __list_node
{
typedef ... | TOOL | 0.978126 | 5.88115 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2018-01-15T03:52:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "962e88a0d... |
cde0aa3d-3215-4d09-8e2d-0120c3b6fda8 | thefreebird777/279Prog4 | Graph.cpp | #include <iostream>
#include <fstream>
#include <map>
#include <sstream>
#include <vector>
#include <algorithm>
using namespace std;
struct Node {
string vert;
int weight;
Node *next;
};
struct List {
struct Node *head;
};
// Edge struct to hold edge data for finding MST
struct Edge {
string sou... | ALGO | 0.999713 | 4.399427 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2016-12-15T04:25: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": "902cdde71... |
6a0a81d0-b662-498f-8ce8-1660f2671082 | RahulkumarRV/algorithms_and_data_structure | stack/interleave_queue_ele.cpp | #include<bits/stdc++.h>
using namespace std;
void interLeaveQueue(queue<int> &q){
if(q.size() % 2 != 0){
cout<< "input queue not have even size";
return ;
}
int n = q.size() / 2;
stack<int> st;
for(int i=0; i<n; i++){
int ele = q.front(); q.pop();
st.push(ele);
... | ALGO | 0.999549 | 3.978542 | {
"github_metadata": {
"branch": "master",
"commit_count": 174,
"repo_created_at": "2021-04-24T14:54: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": "f05c30ff... |
cb7f5a97-ed73-44dc-8904-ec06a7af8ed8 | satyampandey9811/competitive-programming | 1. HackerRank/algorithms/easy level/083. day of the programmer.cpp | // link to question - https://www.hackerrank.com/challenges/day-of-the-programmer/problem
#include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
// Complete the dayOfProgrammer function below.
string dayOfProgrammer(int year) {
string a="12.09.",b="13.09.",c="2... | ALGO | 0.999554 | 4.52511 | {
"github_metadata": {
"branch": "master",
"commit_count": 1478,
"repo_created_at": "2019-08-20T10:43: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": "33c003b... |
eba447df-54f2-4483-8824-0fba8adeb7e4 | AntiAnti/FreeAnimHelpers | FreeAnimHelpers/Source/FreeAnimHelpersEditor/Private/DistanceCurveModifierEx.cpp | // Copyright Epic Games, Inc. All Rights Reserved.
#include "DistanceCurveModifierEx.h"
#include "Animation/AnimData/IAnimationDataController.h"
#include "Runtime/Launch/Resources/Version.h"
#include "FreeAnimHelpersLibrary.h"
#include "AnimationBlueprintLibrary.h"
#include "Animation/AnimSequence.h"
#include "Animati... | ALGO | 0.98737 | 7.148039 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2022-06-24T16:06:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 71,
"forks": 7,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "291f63aa89... |
3848e88a-a316-454b-bfcc-31eb4face7ce | SindormirNet/CursoArduinoBasico-EjerciciosResueltos | Concurso Televisivo/Concurso_Televisivo_Parte_III/Concurso_Televisivo_Parte_III.ino | #define PULSADOR_ROJO A0 // Constante que asigna el pulsador del equipo rojo
#define PULSADOR_VERDE A1 // Constante que asigna el pulsador del equipo verde
#define PULSADOR_PRESENTADOR A2 // Constante que asigna el pulsador del presentador
#define PULSADOR_ACIERTO A3 // Cons... | TOOL | 0.935738 | 5.385633 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2014-11-28T10:13:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "719304724fd... |
442767a6-9809-4040-a985-3ed5ac710a7c | SaineeNihar/Trees | CheckForBST.cpp | #include<bits/stdc++.h>
using namespace std;
class node
{
public:
int data;
node *lc,*rc;
node(int d)
{
data=d;
lc=nullptr;
rc=nullptr;
}
};
node *insert(node *root,int x)
{
if(!root)
return new node(x);
if(x<root->data)
root->lc=insert(root->lc,x)... | ALGO | 0.999968 | 4.275745 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-07-12T04:28: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": "e56a544e5... |
031d18b9-8519-4fb8-993f-ee6bd10cf2b8 | kristi141/c-plus-plus-progects | Циклы/factorial.cpp | /*RU
Условие:
Дано натуральное число n.
Необходимо вычислить факториал числа n (n!).
Примечание: n! = 1*2*3*…*n
Входные данные:
В первой строке входного файла дано натуральное число n (1 ≤ n ≤ 12).
Выходные данные:
В выходной файл необходимо вывести единственное значение -
факториал числа n.
Входные данные:
5
Вых... | ALGO | 0.99998 | 4.625999 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2024-06-22T10:21:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "519c5b6af8e... |
f9a9b51f-1d8c-4087-b726-7480498f9413 | Yash59ops/Leetcode-Solution | Burning Tree - GFG/burning-tree.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
Node *left;
Node *right;
Node(int val) {
data = val;
left = right = NULL;
}
};
Node *buildTree(string str) {
// Corner Case
if (str.length() == 0 || st... | ALGO | 0.999628 | 5.580825 | {
"github_metadata": {
"branch": "main",
"commit_count": 1162,
"repo_created_at": "2023-01-24T17:20: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": "40e332c3a... |
3b50b03b-1fec-4485-87ce-873ddfafbb61 | lyh983012/DSA2018-THU | PA4/kidd/1dtree.cpp | #include<iostream>
using namespace std;
#define lc index*2
#define rc index*2+1
#define ln index-1
#define rn index+1
#define length(index) tree[(index)].b-tree[(index)].a
#define upgrade(index) tree[(index)].sum=tree[lc].sum+tree[rc].sum;
class pockers{
public:
int a,b;
int lazy;
int sum;
int sum0;
pockers(){
... | ALGO | 0.999871 | 3.474612 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-10-24T11:12:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a93bd75972... |
740ab56e-6761-45b6-81aa-a0855c4bcf8b | dreyus95/AVSP_SourceQualityPrediction | CodeJamCrawler/dataset/10_18033_43.cpp |
# include <cstdio>
# include <iostream>
# include <fstream>
# include <list>
using namespace std ;
list<int> L ;
void initList(int *array,int size) {
if(L.empty()==false) {L.clear();}
for(int i=0;i<size;++i) {
L.push_back(array[i]) ; }
}
int main() {
int T ;
int R ;
int K... | ALGO | 0.99957 | 3.590942 | {
"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": "ab3f82565... |
58cd8142-1ab9-451d-b3a3-8437235ff32a | kgn1003/Algorithm | BaekJoon/[2178]미로탐색.cpp | #include <iostream>
#include <queue>
using namespace std;
int N, M, arr[101][101], map[101][101];
char c;
int dy[] = { -1,1,0,0 }; int dx[] = { 0,0,1,-1 };
int BFS(pair<int,int> pos) {
queue<pair<int, int>> q;
q.push(pos);
while (!q.empty()) {
int q_size = q.size();
for (int i = 0; i < q_size; i++) {
int y =... | ALGO | 0.999914 | 3.661275 | {
"github_metadata": {
"branch": "main",
"commit_count": 324,
"repo_created_at": "2021-03-17T10:40:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67bfe72ff6... |
2540d398-3bc9-4efc-8e69-e51bdcb339ad | ABHISHEKBANKAWAT/Prarambh | LinkedList/rough.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node *next;
Node(int d){
data = d;
next = NULL;
}
};
void printList(Node *head){
Node * temp = head;
while(temp!=NULL){
cout<<temp->data<<",";
temp=temp->next;
}
}
Node *addAtHead(Node * head){
Node * newh... | ALGO | 0.999797 | 3.873173 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2022-05-05T06:06:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "85b808de0... |
e7c19f36-dd64-432a-ac22-d3ef91f33b8b | louloubadillo/OOP_TC1033 | 12.cuadrado.cpp | #include <iostream>
using namespace std; //para no repetir std
//método para formar rectágulos
void cuadrado(int width, int height){ //pedir ancho y alto
//Si es par, lo hace impar
if (width % 2 == 0 ){
width++;
}
if (height % 2 == 0){
height++;
}
//Itera en las filas y colum... | ALGO | 0.989608 | 4.200567 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2019-11-04T17:29: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": "83e0ff175... |
42d59d5b-5ee6-4010-a155-a424b3fb86db | tiqwab/atcoder | abc222/c/main.cpp | #include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#include <limits.h>
using namespace std;
typedef long long ll;
template<class T>
inline bool chmax(T &a, T b) {
if(a < b) {
a = b;
return true;
}
return false;
}
... | ALGO | 0.999991 | 3.639441 | {
"github_metadata": {
"branch": "master",
"commit_count": 236,
"repo_created_at": "2019-10-21T04:57:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b7a31f4... |
dd91d2dd-18e2-4d62-82c9-b7623127cf6a | brstu/OTIS-2024 | trunk/ii0230278/task_03/src/main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
#include <set>
class Node {
public:
std::string name;
std::set<std::string> content; // содержание узла, например, текст, ссылки на файл
Node() : name("") {} // Конструктор по умолчанию
Node(const std::string &name) : name... | ALGO | 0.996987 | 5.565216 | {
"github_metadata": {
"branch": "main",
"commit_count": 243,
"repo_created_at": "2024-09-05T07:07:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 51,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "aa249f33bb... |
4682f4f8-6f22-42e3-9d4d-06c70362a0be | sureyeaah/Competitive | uva/CH04/10600.cpp | #include <bits/stdc++.h>
using namespace std;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define FOR0(i,n) for(int i=0, _##i=(n); i<_##i; ++i)
#define FOR(i,l,r) for(int i=(l), _##i=(r); i<_##i; ++i)
#define FORD(i,l,r) for(int i=(r), _##i=(l); --i>=_##i; )
#define repi(i,a) for(__typeof((a).begin()) i=(a)... | ALGO | 0.999923 | 3.774476 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2017-11-01T21:03:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ecde270f... |
b0271fc4-552d-420f-bf16-29d9c5e8704d | taimoorAhmad4/cpp-codes | 2019511 (avl tree)/2019511_2019419_HW5.cpp | // this program was written by <NAME> 2019511 and <NAME> 2019419
#include<iostream>
#include <string>
using namespace std;
struct directoryData {
string phoneNumber;
string Name;
string address;
string email;
};
class node{
public:
directoryData* data = new directoryData;
node* left;
node* right;
int height;... | ALGO | 0.997905 | 3.794264 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-02-25T21:46: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": "d0698da3d3dd... |
fdac3f1d-f34b-4292-af64-af2da6aa7478 | 1m188/algorithm | 洛谷/P1706 全排列问题.cpp | /**
* @file P1706 全排列问题.cpp
* @date 2022-06-09
*/
/*
# 全排列问题
## 题目描述
按照字典序输出自然数 $1$ 到 $n$ 所有不重复的排列,即 $n$ 的全排列,要求所产生的任一数字序列中不允许出现重复的数字。
## 输入格式
一个整数 $n$。
## 输出格式
由 $1 \sim n$ 组成的所有不重复的数字序列,每行一个序列。
每个数字保留 $5$ 个场宽。
## 样例 #1
### 样例输入 #1
```
3
```
### 样例输出 #1
```
1 2 3
1 3 2
2 1 3
... | ALGO | 0.99987 | 5.397696 | {
"github_metadata": {
"branch": "master",
"commit_count": 2060,
"repo_created_at": "2019-07-03T03:19:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5e8447... |
e9cf5853-8c2f-4e3d-9631-e0e27d22e3bc | KartikJS1/Striver-SDE-Sheet | BinarySearchTrees/139)ConstructBSTfromPreorderTraversal.cpp | #include <bits/stdc++.h>
/*************************************************************
Following is the Binary Tree node structure
template <typename T>
class TreeNode{
public:
T data;
TreeNode<T> *left;
TreeNode<T> *right;
TreeNode(T data) {
this->data =... | ALGO | 0.999978 | 4.547739 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2023-06-04T06:27: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": "9e61e73099a... |
3bca02d6-9136-4469-845c-abe524c9558c | ArinNigam/DSA-Grind | POTD/Aug2024/LC_9aug.cpp | // Magic Squares In Grid (Medium)
// A 3 x 3 magic square is a 3 x 3 grid filled with distinct numbers from 1 to 9 such that each row, column, and both diagonals all have the same sum.
// Given a row x col grid of integers, how many 3 x 3 contiguous magic square subgrids are there?
// Note: while a magic square can on... | ALGO | 0.999929 | 5.808485 | {
"github_metadata": {
"branch": "main",
"commit_count": 287,
"repo_created_at": "2023-12-29T11:01:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af73a99b24... |
304bec2f-3971-4ac7-849c-92731177e9ad | Anikk1234/DSA | dsa_graph_tree_leetcode_codeforces_codechef_uva_problemSolution/graphConnecitivity.cpp | //Problem: Finding connected components in an undirected graph
// Description: Count the number of connected components in an undirected graph.
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class DisjointSet {
private:
vector<int> parent, rank;
public:
DisjointSet(int n) {
... | ALGO | 0.999932 | 6.305831 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2025-01-08T13:05: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": "c6f8bc63362... |
88021579-f3c4-4618-8037-eaa597b50718 | p-zany/leetcode-practice | include/1091.二进制矩阵中的最短路径.cpp | /*
* @lc app=leetcode.cn id=1091 lang=cpp
*
* [1091] 二进制矩阵中的最短路径
*/
// @lc code=start
#include <vector>
#include <map>
#include <set>
#include <queue>
using namespace std;
class Solution {
public:
int shortestPathBinaryMatrix(vector<vector<int>>& grid) {
int n = grid.size();
if (grid[0][0] !=... | ALGO | 0.999991 | 5.944992 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2021-05-22T12:08: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": "123851b21... |
bcd7ea47-322a-4729-8bf6-b4e76c636ce9 | allouchear/CdftT | src/lib/Utils/LM.cpp | #include<iostream>
#include<cmath>
#include <Utils/LM.h>
using namespace std;
LXYZ::LXYZ()
{
_coef = sqrt(1.0/(4*M_PI));
_l = vector<int> (3, 0);
}
LXYZ::LXYZ(vector<int> L, double C)
{
_l=L;
_coef=C;
}
Zlm::Zlm()
{
setZlm0();
}
Zlm::Zlm(int L, int M, Binomial& Bin)
{
_bino=Bin;
if(L==0 && M == 0)
setZlm0... | ALGO | 0.997788 | 3.24062 | {
"github_metadata": {
"branch": "master",
"commit_count": 176,
"repo_created_at": "2024-04-12T09:44: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": "b8a27b84... |
28242130-d28b-4d5a-91ba-fd0e9bc5c163 | Amanhacker/Aman-Barnwal-Leetcode-Solutions | 4sum/4sum.cpp | class Solution {
public:
vector<vector<int>> fourSum(vector<int>& a, int tar) {
vector<vector<int>> res;
vector<int> path;
int n = a.size();
sort(a.begin(), a.end());
for(int i=0; i<n-3; i++) {
for(int j=i+1; j<n-2; j++) {
... | ALGO | 0.999692 | 5.963092 | {
"github_metadata": {
"branch": "master",
"commit_count": 2521,
"repo_created_at": "2021-12-24T16:13:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 441,
"forks": 140,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d3... |
19967daf-8006-442a-8fc0-b28972d85c90 | shashimehta03/cpp | binary_linear_menu.cpp | #include<iostream>
using namespace std;
void linear()
{
int arr[10],num,i,n,found=0,pos=-1;
cout<<"Enter the number of element";
cin>>n;
cout<<"Enter the elements";
for(i=0;i<n;i++)
{
cin>>arr[i];
}
cout<<"Enter the number you want to search";
cin>>num;
for(i=0;i<n;i++)
... | ALGO | 0.999501 | 3.4966 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-12-21T09:32: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": "5c1d9d031737... |
829a6f7b-c787-4bde-acdf-5bcdfcefa833 | GaurangRastogi/Codeforces | C_Swap_Letters.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
void solve(){
ll n,count=0,temp,ind,temp2;
cin>>n;
string s,t;
cin>>s>>t;
stack<ll>sa,sb,ta,tb;
set<ll>st{};
for(int i=0;i<n;i++){
if(s[i]!=t[i]){
if(s[i]=='a')
sa.push(i);
... | ALGO | 0.999818 | 3.379689 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-11-16T15:04: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": "ffaf84e8b983... |
46231049-54e6-48bf-98d6-cd4193298c1f | TodorokiKohei/atcoder | 2020_09/05/prac/abc139e.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for(int i = a; i < b; i++)
#define all(x) (x).begin(),(x).end() // 昇順ソート
#define rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
ty... | ALGO | 0.999957 | 3.786556 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-11-25T17:10: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": "4be8a20431a... |
c9ecba3b-4e93-4d56-ac67-01a2111971d2 | deeptishakya22/GfG-LeetCode | Medium/Remove K Digits/remove-k-digits.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
string removeKdigits(string S, int K) {
if(K >= S.size()) return "0";
stack<int> stk;
for(i... | ALGO | 0.999972 | 6.32167 | {
"github_metadata": {
"branch": "main",
"commit_count": 718,
"repo_created_at": "2023-11-24T14:30:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e440d919b8... |
4822344b-91af-43d1-bbdb-67d7a09a16bd | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/05/0513/personal_submission/cf799c_inhng.cpp | #include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define endl '\n'
#define int long long
#define lowbit(x) x & -x
#define PII pair<int, int>
#define PIII pair<int, PII>
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7; // 998244353;
int f(vector<PII> a, int money) {
int ans = 0... | ALGO | 0.999261 | 5.015496 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "dabd... |
4d0cad03-9c71-4e79-89f4-490dcb5d34f3 | MatousProchazka/GrassDistribution | poissonDiskLibrary/cuda_poisson_lib.h | // Copyright 2020 <NAME>, Bohemia Interactive, a.s.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions an... | ALGO | 0.9889 | 3.202549 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2020-10-19T19:41:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf909b250aeb... |
822e688a-de95-4d7d-af0e-0c8f77b36971 | insanfajri18/LabPA1-Algo2-222310004 | Tugas pertemuan ke-2/Tugas Pertemuan 2 nomor 2.cpp | #include <iostream>
using namespace std;
int const SIZE = 5;
void swap(int &a, int &b)
{
int temp;
temp = a;
a = b;
b = temp;
}
void PrintArray(int* array, int n)
{
int i;
for( i = 0; i < n; i++) cout<<array[i]<<',';
}
int SplitArray(int* array, int pivot, int... | ALGO | 0.999936 | 5.788033 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-03-13T05:01: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": "59ede532a32... |
db2b9c4c-a120-4704-96ad-3cbb5f620dfe | wxyz202/WXYZSudoku | WXYZSudoku/Model/SudokuGenerator.cpp | //
// SudokuGenerator.cpp
// WXYZSudoku
//
// Created by wxyz on 14-1-11.
// Copyright (c) 2014年 wxyz. All rights reserved.
//
#include <ctime>
#include <cstdlib>
#include <random>
#include "SudokuGenerator.h"
#include "SudokuSolver.h"
using namespace std;
static const int MAX_EMPTY_GRIDS[6] = {35, 40, 50, 60, 6... | ALGO | 0.964324 | 4.240051 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2014-01-04T03:05:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb5520031... |
f04f8aa2-5dfe-44ef-85ae-cdfc6ae38932 | satyanarayanbarik/CP_31-solutions | Halloumie.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t; // for no. of test cases
while(t--){
long long n,k;
cin >> n >> k;
vector<long long> a(n);
for(int i = 0; i < n; i++){
cin >> a[i];
}
vector<long long> copyOf_a = a;
sort(co... | ALGO | 0.999945 | 4.031113 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-05-14T15:34: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": "92f093fcbc83... |
38d8a6a5-70f8-470b-adbf-c74306c7491e | Anurag-Mishra2006/DSA-in-cpp | prime_Math/2_leetcode-2614.cpp | #include <bits/stdc++.h>
using namespace std;
/*
You are given a 0-indexed two-dimensional integer array nums.
Return the largest prime number that lies on at least one of the diagonals of nums. In case, no prime is present on any of the diagonals, return 0.
Note that:
An integer is prime if it is greater than 1 and h... | ALGO | 0.99997 | 5.371394 | {
"github_metadata": {
"branch": "main",
"commit_count": 65,
"repo_created_at": "2024-09-10T08:16: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": "9c8ad3a92c7... |
dc6b6c6c-af16-41db-8b36-7fb943e2f16d | sajal-jayanto/Algorithm_ACM_problems | Spoj/SQFREE.cpp |
#include <bits/stdc++.h>
using namespace std;
#define sf scanf
#define pf printf
#define MAX 10000010
bool sieve[MAX];
int mobius[MAX];
vector < int > prime;
void is_prime()
{
int k = sqrt(MAX);
prime.push_back(2);
for(int i = 3 ; i <= k ; i = i + 2)
{
if(!sieve[i]) for(int j = i * i ; j < ... | ALGO | 0.999907 | 3.970726 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2017-08-03T19:21:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b744d1233... |
43c7eced-ca82-4954-8bd3-344b526f3c85 | GregWagner/Udemy-DSA-Courses | Mastering_Critical_Skills/Skills/Section_10_Multidimensional_Arrays/02_Medium/homework_01_How_Many_Primes.cpp | #include <iostream>
auto isPrime(int n) -> bool {
for (int i { 2 }; i <= n / 2; ++i) {
if (n % i == 0) {
return false;
}
}
return true;
}
auto main() -> int {
int a[101][101];
std::cout << "Enter the number of rows and colums: ";
int rows {}, columns {};
std::c... | ALGO | 0.999677 | 5.738313 | {
"github_metadata": {
"branch": "master",
"commit_count": 124,
"repo_created_at": "2022-11-30T20:34: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": "c0660f30... |
a712df77-cae2-49d8-a324-844794f13d11 | lifespank/baekjoon_cpp | 1939.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <queue>
#define INF 1e9
using namespace std;
vector<pair<int, int>> graph[10001];
int N, M;
int dist[10001];
void dijkstra(int start) {
priority_queue<pair<int, int>> q;
q.push({INF, start});
dist[start] = INF;
while(!q.empty()) ... | ALGO | 0.999947 | 4.057219 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2022-03-12T12:58: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": "41d599cf153... |
03d24a3b-1626-48db-8073-71acebc4809f | Shahraaz/CP_S5 | codeforces/practice/DIV2_103D.cpp | //Optimise
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
// #define MULTI_TEST
#ifdef LOCAL
#define db(...) ZZ(#__VA_ARGS__, __VA_ARGS__);
#define pc(...) PC(#__VA_ARGS__, __VA_ARGS__);
template <typename T, typen... | ALGO | 0.999881 | 4.553486 | {
"github_metadata": {
"branch": "master",
"commit_count": 219,
"repo_created_at": "2019-07-15T23:57:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ebe6f8a8... |
99eb8fc5-8693-4857-b27d-f4f911374250 | elnahassahmed34/neetcode | 02_Two_Pointers/03_three_integer_sum/main.cpp | #include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
vector<vector<int>> result;
int n = nums.size();
if (n < 3) return result;
// Sort the array
sort(nums.begin(... | ALGO | 0.999996 | 6.562094 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2024-06-27T12:20: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": "7926dbb6bb5... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.