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 |
|---|---|---|---|---|---|---|---|
823cf6ca-0085-4ea3-a9ae-3bad50b7921b | mohsendb7008/Online-Judge-Solutions | UVa/uva10578.cpp | #include <bits/stdc++.h>
using namespace std;
// The Game of 31
#define N true
#define P false
map<string, bool> memo;
bool dp(string state){
if(memo.find(state) != memo.end())
return memo[state];
int sum = 0;
for(int i = 0; i < 6; i++)
sum += (4 - (state[i] - '0')) * (i + 1);
for(in... | ALGO | 0.999815 | 3.774409 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2020-10-07T18:13:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2ff15d8b1... |
8836e9e9-034c-483b-9f4b-748c585c57b5 | jvamtruong/data-structures-and-algorithms | homework/all/20.cpp | #include<bits/stdc++.h>
#define endl '\n'
using namespace std;
const int MOD = 1E9 + 7;
long long f[100][100];
long long tmp[100][100];
int n, k;
void mul(long long a[100][100], long long b[100][100]) {
long long res[100][100];
for (int i = 0 ; i < n; i++) {
for (int j = 0 ; j < n; j++) {
... | ALGO | 0.99986 | 4.641241 | {
"github_metadata": {
"branch": "master",
"commit_count": 86,
"repo_created_at": "2019-03-31T16: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": "72c44da46... |
f5772772-1de7-4fb9-b517-b73909d03273 | hoaghiepp/CTDL-GT | DSA03012.cpp | #include <bits/stdc++.h>
#define LL long long
#define ULL unsigned long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FO(i,a,b) for(int i=a;i<b;i++)
#define FORD(i,a,b) for(int i=a;i>=b;i--)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define debug cout << "YES" << endl
using n... | ALGO | 0.999662 | 3.457101 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-04-27T04:17: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": "275ff2e113... |
e2b18fe4-d7b1-4496-a21c-24db457af0c4 | vrnanshuman/Leetcode | search-a-2d-matrix/search-a-2d-matrix.cpp | class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target) {
int m = matrix.size();
int n = matrix[0].size();
int top,bottom, mid;
top = 0;
bottom = m-1;
while(top<=bottom) {
mid = (top + bottom)/2;
if((mid == ... | ALGO | 0.999912 | 5.968579 | {
"github_metadata": {
"branch": "main",
"commit_count": 646,
"repo_created_at": "2020-12-12T10:50: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": "9a88caea70... |
79cbb260-5c80-4c98-8976-c8828aac609b | E869120/kyopro_educational_90 | sol/009.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;
struct Point {
double px, py;
};
Point operator-(const Point& a1, const Point& a2) {
return Point{ a1.px - a2.px, a1.py - a2.py };
}
double getangle(Point G) {
// 点 G の偏角を求める
if (G.py >= 0.0) {
double I = G.px / sq... | ALGO | 0.999961 | 4.418646 | {
"github_metadata": {
"branch": "main",
"commit_count": 568,
"repo_created_at": "2021-03-27T13:34:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 825,
"forks": 84,
"issues": 5,
"pull_requests": 2
},
"file_meta": {
"content_id": "c8c5a57... |
169a3c8d-ac55-4918-ad6c-a4cbf74712ab | catid/libcatid | _attic_/math/sqrt/SquareRoot.cpp | #include <cat/math/BigInt.hpp>
#include <malloc.h>
namespace cat
{
// root = sqrt(square)
// Based on Newton-Raphson iteration: root_n+1 = (root_n + square/root_n) / 2
// Doubles number of correct bits each iteration
// Precondition: The high limb of square is non-zero
// Returns false if it was unable to determi... | ALGO | 0.999296 | 5.37405 | {
"github_metadata": {
"branch": "master",
"commit_count": 1046,
"repo_created_at": "2015-03-25T21:10:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 5,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "08e79b2... |
5dcfe168-64c3-488e-88b4-7192e2fcede1 | subinmun1997/Algorithm-Problem-Solving | Wall breaking.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 987654321;
int n, m, k, visited[1001][1001][10], a[1001][1001], ret = INF;
struct b{
int y, x, wall;
};
queue<b> q;
const int dy[] = {-1, 0, 1, 0};
const int dx[] = {0, 1, 0, -1};
void fastIO(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
... | ALGO | 0.999983 | 3.685978 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2019-12-24T15:34: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": "130543287... |
1bd854b4-4845-467e-9865-6fb6317e8d67 | pchev/libpasastro | getdss/dss.cpp | #include <math.h>
#include <string.h>
#include <stdlib.h>
#include "dss.h"
#define PI 3.14159265358979323846264338327950288419716939937510582097494
#define ARCSECONDS_PER_RADIAN (3600. * 180. / PI)
static double compute_plate_poly( double ox, double oy, const double *poly);
/*****************************************... | ALGO | 0.999663 | 6.191708 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2018-03-02T20:05:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89984e5... |
33aff74e-87ba-4088-b738-d070cad666d5 | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1243/Standings4/29733210_64395252.cpp | /// Quality Over Quantity
#include <bits/stdc++.h>
#define FILE_NAME "D"
using namespace std;
using ll = long long;
#define f first
#define s second
#define pb push_back
#define pp pop_back
#define SZ(x) ((int) x.size())
#define all(x) x.begin(), x.end()
#define what_is(x) cerr << #x << " is " << x << endl;
... | ALGO | 0.99997 | 5.005074 | {
"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": "688177a4c... |
5b9d996e-fcf7-45f6-a3b6-c8bbf60a13bc | duckdb/duckdb | extension/core_functions/include/core_functions/aggregate/sum_helpers.hpp | //===----------------------------------------------------------------------===//
// DuckDB
//
// duckdb/core_functions/aggregate/sum_helpers.hpp
//
//
//===----------------------------------------------------------------------===//
#pragma once
#include "duckdb/common/types/hugeint.hpp"
#inclu... | TOOL | 0.971151 | 7.382829 | {
"github_metadata": {
"branch": "main",
"commit_count": 59407,
"repo_created_at": "2018-06-26T15:04:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 31074,
"forks": 2450,
"issues": 412,
"pull_requests": 112
},
"file_meta": {
"content_id":... |
1ed513bf-8bdf-41eb-b426-06a76b8d2b32 | 4lb3rt0r/Dev-Stuff | DrRacket/Scheme Syntax Highlighter/prueba3.cpp | #include < iostream >
using namespace std ;
int main () {
double v, c, p, t ;
float ejemplo = 7.7 ;
int i ;
cin >> v ;
cin >> c ;
cin >> p ;
int counter = 0 ;
if ( ( v < 0 ) || ( c < 1 || c > 99999 ) || ( p < 2 || p > 10 ) )
{
cout << "Error" << endl ;
}
else
{
... | ALGO | 0.998525 | 3.290339 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2022-10-28T22:07:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97cbd0dda4a... |
5f777f6f-c909-43a2-9cf5-c560b19229e1 | stan-dev/math | stan/math/prim/functor/map_rect_mpi.hpp | #ifdef STAN_MPI
#ifndef STAN_MATH_PRIM_FUNCTOR_MAP_RECT_MPI_HPP
#define STAN_MATH_PRIM_FUNCTOR_MAP_RECT_MPI_HPP
#include <stan/math/prim/meta.hpp>
#include <stan/math/prim/functor/map_rect_concurrent.hpp>
#include <stan/math/prim/functor/mpi_distributed_apply.hpp>
#include <stan/math/prim/functor/map_rect_reduce.hpp>... | TOOL | 0.993094 | 6.973063 | {
"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": ... |
d45055cb-4051-49d2-8a5d-e40a10e80902 | amsraman/Competitive_Programming | Yosupo/Math/StirlingNumbersoftheFirstKind.cpp | // 1169 ms
#include <bits/stdc++.h>
using namespace std;
template <class B>
struct PowerSeries {
using T = typename B::T;
static const T mod = B::mod;
vector<T> poly;
PowerSeries(size_t size, T init = 0): poly(size, init) {};
PowerSeries(const vector<T> & init): poly(init) {};
inline size_t si... | ALGO | 0.999992 | 4.320375 | {
"github_metadata": {
"branch": "master",
"commit_count": 413,
"repo_created_at": "2019-03-04T14:45:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30851dd8... |
c20a2844-20ca-4c70-a5ba-bd9e5d353174 | PetreCatalin/Concursuri-Programare-Competitiva | Alte concursuri/dfaminimization/main.cpp | #include <fstream>
#include <vector>
using namespace std;
int q,fin,i,q0,nr,x,y,*F,j,**D,*st,v,s1,s2,t,aux,*ech,r,nrf,*finale;
char c,**M,k;
bool ok;
vector <pair <int,int> >per;
int main()
{
ifstream f("intrare.in");
ofstream g("iesire.out");
f>>q; //nr stari
f>>v; //card alfabet
f>>fin; //nr st... | ALGO | 0.999729 | 3.602001 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-05-30T11:37: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": "40102b7563... |
46079903-5338-46e5-8d7f-25a716f9c10b | jakelin0fly/RCombination | RCombination.cpp | #include "RCombination.h"
#include <QStringList>
#include <QDebug>
/**
* @brief RCombination::RCombination
* @param combination_lineEdit
* @param r_lineEdit
*/
RCombination::RCombination(QString combination_lineEdit, QString r_lineEdit){
combinationStr = combination_lineEdit;
rValue = r_lineEdit.toInt();
... | ALGO | 0.996466 | 4.461997 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-10-15T11: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": "2e686c71c... |
c7907792-03d6-47be-8554-fff32a9d1f58 | jiamny/Machine_learning_and_deep_learning_with_CPP | src/Understanding_DL/Ch04_DeepNeuralNetworks/C4_2_Clipping_functions.cpp | /*
* C4_2_Clipping_functions.cpp
*
* Created on: Sep 20, 2024
* Author: jiamny
*/
#include <torch/torch.h>
#include <iostream>
#include <unistd.h>
#include <assert.h>
#include "../../Utils/helpfunction.h"
#include "../../Utils/TempHelpFunctions.h"
using torch::indexing::Slice;
using torch::indexing::None... | ALGO | 0.952297 | 5.85269 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2024-05-26T10:18: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": "42489d2b8c7... |
267e0c84-967c-44b6-b0ba-fe4fbc559422 | richardhaslam/frackit | frackit/intersection/algorithms/algo_quadrilateral_line.hh | // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* ... | ALGO | 0.996562 | 6.923605 | {
"github_metadata": {
"branch": "master",
"commit_count": 960,
"repo_created_at": "2020-11-12T21:32:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ffba2e7... |
83910ea6-5c4d-4ccd-915b-0492f5e44051 | hhecquet/CPP-Modules | CPP-Module-09/ex02/PmergeMe.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* PmergeMe.cpp :+: :+: :+: ... | ALGO | 0.998285 | 6.094936 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2025-04-16T13:14: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": "c6cf288050c... |
eb4acccf-5870-4e35-b77b-166511ebb8cb | chien-yu/algorithm_problems | google/1136_parallel_courses.cpp | #include <vector>
#include <set>
#include <stack>
#include <queue>
using namespace std;
// bfs passed
class Solution {
public:
int minimumSemesters(int n, vector<vector<int>>& relations) {
// build a directed graph and in-degree
// since we want to start from the "root"
vector<set<int>> gr... | ALGO | 0.99972 | 5.196202 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2021-05-08T22:32: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": "aee0aa41c... |
24bc32d0-6b6a-467a-8766-aa0121d54362 | ishandutta2007/codeforces-o | okwedook/normal/1264/A.cpp | #pragma GCC optimize("O3", "unroll-all-loops")
#pragma GCC target("avx2")
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <bitset>
#include <sstream>
#include <dequ... | ALGO | 0.999878 | 3.827484 | {
"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": "19705487bb5d... |
f9d84fab-f352-4b92-b387-a180c01c9a4d | 504281906/ACM | Happy Programming Contest1.cpp | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = 1010;
int num[55][1010], dp[55][1100], time[55][1100], sum[55][1100];
int n, T;
struct node{
int t, c;
bool operator < (const node &tmp)const{
return (t<tmp.t)||(t==tmp.t&&c>tmp.c);
... | ALGO | 0.999945 | 3.062057 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2015-03-16T10:58:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "86d7fad64e... |
a07d7d22-b947-41d2-9dbe-44d56e80f181 | ImperishableMe/codeforces-practice | Educational-round-74/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
int t;
ios::sync_with_stdio(0); cin.tie(0);
int n;
cin >> n;
string s;
cin >> s;
typedef pair<char,ll> PCL;
vector <PCL> v;
int cnt = 0;
char l = '#';
for(int i = 0; i < s.size(); ){
... | ALGO | 0.999971 | 3.608525 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2020-03-16T15:56:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "0942fe61d... |
73bca184-38cb-4d0f-9264-e3a094353cfe | deep-in-apeirophobia/CompetetiveProgramingCodes | CF/543D.cpp | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <cstring>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <math.h>
#include <stack>
#include <deque>
#define mp make_pair
#define F first
#define S ... | ALGO | 0.999986 | 3.365664 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-12-17T13:48:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9e651ec6e... |
f74b7d43-2079-4fe1-9215-c207f8550884 | Pranshu321/Codes | Minimum Allocation of pages.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
bool isfeasible(int a[],int n,int m,int min){
int StudentAllocated=1,sum=0; // student allocation is 1 beacuse we are allocating to forst student;
for(int i=0;i<n;i++){
if(a[i]>min){ // if any element greater than min value is a fas... | ALGO | 0.999958 | 3.841084 | {
"github_metadata": {
"branch": "master",
"commit_count": 93,
"repo_created_at": "2021-10-07T07:59:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43674b709... |
8ff42e75-6770-4dd1-897d-decbdb27ccc3 | Tertyshni/Main | Main/Pointers.cpp | #include <iostream>
using namespace std;
bool contains(int* arr, int size, int value) {
for (int i = 0; i < size; i++) {
if (arr[i] == value) {
return true;
}
}
return false;
}
void swapEvenOddIndices(int* arr, int size) {
for (int i = 0; i < size - 1; i += 2) {
int temp = arr[i];
arr[i] = arr[i + 1]... | ALGO | 0.999784 | 4.928519 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2025-05-20T16:37: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": "bbc654fed... |
abdc0410-d408-41f8-a660-dae257f9f351 | JasenARHansen/portfolio | src/CPP/code/interview/meta/preparation/heaps/MedianStream.cpp | #pragma clang diagnostic push
#pragma ide diagnostic ignored "OCInconsistentNamingInspection"
#include <iostream>
#include <vector>
#include <queue>
#include <cmath>
#include <cassert>
using namespace std;
class MedianStream {
public:
static void description() {
cout << R"(Median Stream
You're given ... | ALGO | 0.999992 | 6.696984 | {
"github_metadata": {
"branch": "master",
"commit_count": 174,
"repo_created_at": "2020-12-26T01:33:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6be2c3ab... |
8e5550ed-b4f3-4145-8d6d-08e8cde55789 | ling78977/simple_fast_lio_lc | src/simple_fast_lio2_lc/include/simple_fast_lio2_lc/esekf.hpp | #ifndef SIMPLE_FAST_LIO_ESEKF_HPP
#define SIMPLE_FAST_LIO_ESEKF_HPP
#include "simple_fast_lio2_lc/common.hpp"
#include "sophus/so3.hpp"
#include <Eigen/Core>
#include <Eigen/Dense>
#include <Eigen/Geometry>
#include <Eigen/Sparse>
#include <Eigen/src/Core/Matrix.h>
#include <boost/bind.hpp>
#include <cstdlib>
#include... | ALGO | 0.994005 | 5.765508 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-07-03T13:07: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": "568f8d640221... |
66e93b6d-cc42-472f-b23e-0e89481639cd | venkat-0706/GeeksForGeeks | Difficulty: Hard/LRU Cache/lru-cache.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// design the class in the most optimal way
class LRUCache {
private:
int n;
map<int,int>mp;
map<int,int>freq;
deque<int>dq;
public:
LRUCache(int cap) {
this->n = cap;
}
// Function to return v... | ALGO | 0.9972 | 6.002367 | {
"github_metadata": {
"branch": "main",
"commit_count": 408,
"repo_created_at": "2024-10-07T07:36:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bddf91865... |
a6dec67d-2c73-413a-986d-fc8f604decca | MzMahmud/problem-solving | Light OJ/LOJ My Solution/1326 - Race.cpp | /*
1326 - Race
Author: <NAME>
Date : 09 May,2017
My Solution:
1 2 3 4 5 ... n
let a(n) be the answer.
Now choose 1 from n in 1st place and rest can be a(n-1).
Now choose 2 from n in 1st place and rest can be a(n-2).
So the recurrence,
a(n) = C(n,1)*a(n-1... | ALGO | 0.99988 | 4.068526 | {
"github_metadata": {
"branch": "master",
"commit_count": 903,
"repo_created_at": "2018-04-27T05:18: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": "5f9465d8... |
b99cc562-9dc8-4393-a570-e2bbdc9832fa | satsukisahi/AtCoder | 03re-examine/abc040-d.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const ll mo = 1000000007;
const ll INF = 1LL << 60; //MAX 9223372036854775807
ll ans = 0;
struct UnionFind
{
vector<ll> data;
UnionFind(ll size) : data(size, -1) {}
bool unionSet(ll x, ll y... | ALGO | 0.999948 | 4.442227 | {
"github_metadata": {
"branch": "master",
"commit_count": 215,
"repo_created_at": "2019-04-26T05:34:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f79fd638... |
ff3960ed-b0f7-4625-9d58-5efacc97486b | vvamshi1982/CodingRound | RichieRich.cpp | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#inc... | ALGO | 0.999949 | 3.464437 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2016-11-29T22:13: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": "72ec3ecc19... |
c5d9120b-2133-441b-942d-d5a9e0a294c2 | missingXiong/leetcode | Amazon/238. Product of Array Except Self.cpp |
vector<int> productExceptSelf(vector<int>& nums)
{
int size = nums.size();
if(nums.size() == 0) return {};
vector<int> ans(size);
// compute prefix product
ans[0] = nums[0];
for(int i = 1; i < size; i++)
ans[i] = ans[i - 1] * nums[i];
ans[size - 1] = ans[size - 2];
int suffix = nums[size - 1];
for(int i... | ALGO | 0.999985 | 6.529726 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2020-07-24T02:43:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "afeceb637... |
fca455ea-878d-473c-9247-64c3237cbe2c | Matistjati/Competitive-programming-solutions | codeforces/1864e.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
const int inf = int(1e18);
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> p2;
#define rep(i, high) for (int i = 0; i < high; i++)
#define repp(i, low, high) for (int i = low; i < high; i++)
#define repe(i, cont... | ALGO | 0.999871 | 5.07146 | {
"github_metadata": {
"branch": "master",
"commit_count": 870,
"repo_created_at": "2021-09-14T12:27: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": "399c275f... |
6ef92972-0c66-402a-bc8a-94062ad40d45 | somdats/Registration_framework | 3DRegistration_Framework/NormalEstimationPoints.cpp | #include"pch.h"
#include"NormalEstimationPoints.h"
#include"ErrorMetric.h"
cNormalEstimationPointCloud::~cNormalEstimationPointCloud()
{
if (NULL != kdTree)
{
delete kdTree;
kdTree = NULL;
}
}
void cNormalEstimationPointCloud ::ComputeFeature()
{
CloudPtr input_cloud(new pcl::PointCl... | ALGO | 0.991116 | 5.819495 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2018-09-26T13:00: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": "a8bb34318... |
2eea4202-b02c-4d28-af97-e26175d66bbb | mablatnik/Algorithmic-Toolbox | algorithmic_toolbox/week_2/01_introduction_starter_files/gcd/gcd.cpp | #include <iostream>
using std::cin;
using std::cout;
int gcd_naive(int a, int b) {
int current_gcd = 1;
for (int d = 2; d <= a && d <= b; d++) {
if (a % d == 0 && b % d == 0) {
if (d > current_gcd) {
current_gcd = d;
}
}
}
return current_gcd;
}
... | ALGO | 0.999427 | 4.707295 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2016-12-02T07:41:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 168,
"forks": 147,
"issues": 3,
"pull_requests": 9
},
"file_meta": {
"content_id": "569a6... |
8d81fad1-3fec-4962-979a-ad48e6ed26fa | ishandutta2007/codeforces-c | chen_zexing/normal/1163/E.cpp | #include <stdio.h>
#include <iostream>
#include <string>
#include <string.h>
#include <vector>
#include <cmath>
#include <assert.h>
#include <algorithm>
#include <stdlib.h>
#include <queue>
#include <climits>
#include <set>
#include <unordered_map>
#include <time.h>
#include <map>
#include <stack>
#include <unordered_s... | ALGO | 0.999967 | 3.646474 | {
"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": "036f8f24144f... |
2ece71a4-ae96-4a9b-b660-78e0dd29b142 | edo01/FastFem | src/linalg/sparseMatrices/SymCSRMatrix.cpp | #include "FastFem/linalg/sparseMatrices/SymCSRMatrix.hpp"
#include <algorithm>
namespace fastfem{
namespace linalg{
using types::ff_index;
SymCSRMatrix::SymCSRMatrix(ff_index n_cols, const CSRPattern& pattern) :
CSRMatrix(n_cols, pattern){};
const double &SymCSRMatrix::get_entry(ff_index i, ff_index j) const
{
... | ALGO | 0.993064 | 6.673685 | {
"github_metadata": {
"branch": "main",
"commit_count": 112,
"repo_created_at": "2024-11-27T16:20: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": "24114c9553... |
4a326e8e-cb7f-4f98-a0ca-3bb2d4431f63 | arkyper/Striver-A2Z-DSA | #01 Step : Learn the Basics/#2 Lec : Build-up Logical Thinking PATTERNS/#15 Code360 - Reverse Letter Triangle.cpp | // Problem statement
// Aryan and his friends are very fond of patterns. For a given integer ‘N’, they want to make the Reverse Letter Triangle.
// You must print a matrix corresponding to the given Reverse Letter Triangle.
// Example:
// Input: ‘N’ = 3
// Output:
// A B C
// A B
// A
// Sample Input 1:
// 3
// Samp... | ALGO | 0.999851 | 4.599988 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2024-04-28T15:18: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": "f18a3a4b17f... |
7ecabe4a-23a0-4b41-bf72-1a5c9bfbe9bf | iiliev02/University | DuplicateElemNode/linked_list.h | #pragma once
#include <iostream>
using namespace std;
template <typename T>
struct Node
{
T data;
Node <T>* next;
Node(const T& data, Node <T>* next)
{
this->data = data;
this->next = next;
}
};
template<typename T>
class LinkedList
{
private:
Node<T>* first;
Node<T>* last;
size_t size;
void copy(const ... | TOOL | 0.90392 | 4.001645 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2020-06-11T17:12:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a24b95874... |
be51bf24-edf7-4841-ae19-4d8b9d436117 | salim002/Cpp-Codes | 52_Codeforces/17_Codeforces 4/78_Long_jumps.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<ld> vd;
#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()
#define fast_io ios_base::sync_wit... | ALGO | 0.999978 | 4.965963 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-12-11T13:47: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": "43b4c666e1... |
001eb303-5549-4870-91af-a9e8e885ed55 | ishandutta2007/codeforces-s | sus/normal/1551/A.cpp | // sus sus amongu, this code was made by sathu
// copy it if you wish, but your coding skills will perish
#include <iostream>
#include <utility>
#include <queue>
#include <stack>
#include <vector>
#include <fstream>
#include <map>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <... | ALGO | 0.999795 | 3.431077 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07: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": "35996defa2bf... |
cc0e9acb-6ab4-4146-bb8c-207652de3e05 | shekharpandey10/Leetcode | Array_01/findAllDistantK2200.cpp | class Solution {
public:
vector<int> sol2(vector<int>& nums, int key, int k) {
int n = nums.size();
int i = 0, j = 0;
vector<int> v(nums.size() + 1);
while (i < nums.size()) {
if (nums[i] == key) {
int start = max(0, i - k);
int end = min(n... | ALGO | 0.999993 | 6.291688 | {
"github_metadata": {
"branch": "main",
"commit_count": 88,
"repo_created_at": "2025-02-28T17:45: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": "31d8bdb3690... |
2d8311b4-5c00-45e0-a3e0-050346d51e24 | tarunsingh7379/Competitive-Programming-Practice | Codeforces/1400/B_One_Bomb.cpp | #include <bits/stdc++.h>
typedef long long int ll;
#define M 1000000007
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, m;
cin >> n >> m;
vector<string> v;
string s;
for (int i = 0; i < n; i++)
{
cin >> s;
v.push_back(s);
}
... | ALGO | 0.99999 | 3.661216 | {
"github_metadata": {
"branch": "main",
"commit_count": 967,
"repo_created_at": "2022-12-23T12:55: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": "ccf60775e4... |
0444128a-a53f-4fce-8ec3-c705753bc921 | QunLi123/PCFG-Framework | PCFG_Framework/多线程实验/guessing.cpp | #include "PCFG.h"
#include <pthread.h>
using namespace std;
void PriorityQueue::CalProb(PT &pt)
{
// 计算PriorityQueue里面一个PT的流程如下:
// 1. 首先需要计算一个PT本身的概率。例如,L6S1的概率为0.15
// 2. 需要注意的是,Queue里面的PT不是“纯粹的”PT,而是除了最后一个segment以外,全部被value实例化的PT
// 3. 所以,对于L6S1而言,其在Queue里面的实际PT可能是123456S1,其中“123456”为L6的一个具体value。
... | ALGO | 0.999949 | 3.71807 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-07-06T09:14: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": "64801c14c9a9... |
f61b5186-a894-4646-a310-ecf4b2ff961f | 1797818494/CMU15-445_2022 | cmu15445/bustub/src/execution/aggregation_executor.cpp | //===----------------------------------------------------------------------===//
//
// BusTub
//
// aggregation_executor.cpp
//
// Identification: src/execution/aggregation_executor.cpp
//
// Copyright (c) 2015-2021, Carnegie Mellon University Database Group
//
//===-----------------------------... | TOOL | 0.961009 | 6.550567 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2023-02-07T14:07:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "920de51ff... |
d6d5f442-c78c-4f54-bb3f-e573a00a8a21 | wsjoshua02tamu/Binary-Search-Tree | BinarySearchTree.h | #pragma once
#include <functional> // std::less
#include <iostream>
#include <queue> // std::queue
#include <utility> // std::pair
template <typename K, typename V, typename Comparator = std::less<K>>
class BinarySearchTree
{
public:
using key_type = K;
using value_type = V;
using key_compar... | ALGO | 0.999205 | 6.680137 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-01-30T17:37: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": "a5dfe2276396... |
1af3a37f-d3ba-4920-a2b8-491d06c44e24 | spooky1703/OMEGAUP | 6123.cpp | #include <iostream>
#include <vector>
using namespace std;
// Función para imprimir una matriz serpentina
void matrizXD(int M, int N) {
// Se crea una matriz de tamaño MxN con valores inicializados en 0
vector<vector<int> > matrix(M, vector<int>(N));
int num = 1; // Variable para asignar números consecuti... | ALGO | 0.999945 | 4.924364 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-06-26T15:37:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f563865b5590... |
d0594a1f-a645-4969-bad4-95c69712d3f7 | arash-ha/Cpp | Expression Add Operators.cpp | /*
Expression Add Operators
Given a string num that contains only digits and an integer target, return all possibilities to add the binary operators '+', '-', or '*' between the digits of num so that the resultant expression evaluates to the target value.
Example 1:
Input: num = "123", target = 6
Output: ["1*2*3","... | ALGO | 0.999974 | 6.601319 | {
"github_metadata": {
"branch": "master",
"commit_count": 982,
"repo_created_at": "2019-10-02T15:30:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa2479c9... |
63d5b732-84a3-4849-9678-755aea1472f4 | imjaya/Leetcode_solved | 98_Validate_Binary_Search_Tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999504 | 5.918005 | {
"github_metadata": {
"branch": "master",
"commit_count": 199,
"repo_created_at": "2020-08-01T06:38: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": "59d19536... |
4ddfe432-0540-479a-b4f7-65744beb3a5d | sureshyhap/C-plus-plus-Primer | Chapter 9/5/5.cpp | #include <iostream>
#include <vector>
std::vector<int>::iterator find_in_range(std::vector<int>::iterator it1,
std::vector<int>::iterator it2,
int value);
int main(int argc, char* argv[]) {
std::vector<int> vec {1, 2, 3, 4, 5};
std::vector<int>::iterator it1 = vec.begin() + 1, it2 = vec.end();
std::ve... | ALGO | 0.998666 | 5.680611 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-08-20T20:06:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "119c6b027... |
bc420e50-12b4-4609-9561-a5ca2ee18a40 | juarezpaulino/coderemite | problemsets/UVA/UVA543.cpp | /**
*
* Author: <NAME>(coderemite)
* Email: <EMAIL>
*
*/
#include <cstdio>
#include <cstdlib>
#include <vector>
using namespace std;
#define MAX 1000000
vector<bool> prime((MAX>>1)+100);
int pr[500000], npr;
void sieve() {
for(int i = 3; i <= 1000; i+=2)
if(!prime[(i-3)>>1])
for(int j ... | ALGO | 0.999383 | 3.327002 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2020-12-12T21:51: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": "a1526bef22bb... |
6b030a42-0378-4c55-b139-dfb88af738b8 | shobhitraj1/CP-31-Sheet-Solutions | 900/900-16-Deletive Editing.cpp | // Created by <NAME>
// Problem link - https://codeforces.com/problemset/problem/1666/D
#include <bits/stdc++.h>
using namespace std;
#define int long long
// brute force removal of extra letters & checking if result is equal to test string
signed main(){
int t;
cin >> t;
while (t--){
string inp... | ALGO | 0.999981 | 4.982281 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-08-15T06:08:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "77de3934927... |
73d6f6af-208d-4f10-8a13-5a750534b72b | facug91/Competitive-Programming | problems_solved/uva.onlinejudge.org/SecretWord.cpp | /*
By: facug91
From: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3911
Name: Secret Word
Date: 27/06/2016
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define endl "\n"
#define EPS 1e-9
#define MP make_p... | ALGO | 0.999613 | 3.553815 | {
"github_metadata": {
"branch": "master",
"commit_count": 117,
"repo_created_at": "2014-06-08T22:47:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f9531dad... |
32cad38e-5e25-420c-a29b-3b26d6ada5d1 | pavel-ryzhov/global_vars | runs/006740.cpp | #include <iostream>
#include <vector>
#include <list>
#include <queue>
#include <fstream>
#include <iterator>
#include <algorithm>
using namespace std;
class Edge
{
//номера вершины, из которой исходит ребро
long v;
//номера вершины, в которую входит ребро
long w;
//вес ребра
long weight;
public:
Edge(long v, ... | ALGO | 0.999993 | 4.629412 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-07-04T20: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": "4101d7c818f2... |
f1e5d03c-671a-4e5b-ab35-d3d7388499a8 | ishandutta2007/codeforces-b | bidzilya/normal/552/E.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
string s;
cin >> s;
int n;
n = (s.length() + 1) / 2;
vector<int> digits;
vector<char> signs;
for (int i = 0; i < (int) s.length(); i += 2) {
digits.push_back(s[... | ALGO | 0.999989 | 4.177701 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83ab9fda4de9... |
26de8298-4b58-448b-8df0-b82cc5c0694d | pratap-raghav/DSA_Practice | gfg/search/bSearchRecursion.cpp | #include <bits/stdc++.h>
using namespace std;
int bSearch(vector<int> &v, int &element, int s, int e)
{
if (s <= e)
{
int mid = (s + e) / 2;
if (v[mid] == element)
return mid;
else if (v[mid] < element)
{
// s = mid + 1;
// bSearch(v, eleme... | ALGO | 0.999756 | 4.827353 | {
"github_metadata": {
"branch": "main",
"commit_count": 139,
"repo_created_at": "2025-01-18T07:57: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": "e86e5004d7... |
82b6222e-acbd-47f7-86b3-3170246d92dc | MisterTea/HyperNEAT | boost_1_57_0/libs/numeric/odeint/performance/openmp/osc_chain_1d_system.hpp | /* Boost libs/numeric/odeint/performance/openmp/osc_chain_1d_system.hpp
Copyright 2013 <NAME>
Copyright 2013 <NAME>
Copyright 2013 <NAME>
stronlgy nonlinear hamiltonian lattice
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or
copy at http://www.boost.org/LICE... | ALGO | 0.997216 | 5.035923 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2011-08-23T16:36:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 95,
"forks": 33,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "c0d532b... |
b40f808a-4e36-4f7c-baab-68643ba64719 | ishandutta2007/codeforces-b | beet/normal/847/E.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int N;
string S;
cin >> N;
cin >> S;
vector< int > latte, malta;
for(int i = 0; i < N; i++) {
if(S[i] == 'P') latte.push_back(i);
else if(S[i] == '*') malta.push_back(i);
}
auto check = [&](int sz)
{
int rest = 0;
auto hi... | ALGO | 0.999806 | 3.563578 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9697bd7a3f90... |
f0f79833-3b63-4a0b-bb3b-6fcc592a3d85 | wm0395/COL781_Assignments | a2-main/src/util/halfedge.cpp | #include "mesh.hpp"
#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
void Vertex::traverse(void (*func)(Face *face)){
HalfEdge *he = halfedge;
bool boundary = false;
do{
Face *face = he->left;
func(face);
//check for boundary
if(he->next->p... | ALGO | 0.99751 | 5.489629 | {
"github_metadata": {
"branch": "main",
"commit_count": 167,
"repo_created_at": "2024-01-04T10:58: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": "dd471f758b... |
3709345b-3fcd-470a-be23-3ead779ccd44 | ishandutta2007/codeforces-g | green_gold_dog/normal/1750/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
typedef long double ldb;
typedef complex<double> cd;
const ll INF64 = 9'000'000'000'000'000'000, INF32 = 2'000'000'000, MOD = 998244353;
const db PI = acos(-1);
const bool IS_FILE = false, IS_TEST_CASES = true;
random_device rd;
... | ALGO | 0.999986 | 4.815174 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:55: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": "98bf48745217... |
6442a09c-c46a-494c-ab4c-135b65bfe5be | picardo-s/exercises | Chapter7_9/Chapter7_9.cpp | #include <iostream>
#include <conio.h>
class Queue
{
private:
static const int LIM = 10;
int m_arr[LIM];
int m_head;
int m_tail;
int m_count;
public:
Queue():m_head(0), m_tail(0), m_count(0)
{}
void put(int num)
{
if (m_tail == LIM)
m_tail = 0;
if (m_cou... | ALGO | 0.941882 | 4.013401 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2021-01-06T07:39: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": "8859bc05c... |
c5ed7d79-ccee-40cd-9dae-1a4d17745a2d | lballabio/QuantLib | ql/pricingengines/basket/mceuropeanbasketengine.hpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2004 <NAME>
Copyright (C) 2007, 2008 StatPro Italia srl
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free s... | ALGO | 0.998319 | 7.121779 | {
"github_metadata": {
"branch": "master",
"commit_count": 17543,
"repo_created_at": "2015-12-17T16:29:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6151,
"forks": 1964,
"issues": 51,
"pull_requests": 11
},
"file_meta": {
"content_id":... |
291d7392-a528-49d8-b903-f1b8a1592ab7 | masterdesky/ELTE-comp-sim-2019 | V. Population Dynamics/src/popdin_log.cpp | #include <cmath>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <chrono>
#include "vector.hpp"
#include "odeint.hpp"
static double n_0; // Starting number of population
static double k; // Maximal number of population
static double w_out; ... | ALGO | 0.999689 | 5.929621 | {
"github_metadata": {
"branch": "master",
"commit_count": 144,
"repo_created_at": "2019-02-12T07:58: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": "37ab5a4e... |
e6b4e676-e126-4512-b6e0-d2fa8fbda5bc | Sid-80/AI-Practical | 1.cpp | #include<iostream>
#include<vector>
#include<queue>
using namespace std;
void bfs(vector<vector<int>> adj, int start, int n){
vector<int> vis(n,0);
queue<int> q;
q.push(start);
vis[start] = 1;
while(!q.empty()){
int front = q.front();
q.pop();
cout<< front << " -> ";
... | ALGO | 0.999997 | 5.387188 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-05-07T03:57:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "884082e1cf66... |
589fcfe4-4e56-4abd-9cd7-955f72046240 | joseraulperezrodriguez/algorithms-and-datastructures | src/graphs/bfs.cpp | /*
koder : melkor
TASK : Breadth-first search of graph G = (V,E)
Note : Assuming G is directed (nonetheless, the algorithm is also
correct if E consists of undirected edges)
Running time: O(V + E)
*/
#include <cstdio>
#include <queue>
#include <bits/stdc++.h>
using namespace std;
#define MAXV 10... | ALGO | 0.999847 | 4.969235 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2018-08-19T14:41: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": "85597f566... |
2d871590-47b6-43ad-b167-205552d0f9c0 | amov-lab/Prometheus | Modules/motion_planning/min_snap_trajectory/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/performance/odeint_rk4_lorenz_array.cpp | /*
* odeint_rk4_lorenz.cpp
*
* Copyright 2009-2012 <NAME>
* Copyright 2009-2012 <NAME>
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or
* copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#include <boost/array.hpp>
#include <boost/numeric/odeint/stepp... | ALGO | 0.963303 | 5.438536 | {
"github_metadata": {
"branch": "main",
"commit_count": 1572,
"repo_created_at": "2019-12-03T06:28:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2835,
"forks": 441,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "6d0b0... |
88768d5b-cd6b-4fec-be0c-4e7c740b0a8a | Preyansh06/LeetCode-problems | SymmetricTree.cpp | class Solution {
public:
bool f(TreeNode *root1, TreeNode* root2) {
if(!root1) return !root2;
if(!root2) return !root1;
return (root1->val == root2->val) && f(root1->left, root2->right) && f(root1->right, root2->left);
}
bool isSymmetric(TreeNode* root) {
if(!root) return tru... | ALGO | 0.999998 | 6.424006 | {
"github_metadata": {
"branch": "main",
"commit_count": 138,
"repo_created_at": "2022-02-23T17:06: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": "8dd8bbd50e... |
32fd7a37-1c49-4ddb-a178-2c4888929379 | ishandutta2007/codeforces-z | zemen/normal/571/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define sz(x) ((int) (x).size())
#define forn(i,n) for (int i = 0; i < int(n); ++i)
#define forab(i,a,b) for (int i = int(a); i < int(b); ++i)
typedef long long ll;
typedef long double ld;
const int INF = 1000001000;
const ll INFL = 2000000000000001000;
int solve();
i... | ALGO | 0.999978 | 3.801715 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:43:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d10477d0fc51... |
6c81641f-d8ab-47cc-870a-e67d8bb198fa | Gilpop8663/Altudy | BOJ/1256_사전/Gilpop8663.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, k;
long long dp[105][105];
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m >> k;
for (int i = 1; i <= 100; i++)
{
dp[i][0] = 1;
dp[0][i] = 1;
}
for (int i = 1; i <= 100; i++)
{
for (... | ALGO | 0.999958 | 3.633476 | {
"github_metadata": {
"branch": "master",
"commit_count": 1719,
"repo_created_at": "2022-03-01T10:54:28.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "zerochae/Altudy",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_i... |
9c56d198-7582-4b07-8ea8-a8cb471d3088 | rtaylo45/libowski | include/sourceTerms/wallDeposition.h | //*****************************************************************************
// Author: <NAME>
//
// Defines the wall deposition souce term.
//
// Model:
// m_dot = dC_surface/dt = (h*A/V)*(C_liquid - C_surface)
// = dC_liquid/dt = (h*A/V)*(C_surface - C_liquid)
//
// m_dot = Mass transfer rate [... | TOOL | 0.926776 | 4.976688 | {
"github_metadata": {
"branch": "main",
"commit_count": 398,
"repo_created_at": "2019-08-01T17:08:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "b8c7671d77... |
02b0080a-7f5a-4bf5-ad66-0d50393708d5 | Tencent/TNN | examples/base/youtu_face_align.cc | // Tencent is pleased to support the open source community by making TNN available.
//
// Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy o... | ALGO | 0.964453 | 5.200011 | {
"github_metadata": {
"branch": "master",
"commit_count": 2512,
"repo_created_at": "2020-05-29T07:20:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4549,
"forks": 771,
"issues": 306,
"pull_requests": 9
},
"file_meta": {
"content_id": "a... |
5c403d18-121e-43e2-9331-af4e9a42d707 | BuBaKaNg/quan_li_sinh_vien | dslk_vong.cpp | #include "dslk_vong.h"
dslk_vong::dslk_vong(){
last = nullptr;
}
bool dslk_vong::isEmpty(){
if (last == nullptr) return true;
return false;
}
dslk_vong::node* dslk_vong::tim_vet_can(QString &msv){
if (last == nullptr) return nullptr;
node* p = last->next;
while (p != last){
if (p->sv... | TOOL | 0.971647 | 3.483331 | {
"github_metadata": {
"branch": "develop",
"commit_count": 13,
"repo_created_at": "2025-05-06T12: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": "6d1f963a... |
9ea4e5d6-3af3-4833-ab6f-7ad5daa2dbac | hyschive/dori | src/DataTransfer.cpp | #include "Dori.h"
#ifdef HYBRID_SCHEME
static real (*Buffer)[3];
#endif
//---------------------------------------------------------------------------
// Function : DataTransfer_Force
// Description : Transfer data between different processes when calculating force
//-------------------------------------------... | ALGO | 0.999816 | 4.902394 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2020-10-11T08:34:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5358e15b12d... |
5cf1d58e-00bd-461a-92ad-c8dbf42a5eae | Doraemon9z/leetcode | Linked List/234.回文链表.cpp | /*
* @lc app=leetcode.cn id=234 lang=cpp
*
* [234] 回文链表
*/
// @lc code=start
/**
* 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) : ... | ALGO | 0.999918 | 6.339483 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-03-07T08:19: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": "5c59f64bffe8... |
9f4a9b23-dd21-4212-b7f8-d5450bf81ea5 | luzh0422/LeetCode | LeetCode3258.cpp | //
// Created by luzehui on 2024/11/12.
//
#include "LeetCode3258.h"
#include <vector>
int LeetCode3258::countKConstraintSubstrings(std::string s, int k) {
int n = s.size();
vector<int> zeroCount(n + 1, 0);
vector<int> oneCount(n + 1, 0);
for (int i = 0; i < n; i++) {
zeroCount[i + 1] = zeroCo... | ALGO | 0.999808 | 5.90518 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-03-12T13:31: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": "7214671b07... |
6705d685-cea6-464e-aa6d-397e07900b60 | raincross7/code-similarity | codes/train_code/problem290/problem290_62.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,x,n) for(int i = x; i < n; i++)
#define MAX 100
#define INF 1000000001
// enum {
// AST_INT,
// AST_SYM,
// AST_STR,
// AST_FUNCALL,
// };
// double winProb(int Rp, int Rq) {
// return 1/(1+pow(10, (Rq-Rp)/400.));
// }
// int R[1<<10];
// doub... | ALGO | 0.99999 | 4.166719 | {
"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": "a078dd18acaf... |
874ae84d-5466-4200-921d-a35d24e6cb53 | darrylteo/cp4-solutions | kattis misc for fun/armcoordination.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
//freopen("error.txt", "w", stderr);
std::ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int x, y, r;
cin >> x >> y >> r;
cout << x - r << " " << ... | ALGO | 0.999914 | 4.108206 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-07-03T16:45:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9448fe811c53... |
76f1bf62-4221-40eb-876a-99d6fd9643f9 | SmriteePoudel/DataStructure | DFS2.cpp | //Number of Provinces
class Solution {
public:
int findCircleNum(vector<vector<int>>& isConnected) {
int n = isConnected.size();
vector<bool> visited(n, false);
int provinces = 0;
for (int i = 0; i < n; i++) {
if (!visited[i]) {
... | ALGO | 0.99992 | 6.172729 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2025-02-12T09:26: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": "cc2fcd93318... |
74716b9a-4d69-40d6-815f-01f1416a09ea | Alberto-SC/Reference | Problems/codingNinjas/catchBrackets.cpp | #include<bits/stdc++.h>
using namespace std;
pair<int,int> dp[307][307][200];
int nxt[307][307][200];
char grid[307][307];
map<char,int> mp = {{'(',1},{')',-1}};
int n,m;
pair<int,int> solve(int row,int col,int cont){
if(cont<0)return {-(1e9),0};
if(row == 0 || grid[row][col]== '*'){
if(cont != 0){
return ... | ALGO | 0.999961 | 3.605213 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-05-06T19:31:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "657007d58... |
ec9b8f04-ebb0-40bc-bb97-1cc9f1d1e747 | tanyakumari18/tanyaday1cdev | octal binary.cpp | #include <stdio.h>
int main() {
/*Define an array of octal digits to binary */
int octalDigitToBinary[8] = {0, 1, 10, 11, 100, 101, 110, 111};
long binaryNumber, octalNumber = 0, binaryCopy;
int threeDigits, multiple, counter;
multiple = 1;
/*
* Take a binary nu... | ALGO | 0.962897 | 4.244654 | {
"github_metadata": {
"branch": "masters",
"commit_count": 2,
"repo_created_at": "2021-08-03T13:12: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": "6bc8166db... |
42788ab1-80e4-4193-8154-07b81ff4ef0a | jokkebk/codeforces | r350/main.cc | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <tuple>
#include <algorithm>
using namespace std;
#define REP(n) for(__typeof(n) _i=0; _i<(n); ++_i)
#define FOR(i,v,b) for(__typeof(b) i=v; i<b; ++i)
#define FORE(i,v,... | ALGO | 0.999927 | 3.036551 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2014-08-06T20:37: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": "c0bacbdb... |
0ad05ede-4334-44e7-8ff7-5c805df9a943 | 0-jij-0/CompetitiveProgramming | CSES Problem Set/11 - Additional Problems/Grid Puzzle II.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll INF = 1ll << 40;
struct Edge {
int u, v; ll cap, cost, flow = 0; Edge() {}
Edge(int _u, int _v, ll _cap, ll _cost) :
u(_u), v(_v), cap(_cap), cost(_cost) {}
};
struct Graph {
vector<vector<int>> nodes; int n;
vector<Edge> edges; int m = 0;
... | ALGO | 0.999793 | 3.982846 | {
"github_metadata": {
"branch": "main",
"commit_count": 256,
"repo_created_at": "2021-02-01T07:57:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c88355f9... |
fcb5bd6c-7f70-47f4-a64a-c2d4997a89fa | bg2b/aoc21 | 10/doit2.cc | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stdio.h>
#include <assert.h>
using namespace std;
struct token {
int type;
bool closing;
token(char c);
bool is_mismatch(token const &t) const;
int points() const;
};
token::token(char c) {
static string valid("()[]{... | ALGO | 0.999607 | 5.228929 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2021-12-09T13:55:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b18abb94c3... |
ab295e02-ed64-4c3d-a6c4-c4734a524990 | AbdullahEweida/Cpp-Problem-solveing-level-1 | C++ Claculate The Sum And Average.cpp | #include <iostream>
#include <cmath>
#include "string"
using namespace std;
void ReadTheLengthOf_Array (int &length,float Arr1[100])
{
cout<<"Please Enter The Length of Array from 1:100 : ";
cin>> length;
for (short int i = 0; i <= length-1; i++)
{
cout<<"Enter The Element "<<i+1<<" : ";
... | TOOL | 0.91792 | 3.592492 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-01-04T19:18: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": "f0c5a0943550... |
9c5b9b8f-b393-4fc6-80d6-d73639a7f348 | elcano/elcano | libraries/Kalman/Matrix.cpp | // Matrix.cpp : Matrix class implementation.
// C++ implementation of Python code.
// From Udacity CS 373 Artificial Intelliegence for Robots.
// Taught by <NAME>.
// C++ version by <NAME>; March 6, 2012.
//#include "stdafx.h" // required for MSVC. Remove for Arduino.
#include <math.h>
#include "Matrix.h"
#if... | ALGO | 0.984961 | 4.784566 | {
"github_metadata": {
"branch": "master",
"commit_count": 800,
"repo_created_at": "2013-03-11T23:41:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 72,
"forks": 72,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "59f8fd5... |
924d3685-fe9c-4dae-a83c-0aff2745864f | aijunbai/pfs | src/math/geomalgo.h | #ifndef __GEOM_ALGO_H__
#define __GEOM_ALGO_H__
#include "gvector.h"
namespace GVector {
// returns distance from point p to line x0-x1
template <class num>
num distance_to_line(const vector2d<num> x0,const vector2d<num> x1,const vector2d<num> p)
{
// dot with unit length normal to line
return(fabs((x1 - x0).nor... | ALGO | 0.999563 | 5.717508 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2015-09-09T19:13:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb980461... |
8c48d995-d664-4a07-9065-41ebc72cee13 | alifnafis/CPP | LeetCode/maxAreOfIsland.cpp | class Solution {
public:
int maxAreaOfIsland(vector<vector<int>>& grid) {
int m = grid.size(), n = grid[0].size();
int ans = 0;
for(int i = 0; i < m; i++){
for(int j = 0; j < n; j++){
if(grid[i][j] == 1){
ans = max(ans, dfs(grid, i, j)... | ALGO | 0.99993 | 6.6237 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-01-20T14:27: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": "63f5b8f5ae... |
561d3c4a-f399-41e6-b159-35b51a17f957 | svkrll/LU-QR-cpp | test7.cpp | #include <iostream>
#include <stdexcept>
#include "all.cpp"
#include <cmath>
using namespace std;
int main(){
//
// Пример 7. Решение несовместной системы 3x3 через LU разложение
//
LUMatrix<double> A(3, 3);
LUMatrix<double> b(3, 1);
A.set(0, 0, 1); A.set(0, 1, 2); A.set(0, 2, 3);
A.set(1, 0, 4); A... | ALGO | 0.991174 | 4.382917 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-02-17T14:44: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": "b18c9be347ab... |
9da9e38b-ddc1-4e11-9303-745877441963 | vignesh-cloud-prog/Data-Structures-and-Algorithms | linkedList/doublyLinkedList/doublyLinkedListUsingStack.cpp | #include <iostream>
using namespace std;
#define N 5
int s1[N], s2[N];
int top1 = -1, top2 = -1;
int count = 0;
void traverse()
{
if (top1 == -1)
{
cout << "Queue is empty\n";
}
else
{
cout << "Queue elements are\n";
for (int i = 0; i < N; i++)
{
cout <<... | ALGO | 0.998087 | 4.167782 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2020-11-21T07:44:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7fb35225f9c... |
a1e5e1a1-6286-4415-a0ff-73143eb31dcf | CarterRock49/CPlusPlus_2022_Projects | TruthTables/TruthTables.cpp | #include <iostream>
using namespace std;
//checks problem questions for true or false for a specfic requested row
bool logicstatments(int problemnum, bool a, bool b, bool c){
switch (problemnum)
{
case 0:
return (a && b) || (a && c);
break;
case 1:
return (a && c) && (b && !c);... | ALGO | 0.998531 | 4.200758 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-08-01T18:14: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": "da032fb5f0c6... |
f7962abf-5036-4d69-9688-8d6f90764221 | wyrover/book-code | 3rdparty/boost/geometry/algorithms/detail/distance/polygon_to_segment_or_box.hpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2014, Oracle and/or its affiliates.
// Contributed and/or modified by <NAME>, on behalf of Oracle
// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTA... | ALGO | 0.999746 | 7.249238 | {
"github_metadata": {
"branch": "master",
"commit_count": 192,
"repo_created_at": "2016-07-24T07:29:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 388,
"forks": 248,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a8a... |
2dd85290-0580-4d7d-bc4c-3a5c915efe4e | PasaOpasen/6-course-tasks | Alexeev/CPP/Theme3/4lab/mult.cpp |
#include "mult.h"
using namespace std;
void ijk(double **&A, double **&B, int a_rows, int b_cols, int vec_len, double **&C)
{
int i, j, k;
for (i = 0; i < a_rows; i++)
for (j = 0; j < b_cols; j++)
for (k = 0; k < vec_len; k++)
C[i][j] += A[i][k] * B[k][j];
}
void ikj(do... | ALGO | 0.999601 | 3.798233 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2020-10-22T14:53:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5da4553de... |
2755b830-81af-4eec-99d3-dd5cf7ee4447 | david-alvarez-rosa/CppPlayground | Leetcode/1475.cpp | #include <bits/stdc++.h>
#include <gtest/gtest.h>
using namespace std;
class Solution {
public:
vector<int> finalPrices(vector<int>& prices) {
for (int i = 0; i < prices.size(); ++i) {
for (int j = i + 1; j < prices.size(); ++j) {
if (prices[j] <= prices[i]) {
prices[i] -= prices[j];
... | ALGO | 0.999942 | 6.184463 | {
"github_metadata": {
"branch": "main",
"commit_count": 283,
"repo_created_at": "2024-02-18T20:03:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ac9806dc9... |
e1b25b24-1c1b-45bf-8aaf-febee8a450fc | cesar-gz/leetcode | Heap-PriorityQueue/lastStoneWeight.cpp | /*
1046.
You are given an array of integers stones where stones[i] is the weight of the ith stone.
We are playing a game with the stones. On each turn, we choose the heaviest two stones and smash them together. Suppose the heaviest two stones have weights x and y with x <= y. The result of this smash is:
If x == y, ... | ALGO | 0.99983 | 5.117706 | {
"github_metadata": {
"branch": "master",
"commit_count": 96,
"repo_created_at": "2022-10-28T03:31: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": "54a906d97... |
24bded9b-cf50-4a2a-84f8-f721dd7cdee9 | mohammadruman/Daa-lab | lab3/roundmatrix.cpp | #include <iostream>
#include <vector>
#include <cmath>
std::vector<std::vector<int>> roundMatrix(const std::vector<std::vector<float>> &inputMatrix)
{
int n = inputMatrix.size();
std::vector<std::vector<int>> roundedMatrix(n, std::vector<int>(n, 0));
std::vector<int> rowSums(n, 0);
std::vector<int> co... | ALGO | 0.999932 | 6.216921 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-09-30T03:41: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": "7e36cc00fcb1... |
88fb81c3-393c-4975-966e-9e71b5d4498a | ai-winter/ros_motion_planning_visualizer | src/core/curve_generation/src/reeds_shepp_curve.cpp | /**
* *********************************************************
*
* @file: reeds_shepp_curve.h
* @brief: Reeds shepp curve generation
* @author: <NAME>
* @date: 2023-12-26
* @version: 1.0
*
* Copyright (c) 2024, <NAME>.
* All rights reserved.
*
* --------------------------------------------------------
*
... | ALGO | 0.997546 | 4.531697 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2023-09-05T02:27:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 44,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a73a07cf... |
ca3a7e69-e521-4fc7-bd1c-8c723234990c | scipy/scipy | scipy/sparse/sparsetools/csr.h | #ifndef __CSR_H__
#define __CSR_H__
#include <set>
#include <vector>
#include <algorithm>
#include <functional>
#include <numeric>
#include "util.h"
#include "dense.h"
/*
* Extract k-th diagonal of CSR matrix A
*
* Input Arguments:
* I k - diagonal to extract
* I n_row - number of rows... | ALGO | 0.992204 | 5.219827 | {
"github_metadata": {
"branch": "main",
"commit_count": 35672,
"repo_created_at": "2011-03-09T18:52:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13826,
"forks": 5417,
"issues": 1470,
"pull_requests": 278
},
"file_meta": {
"content_id"... |
36cc5455-18bb-48e0-94fd-c2abfd2b503e | NickCis/directx-6-1-sdk-samples | d3dim/src/pplane/pplane.cpp | //-----------------------------------------------------------------------------
// File: PPlane.cpp
//
// Desc: Direct3D sample of paper planes flying around. This sample
// demonstrates DrawPrimitives() calls introducted with DX5.
//
// Note: This code uses the D3D Sample Framework.
//
//
// Copyright (c)... | ALGO | 0.939159 | 5.332989 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-01-16T05:14:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9eb3e85da9... |
4e1e100d-f98c-4dd5-9fc3-8aee702a7a40 | MedAzizTousli/Competitive-Programming-Solutions | Codeforces/!Junior Training Sheet/A/A_Restoring_Password.cpp | #include <bits/stdc++.h>
#define int long long
#define ll long long
#define FLASH ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end))) // rep(i, 1, 5) --> {1,2,3,4} ... | ALGO | 0.999026 | 3.328062 | {
"github_metadata": {
"branch": "master",
"commit_count": 505,
"repo_created_at": "2019-04-23T21:46:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "09fdbb8b... |
e93d0b99-649a-48ee-85eb-2ca9514ec93f | skywalker114/practical9 | PolishNotation.cpp | #include "PolishNotation.h"
#include <iostream>
#include <sstream>
#include <string>
#include <stack>
using namespace std;
PolishNotation::PolishNotation(){
affix = "";
}
PolishNotation::PolishNotation(string present){
affix = present;
}
void PolishNotation::setPrefixPresent(string present){
affix = present... | ALGO | 0.996032 | 4.119333 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-05-30T14:09: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": "99d402446008... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.