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 |
|---|---|---|---|---|---|---|---|
138e1a0a-f91e-4277-9074-9514359550a8 | dguerra/pdmaster | ConvexOptimization.h | /*
* ConvexOptimization.h
*
* Created on: Sep 17, 2014
* Author: dailos
*/
#ifndef MINIMIZATION_H_
#define MINIMIZATION_H_
#include <iostream>
#include "opencv2/opencv.hpp"
#include "CustomException.h"
//The process of finding the set of alpha values that gives the optimum phase aberration is non-linear
... | ALGO | 0.999818 | 5.56834 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2014-10-03T12:43:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "436f035ed... |
32f789f6-75a1-4c33-a954-6e31f4879f3b | enkerewpo/OI-Public-Library | 比赛 CONTEST/2021“MINIEYE杯”中国大学生算法设计超级联赛/2021“MINIEYE杯”中国大学生算法设计超级联赛(4)/2021“MINIEYE杯”中国大学生算法设计超级联赛(4)-程序/1002.cpp | // Correct solution in time complexity O(n^2)
// Method: DFS
// Author: HeRaNO
#include <cstdio>
#include <vector>
#define MAXN 2005
const int N = 2000;
const int b = 19560929;
const int M1 = 1000000007;
const int M2 = 1000000009;
int n, ans, c[MAXN], p[MAXN], cnt[MAXN], _1[MAXN], _2[MAXN];
std::vector <int> g[MAXN... | ALGO | 0.999877 | 3.772907 | {
"github_metadata": {
"branch": "master",
"commit_count": 117,
"repo_created_at": "2018-01-21T08:50:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1527,
"forks": 380,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "64d... |
cead1469-8636-438a-878f-75a1ebebc54a | sjzlyl406/Practice | test150.cpp | /*************************************************************************
> File Name: test150.cpp
> Author: leon
> Mail: <EMAIL>
> Created Time: 2015年08月18日 星期二 10时03分56秒
************************************************************************/
/*****************************************************************... | ALGO | 0.992835 | 3.785261 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2015-06-30T04:27: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": "e5db98a47... |
8a74d810-37c7-491f-b185-8a37c1723224 | nxnless/Algorithm-Code | Week3/Final Topological.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
void MainDuplicate() {
int n, m, u, v;
cin >> n >> m;
n++; // Increase size to handle 1-based indexing
queue<int> Q, S;
vector<int> G[n];
vector<int> inD;
inD.assign(n, 0);
for (int i = 0; i < m; i++) {
... | ALGO | 0.999964 | 4.461872 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-12-09T18:12: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": "9769bb0d885f... |
3b60efb2-51e8-462f-8d95-f339f341cd0a | Momofil31/Unitn_Programmazione1_2018 | array/mescolaArray.cc | #include <iostream>
#include <time.h>
#include <stdlib.h>
using namespace std;
void leggiVettore(int a[], int& n);
void leggiVettoreRand(int a[], int& n);
void stampaVettore(const int a[], int n);
void mescolaArray(const int a[], const int b[], int c[], int& n);
const int dim = 10000;
int main() {
int n;
int a[d... | ALGO | 0.98743 | 3.791709 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-12-22T10:50: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": "12c0f83fd9... |
32713f82-a3eb-4168-816d-7ea57bda1555 | mkp0/CP | CodeForce/B - Belted Rooms.cpp | #include <bits/stdc++.h>
#define ll long long
#define pi (3.141592653589)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define vi vector<int>
#define pii pair<int, int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mini(a, b, c) min(c, min(a, b))
#define ... | ALGO | 0.999935 | 3.519235 | {
"github_metadata": {
"branch": "master",
"commit_count": 198,
"repo_created_at": "2020-06-19T19:32: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": "9ef34dde... |
30845fa9-8194-4aeb-a9c9-d0aa1189e500 | alexandraback/datacollection | solutions_5690574640250880_0/C++/lrjconan/GCJ_2014_QR_ProbC.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <queue>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
void searchNeighbor(int & state, bool ** usedMap, char ** saveMap,
const int clickX, const int clickY, int & num, const int & numSafe, const int & R, const int & ... | ALGO | 0.999308 | 3.776658 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c211109d... |
31c8cf61-e122-4ce8-960e-d058ed066660 | geralt-tian/SEAF | SCI/src/FloatingPoint/fp-math.h | /*
Authors: <NAME>
Copyright:
Copyright (c) 2021 Microsoft Research
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... | TOOL | 0.905089 | 7.18365 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2025-01-06T02:50:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c735e66c8... |
cfe81f17-f180-4894-a918-499388e7293d | SiddhantAttavar/Competitive-Programming | CCCC/2-1-Recruitments/Contest-3/G. Treasure Hunt.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;
template<typename T> inline void input(T& inVar) {cin >> inVar;}
template<typename T, typename... S> inline void input(T& inVar, S&... args) {cin >> inVar; input(arg... | ALGO | 0.999813 | 4.066142 | {
"github_metadata": {
"branch": "main",
"commit_count": 607,
"repo_created_at": "2021-09-16T08:14:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f62db7fa... |
86d9fbb0-49f7-4ffe-aa90-c04a08a37eba | KratosMultiphysics/Kratos | applications/RANSApplication/custom_strategies/bossak_relaxation_scalar_scheme.h | // | / |
// ' / __| _` | __| _ \ __|
// . \ | ( | | ( |\__ `
// _|\_\_| \__,_|\__|\___/ ____/
// Multi-Physics
//
// License: BSD License
// Kratos default license: kratos/license.txt
//
// Main authors: <NAME>
// <NAM... | ALGO | 0.999042 | 5.972189 | {
"github_metadata": {
"branch": "master",
"commit_count": 106408,
"repo_created_at": "2017-02-13T10:58:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1141,
"forks": 265,
"issues": 381,
"pull_requests": 258
},
"file_meta": {
"content_id"... |
2ebd64d7-ad2f-40cd-b71a-844f07dc28c7 | billheg/CS300 | VecSor/VectorSorting/VectorSorting.cpp | //============================================================================
// Name : VectorSorting.cpp
// Author : <NAME>
// Version : 1.0
// Copyright : Copyright © 2017 SNHU COCE
// Description : Vector Sorting Algorithms
//========================================================================... | ALGO | 0.999274 | 5.615598 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-02-25T20:22: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": "197882f7c00b... |
e1e10e23-0948-4f4a-bcde-77a4b65e34a2 | shimla-sinthia/Segment_Tree | Segment_with_the_maximum_sum.cpp | //https://codeforces.com/edu/course/2/lesson/4/2/practice/contest/273278/problem/A
//<NAME>
//Allah knows best
#include<bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#incl... | ALGO | 0.99989 | 4.560091 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2021-07-17T10: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": "b5a46982d29... |
e5e59cb6-5916-4162-b96b-0c83f34f982d | hrushikesht/CompetitiveProgramming | algo-imp/dijkastra.cpp | #include <bits/stdc++.h>
#include <unordered_map>
#include <utility>
#include <tuple>
#define ll long long int
#define vi vector<int>
#define vl vector<ll>
#define pi pair<int,int>
#define tiii tuple<int,int,int> >
#define tiiii tuple<int,int,int,int>
#define pl pair<ll> pl
#define vpi vector< pair<int,int> >
#define... | ALGO | 0.999866 | 3.885696 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-03-16T20:24: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": "0ad97b7ccd... |
626ff5b5-57ed-4500-86b5-e24ceb94a7b6 | missionbhattarai443/Chapter-8-assignment | chapter 8 assignment.cpp | #include <iostream>
using namespace std;
int main() {
const int rows = 3; // Number of rows in the matrix
const int cols = 4; // Number of columns in the matrix
double matrix[rows][cols]; // Matrix to store user input
// Prompt the user to enter the matrix row by row
cout << "Enter a " << rows << ... | ALGO | 0.999837 | 5.55295 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-03-16T12:26: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": "bcf8afd258dd... |
87cb79b6-79b7-4579-ae82-9d84c4f4f837 | mianfg-DGIIM/ALGO | Prácticas/Practica2/Codigos/transpose_anotaciones.cpp | #include <iostream>
#include <unistd.h>
using namespace std;
#define TAMANIO_TEST 8
void generarMatriz(int **v, int tam) {
v = new int*[tam];
int index = 0;
for ( int i = 0; i < tam; i++ ) {
v[i] = new int[tam];
for ( int j = 0; j < tam; j++ ) {
v[i][j] = index;
in... | ALGO | 0.983625 | 4.200905 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-05-12T15:56:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b3b408613e... |
1d694652-24f1-4d91-ba58-6d875a20c325 | Mantu01/Programming | C++ Code/Basics/Array/1 D/Bubble sort.cpp | #include<iostream>
void ascarr(int arr[], int n){
int a=n;
for(int i=1;i<n;i++){ // Total (n-1) round of comparision is required.
for(int j=0;j<a-1;j++){ // only (n-1) elements are require to sort, last element will be sorted automatically.
if(arr[j]>arr[j+1]){
... | ALGO | 0.999801 | 4.535622 | {
"github_metadata": {
"branch": "main",
"commit_count": 933,
"repo_created_at": "2024-03-28T17:49:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3a88f12f8c... |
f9d962a7-6ab4-4242-9b52-aa7d30f7bc4e | TheWangYang/cpp_codebase | university practice/openGL/lab4.cpp | //#define GLUT_DISABLE_ATEXIT_HACK
//#include <iostream>
//#include <windows.h>
//#include <math.h>
//#include <GL/glut.h> // OPenGL实用工具库
//#include <gl\GL.h>
//#include <gl\GLU.h>
//
//using namespace std;
//
//#define pi 3.1415926
//
//
//void init(void){
// glClearColor(1.0, 1.0, 1.0, 0.0);
// glMatrixM... | ALGO | 0.996394 | 4.612713 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-04-04T05:26:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45c9cfaeebbc... |
6d090289-199e-4148-a23d-69baa6031904 | PrafoTekno/BDK-Belajar_Cpp_Dasar | 28-Overloading Fungsi/src/Main.cpp |
#include <iostream>
using namespace std;
int LuasKotak (int p, int l) {
return p * l;
}
int LuasKotak (int p) {
return p * p;
}
double LuasKotak (double p, double l) {
return p * l;
}
double LuasKotak (double p) {
return p * p;
}
int main () {
// Overloading fungsi, adalah fungsi yang dapat b... | ALGO | 0.975807 | 5.279678 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-07-19T10:01: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": "19872fb2ef18... |
4ed98f0c-dd4d-491b-9270-1034b4162ca9 | StephanTheisgen/splean | src/bloom.hpp | // (C) Copyright by <NAME>
//
// This is a quick and dirty implementation of a blocked Bloom filter.
// The code is based on code from Apache Impala (incubating) and its version from here:
// https://github.com/peterboncz/bloomfilter-repro/blob/master/src/simd-block.h
//
// The SIMD reinterpret_casts technically viola... | TOOL | 0.925727 | 6.638434 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2025-04-05T20:41:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "430d9aa1cc1... |
af4cf607-d4c0-4521-ae23-154e2bd8b5fa | gbakkk5951/OriginalProblems | ProblemSolvingOJ/2st_term/week2/糖果括号/toshow.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long lld;
const int MXN = 1e6 + 10;
const int left_bracket = 0, right_bracket = 1, sugar = 2;
struct Element {
int type;
lld sweet;
};
typedef deque<Element> d;
d q;
int type[MXN];//仅用于读入初始数据
lld answer = 0;
template <typename iterator>
void update(iterato... | ALGO | 0.999774 | 3.426504 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-12-27T14:52: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": "2c295e9f57... |
99c7fc79-3e5e-427b-8bd1-702ddb467b8a | yiorgosynkl/ntua-ece-progintro | citycirc/citycirc.cpp | /**********************************************************************
* Project : ntua-ece-progintro
* Program name : citycirc.cpp
* Author : yiorgosynkl (find me in Github: https://github.com/yiorgosynkl)
* Date created : 20200109
* Purpose : go around citys having positive a... | ALGO | 0.999989 | 3.950744 | {
"github_metadata": {
"branch": "master",
"commit_count": 107,
"repo_created_at": "2019-12-30T00:10: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": "06bc1eb4... |
49429e9d-8463-496c-a1dc-caded3539a11 | Warawreh/CP-Library | Contests/SWERC 2018/c.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define fast ios::sync_with_stdio(false);cin.tie(0);
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main(){
fast
int n,m... | ALGO | 0.999505 | 3.695869 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2022-04-16T08:24:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c343cb92a94... |
a0fcff58-57e2-4a32-982e-e43f7ecd5249 | realAYAYA/UnrealEngine-ToonLit | UnrealEngine/Engine/Source/Runtime/Datasmith/CADKernel/Private/CADKernel/Geo/Surfaces/RuledSurface.cpp | // Copyright Epic Games, Inc. All Rights Reserved.InBoundary
#include "CADKernel/Geo/Surfaces/RuledSurface.h"
#include "CADKernel/Geo/Curves/Curve.h"
#include "CADKernel/Geo/Sampling/SurfacicSampling.h"
#include "CADKernel/Utils/ArrayUtils.h"
namespace UE::CADKernel
{
void FRuledSurface::LinesNotDerivables(const FS... | ALGO | 0.916621 | 6.944555 | {
"github_metadata": {
"branch": "5.4",
"commit_count": 164,
"repo_created_at": "2023-03-14T06:10:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 66,
"forks": 9,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8fb56c7bf... |
bd46080b-a679-4378-bfdf-f8d9bac3511c | bvillarroelr/entregable2_EDD | archivos experimentacion/heapsort_v1.cpp | // Compilación: g++ -o heapsort_v1 heapsort_v1.cpp
#include <iostream>
#include <chrono>
#include "priorityQueue.h"
using namespace std;
int main(int argc, char** argv) {
// Si no hay suficientes argumentos, terminamos la ejecución
if(argc < 2) {
cerr << "Usage: " << argv[0] << " <cantidad de elementos>" <<... | ALGO | 0.999668 | 5.019551 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2024-05-27T19:30: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": "80cf4554d87... |
72b77a07-6239-437b-8adc-426b181850d6 | LakshyaBatra04/Lakshya-does-DSA | BinaryTreeQuestions.cpp | #include<iostream>
using namespace std;
#include<stack>
#include <queue>
#include<vector>
#include<map>
class node{
public :
int data;
node* left;
node* right;
//constructor
node(int data){
this->data=data;
this->left=NULL;
this->right=NULL;
}
};
class ... | ALGO | 0.999992 | 3.260669 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-10-12T13:42: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": "23c22a1359cb... |
9ac04551-4e31-4fbf-b19a-e756aabd3f0a | kharisovilyas/control_n3 | control_n3/main.cpp | #include <iostream>
#include <vector>
#include <memory>
#include <locale>
#include <cstdlib>
#include <map>
#include "ui.h"
#include "test.h"
#include "sort.h"
using namespace ui;
using namespace sort;
using namespace std;
enum { start = 1, taskreturn = 0 };
enum { exitp = 0, rfile = 1, rconsole = 2, random = 3};
en... | TOOL | 0.951253 | 4.00656 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2023-04-14T02:20: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": "fc39e52c2b... |
7daa0143-d3eb-425d-94d9-34d0956a86ad | AngryCaveman/C-Struct | 02链式线性表/ListNode/ListNode/listnode.cpp | #include "listnode.h"
/*线性链式结构*/
#define Ok 1;//操作成功
#define Error 0;//操作失败
typedef int Statu;//链表操作状态回复
typedef int ElemType;//typedef 声明一个int类型
typedef struct Node
{
ElemType data;//数据
Node *next;//长度
};
typedef Node *LinkList;
//输出链表
void ListPrint(LinkList l)
{
cout << "输出结果" << endl;
Node *n=l;
while (n->ne... | ALGO | 0.999227 | 3.770994 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-05-27T13:25:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c945ba18... |
ea3c53a4-c1e0-470d-9abc-b7c22ee96731 | yasminefontenele/42_CPP | CPP_module09/ex02/PmergeMe.cpp | #include "PmergeMe.hpp"
PmergeMe::PmergeMe() {}
PmergeMe::PmergeMe(const PmergeMe &other) { *this = other; }
PmergeMe &PmergeMe::operator=(const PmergeMe &other)
{
if (this != &other)
{
_vec = other._vec;
_deq = other._deq;
}
return *this;
}
PmergeMe::~PmergeMe() {}
// checks if the... | ALGO | 0.999616 | 6.468075 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2024-11-08T15:19:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63b568faa94... |
7ac51e49-55ca-4add-9da6-0c0a1d9a5427 | actium/codeforces | 1900/10/1919c.cpp | #include <iostream>
#include <vector>
constexpr unsigned oo = ~0u;
template <typename T>
std::istream& operator >>(std::istream& input, std::vector<T>& v)
{
for (T& a : v)
input >> a;
return input;
}
void answer(unsigned x)
{
std::cout << x << '\n';
}
void solve(const std::vector<unsigned>& a)
... | ALGO | 0.999836 | 5.71726 | {
"github_metadata": {
"branch": "master",
"commit_count": 4876,
"repo_created_at": "2020-06-17T16:27:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db784d4... |
53465f3b-f639-4261-a9de-ff98411ba91d | kevinkowa/CS-3333-Data-Structures | Lab1/trendtracker.h |
#ifndef TRENDTRACKER_H
#define TRENDTRACKER_H
#include <vector>
#include <string>
using namespace std;
class Trendtracker
{
// For the mandatory running times below:
// n is the number of hashtags in the Trendtracker.
public:
// Creates a new empty collection of hashtags.
Trendtracker();
// Adds a hasht... | ALGO | 0.997853 | 5.886454 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-09-01T00:44: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": "bc7ee51790... |
106924d7-8fba-4b63-99fe-41f193cb9169 | jbohren-forks/personalrobots-pkg | vision/visual_odometry/src/CvMatUtils.cpp |
#include "CvMatUtils.h"
using namespace cv::willow;
#include <iostream>
#include <fstream>
using namespace std;
#include <limits.h>
#include <opencv/cxcore.h>
#include <opencv/cvwimage.h>
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include "CvMat3X3.h"
#include <boost/foreach.hpp>
#include <Eigen/Geometry>... | TOOL | 0.903975 | 5.320899 | {
"github_metadata": {
"branch": "master",
"commit_count": 23066,
"repo_created_at": "2017-08-07T02:30:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e26de3... |
9046d5cf-71bc-4ba9-8374-c80e4f99eef1 | gou4shi1/leetcode | 19.remove-nth-node-from-end-of-list.cpp | /*
* [19] Remove Nth Node From End of List
*
* https://leetcode.com/problems/remove-nth-node-from-end-of-list/description/
*
* algorithms
* Medium (34.06%)
* Total Accepted: 233.6K
* Total Submissions: 686K
* Testcase Example: '[1,2,3,4,5]\n2'
*
* Given a linked list, remove the nth node from the end of ... | ALGO | 0.999969 | 6.152305 | {
"github_metadata": {
"branch": "master",
"commit_count": 125,
"repo_created_at": "2018-03-11T09:12:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a318407... |
d2ae576f-9bbc-48e5-95a2-e753e19a755d | AdelinNicolaeS/Proiectarea-Algoritmilor | tema2/adrese.cpp | #include <algorithm>
#include <fstream>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
struct Person {
string name;
vector<string> emails;
};
int find_parent(int node, vector<int> parent) {
// parcurg iterativ pana ajung la parintele adevarat
for (; node != parent[node]; no... | ALGO | 0.99976 | 4.166394 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2021-06-27T18:17: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": "4229d06d41... |
2d38ac4a-f7d6-4006-be1c-684d55890312 | ulaval/advent-of-code | 2021/Guillaume Dion (oligocart)/day04/main.cpp | // AoC_2021_04
#include <iostream>
#include <vector>
#include <map>
#include <sstream>
#include <numeric>
using std::size_t, std::cout, std::string, std::vector, std::map, std::array;
constexpr int N = 5;
struct cell {
int row, col;
};
template<typename K, typename V>
std::vector<K> map_keys_to_vec(const map<K, V... | ALGO | 0.999931 | 6.420436 | {
"github_metadata": {
"branch": "master",
"commit_count": 347,
"repo_created_at": "2020-11-17T15:08:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3fc1bdaac... |
d1989718-2dab-4794-85aa-00d2943873d6 | mbkim95/Algorithm | Baekjoon/26169.cpp | #include <iostream>
using namespace std;
bool canFind;
int r, c, b[5][5];
const int dx[] = {-1, 0, 1, 0}, dy[] = {0, -1, 0, 1};
void dfs(int x, int y, int cnt, int ate) {
if(canFind || cnt > 3) return;
if(ate >= 2) {
canFind = true;
return;
}
for(int i=0; i<4; i++) {
int nx =... | ALGO | 0.999918 | 4.484722 | {
"github_metadata": {
"branch": "master",
"commit_count": 1176,
"repo_created_at": "2018-10-23T01:25:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0c26c3... |
c648970a-a960-4dba-a60b-2c27e88f7894 | caixzn/contests | ac/abc/277/c.cpp | #include <iostream>
#include <map>
#include <list>
using namespace std;
int highest = 1;
void dfs(map<int, bool> &vis, map<int, list<int>> &g, const int id = 1) {
if (g.find(id) == g.end())
return;
vis[id] = true;
highest = max(highest, id);
list<int> &neighbors = g[id];
for (const auto &n... | ALGO | 0.998943 | 4.07214 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-11-21T01:41: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": "81306559f0cd... |
584bc20f-ad2e-4173-8f12-872457453f92 | NickLennonLiu/cpp | dsa/PA/PA2b/BBST Performance/generator.cpp | #include <iostream>
#include <ctime>
#include <random>
#include <algorithm>
using namespace std;
#define nmax 1000000
#define xmax 3500000
default_random_engine e;
uniform_int_distribution<int> u(0, xmax);
uniform_int_distribution<int> percentage(0,100);
int num[nmax];
char random_operation(int ins, int del, int qu... | ALGO | 0.989868 | 3.573402 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2020-07-15T14:23:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08543c3b6... |
bea29d22-3e29-4d41-99d5-1c18c50c9657 | bqi343/cp-notebook | Implementations/content/graphs (12)/Trees (10)/HLD (10.3).h | /**
* Description: Heavy-Light Decomposition, add val to verts
* and query sum in path/subtree.
* Time: any tree path is split into $O(\log N)$ parts
* Source: http://codeforces.com/blog/entry/22072, https://codeforces.com/blog/entry/53170
* Verification: *
*/
#include "../../data-structures/1D Range Queries (... | ALGO | 0.999822 | 5.031971 | {
"github_metadata": {
"branch": "master",
"commit_count": 1350,
"repo_created_at": "2017-07-11T03:52:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2642,
"forks": 429,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e... |
aaa699df-7134-47d0-9f7d-c515860550eb | huang46u/VMAS-code | cgogn/geometry/functions/distance.h | /*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* Copyright (C), IGG Group, ICube, University of Strasbourg, France *
* ... | ALGO | 0.994575 | 6.981208 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2025-03-07T22:15:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "426db9626... |
d0449eec-22de-454b-8b75-aacf75103d46 | smrutichan/DSA_LAB | queue_list_adt (2).cpp | // Program to implement Queue using list ADT
#include <cstdio>
#include <cstdlib>
#define SIZE 5
class Queue{
private:
int arr[SIZE];
int front;
int rear;
public:
Queue(){
front=-1;
rear=-1;
}
// Function declarations
void en... | ALGO | 0.995764 | 4.229147 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-05T02:48: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": "910b7433d5bc... |
d46f9f59-c4cf-4eb1-b01d-b32e49216a54 | SanctusAnimus/aoc_2023 | aoc_2023/day_1.hpp | #ifndef AOC_DAY_1
#define AOC_DAY_1
#include "solution.hpp"
#include <array>
static const std::array<std::string, 9> words {
"one", "two", "three", "four", "five", "six", "seven", "eight", "nine"
};
class Day1 : public Solution<Day1> {
public:
Day1() {
day_num = 1;
p1_expected = 54331;
p2_expected = 54518;... | ALGO | 0.998066 | 5.487452 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2023-11-29T15:39: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": "7b7b2464b... |
7ca5bf44-262f-4baf-ae27-171c66b1eb8b | sarahcompsci/CSC_LM_Chapter_04 | 4-5_option2.cpp | // <NAME>
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
int shirts;
float payPercent;
float costShirt;
float total;
cout << "How many shirts would you like?" << endl;
cin >> shirts;
if (shirts < 5)
{
payPercent = 1.00;
}
else if (shirts <= 10)
{
payPercent =... | ALGO | 0.993506 | 4.086772 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-02-10T19:08: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": "b2762bed18ef... |
69923e17-d49e-4ddc-8649-4583705e8908 | MrWhitezz/Coding-during-Learning | C++/ProblemSolving/Term4/Week2/C/bruteforce.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define maxn 20
int n, m, u, v;
int edge[maxn][maxn];
vector<int> vt_set;
ll vertices;
bool is_clique(ll vt);
bool is_max_clique(ll vt);
ll ans = 0;
int main(){
cin >> n >> m;
for (int i = 0; i < m; ++ i){
cin >> u >> v;
edge[u]... | ALGO | 0.999806 | 4.235508 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2021-04-05T07:26:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b2f9a56b... |
f9253116-f06e-4fbc-bf9d-e77ec56e9434 | gnuh24/Programming-Techniques | Example chapter 2/c2_ex2.cpp | #include<iostream>
using namespace std;
void input(int *&a, int &n);
void output(int *a, int n);
int GTLN(int *a,int n);
void swap(int *a, int *b);
void Sort(int *a, int n);
int main(){
int *a, n;
input(a,n);
output(a,n);
cout << "Max = " << GTLN(a,n);
Sort(a,n);
output(a,n);
delete a;
return 0;
... | ALGO | 0.999806 | 3.507369 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-06-24T05:10: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": "ef38845d6d... |
3ba48a87-8c10-4b23-aec9-0970c546f117 | 202515026woorim/- | 20250410/20250410/0410.cpp | #define _USE_MATH_DEFINES
#include <stdio.h>
#include <math.h>
// 중력가속도
#define G 9.8
#define DEG_TO_RAD(angle) ((angle) * M_PI / 180.0)
#define RAD_TO_DEG(angle) ((angle) * 180.0 / M_PI)
int main() {
double speed, angleDeg;
double Vx0, Vy0;
// 입력
printf("발사 속도 (m/s)를 입력하세요: ");
scanf_s("%lf", &sp... | ALGO | 0.99852 | 5.178875 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2025-04-04T00:28:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "420476d9c36... |
b40f0dac-e7e0-4cd4-afe0-5901620ce6c7 | joona95/algorithm | sds/sds/sds/1915 가장 큰 정사각형.cpp | //2020.01.15
//1915
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
int arr[1005][1005];
int dp[1005][1005];
int min(int a, int b) {
if (a > b)
return b;
else
return a;
}
int main() {
int n, m;
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++)
scanf("%1d", &arr[i][j... | ALGO | 0.999914 | 3.229159 | {
"github_metadata": {
"branch": "master",
"commit_count": 129,
"repo_created_at": "2019-08-31T02:22: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": "72c3b857... |
4afec73c-d3ce-49d9-ad95-c1668bc0aa77 | TengFeiyang01/Algorithm | bishi/5-18美团/c.cpp | #include <bits/stdc++.h>
const int inf = 0x3f3f3f3f;
using i64 = long long;
void solve() {
std::string s;
std::cin >> s;
std::unordered_set<char> st{'a', 'e', 'i', 'o', 'u'};
std::string t;
for (auto c : s) {
if (!st.count(c)) {
t += c;
}
}
std::cout << t << "\n";
std:... | ALGO | 0.999837 | 4.40309 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2024-07-12T15:01: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": "7640e71cd... |
0c1b65d2-1d09-419c-b844-4e2c26db9a71 | Abdoelabassi/Leetcode | DataStructuresAndAlgo/CC++/main.hh | #pragma ounce
#include <vector>
/**
* merge - merge two lists
* @list_a: first half
* @list_b: second half
* Returns: merged list
*/
template<typename T>
std::vector<T> merge(std::vector<T> &list_a, std::vector<T> &list_b){
size_t i, j = 0;
std::vector<T> merged_list;
while (i < list_a.size() && j ... | ALGO | 0.999975 | 5.7233 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-04-16T10:11: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": "caf354112a2d... |
958eeac8-710d-483b-86cd-6fe25e252715 | Hoff22/CompetitiveProgramming | summer_camp/SUMMERCAMP22/Day1/G.cpp | #include <bits/stdc++.h>
#define N 200000
#define MAX 1000000000
#define E 0.00000001
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFll 0x3f3f3f3f3f3f3f3fll
#define LEFT(x) (2 * x)
#define RIGHT(x) (2 * x + 1)
#define se second
#define fi first
using namespace std;
char a[N+1];
int main(){
int n;
scan... | ALGO | 0.999922 | 3.02529 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2024-10-24T23:39:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "233a1f6b8bb... |
f8f3e6d1-fae7-497e-b9bc-e1bd41be2c8a | WinkySpeed/Raycasting | Raycasting-Walltexture.cpp |
#include <SFML/Graphics.hpp>
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
using namespace std;
using namespace sf;
#define screenWidth 1440
#define screenHeight 900
#define mapWidth 24
#define mapHeight 24
#define texWidth 64
#define texHeight 64
int worldMap[mapWidth][mapHeight] =
{
{... | ALGO | 0.983039 | 3.523078 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-05-31T06:45: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": "341325819f13... |
b6b927a5-8581-43a0-80dd-70ce63ee33c8 | hank7z7/leetcode | cpp/145.binary-tree-postorder-traversal.cpp | /*
* @lc app=leetcode id=145 lang=cpp
*
* [145] Binary Tree Postorder Traversal
*
* https://leetcode.com/problems/binary-tree-postorder-traversal/description/
*
* algorithms
* Easy (72.04%)
* Likes: 7089
* Dislikes: 199
* Total Accepted: 1.4M
* Total Submissions: 1.9M
* Testcase Example: '[1,null,2,... | ALGO | 0.999981 | 6.766634 | {
"github_metadata": {
"branch": "master",
"commit_count": 554,
"repo_created_at": "2022-03-26T17:31:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "885ba9c5... |
11350b28-725b-4aa6-aa5d-a621d51d55cb | Ronald-Gutierrez/Ciencia-de-la-Computacion-I | arreglos/ejercicios/ejercicio_8.cpp | #include <iostream>
#include <iomanip>
#include <array>
#include <algorithm>
using namespace std;
int main(){
int max;
int num,agregar;
array<int,10> nombre_arreglo;
for(int i=0;i<nombre_arreglo.size();i++){
nombre_arreglo[i]=450;
if(i%2==0)
nombre_arreglo[i]+=200... | ALGO | 0.99702 | 3.759953 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-01-06T23:11: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": "5821c5561028... |
f1b2c0f8-4b4b-41ef-99cb-9b61d9d84b25 | Kartik-Mathur/CPP-PP-Dec-21 | Lecture-6/Directions.cpp | // Directions.cpp
#include <iostream>
using namespace std;
int main() {
int x = 0, y = 0, i;
char ch;
ch = cin.get();
while (ch != '\n') {
if (ch == 'N') {
y++;
}
else if (ch == 'S') {
y--;
}
else if (ch == 'E') {
x++;
}
else {
x--;
}
ch = cin.get();
}
// cout << x << " " << y << ... | ALGO | 0.999942 | 3.904245 | {
"github_metadata": {
"branch": "main",
"commit_count": 65,
"repo_created_at": "2021-12-12T13:35:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 6,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "3910509e63... |
f6e2d945-adf5-4a16-bbd3-6e9a1ac21514 | jiadaizhao/LintCode | 0101-0200/0132-Word Search II/0132-Word Search II.cpp | class TrieNode {
public:
// Initialize your data structure here.
TrieNode() {
next.resize(26);
isEnd = false;
str = "";
}
vector<TrieNode *> next;
bool isEnd;
string str;
};
class Solution {
public:
/**
* @param board: A list of lists of character
* @p... | ALGO | 0.999929 | 6.437494 | {
"github_metadata": {
"branch": "master",
"commit_count": 76,
"repo_created_at": "2017-10-02T03:48:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 72,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "35e63cb7... |
7c837f21-e3bb-4b21-b265-99ea579d6b24 | keyboardsmoke/const-enc-20 | Const20/ConstantMersenne.h | #pragma once
namespace constant
{
namespace dist
{
template <class _Ty, int _Wx, int _Nx, int _Mx, int _Rx, _Ty _Px, int _Ux, int _Sx, _Ty _Bx, int _Tx, _Ty _Cx, int _Lx>
class const_mersenne_twister : public std::_Circ_buf<_Ty, _Nx>
{
// mersenne twister generator
... | TOOL | 0.978971 | 6.563601 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-07-10T07:08: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": "f44903a468... |
3584bc6c-aa64-4f4c-bed4-ba2ceb3d7910 | harshit2608/Solved-Programming-Questions | GeeksForGeeks/Number of Coins.cpp | //TODO: Memoization
class Solution
{
public:
int dp[101][10001];
int minCoins(int coins[], int M, int sum)
{
memset(dp, -1, sizeof(dp));
int ans = solve(coins, M, sum);
// Your code goes here
if (ans == INT_MAX)
{
return -1;
}
return ans;... | ALGO | 0.999979 | 5.038944 | {
"github_metadata": {
"branch": "master",
"commit_count": 220,
"repo_created_at": "2019-09-11T10:58:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cecb5dbe... |
c0ea160c-72b2-4753-8351-6ab483ee4fac | fukuta0614/procon | Atcoder/aribon2-1/b.cpp | // aribon2-1_b
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define debug(x) cout << #x << ": " << (x) << endl
#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= ... | ALGO | 0.999901 | 3.228057 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2018-10-03T13:42:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c63fc2ddf... |
cf04dfac-9b9c-423a-9750-f8851cc00c6c | RooTinfinite/leetcode-solutions | solutions/72-edit-distance/edit-distance.cpp | class Solution {
public:
int minDistance(string word1, string word2) {
const int m = word1.length();//first word length
const int n = word2.length();//second word length
// dp[i][j] := min # of operations to convert word1[0..i) to word2[0..j)
vector<vector<int>> dp(m + 1, vector<int>(n + 1));
fo... | ALGO | 0.999987 | 5.902584 | {
"github_metadata": {
"branch": "main",
"commit_count": 6094,
"repo_created_at": "2024-10-23T03:55:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9543207c2... |
5cfe5f42-0466-4de7-975c-0ec0cdf75b9d | piotr-obroslak/Algorithmic_Tasks | Sorting/heap_sort.h | #ifndef _HEAP_SORT_H_
#define _HEAP_SORT_H_
#include <functional>
#include <utility>
class heap_sort
{
public:
static const char * name(void) { return "heap sort"; }
template<typename data_type, typename comparator_type = std::less<data_type>>
static void run(data_type *array, const size_t count, comparator_type... | ALGO | 0.999583 | 5.87346 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2015-07-26T17:50:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed0574e01... |
bab849fd-4fe2-41df-b498-54a15b8dca61 | ntd275/Applied-Algorithms | Contest 2/K Queue/main.cpp | /*
Author: DucNT
Date:
*/
#include <bits/stdc++.h>
#define Author "DucNT"
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define M 1000000007
#define PI 3.14159265358979323846264338328
using namespace std;
int n,a[100005],nex[100005],res[100005],pos[100005];
int main()
{
ios_base::sync... | ALGO | 0.999995 | 3.723395 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-05-23T16:10:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1fe1fb19ff... |
d8af843f-b13b-415d-ba59-7b970d96cdf8 | alexandraback/datacollection | solutions_5670465267826688_0/C++/treebeard/Dijkstra.cpp | /*
* =============================================================================
*
* Filename: Dijkstra.cpp
*
* Description: Dijkstra
*
* Created: 04/11/2015 01:36:03 AM
* Compiler: gcc/g++
*
* Author: <NAME> (llwu), <EMAIL>
* Organization: Massachusetts Institute of T... | ALGO | 0.999922 | 3.966016 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5be717ea0... |
974a6fd4-4aa9-4068-a64f-58868617c05c | Chaitanya27Sanmotra/Data-Structure-and-Algorithms | Binary Trees/binary_tree.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n';
using namespace std;
class node {
public:
int data;
node* left;
node* right;
node(int d) {
data = d;
left = right = NULL;
}
};
node* buildTree() {
int data; cin >> data;
if (data == -1)
return NULL;
node* root = new node(data... | ALGO | 0.999975 | 3.549236 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-08-21T17:46: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": "8316510e86... |
6f68cd3e-7d3a-4371-8934-04a28f66e9c8 | dae00a/BOJ_COTEST | 백준/Gold/4574. 스도미노쿠/스도미노쿠.cc | #include <bits/stdc++.h>
using namespace std;
int N;
int plane[10][10], cnt;
const int dx[2] = {0, 1}, dy[2] = {1, 0};
bool used[10][10], flag;
bool isPossible(int r, int c, int v);
void printPlane();
void dfs(int dep);
int main(void) {
cin.tie(nullptr);
cin.sync_with_stdio(false);
while(1) {
i... | ALGO | 0.99945 | 4.607391 | {
"github_metadata": {
"branch": "main",
"commit_count": 123,
"repo_created_at": "2022-09-24T00:55:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "198bd2639c... |
306de417-bc24-4b9f-a899-e5908e1e43d8 | avirup247/WaterLeadLevelPredictor | xpublog/OLDcppcon/ComputeCpp-CE-2.7.0-x86_64-linux-gnu/include/SYCL/builtins/math_common.h | /*****************************************************************************
Copyright (C) 2002-2018 Codeplay Software Limited
All Rights Reserved.
Codeplay's ComputeCpp
*******************************************************************************/
/**
@file sycl_math_common_builtins.h
@brief D... | TOOL | 0.976685 | 7.427041 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-09-10T16:15:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed9d3f91f6... |
d341c984-3018-4e9f-8111-3009e4353f19 | drooboll/computer_physics_2019 | task4.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <fstream>
#include <iostream>
std::vector<double> pointsX;
std::vector<double> a;
double fun(double x){
return log(x);
}
double calcW(unsigned int k, unsigned int i){
double w = 1;
for (unsigned int j = 0; j <= i; j++){
... | ALGO | 0.989266 | 4.055364 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-11-10T14:49: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": "f7bed23fe1... |
f8460e09-1d99-4cd8-8825-fe7df73706cb | ritikgarg655/CodeForce | john_cont.cpp | // #include<bits/stdc++.h>
// using namespace std;
// int find_cy_size(vector<int> graph[],int n){
// bool visited[n] = {false};
// // bfs to find cycle;
// }
// int main(){
// int n,m;
// cin>>n>>m;
// vector<int> graph[n];
// vector<int> num[n+1];
// for(int i=0;i<m;i++){
// int a,b;
// cin>>a>>b;a--;b... | ALGO | 0.999871 | 4.32813 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2019-12-21T08:00: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": "ab40d86c4... |
4e0bfd82-8b17-4acd-8993-d4aa0bba05af | matrefeytontias/Escher4D | Escher/Escher4D/utils.cpp | #include "utils.hpp"
#include <algorithm>
#include <cstring>
#include <fstream>
#include <iostream>
#include <iterator>
#include <stdexcept>
#include <string>
#include <vector>
#include <Empty/math/mat.h>
std::string getFileContents(const std::string &path)
{
std::ifstream ifs;
ifs.open(path, std::ios_base::... | TOOL | 0.976998 | 6.169284 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2019-02-05T12:48:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e5f48303... |
b2925a49-1913-41eb-9793-9404f5aa250e | TonyStark-sudo/LeetCode | array/removeElement.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution{
public:
int removeElementUseErase(vector<int>& nums, int val){
// 调库一行代码就可以解决
nums.erase(remove(nums.begin(), nums.end(), val), nums.end());
// cout << "last index: " << remove(nums.begin(),... | ALGO | 0.999414 | 5.3487 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2024-12-21T14:39: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": "e6aa1371b16... |
502fcb19-a1b0-49af-ba42-07b3a6a37fb5 | AbdulsametEkinci/object_oriented_projects | car factory efficiency/src/simulation.cpp | #include <iostream>
#include <fstream>
#include <string>
#include "simulation.hpp"
void Simulation::printWelcomeMessage() const
{
std::cout << "Welcome to the Car Factory!" << std::endl;
std::cout << "You have " << m_total_days << " days to make as much money as possible" << std::endl;
std::cout << "You ... | TOOL | 0.922532 | 4.364576 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-06-12T12:45: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": "b2728c88fda5... |
ab016ba9-6999-44db-a124-5a5a82f42782 | bayulaxana/data_structure_implementation | For C++/Binary Search Tree/unique_binary_search_tree.cpp | /**
* Implementasi Binary Search Tree (ADT: BST)
* yakni BST yang tidak menyimpan key duplikat (unique key)
*
* Dibuat dan ditulis oleh Bayu Laksana
* -- tanggal 29 Februrari 2019
* Struktur Data 2020
*
* Implementasi untuk Bahasa C++
*/
#include <stdio.h>
#include <stdlib.h>
/* Node structure */
struct B... | ALGO | 0.999973 | 5.56812 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2020-01-06T02:22:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 54,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dec18139... |
636ef47c-f454-4fc7-bed9-b8bb814d20e4 | vogarko/base-scimath | askap/scimath/utils/DelayEstimator.h | /// @file
///
/// @brief estimate delay from the complex spectrum
/// @details This class implements a simple algorithm to estimate delay from a complex spectrum
/// by unwrapping the phase and fitting a straight line into the phase slope. This code was
/// originally located in the data monitor of the software corre... | ALGO | 0.948028 | 6.017105 | {
"github_metadata": {
"branch": "Fourth-order-smoothing",
"commit_count": 379,
"repo_created_at": "2021-01-11T08:20:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"conten... |
dd6b51a0-29a0-40f1-b6c6-00d18b47dcdf | TopHK/fightcode | top/HappyNumber_202.cpp | /*
Write an algorithm to determine if a number is "happy".
A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits,
and repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle... | ALGO | 0.99997 | 4.298936 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2018-04-03T11:49: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": "214cc54cc... |
55021876-e150-4bf2-92a0-53669e7f5e29 | BhensdadiyaHeet/cpp-projects | Link List/q1.cpp | #include<iostream>
using namespace std;
class Node{
public :
int data;
Node *next;
Node(int element){
this->data = element;
this->next = NULL;
}
};
class LinkedList{
public :
Node *head = NULL;
int count = 0;
LinkedList(){
this->head = NULL;
this->... | ALGO | 0.998037 | 5.008546 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-04-17T04:57: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": "9a2c563fc614... |
74e00cf8-807f-46ae-b5ee-9f9e440e8f8f | lsung8976/Algoritm | fileArch3_1/exam16.cpp | #include <stdio.h>
#define MAX_TERMS 80
struct Term{
int expon;
float coeff;
};
class SparsePoly {
int nTerms;
Term term[MAX_TERMS];
public:
SparsePoly(int n = 0 , Term *tm = NULL)
: nTerms(n)
{
for(int i = 0 ;i < nTerms ; i++)
{
term[i].expon = tm[i].expon;
... | TOOL | 0.939605 | 3.854458 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2017-01-05T06:42: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": "0b79b8fa3... |
44d55eeb-9fbc-4e9c-9690-96e93d224996 | luonginfosec/DSA | DSA_PTIT/DSA06027.cpp | //Thoi gian troi qua khong the quay tro lai. LuongVD <3, AC AC AC PLEASE
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
ll n;
cin >> n;
ll a[n];
for(auto &x... | ALGO | 0.999969 | 4.235313 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2024-12-25T15:07: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": "da403f2f193... |
e1c2382d-042c-44b9-a19a-a9fb72d5339d | uetsu840/Study_ProgrammingContests | CSAchademy/CrossingTree/solver1.cpp | #pragma GCC optimize ("O3")
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <set>
#include <algorithm>
#include <numeric>
#include <list>
using namespace std;
usin... | ALGO | 0.999767 | 3.36623 | {
"github_metadata": {
"branch": "master",
"commit_count": 123,
"repo_created_at": "2018-07-30T14:46: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": "4dddb373... |
5b27be8f-6e4b-47d2-8f9c-659f31f06f90 | Nishu6129/Stack_and_queue | querue.cpp | # include <iostream>
using namespace std;
template <typename T>
class QueueArr{
T *data;
int nextIndex;
int firstIndex;
int size;
int capacity;
public :
QueueArr(int s){
data = new T[s];
nextIndex=0;
capacity=s;
firstIndex=-1;
size=0;
}
vo... | ALGO | 0.995716 | 3.741688 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-10-11T01:00: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": "05f9f67f89... |
b61ac757-750f-4820-9545-de3b35cce952 | cgm0089/cpp-program | ctest/q8/main.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int nth(int dat[], int len, int num){
for(int j = 0; j < len; j++){
int con = 0;
for(int k = 0; k < len; k++){
if(dat[j] > dat[k]) con++;
}
if(con == num) return dat[j];
}
return... | ALGO | 0.999878 | 3.689206 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-05-24T12:23:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "2ed0f3393aa9... |
528e14a8-aa5e-4ca5-9a92-98bbf441c4fe | MarkB19988/Project3-AnagramSolver | AnagramSolverCode.h | #include <iostream> // Inlucded libraries
#include <fstream> // --
#include <string> // --
#include <cstdlib> // --
#include <map> // --
using namespace std; // Makes functions with the same names within different libraries distinguishable
string answer;
int lastScore; // Creates int called lastScore
void sol... | ALGO | 0.998453 | 4.158267 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-12-04T11:17: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": "b4c75d5e59... |
f4cb2e6e-7c6d-411f-9a21-957a3fa6e36c | Misaka233/acm | Events Arrangement.cpp | /*sort() // 将活动按照b/c的值,从大到小排序
For i = 1 .. N // 枚举活动种类
For v = c[i] .. M-1 // 枚举背包容量
For j = 1 .. K // 枚举举办次数
totalTime = c[i] * j
If (totalTime > v) Thne
// 举办j次,超过了背包容量
Break
End If
tempValue = calc(v - totalTime, j, i)
... | ALGO | 0.99985 | 3.719025 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2016-04-07T09:11:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0442bd042f... |
09e92793-dbdb-40a3-b279-9ed9d33fd2e9 | GRTLCollaboration/Chombo | lib/src/AMRTools/NodeNorms.cpp | #ifdef CH_LANG_CC
/*
* _______ __
* / ___/ / ___ __ _ / / ___
* / /__/ _ \/ _ \/ V \/ _ \/ _ \
* \___/_//_/\___/_/_/_/_.__/\___/
* Please refer to Copyright.txt, in Chombo's root directory.
*/
#endif
// Norms.cpp
// petermc, 12 Aug 2002
// petermc, 9 Sep 2002, revised again:
/... | ALGO | 0.997972 | 5.87148 | {
"github_metadata": {
"branch": "main",
"commit_count": 89,
"repo_created_at": "2018-01-30T14:07:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 16,
"forks": 12,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "dea64f4342... |
71948eb4-d4f3-4260-a4d3-916c954ef93b | YunoGasasi9862/LeavestoDLL | LeavestoDLL/Source.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdlib.h>
#include <stdio.h>
#include "Binary.h"
#include "DLL.h"
void InOrder(bnode_t* root, node_t**List, node_t** Temp)
{
if (root != NULL)
{
InOrder(root->left, List, Temp);
if (root->left == NULL && root->right == NULL)
{
if (*List == NULL)
{
*List = add... | ALGO | 0.999912 | 3.611584 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-06-20T23:10: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": "e55e1ba128... |
26dc123d-7540-4638-a360-5f6c70474da9 | microsoft/SEAL | native/src/seal/util/rlwe.h | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#pragma once
#include "seal/ciphertext.h"
#include "seal/context.h"
#include "seal/encryptionparams.h"
#include "seal/publickey.h"
#include "seal/randomgen.h"
#include "seal/secretkey.h"
#include <cstdint>
namespace seal
... | TOOL | 0.954846 | 7.001515 | {
"github_metadata": {
"branch": "main",
"commit_count": 1818,
"repo_created_at": "2018-11-09T00:33:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3828,
"forks": 739,
"issues": 112,
"pull_requests": 5
},
"file_meta": {
"content_id": "2a9... |
c549ba24-20ba-4def-b3d6-af717a92d4d4 | zlum/simple | simpleMaxCounter/main.cpp | #include <cstdint>
#include <iostream>
#include <string>
using namespace std;
struct Res
{
explicit Res(int size): arr(new int[size]), n(size) {}
~Res() { delete[] arr; }
int* arr = nullptr;
int n = 0;
};
Res* findMax(int a[], int n)
{
if(n == 0) return nullptr;
int max = a[0];
int coun... | ALGO | 0.999951 | 4.358732 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2020-04-13T17:25: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": "c6771a70c... |
32e680a3-0f0c-4b38-a6ff-ad6e1750b2e0 | ishandutta2007/codeforces-b | burnedchicken/normal/1456/C.cpp | #include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace std;
using namespace __gnu_pbds;
#define int long long
#define ull unsigned long long
#define ld long double
#define rep(a) rep1(i,a)
#define rep1(i,a) rep2(i,0,a)
#define rep2(i,b,a) for(int i=(b); i<((int)(a)); i++)
#define rep3(i,b,a) for(int i=(b); ... | ALGO | 0.999964 | 4.083129 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05: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": "1a90c49b4e6d... |
1dd78995-a70c-4d49-a377-7da435478440 | programmerwcn/Computer-Graphics | Project3/Project3/Polygon.cpp | //
// Created by 吴小宁 on 2019/11/3.
//
#include "Polygon.h"
#include "Polygon2D.h"
#include "glm/glm.hpp"
/**
*
* @param k_a ambient reflection coefficient
* @param k_d diffuse reflection coefficient
* @param k_s specular reflection coefficient
* @param K average distance between scene and light (constant)
* @pa... | ALGO | 0.991423 | 5.119798 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-10-11T00:06: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": "f4f8fcca5... |
a8d9cc01-d41c-4a0c-94ca-796c6bab7f5c | suhasghorp/FinEngLech | include/FinEngLech/BSJumps.h | #ifndef __BSJUMPS_H_INCLUDED__
#define __BSJUMPS_H_INCLUDED__
#include <algorithm>
#include <iostream>
#include <cmath>
#include <random>
#include <numeric>
#include <chrono>
#include <Eigen/Dense>
#include <Eigen/Core>
#include <EigenRand/EigenRand>
using namespace Eigen;
using namespace std::chrono;
enum class O... | ALGO | 0.997843 | 6.23539 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-10-28T21:04: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": "aa71af1896... |
37f79acf-cfe1-4e76-b074-a22e2b02060b | vrangr1/competitive-programming | contests/codeforces/edu_rounds/edu_round_1--/edu_round_153_div2/c.cpp | #if 0
me=`basename $0 .cpp`
rm -f $me $me.out
only_compile=${1:-0}
if [ $only_compile == compile ]; then
g++ -std=c++20 $me.cpp -o $me -Wall -O2 -Wextra -Wno-sign-conversion -Wshadow -Wl,-stack_size -Wl,0x20000000
exit
fi
if [ $only_compile == debug ]; then
g++ -std=c++20... | ALGO | 0.999949 | 4.435313 | {
"github_metadata": {
"branch": "main",
"commit_count": 585,
"repo_created_at": "2021-06-02T19:31: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": "9655e5e933... |
35ac7eb2-518d-48a6-ac77-5673b6397f2a | jetsarew/Programming-Fundamental | week6/72.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <string>
#define st first
#define nd second
using namespace std;
struct box{
int cur_node;
int dis;
string tmp;
bool operator<(const box &a) const{
return a.dis < dis;
}
};
int n;
int start;
int cnt;
priority_queue<box> pq;
... | ALGO | 0.999907 | 3.926505 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2022-08-30T01:22: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": "fc79c67ba08... |
1f7c5e8a-b5f8-4f00-bcbc-c61091745ef5 | NguyenKhoiDinh/CompetitiveProgramming | VNOI/qbmax.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX_N = 105;
int n, m;
int a[MAX_N][MAX_N];
int dp[MAX_N][MAX_N];
int main () {
cin >> n >> m;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
cin >> a[i][j];
}
}
for (int i = 1; i <= n; i++) {
dp[i][1] = a[i][1];
}
f... | ALGO | 0.999981 | 3.810263 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2021-03-25T18:48:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "176860ab... |
fe5c419f-85f5-4649-81c1-b7bce00b4d46 | kunal158/LEETCODE | 225. Implement Stack using Queues.cpp | class MyStack {
public:
/** Initialize your data structure here. */
queue<int>q;
MyStack() {
}
/** Push element x onto stack. */
void push(int x) {
q.push(x);
}
/** Removes the element on top of the stack and returns that element. */
int pop() {
... | ALGO | 0.999579 | 5.241626 | {
"github_metadata": {
"branch": "main",
"commit_count": 59,
"repo_created_at": "2021-08-30T19:38: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": "4e552bbdee6... |
b42e2335-d4b1-4731-a7bb-1898bdc56543 | AlecAivazis/condorBatch | include/CORE/topmass/ttdilepsolve.h | /**
Original Author <NAME> <<EMAIL>>
Minor modiifcations by <NAME> <<EMAIL>>
*/
#ifndef ttdilepsolve_class_h
#define ttdilepsolve_class_h
#include "TLorentzVector.h"
#include "TVector2.h"
#include "TH1F.h"
#include<iostream>
#include <vector>
#include <map>
//#include "/nfs-3/userdata/kalavase/lhapdf-5.8.3/include/L... | ALGO | 0.99756 | 4.089231 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2014-07-07T03:01: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": "94c3e6a1c... |
838b3892-b20b-499e-b346-332c1e17da78 | taumoeba/IEEERoboticsJV2022 | RobotSerialControl/RobotSerialControl.ino | // Currently configured for testing
/*******************************************************************************************
* Main program for LU JV IEEE Robotics 2022
* Written by <NAME> and <NAME>
* April 2022
*
* Microcontroller: Arduino Mega 2560
* Components List:
* - Adafruit Motor Control Shield v2.... | TOOL | 0.902656 | 4.115919 | {
"github_metadata": {
"branch": "main",
"commit_count": 80,
"repo_created_at": "2021-11-18T21:52: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": "382a456fc13... |
8af25e93-7a39-42d7-8f75-0be8366858e4 | subha-shesgin/Data_Structure | TREE/BASICS2/BST_search.cpp | #include <iostream>
using namespace std;
struct Node {
int data;
Node* left;
Node* right;
Node(int val) {
data = val;
left = right = NULL;
}
};
// Search in BST
Node* searchBST(Node* root, int val) {
while (root != NULL && root->data != val) {
if (val < root->data) {
... | ALGO | 0.999992 | 5.816456 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2025-06-23T16:43: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": "b4bcea8f197... |
9c623594-20a8-4669-9499-b583d8b524e1 | synthetik-technologies/blastfoam | src/solidModels/fvPatchFields/solidContact/contactModels/normalContactModels/normalContactModel/normalContactModel.H | /*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2007 <NAME>
\\/ M anipulation |
---------------------... | TOOL | 0.937422 | 6.430394 | {
"github_metadata": {
"branch": "master",
"commit_count": 1752,
"repo_created_at": "2019-10-22T01:38:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 261,
"forks": 104,
"issues": 26,
"pull_requests": 1
},
"file_meta": {
"content_id": "c43... |
b5d39bbf-4714-4943-8f9a-c04c6d583543 | teddyy279/Cpp-test | test2 2024/Chu vi lớn nhất.cpp | #include<bits/stdc++.h>
using namespace std;
int n, m, a[102][102], b[102][102];
int dx[4] = {0, 0, 1, -1};
int dy[4] = {1, -1, 0, 0};
void loang(int i, int j, int &sum){
int cnt = 0;
a[i][j] = 0;
for(int k = 0; k < 4; k++){
int i1 = dx[k] + i;
int j1 = dy[k] + j;
if(i1 >= 0 && i... | ALGO | 0.999934 | 3.935824 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2024-12-03T12:33: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": "ad9c2d53575... |
d67ffb0d-a8b9-49f8-ac44-9b86915e430c | keshavpurohit070305/Dsa-Daily | 3647-zero-array-transformation-iii/3647-zero-array-transformation-iii.cpp | class Solution {
public:
int maxRemoval(vector<int>& nums, vector<vector<int>>& queries) {
int n = nums.size();
int m = queries.size();
vector<vector<int>> starts(n);
for (int i = 0; i < m; i++) {
starts[queries[i][0]].push_back(i);
}
vec... | ALGO | 0.999882 | 5.568037 | {
"github_metadata": {
"branch": "main",
"commit_count": 424,
"repo_created_at": "2025-05-19T14:13: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": "99966db564... |
2dfebf8a-c170-4bef-8ba8-335ce5a7dff4 | ASSERT-KTH/Supersonic | predictions/submissions-aizu-cot-gpt35/Codenet/p02240/763914734/response_9.cpp | #include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
class Relation {
public:
Relation(int n, int m) {
V.resize(n);
num_of_each.resize(n, 0);
group.resize(n, 0);
}
void push(int s, int t) {
V[s].push_back(t);
V[t].push_back(s);
num_of_each[s]++;
num_of_each[t]+... | ALGO | 0.999984 | 4.854351 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-02-03T10:33:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1f7269244662... |
e45f03ff-c222-49a8-908c-3a5d6cda304e | SathvikSat/CNN_PL_LAB | lab2/exercise/src/kernels.cpp | #include "kernels.h"
#include "stdio.h"
#include "stdlib.h"
#include "iostream"
using namespace std;
/*
* Applies a 2d convolution on a 3D X using W: Z= W (conv) X + b
* Tensor * X: Input Tensor
* Tensor * W: Array of N weight Tensors (N == Z.size[0]) // feature extraction/ num of filters??
* Tensor * Z: Output ... | ALGO | 0.982417 | 3.140715 | {
"github_metadata": {
"branch": "CNN_PL_LAB",
"commit_count": 3,
"repo_created_at": "2023-05-05T16:43: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": "6ef322... |
373bd383-eb24-4f73-bdf1-4f880e7250f2 | tay10r/lbvh | bench/bvh_library.cpp | #include "bvh_library.h"
#include <bvh/linear_bvh_builder.hpp>
#include <bvh/primitive_intersectors.hpp>
#include <bvh/single_ray_traverser.hpp>
#include <bvh/sweep_sah_builder.hpp>
void
bvh_library::build_bvh(const float* vertices, std::size_t tri_count)
{
using vec3f = bvh::Vector3<float>;
m_triangles.resize(t... | ALGO | 0.992252 | 6.532385 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2020-09-26T11:59:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d082c46dad... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.