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 |
|---|---|---|---|---|---|---|---|
691b9caa-f78e-43c9-99e6-7b68bba560d1 | ninghang/bayesianPlay | cpplapack-2005_03_25/include/drovector-/drovector-calc.hpp | //=============================================================================
/*! return a transposed column vector */
inline _dcovector t(const drovector& rovec)
{
#ifdef CPPL_VERBOSE
std::cerr << "# [MARK] t(const drovector&)"
<< std::endl;
#endif//CPPL_VERBOSE
dcovector covec(rovec.L);
dcopy_... | TOOL | 0.940396 | 5.659653 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2012-08-17T20:48: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": "6b684d299... |
ee56a198-09c2-4962-b427-42bb0399ff65 | Janos95/Phasefields | Viewer/Bvh.cpp | //
// Created by janos on 10/11/20.
//
#include "Bvh.h"
#include "Mesh.h"
#include <bvh/bvh.hpp>
#include <bvh/vector.hpp>
#include <bvh/triangle.hpp>
#include <bvh/ray.hpp>
#include <bvh/sweep_sah_builder.hpp>
#include <bvh/single_ray_traverser.hpp>
#include <bvh/primitive_intersectors.hpp>
using Triangle = bvh::Tr... | ALGO | 0.997197 | 6.27141 | {
"github_metadata": {
"branch": "master",
"commit_count": 96,
"repo_created_at": "2020-12-15T17:39:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 19,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ff63b6e... |
0f3b06fd-404d-4c63-8d90-cb1294c85fac | hmnguyen1067/Coursework-Projects | UCSD/PHYS244/LUDecompositionTestsWithJobScripts/luDecomSerial.cpp | #include <iostream>
#include <chrono>
#include <omp.h>
using namespace std;
using namespace std::chrono;
double A[STEPS][STEPS];
double L[STEPS][STEPS];
double U[STEPS][STEPS];
int main(){
//omp_set_num_threads(THREAD_NUM);
/* Set the random seed */
srand(time(NULL));
/* Initialize the matrix rando... | ALGO | 0.999766 | 5.276176 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-03-20T00:24: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": "184832f4aa... |
44467fca-7de7-4dd1-9ca5-c50332dd32a1 | better-call-vee/Cpp-programming | Graph Grid Traversal Problem Labyrinth.cpp | /**
╔═══╦═══╦═══╗
║ ║ M ║ x ║
╠═══╬═══╬═══╣
║ ║ x ║ x ║
╠═══╬═══╬═══╣
║ ║ ║ F ║
╚═══╩═══╩═══╝
M wants to reach F. x are the main obstacles here. M can only go left right
up down.
Think the grid as a graph. the x nodes will be removed and the other will remain.
we will bfs it by going up down right left and chec... | ALGO | 0.999967 | 4.07303 | {
"github_metadata": {
"branch": "main",
"commit_count": 177,
"repo_created_at": "2023-02-22T10:14: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": "fa60e08fd8... |
ff74356b-aa02-4200-95b9-b861b1e8c7ae | Veljko28/cpp-data-algrtms | codeforces/MexMaster.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <iterator>
#include <numeric>
#include <string>
#include <cstring>
#include <ctime>
#include <set>
#include <list>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <unordered_map>
#include <queue>
#include... | ALGO | 0.99988 | 4.003697 | {
"github_metadata": {
"branch": "master",
"commit_count": 2176,
"repo_created_at": "2021-06-11T09:14:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2843b19... |
50d78c00-5530-43c7-94c3-d803b000e668 | Exawind/nalu-wind | include/wind_energy/ABLSrcInterp.h | // Copyright 2017 National Technology & Engineering Solutions of Sandia, LLC
// (NTESS), National Renewable Energy Laboratory, University of Texas Austin,
// Northwest Research Associates. Under the terms of Contract DE-NA0003525
// with NTESS, the U.S. Government retains certain rights in this software.
//
// This sof... | ALGO | 0.989762 | 7.129816 | {
"github_metadata": {
"branch": "master",
"commit_count": 2492,
"repo_created_at": "2018-05-03T15:39:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 137,
"forks": 93,
"issues": 18,
"pull_requests": 7
},
"file_meta": {
"content_id": "9a1a... |
e1eba1b8-3d39-4d69-b8c3-1fa6335b705e | Domain-Cmap/assignments-day-1-to-day-9-thegolden001 | day3/medium/p3.cpp | #include <iostream>
#include <vector>
using namespace std;
bool predictTheWinner(vector<int>& nums) {
int n = nums.size();
vector<vector<int>> dp(n, vector<int>(n, 0));
for (int len = 1; len <= n; len++) {
for (int i = 0; i + len - 1 < n; i++) {
int j = i + len - 1;
if (len ... | ALGO | 0.999994 | 5.519024 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-01-01T06:51:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7450a514e519... |
7d11e4d8-f89d-4cf8-9e25-3088e3fc7ed9 | wisdompeak/LeetCode | LCCUP/2020Fall/LCP23.魔术排列/code.cpp | class Solution {
public:
bool isMagic(vector<int>& target)
{
int n = target.size();
vector<int>temp;
for (int i=2; i<=n; i+=2)
temp.push_back(i);
for (int i=1; i<=n; i+=2)
temp.push_back(i);
int k = 0;
for (int i=0; i<targ... | ALGO | 0.999821 | 5.061256 | {
"github_metadata": {
"branch": "master",
"commit_count": 8912,
"repo_created_at": "2017-03-01T10:30:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6018,
"forks": 1314,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "a... |
7cc12403-0e8b-4d07-9455-f79c80ba4109 | kamyu104/LeetCode-Solutions | C++/number-of-distinct-islands-ii.cpp | // Time: O((m * n) * log(m * n))
// Space: O(m * n)
class Solution {
public:
int numDistinctIslands2(vector<vector<int>>& grid) {
unordered_set<vector<pair<int, int>>, VectorHash> islands;
for (int i = 0; i < grid.size(); ++i) {
for (int j = 0; j < grid[i].size(); ++j) {
... | ALGO | 0.999943 | 6.544214 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
cd07645b-4698-4a8e-a506-af3f9700d252 | DangerousCactus/BOJ | movement.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef complex<double> C;
typedef vector<double> vd;
void fft(vector<C>& a) {
int ... | ALGO | 0.999988 | 3.88503 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-10-04T02:53: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": "b210f31bf5... |
8b06f186-6f94-41fc-b490-ea7f45ff463f | gengyouchen/leetcode | wiggle-sort-ii/three-way-partition-solution.cpp | class Solution {
private:
enum Color { RED = 0, WHITE = 1, BLUE = 2 };
public:
/* time: O(n), space: O(1) auxiliary (i.e. does not count input & output itself) */
void wiggleSort(vector<int>& nums) {
const int n = nums.size();
const auto mid = nums.begin() + n / 2;
nth_element(nums.begin(), mid, nums.end());
... | ALGO | 0.999996 | 6.070076 | {
"github_metadata": {
"branch": "master",
"commit_count": 1002,
"repo_created_at": "2018-07-28T17:57:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fff65f0... |
fe29c71d-d961-4b9b-8c53-d0d0c249fac7 | jack-slingsby/Peano-Fork | src/exahype2/fv/Generic.cpp | #include "Generic.h"
#include "tarch/logging/Log.h"
#include "tarch/multicore/multicore.h"
#include "../PatchUtils.h"
#include "peano4/utils/Loop.h"
#include "exahype2/NonCriticalAssertions.h"
// This is a fantastic hack
#if defined(OpenMPGPUOffloading)
namespace std
{
#pragma omp declare target
void __throw_bad_f... | ALGO | 0.959802 | 5.22626 | {
"github_metadata": {
"branch": "main",
"commit_count": 7515,
"repo_created_at": "2021-11-23T15:42: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": "60f751a99... |
b8db76fb-c2c8-46bd-9683-01526bc52414 | CGAL/cgal | Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/Disk_samplers.h | // Copyright (c) 2014 GeometryFactory Sarl (France).
// 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>
#ifndef CGAL_SURFACE_MESH_SEGMENTATION_DISK_SAMPLERS_H
#define CGAL_SURFA... | ALGO | 0.973604 | 6.317299 | {
"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... |
3b6067c5-9a99-4f20-9b6b-bfd7460fee27 | tereshinvs/ACM | Codeforces/113 - 2/B.cpp | #include <stdio.h>
long long x[100000], y[100000];
long long square;
int n;
long long get_square(long long x1, long long y1, long long x2, long long y2) {
return x1 * y2 - y1 * x2;
}
bool inside(long long tx, long long ty) {
long long tsq = 0;
for (int i = 1; i < n; i++) {
long long temp = get_square(x[i] - tx,... | ALGO | 0.999981 | 3.962243 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-11-13T09:45: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": "f6579f78a3... |
6d8694a8-3191-43f6-9510-7230e793d3f5 | oscarjgv24/LaguerreMPC | MPC Class/Laguerre_MPC.cpp | #include "Laguerre_MPC.h"
static void mldivide(const float A[4], const float B[100], float Y[100]);
static void mldivide(const float A[4], const float B[100], float Y[100])
{
int r1;
int r2;
float a21;
float a22;
int k;
if ((float)fabs(A[1]) > (float)fabs(A[0])) {
r1 = 1;
r2 = 0;
} else {
r1 ... | ALGO | 0.999464 | 4.217659 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-04-01T07:55:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e51eca77b4... |
18063c19-dfae-4cfb-b284-6ca3987bdf96 | purnimakumarr/ducscode-bsc | data-structures-1/queue_using_stack(enqueue).cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
class QueueUsingStack
{
struct node
{
int data;
node *next;
}*top, *temp;
public:
QueueUsingStack();
~QueueUsingStack();
void enqueue(QueueUsingStack&, int);
int dequeue();
void display();
void push(int);
... | ALGO | 0.994607 | 3.965528 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-07-20T06:16:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2e0cfa11062... |
50b6f6f6-6f10-4639-b70d-bc822440a771 | m1xter/sorting-algoritms-c- | mezcla directa/mezcla_directa.cpp | #include <iostream>
#include <vector>
using namespace std;
void imprimirArreglo(vector<int>&arreglo){
for(int i =0;i< arreglo.size();i++){
cout<< arreglo[i] <<" ";
}
cout<<endl;
}
void merge(vector<int>&arreglo,int inicio,int mitad, int final){
int i,j,k;
int elementosIzq = mitad - inicio+1; // esta es la ... | ALGO | 0.999872 | 5.292941 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-05-14T15:51: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": "6d380b3d6606... |
9ed8ea5c-584c-4f9d-a745-a1868390f002 | vinhqngo5/Cuckoo_Heavy_Keeper | src/frequency_estimator/CountMinSketch.hpp | #pragma once
#include "frequency_estimator/FrequencyEstimatorBase.hpp"
#include "frequency_estimator/FrequencyEstimatorConfig.hpp"
#include <algorithm>
#include <cmath>
#include <ctime>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <string>
class CountMinSketch : public Frequenc... | ALGO | 0.948088 | 6.981148 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2024-11-27T21:29:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c81bfb2badc... |
deb02c3c-3ee3-4f57-ba9d-93d70d640e74 | eahenle/NSE599-W21-HW1 | hw2/openmp.cpp | #include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <math.h>
#include <vector>
#include "common.h"
#include "omp.h"
int main(int argc, char **argv)
{
int navg, nabsavg=0, numthreads;
double dmin, absmin=1.0, davg, absavg=0.0;
if(find_option(argc, argv, "-h") >= 0)
{
printf("Opt... | ALGO | 0.999635 | 5.427689 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2021-01-27T18:29: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": "efc6c5ca2... |
52692240-2b70-43c2-87a8-994f25c5c5a9 | ShaharMoalem/Cache-Simulator | cacheSim.cpp | #include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <cmath>
#include <vector>
#include <list>
using std::FILE;
using std::string;
using std::cout;
using std::endl;
using std::cerr;
using std::ifstream;
using std::stringstream;
using std::vector;
using std::list;
using std::prev;
cla... | TOOL | 0.914928 | 4.184899 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-09-17T12:38: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": "1b7cb0edff1b... |
ef4988e3-692c-4e18-aee9-49274b476373 | roshihie/At_Coder | ABC_C/ABC150_C_CountOrder.cpp | #include <bits/stdc++.h>
using namespace std;
void input(vector<int>& rvnSeqP, vector<int>& rvnSeqQ)
{
int nSeqSiz;
cin >> nSeqSiz;
rvnSeqP.resize(nSeqSiz);
rvnSeqQ.resize(nSeqSiz);
for (int& rnSeqP : rvnSeqP)
cin >> rnSeqP;
for (int& rnSeqQ : rvnSeqQ)
cin >> rnSeqQ;
}
int calcDiffOrderCnt(cons... | ALGO | 0.999966 | 4.095161 | {
"github_metadata": {
"branch": "master",
"commit_count": 465,
"repo_created_at": "2019-11-17T06:24: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": "0724e86d... |
cf8b5079-b95d-4b27-8b00-56933c63f25f | BobIsOnFire/contest-solutions | timus/timus-1650.cpp | #include <bits/stdc++.h>
#include <map>
#include <set>
#include <string>
using namespace std;
struct city {
unsigned long long wealth;
unsigned int days;
};
struct person {
unsigned long long wealth;
city* location;
};
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N;
cin >> N;
map<stri... | ALGO | 0.999939 | 3.995092 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2021-09-30T21:29: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": "c7be2fc8e46... |
48c6d4b0-f1d8-4a6a-a69a-22633132a8fc | SolankiYogesh/Learning-C- | LoginSystem.cpp | #include <stdio.h>
#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;
struct User
{
string username;
string password;
};
int checkIsLogin(string username, string password)
{
ifstream file("users.txt");
int status;
if (file)
{
string line;
while (ge... | TOOL | 0.900819 | 3.741828 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-05-30T10:24: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": "ee1517147165... |
a2560589-e8bc-4426-85a9-6c96a3ad968e | Hayoun01/cpp-journey | caesar_cipher.cpp | #include <iostream>
using namespace std;
string caesarCipher(string phrase, bool encrypt, int shift);
string encryption(string phrase, int shift);
string decryption(string phrase, int shift);
void upper(string &phrase);
int main(void)
{
string phrase;
char choice;
int shift;
cout << "Enter a phrase: ... | ALGO | 0.9867 | 4.507796 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-12-07T16:09: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": "ced6b5c90bfd... |
3f505f2c-fc63-4010-8c1f-2a8b90c8f794 | KMsojib/Competitive-Programming | AtCoder/C_Count_ABC_Again.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define nline '\n'
void solve()
{
int n, q;
cin >> n >> q;
string s;
cin >> s;
int tot = 0;
for (int i = 0; i < n - 2; i++)
{
if (s.substr(i, 3) == "ABC")
{
tot++;
}
... | ALGO | 0.9996 | 4.213319 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2024-09-19T18:19:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "864f1779e38... |
b4784ba8-2eb3-4ff4-a9bd-d48b9668dc13 | jonataseduardo/BayesianSociety | Hist/HistMaster.cpp | #include <stdio.h>
#include <gsl/gsl_histogram.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_blas.h>
#include <gsl/gsl_statistics.h>
#include "../SCR/Struct.hpp"
#include "../SCR/StartGslRngSeed.hpp"
#include "../SCR/StartStrOnline.hpp"
#include "../SCR/DestroyStrOnline.hpp"
#include "../SCR/GenesisMaster.hpp"
#include... | ALGO | 0.991883 | 3.828932 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2013-11-26T21:45: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": "8431a9abb... |
c1367b53-5548-444d-92a3-f220121d5948 | dongpy78/Code_C_C- | BaiTapMang1Chieu/sonhonhat.cpp | /*
Cho mảng số nguyên A[] gồm N phần tử, hãy đếm xem trong mảng của bạn có bao nhiêu số có
cùng giá trị nhỏ nhất. Ví dụ mảng A = {1, 2, 1, 3, 5} thì số nhỏ nhất trong mảng là 1
xuất hiện 2 lần
INPUT
5
-854 600 222 472 207
OUTPUT
1
*/
#include <iostream>
#include <cmath>
using namespace std;
int main() {
system("c... | ALGO | 0.999877 | 4.535796 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2022-11-28T11:52: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": "2bd479fc6... |
59961b4e-0911-49f8-a88f-3761c195aa1d | SNbappy/CP-Vault | A_Robin_Helps.cpp | /*
بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيْمِ
Author: Depressed_C0der
Created: 2024-09-21 20:45:42
*/
#include <bits/stdc++.h>
using namespace std;
#define tst \
int t; \
cin >> t; \
while (t--)
#define el '\n'
#define yes cout << "YES" << el
#define no cout << "NO" << el
#define ll long long
#define Depr... | ALGO | 0.999971 | 5.362814 | {
"github_metadata": {
"branch": "main",
"commit_count": 223,
"repo_created_at": "2025-02-09T15:36:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b4ed3a8d4... |
b4d549e5-dde7-4f8c-907d-5b5ae97e0ba1 | farukshin/e-olymp | 10000-10999/10455/10455.cpp | // https://www.e-olymp.com/ru/problems/10455
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
void solve()
{
int n, q;
scanf("%d %d", &n, &q);
set<int> ans;
ans.insert(0);
set<int> del;
del.insert(-1);
del.insert(n);
for(int i = 0; i < q; i++... | ALGO | 0.999042 | 3.875337 | {
"github_metadata": {
"branch": "master",
"commit_count": 293,
"repo_created_at": "2020-05-09T06:07:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a934e621... |
0d071e4c-a81a-4b12-8b21-991438b593f9 | adrianpoplesanu/personal-work | cpp/problems/algorithms/single_linked_list2.cpp | #include <iostream>
template<typename T>
struct Node {
T data;
Node<T>* next;
};
template<typename T>
class SingleLinkedList {
private:
Node<T>* head;
Node<T>* tail;
int size;
public:
SingleLinkedList() {
size = 0;
}
~SingleLinkedList() {
Node<T>* current;
whil... | ALGO | 0.99207 | 5.875905 | {
"github_metadata": {
"branch": "master",
"commit_count": 2704,
"repo_created_at": "2017-11-03T23:36:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "729b366... |
124d6759-055b-481e-9e44-117e0e6dca81 | dl8sd11/online-judge | 0contest/CF_1280/pC.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<double,double> pdd;
#define SQ(i) ((i)*(i))
#define MEM(a, b) memset(a, (b), sizeof(a))
#define SZ(i) int(i.size())
#define FOR(i, ... | ALGO | 0.999955 | 3.826977 | {
"github_metadata": {
"branch": "master",
"commit_count": 332,
"repo_created_at": "2017-11-19T05:47:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ffa1a7a... |
84eb3311-a417-4eee-9262-a279af9d450d | lyubogankov/book_programming_principles_and_practice_using_cpp | ch06_writing_a_program/exercise_07.cpp | /*
7. Write a grammar for bitwise logical expressions.
A bitwise logical expression is much like an arithmetic expression except that the operators are
! (not), ~ (complement), & (and), | (or), and ^ (exclusive or).
Each operator does its operation to each bit of its integer operands (see §25.5). ... | ALGO | 0.995169 | 6.584257 | {
"github_metadata": {
"branch": "trunk",
"commit_count": 212,
"repo_created_at": "2022-10-19T03:14: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": "111856abd... |
e8a9e56c-b2af-454b-900e-c7a44b8065c4 | Xilinx/merlin-compiler | trunk/regression_test/test_case/test_cases_unit/final_code_gen/check_conflict_kernel_name2/ref_rose___merlinwrapper_begin.cpp | //(C) Copyright 2016-2021 Xilinx, Inc.
//All Rights Reserved.
//
//Licensed to the Apache Software Foundation (ASF) under one
//or more contributor license agreements. See the NOTICE file
//distributed with this work for additional information
//regarding copyright ownership. The ASF licenses this file
//to you under... | ALGO | 0.977437 | 3.308896 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2021-08-03T08:55:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 58,
"forks": 17,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d3495f96a... |
25db7067-87e2-46f0-8b2f-67deec2a00f6 | ishandutta2007/codeforces-c | cheissmart/normal/1559/B.cpp | #include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef ... | ALGO | 0.999924 | 4.111903 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17: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": "adf76c60490b... |
9ba7ec80-fde4-409b-ae57-bfe2569dad98 | PelleJuul/yaybahar | source/plate.cpp | #include "plate.h"
#include <vector>
#include <stdio.h>
#define p2(x) (x * x)
Plate::Plate(int width, int height, float h, int sampleRate) :
u(width * height, 0),
up(width * height, 0),
un(width * height, 0)
{
this->width = width;
this->height = height;
this->h = h;
this->k = 1.0 / samp... | ALGO | 0.998718 | 4.979222 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2020-01-05T16:36:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c0bd01cdf... |
eb2459e0-ef00-4e61-ba20-0fdde0fbbc84 | Rohit-8/Leetcode | 1754-largest-merge-of-two-strings/1754-largest-merge-of-two-strings.cpp | class Solution {
public:
string largestMerge(string s, string t) {
string ans = "";
int i = 0, j = 0;
for(; i < s.size() and j < t.size(); ){
if(s[i] > t[j]) ans += s[i++];
else if(t[j] > s[i]) ans += t[j++];
else {
int k = i +... | ALGO | 0.999981 | 5.39732 | {
"github_metadata": {
"branch": "main",
"commit_count": 2195,
"repo_created_at": "2022-06-26T18:05:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ccedcead0... |
94e2289d-cac7-4cd3-b417-7481df7e8ea4 | dennens/aoc_2022 | Day4.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include "Day4_Input.h"
namespace Day4
{
struct Range
{
int min;
int max;
void parse(std::string& string)
{
std::stringstream stream(string);
stream >> min;
stream >> max;
max *= -1; // undo the '-' used to indicate rang... | ALGO | 0.998611 | 5.206464 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-12-08T23:18:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b01f078f22... |
9a11cf94-0c97-42ef-a0ae-e97192dcc3fb | Sai-Nithya-7/data-structures | lab3.cpp | // Program to implement list ADT using array
#include<iostream>
using namespace std;
class list_adt {
private:
int current;
int list[5];
public:
list_adt() {
current = -1;
for (int i=0;i<5;i++) {
list[i] = 0;
}
}
void insert_beginning(int);
void insert_end(int);
v... | ALGO | 0.999502 | 5.557522 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-04-26T13:47:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da70ab363f92... |
529fbcb0-322e-4150-aed1-44a068efcbf5 | b21quocbao/Competitive-Programming | cf1101e.cpp | #include <bits/stdc++.h>
#define fn "test"
#define fn1 ""
using namespace std;
const int mn = 1 * (int)(1e5) + 10;
const int mod = 1 * (int)(1e9) + 7;
const int mm = 1 * (int)(1e3) + 10;
const int base = 1 * (int)(1e9);
const bool aNs = 0;
int tt, ntest = 1;
void docfile()
{
ios::sync_with_stdio(false);
ci... | ALGO | 0.999986 | 3.914621 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-02-22T14:52: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": "3594acc9c1... |
87fabb2b-efb3-4351-86d4-b1eb885d3795 | callmewenhao/AcWing | 2023夏季每日一题(完结)/week2/4672.cpp | /*
@File : 4672.cpp
@Author : wenhao
@Time : 2023/6/23 22:08
@LC :
*/
#include <iostream>
#include <string>
#include <algorithm>
#include <numeric>
using namespace std;
const int N = 1010;
string C[N];
int D[N], U[N];
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr), cout.tie(nullptr);... | ALGO | 0.999846 | 5.411253 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2023-07-21T03:12:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bcf079dad0... |
79214f10-9f01-472d-a99b-858b5ab1a027 | ishandutta2007/codeforces-o | onionpringles/normal/799/E.cpp | #pragma warning(disable:4996)
#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <cmath>
#include <map>
#include <set>
#include <queue>
#include <complex>
#include <iterator>
#include <random>
#include <t... | ALGO | 0.999886 | 3.332968 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:45: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": "f05663213002... |
7b3f23c2-e105-4dbd-85b6-580bddfd574a | AdrianSiwiec/Perfect-Graphs | code/src/jewels.cpp | #include "jewels.h"
#include <set>
#include "commons.h"
bool isJewel(const Graph &G, const vec<int> &v) {
if (v.size() != 5) return false;
set<int> S;
for (int i : v) S.insert(i);
if (S.size() != 5) return false;
for (int i = 0; i < 5; i++) {
if (!G.areNeighbours(v[i], v[(i + 1) % 5])) return false;
... | ALGO | 0.998292 | 3.948839 | {
"github_metadata": {
"branch": "master",
"commit_count": 219,
"repo_created_at": "2019-12-06T10:00:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "ab745033... |
69cd3877-579a-416c-ac08-0e9a2d1dcb6a | alexandraback/datacollection | solutions_2463486_0/C++/Oakani/c.cpp | #include <iostream>
using namespace std;
int main()
{
int fairNSquare[1001];
for(int i=0;i<1001;i++) fairNSquare[i] = 0;
/*
for(int i=0;i<32;i++)
{
cout << i*i << " ";
// 0 1 4 9 16 25 36 49 64 81 100 121 144 169 196 225 256 289 324 361 400 441 484 529 576 625 676 729 784 841 900 961
}
// palin... | ALGO | 0.999508 | 4.900037 | {
"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": "51e920090... |
251dc388-aef9-4570-af31-8a9656d0b3ec | DJStArbuzz/C1_Demidov_Laboratory | prefix/also_try_minecraft.cpp | #include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
vector<long long> A(n + 2);
vector<long long> Pref_l(n + 2);
vector<long long> Pref_r(n + 2);
for (int i = 1; i <= n; i++) {
cin >>... | ALGO | 0.999845 | 4.027833 | {
"github_metadata": {
"branch": "main",
"commit_count": 235,
"repo_created_at": "2023-09-24T17:28: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": "0829ffa9a3... |
7d785ffb-6449-432f-87ce-3210b7840801 | calofmijuck/BOJ | Codes/2200/2250.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
pii tree[10101], widthrange[10101];
int level[10101], width[10101];
bool hasparent[10101];
int dfs(int v, int lev, int offset) {
if(v == -1) return 0;
level[v] = lev;
int left = dfs(tree[v].first, lev + 1, offset);
width[v] = of... | ALGO | 0.999694 | 3.766625 | {
"github_metadata": {
"branch": "master",
"commit_count": 895,
"repo_created_at": "2018-11-02T11:50:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b6b657c... |
b7819e75-9cf9-48fe-a260-a1dc5897f61d | 7oSkaaa/CP-Templates | Trie.cpp | #include <bits/stdc++.h>
using namespace std;
#define fixed(n) fixed << setprecision(n)
#define ceil(n, m) (((n) + (m) - 1) / (m))
#define add_mod(a, b, m) (((a % m) + (b % m)) % m)
#define sub_mod(a, b, m) (((a % m) - (b % m) + m) % m)
#define mul_mod(a, b, m) (((a % m) * (b % m)) % m)
#define all(vec) vec.begin(), ... | ALGO | 0.995294 | 3.585845 | {
"github_metadata": {
"branch": "main",
"commit_count": 510,
"repo_created_at": "2021-10-12T21:49:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 137,
"forks": 31,
"issues": 1,
"pull_requests": 2
},
"file_meta": {
"content_id": "9d25a52... |
8942678e-361a-49d6-8fc7-c5b9fa2d7126 | define16/Class | vacation/C++/example/0808_1/0808_1/functionPointer1.cpp | #include "config.h"
typedef int (*Func)(int , int); //C언어에서 함수 포인터 선언하기.
int Add(int a, int b)
{
return a+b;
}
int Sub(int a, int b)
{
return a-b;
}
int Mul(int a, int b)
{
return a*b;
}
int Div(int a, int b)
{
if(b != 0)
return a/b;
else
return -1;
}
void main(){
//함수 포인터에 대입될 함수의 이름을 함수 포인터 배열로 만들어 준다.
... | TOOL | 0.986694 | 3.286131 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2018-09-16T07:57: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": "7feef534e... |
1a96c3b7-c914-4cf1-b1be-5a61c24daa73 | TRANTANKHOA/Matlab | Misc/MCMC/cmdstan-2.9.0/stan_2.9.0/lib/stan_math_2.9.0/stan/math/prim/mat/prob/multi_student_t_rng.hpp | #ifndef STAN_MATH_PRIM_MAT_PROB_MULTI_STUDENT_T_RNG_HPP
#define STAN_MATH_PRIM_MAT_PROB_MULTI_STUDENT_T_RNG_HPP
#include <boost/math/special_functions/gamma.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/random/variate_generator.hpp>
#include <stan/math/prim/mat/err/check_ldlt_factor.hpp>
... | TEST | 0.975574 | 5.866752 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-01-08T00:57:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4756e19fda... |
ee7c48e7-4bfc-4224-99e3-77a2281333c4 | LuisAlbertoVasquezVargas/CP | GYM/100712/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define sc( x ) scanf( "%d" , &x )
#define REP( i , n ) for( int i = 0 ; i < n ; i++ )
#define clr( t , val ) memset( t , val , sizeof(t) )
#define all(v) v.begin() , v.end()
#define pb push_back
#define SZ( v ) ((int)(v).size())
#define mp make_pair
#define fi first
#d... | ALGO | 0.999937 | 4.076972 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-02-12T20:18:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "efa3a2d05e... |
3d22ce08-42f7-4e93-abfc-5052ec0995ac | m-taib/CPP09 | ex02/main.cpp | #include "PmergeMe.hpp"
#include <exception>
// Before: 3 5 9 7 4
// After: 3 4 5 7 9
// Time to process a range of 5 elements with std::[..] : 0.00031 us
// Time to process a range of 5 elements with std::[..] : 0.00014 us
int main(int ac, char **av)
{
long start_time;
long elapsed_time;
if (a... | ALGO | 0.982665 | 5.469223 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2023-11-29T17:23: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": "12d9f5a6b... |
d9835a39-b298-48a2-844e-93bb635778ac | Plypy/Lifestyle | Poj/3281.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
const int MAXN = 105;
const int MAXV = MAXN*4;
const int MAXE = MAXV*MAXV;
const int INF = 1<<28;
int vs, vt;
struct Edge {
int vtx, cap;
Edge *nxt, *rev;
Edge() { }
E... | ALGO | 0.999266 | 3.493659 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2015-03-19T14:24:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "21a0015374... |
f3173371-7fa4-46a4-b271-85a543eaa02b | alexandraback/datacollection | solutions_2453486_1/C++/frp/a.cpp | #include <iostream>
using namespace std;
char field[4][4];
bool checkRow(int i, char& winner) {
char p = field[i][0] == 'T' ? field[i][1] : field[i][0];
if(p == '.') return false;
for (int j = 0; j < 4; j++)
if (field[i][j] != p && field[i][j] != 'T')
return false;
winner = p;
return true;
}
bool checkColu... | ALGO | 0.999826 | 4.083656 | {
"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": "0f84f22bb... |
5757fc5f-6fc0-423f-8670-c4fe97ad55fc | zzzxq/RayTracing | src/ray_tracing.cpp | /*************************************************************************
> File Name: ray_tracing.cpp
> Author: zxq
> Mail: <EMAIL>
> Created Time: Wed 20 Apr 2022 03:07:19 PM CST
************************************************************************/
#include <iostream>
#include "rtweekend.h"
#include "hitta... | ALGO | 0.972706 | 4.609667 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-05-07T02:05: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": "b5276ec99f... |
f4ce2a01-f42e-403b-94bc-a112db5fd25f | TzachX/ProblemSolver | BestFirstSearcher.h | //
// Created by tzach on 02/02/2020.
//
#ifndef EX4_BESTFIRSTSEARCHER_H
#define EX4_BESTFIRSTSEARCHER_H
#include "TraceBackSearcher.h"
#include "PriorityQueueDS.h"
template <typename T>
/***
* best Sercher algorithm
* @tparam T any object node
*/
class BestFirstSearcher : public TraceBackSearcher<T>
{
private:... | ALGO | 0.999423 | 5.982066 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-02-06T15:32:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1faf25eb54... |
c6ec0744-1cd9-4571-a1d1-d1667139ba42 | hallamlab/LAST-Plus | src/GappedXdropAligner.cc | // Copyright 2011, 2012, 2013 <NAME>
// The algorithm is based on these recurrence formulas, for
// generalized affine gap costs. For standard affine gap costs, set
// gup=infinity.
//
// gop = gapExistenceCost
// gep = gapExtensionCost
// gup = gapUnalignedCost
//
// The 1st sequence: s(1), s(2), s(3), ...
// The 2n... | ALGO | 0.990832 | 5.453452 | {
"github_metadata": {
"branch": "master",
"commit_count": 157,
"repo_created_at": "2015-06-25T01:01:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 19,
"forks": 3,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc0214a1... |
24e09666-ad17-4c11-a95e-3eb73d1ae758 | aashitagrawal/Love-Babbar-DSA-Sheet | 063-find-the-index-of-the-first-occurrence-in-a-string-leetcode.cpp | #include <bits/stdc++.h>
using namespace std;
// Today's Date - 9 Jan 2024
// Leetcode Question Name - Find the Index of the First Occurrence in a String (Rabin Karp Algo)
// About the RAbin Karp Algorithm
// * An implementation of the Rabin-Karp string-matching algorithm. Given two
// * strings - a text string T ... | ALGO | 0.999937 | 6.291383 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2023-12-24T09:28: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": "9ef02e5eec1... |
a322156b-77ef-4cbe-aeb6-fbaa231acbbb | jason-weirather/SpliceMap | src/SpliceMap-src/nnrFilter.cpp |
#include "nnrFilter.h"
int main (int argc, char * const argv[])
{
srand((unsigned)time(0));
string line;
ifstream in_file;
ofstream out_file;
int nNR_limit = 2;
if (argc != 4) {
print_usage_and_exit();
}
string in_filename = argv[1];
string out_filename = argv[2];
if (in_filename.substr... | DATA | 0.967137 | 4.240575 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-09-16T13:40:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af08a3b476... |
cb89ac0f-617c-4bcf-a43a-631bb58e82b5 | wangyang2333/dbscan | src/octree_nn.h | //
// Created by xcy on 2020/5/4.
//
#ifndef SRC_OCTREE_NN_H
#define SRC_OCTREE_NN_H
#include <ros/ros.h>
#include <iostream>
#include <sensor_msgs/PointCloud.h>
#include <ctime>
using namespace std;
//定义八叉树节点类
struct OctreeNode
{
OctreeNode* children[8];
vector<double> center;
double extent;
vector... | ALGO | 0.997461 | 5.268224 | {
"github_metadata": {
"branch": "master",
"commit_count": 121,
"repo_created_at": "2019-05-29T02:45:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "590fc285... |
b1c2427d-001a-4cc4-9a0f-7f1916d0e479 | rene-d/hackerrank | cpp/classes/classes-objects.cpp | // Classes and Objects
// Familiarize yourself with classes and objects.
//
// https://www.hackerrank.com/challenges/classes-objects/problem
//
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
// (template_head) -----------------------------------------... | ALGO | 0.999943 | 4.233738 | {
"github_metadata": {
"branch": "master",
"commit_count": 197,
"repo_created_at": "2018-03-27T13:10:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 86,
"forks": 25,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "44f14c... |
37eb9670-b183-4e2a-a352-4721e5c507e4 | ishandutta2007/codeforces-l | leaf1415/normal/1213/F.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
#include <map>
#define llint long long
using namespace std;
typedef pair<llint, llint> P;
typedef pair<llint, P> E;
llint n, k;
llint p[200005], q[200005];
vector<llint> G[200005], revG[200005];
vector<int> topo;
bool used[200005];
int scc... | ALGO | 0.999982 | 3.474995 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:17: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": "027ddb7c4c9d... |
851987ea-b4e0-46b4-8865-37edd390709d | blender/blender | source/blender/blenlib/intern/math_vector_inline.cc | /* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup bli
*/
#ifndef __MATH_VECTOR_INLINE_C__
#define __MATH_VECTOR_INLINE_C__
#include "BLI_math_base.h"
#include "BLI_utildefines.h"
/********************************** Ini... | ALGO | 0.967986 | 6.709313 | {
"github_metadata": {
"branch": "main",
"commit_count": 152123,
"repo_created_at": "2019-10-09T12:47:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 15670,
"forks": 2395,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3... |
195905b3-d89d-47a5-b036-e29a613f56c2 | Arpit-mandhan-001/DSA | S2.cpp | #include <bits/stdc++.h>
using namespace std;
void insertion(int arr[], int n)
{
for (int i =0; i <=n-1; i++)
{
int j=i;
while(j>0 && arr[j-1]>arr[j]){
int temp = arr[j - 1];
arr[j - 1] = arr[j];
arr[j] = temp;
j--;
}
... | ALGO | 0.999967 | 5.208628 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-06-16T10:37: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": "c3a44fb0b9f8... |
b6a7181c-590d-44ad-af2c-fa75c1afef97 | Tora416/MultiCodeEmbed | dataset/dataset_raw/gcj_cpp/aki33524/3264486_5633382285312000_aki33524.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
string S;
void solve() {
cin >> S;
int L = S.size();
int x = -1;
for (int i = 0; i < L - 1; i++) {
if (S[i] > S[i + 1]) {
x = i;
break;
}
}
if (x == -1) {
cout << S << endl;
return;
}
int y = 0;
for (int... | ALGO | 0.999959 | 3.592214 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2025-07-10T08:38:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a4748889a... |
5a472d8b-fc26-4f2f-975d-1f9c47089dbb | OneZeroAndTwoZero/own-cppfile | 程序/实验舱/题库/2208.cpp | #include<bits/stdc++.h>
using namespace std;
bool r(int a){
if(a % 400 == 0) return 1;
if(a % 4 == 0 && a % 100 != 0) return 1;
return 0;
}
int day(int y,int m,int d){
int ans = 0;
for(int i = 1;i < m;i++){
if(i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12){
ans += 31;
}else if(i != ... | ALGO | 0.999885 | 3.613952 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-10-20T03:01: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": "638badf50204... |
ddb0834e-1e0e-46fe-9121-d1c78a262dec | codingWithRakesh/LeetCode | 35SearchInsertPosition.cpp | #include <iostream>
#include <vector>
using namespace std;
int searchInsert(vector<int>& arr, int target) {
int st = 0, end = arr.size() -1;
int mid;
while(st <= end){
mid = st + (end - st) /2;
if(target > arr[mid]){
st = mid + 1;
}else if(target < arr[mid]){
... | ALGO | 0.999933 | 5.662646 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2025-07-04T03:04:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa7e2eb580f... |
94754bae-4278-426e-9759-f69695179547 | NandiSoham/Leetcode-POTD-Daily-Coding-Challenge | Year 2025/07_July/day18_2163. Minimum Difference in Sums After Removal of Elements.cpp | // Problem Link -> https://leetcode.com/problems/minimum-difference-in-sums-after-removal-of-elements/description/
class Solution {
public:
long long minimumDifference(vector<int>& nums) {
int totalSize = nums.size();
int partitionSize = totalSize / 3;
vector<long long> minLeftSum(totalSi... | ALGO | 0.999957 | 6.283772 | {
"github_metadata": {
"branch": "main",
"commit_count": 727,
"repo_created_at": "2024-02-03T00:34: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": "88f8aec8d5... |
549dd919-757e-498c-ae13-0892016363bc | tryuan99/micromissiles | simulation/swarm/agent.cc | #include "simulation/swarm/agent.h"
#include <Eigen/Dense>
#include <boost/numeric/odeint.hpp>
#include <boost/numeric/odeint/external/eigen/eigen.hpp>
#include <cmath>
#include <cstdbool>
#include <stdexcept>
#include "absl/strings/str_format.h"
#include "simulation/swarm/proto/agent.pb.h"
#include "simulation/swarm... | ALGO | 0.98575 | 7.769852 | {
"github_metadata": {
"branch": "develop",
"commit_count": 351,
"repo_created_at": "2022-11-06T00:06:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "457327f... |
4953eca8-475b-44b2-9c75-48af0d06a1d2 | PaddlePaddle/Paddle-Lite | lite/kernels/host/deformable_conv_op.h | // Copyright (c) 2019 PaddlePaddle Authors. 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... | ALGO | 0.974318 | 5.181277 | {
"github_metadata": {
"branch": "develop",
"commit_count": 7526,
"repo_created_at": "2017-09-20T11:41:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7124,
"forks": 1620,
"issues": 68,
"pull_requests": 17
},
"file_meta": {
"content_id": ... |
5ec2f9cc-44dd-4b39-a824-8f4d9aa37f70 | umang-singla/Competitive-Programming | Codeforces/Educational Round 129/A.cpp | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ff first
#define ss second
#define vi vector<int>
#define vl vector<ll>
#define vvi vector<<vi>>
#define vii vector<pii>
#define vll vector<pll>
#define FOR(i, l, r) for (... | ALGO | 0.999977 | 3.5434 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-08-22T07:30:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b371af4165c... |
5aac6ceb-821d-479e-9ed0-353f0b078d11 | LunarG/gfxreconstruct | framework/util/argument_parser.h | /*
** Copyright (c) 2018 Valve Corporation
** Copyright (c) 2018 LunarG, Inc.
**
** 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 ri... | TOOL | 0.965354 | 6.962457 | {
"github_metadata": {
"branch": "dev",
"commit_count": 3403,
"repo_created_at": "2018-05-17T17:57:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 471,
"forks": 143,
"issues": 272,
"pull_requests": 66
},
"file_meta": {
"content_id": "a05b... |
3bad5b0a-f648-4608-b0b8-e3ea2ae1d783 | PatrickSchm/Assessing-the-role-of-non-linear-contact-mechanics-for-flow-in-fractures---Code | dune_implementation/dune-localfunctions/dune/localfunctions/lagrange/prismp2/prismp2localinterpolation.hh | // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_PRISM_P2_LOCALINTERPOLATION_HH
#define DUNE_PRISM_P2_LOCALINTERPOLATION_HH
#include <vector>
namespace Dune
{
template<class LB>
class PrismP2LocalInterpolation
{
public:
//! \brief Local interpo... | ALGO | 0.989595 | 6.366367 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-06-25T18:50:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef3073ea26... |
03307f5d-9b01-4b01-a25a-53e146645788 | susa0676/Car-Automation-Sytem | code/iot.ino | // Pin Definitions
#define trigPin 8
#define echoPin 9
// Motor Pins
#define motor1Pin1 2 // Left motor forward
#define motor1Pin2 3 // Left motor backward
#define motor2Pin1 4 // Right motor forward
#define motor2Pin2 5 // Right motor backward
// Constants
const int obstacleThreshold = 20; // Distance in cm to ... | ALGO | 0.912562 | 5.750323 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-05-10T12:36: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": "47d9df3075d4... |
1a0714d7-02f5-4989-906f-b420fee1ee78 | huyongxi/Lanelet2-cmake | lanelet2_path/include/mpt_optimizer.hpp | // Copyright 2023 TIER IV, 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 i... | ALGO | 0.999793 | 5.275006 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-02-07T08:18: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": "39fe4f9230c8... |
9ad272ac-f341-40f7-88dc-4894eb04b6fe | nuyenhuy/ICPC | KMP/Text_Editor/Text_Editor.cpp | #include <bits/stdc++.h>
using namespace std;
string t, p;
int k;
void KMPPreprocess(string p, vector<int>& prefix) {
prefix[0] = 0;
int m = p.length();
int j = 0;
int i = 1;
while (i < m) {
if (p[i] == p[j]) {
j++;
prefix[i] = j;
i++;
}
else {
if (j != 0) {
j = prefix[j - 1];
}
... | ALGO | 0.999981 | 4.199311 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2022-01-25T16:42: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": "6a3d1422881... |
6ca737a7-0375-4396-8120-196ce152fe3f | dvanaken/peloton-bwtree | src/backend/expression/conjunction_expression.h | //===----------------------------------------------------------------------===//
//
// PelotonDB
//
// conjunction_expression.h
//
// Identification: src/backend/expression/conjunction_expression.h
//
// Copyright (c) 2015, Carnegie Mellon University Database Group
//
//===----------------------... | ALGO | 0.954998 | 7.598777 | {
"github_metadata": {
"branch": "master",
"commit_count": 2912,
"repo_created_at": "2016-01-14T03:45:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "22ea646... |
67291d25-f373-450f-bc5a-7ba0644186e5 | mdhaber/scipy | scipy/linalg/src/_common_array_utils.hh | /*
* LAPACK declarations.
*/
#ifndef _SCIPY_COMMON_ARRAY_UTILS_H
#define _SCIPY_COMMON_ARRAY_UTILS_H
#include "Python.h"
#include "numpy/npy_math.h"
#include "npy_cblas.h"
/*
* declare LAPACK prototypes
*/
/* ?GESV */
extern "C" {
CBLAS_INT
BLAS_FUNC(sgesv)(CBLAS_INT *n, CBLAS_INT *nrhs, float a[], CBLAS_INT *ld... | TOOL | 0.907559 | 5.819109 | {
"github_metadata": {
"branch": "main",
"commit_count": 35437,
"repo_created_at": "2017-02-15T02:06:14.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "scipy/scipy",
"stars": 1,
"forks": 5,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "... |
695aeefa-d2ce-4745-bbd9-24183e014de1 | NimishToshniwal/Codeforces-Solved | 1-499/289B.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; i++)
#define rep1(i, n) for (ll i = 1; i <= n; i++)
int main()
{
ios::sync_with_stdio(false);
int n, m, d;
cin >> n >> m >> d;
int mn = m * n;
int count = 0, total = 0;
int a[n][m], b[mn... | ALGO | 0.999934 | 3.636747 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-01-17T16:53: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": "907875d41d37... |
6b492830-876e-4575-bb82-5e5aa6256499 | Swayam792/DSA-SHEET | String/Edit_distance.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int solve(int i,int j,string s,string t,vector<vector<int>> &dp){
if(i == 0 || j == 0){
return max(i,j);
}
if(dp[i][j] != -1){
return dp[i][j];
}
if(s[i-1] == t... | ALGO | 0.999999 | 6.244521 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2022-05-31T17:10: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": "96ed1877d... |
6a4c0f0c-8b4d-4f7b-8694-f7263df902af | grandeagle/Competitive-Programming | uVa/uva 108.cpp | /*
ID: 1107501
TASK: milk2
LANG: C++
*/
#include <bits/stdc++.h>
#define forit(it, a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef set<... | ALGO | 0.999991 | 3.332837 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2019-07-20T16:44: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": "91c7c1d9a... |
8ce832dd-2de9-4e0c-a381-e82ba6a69c23 | Zewang0217/programing_design_ECNU_- | 1043stringSort.cpp | /*
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cctype>
#include <sstream>
using namespace std;
struct str {
string str;
int num;
bool hasNum = false;
};
bool cmp(const str& a, const str& b) {
if (a.hasNum && !b.hasNum) return false;
else if (!a.hasNum && b.hasNum) retu... | ALGO | 0.99954 | 4.464236 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2025-03-02T06:14:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "efa4d75a905... |
192eb9ba-f485-4f78-b549-761234688feb | kweonminsung/BOJ | 24060/main.cpp | #include <bits/stdc++.h>
using namespace std;
int N, K, cnt = 0, result = 0;
int arr[500001], tmp[500001];
void merge_(int p, int q, int r) {
int i = p, j = q + 1, t = 1;
while (i <= q && j <= r) {
if (arr[i] <= arr[j])
tmp[t++] = arr[i++];
else
tmp[t++] = arr[j++];
}
while (i <= q)
... | ALGO | 0.999996 | 4.460638 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2023-10-02T04:13: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": "18b091f10cf... |
24ea51b4-2ab6-4ef9-ad39-24aa40878fb4 | SuZeAI/Code_CPP | biendoinhiphan.cpp | #include <bits/stdc++.h>
using namespace std;
void mang(int a, int b, int m, int n, int arr[][100])
{
for(int i = 0; i < n; i++)
arr[a][i] = 1;
for (int i = 0; i < m ; i++)
arr[i][b] = 1;
}
int main()
{
ios_base :: sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while(t--)... | ALGO | 0.999734 | 3.693898 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-10-16T05:21:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6841743a36... |
80bbb0b4-c07a-45cd-bf47-f0b5dd07b789 | Arunm619/InterviewBit | 2.Arrays/Bucketing/NobleInteger.cpp | int Solution::solve(vector<int> &A) {
sort(begin(A), end(A));
for (int i = 0; i < A.size(); i++) {
if (A[i] == A[i + 1]) continue;
if (A[i] == A.size() - 1 - i) {
//solution = A[i];
return 1;
}
}
if (A.back() == 0)
//solution = 0
return 1;... | ALGO | 0.999975 | 4.436307 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2019-10-26T20:24: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": "f641721ec... |
604ab6f5-10cc-4a5d-a466-00eb922a64f7 | louishenrifranc/competitive-programming | graph/Krustal + Detection de cycle/11710 - Expensive subway.cpp | #include<stdio.h>
#include<string.h>
#include<iostream>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<math.h>
/**
Arbre non oriente,avec poids,pas forcement complet
Classic Minimal Spanning Tree avec Krustal
Arret de l'algo quand on a N-1 liens (il y a N noeuds )
Affichage de impossible ... | ALGO | 0.999956 | 3.525362 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2015-10-16T18:34:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f86b905a... |
271d18b4-f383-4d9a-be35-d68aaa12aafd | vincentadamthefirst/vr_mesh_view | ray_intersection.h | #ifndef RAY_INT_H
#define RAY_INT_H
#pragma once
#include <cgv\math\fvec.h>
#include <cgv/media/axis_aligned_box.h>
#include "halfedgemesh.h"
#include "mesh_utils.h"
#include "aabb_tree.h"
typedef typename cgv::math::fvec<float, 3> vec3;
typedef typename cgv::media::axis_aligned_box<float, 3> box3;
//This class is ... | ALGO | 0.996527 | 5.493527 | {
"github_metadata": {
"branch": "master",
"commit_count": 127,
"repo_created_at": "2020-05-13T13:18:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c480a5f4... |
df08c2e9-c7be-4c9d-ab1a-8ddfa3ee226d | PrestinB12/ODU-Programming | cs361/labs/cs361-lab3-PrestinB12/median.cpp | #include <algorithm>
#include <limits>
#include <cmath>
#include <vector>
#include "median.h"
#include <iostream>
using namespace std;
using std::vector;
/**
* Constructor for the median calculator.
* Initially, has 0 values.
*/
Median::Median()
{
}
/**
* Add a new value to the collection. Values are kept
* in ... | ALGO | 0.999894 | 6.221951 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2025-02-26T22: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": "768a91aec85... |
f0d547ab-7181-4377-a4f6-2c90aa4b985a | NovaPigeon/Parallel_and_Distributed_Computing | hw/final-hw/fpga-route/src/partition.cc | #include "ace-route.h"
#include <cassert>
#include <numeric>
#include <sstream>
#include <vector>
#include <log4cplus/logger.h>
#include <log4cplus/loggingmacros.h>
static log4cplus::Logger logger = log4cplus::Logger::getInstance("ace.route");
int index_offset[10] = {0, 3, 12, 39, 120, 363};
std::vector<std::vector... | ALGO | 0.940449 | 4.830924 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-05-12T19:23: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": "5eb0acdf60dc... |
051b3a50-efdf-48e0-bac7-ef1e14d160ea | ha-jinwoo/algo | programmers/무지의먹방라이브.cpp | #include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
struct h{
int food;
int index;
};
bool comp(struct h &a,struct h &b){
return a.food<b.food;
}
bool comp2(struct h &a,struct h &b){
return a.index<b.index;
}
int solution(vector<int> food_times, long long k) {
int n=f... | ALGO | 0.999982 | 4.814543 | {
"github_metadata": {
"branch": "main",
"commit_count": 178,
"repo_created_at": "2021-06-14T07:26: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": "2f02c50133... |
0bcc818f-3b97-4974-a8b3-ce5c142e9da5 | hiroshi-maybe/atcoder | solutions/SimpleKnapsack.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <unordered_set>
#include <unordered_map>... | ALGO | 0.999992 | 4.146479 | {
"github_metadata": {
"branch": "master",
"commit_count": 1406,
"repo_created_at": "2018-04-21T07:34:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f19167d... |
beaaafb6-ac3d-425f-b68e-e763986fd1fc | lawrence910426/practice | Algo/Chaos/TOI_pretest/pC/re/main.cpp | #include <iostream>
#include <algorithm>
#include <memory.h>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
long long int day[150] ,night[150] ,n ,t ,r;
#define Z(x) (x > 0 ? x : 0)
#define INF 9223372036854775807
int main() {
long long int i... | ALGO | 0.999926 | 3.419007 | {
"github_metadata": {
"branch": "master",
"commit_count": 237,
"repo_created_at": "2019-05-11T00:39:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 8
},
"file_meta": {
"content_id": "96994d7e... |
eed2f1d0-a6e7-4dea-b7d9-0ef555b775ad | ssevR/cses | Dynamic_Programming/Coin_Combinations_II/main.cpp | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define IOS ios::sync_with_stdio(false); cin.tie(0)
#define ll long long
#define ld long double
#define rep(i,a,n) for (int i=(int)(a);... | ALGO | 0.999993 | 4.800529 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-01-25T12:18: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": "a10e56056db0... |
384bfa0a-4db9-43e8-9be9-c455f63f1f2b | AntonBogun/SBWT_alphabet | include/sbwt_alphabet.hpp | #pragma once
#include <vector>
#include <sdsl/bit_vectors.hpp>
#include <sdsl/rank_support_v.hpp>
#include "globals.h"
#include <map>
#include <unordered_set>
#include <fstream> // Include the necessary header file
using namespace std;
using namespace sdsl;
// // Assumes that a root node always exists
// template <t... | ALGO | 0.996258 | 3.762429 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-04-26T15:40: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": "b52f3f3266... |
22b2e578-5395-41da-8ec4-82c7ee0e5620 | jason-marshall/STLIB | examples/geom/mesh/utility/removeLowAdjacencies.h | // -*- C++ -*-
/*!
\file removeLowAdjacencies.h
\brief Remove simplices until there are none with minimum adjacencies less than specified.
*/
/*!
\page examples_geom_mesh_removeLowAdjacencies Remove Simplices with Low Adjacencies.
When meshing objects, one usually wants to avoid boundary simplices with
lo... | ALGO | 0.91836 | 6.694569 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-05-10T18:09:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47b9227a5f... |
8ef98fd3-67f3-4ae4-b3a7-9543a8a6d9d7 | aquach/facebook-grapher | src/Graph/CGrapher.cpp | #include "CGrapher.h"
#include "Gfx/GfxBase.h"
#include <fstream>
#include <map>
#include <iostream>
#include <sstream>
#include "Resources/CTexture.h"
#define Error_(x) cerr << x << endl; cout << x << endl;
const real32 c_springConstant = 1.0f;
const real32 c_coulombConstant = 400.0f;
const real32 c_damping = 0.9f;
... | TOOL | 0.983227 | 4.368142 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2011-06-02T23:17:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a31cddf41b... |
fadf26c3-2ad7-4126-8e4b-33869e01a6e3 | anbinh93/Data-structure-and-Algorithms | HSG/LIS.cpp | #include <iostream>
#include <stack>
using namespace std;
long long n, tam = 10e16, m = 0;
static long a[1000000];
static long f[1000000];
static long e[1000000];
stack<long> s;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
freopen("LIS.INP", "r", stdin);
freopen("LIS.OUT... | ALGO | 0.999998 | 3.867727 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-10-24T02:04: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": "735d2b620562... |
09a6cf8b-90e6-4b23-951b-2aea948d5fa9 | exposedtalent/CodingBlocks | inClass Coding/Stack & Queue/stackUsingLinkedList.cpp | #include<iostream>
using namespace std;
template<typename T>
class node{
public:
T data;
node<T>* next;
node(T data){
this->data = data;
this->next = NULL;
}
};
template<typename T>
class forward_list {
node<T>* head;
int len;
public:
... | ALGO | 0.996418 | 4.608257 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2021-06-04T18:16:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e412c5dd5... |
beb17d58-5f3d-4079-bf63-c19076f3fc7a | viacheslav-anokhin/MatrixLib | MatrixLib/main.cpp | /*
На основе динамических массивов, типа std::vector или другого стандартного контейнера реализовать типы данных для представления матриц и векторов произвольной размерности.
Создать класс Матрица. (Yes)
Вектор рассматривать как матрицу размера 1xN или Nx1.(Yes)
написать подклассы для матриц указанных видов - Единичн... | ALGO | 0.993503 | 5.134311 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-03-02T20:43:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4138432e34... |
537d0b61-1274-4ae0-942d-dcb8322d6548 | zhedahht/CodingInterviewChinese2 | 59_02_QueueWithMax/QueueWithMax.cpp | /*******************************************************************
Copyright(c) 2016, <NAME>
All rights reserved.
Distributed under the BSD license.
(See accompanying file LICENSE.txt at
https://github.com/zhedahht/CodingInterviewChinese2/blob/master/LICENSE.txt)
*****************************************************... | ALGO | 0.999591 | 5.339529 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2016-11-21T05:04:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5377,
"forks": 2163,
"issues": 60,
"pull_requests": 9
},
"file_meta": {
"content_id": "0... |
12dfbb4b-85e3-4a67-8150-2e60bd9f7ba8 | ulyssesrr/carmen_lcad | src/saliency_search/VFAT/segmentImageMerge2.H | /*!@file VFAT/segmentImageMerge2.H Basic image segmenter blob finder using color */
// //////////////////////////////////////////////////////////////////// //
// The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2001 by the //
// University of Southern California (USC) and the iLab at USC. //
// See htt... | TOOL | 0.993327 | 6.012614 | {
"github_metadata": {
"branch": "master",
"commit_count": 384,
"repo_created_at": "2015-11-26T15:08:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 15,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c0645cf... |
fcd3bd77-fcb6-4963-9c49-16733948ce95 | irajatpandey/Practice | Tree/TreeNode.cpp | #include<bits/stdc++.h>
using namespace std;
template<typename T>
class TreeNode{
public:
int data;
vector<TreeNode <T>*> child;
TreeNode(T data){
this -> data = data;
}
};
int heightOfTree(TreeNode<int> *root){
if(root == NULL) return 0;
int height = 0;
for(int i = 0; i < root... | ALGO | 0.999773 | 4.623312 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2020-04-26T10:15: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": "6f74eeab0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.