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 |
|---|---|---|---|---|---|---|---|
d8db9df7-4c4b-40ef-a142-bac31f87bc18 | himanshu9999git/DSA-Solutions | Dynamic Programming/RodCutting.cpp | #include <bits/stdc++.h>
using namespace std;
int RodCutting(vector<int> length, vector<int> price, int len, int n)
{
vector<vector<int>> dp(n + 1, vector<int>(len + 1, 0));
for (int i = 1; i < n + 1; i++)
{
for (int j = 1; j < len + 1; j++)
{
if (length[i - 1] <= j)
... | ALGO | 0.999963 | 4.24876 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-09-10T11:51: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": "7a1af3eb2128... |
7d99b73b-1269-4e2d-972d-6536e0477628 | dimak24/MIPT-Algorithms-and-Data-structures | EffectiveModernDinamicProgramming/ahalaimahalai.h |
/*У маленького мальчика Илюши было k клетчатых досочек размеров M_i на N_i, где M_i <= 6, N_i <= 100.
Дома по вечерам, когда все взрослые смотрели программу “Время”,
он любил делать замощения этих досочек доминошками размера 1х2.
Однажды ему пришел в голову вопрос: а сколькими различными способами он может замостить к... | ALGO | 0.999914 | 4.095778 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2016-11-01T19:43: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": "337d6f4c1... |
6150bf78-33e0-4813-afb1-98f74e5e7034 | AlexanderGarifullin/competitive-programming | Codeforces/Rounds/Div-2/592/1244D.cpp | #include <bits/stdc++.h>
// #pragma GCC target ("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
#define en '\n'
//#define mp make_pair
#define isz(x) int((x).size())
#define ins insert
#define pb push_back
#define eb emplace_back
#define bg(x) begin(x)
#define all(x) bg(x), end(x)
#def... | ALGO | 0.999993 | 4.289351 | {
"github_metadata": {
"branch": "main",
"commit_count": 2804,
"repo_created_at": "2023-07-17T09:16:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89a5eb1d0... |
f9f3e723-dbe0-44a4-8ffc-fa5cdafe16a6 | challan/Deal.II-Tutorial | include/deal.II/base/utilities.h | // ---------------------------------------------------------------------
//
// Copyright (C) 2005 - 2016 by the deal.II authors
//
// This file is part of the deal.II library.
//
// The deal.II library is free software; you can use it, redistribute
// it, and/or modify it under the terms of the GNU Lesser General
// Pu... | TOOL | 0.906892 | 7.040715 | {
"github_metadata": {
"branch": "master",
"commit_count": 35719,
"repo_created_at": "2017-03-20T22:19: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": "943b45... |
889a0aa9-3bea-40ef-a699-87b9a9e0a474 | cccrrrccc/VPR-Gym | ODIN_II/SRC/MixingOptimization.cpp | /*
* 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 to use,
* copy, modify, merge, publish, distribute, sublicense, and/or s... | ALGO | 0.989556 | 6.495514 | {
"github_metadata": {
"branch": "main",
"commit_count": 85,
"repo_created_at": "2022-07-05T15:08:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c90a22a4fc... |
b9d5b853-632d-4426-bb0a-05e7e4630f75 | varun1729/Project-Euler | 15.cpp | #include <iostream>
using namespace std;
long binomialCoeff(long n, long k)
{
long C[k+1];
//memset(C, 0, sizeof(C));
C[0] = 1; // nC0 is 1
for (long i = 1; i <= n; i++)
{
// Compute next row of pascal triangle using
// the previous row
for (long j = min(i, k); j > 0; j-... | ALGO | 0.999911 | 4.611376 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2017-11-10T07:22:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e14d8effc... |
6fb6e753-ab52-472f-bfbe-ec1f40ae2a1c | thirofoo/atcoder-archives | abc342/abc342_e_50615469_AC.cpp | /*
* Author: through
* Submission URL: https://atcoder.jp/contests/abc342/submissions/50615469
* Submitted at: 2024-02-24 23:37:39
* Problem URL: https://atcoder.jp/contests/abc342/tasks/abc342_e
* Result: AC
* Execution Time: 319 ms
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P... | ALGO | 0.999797 | 5.012467 | {
"github_metadata": {
"branch": "main",
"commit_count": 5513,
"repo_created_at": "2022-12-17T09:45:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "8f49302ab... |
aa7c1886-1f89-40ea-bb35-a859deac6d36 | NikitaS4/regbm | Code/GBoosting/src/common/GBDecisionTree.cpp | #include "GBDecisionTree.h"
#include "StatisticsHelper.h"
#include <stdexcept>
#include <cstdlib>
#include <cmath>
const float GBDecisionTree::scoreInRandNoiseMult = 0.3f;
GBDecisionTree::GBDecisionTree(const size_t treesInEnsemble,
const Lab_t regularizationParam,
const bool spoilScores,
const float learningRa... | ALGO | 0.969325 | 6.466726 | {
"github_metadata": {
"branch": "main",
"commit_count": 200,
"repo_created_at": "2020-11-10T11:52:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "87ba6ebca2... |
a64e7a63-1874-4f66-a2f2-717064c00368 | i-am-arvinder-singh/CP | Segment Tree Problems/CF-F-Heavens Arena-AP in Segment Tree(Lazy Prop).cpp | #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 endl "\n"
#define ll long long
#define int long long
#define ff first
#define ss second
... | ALGO | 0.999099 | 4.076764 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2020-05-25T21:25: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": "912325dd... |
a8957284-2375-4aad-9ece-2eed0469cb72 | Lunarskii/Parallels | sources/grape/grape.cc | #include "grape/grape.h"
namespace s21 {
Grape::Grape(const Matrix<double>& m1, const Matrix<double>& m2) {
LoadMatrices(m1, m2);
}
void Grape::LoadMatrices(const Matrix<double>& m1, const Matrix<double>& m2) {
if (m1.GetRows() == 0 || m1.GetCols() == 0 || m2.GetRows() == 0 ||
m2.GetCols() == 0) {
thro... | ALGO | 0.9979 | 6.285181 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-11-02T00:35: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": "8304446ce81a... |
9ea04763-e6fd-4e99-9a5c-d7de4149ca8f | QuickSorting/CompetitiveProgramming | Olympiad/IOI/IOI 14-gondola.cpp | #include "gondola.h"
#include <bits/stdc++.h>
using namespace std;
bool check_valid_pair(int lvalue, int rvalue, int n){
if(lvalue <= 0 || rvalue <= 0)
return false;
if(lvalue > n || rvalue > n)
return true;
if((lvalue + 1) % n != rvalue % n)
return false;
return true;
}
int valid(int n, int inputSeq[]){
... | ALGO | 0.999913 | 4.432211 | {
"github_metadata": {
"branch": "master",
"commit_count": 107,
"repo_created_at": "2019-08-13T13:48: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": "a8a4b010... |
c4323686-0f83-4b39-8fda-16c56ea6ba16 | bioinf/Sibelia | src/include/seqan/graph_align/graph_align_smith_waterman_clump.h | // ==========================================================================
// SeqAn - The Library for Sequence Analysis
// ==========================================================================
// Copyright (c) 2006-2010, <NAME>, FU Berlin
// All rights reserved.
//
// Redistribution and use in s... | ALGO | 0.999829 | 7.028569 | {
"github_metadata": {
"branch": "master",
"commit_count": 653,
"repo_created_at": "2012-03-09T18:04:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 68,
"forks": 17,
"issues": 16,
"pull_requests": 0
},
"file_meta": {
"content_id": "33437a... |
c985f597-58c6-4dd7-82cd-a0c4c51623e7 | nillerusr/source-engine | engine/sound_shared.cpp | //========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Sound code shared between server and client
//
//=============================================================================//
#include <math.h>
#include "convar.h"
#include "sound.h"
ConVar snd_refdist( "snd_refdist", "3... | TOOL | 0.977503 | 5.529528 | {
"github_metadata": {
"branch": "master",
"commit_count": 551,
"repo_created_at": "2020-10-22T15:16:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1850,
"forks": 286,
"issues": 89,
"pull_requests": 19
},
"file_meta": {
"content_id": "3... |
8f1d1e4c-1173-43ed-b30f-def3b4136e64 | gautam-bits/CompetitiveCoding | Codeforces/Edu(108)Div2/C.cpp | // This is an intellectual property of <NAME> ,
// So please use it with extreme CAUTION .
//-------We can be heroes , just for one day!!.---------//
#include <bits/stdc++.h>
using namespace std;
//*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ knowledge $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*//
#define... | ALGO | 0.999986 | 3.833506 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2020-09-16T19:20: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": "6f2735fa4... |
43b4610b-cc6b-4a5b-aac9-c97c3b560c5c | PavPS/Careercup | Epic2.cpp | #include "stdafx.h"
/*
Edge Detection:
Two-dimensional array representation of an image can also be represented by a one-dimensional
array of W*H size, where W represent row and H represent column size and each cell represent
pixel value of that image. you are also given a threshold X.
For edge detection, you have ... | ALGO | 0.977892 | 4.607302 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2014-07-08T01:42:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f490a05... |
07c0e215-52c8-4585-b69c-6baa25e43ffc | Liuchenlong/acm | hdu/3579.cpp | #include<stdio.h>
#include<cmath>
#include<iostream>
#include<string.h>
#include<algorithm>
#include<queue>
#include<set>
#include<vector>
#include<map>
using namespace std;
#define eps 1e-9
long long gcd(long long a,long long b)
{
if(b==0)return a;
return gcd(b,a%b);
}
long long lcm(long long a,long long b)
{
... | ALGO | 0.999925 | 3.64847 | {
"github_metadata": {
"branch": "master",
"commit_count": 776,
"repo_created_at": "2016-05-18T16:06:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb76c84e... |
80bd04ba-8881-4991-a49f-4b828451b6ce | kkw2238/Programmers | C++/Level3/NQueen.cpp | #include <string>
#include <vector>
#include <queue>
using namespace std;
const int ABS(int x)
{
return x < 0 ? -x : x;
}
const bool IsRightQueens(vector<int>& queens, int x)
{
int y = queens.size() - 1;
for (int i = 0; i < y; ++i)
{
if (queens[i] == x)
{
return false;
}
else if (ABS(y - i) == ABS(x ... | ALGO | 0.999992 | 5.123485 | {
"github_metadata": {
"branch": "master",
"commit_count": 269,
"repo_created_at": "2021-02-06T09:23: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": "61ebf9b5... |
14544fe6-c0bb-4aeb-8f54-734c8ced8682 | Compressible-Flow-Simulation-Tool-Sets/NUC3d-cartisian | src/fft.h | #ifndef fft_h
#define fft_h
#include "field.h"
#include "MPICommunicator.h"
#include <iostream>
#include <sstream>
#include <fstream>
#include <map>
#include <memory>
#include "fftw3.h"
#include "fftw3-mpi.h"
/*
three dimensional fully parallel FFT for multidimensinal block is
very challenging. In this class, we use... | ALGO | 0.998794 | 5.439461 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-02-16T17:59:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc120d19dca... |
2ca8afbe-3086-4a87-b129-66e4dba6e383 | nur-alam/CrackingTheCodingInterview | Array Problems/removeDuplicatesFromArray/RDFSortedArray.cpp | // #include<bits/stdc++.h>
// using namespace std;
// // specifically for unsorted array
// int removeDuplicatesWithHashWay(int arr[], int n) {
// unordered_map<int, bool> m;
// for(int i = 0; i < n; ++i) {
// if(m.find(arr[i]) == m.end()) {
// //m[arr[i]] = true;
// m.insert({... | ALGO | 0.999759 | 5.573102 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2019-11-23T15:04: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": "a9452c843... |
277958a3-a0cc-4549-87b4-953d9ed5676a | organicmaps/organicmaps | base/limited_priority_queue.hpp | #pragma once
#include "base/assert.hpp"
#include <algorithm>
#include <functional>
#include <vector>
namespace base
{
// Priority queue that stores only N smallest elements.
template <typename T, typename CompareT = std::less<T>>
class limited_priority_queue
{
public:
typedef T value_type;
typedef typename std::... | ALGO | 0.997497 | 7.422027 | {
"github_metadata": {
"branch": "master",
"commit_count": 42613,
"repo_created_at": "2020-12-27T19:02:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11487,
"forks": 1128,
"issues": 2796,
"pull_requests": 182
},
"file_meta": {
"content_i... |
786853da-039d-444b-a4b9-a12d4347134c | ishandutta2007/codeforces-e | emthrm/normal/1619/B.cpp | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
constexpr int INF = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr double EPS = 1e-8;
constex... | ALGO | 0.998971 | 4.850611 | {
"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": "b0bb4591c6d6... |
b2663699-befa-41e7-b58c-a8638a999619 | kunalsahdeveloper/DSA | Array/LeetCode/26.removeDuplicates.cpp | // Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place
// such that each unique element appears only once. The relative order of the elements should
// be kept the same. Then return the number of unique elements in nums.
// Consider the number of unique elements of nums to be k... | ALGO | 0.999718 | 5.850284 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-01-24T13:21: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": "c5aaaf447fac... |
e18e678a-d8ec-4cbb-828d-aa76364a7f74 | drapz13/scripts-and-cmptprog | Competitive Coding/433A.cpp | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define _ ios_base::sync_with_stdio(false);cin.tie(0);
#define __ int t;cin>>t;while(t--)
#define endl '\n'
#define ispow2(n) (n&&(!(n&(n-1)))) ///check if its perfect power of 2
using namespace std;
template <typename T>
T modpow(T base, T exp, T ... | ALGO | 0.999808 | 3.759719 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2015-11-30T16:47: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": "1577ad0e3d... |
d7da2e02-9ba7-45f1-a9c9-e055a9734817 | gaolinorange/Automatic-Unpaired-Shape-Deformation-Transfer | ACAP_linux/3rd/gmm/include/gmm/gmm_vector_to_matrix.h | /* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2003-2012 <NAME>
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Publ... | TOOL | 0.986767 | 6.187254 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2018-09-09T07:35:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 251,
"forks": 44,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "931c71... |
41cc09fe-8d41-45d5-bdb6-b4c3cda89691 | minje46/Data_Structure | Stack/Problems/4889_safe_string.cpp | #include<iostream>
#include<stack>
#include<string>
using namespace std;
int Simulation(string str) // To figure out the minimum operation to make safe string.
{
stack<char>stk; // stk = The memory for storing open case's.
int cnt = 0;
for (int i = 0; i < str.length(); i++)
{
if (stk.empty() && str[i] == '}')... | ALGO | 0.997462 | 3.895878 | {
"github_metadata": {
"branch": "master",
"commit_count": 197,
"repo_created_at": "2019-10-06T11:47: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": "a28dc333... |
109944fa-2285-4feb-92a9-4d86438aaec0 | RmdanJr/Data-Structures-and-Algorithms-Specialization | 2-Data-Structures/programming-challenges/week2_priority_queues_and_disjoint_sets/2_job_queue/job_queue.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using std::cin;
using std::cout;
using std::pair;
using std::priority_queue;
using std::vector;
auto cmp = [](pair<int, long long> a, pair<int, long long> b)
{
return (a.second == b.second) ? (a.first > b.first) : (a.second > b.second);
};
... | ALGO | 0.999987 | 3.812409 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2021-09-25T14:38: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": "8c20681a4... |
ea892d68-3eae-4013-874b-d1c21083fd3e | Satyams-23/Confuse_Coder | DSA/Recursion/AllPermutation.cpp | // Print All Permutation of a string/array
// A permutation, also called an “arrangement number” or “order,” is a rearrangement of the elements of an ordered list S into a one-to-one correspondence with S itself. A string of length n has n! permutation.
// Recursion Approach
#include <iostream>
#include <vector>
usi... | ALGO | 0.999281 | 6.252063 | {
"github_metadata": {
"branch": "main",
"commit_count": 116,
"repo_created_at": "2024-02-08T12:03: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": "2ccf31c5c4... |
5bdad8f6-1217-4101-9f4b-f3a2c27c7340 | minbak26/Platinum | 백준/Silver/11660. 구간 합 구하기 5/구간 합 구하기 5.cc | #include<iostream>
#include<vector>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int N, M;
cin >> N >> M;
// 2차원 배열 초기화.
vector<vector<int>> arr(N + 1, vector<int>(N + 1, 0));
vector<vector<int>> dp(N + 1, vector<int>(N + 1, 0));
// 입력 및 누적 합 ... | ALGO | 0.999979 | 5.308829 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2025-02-14T02:48: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": "7a9db951da8... |
3b50eac6-d970-4806-9769-37942333e62a | dysuby/Learn-to-Program-CPP | 2427 [STL]Maze (eden)/Standard Answer/main.cpp | #include<cstdio>
#include<iostream>
#include<queue>
#include<cstring>
using std::cin;
using std::cout;
using std::endl;
using std::queue;
int n, m;
class state {
private:
int s_x, s_y;
int e_x, e_y;
int step;
public:
state() {step = 0;}
state(int a, int b, int c, int d) {
s_x = a;
... | ALGO | 0.999971 | 3.358379 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-07-05T13:22: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": "b16ed03f32... |
2132ce4e-3e0e-4c64-a0d6-da9cbeca08dc | Rey2607/Program-Robot-Manipulator | Program_Trajectory_GUI_Robot_Manipulator/main.cpp | #include <string.h> // Pustaka string.h untuk memproses input string
#define DXL_BUS_SERIAL3 3 // Menggunakan Serial3 (USART3) untuk komunikasi dengan Dynamixel
#define ID_NUM1 1 // ID motor Dynamixel pertama
#define ID_NUM2 2 // ID motor Dynamixel kedua
Dynamixel Dxl(DXL_BUS_SERIAL3);
void... | TOOL | 0.925608 | 6.404032 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-12-04T07:01:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df701d9ff26a... |
7ae19e20-f922-44bc-ac7f-380c2fde4b89 | Deok-min/me400 | ball_harvesting_zone_GroupB/vehicle_control/src/vehicle_control.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
#include <chrono>
#include <math.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <boost/thread.hpp>
#include <ros/ros.h>
#include <ros/package.h>
#include "sensor_msgs/LaserScan.h"
#include "geometry_msgs/PoseArray.h"
#include "std_m... | TOOL | 0.966534 | 3.30719 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2021-05-02T04:56:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2f6c8ad878... |
6080ea52-44ea-4c48-81a5-e2b2e0cbc635 | ernestognw/cpp-fundamentals | competenciaCiclos/LoopChallenge3/LoopChallenge3.cpp | // LoopChallenge3
// <NAME> A00820783
// Creado en Fri Oct 5 11:16:33 CDT 2018
#include<iostream>
using namespace std;
int main() {
// Declarar variables
int n = 0;
cin >> n;
for (int row = 1; row <= n; row++) {
// This for loop writes a descendant point triangle
for (int points = 0; points < n -... | ALGO | 0.999877 | 4.414822 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2018-08-28T15:27:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c0638448... |
d3c5a6e5-efe4-4b8c-a544-544ff7b7d8e0 | bayesiancook/bayescode | sources/Sum.hpp |
#ifndef SUM_H
#define SUM_H
/**
* \brief The product of a Selector<double> and a double
*
* takes two arguments: an array l_j and a double multiplier a, and
* returns, for index j, the product a * l_j.
*
*/
class Sum : public Selector<double> {
public:
//! \brief Constructor with branch array and multipl... | ALGO | 0.925051 | 4.617538 | {
"github_metadata": {
"branch": "master",
"commit_count": 877,
"repo_created_at": "2017-05-27T12:20:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 4,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "d364e218... |
2baf5b84-0f47-416d-97b7-5bc2a7fddbd2 | dkdlel/DongA-University | Algorithm/과제22(Water Tank)/watertank.cpp | #include<bits/stdc++.h>
using namespace std;
ifstream fcin("watertank.inp");
ofstream fcout("watertank.out");
typedef struct inf {
int x, y, h; // x, y : 좌표, h : 그때의 높이
};
bool operator <(inf A, inf B) {
return A.h > B.h;
};
class WaterTank {
public:
int T, N, M, H; // T : testcase, N : 세로, M : 가로, H : 높이
int res... | ALGO | 0.999689 | 3.599699 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2021-02-06T14:20:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51a28a760... |
e13a9aef-5de0-411f-b1e5-313598c614f2 | sunkyoo/opencv4cvml | ch09/edges/main.cpp | #include "opencv2/opencv.hpp"
#include <iostream>
using namespace cv;
using namespace std;
void sobel_derivative();
void sobel_edge();
void canny_edge();
int main(void)
{
sobel_derivative();
sobel_edge();
canny_edge();
return 0;
}
void sobel_derivative()
{
Mat src = imread("lenna.bmp", IMREAD_GRAYSCALE);
if... | ALGO | 0.997057 | 4.961261 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2019-03-17T01:06:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 171,
"forks": 126,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b446... |
40f57419-a79c-44d6-aa8f-1f3a96573ee8 | ftiasch/secret-weapon | 2014-06-09/b.cpp | #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long ll;
struct point
{
int x,y;
point(){}
point(int x,int y):x(x),y(y){}
};
inline point operator -(const point &a,const point &b)
{
return(point(a.x-b.x,a.y-b.y));
}
inline ll det(const point &... | ALGO | 0.999935 | 3.422253 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-02-02T10:07:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa1f5ebd99... |
84a62aca-24dd-49a3-9fd7-04b9f17da8df | gcamargo96/Competitive-Programming | problem-solutions/ICPC/NEERC/subregional/2009-2010/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define For(i,a,b) for(int (i)=(a);(i) < (b); ++(i))
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define PI acos(-1)
#define fastcin ios_base::sync_with_stdio(false);
typedef long long ll;
typedef unsigned long long u... | ALGO | 0.998127 | 3.594778 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2016-08-23T18:09:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c80680ae1... |
10229e91-12d4-4592-9a40-75283bf08a02 | omkarlenka/leetcode | kth_smallest_in_bst.cpp | //
// kth_smallest_in_bst.cpp
//
// Created by omlenka on 05/05/20.
// Copyright © 2020 <NAME>. All rights reserved.
//
#include <iostream>
using namespace std;
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0),... | ALGO | 0.999995 | 6.127783 | {
"github_metadata": {
"branch": "master",
"commit_count": 447,
"repo_created_at": "2020-04-10T09:27:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f65ce90... |
679ad63f-a296-4c4c-b252-8bb31122833e | equation314/simple-polygon | cpp/2-Opt-Move/basicOperation.hpp | #include "2-Opt-Move.hpp"
#ifndef BASIC_H
#define BASIC_H
/******************************************
* *
* Error Handling *
* *
*****************************************/
#define DELTA 1.0e-16
#define ERR_MEM 0... | ALGO | 0.998001 | 4.186447 | {
"github_metadata": {
"branch": "main",
"commit_count": 80,
"repo_created_at": "2021-04-30T09:54:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a691ed09fae... |
63cd9203-f6f6-45d0-98cc-54519d1da3d1 | austinmccoy6251/CS-171 | hw2/src/LSalgorithms.h | #include <iostream>
#include <cstdio>
#include <string>
#include "structs.h"
#include <Eigen/Dense>
using namespace std;
/* Normalizing a vector */
Eigen::Vector3d normalize(Eigen::Vector3d vec);
/* Color a point based on the material, the lights, and its position */
Color Lighting(Vertex P, Vertex sn, Material mate... | ALGO | 0.977029 | 4.6595 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2021-11-22T12:38:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97651553a... |
bec237ee-1fc9-4af7-9837-067f289af985 | MaxwellBrohm/Screen | main.cpp | #include <iostream>
#include <conio.h>
#include <cstdlib>
#include <vector>
#include <sstream>
#include <ctime>
using namespace std;
const int gridSize = 9;
vector<vector<int>> gameMap(gridSize, vector<int>(gridSize, 0));
vector<vector<int>> gameMapDup(gridSize, vector<int>(gridSize, 0));
// Define... | TOOL | 0.971575 | 4.798656 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-02-19T15:44: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": "a6bec39cb158... |
ea2c6005-b4b8-484b-881f-c94b33dad654 | NgHuy-akaSteph/CODEPTIT_DSA | Sinh_QuayLui/Parentheses.cpp | #include<bits/stdc++.h>
using namespace std;
int n;
string s, tmp = "()[]{}";
vector<string> vs;
bool check(string x){
stack<char> st;
for(char c : x){
if(c == '(' || c == '[' || c == '{'){
st.push(c);
}
else{
if(st.empty()) return false;
char k = st.... | ALGO | 0.999835 | 4.374547 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-05-10T14:27: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": "ec1297c14b6... |
ba6ec4ce-8a17-4fa8-a5fd-6f433dcacea4 | gem5/gem5 | src/arch/power/isa/formats/integer.isa | // -*- mode:c++ -*-
// Copyright (c) 2009 The University of Edinburgh
// Copyright (c) 2021 IBM Corporation
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met: redistributions of source code m... | TOOL | 0.951726 | 6.472942 | {
"github_metadata": {
"branch": "stable",
"commit_count": 22975,
"repo_created_at": "2014-12-02T09:46:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2105,
"forks": 1470,
"issues": 88,
"pull_requests": 56
},
"file_meta": {
"content_id": ... |
3f144057-a1c4-4900-82c0-a4e1cc8dcc88 | ouoam/CE_Artificial-Intelligence | test/astart.cpp | // A C++ Program to implement A* Search Algorithm
#include<cstdio>
#include<stack>
#include<queue>
#include<set>
#include<climits>
#include<cfloat>
#include<cctype>
#include<cmath>
#include<cstring>
#include <benchmark/benchmark.h>
int insertCount;
int maxSize;
using namespace std;
#define ROW 15
#define COL 15
// ... | ALGO | 0.998266 | 3.444402 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2019-09-09T15:34: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": "a388b3258... |
0dad94d7-0def-4673-a18f-208534154eb1 | Golangltd/codeclass | interface{}/src/opencv-master/opencv110/cv/src/cvcalibration.cpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | ALGO | 0.999484 | 6.05782 | {
"github_metadata": {
"branch": "master",
"commit_count": 206,
"repo_created_at": "2018-08-14T03:58:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 615,
"forks": 195,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "16de9... |
21bebe9a-d5b0-451f-bdf8-a5a8c6c40098 | vslezax/simple_PSNR_and_SSIM_image_calculator | main.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <cstdint>
#include <cmath>
class pix{
public:
uint8_t b;
uint8_t g;
uint8_t r;
pix(uint8_t a, uint8_t aa, uint8_t aaa){
b = a;
g = aa;
r = aaa;
}
};
double mean(const std::vector<uint8_t... | ALGO | 0.966796 | 5.071689 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-07-16T15:42: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": "78151cd747... |
274874d1-f057-4d6c-bed9-89b2cce0b2b6 | Darth-InVader15/Daily-Practise | 1717-maximum-score-from-removing-substrings/1717-maximum-score-from-removing-substrings.cpp | class Solution {
public:
int maximumGain(string s, int x, int y) {
stack<char> stk;
int n = s.size();
int ans = 0;
for(int i=0;i<n;i++)
{
if(stk.empty()) stk.push(s[i]); //either empty stack or not ab forming elements
else
{
... | ALGO | 0.999924 | 4.814581 | {
"github_metadata": {
"branch": "main",
"commit_count": 781,
"repo_created_at": "2023-06-06T05: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": "55a83fffa3... |
a2ebc375-c6fe-4a12-8d92-b2a3e5a04bf8 | jrivers96/scalable_math | include/SpearmanR.hpp | /*
* SpearmanR.hpp
*
* Created on: Mar 22, 2016
* Author: <NAME>
* Affiliation: School of Computational Science & Engineering
* Georgia Institute of Technology, Atlanta, GA 30332
* URL: www.liuyc.org
*/
#ifndef SPEARMANR_HPP_
#define SPEARMANR_HPP_
#include <stdlib.h>
#include <stdio.h>
#include <st... | ALGO | 0.99814 | 5.140966 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2017-03-30T14:30:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fda7cd8a2... |
4c5b984d-0319-4c04-8aa6-ae0248d13215 | KartikWatts/CCppCodingCollection | CodeChef/July20B/CHFNSWPS.cpp | #include <iostream>
#include <unordered_map>
typedef long long ll;
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
bool possible = true;
ll cost = 0;
unordered_map<ll, int> a, b, miss;
for (int i = 0; i < n; i++)
... | ALGO | 0.999977 | 3.38396 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2017-11-24T07:27:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f314a5e3... |
d1f9c0a3-ab10-4956-98d7-c61b053b8f11 | ankushmanchandani/LeetCode-Solved_questions | Count Inversions - GFG/count-inversions.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
// arr[]: Input Array
// N : Size of the Array arr[]
// Function to count inversions in the array.
long long int merge(long long arr[], long long temp[] ,long long left,long long ... | ALGO | 0.999681 | 5.758811 | {
"github_metadata": {
"branch": "main",
"commit_count": 781,
"repo_created_at": "2022-10-17T12:51:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb7b445ecc... |
6b31e858-b986-4eac-94bd-bfd11b4d081a | ishandutta2007/codeforces-k | krijgertje/normal/1152/D.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <cstring>
#include <list>
#include <cassert>
#include <climits>
#inclu... | ALGO | 0.999912 | 3.264983 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06: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": "cf16620388f9... |
8ada5928-2c56-46b8-a657-4aa14d36a5ab | atarng/interview_practice | cplusplus/uncrossed_lines/uncrossed_lines.cpp | #define DEBUG 1
class Solution {
public:
// constraints:
// 1 <= A.length <= 500
// 1 <= B.length <= 500
// (NOTE A.length != B.length)
// 1 <= A[i], B[i] <= 2000
// (NOTE A[i], B[i] are not unique; A, B can contain duplicates in their sets)
int maxUncrossedLines(vector<int>& A, vector<int>... | ALGO | 0.999967 | 5.80775 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2020-05-15T01:40:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "528c89d2e... |
c9a847e6-a15b-4113-b102-fc9cc982c117 | CubbyFlow/CubbyFlow | Includes/Core/Solver/FDM/FDMCGSolver3.hpp | // This code is based on Jet framework.
// Copyright (c) 2018 <NAME>
// CubbyFlow is voxel-based fluid simulation engine for computer games.
// Copyright (c) 2020 CubbyFlow Team
// Core Part: <NAME>, <NAME>, <NAME>, <NAME>
// AI Part: <NAME>, <NAME>
// We are making my contributions/submissions to this project solely i... | ALGO | 0.951245 | 6.504949 | {
"github_metadata": {
"branch": "main",
"commit_count": 996,
"repo_created_at": "2018-05-05T13:13:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 286,
"forks": 34,
"issues": 33,
"pull_requests": 1
},
"file_meta": {
"content_id": "0d67e40... |
7d6f540b-7bb7-4d25-83b4-37d3b4d4ecfa | Nipun4338/Solved-Programming-Problems | UVA/10924/19000109_AC_0ms_0kB.cpp | #include<bits/stdc++.h>
using namespace std;
int status[100000000/32];
bool Check(int N,int pos){return (bool)(N & (1<<pos));}
int Set(int N,int pos){ return N=N | (1<<pos);}
int arr[100000];
long long int l=0,a,b=10000,n;
void sieve()
{
long long int i,j,sqrtN;
sqrtN = int( sqrt( b ) );
for( i=3; i<=s... | ALGO | 0.999409 | 3.74003 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-07-29T12:52:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7db685db5... |
535023b3-158a-4525-b049-97dd7b86079b | SaqlainAveiro/Competitive-Programming-Solves | LightOj/1002 - Country Roads.cpp | #include<bits/stdc++.h>
using namespace std;
#define FastIO ios_base :: sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define read(in) freopen("Input.txt","r",stdin)
#define write(out) freopen("Output.txt","w",stdout)
#define pf printf
#define sf scanf
#define fr0(i,n) for(long long int i=0 ; i<n ; i++)
#define fr1... | ALGO | 0.999951 | 3.600771 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2021-06-04T22:13: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": "ad3ba743038... |
3ffe261e-d174-40b0-afda-6a6a2dcecdba | The-OpenROAD-Project/OpenROAD | src/drt/src/db/infra/KDTree.cpp | // SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2024-2025, The OpenROAD Authors
#include "KDTree.hpp"
#include <algorithm>
#include <cmath>
#include <cstddef>
#include <memory>
#include <utility>
#include <vector>
using odb::horizontal;
namespace drt {
KDTree::KDTree(const std::vector<Point>& points)
{
st... | ALGO | 0.999589 | 7.135608 | {
"github_metadata": {
"branch": "master",
"commit_count": 31212,
"repo_created_at": "2019-10-28T17:48:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2056,
"forks": 696,
"issues": 386,
"pull_requests": 61
},
"file_meta": {
"content_id": ... |
dcfaedf9-e694-472d-b43e-2fb35e19dfea | vfolunin/archives-solutions | LeetCode/707.cpp | class MyLinkedList {
struct Node {
int val;
Node *prev, *next;
Node(int val, Node *prev = 0, Node *next = 0) : val(val), prev(prev), next(next) {}
} *head, *tail;
Node *getNode(int index) {
Node *n = head->next;
for (int i = 0; i < index && n; i++)
n ... | ALGO | 0.999822 | 5.385815 | {
"github_metadata": {
"branch": "master",
"commit_count": 2367,
"repo_created_at": "2017-11-27T10:19:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 5
},
"file_meta": {
"content_id": "5874709... |
a3251f3c-3593-4e97-aacb-857512f331df | mindspore-ai/models | research/nlp/fasttext/infer/mxbase/src/main.cpp | /**
* Copyright 2022 Huawei Technologies Co., Ltd
*
* 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... | DATA | 0.921229 | 5.460434 | {
"github_metadata": {
"branch": "master",
"commit_count": 4305,
"repo_created_at": "2021-10-15T06:38:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 362,
"forks": 101,
"issues": 13,
"pull_requests": 2
},
"file_meta": {
"content_id": "4b4... |
2abe33ae-9d72-4d5d-95b8-10568969b6f9 | nianny/nianny.github.io | GeneralCoding/CP/Codebreaker/heatwv/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define hallo ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl '\n'
int32_t main() {
// ifstream cin("addin.txt");
// ofstream cout("addout.txt");
hallo;
int t,c,Ts,Te;
cin>>t>>c>>Ts>>Te;
vector<pair<in... | ALGO | 0.999959 | 3.896755 | {
"github_metadata": {
"branch": "main",
"commit_count": 352,
"repo_created_at": "2021-02-06T09:57:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e9dbac4ebd... |
cc2838ae-b5bd-4e86-b24d-9e1b13b9cb0a | AdwaithRK/Classic-Algorithm-Problems | pairLeetcode.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
vector<vector<int>> kSmallestPairs(vector<int> &nums1, vector<int> &nums2, int k)
{
priority_queue<vector<int>, vector<vector<int>>, greater<vector<int>>> pq;
pq.push({nums1[0] + nums2[0], 0, 0});
vector<vector<int... | ALGO | 0.999997 | 5.534692 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2022-03-09T04:31: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": "b02f5535533... |
a558ef5c-03db-453a-bdb2-697380edf0cd | DikshaSharma05072003/Cryptography-Algorithm | prac6/rsa_rough.cpp | #include<bits/stdc++.h>
using namespace std;
int calc_d(int e, int On)
{
int T1=0, T2=1;
int A = e>On?e:On;
int B = e>On?On:e;
int R = A%B;
int Q= A/B;
int T = T1-(T2*Q);
int matrix[7];
// Q A B R T1 T2 T;
matrix[0] = Q;
matrix[1] = A;
matrix[2] = B;
matrix[3] = R;
matri... | ALGO | 0.999988 | 3.92847 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-07-20T07:24: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": "7ff7d64a0f3e... |
34510978-b1fa-409b-bb8e-dbdb53418d5b | nileshsah/Algorithms | CF558C(2).cpp | #include <bits/stdc++.h>
#define ll long long
#define get(a) scanf("%lld", &a);
#define repVector(v) for( auto it = v.begin(); it != v.end(); it++ )
#define all(c) c.begin(), c.end()
#define pb push_back
#define FOR(i,a,b) for( ll i = a; i <= b; i++ )
#define ROF(i,a,b) for( ll i = a; i >= b; i-- )
#define debug(x) co... | ALGO | 0.999963 | 3.582981 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2015-02-17T10:07:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d6d3fe675... |
20ac8bde-ccf1-4fb5-9cef-c7092f1a8523 | focus913/velox | velox/expression/VectorUdfTypeSystem.h | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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 applic... | TOOL | 0.927928 | 6.938178 | {
"github_metadata": {
"branch": "main",
"commit_count": 262,
"repo_created_at": "2021-09-18T01:52:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af2277e2ec... |
4babdd13-dbac-4499-a368-8d16a2a480c1 | Artorias17/Online-Judge-Codes | Codeforces/1669F - Eating Candies.cpp | #include <iostream>
using namespace std;
int main(){
int t, n, left, right, totalCandies;
long long int alice, bob;
cin >> t;
int arr[(int)2e5];
bool leftChange, rightChange;
while(t--){
cin >> n;
for(int i=0; i<n; i++) cin >> arr[i];
alice = bob = totalCandies = 0;;
... | ALGO | 0.999941 | 4.447749 | {
"github_metadata": {
"branch": "master",
"commit_count": 169,
"repo_created_at": "2020-03-28T08:22: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": "6b203848... |
a9127fe1-25fd-49e9-8455-a8acb672735a | l-korous/mhdeal | examples/orszag-tang/initialConditionOT.cpp | #include "completeEllipticIntegrals.h"
#include "initialConditionOT.h"
#include "equationsMhd.h"
template <EquationsType equationsType, int dim>
InitialConditionOT<equationsType, dim>::InitialConditionOT(Parameters<dim>& parameters) :
InitialCondition<equationsType, dim>(parameters)
{
}
template <EquationsType equ... | ALGO | 0.953436 | 3.421609 | {
"github_metadata": {
"branch": "master",
"commit_count": 413,
"repo_created_at": "2015-07-14T16:23:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50c18ee5... |
7607346e-f7fc-47e0-9755-70cd2ea0c3d0 | prakhar7017/DSA-CPP | 725-split-linked-list-in-parts/split-linked-list-in-parts.cpp | class Solution {
public:
vector<ListNode*> splitListToParts(ListNode* head, int k) {
ListNode* temp = head;
int n = 0;
while (temp != NULL) {
n++;
temp = temp->next;
}
int size = n / k; // required size of each part
int rem = n % k; // left ou... | ALGO | 0.99978 | 6.072774 | {
"github_metadata": {
"branch": "main",
"commit_count": 1146,
"repo_created_at": "2023-10-06T17:49: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": "ca95f037e... |
8600ad20-e5ea-4d60-a69e-4a1d5cb3eec7 | yang48699997/code | template/SegmentTreeORI.cpp | using ll = long long;
template<class T>
struct SegmentTree {
static int n;
vector<T> a, tr, mark;
SegmentTree(int x) {
n = x;
a.resize(x + 1);
tr.resize((x + 1) << 2);
mark.resize((x + 1) << 2);
}
void set(int i, T x) {
a[i] = x;
}
void build(int p = ... | ALGO | 0.999794 | 4.093797 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2024-04-12T14:28:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13af7c760... |
8c09bfb7-2587-429a-b7ce-835ae982b16b | aditigupta17/random-codes | Tree/Largest-BST-Subtree.cpp | /**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
struct data{
int size, lower, upper, ans;
bool isBST;
};
data largestBST(TreeNode* A){
if(A == NULL) return {0, INT_MAX, IN... | ALGO | 0.999861 | 5.101498 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2018-01-08T15:30:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1a7d132d... |
ea4d830f-563c-415e-a6ba-450972c7b448 | jj123t/code | luogu/p1042.cpp | /*************************************************************************
> File Name: p1042.cpp
> Author:123emm
> Mail: <EMAIL>
> Created Time: Mon May 29 02:39:12 2023
************************************************************************/
#include<bits/stdc++.h>
using namespace std;
#include <iostream>
int... | ALGO | 0.999871 | 3.241007 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-09-21T11:37: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": "94f2b0fa7011... |
4c6a986a-9d7e-4f16-9029-a46817ce4749 | EmcTROJ1N/ITStep_PD111 | CPPAdvancedSemestr_2/ExamCPP/Sentence.cpp | #include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include "Word.h"
#include "Sentence.h"
using namespace std;
Sentence::Sentence()
{
Sntns.push_back("Hello");
Sntns.push_back("World");
Symbols = { ',', '.', };
}
Sentence::Sentence(string sentence) { Set(sentence); }
Sentence::Se... | TOOL | 0.940299 | 3.608611 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2021-07-22T17:03: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": "4207f4480... |
ec39f1a0-7dc5-48f2-a2bb-e3b1ee5bda41 | ishandutta2007/codeforces-i | ivl/normal/665/B.cpp | #include <bits/stdc++.h>
#define FOR(i,a,b) for (int i = (int)(a); i < (int)(b); ++i)
#define REP(i,n) FOR(i,0,n)
#define ll long long
#define pb push_back
#define pii pair < int, int >
#define x first
#define y second
#define TRACE(x) cerr << #x << " = " << x << endl
#define _ << " _ " <<
using namespace std;
int ... | ALGO | 0.999862 | 3.46633 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "656b52dc515f... |
69b85071-2f36-471f-92b9-7b26d08c3a18 | JeraKrs/acm | codes/HDU/hdu4998.cpp | #include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
const double pi = 4 * atan(1.0);
struct point {
double x, y;
point (double x = 0, double y = 0) {
this->x = x;
this->y = y;
}
point rotate (double rx, double ry, double r) {
double x0 = (x - rx) * cos(r) - (y - ... | ALGO | 0.99938 | 3.815681 | {
"github_metadata": {
"branch": "master",
"commit_count": 163,
"repo_created_at": "2016-05-23T06:40:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef209881... |
168e0ec4-2378-4456-827d-1919b4ceebfb | qwaker00/Olymp | CodeChef/June Cook-Off 2014/Counting Flags/hax.cpp | #ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <memory.h>
#include <cmath>
#include <string>
#include <cstring>
#include <queue>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <functional>
#inc... | ALGO | 0.999769 | 3.871015 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2012-09-04T15:56:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e64ffe114... |
4d92030f-771b-4db2-a158-61e5aae927dd | rdstihz/Learning-and-Coding | src/cf/contest/1720/e/e.cpp | /*
Created by rdstihz at 2022-08-19 13:29:05
*/
#include <bits/stdc++.h>
using namespace std;
const int maxn = 510;
int a[maxn][maxn];
int bd[maxn * maxn][4];
int s[maxn][maxn];
void solve() {
int n, k;
scanf("%d%d", &n, &k);
for (int i = 1; i <= n * n; i++) {
bd[i][0] = bd[i][1] = n + 1;
... | ALGO | 0.999874 | 3.38268 | {
"github_metadata": {
"branch": "main",
"commit_count": 220,
"repo_created_at": "2021-01-26T13:30: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": "6a0f72d696... |
e5b9aa6b-54a2-46c5-af8b-202c56ffc56b | JunChangM/ProblemSolving | 백준/Gold/1967. 트리의 지름/트리의 지름.cc | #include <iostream>
#include <vector>
#include <queue>
#include <string.h>
using namespace std;
int n, a, b, c;
vector < pair<int, int>> map[10001];
int dist[10001];
int search(int start) {
queue<int> q;
memset(dist, 0, sizeof(dist));
q.push(start);
while (!q.empty()) {
int cur = q.front();
q.pop();
for (i... | ALGO | 0.999956 | 3.751899 | {
"github_metadata": {
"branch": "main",
"commit_count": 346,
"repo_created_at": "2023-06-13T12:57: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": "5bf6847979... |
6921dad1-63af-42f6-a5a5-9210f7aeb161 | StasVitvitskiy/Knight-s-tour | main.cpp | #include <iostream>
#include <iomanip>
using namespace std;
#define BoardSize 8
int boardFive[5][5] = {
{0,0,0,0,0},
{0,0,0,0,0},
{0,0,0,0,0},
{0,0,0,0,0},
{0,0,0,0,0}
};
int boardEight[8][8] = {
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
... | ALGO | 0.999599 | 3.833364 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-11-18T22: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": "b40b123352... |
a52f42e1-93eb-4f3d-a7ca-30f245380faa | Siudya/ORB_FPGA | ip/xfopencv/include/imgproc/xf_magnitude.hpp | /***************************************************************************
Copyright (c) 2018, Xilinx, Inc.
All rights reserved.
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 retai... | TOOL | 0.950284 | 5.825242 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2020-05-25T10:54:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 72,
"forks": 26,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "60c5872... |
623bb667-556b-411d-9057-c6f8776f62f9 | louisfaury/MobileRobotsProject | userFiles/ctrl/groups_ctrl/gr4/regulation/CurvePath_gr4.cpp | /*!
* @file CurvePath.cpp
* @author <NAME>
* @date 15/11
*/
#include "CurvePath_gr4.h"
#include "speed_regulation_gr4.h"
#include "config_file_gr4.h"
NAMESPACE_INIT(ctrlGr4);
CurvePath::CurvePath() : m_sign(1)
{
}
bool CurvePath::nextStep(double& alpha, double dt, CtrlStruct *cvs)
{
bool end = false;
... | ALGO | 0.981588 | 5.035123 | {
"github_metadata": {
"branch": "master",
"commit_count": 103,
"repo_created_at": "2016-09-28T21:00:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c365197... |
95ccace6-bb7e-4410-a766-2cd9cdd906a2 | Vipulk1605/Competitive_Coding | 20.Challenges_Sorting_And_Searching/16.Sort_Game.cpp | /*
Sanju needs your help! He gets a list of employees with their salary. The maximum salary is 100.
Sanju is supposed to arrange the list in such a manner that the list is sorted in decreasing order of salary. And if two employees have the same salary, they should be arranged in lexicographical manner such that the li... | ALGO | 0.999827 | 4.261659 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-07-20T18:09:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b3a2da266c... |
79f43df3-11b2-4089-8d95-ed726dc50606 | manthan0x23/Data-Structures-and-Algorithms | graphs/ll-1519.cc | #include <string>
#include <vector>
using namespace std;
class Solution {
public:
int dfs(vector<vector<int>> &adj, string &labels, int u, int parent,
vector<int> &result, vector<int> &count) {
char c = labels[u];
int before_curr = count[c - 'a'];
count[c - 'a']++;
for (auto &node : adj[... | ALGO | 0.999947 | 5.676487 | {
"github_metadata": {
"branch": "main",
"commit_count": 224,
"repo_created_at": "2023-09-27T17:32: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": "52b99fcb32... |
11254c6f-aeb5-4d78-a0ba-dddc2e58c2e8 | atmqq1990/leetcode | leetcode/Q99_Recover_Binary_Search_Tree.cpp | #include<iostream>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
void recoverTree(TreeNode* root) {
TreeNode *first = NULL;
TreeNode *second = NULL;
TreeNode *pre = NULL;
TreeNode *cur = ro... | ALGO | 0.999997 | 4.93441 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2015-08-10T00:20:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ff149f9c2... |
e8402d3e-ae60-4858-9f21-c0b439793f49 | jonghoinside/LearningtheCpp | practice/SingleDigit_RationalCaculation/rational.cpp | #include <cstdlib>
#include <cassert>
#include "rational.h"
char board[][50] = {
" [1] [2] ",
"_____ _____ _____",
"| | | | | |",
"----- ----- -----",
"----- ----- = -----",
"_____ _____ _____",
"| | | | | |",
"----- -... | ALGO | 0.976264 | 3.91598 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2021-05-18T00:33:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d752dc902b5... |
947378f7-ddf6-41af-ba37-c78c17e41fee | VipulKhandelwal1999/Coding_Blocks | 29.Recursion_V_Backtracking/01.CPP_Recursion_Rat_In_A_Maze.cpp | /*
* Solved Simple Variation: https://www.geeksforgeeks.org/rat-in-a-maze-backtracking-2/
* To print all such paths just replace #36 base case to false. as we did in N queen problem to find all possible configuration
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
bool ratInMaze(char maze[10][... | ALGO | 0.999458 | 4.00654 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2020-07-20T20:40: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": "7680dda2b... |
aefe4f6c-5c89-4e89-bad8-c110e46fab3c | kmchacha/ProblemSolving | Baekjoon/6497.cpp | #include <bits/stdc++.h>
using namespace std;
struct Edge{
int start, end, value;
Edge(int a, int b, int c) {
start = a;
end = b;
value = c;
}
bool operator < (const Edge &e) const {
return value < e.value;
}
};
int Find(int v, int *unf){
if(unf[v] == v) return ... | ALGO | 0.999821 | 3.999522 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2020-06-29T13:16: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": "6e5c9ae2e... |
f0d23398-963f-460b-b7e2-38d721f67115 | scottku/Baekjoon_Solution | 24.01.22/q1697.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <cmath>
#include <iostream>
#include <string>
#include <deque>
#include <vector>
#include <memory.h>
#include <algorithm>
#include <map>
#include <stack>
#include <sstream>
#include <unordered_map>
using namespace std;
deque<pair<int, int>> dq;
vector<int> ... | ALGO | 0.99998 | 3.078137 | {
"github_metadata": {
"branch": "master",
"commit_count": 133,
"repo_created_at": "2024-01-03T12:47: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": "e509f039... |
5509cc3a-be59-46ee-b9a3-71b6cee59204 | dev1810/Cpp | hwstar.cpp | #include <iostream>
using namespace std;
int main(){
//************************* */
// ABCDE
// FGHIJ
// KLMNO
// PQRST
// UVWXY
// int n = 5;
// char ch = 'A';
// for(int i =0 ;i<n;i++){
// for(int j=0;j<n;j++){
// cout<<ch;
// ch = ch+1;
// }
// cout<<endl;
// ... | ALGO | 0.999941 | 3.720627 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2025-02-09T10:08: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": "0a0aac5ecd9... |
8899a6bf-fe7a-4ec6-9246-f2505ab6ab1c | flyhero99/BaoYanJiShi | 图论/最短路/POJ1847 dijkstra.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <cmath>
#include <string>
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int inf = 0x3... | ALGO | 0.999963 | 3.448503 | {
"github_metadata": {
"branch": "master",
"commit_count": 135,
"repo_created_at": "2018-11-21T10:09:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 54,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "399314... |
9f1c113f-aa4c-4f06-9129-b3db851ea041 | Dzy0726/LeetCode-Practice | Stack&Queue/232.用栈实现队列/implement-queue-using-stacks.cpp | /***
* @Author: Dzy0726
* @Date: 2024-01-05 14:22:22
* @LastEditors: Dzy0726
* @LastEditTime: 2024-01-05 14:22:50
* @FilePath: \LeetCode-Practice\Stack&Queue\232.用栈实现队列\implement-queue-using-stacks.cpp
* @Description:
* @
* @Copyright (c) 2024 by <NAME>, All Rights Reserved.
*/
class MyQueue {
public:
M... | ALGO | 0.999709 | 6.02859 | {
"github_metadata": {
"branch": "main",
"commit_count": 288,
"repo_created_at": "2023-04-06T15:00: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": "3b517d0124... |
4c7f5bbc-10b3-4955-a652-d658bac1dfbc | RyanDMorales/Sparse-Matrix-Addition | sparse.cpp | //
// Created by <NAME> on 9/23/16.
//
#include <iostream>
using namespace std;
#include "ArrayMatrix.h"
#include "LinkedListMatrix.h"
#include "ArgumentManager.h"
int main(int argc, char* argv[] ) {
ArgumentManager am(argc, argv);
string op = am.get("operation");
string str = am.get("storage");
stri... | ALGO | 0.956261 | 4.478295 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-09-27T02:29: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": "4b8fd51fa9... |
dd37d216-7ade-40f7-8267-e143f7da4fe1 | qiaozishun4/CSP2024_BJ | BJ-Senior/answers/BJ-S01602/detect/detect.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
int machine[100005];
int d[100005];
int v[100005];
int a[100005];
signed main()
{
freopen("detect.in", "r", stdin);
freopen("detect.out", "w", stdout);
int T;
cin >> T;
while (T--)
{
memset(machine, 0, sizeof(machine))... | ALGO | 0.999771 | 3.499317 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2024-11-01T16:05: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": "66fd83c296... |
fdfd1eac-3344-4aa5-9afa-6c4be63dab13 | ritwika-reddy/google-prep | roman_to_integer.cc | #include <string>
#include "test_framework/generic_test.h"
using std::string;
int getValue(char roman){
if(roman == 'I')
return 1;
if(roman == 'V')
return 5;
if(roman == 'X')
return 10;
if(roman == 'L')
return 50;
if(roman == 'C')
return 100;
if(roman == 'D')
return 500;
if(roman ... | ALGO | 0.998813 | 5.692976 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-11-16T17:00: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": "1e6440a6dc... |
8d8e2028-66df-4854-868d-50f49de44298 | arthurvtrr/AA-Problems-Solved | To Define/childandhomework.cpp | #include <stdio.h>
#include <cstring>
using namespace std;
bool correct(char s1[110], char s2[110], char s3[110], char s4[110]) {
if ((strlen(s1) - 2) / 2 >= (strlen(s2) - 2) && (strlen(s1) - 2) / 2 >= (strlen(s3) - 2) && (strlen(s1) - 2) / 2 >= (strlen(s4) - 2))
return true;
if ((strlen(s1) - 2) <= (... | ALGO | 0.999949 | 3.457224 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2015-09-18T11:53: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": "264da0ab1... |
4a16d451-2514-4b47-9881-81dcfef5acfc | tarek-adam/runtrackCPP | jour01/job06.cpp | #include <iostream> // Include the standard iostream library
int main() {
int num; // Declare a variable to store the user's input
// Prompt the user to enter a number
std::cout << "Enter a number: ";
std::cin >> num;
// Display the multiplication table of the given number
std::cout << "Mul... | TOOL | 0.998237 | 4.685338 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-04-29T14:35: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": "be0b100aad89... |
db2bb9db-e376-4b84-a120-3425b27b2010 | wangxianghust/CLRS | 2/MergeSort.cpp | #include <iostream>
using namespace std;
template<unsigned M>
void Merge(int (&A)[M], int p, int q, int r){
int n1 = q - p + 1;
int n2 = r - q;
int L[n1+1];
int R[n2+1];
for(int i=0; i < n1; ++i){
L[i] = A[p+i];
}
L[n1] = 100000; // the end sign;
for(int j = 0; j < n2; ++j){
... | ALGO | 0.999908 | 4.102424 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2017-01-25T10:09:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b018859b7... |
5a806851-6ea1-4b50-9fd6-6d9dffd3ba01 | biggysmith/advent_of_code_2024 | src/day07/day7.cpp | #include <vector>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <algorithm>
struct equation_t{
uint64_t val;
std::vector<uint64_t> nums;
};
using equations_t = std::vector<equation_t>;
equations_t load_input(const std::string& file){
equations_t ret;
std::ifstre... | ALGO | 0.999491 | 5.831258 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2024-12-01T16:37: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": "717084fef... |
c26e0e90-2852-4158-9f15-c0a35b3193dd | ishandutta2007/codeforces-n | normie28/normal/1667/E.cpp | #ifndef CPL_TEMPLATE
#define CPL_TEMPLATE
/*
Normie's Template v2.5
Changes:
Added warning against using pragmas on USACO.
*/
// Standard library in one include.
#include <bits/stdc++.h>
using namespace std;
// ordered_set library.
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.h... | ALGO | 0.999898 | 3.882278 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:35:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "546ccb15fba2... |
ae4e7452-fae1-4e80-8f67-8f78dc35f079 | lbalic21/keyword_spotting | microcontroller/kws/main/Application/FeatureGenerator/FFT.cpp | #include "FFT.hpp"
#include <math.h>
FFT::FFT()
{
esp_err_t ret = dsps_fft2r_init_fc32(NULL, WINDOW_SIZE);
if(ret != ESP_OK)
{
//ESP_LOGE("FFT", "Not possible to initialize FFT. Error = %i", ret);
while(1);
}
}
void FFT::compute(float* frame, float* spectrogram)
{
for(size_t i = 0;... | ALGO | 0.903565 | 5.90934 | {
"github_metadata": {
"branch": "master",
"commit_count": 152,
"repo_created_at": "2024-10-09T18:04:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c82ace3c... |
40ace8df-9a10-423a-8430-b256f55893ce | utsavkapoor/practice_questions | linked_list.cpp | #include<iostream>
using namespace std;
struct node {
int data;
node * next;
};
class Linkedlist
{
node *head;
public:
Linkedlist();
void display();
void addbegin(int num);
void addlast(int num);
void addmiddle(int num, int position);
void del(int num);
int search(int num);
};
Linkedlist::Linkedli... | ALGO | 0.999649 | 4.280222 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2017-06-18T22:31: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": "01c4d36ba... |
6c1f8089-b409-4e9f-8a83-779a6f11d397 | brown0394/algorithm_practice | sangbeomsSadDay.cpp | #include <iostream>
#include <list>
#include <vector>
struct longest {
int from, to;
};
std::vector<longest> longestOnes;
int longestSad = 0;
std::list<int> daysFlower;
std::vector<int> days;
int getDaysBought(int end, int start, std::list<int>::iterator it) {
int sum = 0;
int count = end - start;
if (count > lon... | ALGO | 0.999942 | 4.448389 | {
"github_metadata": {
"branch": "main",
"commit_count": 715,
"repo_created_at": "2022-03-02T12:11:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c67802306... |
93959c4a-e53d-43bc-87f9-52195cde674e | pfl-cs/DILI | src/butree/interval_utils.h | #include "interval.h"
#include "../global/global.h"
#include <vector>
#include <queue>
#include <set>
#include <string>
#ifndef DILI_INTERVAL_UTILS_H
#define DILI_INTERVAL_UTILS_H
class interval_comparator {
public:
bool operator() (const interval *lhs, const interval *rhs) const {
if (lhs->merge_metric =... | ALGO | 0.983524 | 4.876255 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2023-05-14T11:16:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 4,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "c51f89a965... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.