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 |
|---|---|---|---|---|---|---|---|
b36724c5-e669-479c-b992-b3ceff336b59 | leostd/Competitive-Programming | Library/DP/EggDropping.cpp | /*
Este algoritmo consigue el numero minimio de lanzamientos dados n
huevos y k pisos.
Al lanzar un huevo desde un piso p, el huevo puede romperse o no.
Se toma el peor caso de ambos.
k ==> Number of floors
n ==> Number of Eggs
eggDrop(n, k) ==> Minimum number of trials needed to find the critical
... | ALGO | 0.999784 | 4.761563 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2017-04-09T05:24:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a29add9... |
29e18eea-ad45-44fe-9c0a-dfafd3de67f7 | hachemite/c-Structure_de_donnees | serie1-2/exo4-serie2.cpp | #include <stdio.h>
#include <stdlib.h>
#define MEMORY_SIZE 1000 // Taille totale de la mémoire simulée
// Structure de données pour un bloc de mémoire
typedef struct {
void *ptr; // Pointeur vers le bloc de mémoire alloué
size_t size; // Taille du bloc de mémoire
} MemoryBlock;
MemoryBlock memory[MEM... | TOOL | 0.958082 | 4.01834 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-09-29T21:36: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": "e4d51a08724a... |
87f1d57a-431b-4242-8c79-d642def1ec55 | Samriddhi430/GFGcodingproblems | Easy/Find Transition Point/find-transition-point.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
int transitionPoint(int arr[], int n) {
if(arr[0]==1){
return 0;
}
if(arr[n-1]==0){
return -1;
}
int low=0;
int high=... | ALGO | 0.999419 | 5.459988 | {
"github_metadata": {
"branch": "main",
"commit_count": 651,
"repo_created_at": "2024-03-12T07:33: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": "04058754e3... |
da1316db-f873-434c-a739-fbae02dbed4d | nariaki3551/cmapdeepbkz | src/DeepBKZ/lattice/samplingboostcore.cpp | //This file defines core subroutines of sampling_tools
//for even and odd dimensions
//SFLOAT: type for sampling
//DFLOAT: type of input data
//Approximating the ratio between cylinder intersections by random point sampling
#ifdef define_even
template <typename SFLOAT,typename DFLOAT> DFLOAT ApproxRatio_even(st... | ALGO | 0.997649 | 4.259312 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2022-10-14T11:38:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "c77b4c6fd6c... |
4b3b9847-6332-448a-b858-ef9f1acf6a48 | JohannesMDr/AtCoder_mysolutions | ABC186/B.cpp | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int> >;
typedef long long ll;
#define REP(i, n) for(ll i = 0; i < ll(n); i++)
#define REPD(i, n) for(ll i = n-1; i >= 0; i--)
#define FOR(i, a, b) for(ll i = a; i < ll(b); i++)
#define FORD(i, a, b) for(ll i = a; i > ll(b); i--)
#define ALL(v) v.... | ALGO | 0.999887 | 4.07341 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-09-10T07:59: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": "eda4506f4... |
b70c3794-73ef-4c4c-a66d-adf1c53e657e | ishandutta2007/codeforces-m | matrixcascade_qwq/normal/1554/C.cpp | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define int long long
#define YES puts("YES")
#define NO puts("NO")
#define Yes puts("Yes")
#define No puts("No")
#define edl puts("")
#define mc cerr<<"qwq\n"
#define rd(x) x=read()
#define op(x) printf("%lld",x)
#define ops(x) printf("%lld "... | ALGO | 0.999963 | 4.069926 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03: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": "a6efd2a105da... |
1df1cfb8-a587-4947-b238-ef1296242627 | StafShah/portfolio | Academic Work/Object Features/MP7/board.h | #include <iostream>
#include <vector>
#include <string>
using namespace std;
class Board {
private:
vector<vector<char>> board;
public:
Board();
vector<vector<char>> getBoard();
void displayBoard();
bool insert(const char& piece);
bool checkWin();
bool checkDraw();
bool checkHorizonta... | ALGO | 0.990917 | 5.733227 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2022-08-09T23:50:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d4b8c6f60d... |
ab79bf0c-3925-47c7-a09f-c1beaafe6985 | Sixzeroo/LeetCode | C++/173.cpp | /**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class BSTIterator {
stack<TreeNode*> bst;
public:
BSTIterator(TreeNode *root) {
if(root != nullptr)
bst.push... | ALGO | 0.999993 | 5.624144 | {
"github_metadata": {
"branch": "master",
"commit_count": 133,
"repo_created_at": "2018-01-26T13:56: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": "bfdf84e0... |
c160e974-16c9-4438-97ef-e2a065754d57 | asb-514/Programming-questions | removal-game.cpp | #if ONPC
#define _GLIBCXX_DEBUG
// #include "bits/stdc++.h"
#else
#include <bits/stdc++.h>
#endif
#define sz(a) ((int)((a).size()))
#define char unsigned char
#define pi 3.141592653589793238
using namespace std;
// mt19937 rnd(239);
// mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
typedef long... | ALGO | 0.999883 | 3.97913 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-08-27T02:58: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": "3dba97c3156... |
72d2c150-3008-49b1-a5fa-5c9c52cceaba | xeruvimov/algo_labs | LabNine.cpp | #pragma clang diagnostic push
#pragma ide diagnostic ignored "modernize-use-nullptr"
#include "lists/BinaryTree.cpp"
#define DEFAULT_SIZE 15
using namespace std;
int data[DEFAULT_SIZE];
BinaryTree *tree;
void initTestData() {
for (int &i : data) {
i = rand() % 100;
}
}
void initTree() {
tree = ... | TEST | 0.998216 | 5.675464 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2019-03-03T20:24: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": "ddbcaf417... |
9750f34b-804a-4b4c-915b-2404d60f1fb4 | SSBASLD/SciOly-Robot-Tour | ELEGOO Smart Robot Car Kit V4.0 2023.02.01/03 Tutorial & Code/02 SmartRobotCarV4.0_Move/TB6612 & MPU6050/Demo4/Demo4.ino | #include <avr/wdt.h>
#include "DeviceDriverSet_xxx0.h"
#include "ApplicationFunctionSet_xxx0.cpp"
#include "test.cpp"
String grid[9] = {
".-.-.-.-.",
"| B | |X|",
".-.B.-.B.",
"| | B B |",
".B.-.-.B.",
"| B | | |",
".-.-.-.-.",
"| | | | |",
".S.-.-.-."};
DeviceDriverSet_Motor AppMotor;
Application_xxx Application_Con... | ALGO | 0.997926 | 3.266524 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-01-03T20:18: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": "9573cec5df7a... |
68748888-b46d-4580-81ca-3fcc7d326e60 | c4fiber/Algorithm_Study | baekjoon/제6회 천하제일 코딩대회 예선/a.cpp | #include <iostream>
#define fastio cin.tie(0)->sync_with_stdio(0)
using namespace std;
int seperateRank(int height, int weight) {
float bmi = (float)weight / (height * height) * 10000;
if (height <= 140) {
return 6;
}else if (height < 146) {
return 5;
}else if (height < 159) {
... | ALGO | 0.999714 | 3.581446 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2020-09-02T00:27:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b067b548b... |
e1ad9f73-bf79-4283-8b7a-a7c24105b3d9 | arangodb/arangodb | 3rdParty/boost/1.78.0/boost/hana/fwd/partition.hpp | /*!
@file
Forward declares `boost::hana::partition`.
@copyright <NAME> 2013-2017
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_HANA_FWD_PARTITION_HPP
#define BOOST_HANA_FWD_PARTITION_HPP
#include <boost/hana... | ALGO | 0.999055 | 7.461421 | {
"github_metadata": {
"branch": "devel",
"commit_count": 51986,
"repo_created_at": "2011-10-26T06:42:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13878,
"forks": 857,
"issues": 743,
"pull_requests": 38
},
"file_meta": {
"content_id": ... |
a97c852b-8701-422b-b9e2-36c53637ca7f | Infin8Gamer1/Beta-Engine | Beta Engine/HighLevelAPI/src/Intersection2D.cpp | //------------------------------------------------------------------------------
//
// File Name: Intersection2D.cpp
// Author(s): <NAME>
// Project: BetaEngine
// Course: CS230
//
// Copyright © 2018 DigiPen (USA) Corporation.
//
//------------------------------------------------------------------------------
#incl... | ALGO | 0.990658 | 5.405116 | {
"github_metadata": {
"branch": "master",
"commit_count": 101,
"repo_created_at": "2019-03-11T20:59:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b57b5653... |
5b9e2d3a-f9c7-492f-a4fa-e773197b75e5 | Nguyenbaha/CP-Algorithms | contest/div 3/661 div 3/B.cpp | // <NAME>
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp(x,y) make_pair(x,y)
#define fore(i,a,b) for (ll i=a,ThxDem=b;i<ThxDem;i++)
#define ford(i,a,b) for (ll i=a-1,ThxDem=b;i>=ThxDem;i--)
#define pb push_back
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.... | ALGO | 0.999884 | 3.151498 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-11-09T02:49:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cdbfc7cdbe8f... |
8c9a7d4f-c019-41d6-9dae-0dfb04266b3f | rahul-p-007/Data-Structure-Program | Searching and Sorting/Aggressive_Cows.cpp | //Aggressive Cows
#include<iostream>
using namespace std;
//Function for checking the cows
bool isPossiblePosition(int arr[],int size,int cow,int mid){
int cowCount = 1;
int Lastposition =arr[0] ;
for(int i = 0; i< size; i++)
{
if(arr[i] - Lastposition >= mid){
cowCount++;
i... | ALGO | 0.999982 | 4.791342 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-10-26T04:41: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": "e953dfb49b67... |
cd4c5a79-e783-4c26-97ab-ec99145c213a | CGAL/cgal | Arrangement_on_surface_2/include/CGAL/Arr_walk_along_line_point_location.h | // Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : <NAME> <<EMAIL>>
// (based on old vers... | ALGO | 0.997653 | 6.720197 | {
"github_metadata": {
"branch": "master",
"commit_count": 113659,
"repo_created_at": "2014-10-01T12:22:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5443,
"forks": 1475,
"issues": 511,
"pull_requests": 136
},
"file_meta": {
"content_id... |
cc73b9c8-9369-43f8-a7bd-7d83bf814088 | KurodaKanbei/ACM | Template of other teams/NewMeta/2 Graph/checker/matching/zoj3316/code.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 7;
// 0 base, O(V^3)
vector<int> adj[N], q;
int n, mat[N], pred[N], base[N], type[N];
int lca(int u, int v){
static int visit[N], tick = 0; ++tick;
for (int i = 0; i < 2; i++, swap(u, v)) {
for (u = base[u]; ~mat[u]; u = base[pred[mat[u]]]) {
if... | ALGO | 0.999982 | 4.024809 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2017-04-06T12:53:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "06944ae1c... |
4472ace7-4f67-4935-aaa9-d1838de8f7bf | FruKun/cpp-2022-2023- | 10_9.cpp | // Написать программу с классом для реализации выражения вида сумма a[i]*exp(-i*x)
// Путем перегрузки операторов предусмотреть возможность сложения,
// вычитания таких выражений,
// а также умножения и деления на число.Результат – объект того же класса, что и исходный.
#include <cmath>
#include <iostream>
using namesp... | ALGO | 0.96581 | 4.65167 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-10-23T08:53: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": "0b9793c1d597... |
b530e4e6-3b49-4656-82c5-0af40a775529 | vickie02736/molsim2024 | Exercises2024/Chapter08-PMD/plumed/plumed-2.3.0/src/multicolvar/DistanceFromContour.cpp | /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Copyright (c) 2016 The plumed team
(see the PEOPLE file at the root of the distribution for a list of names)
See http://www.plumed.org for more information.
This file is part of plumed, version 2.
plumed is free software: you... | ALGO | 0.977984 | 4.995933 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-12-22T21:39: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": "89d4e647984... |
bc5924a6-3562-4751-b297-0d71ad0a220c | devjiwon/baekjoon | 1018.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
char s[51][51];
vector<int> v;
int calChess(int x, int y){
int count = 0;
for(int i=y;i<y+8;i++){
for(int j=x;j<x+8;j++){
if((i+1) % 2 != 0 && (j+1) % 2 != 0){ //홀수
if(s[i][j] == 'B'){
... | ALGO | 0.999868 | 3.981926 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2020-09-27T09:25: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": "28eb126cd... |
5ed71839-3255-491c-86fc-d51c5e61cf43 | LaboratorioGluon/Velocista-Marrajo | Source/Velocista/src/controllers/morroController.cpp | #include "controllers/morroController.h"
// @TODO: delete me
#include "comms/udp_serial.h"
extern UdpSerial uSerial;
morroController::morroController(sensorArray &pSensors) : sensors(pSensors)
{
aCurrentSensors[0] = 7;
aCurrentSensors[1] = 8;
isCalibrationCompleted = 0;
for (uint8_t i = 0; i < ARRAY... | TOOL | 0.931462 | 4.708296 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-03-15T08:08:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a356a4cbaed... |
75e1d716-0085-4379-8167-1509dede19ca | nbulsi/also | src/core/misc.cpp | #include <algorithm>
#include <percy/percy.hpp>
#include <string>
#include <sstream>
#include "misc.hpp"
using namespace percy;
using namespace mockturtle;
namespace also
{
std::vector<std::string> split_by_delim(const std::string &s, char delim)
{
std::vector<std::string> elems;
split_by_delim(s, delim... | ALGO | 0.985509 | 5.664965 | {
"github_metadata": {
"branch": "main",
"commit_count": 508,
"repo_created_at": "2019-02-21T09:10:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 77,
"forks": 35,
"issues": 1,
"pull_requests": 3
},
"file_meta": {
"content_id": "d91040b0... |
ca041a71-b6c4-4b70-8c5e-73d71304820e | ry3s/aoj | ITP2/Dynamic_Arrays_and_List/vector2.cpp | #include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <list>
#include <iterator>
#define rep(i, n) for(long long i = 0; i < (long long)(n); i++)
using namespace std;
typedef long long int LL;
typedef unsi... | ALGO | 0.999797 | 3.733938 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2018-12-21T16:31: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": "237cafff8... |
c9b12d6e-fba8-4182-96f0-b311e7271b05 | pcc-cs/cs-003a-winter-2021-exercises | 01-27-2021/fib2.cpp | /**
* Recursion examples.
*
* Copyright (c) 2021, <NAME>.
*/
#include <cstdio>
#include <cstdlib>
#include <cstdint>
// uint64_t rounds after MAX
#define MAX 92
// Using memoization, with O(n) time complexity, O(n) space complexity
// Keyword "auto" automatically deduces the type, still statically typed
namespace... | ALGO | 0.999624 | 5.781652 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2021-01-09T02:43:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6471a8fe86... |
4a63e1ef-8291-44cb-8a4a-aa4b66225751 | LiSAT-Planning/LiSAT | src/search/states/sparse_states.h | #ifndef SEARCH_SPARSE_STATES_H
#define SEARCH_SPARSE_STATES_H
#include <algorithm>
#include <cstdint>
#include <iostream>
#include <vector>
#include <unordered_map>
#include <boost/functional/hash/hash.hpp>
/**
* @brief The packed state representation is a more concise representation of states,
* based on the Fast... | ALGO | 0.983817 | 6.829774 | {
"github_metadata": {
"branch": "main",
"commit_count": 680,
"repo_created_at": "2022-10-24T14:50:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5bded1b55... |
708b4153-98f5-4c37-98fe-bcaaadabb367 | FranciscoKaleb/Cplusplus | [6]_StandardTemplateLibrary[linux]/09_SequenceContainer/main.cpp | #include <iostream>
#include <array>
#include <numeric>
#include <algorithm>
void test_1();
void test_2();
void test_3();
void test_4();
void test_5();
void test_6();
void test_7();
void test_8();
void test_9();
int main()
{
// Fixed size
// Direct element access .at()
// provides access to underlying raw ... | TOOL | 0.908343 | 5.630687 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2022-12-23T10:50: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": "1a221d14c7f... |
f0de2148-20ef-4ee8-b10d-fd588859b1a8 | mylxiaoyi/uniclop | src/algorithms/model_estimation/estimators/Ensemble.hpp |
#if !defined(ENSEMBLE_HEADER)
#define ENSEMBLE_HEADER
#include "../IParametricModel.hpp"
#include "../IModelEstimator.hpp"
#include <boost/random.hpp>
#include <boost/program_options.hpp>
namespace cimg_library {
class CImgDisplay;
}
namespace uniclop
{
namespace args = ::boost::program_options;
class Scored... | ALGO | 0.984663 | 6.962766 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2015-09-30T02:09:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a85423412... |
9e2ea3a6-5110-4e1f-aa81-b87993d22cc5 | dkangtext/Data-Structures-and-Algorithms | practice/LT-BT-LinkedList.cpp | #include <iostream>
using namespace std;
struct Node
{
int info;
Node *next;
};
struct List
{
Node *pHead;
Node *pTail;
};
// Khởi tạo một Node mới
Node *getNode(int x)
{
Node *p = new Node;
p->info = x;
p->next = NULL;
return p;
}
// Khởi tạo danh sách
void Init(List &L)
{
L.pH... | ALGO | 0.999861 | 3.859609 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-10-15T19:49: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": "00b8eecf543... |
81589c34-2960-4752-898a-f458e6a4ef83 | bonetblai/mdp-engine | superseded/ctp/parsing.h | #include <iostream>
#include <vector>
#include <queue>
namespace CTP {
struct open_list_cmp {
bool operator()(const std::pair<int, int> &p1, const std::pair<int, int> &p2) {
return p1.second > p2.second;
}
};
struct graph_t {
int num_nodes_;
int num_edges_;
bool with_shortcut_;
int sh... | ALGO | 0.99908 | 4.137609 | {
"github_metadata": {
"branch": "master",
"commit_count": 367,
"repo_created_at": "2015-08-20T09:26:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9497ef55... |
1db28514-211b-4c30-b651-83201afb7a9b | GenguoWang/codechef | CDWR2013/GPRIME.cpp | #include <cstdlib>
#include <iostream>
using namespace std;
#define N 10000000
int main(int argc, const char *argv[])
{
int *phi;
char *prime;
prime = (int*)malloc((N + 1) * sizeof(char));
prime[0] = prime[1] = 0;
for(int i = 2; i <= N; i++)
prime[i] = 1;
for(unsigned long long i =... | ALGO | 0.999897 | 3.732312 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2013-09-27T13:31: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": "88713c3626... |
e6feeb18-e44c-43e8-81b7-523ef73ab8f2 | Priyo002/DSA | Contests/Codechef/Starters-116/q2.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb emplace_back
#define setbits(x) __builtin_popcountll(x)
#define zerobits(x) __builtin_ctzll(x)
#define endl '\n'
#define sort(X) sort(X.begin(),X.end())
const int mod = 1e9 + 7;
const long long INF = 1e18;
void init() {
ios::sync_with_stdi... | ALGO | 0.999931 | 4.673291 | {
"github_metadata": {
"branch": "master",
"commit_count": 238,
"repo_created_at": "2023-06-21T09:23:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7644bd84... |
f174b06b-e011-4a50-9aea-7f9537b2ebb5 | alexandraback/datacollection | solutions_5658282861527040_1/C++/NicYun/c++.cpp | #include <string>
#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <map>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;
const int N = 35;
long lon... | ALGO | 0.999903 | 4.49799 | {
"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": "7c338a085... |
585fc6aa-2c5d-427f-b956-c966080cb554 | gmaher/stanford-cme213.github.io | Homework/starter-code/main_q1.cpp | #include "matrix.hpp"
#include <assert.h>
int main(){
unsigned N=5;
MatrixSymmetric<unsigned> A(N);
for (unsigned j = 0; j < N; j++){
for (unsigned i = 0; i < N; i++){
if (i > j){break;}
A(i,j) = i+j;
}
}
std::cout << A;
std::cout << "non zeros: " << A.l0_norm() << "\n";
std::... | TEST | 0.913666 | 4.63334 | {
"github_metadata": {
"branch": "master",
"commit_count": 410,
"repo_created_at": "2019-04-02T23:54:42.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "caseyfleeter/stanford-cme213.github.io",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_m... |
d98aae94-8dbe-485b-8c70-ecd5a7638155 | satvik007/uva | More Advanced Topics/More Advanced DP Techniques/DP level 2/The Bridges of Kolsberg.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll dp[1003][1003];
int val[1003][2];
int num[1003][1003];
string bank[1003][2];
int N, M;
void testAndSet(int i, int j, ll cur, int n) {
if(dp[i][j] < cur) {
dp[i][j] = cur;
num[i][j] = n;
} else if(dp[i][j] == cur) {
... | ALGO | 0.999966 | 4.045848 | {
"github_metadata": {
"branch": "master",
"commit_count": 275,
"repo_created_at": "2017-08-12T06:07:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1dbaa2e... |
405ba97d-bf9f-4ddb-bab0-2e7417e93595 | iamvickynguyen/Kattis-Solutions | cats.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef priority_queue<int, vector<int>, greater<int>> minpq;
typedef unordered_set<int> usi;
typedef unordered_map<int, vi> ivi;
typedef unord... | ALGO | 0.999916 | 4.35223 | {
"github_metadata": {
"branch": "master",
"commit_count": 432,
"repo_created_at": "2019-11-12T01:25:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0052bfc6... |
390b2d72-521f-422b-8352-297d27fbeb0a | dvdRiscado/Programming | C++/Engenharia de Software/DuasVariaveis(sub-rotina).cpp | #include "iostream"
#include "cstdlib"
#include "Math.h"
#include "String"
using namespace std;
/*
Ler dois inteiros (variáveis A e B) e imprimir o resultado do quadrado da diferença do primeiro valor pelo
segundo.
*/
int insValor(string letra);
void calcDiferenca(int numA, int numB);
int main() {
system("cls... | ALGO | 0.994015 | 4.501281 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2024-12-12T12: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": "0f50ad356b2... |
6b65ea75-6ebc-43e9-88ef-541d580ac054 | vcfrasineanu/Algorithms-and-Data-Structures | SortingAndSearching/heap_sort.cpp | /**
* Task: Heap sort
* (maintain a max-heap using array representation)
* - Children of index i are 2i+1 and 2i+2
*/
// -----------------------------------------------------------------------------
#include <iostream>
using namespace std;
// -----------------------------------------------------------------... | ALGO | 0.999669 | 5.049545 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2016-03-10T11:21: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": "e26ce3ea8... |
791c9bd6-3694-4af9-99c3-9a3fe1f25a95 | werner-yin/code-public-2 | Luogu/P1742.cpp | #include <bits/stdc++.h>
#define eb emplace_back
#define ep emplace
#define fi first
#define se second
#define in read<int>()
#define lin read<ll>()
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)
using namespace std;
using ll = long long;
using db = double;
... | ALGO | 0.999827 | 4.030894 | {
"github_metadata": {
"branch": "master",
"commit_count": 446,
"repo_created_at": "2023-06-23T00:46: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": "7e579257... |
6415c472-1e50-4250-bb3c-dff17408793c | joey486/intro-to-computer-science-150005 | Homework 7/H7proj2.cpp | #include<iostream>
using namespace std;
int input(int arr[10])
{
bool flag1;
bool flag2;
bool flag3;
bool flag4;
do
{
flag1 = false;
flag2 = false;
flag3 = false;
flag4 = false;
do
{
flag1 = false;
flag2 = false;
for (int i = 0; i < 10 && flag1==false && flag2==false; i++)
{
cin >... | ALGO | 0.999148 | 3.654172 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-08T12:32: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": "c374e5fe17ab... |
9e96446c-c76c-4826-a613-e3be59aa6a5f | Snehal3704/CPP-DSA | binary_search/capacity_to_ship_packages_in_dDays.cpp | #include<bits/stdc++.h>
using namespace std;
int daysRequired(vector<int>arr,int cap){
int days = 1; //First day.
int load = 0;
int n = arr.size(); //size of array.
for (int i = 0; i < n; i++) {
if (load + arr[i] > cap) {
days += 1; //move to next day
load = arr[i]; //... | ALGO | 0.999983 | 4.067555 | {
"github_metadata": {
"branch": "main",
"commit_count": 215,
"repo_created_at": "2024-04-10T15:38:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "91da86c665... |
835465df-cde1-4a0b-ad34-e2a1556e0eb7 | golu-aryan/Cpp-with-DSA | Array/addrowcol.c++ |
#include <iostream>
using namespace std;
class Addition
{
private:
int arr[3][3];
public:
void input()
{
cout << "Enter 3*3 matrix elements : " << endl;
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
cin >> arr[i][j];
... | ALGO | 0.978109 | 4.999963 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2024-03-16T14:48: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": "a16415739c9... |
d4492c33-fbd9-48af-81bc-ff5ed63035d8 | tuling56/opencv_study | Feature/connectedomain/fixDomain.cpp | /************************************************************************
* Copyright(c) 2015 tuling56
*
* File: fixDomain.cpp
* Brief: 连通域内部修补,不牵涉到边界的断裂
* Source:http://www.cnblogs.com/tornadomeet/archive/2012/12/11/2813534.html
* Status:
* Date: [3/17/2015 jmy]
*******************************************************... | ALGO | 0.979267 | 3.92479 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2014-11-30T09:24:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "974e3873d... |
fdee4be4-4e07-4a36-aedf-dd41fab176d1 | ashish-3916/competitive-programming | CP/GRAPH PRACTICE/SCC - kosaraju algo [E002].cpp | //https://www.codechef.com/problems/CHEFRRUN
const int N = 1e5 + 1 ;
vector<ll> graph[N];
vector<ll> transpose[N];
vector<ll>visited(N);
vector<ll>skips(N);
vector<ll>scc;
vector<ll>out_time;
ll n , x;
void dfs(ll sv)
{
visited[sv] = 1;
for (ll child : graph[sv])
if (!visited[child])
dfs(child);
out_time.p... | ALGO | 0.999606 | 4.164786 | {
"github_metadata": {
"branch": "main",
"commit_count": 283,
"repo_created_at": "2021-02-01T12:35:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f26305258a... |
c249f091-e61c-4f0c-897a-40b4880a0bd4 | liuchuming/C-advance | 08分配病房/08分配病房.cpp | //编程题#1:分配病房
//来源 : POJ(Coursera声明:在POJ上完成的习题将不会计入Coursera的最后成绩。)
//
// 注意: 总时间限制 : 1000ms 内存限制 : 65536kB
//
// 描述
// 某个科室的病房分为重症和普通,只有当病人的疾病严重程度超过了入住重症病房的最低严重值,才可以安排入住重症病房。
//
// 现在要求设计一个程序,给病人安排好病房。疾病的严重程度用0到10来表示,0表示小毛病,10表示非常严重。
//
// 输入
// 第一行输入病人的个数m(m < 50),以及安排住入重症病房的最低严重值a
//
// 紧接着m行,每行表示病人编号(三个位,用0补齐)及其疾病的严重... | ALGO | 0.999889 | 3.610558 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-09-19T12:07: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": "df468e6e96... |
b3fc8aab-c317-47ba-b9bb-95addcd5ac8b | lacram/study | Baekjoon/save/11266.cpp | #include <iostream>
#include <vector>
#include <cstring>
#include <fstream>
#include <algorithm>
#include <cmath>
#define endl '\n'
using namespace std;
int n,m;
int cnt;
int discoverd[10001];
bool isCutVertex[10001];
vector<vector<int>> tree;
int dfs(int now, bool isRoot) {
discoverd[now] = ++cnt;
int ret = di... | ALGO | 0.999936 | 3.828216 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2022-07-03T15:46: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": "9edba56b4... |
4b931eaf-028a-4f8d-9498-3df81663e15c | ishandutta2007/codeforces-j | joyfun/normal/634/E.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
const int N = 200005;
int n, k, a[N];
vector<int> g[N];
int dp[N], tp[N];
int Mid;
int use[N];
bool vis[N];
void dfs(int u, int p) {
vis[u] = true;
tp[u] = 0;
dp[u] = 0;
if (a[u] < Mid) {
tp[u] = ... | ALGO | 0.999918 | 3.889292 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:42: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": "be1519b3d73d... |
869deca2-5793-48d1-92ab-35e1433db241 | benmyb/OFEC_v0.4.2 | src/imp/Problem/FunctionOpt/FIBA.cpp | /*************************************************************************
* Project:Open Frameworks for Evolutionary Computation (OFEC)
*************************************************************************
* Author: <NAME>
* Email: <EMAIL>
* Language: C++
**********************************************************... | ALGO | 0.999689 | 5.233708 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-08-08T01:01:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7fa853b237... |
9657b5a8-218b-49a4-a182-2bc2efa5e2a4 | ren082215/LeetCode | src/cpp/0546-removeBoxes.cpp | class Solution {
public:
int removeBoxes(vector<int>& boxes) {
int n = boxes.size();
int dp[100][100][100] = {0};
return helper(boxes, 0, n - 1, 0, dp);
}
int helper(vector<int>& boxes, int i, int j, int k, int dp[100][100][100]) {
if (j < i) return 0;
if (dp[i][j][k]... | ALGO | 0.999955 | 5.485798 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2018-11-28T23:47:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d903ed7d6... |
ccc46c49-5faa-45e1-baed-6383ac451729 | Jontte/DMCR | backend/src/aabb.h | /*
* This file is a part of the DMCR project and is subject to the terms and
* conditions defined in file 'LICENSE.txt', which is a part of this source
* code package.
*/
#ifndef DMCR_AABB_H
#define DMCR_AABB_H
#include "ray.h"
#include "sceneobject.h"
#include "vector.h"
namespace dmcr {
/*!
* \brief Axis ali... | TOOL | 0.958987 | 7.362435 | {
"github_metadata": {
"branch": "master",
"commit_count": 332,
"repo_created_at": "2012-01-27T09:15:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "6de1d2d6... |
b1c4a7d8-45eb-4009-a818-54fd00766236 | kartikkukreja/blog-codes | src/Weighted Interval Scheduling Problem.cpp | #include <cstdio>
#include <algorithm>
#include <stack>
using namespace std;
class WeightedInterval {
public:
int start, finish, weight;
bool operator < (const WeightedInterval& x) const {
if (finish != x.finish)
return finish < x.finish;
return start < x.start;
}
} *interval... | ALGO | 0.999958 | 3.9095 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2014-07-14T18:27:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 177,
"forks": 117,
"issues": 3,
"pull_requests": 1
},
"file_meta": {
"content_id": "2ed0a... |
6d7246d0-ef66-419a-8320-9d369fa3550b | LordOfDragons/dragengine | src/modules/audio/openal/src/world/octree/deoalRTWorldBVH.cpp | /*
* MIT License
*
* Copyright (C) 2024, DragonDreams GmbH (<EMAIL>)
*
* 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
* t... | ALGO | 0.975355 | 5.43767 | {
"github_metadata": {
"branch": "master",
"commit_count": 4112,
"repo_created_at": "2020-04-19T17:01:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 79,
"forks": 8,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "d79a9c... |
2bdf6c5c-1e25-4035-a599-a9cf667d026a | ibab/lhcb-software | Phys/Phys/JetAccessories/src/UpdateJetsWithVtx.cpp | // ============================================================================
// from Gaudi
// ============================================================================
#include "GaudiAlg/GaudiAlgorithm.h"
#include "LoKi/ParticleCuts.h"
#include "LoKi/VertexCuts.h"
#include "LoKi/CoreCuts.h"
#include "Event/Parti... | ALGO | 0.957702 | 6.186882 | {
"github_metadata": {
"branch": "master",
"commit_count": 91578,
"repo_created_at": "2015-12-10T14:42:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5882a... |
ac406309-a450-4c87-b40d-600218fafd5e | krishnakpt18/numericalmethods | simpson/compsimpson.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
#include <fstream>
#include <math.h>
#include <string>
using namespace std;
double simp(double[],double,int);
double fun(double);
int main (int argc, char *argv[])
{
ofstream fout;
fout.open("simpson-out.txt");
const int npts=5;
int n[npts] = {100,200,25... | ALGO | 0.981962 | 4.383057 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-09-06T16:26: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": "1ccdf67cc1b... |
9e806bb0-861b-4a5d-bfd4-c75421429d5e | openbigdatagroup/plda | lda.cc | // Copyright 2008 Google Inc.
//
// 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 agreed to in... | DATA | 0.973077 | 7.13901 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2016-01-31T07:41:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 85,
"forks": 30,
"issues": 12,
"pull_requests": 1
},
"file_meta": {
"content_id": "9fbf693... |
db0dc23e-882e-483a-853d-a6fafe0acf84 | Sudhanshu-273/LeetCode | 229-majority-element-ii/majority-element-ii.cpp | class Solution {
public:
vector<int> majorityElement(vector<int>& nums) {
int n = nums.size();
int c1 = 0, v1 = INT_MIN, c2 = 0, v2 = INT_MIN;
for(int i = 0; i < nums.size(); ++i) {
if(v1 == nums[i]) {
c1++;
} else if(v2 == nums[i]) {
c... | ALGO | 0.999993 | 5.737016 | {
"github_metadata": {
"branch": "main",
"commit_count": 214,
"repo_created_at": "2024-01-25T18:01: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": "cc415b0507... |
4d4e0123-3bb8-441d-8fb6-96c31e3f5a8a | helmesjo/convertible | libconvertible/convertible/operators.hxx | #pragma once
#include <convertible/concepts.hxx>
#include <convertible/converters.hxx>
#include <algorithm>
#include <iterator>
#include <tuple>
#define FWD(...) ::std::forward<decltype(__VA_ARGS__)>(__VA_ARGS__)
namespace convertible::operators
{
namespace details
{
template<typename to_t, typename convert... | TOOL | 0.914444 | 7.782872 | {
"github_metadata": {
"branch": "main",
"commit_count": 400,
"repo_created_at": "2021-05-29T14:04: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": "ef1d70a294... |
09cf87bd-dce8-48fa-bb01-ec119aaf8d55 | zhijuyingfeng/RSA | bigint.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include "bigint.h"
#include "mpn.h"
BigInteger::BigInteger()
{
this->ival=0;
this->words=NULL;
}
BigInteger::BigInteger(const int&val)
{
this->ival=val;
this->words=NULL;
}
BigInteger::BigInteger(const char* val)
{
if(!val)
{
*t... | ALGO | 0.992642 | 4.0853 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2019-11-06T13:11:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "deec38d3a... |
46a96d67-a0c4-4236-aefc-d7e5ceeaba28 | franklingutierrez/Recursividad_Multiplo_N1 | problema1.cpp | /*Mostrar los múltiplos de 2 y 5 entre 0 y 100
Autor --> <NAME>*/
#include<iostream>
#include<conio.h>
using namespace std;
//---- FUNCION MULTIPLO DE 2 ---------
int multiplo2(int numero){
if(numero<=100){
if(numero>=0){
if(numero%2==0){
cout<<numero<<" ";
}
... | TOOL | 0.968138 | 3.662701 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-04-15T16:49:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e362f736e3... |
81aa4ff9-58ab-4373-b646-ce591448e826 | vivekup3424/Coding_Problems | leetcode/cpp/974.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
class Solution
{
public:
int subarraysDivByK(vector<int> &nums, int k)
{
int n = nums.size();
map<int, int> mp;
vector<int> pref(n);
// construct the prefix sum
for (int i = 0; i < n; i++)
{
... | ALGO | 0.999877 | 5.406415 | {
"github_metadata": {
"branch": "main",
"commit_count": 810,
"repo_created_at": "2023-08-15T09:48:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9380efe8ae... |
18d9c560-51b0-446c-a036-e8ded0e1fe98 | dillonhuff/qecode | autogen/line_opt_rectangle.cpp | #include <ralg/root_counting.h>
using namespace std;
using namespace ralg;
#define EPSILON 1.0e-4
bool within_eps(const double a, const double b, const double eps) {
return fabs(a - b) < eps;
}
std::vector<rational> test_points_from_roots(const std::vector<rational>& roots) {
if (roots.size() == 0) { return {};
}... | ALGO | 0.999548 | 4.954266 | {
"github_metadata": {
"branch": "master",
"commit_count": 160,
"repo_created_at": "2017-05-16T21:11: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": "dcd02d31... |
7781735f-7426-4fe8-95cf-8a86b80126b0 | mzuenni/icpc-problems | lookingforwaldo/submissions/accepted/gregors.cpp | #include <iostream>
#include <vector>
#include <set>
using namespace std;
int main()
{
int h,w; cin >> h >> w;
vector<vector<int>> field(min(h,w)+1, vector<int>(max(h,w),-1));
for (int i = 0; i < h; ++i)
{
for (int j = 0; j < w; ++j)
{
int a = i; int b = j;
if (h > w) swap(a,b);
char c; cin >> c;
i... | ALGO | 0.999904 | 3.644526 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-06-27T14:50: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": "d1775a63246... |
cd26538f-ed7b-47d3-8036-d2eca984d62d | whencanibe/BaekJoon_Algorithm | 11XXX/11722.cpp | #include <iostream>
#include <algorithm>
int main(int argc, char const *argv[])
{
int N;
std::cin >> N;
int* A = new int[N];
int* dp = new int[N];
for (int i = 0 ; i < N; i++){
std::cin >> A[i];
dp[i] = 1;
}
for (int i = 1 ; i < N ; i++){
for (int j = 0 ; j < i ; j... | ALGO | 0.99997 | 4.724276 | {
"github_metadata": {
"branch": "main",
"commit_count": 90,
"repo_created_at": "2024-12-24T15:44: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": "75eb834057e... |
be309966-c29c-4839-b548-d9c3ddc7fa10 | ThiagoVicentini/competitive_programming | SCC0210 - Laboratório de Algoritmos Avançados I/Semana6_Divisao_e_Conquista/semana6_ex1.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int vet[1000];
int n, k;
bool funcao(int mid){
int ac = 0;
int k_aux = k;
for (int i = 0; i <= n; ++i){
ac += vet[i];
if (ac > mid){
k_aux--;
if (k_aux < 0 || vet[i] > mid)
return false;
ac = vet[i];
}
}
return true... | ALGO | 0.999978 | 3.972714 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2020-11-07T02:35: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": "da62e0f7ecc... |
712be790-7f5f-4bde-8422-e373b3048355 | oreillymedia/Learning-OpenCV-3_examples | example_14-04.cpp | // Example 14-4. Using the shape context distance extractor
#include <algorithm>
#include <iostream>
#include <string>
#include "opencv2/opencv.hpp"
using namespace std;
using namespace cv;
static vector<Point> sampleContour( const Mat& image, int n=300 ) {
vector<vector<Point> > _contours;
vector<Point> all_p... | ALGO | 0.990976 | 6.361732 | {
"github_metadata": {
"branch": "master",
"commit_count": 228,
"repo_created_at": "2016-12-06T14:06:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2279,
"forks": 904,
"issues": 15,
"pull_requests": 3
},
"file_meta": {
"content_id": "4a5... |
1f83afae-5b76-441a-a4b1-ada9a71c6f69 | Xilinx/xfopencv | include/imgproc/xf_edge_tracing.hpp | /***************************************************************************
Copyright (c) 2019, Xilinx, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must reta... | ALGO | 0.996949 | 5.15837 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2017-06-06T16:37:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 336,
"forks": 142,
"issues": 28,
"pull_requests": 1
},
"file_meta": {
"content_id": "1b4d3... |
6f1d0a54-9430-4447-80c5-b341b8396308 | shibe2/tigervncviewer | common/core/string.cxx | /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
* Copyright 2011-2023 <NAME> for Cendio AB
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (a... | TOOL | 0.923881 | 6.713993 | {
"github_metadata": {
"branch": "viewer1",
"commit_count": 1,
"repo_created_at": "2025-04-06T16:17: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": "bb1ebe17a... |
865d9300-c54d-4b3d-975c-fed8c0b8c037 | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1245/all/29580747_64012025.cpp | #include <iostream>
#include <cstring>
#include <cstdio>
#include <queue>
#include <stack>
#include <string>
using namespace std;
string op;
char m[500];
int main(){
int t, i, a, b, c, n, len, ans, tmp;
int t1, t2, t3;
scanf("%d", &t);
while(t--){
scanf("%d", &n);
ans = 0;
scanf("%d%d%d", &a, &b, &c);
c... | ALGO | 0.999678 | 3.424672 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-11-22T14:40: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": "d59040bf7... |
71ff11a4-04cb-4cc9-9f9d-a8ff9a26ca6d | devartstar/Algorithms | codeForces_RatingWise/codeForces1600/#622_D2_C1.cpp | /*
-------------------------------------
| |
| Author - <NAME> |
| Date - 2021-10-19 10:44:36 |
| |
-------------------------------------
Link - https://codeforces.com/problemset/problem/1313/C1
*/
#include <bits/stdc++.h>
using namespace std;
... | ALGO | 0.999994 | 4.610111 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2021-05-02T08:47:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58d316bef... |
04a60454-c3e7-4aee-b22c-a6f3eaaffc81 | jjsv20/info-ii | Lab_04/main.cpp | #include <iostream>
#include <map>
#include <vector>
#include <string>
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <iomanip>
#include <set>
#include <climits>
#include <ctime>
using namespace std;
class Ruta{
public:
string destino;
int costo;
Ruta(string destino, int costo) : destino... | ALGO | 0.911432 | 4.152768 | {
"github_metadata": {
"branch": "main",
"commit_count": 71,
"repo_created_at": "2025-03-26T13:37: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": "c577dcfd067... |
29efa3dd-80b5-42f3-96ec-db813d5064c1 | aidarinho2017/Algorithms | lab2/2d.cpp | #include<iostream>
#include<unordered_map>
#include<vector>
#include<algorithm>
#include<iterator>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
unordered_map<int, int> m;
int k = 1;
for (int i = 0; i < n; ... | ALGO | 0.999987 | 4.374704 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-03-23T15:31: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": "b55b63e1261b... |
d1d551bb-8dce-425e-8cab-bf033f6738d7 | RoyDibs/Diffusion_project | DiffusionEnvironment.cc | #include "DiffusionEnvironment.h"
#include <deal.II/grid/grid_tools.h>
#include <deal.II/grid/manifold_lib.h>
namespace TransientDiffusion {
DiffusionEnvironmentWrapper::DiffusionEnvironmentWrapper(const GeometryConfig& geometry_config,
int refinement_level,
... | ALGO | 0.996905 | 7.657681 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-06-02T13:41: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": "77bc52fb318... |
e3755815-c1ec-47b9-b87e-633eaf85fa13 | mayataka/pinipopt | include/pinipopt/ocp.hpp | #ifndef PINIPOPT_OCP_HPP_
#define PINIPOPT_OCP_HPP_
#include <vector>
#include <memory>
#include "Eigen/Core"
#include "ifopt/variable_set.h"
#include "ifopt/constraint_set.h"
#include "ifopt/cost_term.h"
#include "ifopt/problem.h"
#include "ifopt/ipopt_solver.h"
#include "pinipopt/robot/robot.hpp"
#include "pinipop... | ALGO | 0.949953 | 6.492867 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-11-30T03:37:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "950ae9b03d... |
ef5b53cf-84f9-4e6b-b031-54247d794ca6 | silasdani/C-Cplusplus | fmcm/main.cpp | #include <queue>
#include <cstdio>
#include <vector>
#include <cstring>
#include <algorithm>
#define MAXN 351
#define MAXM 12501
#define INF 0x3f3f3f3f
using namespace std;
int best[MAXN];
class gentleman{
public:
bool operator () (int &x, int &y) {
return best[x] > best[y];
}
};
vector <int> G... | ALGO | 0.999931 | 4.065064 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2019-07-17T22: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": "3b254c1ae... |
76e40f0e-32ba-495a-92af-f4fa23435bb8 | 2261819266/code_old | luogu/P1507.cpp | #include <cstdio>
#define max(X, Y) ((X) > (Y) ? (X) : (Y))
#define min(X, Y) ((X) < (Y) ? (X) : (Y))
const int maxn = 505;
int v[maxn], q[maxn], k[maxn], dp[maxn][maxn][maxn], n;
int dfs(int x, int y, int z) {
if (y <= 0 || z <= 0 || x == 0)
return 0;
if (!dp[x][y][z]) {
if (y < v[x] || z < q[x])
dp[x][y][z... | ALGO | 0.99982 | 3.369196 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2023-01-29T12:39: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": "f3276882d8... |
c6cc9d59-908d-4961-b584-6abc573d3357 | harshbhagwani94/Company_Coding_Questions | Cohesity/kFrequency.cpp | /*You are given a string of length N.
The string consists of lowercase english alphabets only i.e. a to z.
You are also given an integer K. You need the find the Kth most frequent alphabet
in the string.
If more than one alphabet share the Kth frequency,
you need to find the lexicographically smallest alphabet among... | ALGO | 0.999984 | 4.898587 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2018-11-16T13:32: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": "5a1f7d818... |
fa47d6c2-0c9c-400d-8a61-1f9b4c7b213c | JayeshK10/OperatingSystems | Scheduler/scheduler.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <cstring>
#include <unistd.h>
#include <cstdlib>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <deque>
#include <optional>
#include <stack>
#include <functional>
#include <limits>
#include <i... | ALGO | 0.999566 | 5.125537 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-25T20:50: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": "d9041c163d28... |
03ae715a-3ec0-4cdd-a013-6c06241d13a7 | Anshul-Dishoriya/CPP-Data-Structures- | Linked List/Singly Linked List/RemoveDublicatesformSLL.cpp | #include <iostream>
using namespace std;
struct Node {
int data;
Node *next;
Node(int x) {
data = x ;
next = NULL;
}
};
void print_linked_list(Node *head) {
Node *curr = head;
while (curr != NULL) {
cout << curr->data << " ";
curr = curr->next;
}
}
Node* Insert_end(Node *ptr , int n) { //head pointe... | ALGO | 0.999555 | 4.16174 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-12-19T12:26:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "763b87c53a5d... |
5ffa0afd-b2d2-4de5-ad4c-8002c4db6f04 | SammaelA/grade | src/generation/planter.cpp | #include "planter.h"
Planter::Planter(LightVoxelsCube *_voxels, Heightmap *_heightmap, GroveMask *_mask, GroveMask *_bm,
float3 _center, float2 _size,
float base_density, int max_saplings, float _cell_size):
density(_center, _size, _cell_size),
occlusion(_center, _size, _cell_size)
{ ... | ALGO | 0.976658 | 4.285337 | {
"github_metadata": {
"branch": "master",
"commit_count": 1489,
"repo_created_at": "2024-02-07T06:31:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1821218... |
b13f3985-ce47-4454-b416-ae6a7a2fad29 | buckeye-cn/ACM_ICPC_Materials | solutions/buckeyecode/14.cpp | #include <cstdlib>
#include <cstdint>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <iostream>
using namespace std;
template <long N>
struct SPFA {
struct Edge {
long to, len;
};
vector<Edge> edges;
vector<long> outs[N];
void add(long ... | ALGO | 0.999978 | 3.975385 | {
"github_metadata": {
"branch": "master",
"commit_count": 1094,
"repo_created_at": "2017-09-09T18:26:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 40,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c807fe5... |
66c67171-7faf-4fc1-84cf-970ef3cccedb | ericranjie/slicing_notes | leetcode/1-100/82_RemoveDuplicatesFromSortedListII.cc | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* deleteDupli... | ALGO | 0.999977 | 5.719683 | {
"github_metadata": {
"branch": "main",
"commit_count": 134,
"repo_created_at": "2023-05-19T08:02: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": "039fc19850... |
0e05ccef-1265-41a5-80b7-81e33475ee48 | srajan-code-heaven/coding_interview_preparation | Arrays/q16.cpp | //Algorithm to find the common element in given three sorted arrays
#include <stdio.h>
#include<bits/stdc++.h>
using namespace std;
void findCommonOfThree(int a1[],int a2[],int a3[],int n1,int n2,int n3)
{
int i=0,j=0,k=0;
while(i<n1 && j<n2 && k<n3)
{
if(a1[i]==a2[j] && a2[j]==a3[k])
{
... | ALGO | 0.999789 | 4.755538 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-02-16T05:03: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": "4cc833202c... |
9303b461-b64d-46e8-8790-8c359cf9d847 | berlinquin/col-opt | include/approximate.h | #include <cassert>
#include <cmath>
#include <numeric>
#include <coin/ClpSimplex.hpp>
#include <coin/CoinHelperFunctions.hpp>
#include "global.h"
// Approximate the optimal solution with linear programming
template<typename T>
std::vector<int> approximate(const T& table, int width);
// Round the given list so that al... | ALGO | 0.999764 | 5.866086 | {
"github_metadata": {
"branch": "master",
"commit_count": 120,
"repo_created_at": "2022-02-12T19:07: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": "5c8d085f... |
3ad315ec-11e6-40c9-9385-f00d3414866f | zhamghaoran/leetcode | leetcode1377.cpp | #include "bits/stdc++.h"
using namespace std;
class Solution {
public:
struct e {
int f, t, nex;
} rt[100010];
int cnt;
int head[100010];
double ans[100010];
void add(int x, int y) {
rt[++cnt].f = x;
rt[cnt].t = y;
rt[cnt].nex = head[x];
head[x] = cnt;
... | ALGO | 0.999734 | 4.683067 | {
"github_metadata": {
"branch": "main",
"commit_count": 270,
"repo_created_at": "2022-12-15T03:00:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4f6269a72... |
5ac2ea8a-135e-421c-b46c-08b16f71829f | zuev-stepan/MIPT | MIPT-4SEM/GeometryContest/A-HK.hpp | #ifndef GEOMETRY_HPP
#define GEOMETRY_HPP
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <assert.h>
namespace Geometry {
using std::swap;
using std::max;
using std::min;
using std::abs;
using std::vector;
using std::istream;
using std::ostream;
usi... | ALGO | 0.97949 | 3.746473 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-06-25T01:24:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "48eb64b743... |
5404a981-1734-4ae3-b532-d12ff00b5467 | JayrajCE/C-- | problem1_2.cpp | #include <iostream>
#include <vector>
using namespace std;
class Product {
private:
int Product_id;
string Name;
int Quantity;
double Price;
public:
Product() {
Product_id = 0;
Name = "Unknown";
Quantity = 0;
Price = 0.0;
}
void Set_details(int id, string n... | TOOL | 0.982103 | 6.635643 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-04-13T12:37: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": "aef8d566f77... |
1f7b143c-3c02-426b-a9e6-457d10baa9e5 | jeremyonscale/advent2023 | 08/one.cpp | #include <iostream>
#include <vector>
#include <map>
int main(void) {
std::string s;
std::cin >> s;
std::vector<int> instructions;
for (size_t i = 0; i < s.length(); i++) {
instructions.push_back(s[i] == 'R');
}
std::map<std::string, std::pair<std::string, std::string>> nodes;
while (std::... | ALGO | 0.999587 | 4.017039 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2023-12-01T13:29: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": "c1e39a5a9a1... |
53c34d5b-7e26-4d3d-be66-3965a754c278 | freezer-glp/leetcode-submit | src/Delete Node in a Linked List.cpp | /*Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.
Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value 3, the linked list should become 1 -> 2 -> 4 after calling your function.
Hide Tags Linked List
Hide Similar Problems ... | ALGO | 0.994772 | 5.583436 | {
"github_metadata": {
"branch": "master",
"commit_count": 199,
"repo_created_at": "2014-11-12T04:30: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": "f0f5b34d... |
5562d5cb-dec9-4429-b42a-01880116518f | newcoderlife/leetcode | cpp/92/reverseBetween.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;
struct ListNode {
int val;
ListNode* next;
ListNode(int x) : val(x), next(nullptr) {}
};
class Solution {
public:
ListNode* reverseBetween(ListNode* head, int m, int n) {
ListNode *pivot = new ListNode(0),... | ALGO | 0.999931 | 5.722319 | {
"github_metadata": {
"branch": "master",
"commit_count": 165,
"repo_created_at": "2018-09-24T15:39:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97322589... |
09fc7879-fd37-4686-a879-0c53e4aca941 | user-of-github/BSUIR_Labs_Algorithmization-and-programming | 1_semester/2020.11.21 - PR/4_PassFromThe1RowToTheN/4_PassFromThe1RowToTheN.cpp | #include <fstream>
using std::ios_base,
std::min,
std::ifstream,
std::ofstream;
int main()
{
ifstream cin("input.txt");
ofstream cout("output.txt");
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
short rows,
cols;
cin>>rows>>cols;
/* cr... | ALGO | 0.999924 | 4.314416 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2021-03-01T13:10: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": "0328dbdc9... |
d925c356-38e0-4844-9840-dd5daa934c3c | michaelnaps/xtern_WSA_datascience | data_manip_files/cluster_mapping.cpp | // File: cluster_mapping.cpp
// Created by: <NAME>
// Created on: 10/11/2019
/*
Program that uses preset cluster sizes to find average battery
level of scooters and orders the clusters from lowest battery level
to highest.
*/
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <fstre... | ALGO | 0.978214 | 4.638813 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-10-11T14:44: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": "faa3d36c4... |
794f4c71-41f3-41ef-a157-3fd5191901c4 | rajrohan10899/Striver-SdeSheet-Challenge | Linked List Ques/23. Merge k Sorted Lists.cpp | // https://leetcode.com/problems/merge-k-sorted-lists
/**
You are given an array of k linked-lists lists, each linked-list is sorted in ascending order.
Merge all the linked-lists into one sorted linked-list and return it.
Example 1:
Input: lists = [[1,4,5],[1,3,4],[2,6]]
Output: [1,1,2,3,4,4,5,6]
Explanation: The l... | ALGO | 0.999961 | 6.576435 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2023-06-05T07:13:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13f6aec6f46... |
678a8eab-9016-4048-93cd-cf45ab61a26c | m-pilia/CorrespondingPointsMeanDistanceMetric | CorrespondingPointsMeanDistanceMetric/itkCorrespondingPointsMeanDistancePointMetric.hxx | /*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* 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
*
* h... | ALGO | 0.96627 | 7.035712 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-09-06T14:03:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b3d407f9d... |
cb7df30f-457d-405b-8bcf-28d6053c96ab | 0xch4z/hackerrank-cpp | Algorithms/BirthdayChocolate.cpp | #include <bits/stdc++.h>
int solve(const int &n, const std::vector<int> &s, const int &d, const int &m) {
int matches = 0;
// start at each peice
for (int i = 0; i < s.size(); i++) {
int j = i + 1;
int peices = 1;
int sum = s[i];
// accumulate peice... | ALGO | 0.999953 | 4.377382 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-07-21T00:54:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "013809dc59... |
90d76a3e-8f5d-4632-9b19-b3f6f8ddfdc4 | shbhmexe/GeeksforGeeks-Sol | Hard/max_rectangle.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
private:
vector<int> nextSmallerElements(vector<int>& arr, int n) {
vector<int> v(n);
stack<int> s;
s.push(-1);
for (int i = n - 1; i >= 0; i--) {
while (s.top() != -1 && arr[s.top()] >= arr[i]) {
... | ALGO | 0.999985 | 6.594556 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2025-07-01T15:13: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": "c4c3cc39945... |
cd8bf9c8-7863-4005-9559-aa8c59d03ccd | zhwj184/zhwj184-zoj | 1657yitongguo.cpp | #include <stdio.h>
#include <math.h>
using namespace std;
bool isPrime(int num)
{
int rnum,ca;
rnum=(int)sqrt(num);
for(ca=2;ca<=rnum;ca++)
{
if(num%ca==0)
{ return false;}
}
return true;
}
int main()
{
int ca,temp,n,count;
while(scanf("%d",&n) && n!=0)
{
count=0;
for(ca=(int)ceil(... | ALGO | 0.999898 | 3.995043 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2013-03-14T15:00:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae2861dab2... |
8b74dff9-c91e-4c2b-ae44-9bd5ff7aec84 | monellz/perm | src/sjt_order.cpp | #include "sjt_order.h"
bool SJTOrderBaseline::perm(std::vector<uint32_t>& result, const std::vector<uint32_t>& pattern, int idx) {
//dbg(pattern, idx);
int num = pattern.size();
result.resize(num);
if (num == 0) return false;
if (idx == 0 || num <= 1) {
for (int i = 0; i < num; ++i) result[i] = pattern... | ALGO | 0.999864 | 4.669387 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2021-10-19T19:21: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": "3aeb64e69e... |
8b24e5ea-a834-4371-b3c6-b1499a74a600 | bitluni/ESP32Lib | src/Graphics/TriangleTree.h | /*
Author: bitluni 2019
License:
Creative Commons Attribution ShareAlike 4.0
https://creativecommons.org/licenses/by-sa/4.0/
For further details check out:
https://youtube.com/bitlunislab
https://github.com/bitluni
http://bitluni.net
*/
#pragma once
class TriangleTree
{
public:
short *v[3];
int z;
... | ALGO | 0.983289 | 4.708595 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2019-01-29T10:23:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 495,
"forks": 85,
"issues": 58,
"pull_requests": 4
},
"file_meta": {
"content_id": "ea1df... |
29297206-a31e-4ef2-b67b-17bbe5fe939c | Blaga-Cristian/Personal-Projects | Competitive programming - solutions/All Problems (pbInfo, Infoarena, Codeforces, Kilonova...)/Consecutive/main.cpp | #include <bits/stdc++.h>
#define VI vector<int>
#define VVI vector<VI>
#define PI pair<int, int>
#define F first
#define S second
#define FOR(i, a, b) for(int i = a; i <= b; ++i)
#define FORR(i, a, b) for(int i = a; i >= b; --i)
#define pb push_back
#define ll long long
#define FAST_IN_OUT ios_base::sync_with_stdio(0),... | ALGO | 0.999982 | 4.580031 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-10-23T19:43: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": "56a9c4c0620f... |
442c919f-65fd-499e-aed1-d181f1fd2bdf | unisharespecial/EBMYL525 | codes/transformation.cpp | #include <GL/glut.h>
// Cumulative affine transformations
void draw(){
// Make background colour yellow
glClearColor(1, 1, 0, 0 );
glClear ( GL_COLOR_BUFFER_BIT );
// modelview matrix for modeling transformations
glMatrixMode(GL_MODELVIEW);
// x-axis
glColor3f(0,0,0);
glBegin(GL_LINES);
glVertex2f(0.0,0.0... | ALGO | 0.946908 | 4.698741 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-08-30T17:47:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "14d7c14d19dc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.