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 |
|---|---|---|---|---|---|---|---|
0932a15a-227c-4e64-8a9a-db4bf34b8f57 | Leixb/jutge_problems | P88760_ca_Las_Zamburguesas.cc | #include<bits/stdc++.h>
using namespace std;
typedef vector <double> vd;
typedef vector <int> vi;
typedef vector <vi> vvi;
int main(){
int n;
double d;
while(cin >> n >> d){
vd X(n), Y(n), R(n);
vvi G(n);
for(int i=0; i<n; i++) cin >> X[i] >> Y[i] >> R[i];
for(int i=0; i<n... | ALGO | 0.999658 | 3.525377 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2018-02-18T21:07:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c994edb... |
32bf5c3c-3f7a-4d9d-b1cb-0d3e7edd221a | man0045/Data_Structure_with_Cpp | Dynamic_Programming/MODIFIED_KNAPSACK.cpp | #include<iostream>
#include<vector>
#include<climits>
#define ll long long int
using namespace std;
vector<vector<ll>> dp(105, vector<ll>(100005, -1));
ll f(vector<int> &wts, vector<int> &val, int idx, int tv){
if(tv == 0) return 0;
if(idx == wts.size()) return INT_MAX;
if(dp[idx][tv] != -1) return dp[idx][tv];
... | ALGO | 0.999996 | 4.526596 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2023-10-02T15:35:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "64847a677... |
12362af6-35b7-4765-b25a-3c538dbf6d6e | liuyubobobo/Play-Leetcode | 0501-1000/0677-Map-Sum-Pairs/cpp-0677/main3.cpp | /// Source : https://leetcode.com/problems/map-sum-pairs/description/
/// Author : liuyubobobo
/// Time : 2017-11-05
#include <iostream>
#include <map>
#include <vector>
using namespace std;
/// Trie
/// Time Complexity: insert: O(len(prefix))
/// sum: O(sum(len(wi)))
/// Space Complexity: O(sum(... | ALGO | 0.999829 | 5.565885 | {
"github_metadata": {
"branch": "master",
"commit_count": 2592,
"repo_created_at": "2016-12-01T17:08:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2732,
"forks": 718,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b... |
ccbfe98f-9d95-49ee-916d-03aaed42b090 | karraanvesh/ProblemOfTheDay | LeetcodeDailyChallenge/Graphs/TopoSort/BuildAMatrixWithConditions.cpp | // Time Complexity : O(n + m + 2 * k) ~ O(n + m + k)
// Space Complexity : O((n + 2*k) + (m + 2*k))
// Problem Link : https://leetcode.com/problems/build-a-matrix-with-conditions/description/?envType=daily-question&envId=2024-07-21
class Solution {
private :
void buildGraph(vector<int> adj[] , vector<vector<... | ALGO | 0.999934 | 6.514338 | {
"github_metadata": {
"branch": "master",
"commit_count": 181,
"repo_created_at": "2024-01-14T14:46: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": "4b30d170... |
f785c971-45a2-41dc-9328-ed2de5016262 | duongminhhieu/Sorting | Sorting/Algorithms.h |
#pragma once
#include <iostream>
#include <fstream>
#include <cmath>
#include <time.h>
using namespace std;
void selectionSort(int arr[], unsigned int n);
void selectionSort_countComp(int arr[], int n, unsigned long long int& count_comp);
void heapify(int* arr, int n, int i);
void heapSort(int* arr, int n);
void hea... | ALGO | 0.998955 | 4.071011 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2021-11-20T13:21: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": "e2b37d9467a... |
03eb4925-6579-47dc-bad8-b78d1f91a4e6 | mittalaakash/DSA-SUPREME | week 8- divide and conquer/Lecture 2/quick sort.cpp | #include <iostream>
#include <vector>
using namespace std;
int partition(int arr[], int s, int e)
{ // step 1 choosed pivot
int pivotIndex = s;
int pivotElement = arr[s];
// step2: find right position for pivot element and place it there
int count = 0;
for (int i = s + 1; i <= e; i++)
{
... | ALGO | 0.99999 | 5.891609 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2023-03-04T17:48:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46d935940... |
a9c15e15-303a-4b47-94e3-11e7629a9b97 | mitsuba-renderer/mitsuba2 | src/librender/kdtree.cpp | #include <mitsuba/render/kdtree.h>
#include <mitsuba/render/mesh.h>
#include <mitsuba/core/properties.h>
NAMESPACE_BEGIN(mitsuba)
MTS_VARIANT ShapeKDTree<Float, Spectrum>::ShapeKDTree(const Properties &props)
: Base(SurfaceAreaHeuristic3f(
/* kd-tree construction: Relative cost of a shape intersection
... | ALGO | 0.987892 | 6.986999 | {
"github_metadata": {
"branch": "master",
"commit_count": 2096,
"repo_created_at": "2019-08-29T23:49:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2064,
"forks": 265,
"issues": 96,
"pull_requests": 10
},
"file_meta": {
"content_id": "a... |
d8cb18dd-2c32-45ec-96bb-2261d97f6847 | arpit23697/For-Uva-solutions | Graph/specialGraph/10401/10401.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
bool matrix[20][20];
vector <vector <int> > graph;
int total;
vector <bool> visited;
vector <int> topological;
void dfs (int start)
{
visited[start] = true;
for (int i=0 ; i < graph[start].size(); i++)
{
int v = graph[start][i];
if (vi... | ALGO | 0.999988 | 3.899543 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2018-01-04T19: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": "2ea6e519d... |
3323fc20-13ad-4450-bb0f-cc63e8101836 | jeffamstutz/tsimd | tsimd/detail/functions/math/rcp.h | // ========================================================================== //
// The MIT License (MIT) //
// //
// Copyright (c) 2017 Intel Corporation ... | ALGO | 0.92578 | 7.23251 | {
"github_metadata": {
"branch": "main",
"commit_count": 211,
"repo_created_at": "2017-10-13T02:16:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 349,
"forks": 20,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf28b4e... |
f969b58d-2343-4bee-87ff-c433b2b1f347 | hyperk/Geant4 | source/4.10.01.p03/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPEnAngCorrelation.cc | //
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration... | ALGO | 0.93018 | 4.180106 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2015-01-26T21:29:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "164ac8bb8c8... |
11bf79bc-ce8b-4ccc-88d9-3941dee03f94 | ajay-1134/CODING | Chef_and_Meetings.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long int
const int mod = 1000000007;
#define PI 3.1415926535897932384626
float func(string st,string t){
if(t == "AM"){
string st1;
for(int i=0; i<2; i++){
st1 += st[i];
}
int nm1 = stoi(st1);
if(nm1 ... | ALGO | 0.999778 | 4.089151 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-08-02T16:50: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": "75bb5cb2ad... |
1e6a62b8-1c57-4419-a241-df484b7a7bcf | JoaoDanielRufino/Algorithms | Graph/possible_bipartition.cpp | // https://leetcode.com/problems/possible-bipartition/description/
// This is an algorithm to check if given graph can be bipartite
class Solution {
public:
bool solve(vector<vector<int>>& graph, int current, bool color, vector<int>& colors) {
colors[current] = color;
for(int adj : graph[current]... | ALGO | 0.99989 | 6.014651 | {
"github_metadata": {
"branch": "master",
"commit_count": 349,
"repo_created_at": "2017-09-06T16:56:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "694b4e9d... |
fd52dcf0-ad9f-4a14-ba51-70fefa933ed0 | IvanRenison/ProgrammingProblems | Codeforces rounds/Codeforces rounds/Codeforces Round 883 (Div. 3)/E1.cpp | // https://codeforces.com/contest/1846/problem/E
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define fore(i, a, b) for (ull i = a; i < b; i++)
#define MAXN ull(1e6 + 1)
/*
n = (c^i - 1)/(c - 1)
nc - n = c^i - 1
n(c - 1) + 1 = c^i
*/
vector<bool> v... | ALGO | 0.999835 | 4.709031 | {
"github_metadata": {
"branch": "main",
"commit_count": 665,
"repo_created_at": "2022-11-24T13:05:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "16f4b18a18... |
e078105b-ab61-4e8e-bc54-6fbae09471d3 | ejasminehunter/ICS167-Snake | Milestone5/updated_server/Snake.cpp | #include "Snake.h"
SnakeGame::SnakeGame() {
StartNewGame();
}
SnakeGame::~SnakeGame() {
}
void SnakeGame::StartNewGame()
{
board = std::string(BOARD_WIDTH*BOARD_HEIGHT, '=');
playerScore[0] = 0;
playerScore[1] = 0;
ResetBoardState();
}
void SnakeGame::SetPlayerInput(int player, char input)
{
switch (input)
... | TOOL | 0.979371 | 4.786038 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2016-02-09T05:06: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": "1a717a21e... |
103ec7d6-470c-46c1-b42e-39e7726be504 | yzgyyang/freebsd-ports | www/ungoogled-chromium/files/patch-content_browser_renderer__host_render__process__host__impl.cc | --- content/browser/renderer_host/render_process_host_impl.cc.orig 2025-01-31 07:50:54 UTC
+++ content/browser/renderer_host/render_process_host_impl.cc
@@ -221,7 +221,7 @@
#include "third_party/blink/public/mojom/android_font_lookup/android_font_lookup.mojom.h"
#endif
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROM... | TOOL | 0.948425 | 5.32474 | {
"github_metadata": {
"branch": "main",
"commit_count": 695685,
"repo_created_at": "2021-05-16T04:54:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9c0fbd... |
2adcdbd2-136c-4c4a-b91c-e89677c5d588 | 8f-a/BSU_famcs | Programming/Semester-2/C2_2/MyClass.cpp | #include "MyClass.h"
Our_Class :: Our_Class(int n) {
Array = new int[n];
size = n;
}
Our_Class :: Our_Class(const Our_Class &other) {
this->size = other.size;
this->Array = new int[other.size];
for (int i = 0; i < other.size; i++)
this->Array[i] = other.Array[i];
}
Our_Class :: ~Our_Class() {
delete[] Array;... | ALGO | 0.990161 | 3.923969 | {
"github_metadata": {
"branch": "uploading-items-branch",
"commit_count": 369,
"repo_created_at": "2021-03-31T09:29:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"conten... |
d5407d25-9d3a-4ef8-be72-3b3a44e9b2ce | jzijin/target_to_offer | 矩阵中的路径.cpp | class Solution
{
public:
bool isok(vector<bool> marked, char *matrix, int r, int c, int rows, int cols, char *a, int index)
{
int tmp = r * cols + c;
if (r < 0 || r >= rows || c < 0 || c >= cols || matrix[tmp] != a[index] || marked[tmp] == true)
return false;
if (index == st... | ALGO | 0.999656 | 5.491179 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-05-25T13:38: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": "537456a3b1... |
8f83d0fa-cec1-40b0-9bfe-d031976635fa | GabrielCzar/Grafos | ordenacao_topologica/main.cpp | #include <iostream>
#include <list>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
enum COR {BRANCO, CINZA, PRETO};
enum VERTICES {A, B, C, D, E, F, G, H};
vector <list <int>> Adj;
list <int> ord_topologica;
vector <int> cor, pi, d, f;
int tempo = 0;
int N;
bool topologic_sort_visit (... | ALGO | 0.999904 | 4.271001 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2017-04-07T23:42:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5cdfb05d2... |
09d553c1-6fcc-49ff-b76a-32925648baf6 | yassjd199/Meta-Hacker-Cup | 2022/Round 2/A1.cpp | // author : yassjd199
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vii;
typedef vector<long long> vll;
double eps = std::num... | ALGO | 0.999922 | 4.46142 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-10-03T20:05: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": "b2a8b495e42... |
d1761eb9-82d3-4dbf-a237-93779efec35d | RosettaCommons/rosetta | source/src/core/scoring/epr_deer/metrics/DEEROverlapMethod.cc | // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// (c) Copyright Rosetta Commons Member Institutions.
// (c) This file is part of the Rosetta software suite and is made available under license.
// (c) The Rosetta software is developed by the co... | ALGO | 0.997086 | 6.596734 | {
"github_metadata": {
"branch": "main",
"commit_count": 11737,
"repo_created_at": "2023-11-17T16:42:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 296,
"forks": 100,
"issues": 27,
"pull_requests": 9
},
"file_meta": {
"content_id": "7268... |
e5bb1530-c1df-4ae9-8ac6-ed6d9bc69eca | Arjav96/My-Spoj-Solutions | STAVATAR.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
long n;
scanf("%ld",&n);
char s1[1000010],s2[1000010];
//getchar();
//scanf("%[^\n]s",s1);
//getchar();
//scanf(" %[^\n]s",s2);
//getchar();
//scanf("%[^\n]%*c",s1);
//scanf("%[^\n]%*c"... | ALGO | 0.99999 | 3.144836 | {
"github_metadata": {
"branch": "master",
"commit_count": 205,
"repo_created_at": "2015-11-19T20:15:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "25ead2d2... |
a38a9b15-1a91-4653-a97e-6311d7bff0df | Anav0/Dread | Analysis/source/Problem.h | #pragma once
#include "Metaheuristics/Annealing.h"
#include "Misc/Constants.h"
#include <random>
#include <vector>
struct DreadInstance {
Fight fight;
SimulationParams params;
Deployment deployment;
DreadInstance(Fight fight, SimulationParams params, Deployment deployment)
: fight(fight)
... | ALGO | 0.992506 | 5.507856 | {
"github_metadata": {
"branch": "master",
"commit_count": 236,
"repo_created_at": "2023-12-21T06:07: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": "a1fb32ce... |
42feff7e-9d82-4eba-b6cf-773a1f76afd3 | hiit-tabata/Extended-Kalman-Filters | src/tools.cpp | #include <iostream>
#include "tools.h"
using Eigen::VectorXd;
using Eigen::MatrixXd;
using std::vector;
Tools::Tools() {}
Tools::~Tools() {}
VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations,
const vector<VectorXd> &ground_truth) {
/**
TODO:
* Calculate the RMSE... | ALGO | 0.99076 | 6.085328 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-06-30T04:01: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": "0b379a7ce8... |
2be8d8bc-d9aa-477d-af44-7d99bbe64b69 | Arman-Ferdous/USACO-Traning-Gateway | warmhole.cpp | /*
ID: akash331
TASK: wormhole
LANG: C++11
*/
#include <bits/stdc++.h>
using namespace std;
const int N = 14;
int n, x[N], y[N], link[N], to[N];
bool cycle() {
for(int source = 1; source <= n; source++) {
int s = source;
for(int i = 1; i <= n; i++)
s = to[link[s]];
if(s != 0) return true;
} return false;
... | ALGO | 0.999683 | 3.732608 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-10-01T15:33: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": "909375e6bb... |
e9308edd-79cc-4d7e-84ff-c6ddc290355a | woomin-Shim/Algorithm-Practice | Simple Brute-Force Algoritm/체스.cpp | #include <iostream>
using namespace std;
/*체스에서 룩은 기물로 막혀있지 않으면 룩의 위치에서 같은 열,행에 해당하는 칸 중 하나로 이동가능
8X8 체스판의 상태를 입력한다, 0은 기물이 없는상태, 1은 킹, 2는 상대 룩(최대 2개),
3은 그 외 다른 기물
만약 킹이 잡힐 가능성이 있으면 1, 없으면 0을 출력 */
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int arr[9][9], ry[2] , rx[2], cnt = 0, result = 0;
for (int... | ALGO | 0.999524 | 3.682753 | {
"github_metadata": {
"branch": "master",
"commit_count": 159,
"repo_created_at": "2021-02-01T14:59: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": "7dcdba83... |
d38d56c9-4120-4809-adab-ccf7f8a2eefa | fabioprev/SPQR-NAO-2013 | Src/Tools/BodyDynamics/BodyDynamicsProviderDelegate.cpp | /**
* @file BodyDynamicsProviderDelegate.cpp
*
* This file implements a class that provides the dynamics of the robot's limbs.
*/
#include "BodyDynamicsProviderDelegate.h"
#include "Tools/BodyDynamics/InverseDynamics.h"
BodyDynamicsProviderDelegate::BodyDynamicsProviderDelegate(const MassCalibration& theMassCalib... | ALGO | 0.981622 | 6.88218 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2014-01-31T13:28:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d3cd93024... |
d138b9c2-95e7-45dc-b342-554234f54133 | zholofmeister/acmTemplate | 图论/双连通/割点 桥 v3.cpp | const int N=(int)1e4+100;
int n,m;
vector<int> E[N],sccv[N];
struct BCC {
int n, bcc, top, top2, tot, cntCut, sccIdx; //sccIdx:点双联通分量编号
vector<int> G[N];
vector< pair<int, int> > bridge;
int low[N], dfn[N], belong[N], fa[N], val[N], sz[N];
//val[i]表示i点tarjan出去多少个**多的(懂得都懂)**点
//sz[i]表示编号为i的点双里有多... | ALGO | 0.999873 | 4.5431 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2023-09-06T06:32:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d40df0478... |
41442712-3e52-4d88-9463-4c53a711c396 | turbulenz/turbulenz_engine | external/boost/1.43/include/boost/proto/transform/impl.hpp | ///////////////////////////////////////////////////////////////////////////////
/// \file impl.hpp
/// Contains definition of transform<> and transform_impl<> helpers.
//
// Copyright 2008 <NAME>. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http:... | TOOL | 0.953423 | 7.351044 | {
"github_metadata": {
"branch": "master",
"commit_count": 1737,
"repo_created_at": "2013-05-02T14:41:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4727,
"forks": 513,
"issues": 29,
"pull_requests": 9
},
"file_meta": {
"content_id": "ec... |
a8891ace-bad8-48d6-a978-64f1e56a316d | IllusoryY/exercise | Algorithms/InvertBinaryTree/InvertBinaryTree/InvertBinaryTree.cpp | /*
Invert a binary tree.
*/
#include<iostream>
#include<algorithm>
#include<cstdlib>
using std::max;
using std::cout;
using std::endl;
struct TreeNode
{
int val;
TreeNode *left;
TreeNode *right;
TreeNode() :val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) :val(x), left(nullptr), right(nullptr) {}
TreeNo... | ALGO | 0.999982 | 5.645044 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2019-10-13T14:20:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e72b53257... |
35fb6032-26fa-42be-9490-5c8c149bd34a | ElizaWszola/HTHC | task_a.cpp | /**
* Copyright 2019 <NAME> (<EMAIL>)
*
* 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 ag... | ALGO | 0.966316 | 5.250406 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-07-25T10:13: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": "c95c795673... |
8c5a3f08-fdb7-40c5-8368-1327528ccc59 | ankurg0806/LeetCode | String/Group_Anagrams_Using_CountingSort.cpp | /* 49. Group Anagrams
Given an array of strings strs, group the anagrams together. You can return the answer in any order.
An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.
Example 1:
Input: strs = ["eat","tea","tan... | ALGO | 0.999983 | 6.562787 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2020-08-23T15:21:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b466fd968... |
35c0620d-03ce-46f2-86b7-851d708aa8cb | Rolight/ACM_ICPC | Old_Contests/140730/A.cpp | #include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <climits>
#include <string>
#include <iostream>
#include <map>
#include <cstdlib>
#include <list>
#include <set>
#include <queue>
#include <stack>
using namespace std;
typedef long long LL;
const int maxn = 100000 + 5;
int num[maxn];
... | ALGO | 0.999915 | 3.398197 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2014-12-10T08:06:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cdf24dc5d... |
42fdc63f-f014-4fef-8963-f5c8e3a75fb5 | galaxysd/GalaxyCodeBases | c_cpp/etc/mVicuna/src/xny/sketch.hpp | //========================================================================
// Project : M-Vicuna
// Name : sketch.hpp
// Author : <NAME>
// Created on : Jul 2, 2013
// Version : 1.0
// Copyright : The Broad Institute
// SOFTWARE COPYRIGHT NOTICE AGREEMENT
// This software and its docum... | ALGO | 0.919696 | 5.028774 | {
"github_metadata": {
"branch": "master",
"commit_count": 10027,
"repo_created_at": "2015-04-11T16:12:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "72c3dfa... |
04945166-7810-4621-9a6c-aa2760efac93 | myCloudStrife/SSPP2018 | sem6/task4/quantum_transform.hpp | #ifndef SSPP_SEM6_TASK4_QUANTUM_TRANSFORM_HPP_
#define SSPP_SEM6_TASK4_QUANTUM_TRANSFORM_HPP_
#include <mpi.h>
#include <omp.h>
#include <complex>
#include <climits>
#include <utility>
constexpr int SENDRECVTAG = 7321;
std::complex<double> * quant_transform(std::complex<double> *a, uint64_t n,
int k, std::co... | ALGO | 0.999802 | 4.977509 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2018-09-07T16:03:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "820edbd1f... |
207938b0-95d7-4bce-aacf-cd7714a03781 | alaneos777/club | codeforces/247271G.cpp | #include <bits/stdc++.h>
using namespace std;
using lli = long long int;
const lli inf = numeric_limits<lli>::max();
struct edge{
int u, v; lli w; int id;
bool operator<(const edge & e) const{
return w < e.w;
}
bool operator>(const edge & e) const{
return w > e.w;
}
};
int main(){
ios_base::sync_with_stdio(... | ALGO | 0.999959 | 4.516999 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2018-08-06T04:13:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a10b7af7e... |
74dd8191-1346-4c62-86fe-a8c8badda6a5 | ragibshahrier/cp | Practice/D_Decrease_the_Sum_of_Digits.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define vi vector<int>
#define vll vector<ll>
#define pi pair<int,int>
#define pll pair<ll,ll>
#define ff first
#define ss second
#define vpi vector<pair<int,int>>
#define rep(ii,st, n) for(int ii=st; ii<n; ii++)
#define gp " "
//bit_manupulation
#de... | ALGO | 0.999287 | 3.355516 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2024-08-24T12:32:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c8b6a389... |
47293e19-7318-44c5-aef1-9bf1ee7088a7 | FLAGlab/SimCorp | codeforces/1553-G/submissions/OK/126578075.cpp | #include<bits/stdc++.h>
const int N = 200100;
int dv[1000100], prime[N], fa[N], tot;
void init(int n) {
for (int i = 2; i <= n; i++) {
if (!dv[i]) {
prime[++tot] = i;
dv[i] = tot;
}
for (int j = 1; j <= tot; j++) {
const int p = prime[j];
if (i * p > n) break;
dv[i * p] = j;
if (i % p == 0) break;
}
... | ALGO | 0.999794 | 3.905891 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2021-10-21T18:55:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f0952cc607b0... |
4be578cb-0e2a-45b9-96ec-19d5d918b136 | VerechoTJI/2021610Digital_WK | polling_8x8_led_matrix_745951.ino |
int fstones[] = {
0, 185, 207, 233, 247, 277, 311, 349, 370, 293//293 D4
};
int etones[] = {
0, 165, 185, 208, 220, 247, 277, 311, 330, 185//185 #F3
};
int me1[][2] = {
{6,-1},{7,-1},{1,0} ,{2,0},{3,0} ,{6,0} ,{5,0} ,
{3,0} ,{6,-1},{3,0} ,{2,0},{1,0} ,{7,-1},
{6,-1},{7,-1},{1,0} ,{2,0},{3,0} ,{2,0} ,{1,0} ... | ALGO | 0.968613 | 3.815714 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-06-10T12:09:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4d0d266981c... |
a7815d27-a9bc-41ab-abc7-08255b242f94 | smnahidhasan/Competitive-Programming | Leetcode/13. Roman to Integer.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int romanToInt(string s) {
int num = 0;
// cout<<s<<endl;
for(int i =0 ;i<s.size();i++)
{
int cnt = 1;
int x;
if(s[i]=='I')
x = 1;
if(s[i]=='V')
... | ALGO | 0.999949 | 4.941284 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2022-05-13T02:54:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e8234c3a65... |
9a95f24c-ac80-48df-8653-56994e4831f5 | sarakfouri/projects-c | trabalhoEdII.cpp | #include <stdio.h>
#include <stdlib.h>
#include <conio.h>
struct no{
int info;//informação a ser guardada na lista é um inteiro
struct no *prox;
};
typedef struct no Lista;
Lista *criaLista(void){
return NULL; //inicializando a lista com NULL
}
Lista *insereInicio(Lista *p, int num)
{
Lista *novo; //declar... | ALGO | 0.999581 | 4.754604 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-10-23T13:52: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": "10671d461b... |
243a2a0f-6aa6-47dc-90df-7abd1020dc68 | ducanh0/numerical-method | newton_pt.cpp | /**
input : initial approximation p0, tolerance TOL, maximum number of iterations N
output : approximate solution p or message of failure
*/
#include <bits/stdc++.h>
using namespace std;
const double minVal = -1e18;
const double maxVal = 1e18; /// avoid fault when calculate number
const double eps = 1e-18;
/... | ALGO | 0.999976 | 4.266551 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-05-04T04:14: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": "5a141d362e43... |
3df3de7d-666e-4611-aa6f-a810917bf532 | koba-e964/contest | atcoder/arc086/c.cpp | #include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <str... | ALGO | 0.999979 | 3.932795 | {
"github_metadata": {
"branch": "master",
"commit_count": 2836,
"repo_created_at": "2013-09-13T04:48:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 25,
"forks": 5,
"issues": 20,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a9cd... |
b478bf63-3969-4085-b040-c5249a66fa9e | JakubMazurek/zsk | 2B/petle.cpp | #include <iostream>
#include <cstdlib>
#include <cmath>
#include <ctime>
using namespace std;
int main()
{
/*int a;
while(a != 0){
cout<<"Podaj a";
cin>>a;
}*/
/*int i;
for(i=1; i<11; i++){
cout<<"i=";
cout<<i<<" ";
}
cout<<endl;*/
/*int i;
for(i=1... | TOOL | 0.987442 | 3.096357 | {
"github_metadata": {
"branch": "master",
"commit_count": 180,
"repo_created_at": "2017-11-16T19:29: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": "d9cbc104... |
e035104b-e72d-4721-96cc-8108a5aaa1cb | bblackyyyy/Algos | stol.cpp | #include <iostream>
//#include <string>
using namespace std;
struct food {
char name[20];
int cal;
};
// int minn(food arr[], int n){
// int min = arr[0].cal;
// for(int i =0; i<n; i++){
// if(min > arr[i].cal){
// min = arr[i].cal;
// }
// }
// return min;
// }
// int maxx(food arr[], in... | ALGO | 0.999861 | 3.902712 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2024-02-22T17:21: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": "ca61fbd7df2... |
e871e590-d7dc-4144-b50c-370cc5fcc385 | wyx150137/wyx-infinity37-ac-code-on-BZOJ | 4293_wyx.cpp |
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long LL;
const int N = 500000+5;
const int M = N << 2;
LL a[N],sum[N];
struct seg{
LL tmp1,tmp2;
LL Min,Max;
LL sum;
}tr[M];
void down(int k,int L,int R) {
if(L == R) return ;
int mid = (L+R) >> 1;... | ALGO | 0.999855 | 3.716706 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-07-12T01:10:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "09c8d29d92... |
1270877f-4f8e-4d78-ac0f-653ca7bcaf69 | SoulAdor/Algorithm-Templates | Algorithms/String/RabinKarp.cpp | #include <bits/stdc++.h>
using namespace std;
long long d = 26; // Alphabet size
long long mod = 1e9 + 7; // Modulo prime
// Powers stored here for fast computation.
vector <long long> pows_d;
void InitPowers (int size, int d)
{
pows_d.resize(size);
pows_d[0] = 1;
for (int i = 1; i < size; i++) pows_d[i] = pow... | ALGO | 0.999976 | 5.140607 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2019-08-22T23:51: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": "95d74dd06... |
59ffe1ef-e3f4-4d58-9cbe-bdfb834b46ee | ompl/ompl | src/ompl/control/planners/syclop/Syclop.h | /*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2011, Rice University
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following con... | ALGO | 0.999088 | 5.903876 | {
"github_metadata": {
"branch": "main",
"commit_count": 4948,
"repo_created_at": "2014-05-20T14:22:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1776,
"forks": 636,
"issues": 80,
"pull_requests": 28
},
"file_meta": {
"content_id": "64f... |
a30eb0e0-f997-4e64-810c-ffb862b3035a | ls1mardyn/ls1-mardyn | tools/mksd/main.cpp | /*
* main.cpp
*
* Created on: 04.01.2012
* Author: <NAME> <<EMAIL>>
*
* The method main() is called via the command line allowing for multiple flags.
* Operation: - processing the the input information: prefix of output file, what flags are set,
* adoption of the values of the flags (if set), oth... | DATA | 0.93203 | 5.665752 | {
"github_metadata": {
"branch": "master",
"commit_count": 6051,
"repo_created_at": "2018-10-14T13:38:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 30,
"forks": 15,
"issues": 48,
"pull_requests": 13
},
"file_meta": {
"content_id": "c8d1... |
96cd1b37-e1b0-40d5-bc4c-c51fd685b5b1 | NamanH16/DSA-PRACTICE | Priority Queues/HeapSort.cpp | /*Min Heap will arrange array in a decreasing order
Max Heap will arrange array in a increasing order*/
#include <iostream>
using namespace std;
void inPlaceHeapSort(int input[], int n)
{
// Step 1: Build the heap in input array
// We assume that 0th element is already sorted
for (int i = 1; i < n; i++)
... | ALGO | 0.999996 | 5.310726 | {
"github_metadata": {
"branch": "main",
"commit_count": 1111,
"repo_created_at": "2022-06-03T04:16:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98813e5e0... |
b9325285-a9c4-45ef-8616-52e4257c63b3 | ursuswh-metamorphic/OOP_Assignment_UIT | 23520066_BT07/Bai06/Source.cpp | #include <iostream>
using namespace std;
#include "CDuongTron.h"
int main()
{
CDuongTron O1, O2;
cout << "Moi nhap duong tron thu nhat: " << endl;
cin >> O1;
cout << "duong tron thu nhat la: ";
cout << O1;
cout << "Moi nhap duong tron thu hai: " << endl;
cin >> O2;
cout << "duong tron thu hai la: ";
cout << ... | ALGO | 0.968711 | 3.707227 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-07-30T13:54: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": "d8b515bf4b5a... |
271cebda-110d-4252-9e12-8c9a9722bb14 | Raccooon98/baekjoon_algo | 백준/Gold/13549. 숨바꼭질 3/숨바꼭질 3.cc | //숨바꼭질 앞뒤로 한칸씩 움직이거나(1초 소모) 현재 좌표의 두배로 이동 할 수 있음(0초 소모)
//예전에 풀었던 문제처럼 BFS로 해결 가능할듯
#include<iostream>
#include<queue>
#include<algorithm>
#include<cstring>
using namespace std;
int N,M;
int vis[100001];
int result= 10000000;
void BFS(int n) {
queue<pair<int, int>> q;//좌표 + 시간
q.push({ n,0 });
while (!q.empty())... | ALGO | 0.999967 | 3.34806 | {
"github_metadata": {
"branch": "main",
"commit_count": 315,
"repo_created_at": "2023-03-14T09:53: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": "2d53429f32... |
135f789f-4943-46af-b52f-dc9a0d349a9b | jho0n/Zhernovoy_Task_MP | GUI Out and In sorting/no_gui.cpp | /*
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <stdlib.h>
#include <iomanip>
#include <algorithm>
#include <vector>
using namespace std;
struct data
{
int information;
};
int comp_more(data a, data b)
{
if(a.information>b.information) return 1;
else return 0;
}
int comp_less(data ... | ALGO | 0.998485 | 4.525693 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-10-15T16:00: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": "87019639b7... |
4a2cb078-be46-4aae-8a90-2b7911bc9f51 | vineelkrish/LinkedList | ReverseKGroupsLL.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
ListNode* getKthNode(ListNode* curr, int k) {
while (curr && k > 0) {
curr = curr->next;
k--;
}
return curr;
}
ListNode* reverseKGroup(ListNode* head... | ALGO | 0.999977 | 5.751096 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-02T10:05:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc300bc36d45... |
531dbf5e-a3f4-4d3c-93ae-82f93332e4c8 | bhavinvirani/competitive-programming-coding-ninjas | 1. Basic Recursion/Sorted_Array.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
bool is_sorted(int a[], int n){
if(n == 0 || n == 1) return true; // Base case
if(a[0] > a[1]) return false; // checking first element of array
bool isSmallerSorted = is_sorted(a+1, n - 1); // checking for smaller array
re... | ALGO | 0.99996 | 5.454829 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2021-11-22T04:29: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": "20651ad0f... |
9537b069-426f-4c88-8139-4e5ee595cac7 | NeSC-IV/DEFORM | src/planning/path_opti/src/path_opti.cpp | #include "path_opti/path_opti.h"
void PathOptimizer::setGridMapandObsClearance(GridMap::Ptr map_, double clearance) {
grid_map_ = map_;
obs_clearance=clearance;
}
int PathOptimizer::startOpt(std::vector<Eigen::Vector2d>& path) {
vector<int> opti_vars;
for (int i = 0; i < path.size() ; i++) {
d... | ALGO | 0.999501 | 5.156302 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-03-14T01:32:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a933379cfa0a0... |
c1498c64-7e35-4e6f-a3f8-c0ab19aa73ae | PluckyCoward/WCH_IS_DEAD | W004. Median of Two Sorted Arrays.cpp | //Binary Search
class Solution {
public:
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {
int n = nums1.size();
int m = nums2.size();
if (n > m) {
return findMedianSortedArrays(nums2, nums1);
}
int LMax1, LMax2, RMin1, RMin2, c1, c2, l = 0, r = 2 * n;
while (l <= r)
{
c1 =... | ALGO | 0.999986 | 6.091838 | {
"github_metadata": {
"branch": "master",
"commit_count": 289,
"repo_created_at": "2020-01-16T05:49:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d104a1241... |
5784acc3-42ac-4893-bf51-7a57c97db4f1 | LiamSorta/HanyangLabs | C++ Labs Hanyang/Lab7b.cpp | //C++ Lab 7
//<NAME>
//<EMAIL>
#include <iostream>
#include <cmath>
#include <string>
using namespace std;
double square(double val1[], double val2[]);
int main()
{
double a[] = { 1, 0, 0 };
double b[] = { 0, 1, 1 };
double c[] = { 1, 1, 1 };
double d[] = { 0, 0, 1 };
double ab = square(a, b);
double ac... | ALGO | 0.999089 | 3.746398 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-01-26T19:25: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": "b255d98392... |
2908d25a-ab40-448b-8dfd-e440c6ac30b5 | backpropagator/backpropagator_old.github.io | Competitive Programming/UVa/UVa11402.cpp | #include<bits/stdc++.h>
using namespace std;
void built(int* tree,int* lazy,int* a,int start,int end,int index)
{
if(start==end)
{
if(a[start]==1)
tree[index]=1;
else
tree[index]=0;
lazy[index]=2;
return;
}
int mid=(start+end)/2;
built(tree,lazy,a,start,mid,2*index);
built(tree,lazy,a,mid+1,end,2*in... | ALGO | 0.999624 | 3.997305 | {
"github_metadata": {
"branch": "master",
"commit_count": 353,
"repo_created_at": "2019-02-07T14:41:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "268181fb... |
bd2909d0-18ee-41f9-bede-8adb54f50200 | i-am-harveyt/MyLeetCodePractice | cpp/1472.cpp | #include <iostream>
#include <vector>
using namespace std;
class BrowserHistory
{
public:
BrowserHistory(string homepage)
{
hist.push_back(homepage);
}
void visit(string url)
{
++cur;
if (hist.size() > cur)
hist[cur] = url;
else
hist.push_ba... | ALGO | 0.995978 | 5.140992 | {
"github_metadata": {
"branch": "main",
"commit_count": 88,
"repo_created_at": "2022-07-18T12:26: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": "29a8cd33127... |
5902e032-c646-4ac4-81c6-f4783f956da2 | navyxliu/leetcode | probs/prob315-bit.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm>
using namespace std;
class FenwickTree {
vector<int> sum_array;
int n;
inline int lowbit(int x) {
return x & -x;
}
public:
FenwickTree(int n) :n(n), sum_array(n + 1, 0) {}
void add(int x, int val) {
while (x <=... | ALGO | 0.999976 | 5.881551 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2016-07-19T09:56:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1f3791b9... |
a4dae9a4-faa4-48ca-b7e8-a5803379cf04 | kkrismer/transite | src/scoring.cpp | // [[Rcpp::plugins(cpp11)]]
#include <Rcpp.h>
#include <random>
#include <algorithm>
//' @title Score Sequences with PWM
//'
//' @description
//' C++ implementation of PWM scoring algorithm
//'
//' @param sequences list of sequences
//' @param pwm position weight matrix
//'
//' @return list of PWM scores for each seq... | ALGO | 0.996993 | 7.591823 | {
"github_metadata": {
"branch": "devel",
"commit_count": 171,
"repo_created_at": "2018-09-05T16:23:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e9058b6... |
b78edc5a-0d79-495f-927e-d5dc2d82803a | yonasadiel/cp | UVa/12190_ElectronicBill.cpp | #include <cstdio>
using namespace std;
int wattToBill(int watt) {
int ans = 0;
if (watt > 100) { ans += 2 * 100; watt -= 100; } else { return ans + watt * 2; }
if (watt > 9900) { ans += 3 * 9900; watt -= 9900; } else { return ans + watt * 3; }
if (watt > 990000) { ans += 5 * 990000; watt -= 990000; } else { re... | ALGO | 0.999825 | 3.254225 | {
"github_metadata": {
"branch": "master",
"commit_count": 187,
"repo_created_at": "2017-07-08T00:59:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bca3d0f6... |
c0164d71-ce96-468d-bdac-6e89d8153c13 | Dim-chae/Algo | 백준/Silver/2485. 가로수/가로수.cc | #include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
if (a == 0) return b;
return gcd(b % a, a);
}
int main() {
cin.tie(0);
ios::sync_with_stdio(0);
int N;
cin >> N;
vector<int> v;
int prv, cur;
for (int i = 0; i < N; i++) {
cin >> cur;
if (i > ... | ALGO | 0.99996 | 4.245984 | {
"github_metadata": {
"branch": "main",
"commit_count": 366,
"repo_created_at": "2023-07-15T07:21:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ee976ad24... |
320016d8-04cf-4680-9267-5d3a67781227 | Sumit-pd/DSA | strings/countPalindromicSubsequence.cpp | //brute
void helper(int i , string str, vector<string> &ans, string output){
if(i == str.length()){
if(output == ""){
return ;
}
ans.push_back(output);
return ;
}
output+= str[i] ;
helper(i+1,str,ans,output) ;
output.pop_back() ;
helper(i+1,str,ans,output) ;
}
vector<string> subsequences(string str){
... | ALGO | 0.999957 | 5.978782 | {
"github_metadata": {
"branch": "master",
"commit_count": 213,
"repo_created_at": "2023-04-05T11:42:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "185d841f... |
a691a2ec-e809-4490-adf3-28a690581971 | mbglover98/GraphClasses | GraphClasses.cpp | // GraphClasses.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <vector>
#include <map>
#include <list>
#include <algorithm>
#include <chrono>
template <class T>
class graph{
public:
virtual bool adjacent(T x, T y) = 0;
virtual std::vect... | ALGO | 0.984112 | 4.991444 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-01-25T00:32: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": "7eb232e963... |
2b1f845f-0051-4c46-ac16-8c32fbae1858 | CodderPrince/C-Plus-Plus | CODEFORCES/DIV 3 JAN 15 2024/c.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, f, a, b;
cin >> n >> f >> a >> b;
vector<int> moments(n);
for (int i = 0; i < n; ++i) {
cin >> moments[i];
}
sor... | ALGO | 0.999792 | 3.85124 | {
"github_metadata": {
"branch": "main",
"commit_count": 5146,
"repo_created_at": "2024-11-25T18:09:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d18d3c1b... |
de531169-8fd3-40dd-8430-65746a3cfaae | omerzaheer-dev/DSA-Theory-Assignment | q4.cpp | #include <iostream>
using namespace std;
class Node {
public:
int data;
Node* next;
Node(int item) {
data = item;
next = nullptr;
}
};
class orderedLinkedList {
private:
Node* head;
public:
orderedLinkedList() {
head = nullptr;
}
bool isEmpty() {
retu... | ALGO | 0.998447 | 5.917563 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-11-12T08:56: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": "16dad37a003e... |
51354ec9-4841-4846-9a4e-02ede5acc8b8 | ikhader/Programming | data_structs/btree_sum_of_all_elements.cpp | #include <iostream>
/*
* finds sum of all elements in binary tree
*/
using namespace std;
typedef struct __node
{
int data;
struct __node *l;
struct __node *r;
}stnode;
stnode * binarytree_createnode(int data)
{
stnode *pnode = new stnode();
if(!pnode)
return NULL;
pnode->data = data;
pnode->l ... | ALGO | 0.999967 | 5.338206 | {
"github_metadata": {
"branch": "master",
"commit_count": 149,
"repo_created_at": "2016-06-26T06:18:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e89bac4... |
09da1772-c378-4015-907b-a90d1ad7adea | jhnaldo/problem-solving | acmicpc/cpp/2897.cc | #include <stdio.h>
int main() {
int n, m, answer[5] = {0, };
char map[50][51];
scanf("%d %d", &n, &m);
for (int i = 0; i < n; i++) {
scanf("%s", map[i]);
}
for (int i = 1; i < n; i++) {
for (int j = 1; j < m; j++) {
int count = 0;
if (map[i-1][j-1] == '#') count -= 10;
if (map[i-... | ALGO | 0.999878 | 3.673556 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2018-02-25T16:12: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": "6e5564921... |
dcb0cb25-095a-42cc-a10e-9c11717bc9b8 | hashemja/Cache-simulator | cacheSim.cpp | /* 046267 Computer Architecture - Winter 20/21 - HW #2 */
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <cmath>
using std::FILE;
using std::string;
using std::cout;
using std::endl;
using std::cerr;
using std::ifstream;
using std::stringstream;
// Function to extract the set ... | ALGO | 0.971134 | 4.929642 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-09-26T10:44: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": "c3faa7d32793... |
912774b3-001e-48c0-bfa4-b0e5ddd6733b | raincross7/code-similarity | codes/train_code/problem421/problem421_233.cpp | #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPr(i,n) for(int i=(n)-1;i>=0; --i)
#define FORq(i, m, n) for(int i = (m);i <= (n);++i)
#define FORqr(i, m , n) for(int i = (n);i >=(m);--i)
#define SCD(n) scanf("%d",&n)
#define SCD2(m,n) scanf("%d%d"... | ALGO | 0.999979 | 3.529392 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07: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": "56e896d376a9... |
d56b8c7a-cde8-4942-8781-edc78883119e | akiyomov/ComputerProgramming-202301-IGS1232-001 | Lab4/Lab4-Ex5.cpp | #include <iostream> // include the standard input/output library
using namespace std; // use the standard namespace
int main() { // define the main function
int num; // initialize a variable to store the input number
while (true) { // infinite loop to continuously prompt the user for input
cout << "E... | ALGO | 0.992465 | 4.284661 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2023-04-30T19:17:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "99681cd77... |
13521625-f492-4743-a947-4936eb6513fa | ishandutta2007/codeforces-r | ronnie007/normal/682/C.cpp | #include<bits/stdc++.h>
using namespace std ;
#define MAXN 100007
int n ;
int a[ MAXN ] ;
vector < pair < int , int > > v[ MAXN ] ;
long long pref[ MAXN ] ;
int used[ MAXN ] ;
int ans = 0 ;
void dfs ( int vertex ) {
int i ;
int sz = v[ vertex ].size ( ) ;
if ( pref[ vertex ] > a[ vertex ] ) { used[ ve... | ALGO | 0.999676 | 3.777056 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:58: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": "eee19c6b5b93... |
effd99d0-0cf5-42af-9057-233cf76797b9 | zackaryjing/leetcodecpp | 0900_0999/leetcode-no934.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
class Solution2 {
public:
vector<vector<int>> directions = {{1,0},{0,1},{-1,0},{0,-1}};
void dfs(int i,int j,const vector<vector<int>>& grid,
vector<vector<int>> &vis,vector<vector<int>>& border,int n... | ALGO | 0.99997 | 5.652915 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2023-07-09T12:34: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": "5a5e6c635... |
0b1e9464-3b87-49e8-be55-6bf7fe9db697 | chickenchobab/BOJ-problem-solving | 7_simulation/2447.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int N;
vector<vector<char>> pattern;
void input(){
cin >> N;
}
void makePattern(int r, int c, int siz){
if (siz == 1) {
pattern[r][c] = '*';
return;
}
i... | ALGO | 0.999876 | 3.886059 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2023-07-26T09:20: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": "46206b65755... |
80ea6e09-72e1-4e0d-99a7-00c57e0592bc | lccspoon/ros_ws | src/hexapod_master/common/foot_swing_trajectory/lagrange_interpolator.h | #ifndef _LAGRANGEINTERPOLATOR_H
#define _LAGRANGEINTERPOLATOR_H
#include "../utilities/linear_trans.h"
#include <iostream>
#include <Eigen/Dense>
#include <eigen3/Eigen/Core>
#include <cmath>
using namespace Eigen;
class LagrangeInterpolator
{
private:
VectorXd x_;
VectorXd y_;
int n_;
... | ALGO | 0.991171 | 5.266824 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-05-29T13:37:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a86f23ae0c6... |
ad1464a1-9822-4bc6-84a1-8b007b033951 | areebg9/cpsc424-final | nbody-sim-new/fmm.h | #ifndef FMM_H
#define FMM_H
#include <vector>
#include <complex>
#include <memory>
#include <array>
#include "vector.h"
#include "body.h"
#include "utils.h" // Include utils.h for G, complex math helpers, and other constants
// Forward declarations
template <int D> class FMMNode;
template <int D> class FMM;
// Mult... | ALGO | 0.999886 | 6.330101 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-04-07T19: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": "8719a6c9873... |
f65484d7-bf79-4ee6-905a-0733155e41d9 | ishandutta2007/codeforces-d | dlalswp25/normal/1178/G.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef double ld;
const int BSZ = 200;
const ld NEGINF = -2e18;
ll A[202020];
ll B[202020];
ll tmp[202020];
int N, Q;
vector<int> adj[202020];
int dfn[202020];
int ed[202020];
int id;
vector<int> ord[2020];
pii P[2020... | ALGO | 0.999799 | 4.177143 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31: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": "0607fb87126d... |
e49af253-e58e-437f-9942-10d65bfaeaf6 | Dishebh/Data-Strucuture-Algos | ds algos/binary using recursion.cpp | #include <bits/stdc++.h>
using namespace std;
int binarySearch (int b, int e, int arr[], int x) {
int m=(b+e)/2;
if (arr[m] == x) return m;
else if (arr[m]>x) binarySearch(b, e, arr, x);
else if (arr[m]<x) binarySearch (b, e, arr, x);
else {
cout << "Item " << x << " not found!" << endl;
return 0;
}
retur... | ALGO | 0.99932 | 4.916228 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-12-10T16:47: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": "a061cf72da... |
5359cbd8-1559-4901-b4e5-d85f2e2f2c6e | branduo/COMP2710 | Project 3/project3_Duong_bhd0014.cpp | /*
* Author: <NAME>
* AU ID: bhd0014
* Class: COMP2710
* Filename: project3_Duong_bhd0014.cpp
* Compile source code with g++.
* I used Dr. Li's hints to write my code. I also googled how to use ifstream
* and ofstream as well as how to use c_str().
*/
#include <fstream>
#include <iostream>
using namespace std... | ALGO | 0.999496 | 4.590499 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-01-27T21:46: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": "77cd7552c27... |
358af5aa-1412-4eea-866c-6201805c5339 | Balusu-Revanth/AlgoUniversity | A18 BFS and Topological Sorting/1.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> bfs(int start, vector<vector<int>> g) {
int n = g.size();
queue<int> q;
vector<bool> visited(n+1, false);
vector<int> dist(n+1);
q.push(start);
visited[start] = true;
dist[start] = 0;
while (!q.empty()) {
int node = q.front();
q.pop();
... | ALGO | 0.999967 | 3.911017 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-05-02T06:16:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4af8ca8106... |
53197eda-5893-4692-bf9d-550820f39b43 | Rehwar123/Library-management | a.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
class Book {
public:
string title;
string author;
int quantity;
Book(string t, string a, int q) {
title = t;
author = a;
quantity = q;
}
};
class Library {
private:
vector<Book> books;
publ... | TOOL | 0.985761 | 6.055595 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-07-20T15:25:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "209d297c31fc... |
b4fb67e7-df65-46b2-91a4-0c4573dd326b | glennlopez/Cpp.Playground | zyBooks/5 - Arrays and Vectors/5.8 - Loop-modify/activity/compare_copy.cpp | #include <iostream>
#include <vector>
using namespace std;
/*
If the vector oldData is the same as the vector newData, print "Data matches!" ended with a newline. Otherwise, assign oldData with newData.
Ex: If oldData = {10, 12, 18} and newData = {25, 27, 29, 23}, then oldData becomes {25, 27, 29, 23}.
*/
int main... | TOOL | 0.991674 | 5.012248 | {
"github_metadata": {
"branch": "master",
"commit_count": 1869,
"repo_created_at": "2015-11-10T16:22:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "96236c... |
4985a7db-260f-4244-9f33-916ff325bb16 | Blow0/Algorithmic-Toolbox-SanDiego | week4_divide_and_conquer/2_majority_element/majority_element.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <algorithm>
using std::vector;
int countFreq(vector<int>& a, int left, int right, int num)
{
int count = 0;
if (right == a.size())
right--;
for (int i = left; i <= right; i++)
{
if (num == a[i])
count++;
}
return count;
}
int get_majority... | ALGO | 0.999989 | 4.15904 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-08-27T07:16: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": "43a4b82ee1... |
0ee48bb5-c4c6-4866-9376-91cdbf480dc7 | Shubham555/Dats-Structures-and-Algorithms-Codes | dsa33_Recursion_Binary_Day3.cpp | #include<iostream>
using namespace std;
// array is sorted or not
/*
bool isSorted(int arr[],int size){
//base case
if(size==0 || size==1){
return true;
}
if(arr[0]>arr[1]){
return false;
}
else{
bool ans = isSorted(arr+1,size-1); // Recursive Relation
return... | ALGO | 0.999853 | 4.822696 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2022-11-19T17:24: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": "191b1aad342... |
ae30291b-f6e6-46e1-8f68-97b0292b3fd7 | jgjung9/algorithm-test-practice | BOJ/C++/done/16198.cpp | /**
* https://www.acmicpc.net/problem/16198
*
* solution: Brute Force (Backtracking)
* 처음과 마지막을 제외한 모든 구슬을
* 가능한 모든 방식으로 제거하고 그 결과의 최댓값을 구한다.
*/
#include <iostream>
using namespace std;
int n, ans = 0;
int w[10];
bool removed[10];
void solve(int cnt, int res)
{
if (cnt == n - 2)
{
ans = max(ans, ... | ALGO | 0.999982 | 3.648735 | {
"github_metadata": {
"branch": "master",
"commit_count": 330,
"repo_created_at": "2021-12-24T12:45: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": "b24ca827... |
045a9424-6c21-493b-aae1-0b1e36e92653 | piLaboratory/GillesCom | src/main.cpp | #define R_STRICT_HEADERS
#include<iostream>
#include<fstream>
#include<string>
#include<RcppArmadillo.h>
Rcpp::Function warning("warning");
// Samples a single integer from 0:(size-1) with probabilities prob
// similar to R function sample(1:length(prob) - 1, 1, prob)
// Notice that prob does not need to be normaliz... | ALGO | 0.992916 | 6.26207 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2015-10-22T01:30:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "caf0d90875... |
0f9b44ef-40ae-4f3e-bb57-867a71a00a77 | AceWhale/04.10.22HW | 27.09.22HW/Source.cpp | #include <iostream>
#include <string.h>
#include <windows.h>
using namespace std;
class Queue
{
char* Wait;
int MaxQueueLenght;
int QueueLenght;
public:
Queue(const char* buf);
~Queue();
bool IsEmpty();
char Extract();
};
Queue::Queue(const char* buf)
{
MaxQueueLenght = 6;
Wait = new char[MaxQueueLenght];
s... | TOOL | 0.902447 | 3.089229 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-09-27T10:23: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": "af1a50ae7a... |
d9447d55-1686-4075-8156-5a611fd98482 | icpcvn/icpcvn.github.io | _site/2018/national/codes/g.cpp | #include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a), _b = (b); i <= _b; i++)
#define FORD(i, b, a) for (int i = (b), _a = (a); i >= _a; i--)
#define REP(i, n) for (int i = 0, _n = (n); i < _n; i++)
#define FORE(i, v) for (__typeof((v).begin()) i = (v).begin(); i != (v).end(); i++)
#define ALL(v) (v).begin(), ... | ALGO | 0.999349 | 4.101339 | {
"github_metadata": {
"branch": "master",
"commit_count": 126,
"repo_created_at": "2015-12-01T19:05:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 79,
"forks": 35,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d18cc74... |
006c5f1e-a136-48f7-a592-305c6a878ef0 | b4silio/MLDemos | _AlgorithmsPlugins/Reinforcements/reinforcementDP.cpp | /*********************************************************************
MLDemos: A User-Friendly visualization toolkit for machine learning
Copyright (C) 2010 <NAME>
Contact: <EMAIL>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as publ... | ALGO | 0.998921 | 4.793675 | {
"github_metadata": {
"branch": "master",
"commit_count": 485,
"repo_created_at": "2018-04-18T18:14:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 52,
"forks": 15,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "0de97d... |
3640ae00-9401-4430-8318-e59ce84f55d9 | tonyli00000/Competition-Code | UVA Online Judge/10603/10603/10603.cpp | #include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <math.h>
#define MAXN 100000
using namespace std;
int a, b, c, d,t, i, j, k, data[4],state[MAXN][4],tail;
void solve(int a, int b, int c, int d){
int a2, b2, c2, d2,i,j,k;
for (i = 0; i < 3; i++){
if (data[i] != 0){
for (j =... | ALGO | 0.999893 | 3.164904 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-07-09T22:14: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": "ba2d869a1... |
8b6609e8-80b2-4b5f-a305-d6f0f8bd78a5 | fsjhhh/acm_title | cpp/模板/有向图的拓扑序列.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <deque>
#define IOS ios::sync_with_stdio(false); \
cin.tie(0); \
... | ALGO | 0.999996 | 4.166059 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-10-30T10:57:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d8b869cd9c... |
7ca4a36c-fa28-4860-9467-6f260a517a9a | talhaibnmahmud/leetcode | source/cpp/1162. As Far from Land as Possible.cpp | #include <queue>
#include <vector>
class Solution {
public:
int maxDistance(std::vector<std::vector<int>>& grid) const {
if (grid.size() == 1) return -1;
std::queue<std::pair<int, int>> q;
for (auto i = 0; i < grid.size(); ++i) {
for (auto j = 0; j < grid[i].size(); ++j) {
... | ALGO | 0.999838 | 5.752657 | {
"github_metadata": {
"branch": "main",
"commit_count": 135,
"repo_created_at": "2022-12-29T19:05:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c6d3f0ef44... |
8829bc0d-4b0e-40c9-ac92-b6c6c8fcb955 | iamslash/learntocode | leetcode/CarPooling/a.cpp | /* Copyright (C) 2019 by iamslash */
#include <cstdio>
#include <vector>
#include <map>
// 13
// 4 5 6
// 6 4 7
// 4 3 5
// 2 3 5
// // 12ms 62.12% 10.2MB 100.00%
// // map
// // O(NlgN) O(N)
// class Solution {
// public:
// bool carPooling(std::vector<std::vector<int>>& T, int cap) {
// std::map<int, int> e... | ALGO | 0.999667 | 5.62124 | {
"github_metadata": {
"branch": "master",
"commit_count": 2102,
"repo_created_at": "2020-11-23T21:43:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1f1f0f... |
76f0d172-aeff-403c-95a0-195e20fce781 | chiranjeev-21/Codes-in-C-Cpp-and-python-of-CP-and-algorithms | DP/UniquePathsII.cpp | #include <bits/stdc++.h>
using namespace std;
// Some typedef's
typedef long long ll;
typedef unsigned long long ull;
const int inf = 1e9 + 7;
const double eps = 1e-6;
const double pi = 1.00 * acos(-1.00);
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
typ... | ALGO | 0.99998 | 3.79326 | {
"github_metadata": {
"branch": "master",
"commit_count": 605,
"repo_created_at": "2023-01-19T17:25: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": "8c3c9fa6... |
1c9d0593-d36a-43f7-8d5d-d7dca32a61b0 | Cation-Coder6/DSA-450-Solved | Dynamic Programming/2.Coin-Change-Ways.cpp | int change(int amount, vector<int> &coins)
{
int length = coins.size();
int t[length + 1][amount + 1];
for (int i = 0; i < length + 1; i++)
{
for (int j = 0; j < amount + 1; j++)
{
if (i == 0 && j != 0)
t[i][j] = 0; // if we have amount>0 but no coins i.e leng... | ALGO | 0.999708 | 4.923612 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-01-27T15: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": "30ae85dbf80... |
32548757-6f58-46dd-908e-c9b2b2007a16 | sammiiT/leetcode | queue/1429. First Unique Number.cpp | //===類似題====
//===思路===
(*)queue和map
1.add 紀錄每一個數出現的次數, 和出現的順序
2.pop Q中的每一個element, 如果滿足條件就回傳數值
3.不用管q.pop的數值, 因為被pop的數值都是不滿足條件的
//====
class FirstUnique{
public:
FirstUnique(){}
FirstUnique(vector<int> nums){
for(int i=0;i<nums.size();i++){
mp[nums[i]]++;
q.push(nums[i]);
... | ALGO | 0.999946 | 4.98206 | {
"github_metadata": {
"branch": "master",
"commit_count": 1345,
"repo_created_at": "2019-11-02T04:35: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": "3ae4f6b... |
f66f2186-81d7-4f98-b197-c4c6039a716a | Brook833/DailyLearningForC | day68/10_9.cpp | #include <vector>
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
void elimDups(vector<string> &words) {
for (auto c : words) {
cout << c << " ";
}
cout << words.size() << endl;
sort(words.begin(), words.end());
for (auto c : words) {
cout << c << ... | ALGO | 0.999603 | 4.539317 | {
"github_metadata": {
"branch": "main",
"commit_count": 212,
"repo_created_at": "2022-09-07T12:25: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": "59d60a3d4e... |
ded6df91-17cd-4d32-8ba0-32527aa88743 | Kubakl11/JK_Fitness | src/backend/FitnessPerson.cpp | #include "FitnessPerson.hpp"
//This function calculates the Soma Coeficient
void FitnessPerson::calculateSomaCoeficent()
{
if (soma_type == EKTOMORF)
{
soma = 1.1;
}
else if (soma_type == EKTOMEZOMORF)
{
soma = 1.05;
}
else if (soma_type == MEZOMORF)
{
(s... | ALGO | 0.946848 | 4.982955 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-05-23T13:08:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e375e3952f... |
af9af61a-2a61-4cd5-a24b-0df4a4a4a279 | Aarushi2812/Leetcode-Solutions | Delete node in Doubly Linked List - GFG/delete-node-in-doubly-linked-list.cpp | //{ Driver Code Starts
#include <stdio.h>
#include <stdlib.h>
/* a Node of the doubly linked list */
struct Node
{
int data;
struct Node *next;
struct Node *prev;
Node(int x){
data = x;
next = NULL;
prev = NULL;
}
};
// } Driver Code Ends
/* Structure of Node
struct Node
{
int dat... | ALGO | 0.999777 | 5.613279 | {
"github_metadata": {
"branch": "main",
"commit_count": 432,
"repo_created_at": "2022-07-03T08:18: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": "0b0172a28c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.