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 |
|---|---|---|---|---|---|---|---|
62dfe43e-5b15-4d6f-9534-6f71cb90771e | Ypsidshi/LR1 | code.cpp | #include <iostream>
#include <stdlib.h>
#include <time.h>
#include <locale.h>
#include <Windows.h>
int main()
{
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
int arr[10] = { 1, 2, 5, 6, 8, 9, 10, 3, -77, 0 }, min = arr[0], max = arr[0];
setlocale(LC_ALL, "Rus");
srand(time(NULL));
for (int i = 0; i < 10; i++)
{... | ALGO | 0.982434 | 3.376268 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-09-19T13:39: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": "e9b833e1cd9b... |
24c594a2-97ec-4c5f-ba7f-511b0b1a2e47 | FredericoNesti/HMM | vec.h | vec.h
Type
C
Size
5 KB (4,824 bytes)
Storage used
0 bytes
Location
version1
Owner
<NAME>
Modified
Sep 15, 2019 by <NAME>
Opened
11:43 PM by me
Created
Sep 15, 2019
Add a description
Viewers can download
#include <cstdlib>
#include <iostream>
#include<cmath>
class vec{
public:
int rows;
int cols;
double... | ALGO | 0.976606 | 3.757094 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-06-08T21:37:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e2a03a47d... |
05eb5547-eb23-46e7-b724-2deb5f10bc79 | SiddharthJadhav99/data_structures_and_algorithms | 1 Array/Array Important/12maxCirularSubarray.cpp | #include <iostream>
using namespace std;
int maxCircularArray(int arr[], int n){
int res = arr[0];
for(int i = 0; i < n; i++){
int curr_sum = arr[i];
int max_sum = arr[i];
for(int j = 1; j < n; j++){
int index = (i+j)%n;
curr_sum += arr[index];
max_sum... | ALGO | 0.999993 | 4.895183 | {
"github_metadata": {
"branch": "master",
"commit_count": 239,
"repo_created_at": "2021-06-18T00:59:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "88278e33... |
85f59bb4-aae6-4a2b-b066-77e274455b15 | mingyuefly/leetcode | leetcode/union&find/Number of Provinces547/Number of Provinces/Number of Provinces/main.cpp | //
// main.cpp
// Number of Provinces
//
/**
There are n cities. Some of them are connected, while some are not. If city a is connected directly with city b, and city b is connected directly with city c, then city a is connected indirectly with city c.
A province is a group of directly or indirectly connected citi... | ALGO | 0.999984 | 6.013051 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2019-12-25T11:28: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": "74840fb0f... |
60237bb5-aeb6-4147-988e-d6a9b7dcca2e | japonica99/syp_video | shot/mainwindow.cpp | #include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
//获取源视频
void MainWindow::on_inputPushButton_pressed()
{
QString filename = QFileDialog::getOpenF... | TOOL | 0.938091 | 4.882797 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-12-17T11:17:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7120f26984... |
708f4b72-6ef4-4740-8e9a-c71da3a733ad | karan221/cp | 1474/B_Different_Divisors.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 1e4;
int primes[N];
void SieveOfEratosthenes(int n)
{
bool prime[n+1];
memset(prime, true, sizeof(prime));
for (int p=2; p*p<=n; p++)
{
if (prime[p] == true)
{
for (int i=p*p; i<=n; i... | ALGO | 0.99982 | 4.391198 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2021-03-27T14:54: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": "159c12bde28... |
e75b4c23-974a-4b02-8ac5-fe7523cdbbcf | Abdulla3037/CPU-Scheduler-Algorithm-Simulator-Performance-Evaluator | CPU_Scheduler_Algorithm_Project.cpp | /*
Name: Md. <NAME>
*/
#include <bits/stdc++.h>
using namespace std;
// Structure to represent processes
typedef struct{
int burst_time; // Process Burst time
int waiting_time; // Proces Waiting Time
int backupburst_time; //A backup of the initial burst time (used for displaying)
int priority; // ... | ALGO | 0.999966 | 5.867014 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-06-14T11:48: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": "0f03759ac09a... |
1a34ab5c-4f68-4764-8c67-af1c6420fd70 | russellfolk/CPP-Primer-Plus-6th-Edition | PE-03-01.cpp | /**
* Programming Exercise 3.1
* C++ Primer Plus, 6th Edition
* @author <NAME>
*
* Write a short program that asks for your height in integer inches and then converts your height to feet and inches.
* Have the program use the underscore character to indicate where to type the response. Also use a `const` sy... | ALGO | 0.922322 | 4.336099 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2017-12-12T03:53:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89153f417... |
598da921-8874-4bad-a5a7-d22db19e59a3 | gap-king/LeetCode | src/solutions/array/MedianOfTwoSortedArrays_4.cpp | #include <limits>
#include "MedianOfTwoSortedArrays_4.hpp"
using namespace std;
double MedianOfTwoSortedArrays::operator()(std::vector<int>& nums1, std::vector<int>& nums2) {
int n1 = nums1.size(), n2 = nums2.size();
// Ensure nums1 is the smaller array for simplicity
if (n1 > n2)
return ope... | ALGO | 0.999998 | 6.636296 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2025-01-10T07:29: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": "01b5f86cb... |
5c7b0f92-6ae4-44ec-9d99-6781ab1c97bc | EmmanuelAdesope/Heisenberg_simulation | main.cpp | //Main Program for Model simulation
#include "lattice.h"
#include "simulation.h"
#include "measurements.h"
#include <iostream>
// Constants
const int L = 10; // Lattice size (L x L x L)
const int N = L * L * L; // Total number of spins
const double T_max = 3.0; // Maximum temperature
cons... | ALGO | 0.999113 | 5.740302 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2025-03-16T14:55: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": "bcbb34cae6a... |
4cfea424-5139-4ce4-abde-853dc799e912 | KartikAg13/College | data_structures_and_algorithms/learn/binary_tree/questions2.cpp | // lecture 64
#include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
class Node;
vector<int> zigZagTraversal(Node *);
vector<int> boundaryTraversal(Node *);
vector<int> verticalOrder(Node *);
vector<int> topView(Node *);
void leftView(Node *, vector<int> &, int);
class Node {
... | ALGO | 0.99998 | 4.52055 | {
"github_metadata": {
"branch": "main",
"commit_count": 91,
"repo_created_at": "2023-12-13T16:37:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d3959b693d9... |
e9e8beff-22b7-4da1-89fa-0dfe5e34ca40 | Halksel/Competition | Geometry/CGL3B.cpp | #include <bits/stdc++.h>
using namespace std ;
#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) begin(r),end(r)
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define ... | ALGO | 0.999783 | 4.774065 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2016-05-23T14:03: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": "0bead3f6d... |
a0cde0a3-785b-456d-a3fd-978ff1d6bf3e | Diego-Aquino1/AugmentedReality3D_CG | calibrateCamera.hpp | //
// calibrate.hpp
// Augmented Reality
//
// Calibration
#ifndef calibrateCamera_hpp
#define calibrateCamera_hpp
#include <stdio.h>
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/calib3d.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/core/types_c.h>
using namespace cv;
using namespace... | TOOL | 0.935407 | 5.475177 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-07-22T08:30: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": "b23e8b3c2bfd... |
c74839a7-80f2-4368-aea2-b65617c9125c | roboptim/roboptim-core-plugin-cminpack | src/cminpack.cc |
// Copyright (c) 2011 CNRS
// Authors: <NAME>
// This file is part of roboptim-core-plugin-cminpack
// roboptim-core-plugin-cminpack is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
/... | ALGO | 0.998769 | 6.021929 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2011-11-10T21:43:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de7085aa1e... |
14a8f946-7c27-456b-8f01-be45daa90eca | cyendra/ACM_Training_Chapter_One | poj 3213 PM3/main.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long LL;
const int maxn=1011;
int N,P,M;
int A[maxn][maxn],B[maxn][maxn];
LL C[maxn][maxn];
LL sumB[maxn],sumC[maxn];
int wr,wl;
LL rt;
int main()
{
while (~scanf("%d%d%d",&N,&P,&M)){
... | ALGO | 0.999975 | 3.423025 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2013-11-17T08:33: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": "5a8afdc827... |
293e6439-ba8c-484f-8d3c-4ee2d1db54e0 | arnavarora1710/Competitive_Programming | Codeforces/1956B.cpp | // https://codeforces.com/contest/1956/problem/D
#pragma GCC optimize("Ofast")
#pragma GCC optimization("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> pi;
#define f first
#define s second
#define MULTI_TEST (1)
const int maxn = 2e5 + 5, inf = 1e18;
int n, a[... | ALGO | 0.999739 | 4.637686 | {
"github_metadata": {
"branch": "main",
"commit_count": 513,
"repo_created_at": "2023-11-05T09:57: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": "ebb1c8d024... |
fafce9ae-69c0-415d-b4e7-fe7bafec2be5 | thinker99k/BOJ-25summer | 2507/250715/3190.cpp | #include <iostream>
#include <queue>
#define DEBUG 0
using namespace std;
struct Pos {
int row;
int col;
};
struct Turn {
int time;
char dir;
};
bool apple[101][101];
int LIM;
queue<Turn> mov;
queue<Pos> snake;
bool snake_chk[101][101];
unsigned int snake_dir;
/**
* 2
* 3 1
* 4
*/
Pos... | ALGO | 0.999869 | 4.232501 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2025-06-21T10:57: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": "1dfcd94a60b... |
dea14fdf-2c84-42ee-8b6a-ba520656399a | drviruses/CP | irreducible.cpp | /*
@uthor: <NAME>
user -->GitHub: drviruses ; CodeChef: dr_virus_ ; Codeforces,AtCoder,Hackerearth,Hakerrank: dr_virus;
*/
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;
//#define ... | ALGO | 0.999862 | 4.554124 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-10-20T06:14: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": "405a5ebbbe... |
c381c815-b31a-4954-bc1a-cd475b924600 | priyanka-111-droid/codewithharry_cpp | C++STL/tut71g.cpp | //iterator lower_bound and upper_bound
/*
vector<int> v{1, 3, 6, 6, 8};
vector<int>::iterator lower1, lower2, lower3;
lower1 = lower_bound(v.begin(), v.end(), 4); // Index will be 2
lower2 = lower_bound(v.begin(), v.end(), 1); // Index will be 0
lower3 = lower_bound(v.begin(), v.end(), 9); // Index will be 5
// To get ... | ALGO | 0.999943 | 5.438838 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2021-06-02T18:44: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": "01a67a994bf... |
ce35670f-9743-42b0-b2cb-403ae6fa8d05 | ishandutta2007/codeforces-k | kristevalex/normal/1580/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false); \
cin.tie(nullptr); \
cout.tie(nullptr)
using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
template<typename T>
using pair2 = pai... | ALGO | 0.999932 | 3.377308 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8eff7a2f87fe... |
8d86bc34-7700-4566-a4f6-c5878c53419a | srinjoyray/Codeforces-Solutions | codeforces/151/B.cpp | #include <bits/stdc++.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<ctype.h>
#define lli long long int
#define mod 1000003
#define pi 3.141592653589793238
using namespace std;
int main()
{ int n,nos;
cin>>n;
vector<string> name;
string temp_name,s;
vector<int> v;
int ... | ALGO | 0.998486 | 3.015226 | {
"github_metadata": {
"branch": "master",
"commit_count": 998,
"repo_created_at": "2021-05-22T14:38:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "319fbef5... |
ff6398bc-ea86-44a9-bfa3-1c8a35a3ba55 | dpohanlon/IPU4HEP | kalman_filter_poplar/packHitsVertex.cpp | #include <poplar/Vertex.hpp>
class PackHits : public poplar::Vertex {
public:
// Fields
poplar::Vector<poplar::Input<poplar::Vector<float>>> inputHits;
poplar::Input<poplar::Vector<int>> itr;
poplar::Vector<poplar::Output<poplar::Vector<float>>> out;
// Compute function
bool compute() {
int inCols =... | ALGO | 0.981633 | 3.859949 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-08-11T12:20:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73faf4bb5... |
4a43d4d9-cfbd-405a-98b3-064aa9a0505e | ishandutta2007/codeforces-d | demoralizer/normal/982/D.cpp | #include "bits/stdc++.h"
using namespace std;
#define int long long
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define all(x) (x).begin(),(x).end()
#define uniq(v) (v).erase(unique(all... | ALGO | 0.999935 | 3.788663 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "034deae312e1... |
0f997b22-7f4c-484e-b0c6-16c9945bb1a1 | zerlok/nsu-prog-all | oop/task5/gtest.cpp | #include <algorithm>
#include <string>
#include <vector>
#include <gtest/gtest.h>
#include "node.h"
// -------------------------- EXTRA --------------------------//
static const string INPUT_FILE_TAIL = "-input.txt";
static const string OUTPUT_FILE_TAIL = "-output.txt";
bool operator==(const vector<Node> &node1, ... | TEST | 0.940851 | 5.195502 | {
"github_metadata": {
"branch": "master",
"commit_count": 542,
"repo_created_at": "2020-06-30T01:10: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": "ffcbb6c6... |
fbf9806a-509e-4359-b039-129b08c030c6 | E-studenci/ChessPy2 | cpp/Chess/Zobrist.cpp | #include "Zobrist.h"
#include <cstddef>
#include <random>
#include "Board.h"
#include "Coordinates.h"
const std::array<uint64_t, 781> Zobrist::ZobristTable = [] {
std::array<uint64_t, 781> table;
std::mt19937_64 gen(0);
std::uniform_int_distribution<uint64_t> dist(0, UINT64_MAX);
for (size_t i = 0; i... | ALGO | 0.987366 | 5.729583 | {
"github_metadata": {
"branch": "develop",
"commit_count": 72,
"repo_created_at": "2022-04-01T15:37:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6fd138c6a... |
19d3b498-ee04-40b7-a660-3fc91b819e3e | poweihuang17/practice_leetcode_and_interview | Leetcode/Sort/148_Sort_List.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* sortList(ListNode* head) {
if(head==nullptr) return nullptr;
ListNode * fast=head;
ListNode * slow... | ALGO | 0.999992 | 5.56126 | {
"github_metadata": {
"branch": "master",
"commit_count": 608,
"repo_created_at": "2018-02-07T08:21:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "92a4a6cd... |
072c48b6-0807-4db3-b1f5-a3a08e838882 | Saurabhmishra1909/DSA | Medium/New Year Resolution/new-year-resolution.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution {
public:
int solve(int ind, int sum , int n, int coins[],vector<vector<int>>& dp) {
if(ind==n) {
if((sum%20==0 || sum%24==0 || sum==2024) && sum!... | ALGO | 0.999196 | 4.72055 | {
"github_metadata": {
"branch": "master",
"commit_count": 664,
"repo_created_at": "2023-03-23T23:57:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a24ef50... |
7145fe13-c921-449e-9dfa-e270c46df76f | AllAlgorithms/cpp | algorithms/strings/palindrome_check.cpp | //
// C/C++ program to check whether the given string is a palindrome
//
// The All ▲lgorithms Project
//
// https://allalgorithms.com/strings
// https://github.com/allalgorithms/cpp
//
// Contributed by: <NAME>
// Github: @sankalp24
//
#include<bits/stdc++.h>
using namespace std;
// A function to check if a string str... | ALGO | 0.932209 | 3.622882 | {
"github_metadata": {
"branch": "master",
"commit_count": 485,
"repo_created_at": "2018-09-18T05:00:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 799,
"forks": 339,
"issues": 9,
"pull_requests": 34
},
"file_meta": {
"content_id": "4014... |
b2bdc6ee-3629-403c-97aa-2a5bb2e9a50d | Romasa102/CompetitiveProgramming | AlgorithmPractice/100Problem/5.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i = 0; i < (n); ++i)
using P = pair<ll,ll>;
int main(){
ll A,B,C,X,Y;
cin >> A >> B >> C >> X >> Y;
ll currentCost = A * X + B * Y;
ll smallestCost = currentCost;
ll counter = 0;
ll LoopA = max(X,Y);
... | ALGO | 0.999832 | 3.225485 | {
"github_metadata": {
"branch": "main",
"commit_count": 162,
"repo_created_at": "2023-04-30T09:21:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3fac4559e... |
8adb877a-39f6-44b1-990e-ff2b1a95ec29 | mgschwan/blensor | source/blender/freestyle/intern/geometry/normal_cycle.h | /*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program 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 (at your option) any later version.
*
* This program is d... | ALGO | 0.986186 | 6.630689 | {
"github_metadata": {
"branch": "master",
"commit_count": 56131,
"repo_created_at": "2011-10-10T10:14:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 186,
"forks": 48,
"issues": 27,
"pull_requests": 3
},
"file_meta": {
"content_id": "61... |
66a1fa4f-d7b1-4d2c-8f19-a72828c22acd | leefige/foundation-of-programming-pa | hw4/13932.CPP | #include <iostream>
using namespace std;
class Mat {
long long** mat;
int n;
public:
Mat(int n) {
this->n = n;
mat = new long long*[n * n];
}
Mat(long long arr[], int n) {
this->n = n;
mat = new long long*[n * n];
for (int i = 0; i < n * n; i++) {
... | ALGO | 0.999988 | 4.217636 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2017-10-17T13:20: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": "a4dc5ee8e... |
fdd4f9eb-5993-4c02-b7ba-325804b8d18d | akhikolla/testpackages | fuzzedpackages/Buddle/src/Sinc.h |
#ifndef xxSINC_H
#define xxSINC_H
class Sinc{
private:
int p;
int n;
arma::mat Out;
arma::mat dOut;
public:
Sinc(){
n=0;
p=0;
}
Sinc(int xp, int xn) // Constructor
: Out(xp, xn), dOut(xp, xn) { // Default matrix member variable initialization
n = xn;
p = xp;
... | TOOL | 0.997904 | 4.561643 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-01-15T17:42:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8dd10bf922... |
310a0065-8444-4b27-a44e-424b5d639ed7 | gu1trh2ro/BOJ_Solutions | BOJ_STEP9/BOJ_STEP9/11653.cpp | /*
// 너무 못풀었다
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
bool is_prime(int num) {
if (num < 2) return false; // 2 미만은 소수가 아님
for (int i = 2; i <= sqrt(num); i++) {
if (num % i == 0) return false; // 약수가 존재하면 소수가 아님
}
return true; // 소수
}
int main(void)
{
int N;
cin >> N;
ve... | ALGO | 0.999975 | 4.930051 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-06-11T06:49: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": "5e36e1eb1464... |
d2b712f2-f2c6-4792-9407-f827edc5a318 | mgtruuuu/LeetCode | 1202-smallest-string-with-swaps/1202-smallest-string-with-swaps.cpp | /*
// Approach 1: Recursive DFS
class Solution {
private:
void dfs(const std::string& s, const std::vector<std::vector<int>>& adj_list, const int vertex,
std::vector<bool>& visited, std::vector<char>& characters, std::vector<int>& indices)
{
// Add the character and index to the list
... | ALGO | 0.999993 | 6.745491 | {
"github_metadata": {
"branch": "main",
"commit_count": 2391,
"repo_created_at": "2023-05-27T05:02: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": "4ce5ac477... |
f7683317-b076-4933-be25-52c1301f1cbc | cueltschey/5G_dynamic_compression | lib/security/security.cpp | /*
*
* Copyright 2021-2024 Software Radio Systems Limited
*
* This file is part of srsRAN.
*
* srsRAN is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at y... | ALGO | 0.974773 | 7.037374 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2024-10-05T22:54:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5906e0457a... |
fb0aa54d-8be7-4d2b-9a23-26ea68b542a5 | courage17340/OI | tyvj/第05页(1400-1499)/1414三取方格数/1414.cpp | #include <cstdio>
#include <cstring>
int n,ans,a[21][21],f[41][21][21][21] = {{{{0}}}};
int max(int a,int b){
return a > b ? a : b;
}
int main(){
scanf("%d",&n);
for (int i = 1;i <= n;i++)
for (int j = 1;j <= n;j++) scanf("%d",&a[i][j]);
ans = a[1][1] + a[n][n];
a[1][1] = a[n][n] = 0;
for (int i = 1;i <= n * 2 ... | ALGO | 0.999983 | 3.103258 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2015-03-27T10: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": "429bb9504... |
94cd3cbc-c426-492b-80d8-052cfba73661 | hareeshghk/leetcode_solutions | 2699-count-the-number-of-fair-pairs/2699-count-the-number-of-fair-pairs.cpp | class Solution {
public:
long long countFairPairs(vector<int>& nums, int lower, int upper) {
sort(nums.begin(), nums.end());
// create a function to getnumber of element less than or equal to a value.
// fn(upper) - fn(lower-1) is the answer.
return getNumberOfPairsWithMaxSumLimit(up... | ALGO | 0.999978 | 6.14055 | {
"github_metadata": {
"branch": "master",
"commit_count": 2809,
"repo_created_at": "2022-02-18T07:13:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4526268... |
fb0e21a1-68a6-4b20-b000-abc16c376429 | mariasegura20/CC | prac1/RAM_exercise2.cpp | // Input: m[1], m[2], ... (the string)
// Output: m[0] (0 == false, 1 == true)
// 10101
#include "ram.h"
#include <iostream>
void program()
{
reset(0); // Counter to go through the number
reset(2); // Auxiliary variable to inconditional jumps
node1:
inc(0);
load(1, 0); // r[1... | ALGO | 0.997224 | 3.393236 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-12T15:24: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": "69115054c7bc... |
980449f6-b17f-49e9-a48d-b8865ffbe7fa | TimKingNF/leetcode | editor/cn/164.maximum-gap.h | //给定一个无序的数组,找出数组在排序之后,相邻元素之间最大的差值。
//
// 如果数组元素个数小于 2,则返回 0。
//
// 示例 1:
//
// 输入: [3,6,9,1]
//输出: 3
//解释: 排序后的数组是 [1,3,6,9], 其中相邻元素 (3,6) 和 (6,9) 之间都存在最大差值 3。
//
// 示例 2:
//
// 输入: [10]
//输出: 0
//解释: 数组元素个数小于 2,因此返回 0。
//
// 说明:
//
//
// 你可以假设数组中所有元素都是非负整数,且数值在 32 位有符号整数范围内。
// 请尝试在线性时间复杂度和空间复杂度的条件下解决此问题。
//... | ALGO | 0.999937 | 5.692481 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-07-09T06:35:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3cee5a11b... |
09e65e48-3f87-4ab3-8aa4-35fd870a3cbb | Sziperd/Portfolio | Nash_Equilibrum_Maxmin_GameTheory/main.cpp | //
// main.cpp
// Nash_Equilibrum_GameTheory
//
// Created by <NAME> on 07/12/2020.
//
#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
cout << endl << " First Part of the program, Nash Equilibrum checker: " << endl << endl ;
cout << endl << "---------------------... | ALGO | 0.999346 | 4.233244 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2021-01-11T16:03: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": "d853582eb7f... |
0fb1e7b6-fda8-4f7c-900b-52c2c2898c2b | AvDav/GraphViewer | FParser.h | /*
Execution after the parsing.
cos(x + sin(x + 0.1)*ln(x))
Parser holds the expression like a binary tree structure:
----------
|+, cos()|
----------
/ \
/ \
/ \
/ \
/ \
... | TOOL | 0.957061 | 4.368789 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-12-28T01:05:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc7f46345... |
57abbe64-4bfd-47a5-8bef-1b0df55f482f | semenInRussia/cf | futurestep/f.cpp | // semenInRussia 2024
#include <iostream>
#include <vector>
using namespace std;
const int N = 1000;
int a[N];
bool used[N];
vector<int> g[N];
void dfs(int x, int c) {
used[x] = 1;
a[c]++;
for (int y : g[x]) {
if (!used[y]) {
dfs(y, c);
}
}
}
int main() {
int n, m;
cin >> n >> m;
for (int... | ALGO | 0.99993 | 4.139993 | {
"github_metadata": {
"branch": "main",
"commit_count": 140,
"repo_created_at": "2024-05-03T10:20:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd10532b5e... |
d19de013-e508-4331-8f1e-7429f25ac151 | floreaadrian/C- | 2/URI/1490/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF (int)1e9
int n, visited[11000], c[105], l[105], ec[105], el[105];
map<int,int> cap[11000];
int caminho( int u, int t, int f ) {
if( u == t ) return f;
visited[u] = 1;
for( map<int,int>::iterator it = cap[u].begin(); it != cap[u].end(); it++ ) {
... | ALGO | 0.999413 | 3.922927 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2018-01-03T21:40:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73c8b3738... |
f40f392d-12f6-45c9-8002-a422ebaa88f3 | ChenglongWang/Voronoi | CppDLL/CppRun.cpp | #include <mist/mist.h>
#include <mist/filter/distance.h>
#include <mist/filter/morphology.h>
#include <vector>
#include <algorithm>
#include <assert.h>
#include "./VesselLabeling/artery.h"
#include "./VesselLabeling/image.h"
#include "myVoronoi.h"
extern "C"
{
__declspec(dllexport) bool Run(const mist::array3<short>... | ALGO | 0.913569 | 3.603674 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2015-06-05T09:50:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b1c001a1... |
49e6a5f1-acd7-42dc-ba27-b6ca6563286f | smallsimple/Space-Volume-detector-MonteCarlo | MonteCarlo.cpp | #include <stdio.h>
#include <string.h>
#include <cmath>
#include <stdlib.h>
#include <sys/times.h>
#include <limits.h>
#define N2 100
#define N3 1000
#define N4 10000
#define N5 100000
#define N6 1000000
#define N7 10000000
#define two31minus1 2147483647
FILE *fp_metaball, *fp_write;
char metaball[30];
char writename[... | DATA | 0.991755 | 3.423137 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-01-08T20:33: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": "2498f4874f... |
ec002be0-bc31-48c0-98f6-12c5ffa79f84 | zudydy/problem-solving | 백준/Gold/14502. 연구소/연구소.cc | #include <iostream>
#include <queue>
#include <vector>
#define FASTIO() ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
using namespace std;
struct Point {
int x, y;
Point(int x, int y) : x(x), y(y) {}
};
int N, M;
const int dx[4] = {0, 0, -1, 1};
const int dy[4] = {-1, 1, 0, 0};
int bfs(vect... | ALGO | 0.999915 | 4.749952 | {
"github_metadata": {
"branch": "main",
"commit_count": 992,
"repo_created_at": "2021-12-14T17:57: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": "56599255c5... |
d49d4fb0-446b-4d7f-a68c-e66393582f2f | zzzz955/Algorithm_Solved | C++17/백준/Gold/9694. 무엇을 아느냐가 아니라 누구를 아느냐가 문제다/무엇을 아느냐가 아니라 누구를 아느냐가 문제다.cc | #include<iostream>
#include<queue>
#include<vector>
using namespace std;
int t, n, m;
struct Edge {
int nn, nv;
};
struct Pos {
int cn, cv;
bool operator<(const Pos& other) const {
return cv > other.cv;
}
};
vector<int> dijkstra(const vector<vector<Edge>>& edges) {
priority_queue<Pos> pq;
pq.push({ m - 1, 0 }... | ALGO | 0.999981 | 4.779185 | {
"github_metadata": {
"branch": "main",
"commit_count": 1236,
"repo_created_at": "2024-07-11T13:55:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "00f3b2d45... |
bb44c54c-397b-47be-840f-b1e48191da31 | PaoPaoRobot/ORB_SLAM2 | src/KeyFrameDatabase.cpp | /**
* This file is part of ORB-SLAM2.
*
* Copyright (C) 2014-2016 <NAME> <raulmur at unizar dot es> (University of Zaragoza)
* For more information see <https://github.com/raulmur/ORB_SLAM2>
*
* ORB-SLAM2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as p... | ALGO | 0.996517 | 3.449175 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2019-05-12T11:25:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 107,
"forks": 46,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4dac055... |
7b670431-f409-493f-82e4-76569ab72723 | ThaHobbyist/Assignments | 4th_Sem/CSS452_DSA_assign/Assign5/fraction.cpp | #include <iostream>
#include <algorithm>
#include<cstdlib>
using namespace std;
int lcm(int a, int b) {
return (a*b/__gcd(a,b));
}
class fraction {
private:
int num, deno;
public:
fraction() {
num = deno = 1;
}
fraction operator+(const fraction &frac) {
fraction res;
res.num = (num * frac.deno) ... | ALGO | 0.947507 | 5.104889 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2022-02-21T07:53:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8af05af77... |
c7f5ea11-6305-4f1e-80b3-e75a420d99c9 | baeitur/arduino-iot-project | JWS-P10/Arduino/JWS_6panel/tampilAnimasi.ino | void moveLiftAzan(int waktu)
{
display.clear();
display.setFont(TimesNewRoman12);
for(int y=0;y<3;++y){
for(int x=0;x<480;++x){
//di isi tampilAnimasi
strcpy_P(bufferText1,(char *)pgm_read_word(&(waktuTabel[waktu])));
sprintf(bufferText,"Saatnya sholat %s",bufferText1);
display.drawText(display.width()... | TOOL | 0.947838 | 4.500921 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-10-16T03:07: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": "f97b80a89b38... |
e5c8c495-4b11-4d99-99c4-10f7897d0817 | stan-dev/math | stan/math/rev/fun/cumulative_sum.hpp | #ifndef STAN_MATH_REV_FUN_CUMULATIVE_SUM_HPP
#define STAN_MATH_REV_FUN_CUMULATIVE_SUM_HPP
#include <stan/math/prim/fun/Eigen.hpp>
#include <stan/math/rev/meta.hpp>
#include <stan/math/prim/fun/cumulative_sum.hpp>
#include <vector>
#include <numeric>
#include <functional>
namespace stan {
namespace math {
/**
* Retu... | ALGO | 0.999919 | 7.070407 | {
"github_metadata": {
"branch": "develop",
"commit_count": 28933,
"repo_created_at": "2015-07-01T18:40:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 785,
"forks": 195,
"issues": 298,
"pull_requests": 19
},
"file_meta": {
"content_id": ... |
45ee99ee-cf55-4d5a-8ca6-93318ac8dabb | dhnesh12/codechef-solutions | 03-CodeChef-Medium/764--Chef And Fibonacci Tree.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void open_file(){
string FILENAME = "";
#ifdef LOCAL
#else
freopen((FILENAME + ".in").c_str(), "r", stdin);
freopen((FILENAME + ".out").c_str(), "w", stdout);
#endif
}
const ll MOD = 1e9 + 7;
ll pl(const ll &a, const ll &b){
return... | ALGO | 0.999755 | 3.713407 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-04-06T05:27: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": "563ca6013a... |
ec911199-bf31-495a-a6bf-ec68b5339389 | sajib21/Competitive-Programming | Codeforces/Practice/191C. Fools and Roads.cpp | #include<bits/stdc++.h>
#define LIM 100005
#define vi vector<int>
#define pb push_back
using namespace std;
int n,k, uu[LIM], vv[LIM], vis[LIM], lev[LIM], keys[LIM], tim, sparse[LIM][20], mx;
vi g[LIM], nodes[LIM];
void dfs(int u, int l=0) {
vis[u] = 1; lev[u] = l+1; nodes[l+1].pb(u); mx = max(mx, l+1);
for(... | ALGO | 0.999987 | 4.27689 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2018-07-20T08:27:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f015d4c9... |
4af96624-b47f-4bcc-bddd-caa0fc4f66e9 | ChKran/apdd | example.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#define N 1000000
using namespace std;
bool has_duplicates(int a[], int n){
int c=0;
for(int i=0;i<n;i++)
for(int j=0;j<n;j++){
if(i==j)
continue;
if(a[i]==a[j])
c++;
... | ALGO | 0.990081 | 3.681923 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2018-11-20T16:56: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": "553d6ec4c... |
eded9068-8c0c-4ba9-ad43-da44628a37b7 | pingsoli/cpp | tutorials/cpp_concurrency_in_action/chapter08/listing_8.3.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// A parallel version of std::accumulate using std::packaged_task
// It's not thread-safe
//
///////////////////////////////////////////////////////////////////////////////
#include <algorithm>
#include <functional>
#include <future>
#i... | ALGO | 0.999782 | 7.197581 | {
"github_metadata": {
"branch": "master",
"commit_count": 95,
"repo_created_at": "2018-01-23T02:38: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": "37f36909e... |
3a7007d5-67b0-4440-aa5d-ba0cc5b537a1 | nguyennhatminh230801/CauTrucDLGT | Bài TH 7/BTH_Bai3.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAX 100
struct Stack {
int a[MAX];
int top;
};
Stack S;
void create(Stack &S) {
S.top = -1;
}
bool isEmpty(Stack S) {
return S.top == -1;
}
bool isFull(Stack S) {
return S.top == MAX - 1;
}
void push(Stack &S, int x) {
if (!isFull(S)) {
S.top++;
S.a... | ALGO | 0.999974 | 4.077807 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2021-03-07T04:41:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eff2b628be... |
5bdf42b5-8308-40cb-bf45-db7a80ae1704 | GuanLong-Zhang/design_pattern | design_pattern/13责任链模式.cpp | //责任链模式
//将请求的发送者和接收者进行解耦,并允许多个对象都有机会去处理这个请求
//每个处理器对象都包含对下一个处理器对象的引用,形成一个链条
#include <iostream>
#include <string>
// 抽象处理器
class Handler {
public:
virtual ~Handler() {}
virtual void handleRequest(const std::string& request) = 0; //纯虚函数
void setNextHandler(Handler* handler) {
nextHandler = handle... | ALGO | 0.931978 | 5.122629 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2024-08-17T12:54: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": "940d754547... |
a311b19f-0dea-4c0a-9c67-81c81fc0ed2e | DHimeka/CS2023_200222K | lab7_200222K/lab7_200222K.cpp | #include <iostream>
using namespace std;
struct node {
int key;
struct node *left, *right;
};
// Inorder traversal
void traverseInOrder(struct node *root) {
if (root == NULL) {
return;
}
traverseInOrder(root->left);
cout << root->key << " ";
traverseInOrder(root->right);
}
// Insert... | ALGO | 0.999631 | 5.363383 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-04-25T10:43: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": "4d02a48bee5... |
25bcdc52-8486-417b-ac27-658701d84083 | hashim-i222478/Algorithms | graph_average_degree.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <queue>
#include <stack>
#include <limits>
#include <chrono>
#include <algorithm>
#include <sstream>
#include <numeric>
using namespace std;
// Structure to represent a node in the graph
struct Node {
int id; // Original node ID
int in... | ALGO | 0.999648 | 6.965288 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-27T16:09: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": "3fa5b43b5fc7... |
401e0fc4-6f72-4d0e-801b-5161e22427c5 | josh-ramer/set-theory | magic-squares/tests.cpp | #include "min_cost_magic_square.hpp"
int main()
{
cout << "\nThese are the possible magic squares for this size square:\n";
// ofstream fout(getenv("OUTPUT_PATH"));
ifstream fin("input.txt");
vector<vector<int>> s(3);
for (int i = 0; i < 3; i++) {
s[i].resize(3);
for (int j = 0; ... | ALGO | 0.999745 | 5.043791 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-12-06T15:55: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": "a307599439... |
d00b9615-d499-4b37-aa5f-c5db2bbc7174 | Zhenye-Na/algo-for-data-analytics | assignments/assignment4/mp4/part1/Metropolis-Hastings.cpp | //
// main.cpp
// Multivariate Gaussian via Metropolis-Hastings
//
// IE531: Algorithms for Data Analytics mp4 part1
//
// <NAME> Apr 13, 2018
//
#include <iostream>
#include <iomanip>
#include <cmath>
#include <fstream>
#include <cstdlib>
#include <random>
#include <chrono>
#include <algorithm>
//Substitue the d... | ALGO | 0.997713 | 4.761885 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2018-01-27T22:18:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9099b4198... |
07d37378-fe7d-48d4-af5b-471ed9751384 | wisteria-soba/atcoder-solved | ABC/103/d.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(ll i = n;i >= 0;--i)
#define FOR(i,m,n) for(ll i = m, i##_len=(n);i <i##_len; ++i)
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmax(T& a, T b) { if ... | ALGO | 0.999969 | 3.571145 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-08-11T07:03: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": "96146b89cdf6... |
842da9a5-c017-4ac2-8aab-2efd1c76e82b | hemakesh-github/dsa | labrinth.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> labr(int n, int k) {
vector<int> ans;
if (k%2 == 0) {
for(int i = 0; i < n - 2;i++) {
ans.push_back(n-1);
}
ans.push_back(n);
ans.push_back(n-1);
} else {
for (int i = 0; i < n-1; i++) {
... | ALGO | 0.99993 | 4.229297 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-03-23T09:52:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5567c7d0280c... |
05665049-9fae-46fe-b2ab-c38f1813e127 | abeleinin/dsa | neetcode150/easy/21-Merge-Two-Sorted-Lists.cpp | #include <algorithm>
/**
* 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) {}
};
/**
* \c RecursiveSolution
*
* 1. Check for... | ALGO | 0.999984 | 6.836094 | {
"github_metadata": {
"branch": "main",
"commit_count": 235,
"repo_created_at": "2022-08-31T01:22: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": "dc53ecfa93... |
1d8772cc-9bf1-41a1-94cf-bd3f7cb04474 | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1236/all/29085640_62786087.cpp | #include<iostream>
#define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i)
#define rrep(i, start, end) for (int i = (int)start - 1; i >= end; --i)
#define arep(i, c) for (auto i = (c).begin(); i != (c).end(); ++i)
#define all(x) (x).begin(), (x).end()
using namespace std;
void solve() {
int A, B, C;... | ALGO | 0.999933 | 4.798764 | {
"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": "4c17bbc05... |
d98066df-addc-46cb-98ec-b97e0e0ba48a | gustavofadel/Exercises | URI/3312.cpp | # include <bits/stdc++.h>
using namespace std;
# define _ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
const int MAXLEN = 2e2 + 10;
int multiply (int x, int vet[], int len) {
int carry = 0;
for (int i = 0; i < len; i++) {
int prod = vet[i] * x + carry;
vet[i] = prod % 10; carry = ... | ALGO | 0.999803 | 4.3245 | {
"github_metadata": {
"branch": "main",
"commit_count": 209,
"repo_created_at": "2021-02-19T15:30:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac2ab83063... |
be43911a-e4aa-4b79-9c3b-bf21545f9193 | guyueguakenan/StudyProjects | Algorithm/InsertSort/InsertSort/main.cpp | #include <string>
#include <iostream>
using namespace std;
int g_input_data[] =
{
20,3,1,15,7,2,13
};
void PrintIntArray(const int* data,int data_size,bool is_print_marks=true)
{
string log_head("array:");
if (is_print_marks)
{
string log_begin(data_size,'+');
cout << log_head+log_begi... | ALGO | 0.999719 | 4.924938 | {
"github_metadata": {
"branch": "master",
"commit_count": 170,
"repo_created_at": "2016-08-02T06:28:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "856061bc... |
e7270dc6-1128-4060-b1ab-3a10633da836 | jinfanbo/nowcodecode | Find.cpp | #include<stdio.h>
#include<windows.h>
#include<vector>
using namespace std;
#define HEIGHT 5
#define WIDTH 5
class Solution1 {
public:
bool Find(vector<vector<int> > array,int target) {
int rowCount = array.size();
int colCount = array[0].size();
int i,j;
if(rowCount == 0||colCou... | ALGO | 0.997436 | 3.588084 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2018-07-16T04:00:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b3532163... |
4cc6d00b-f302-4fe1-893c-7ed07d6e06f5 | Will1364/Juno-project | interpolation_float/source_misc.cpp | #include "header.h"
//
// Various functions used for handling rotaion of image and lens correction.
// Text for header file:
/*
// Constants
const double pi = 3.14159265358979;
const int border_pad = 0; // Number of rows/columns removed (left side and top)
// Split image
pair<Mat, Mat> splitBinary(Mat img, ... | ALGO | 0.980823 | 4.174498 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2024-10-24T12:18:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af04064ecd5... |
20c4c2b4-1577-48fc-854b-2397deb88de1 | mansigarg-nith/Queue-DataStructures | queue.cpp | // queue implmentation as an array
#include <iostream>
using namespace std;
#define MAX 100
class Queue{
public:
int front, rear;
int arr[MAX];
Queue(){
front = -1;
rear = -1;
}
void createQueue();
void isEmpty();
void isFull();
void enqueue();
void dequeue();
void Front();
void Rear();
v... | ALGO | 0.999589 | 4.578489 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-01-17T08:01:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b781e80d714b... |
2d16b78b-1f3f-43a4-bd29-b8fdebf8f588 | wdeconinck/atlas | src/atlas/meshgenerator/detail/HealpixMeshGenerator.cc | /*
* (C) Copyright 2013 ECMWF.
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
* In applying this licence, ECMWF does not waive the privileges and immunities
* granted to it by virtue of its status as an intergo... | ALGO | 0.930349 | 6.247276 | {
"github_metadata": {
"branch": "develop",
"commit_count": 4377,
"repo_created_at": "2018-03-19T18:09:09.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "ecmwf/atlas",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id":... |
f41c4cba-f6c0-40d0-8b3b-8fc71d75bb98 | TimErr/IS228_C_Plus_Plus_Spring_2024 | Unit 2/week2discussionCode.cpp | #include <iostream>
/*originally had this function coded as just an int, but in playing with the program,
trying to do a factorial on any number above 12 gave garbage data. changed to an
unsigned long long int to adjust for this. now it can do factorial up to 20*/
// Function to calculate factorial
unsigned long l... | ALGO | 0.987202 | 4.266018 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-03-04T22:21: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": "12a79b112db... |
d32318cd-32da-4eac-98f8-4ea2e616c2d6 | Tuhin114/DSA-I | Lecture 5/Program-23.cpp | #include <iostream>
using namespace std;
int main()
{
int a = 4;
int b = 6;
// Bitwise operator
cout << " a&b " << (a & b) << endl;
cout << " a|b " << (a | b) << endl;
cout << " ~a " << (~a) << endl;
cout << " a^b " << (a ^ b) << endl;
// Right shift & left Shift
cout << (17 << 2) ... | ALGO | 0.923063 | 3.119982 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2023-11-08T11:04: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": "762366b626b... |
e7d04bd5-1e0c-46d0-88e1-25c61844b724 | RTMilliken/EDFbrowser | z_ratio_filter.cpp | /*
***************************************************************************
*
* Author: <NAME>
*
* Copyright (C) 2012, 2013 <NAME>
*
* <EMAIL>
*
***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of... | ALGO | 0.91204 | 5.004478 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2014-07-16T14:12:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 36,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed31d35... |
877ac3a0-f368-4871-8500-242208adb029 | trietvuive/CF_Practice | CodeForces/old/1467B.cpp | #include<bits/stdc++.h>
using namespace std;
int t, n, a[300005], k, s;
int f(int i) {
if (a[i] > a[i - 1] && a[i] > a[i + 1]) return 1;
if (a[i] < a[i - 1] && a[i] < a[i + 1]) return 1;
return 0;
}
int main() {
cin >> t;
while (t--) {
cin >> n; s = k = 0;
for (int i = 1; i <= n; ++i) cin >> a[i];
a[0] = a[... | ALGO | 0.999874 | 3.947959 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2021-06-30T22:40: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": "189179d0f51... |
8dbe6bcb-ce56-45f3-86c2-223c7bf69ab2 | raincross7/code-similarity | codes/train_code/problem330/problem330_359.cpp | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define TO_STRING(VariableName) # VariableName
#de... | ALGO | 0.999949 | 3.941252 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b1e64e8f533... |
3050e194-5fe4-4270-837c-d5626154ed79 | Lee-DongWon/Baekjoon_Problems | 2355.cpp | #include <iostream>
using namespace std;
long long sigma(long long, long long);
long long sigma2(long long, long long);
long long sigma3(long long, long long);
int main()
{
long long start, end;
long long ans;
cin >> start >> end;
long long tmp;
if (start > end) {
tmp = start;
start = end;
end = tmp;
}
... | ALGO | 0.999983 | 4.444526 | {
"github_metadata": {
"branch": "master",
"commit_count": 154,
"repo_created_at": "2019-07-23T04:07: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": "7fb9078a... |
03ff1df7-ac66-4b1c-b413-b1515f4ad1cc | hamdiademi/OOP | Labs/Lab_7/task_1.cpp | //
// Created by Hamdi on 5/3/2023.
//
#include<iostream>
#include<cstring>
using namespace std;
class Square{
protected:
double a;
public:
Square(double a=0.0){
this->a=a;
}
Square(const Square &other){
this->a=other.a;
}
double perimeter()const{
return a*4;
}
d... | ALGO | 0.947923 | 4.330884 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-06-29T20:55: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": "bb90de594457... |
a1f21150-2b4e-4e29-bc0d-afcf23f61f09 | Nilanjana02/DSA_C_C-_programe | single linked list.cpp | #include<stdio.h>
#include<stdlib.h>
struct node{
int data;
struct node* next;
};
int main()
{
struct node* create_list(void);
void display(struct node *start);
struct node* insert_f(struct node *start);
void insert_last(struct node *start);
struct node* insert_bf_i(struct node *start);
void insert_af_i(struct ... | ALGO | 0.999378 | 3.927457 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-08-15T11:53: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": "41845ca3fee0... |
cabc25e6-be8e-46f5-897d-d353a6b7c34e | YongjunZhao/liphe | tests/test_spirit_helib.cc | #include <iostream>
#include <string.h>
#include <helib_number.h>
#include <eq.h>
#include <binomial_tournament.h>
#include <first_non_zero.h>
#include "test_spirit_framework.h"
int main(int argc, char**argv) {
HelibKeys keys;
int size = 0;
// int L = 20;
int L = 500;
for (int argc_i = 0; argc_i < argc; ++argc... | TEST | 0.989078 | 3.623295 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-11-12T10:02: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": "a1424a1ef4... |
1029fcfd-36ee-4f53-8af8-d622c2624b95 | chris-1987/lookup | code/src/tree/mptree.h | #ifndef _MPT_H
#define _MPT_H
///////////////////////////////////////////////////////////////////////////////////////////////
/// Copyright (c) 2016, Sun Yat-sen University
/// All rights reserved
/// \file mptree.h
/// \brief definition of multi-prefix tree
///
/// Build, insert and delete prefixes in a multi-bit tre... | ALGO | 0.998175 | 4.364768 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2016-10-20T14:17: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": "bb80f6230... |
d1d5f0a2-c8f6-4cbe-bb5f-6664da0e9f77 | Abhinay-bir-17/a2z_dsa | step4_binarySearch/5_finding_peak_el.cpp | // naive soln: linear search
int findPeakElement(vector<int> &ar) {
// Write your code here
int n = ar.size();
if (n == 1)return 0;
else if (ar[0] > ar[1]) {
return 0;
}
else if (ar[n - 1] > ar[n - 2])return n - 1;
else {
for (int i = 1; i < n - 1; i++) {
if (ar[i] > ar[i - 1] && ar[i] > ar[i + 1]) {
... | ALGO | 0.999828 | 4.848312 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2023-09-17T09:05: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": "71373ae4554... |
e59764e4-ddf5-4a86-b5aa-a53fcc00ea98 | pablopalou/ICPC | fraizen/C++/simulacrosICPC/NWERC2022/c.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fr(a,b) for(int i = a; i<b; i++)
#define rep(i,a,b) for(int i = a; i<b; i++)
#define fre(s) for(auto e:s)
#define cout(x) cout << x << "\n";
ll n;
#define eps 1e-12
typedef long double ld;
ld dist(ll x, ll y){
return sqrt(x*x + y*y);
}
ll... | ALGO | 0.999786 | 3.92129 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-10-02T22:43:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df7db4c033e... |
1a1f6c1d-458d-4292-8d80-65d63cc7c932 | theVCS/websites_solutions | codeforces/cpp/1108B.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
#define REP(i, a, b) for (int i = a; i < b; i++)
#define maxN 1000001
//int dx[] = {-2, -1, 1, 2, 2, 1, -1, -2};
//int dy[] = {1, 2, 2, 1, -1, -2, -2, -1};
//int dx[] = {-1, 0, 1, 0, 1, -1, 1, -1};
//int dy[] = {0, -1, 0, 1, -... | ALGO | 0.999966 | 3.545134 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2020-10-14T11:50: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": "24ca4f012... |
613e242e-8993-400f-8a49-1e5a9f539cba | googleprojectzero/functionsimsearch | tools/matchfunctionsfromindex.cpp | // Copyright 2017 Google Inc. All Rights Reserved.
//
// 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... | TOOL | 0.950113 | 7.002041 | {
"github_metadata": {
"branch": "master",
"commit_count": 367,
"repo_created_at": "2017-06-16T12:28:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 562,
"forks": 96,
"issues": 10,
"pull_requests": 2
},
"file_meta": {
"content_id": "84ded... |
f1cc00de-a7a9-43ea-be81-4fc357aea8ad | ajaayc/CodingProblems | ctci/15_threads_and_locks/15.7_fizzbuzz/main.cpp | #include <iostream>
#include <iomanip>
#include <queue>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <chrono>
using namespace std;
#define THREE 3
#define FIVE 5
#define FIFTEEN 15
std::mutex m1;
std::queue<unsigned> numbers3Check;
std::condition_variable_any cv1;
std::mutex m2;
std::qu... | ALGO | 0.982623 | 5.764602 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2019-09-21T17: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": "c15539c74... |
9a2d90a4-f51a-40a2-a971-b061a0aecc5a | v14dt20/Labs_PSTU_2021-2022 | kmp/main.cpp | #include <iostream>
using namespace std;
// Функция для реализации алгоритма KMP
void KMP(string text, string pattern)
{
int m = text.length();
int n = pattern.length();
// если шаблон это пустая строка
if (n == 0)
{
cout << "The pattern occurs with shift 0";
return;
}
... | ALGO | 0.999956 | 5.589482 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2022-03-10T09:33: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": "0ce60ceaf78... |
8caf1c3e-75c4-426c-b42a-64f6c360b87a | TheoShah04/FPGA_Accelerator | maths-accelerator/rayMarcher/C/rayMarcher.h | #ifndef RAYMARCHER_H
#define RAYMARCHER_H
class vec3 {
public:
float x, y, z;
vec3(float x_, float y_, float z_);
vec3 addition(const vec3& other) const;
vec3 subtraction(const vec3& other) const;
vec3 scalarMul(float mul) const;
float length() const;
vec3 normalise() const;
vec3 abs() ... | ALGO | 0.942881 | 3.718345 | {
"github_metadata": {
"branch": "main",
"commit_count": 673,
"repo_created_at": "2025-05-23T21:32:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81f01e0934... |
d7043f04-9b1d-44cf-8f8c-4dcd9be578ad | shuxiangguo/sxg_leetcode | 605.种花问题.cpp | /*
* @lc app=leetcode.cn id=605 lang=cpp
*
* [605] 种花问题
*
* https://leetcode-cn.com/problems/can-place-flowers/description/
*
* algorithms
* Easy (30.32%)
* Likes: 96
* Dislikes: 0
* Total Accepted: 14.5K
* Total Submissions: 47.3K
* Testcase Example: '[1,0,0,0,1]\n1'
*
* 假设你有一个很长的花坛,一部分地块种植了花,另一部... | ALGO | 0.999985 | 6.024044 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2019-09-22T18:10: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": "935cc74fa... |
140e9928-15ec-4161-97ea-b0e0d2e1bbae | sak5010/PNU_Algorithm_2020 | station_assistant_white.cpp | #include <bits/stdc++.h>
using namespace std;
// epsilon
const double GAP = 0.0001;
vector <double> A(3);
vector <double> B(3);
vector <double> P(3);
double ans = 1e9;
double calc(const vector <double>& P1, const vector <double>& P2) {
double ret = 0;
for(int i=0; i<3; ++i)
ret += (P1[i] - P2[i]) * (P1[i] - P2[i... | ALGO | 0.999503 | 4.175527 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-03-02T09:53: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": "003187dbfb... |
d41ac52f-fd48-4012-87aa-d49dbd35f3d0 | EliahKagan/old-practice-snapshot | main/compute-primes/compute-primes.cpp | #include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
namespace {
basic_string<bool> make_sieve(const int bound) noexcept
{
basic_string<bool> known_composite (bound + 1, false);
const auto imax = static_cast<int>(sqrt(bound));
for (auto... | ALGO | 0.999907 | 5.040873 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2021-08-17T05:25: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": "7fbafd6f066... |
d2249e8e-0c9a-4649-8e41-7f9cf2af0b5d | e1810/kyopro | ac/abc172/abc172_c/14742744.cpp | #pragma target("avx")
#pragma optimize("O3")
#include<bits/stdc++.h>
using ll = int_fast64_t;
using P = std::pair<ll,ll>;
using PP = std::pair<ll,P>;
using V = std::vector<ll>;
template<typename T> using pq = std::priority_queue<T>;
template<typename T> using rpq = std::priority_queue<T, std::vector<T>, std::greater<T>... | ALGO | 0.999983 | 3.326154 | {
"github_metadata": {
"branch": "master",
"commit_count": 1888,
"repo_created_at": "2020-04-02T07: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": "32be53e... |
3280a78f-089d-4415-9772-9f72e16f7e70 | nazmul-islam00/solutions | LeetCode_ProblemSet/Problem2658.cpp | #include <vector>
#include <queue>
#include <functional>
#include <algorithm>
class Solution {
private:
std::vector<int> changeX = {-1, 1, 0, 0};
std::vector<int> changeY = {0, 0, -1, 1};
public:
int findMaxFish(std::vector<std::vector<int>>& grid) {
int maxFishCount = 0;
for (in... | ALGO | 0.999755 | 6.275303 | {
"github_metadata": {
"branch": "master",
"commit_count": 461,
"repo_created_at": "2024-04-13T13:17: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": "b021a2d6... |
0d4dc7d5-73e7-4b25-894b-434ec3480f73 | KnightWXW/Algo-CPP | PrefixSum/StrongestSignalPosition.cpp | #include <stdio.h>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <unordered_map>
#include <algorithm>
using namespace std;
// Huawei: 最强信号位置
// 有若干个信号塔,沿东西方向排列成一条直线,位置从 0 开始,
// 信号塔可以向东或者向西方向发射信号,信号强度是1个信号单位,
// 假设信号塔发射的信号不会衰减,
// 现给出N组信号塔的位置和信号发射的方向。
// 计算直线上的哪个位置信号最强。... | ALGO | 0.999989 | 4.363517 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2022-07-30T13:34:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "37efaf6c2... |
76fc0b75-5007-4f2e-b5e3-a8a07f0955c9 | tetat/Codeforces-Problems-Sol | Difficulty1000/626A.cpp | /// Problem Name: Robot Sequence
/// Problem Link: https://codeforces.com/problemset/problem/626/A
/**
* winners never quit
**/
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef long long Long;
const int N = 1e6;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);... | ALGO | 0.999908 | 4.145394 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2021-05-21T17:12: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": "51eab5df429... |
11ddd151-4740-4773-abb9-2068f0ba8988 | aakashverse/cpp | BINARY SEARCH on answer/FindNthRootOfNumber.cpp | #include<bits/stdc++.h>
using namespace std;
int power(int n,int x,int m){
long long res = 1;
for(int i=0;i<n;i++){
res *= x;
if(res > m) return 2; // exceeds m
}
if(res == m) return 1; // exactly m
return 0; // otherwise
}
int Nt... | ALGO | 0.99999 | 4.322064 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2024-10-26T13:26: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": "6f109e578dc... |
59359169-dd26-4506-921a-edea0d9a139a | jtrfid/C-Repositories | 2017/C语言课程设计/提交报告/15040210019李长泽/elevator.cpp | #include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "ElevatorLib.h"
/**********************************************
* Idle状态,电梯停止在某楼层,门是关闭的,处于静止状态,等待相关事件的发生,从而转换到下一个状态。
**********************************************/
void StateIdle(int *state)
{
int floor;
bool up;
floor = IdleW... | ALGO | 0.974605 | 3.912997 | {
"github_metadata": {
"branch": "master",
"commit_count": 275,
"repo_created_at": "2015-07-07T14:48: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": "7a2db013... |
210d3c25-818e-40e9-aa00-2d32e1c8341e | Prathamesshh/Leetcode-Files | 2359. Find Closest Node to Given Two Nodes.cpp | /*
You are given a directed graph of n nodes numbered from 0 to n - 1, where each node has at most one outgoing edge.
The graph is represented with a given 0-indexed array edges of size n, indicating that there is a directed edge from node i to node edges[i]. If there is no outgoing edge from i, then edges[i] == -1.
... | ALGO | 0.999996 | 5.764968 | {
"github_metadata": {
"branch": "main",
"commit_count": 162,
"repo_created_at": "2025-01-31T15:34:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f375a1ede... |
73f91579-1997-46ea-aa1e-dc9d674d978b | breno-helf/Maratona | Done/Codeforces/189/C.cpp | //This code was written by <NAME>, Codeforces Handle: Brelf
//From University of São Paulo - USP
//If you are trying to hack me I wish you can get it, Good Luck :D
#include <bits/stdc++.h>
using namespace std;
#define debug(args...) fprintf (stderr,args)
#define pb push_back
#define mp make_pair
typedef long long ll;... | ALGO | 0.99997 | 3.257233 | {
"github_metadata": {
"branch": "master",
"commit_count": 235,
"repo_created_at": "2016-04-29T20:54:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34e8ae81... |
783ed5b3-935c-4208-a6a0-45b1a4e77afa | Gespinoza10/Pointers-Vectors-Allocated-Memory | main.cpp | /******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
******************************************... | DATA | 0.98315 | 5.735345 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-05-15T15:48: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": "10e8c375cfe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.