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 |
|---|---|---|---|---|---|---|---|
eeec8a3c-58a2-432d-b450-c183321bec4d | reoono/competitive-programming-archive | archive/atcoder.jp/abc029/abc029_c/Main.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
using edge = pair<int, ll>;
using Graph = vector<vector<int>>;
using WeightedGraph = vector<vector<edge>>;
const ll INF = 1LL << 60;
const int INF32 = 1 << 29;
const ll MOD... | ALGO | 0.999953 | 3.355255 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-04-30T13:44: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": "76fc54bcdf... |
69044c90-1123-4830-98e3-61a3e99cbbe0 | M-E-U-E/Leetcode | 40. Combination Sum II.cpp | #include<bits/stdc++.h>
#define ll long long
#define endl "\n"
using namespace std;
bool cmp(pair<int,int>a,pair<int,int> b)
{
if(a.first > b.first)
return true;
else if(a.first == b.first and a.second<b.second)
return true;
return false;
}
//vector<ll>v;
//void primeFactors(ll n)
//{
// ... | ALGO | 0.999977 | 4.894985 | {
"github_metadata": {
"branch": "main",
"commit_count": 157,
"repo_created_at": "2024-04-02T23:26: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": "665fa04fef... |
b3a5b02f-bdce-4920-ac5d-357d6c309ada | cartographer-project/cartographer | cartographer/mapping/2d/probability_grid.cc | /*
* Copyright 2016 The Cartographer Authors
*
* 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... | ALGO | 0.970081 | 7.487133 | {
"github_metadata": {
"branch": "master",
"commit_count": 1177,
"repo_created_at": "2016-08-02T06:55:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7491,
"forks": 2285,
"issues": 223,
"pull_requests": 12
},
"file_meta": {
"content_id": ... |
ceda8fe4-6489-4f3f-8a84-1dcace3ac8e2 | YoshikiTakashima/vert | benchmark/cpp_transcoder/PROGRAM_COUNT_OCCURRENCE_GIVEN_CHARACTER_STRING/PROGRAM_COUNT_OCCURRENCE_GIVEN_CHARACTER_STRING_towasm_mutated.cpp | #include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <stdbool.h>
int min(int x, int y) { return (x < y)? x: y; }
int max(int x, int y) { return (x > y)? x: y; }
int cmpfunc (const void * a, const void * b) {return ( *(int*)a - *(int*)b );}... | ALGO | 0.999829 | 3.816129 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2023-11-26T18:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f83f1a02d... |
b634c874-0794-411a-89e8-6248aa57764f | khasion/Codeforces | problems/1490b.cpp | #include <iostream>
#include <algorithm>
#include <cmath>
#include <limits.h>
#include <vector>
int solve(int c0, int c1, int c2, int n) {
if (c0 == c1 && c1 == c2) return 0;
int p0 = INT_MAX, p1 = INT_MAX, p2 = INT_MAX;
if (c0 > n/3) p0 = solve(c0-1, c1+1, c2, n) + 1;
else if (c1 > n/3) p1 = solve(c0, c1-... | ALGO | 0.999349 | 4.327585 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-10-14T13:59: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": "edf5146d4884... |
100833ec-6905-4a55-9c04-13efe58be0f9 | xuesongzh/MultiMedia | SimpleH264Analyzer/demo/restoreMatrix/restoreMatrix/restoreMatrix.cpp | /*
将长度为16的一维数组按照zig-zag顺序,分16次插入到16×16矩阵中;
*/
#include <stdio.h>
int coeff[16][16] = { 0 };
const int SNGL_SCAN[16][2] =
{
{ 0, 0 }, { 1, 0 }, { 0, 1 }, { 0, 2 },
{ 1, 1 }, { 2, 0 }, { 3, 0 }, { 2, 1 },
{ 1, 2 }, { 0, 3 }, { 1, 3 }, { 2, 2 },
{ 3, 1 }, { 3, 2 }, { 2, 3 }, { 3, 3 }
};
/*
函数名:insert_matrix
参数:
(i... | ALGO | 0.999447 | 3.039653 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2021-02-17T02:41:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 87,
"forks": 41,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "88b051d47... |
f18aca59-ea90-4aa5-8e60-f15f7793bc94 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/12/1220/personal_submission/cf165d_tsreaper.cpp | #include <bits/stdc++.h>
#define MAXN ((int) 1e5)
#define MAXP 20
using namespace std;
int n, A[MAXN + 5][2];
vector<int> e[MAXN + 5];
int clk, bgn[MAXN + 5], fin[MAXN + 5], dep[MAXN + 5], pa[MAXN + 5][MAXP];
int tree[MAXN + 5];
int lb(int x) { return x & (-x); }
void add(int pos, int val) {
for (; pos <= n; po... | ALGO | 0.999737 | 4.309833 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "6c74... |
3fa092ca-b67c-475f-a1b9-1939b0853239 | meox3259/XCPC | Code/diverta2019E.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int P = 1e9 + 7;
const int maxn = 1e6 + 5;
int n, d, h;
ll dp[maxn], sum[maxn];
ll power(ll x, ll t) {
ll ret = 1;
for(; t; t >>= 1, x = x * x % P) {
if(t & 1) {
ret = ret * x % P;
}
}
return ret;
}
int main() {
cin >> n >> h >> d;
l... | ALGO | 0.999911 | 4.212231 | {
"github_metadata": {
"branch": "master",
"commit_count": 340,
"repo_created_at": "2020-03-12T08:25:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e73f1b19... |
450be3f7-5647-4442-8d0f-46ec925199da | dianab5319/cis202 | projects/final-project/main.cpp | /*
FileName: main.cpp
Description: The program creates seven objects of type Mountain. Each object is set with it's mountain name,
country, and elevation. It is also able to convert the elevation value from feet to meters.
The program will output each object's information as well as the shortes... | TOOL | 0.951259 | 4.487949 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-05-25T16:36: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": "60fc8e966b1... |
9eba7928-01f7-4327-aa56-6496f37afd1d | joseph97svk/concurrente22b-Joseph_Valverde | exercises/DataP/Ejercicio_46_fence_parallelization/cpp/fence.cpp | #include <cassert>
#include <iostream>
#include <limits>
#include <map>
#include <vector>
// Data type declarations
typedef short coord_t;
typedef long perimeter_t;
static const perimeter_t min_perimeter = std::numeric_limits<perimeter_t>::min();
struct cell_t
{
// Distance from the cell to the closest right marsh
... | ALGO | 0.999964 | 4.824284 | {
"github_metadata": {
"branch": "master",
"commit_count": 174,
"repo_created_at": "2023-12-10T21:49: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": "f3c75a7f... |
4d0bdf28-a901-4c93-9b09-0028d4a93167 | Sujal-prajapati07/College_programs | sem 4/Data Structure/UNIT3/stack_using_array.cpp | #include<iostream>
using namespace std;
int stack[5];
int n=5,top=-1;
void push(int val) //stack create
{
cout<<"Enter -1 to end"<<endl;
cout<<"Enter value to be pushed : "<<endl;
cin>>val;
while(val!=-1)
{
if(top>=n-1)
{
cout<<"Stack overflow"<<endl;
}
... | ALGO | 0.993086 | 3.7915 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2025-02-21T15:01:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "515383dbcb6... |
dbfcf204-2a32-424e-aae1-112cf5aa35ec | CQ-Quest/Data-structure | Tree/Segment_Tree/Chairman_Tree/2021Niu7 Xay loves trees.cpp | /*2021牛客多校第七场 F xay loves trees,求最大子集
动态主席树dfs序+懒标记
dfs序性质:dfs序的区间要么某个区间全部包含某个区间,要不就是两个区间没有交集
在第二棵树上跑一边dfs,得到了dfs序,每个点就有一个区间[l,r]
主席树维护从根节点到链上的最大深度。每次插入新节点,询问不符合节点的id,
由于区间不相交,这样的值最多一个
*/
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N=3e5+5;
typedef long long ll;
struct Chairman... | ALGO | 0.99982 | 4.58577 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-04-28T02:13:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "387ddebd3700... |
9b69aa1e-ea75-4e56-a077-1449dd9de61a | Tencent/ncnn | src/layer/einsum.cpp | // Copyright 2022 Tencent
// SPDX-License-Identifier: BSD-3-Clause
#include "einsum.h"
#include <string.h>
namespace ncnn {
Einsum::Einsum()
{
one_blob_only = false;
support_inplace = false;
}
int Einsum::load_param(const ParamDict& pd)
{
Mat equation_mat = pd.get(0, Mat());
const int equation_len ... | ALGO | 0.989485 | 5.453972 | {
"github_metadata": {
"branch": "master",
"commit_count": 3535,
"repo_created_at": "2017-06-30T10:55:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 21795,
"forks": 4291,
"issues": 1037,
"pull_requests": 82
},
"file_meta": {
"content_id"... |
e992fa96-16d9-425a-8084-bac83c83175c | Jiajun-Ji/2023-7th-China-College-IC-Competition-AWCloud-Cup | Project_Src/NNA_Src/nna/Paddle-Lite/lite/backends/fpga/KD/pes/depthwise_conv_pe.hpp | /* 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 by applicable law or... | TOOL | 0.929928 | 4.70589 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2024-12-01T13:46:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc6b3add37... |
29bed3b2-15c0-44d1-8d06-1e773be4c87a | Gaurang03/DSA-Questions | DPP7/1_BST_operations.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
const long long ONE_SIXTH = 166666668;
struct Node
{
int data;
struct Node *left;
struct Node *right;
Node(int val)
{
data = val;
left = NULL;
right = NULL;
}
};
Node *searchInBST(... | ALGO | 0.999995 | 3.774972 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-03-12T09:20: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": "7299fad1c81e... |
abdc4520-03a2-4d89-a3b6-81e4478597ed | al-martyn1/umba_tokenizer | inc/umba/tokenizer/parsers/utils.h | /*! \file
\brief Утилиты
*/
#pragma once
//----------------------------------------------------------------------------
// umba::tokenizer::utils::
namespace umba {
namespace tokenizer {
namespace utils {
//----------------------------------------------------------------------------
//-----------------------... | TOOL | 0.901046 | 6.446618 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2024-10-05T14:45:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "118d73d048... |
377a3806-dbfa-447b-8898-3ff6b0ba0cba | warwick-hpsc/CPX | mg-cfd/src/euler3d_cpu_double.cpp | // Copyright 2009, <NAME>, <EMAIL>
// This code is from the AIAA-2009-4001 paper
// Warwick extensions:
// - multigrid, per-edge computation, n-neighbours
// - residual calculation, solution validation
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <cmath>
#include <string>
#include <omp.h>
#inclu... | ALGO | 0.95273 | 4.329208 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-02-17T10:42:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f19a059e49231... |
504cdbb4-d031-442f-bc1e-7de249d3fa62 | Natpanzarini/Data-Structures-in-C- | project_1/calc.cpp | //Header File for Project 1 - <NAME> 5170525
#include <iostream>
#include <cmath>
#include <string>
#include <sstream>
#include <math.h>
#include <limits>
#include <vector>
#include <cstdlib>
#include <unistd.h>
#include "header.h"
using namespace std;
int main(int argc, char *argv[]){
char op, c;
unsigned i... | ALGO | 0.966693 | 4.383917 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-05-23T02:42: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": "4294bf977a... |
4c2902db-608d-478b-a309-b355418fdce8 | BFDestroyeer/pp_2020_autumn_informatics | modules/task_1/yurin_s_sum_of_values_by_matrix_rows/sum_of_values_by_matrix_rows.cpp | // Copyright 2020 <NAME>
#include <mpi.h>
#include <vector>
#include <string>
#include <random>
#include <ctime>
#include <algorithm>
#include "../../../modules/task_1/yurin_s_sum_of_values_by_matrix_rows/sum_of_values_by_matrix_rows.h"
std::vector<int> getSequentialSumOfMatrixRows(std::vector<int> matrix, int number_... | ALGO | 0.999837 | 4.973459 | {
"github_metadata": {
"branch": "master",
"commit_count": 1525,
"repo_created_at": "2020-10-08T08:09:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 69,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a8721... |
3f1cf31b-c197-4204-9535-cdee804e5cd9 | lifev/lifev | lifev/electrophysiology/solver/IonicModels/IonicLuoRudyI.cpp | //@HEADER
/*
*******************************************************************************
Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
This file is part of LifeV.
LifeV is free software; you can redistribute it a... | ALGO | 0.987273 | 4.307125 | {
"github_metadata": {
"branch": "master",
"commit_count": 12133,
"repo_created_at": "2012-11-06T15:58:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 36,
"forks": 30,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5fab... |
88a93945-a587-46b2-aa06-898ddb12dc9e | vishnurudhva/problem-solving | 5-longest-palindromic-substring/5-longest-palindromic-substring.cpp | class Solution {
public:
string longestPalindrome(string s) {
int maxLen = 1, start = 0, size = s.length();
for (int i = 0; i < size; i++) {
int len = 0;
if (i > 0 && s[i] == s[i - 1])
len = getPalLength(s, i - 1, i);
if (i > 0 && i + 1 < size && s... | ALGO | 0.99999 | 6.079081 | {
"github_metadata": {
"branch": "main",
"commit_count": 784,
"repo_created_at": "2022-01-15T09:34: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": "ae79865b3b... |
1ac0d989-92ea-4860-b1ca-97a95e9b100a | Natureal/Codeforces | Regular_competitions/610_2_C.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for(int i = a; i <= b; ++i)
#define DEC(i, a, b) for(int i = a; i >= b; --i)
#define getmid(l,r) ((l) + ((r) - (l)) / 2)
#define MEM(a,b) memset(a,b,sizeof(a))
#define FI first
#define SE second
#define SZ(x) ((int)(x).size())
#define MP make_pair
#def... | ALGO | 0.999904 | 3.19303 | {
"github_metadata": {
"branch": "master",
"commit_count": 104,
"repo_created_at": "2019-12-17T09:33: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": "f4baeb07... |
20a348e6-96cd-4deb-a6b3-cc26dd6f7298 | Delires/welcome-to-Cpp-world | 黑马-程序/0.1一些基本语法/1.0结构体(数组 指针 嵌套 做参数)/1.1结构体+冒泡法应用.cpp | /**
设计一个英雄的结构体,包括成员姓名,年龄,性别;创建结构体数组,数组中存放5名英雄。
通过冒泡排序的算法,将数组中的英雄按照年龄进行升序排序,最终打印排序后的结果。
五名英雄信息如下:
{"刘备",23,"男"},
{"关羽",22,"男"},
{"张飞",20,"男"},
{"赵云",21,"男"},
{"貂蝉",19,"女"},
**/
#include "iostream"
#include "string"
using namespace std;
#define number 5
//结构体 数组的定义都放函数外 这样存储不再栈区,而在堆区。单片机不会卡死
struct Hero
{
... | ALGO | 0.999454 | 3.671383 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2020-10-31T03:07: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": "7b4a531845d5... |
427601da-69e0-4699-b971-84e0d282186e | orkzking/openxfem | skyline.h | // *********************
// *** CLASS SKYLINE ***
// *********************
#ifndef _SKYLINE_H_
#define _SKYLINE_H_
#include "lhs.h"
#include "column.h"
#include "flotarry.h"
#include <stdio.h>
class Domain ; class FloatMatrix ;
//! A Skyline matrix
/*!
This class implements a symmetric matrix stored in a ... | TOOL | 0.908799 | 6.169157 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2016-03-15T13:18: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": "cf99e3ffd... |
8d4793e1-0f2a-4284-a942-2b9dda61917d | Riccard0Fazzi/Sport-video-analysis-for-billiard-matches | src/main.cpp | #include <opencv2/opencv.hpp>
#include <iostream>
#include "../include/field_detection.h"
#include "../include/ball_detection.h"
#include "../include/homography.h"
#include "../include/classification.h"
#include "../include/trajectory_tracking.h"
#include "../include/bounding_box.h"
using namespace cv;
using namespace ... | ALGO | 0.947308 | 5.430984 | {
"github_metadata": {
"branch": "main",
"commit_count": 152,
"repo_created_at": "2024-05-29T17:36: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": "c95128be02... |
b841109b-e68f-460d-b68b-fab05905c8b1 | TruVortex/Templates | Numbers/Big-Number.cpp | #include <iostream>
#include <string>
using namespace std;
struct BigNum {
static const int SZ = 300;
int arr[SZ];
BigNum(string n = "") {
for (int i = 0; i < SZ; i++) {
arr[i] = 0;
}
for (int i = 0; i < n.length(); i++) {
arr[i] = n[n.length() - i - 1] - ... | ALGO | 0.999896 | 3.998603 | {
"github_metadata": {
"branch": "main",
"commit_count": 136,
"repo_created_at": "2021-11-30T00:20:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "21d04f456d... |
a18390e0-df8a-45b6-8824-9927e3c88641 | superAman07/Cpp-basic-STL-to-advance-DSA | 105.Tail_Recursion_exercises.cpp | //this is not the example of tail recursion
#include<bits/stdc++.h>
using namespace std;
void fun(int n){
if(n==0)return;
fun(n-1);
cout<<n<<" ";
}
int main(){
fun(5);
return 0;
}
// //o/p:- 1 2 3 4 5
#include<iostream>
using namespace std;
int fact(int n){
if(n==0 || n==1)return 1;
retur... | ALGO | 0.999563 | 5.434423 | {
"github_metadata": {
"branch": "main",
"commit_count": 357,
"repo_created_at": "2023-11-14T07:00: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": "17862e134b... |
2bc8d515-d5ed-444d-a67e-15d4731cfe85 | tinylcy/snippets | LeetCode/064-Minimum-Path-Sum/MinimumPathSum.cpp | /* Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right
which minimizes the sum of all numbers along its path.
Note: You can only move either down or right at any point in time. */
/* 思想:动态规划:递推方程为dp[i][j]=grid[i][j]+min(dp[i][j-1],dp[i-1][j]) */
#include <iostream>
#include... | ALGO | 0.99996 | 5.03988 | {
"github_metadata": {
"branch": "master",
"commit_count": 168,
"repo_created_at": "2015-07-06T14:36:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e517af1... |
40a642f4-5311-41a8-a09e-d2377332c215 | MarianoReyes/Lab2_Paralela | ejercicio1Paralel.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <omp.h>
#include "qsort.c" // Include the sorting function declaration from qsort.c
#include <vector>
#include <string>
#include <sstream>
#include <fstream>
using namespace std;
int main()
{
clock_t start_time = clock();
int N;
cout << "Ing... | ALGO | 0.999712 | 5.123989 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-08-24T14:22: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": "d77d9c434f1f... |
37dcecfb-494c-49de-abb4-e5f10692dee4 | ToRattt/-inh-C-ng | program.cpp | #include<iostream>
#include<string>
#include<vector>
#include<utility>
using namespace std;
class xe{
private:
string plate;
string timein;
public:
xe(string timein, string plate){
this->plate = plate;
this->timein = timein;
}
string getTimein(){
... | ALGO | 0.952781 | 3.939418 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-06-11T08:53:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ea77f675126... |
00d62715-8733-4273-9340-0069669ed38a | chasieee/PraktikumAP1 | STRUCT NO.1.cpp | #include <iostream>
#include <string>
using namespace std;
struct hitung {
int pemb;//pembilang
int peny;//penyebut
};
int main (){
hitung x, y, hasil1, hasil2, hasil3, hasil4;
int temp = 0;
cout << "==== PROGRAM MENGHITUNG PECAHAN ====\n";
cout << "====================================\n";
cout << en... | ALGO | 0.987738 | 4.695211 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2021-09-21T13:21: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": "62fc848eadd3... |
9b1e2043-3a0c-4ea5-84aa-87dbdb6c1cb9 | ishandutta2007/codeforces-n | natsugiri/normal/711/A.cpp | #include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
typedef long long LL;
typedef vector<int> VI;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=(c).end();i!=i##_e... | ALGO | 0.999607 | 3.420377 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:35: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": "0ccc4b47218d... |
ef5b97ba-6c42-4f2f-a5bd-9c88c2a3f11d | ishandutta2007/codeforces-i | ilya_msu/normal/1017/B.cpp | #define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/STACK:256000000")
#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<algorithm>
#include<cmath>
#include<set>
#include<queue>
#include<sstream>
#include<utility>
#include<map>
#include<ctime>
#include<cstdio>
... | ALGO | 0.999939 | 3.713879 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39: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": "b2b4ae80b5d8... |
2cba3159-c8cb-4fa1-82e7-d55f853c979b | DarkOriole4/PhysicsSim-gravity | imgui/src/sim_source.cpp | #include <sim_headers.h>
#include <glm/glm.hpp>
#include <random>
#include <chrono>
#include <iostream>
#include <thread>
using namespace std;
void framerate_control (std::chrono::high_resolution_clock::time_point& start, std::chrono::high_resolution_clock::time_point& end, float& dtime, const int& target_fps) {
... | ALGO | 0.986841 | 4.503874 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2024-02-01T21:46:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f5e6752288... |
3bc6cd4f-95ad-4e50-9339-4fdebc292c3a | ermaotech/LeetCode | 1twoSum.cpp | #include <iostream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
/*
Given an array of integers, return indices of the two numbers such that they add up to a specific target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
Examp... | ALGO | 0.999928 | 5.582366 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-05-29T13:38: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": "94d6bd254... |
7b085225-3246-4be4-81f6-5d867085f68d | nataraj2/MultiphaseSolverAMReX | amrex/Src/EB/AMReX_EB_utils.H | #ifndef AMREX_EB_UTILS_H_
#define AMREX_EB_UTILS_H_
#include <AMReX_Config.H>
#include <AMReX.H>
#include <AMReX_MultiFab.H>
#include <AMReX_EB2.H>
#include <AMReX_EB2_GeometryShop.H>
namespace amrex {
#if (AMREX_SPACEDIM > 1)
void single_level_redistribute (MultiFab& div_tmp_in, MultiFab& div_out,
... | ALGO | 0.985857 | 6.677266 | {
"github_metadata": {
"branch": "master",
"commit_count": 76,
"repo_created_at": "2022-08-24T07:25:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb24c3bba... |
17df6c47-4d45-41c2-86df-8514c4f0edf4 | winnieryl/algorithms-and-structures | algorithms/substr/kmp.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
class Solution {
public:
int strStr(string haystack, string needle) {
int m = haystack.size();
int n = needle.size();
if(n == 0) return 0;
vector<int>next(n,0);
for(int i = 1, j = 0; i<n; i++)
... | ALGO | 0.99991 | 5.326427 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2017-08-23T15:11: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": "76d0f4dd9... |
2c91006d-a58c-45c2-9b57-99481970e2e3 | gtoo8888/Cplusplustest | 1-Algorithm_test/codeforces/Codeforces Round #799 (Div. 4)/B.cpp | #include <cstdio>
#include <ctime>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <unordered_map>
#include <algorithm>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define eb emplace_back
#define mp make_... | ALGO | 0.999135 | 3.549848 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2021-11-04T10:37: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": "6160ea6fa... |
7417f2ff-d16f-49c5-9aab-3bbd70ce8cf0 | pustot/my-leetcode | 0059-spiral-matrix-ii/0059-spiral-matrix-ii.cpp | class Solution {
public:
vector<vector<int>> generateMatrix(int n) {
int curr = 0;
vector<vector<int>> ans(n, vector<int> (n, 0));
for (int i = 0; i < (n + 1) / 2; i ++) {
for (int c = i; c < n - i; c ++)
ans[i][c] = ++curr;
for (int r = i + 1; r < n -... | ALGO | 0.999964 | 5.788831 | {
"github_metadata": {
"branch": "main",
"commit_count": 1204,
"repo_created_at": "2022-03-04T01:55: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": "d21a66618... |
4ad833cd-1bcb-444f-879c-2db12b7c9eb5 | kinhquocne/HCMUS | HKI/CSLT/WA8_DONE/24127230_3.cpp | #include <iostream>
using namespace std;
void sort(int n);
void swap(int *p1, int *p2);
int a[10];
int main()
{
for (int i = 0; i < 10; ++i)
{
cout << "Enter array element #" << i << ": ";
cin >> a[i];
}
sort(10);
cout << "Here is the array, sorted:" << endl;
for (int i = 0; i < ... | ALGO | 0.999416 | 4.901992 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2024-11-16T12:20: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": "31b7716067a... |
8f137887-5537-4350-804e-b11ffe7407db | KROU4/BSTU_2_SEM | ОАИП/Лабораторная 13/main/FileName.cpp | //Заполнить массив B элементами массива А с нечётными индексами,справа от которых стоят нечётные элементы
#include <iostream>
#include <time.h>
#include <windows.h>
#define MAX_5000 5000
using namespace std;
int* MAX_MASSIVA(int size);
int* ODD_ELEMENTS_TRASFER_A_B(int* A, int size);
void ShakerSort_ASCENDING(int* ... | ALGO | 0.999297 | 3.715262 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-09-17T22:29:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1a8a08d3376... |
7ec145c1-8157-4ad5-bbe1-b5c6412c45a7 | harshitn2002/DAA | Mid Sem Practicals/Practical 11.cpp | #include<iostream>
#include <cstdlib>
#include <time.h>
using namespace std;
void swap(int arr[], int i, int j)
{
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
int partition(int arr[], int low, int high,int &co,int &sw)
{
srand(time(NULL));
int ran... | ALGO | 0.999765 | 4.831292 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2022-02-28T07:51: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": "c8f77af62a4... |
326ae789-a842-420c-b0a0-af0c60d27a7d | ShenfeiPei/HamKMeans | alias_copyi_HamKMeans/HKM/HKM.cpp | #include "HKM.h"
HKM::HKM(){}
HKM::HKM(vector<vector<double>> &X, int c_true, bool debug){
this->N = X.size();
this->dim = X[0].size();
this->c_true = c_true;
this->debug = debug;
this->X.resize(N, dim);
for (int i = 0; i < N; i++)
this->X.row(i) = VectorXd::Map(&X[i][0], X[i].size())... | ALGO | 0.999373 | 4.168941 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-05-10T07:33: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": "06ad0da58cda... |
21047419-3f71-4951-b9c7-28e46d3f4e8e | ishandutta2007/codeforces-l | l7-56/normal/115/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
constexpr int maxn = 2010, mod = 1e6 + 3;
int n,f[maxn][maxn];
char s[maxn];
int dfs(int l, int r) {
if (l > r) return 0;
if (f[l][r] != -1) return f[l][r];
ll val = 0;
if (s[l] == '+' || s[l] == '-') val += dfs(l + 1, r);
for ... | ALGO | 0.9999 | 3.883831 | {
"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": "644cdd38107d... |
36ba4a23-f3e6-458b-bc8b-1e8affac8379 | Smrity01/Data-Structures-Algorithms | Array/firstPositiveMissing.cpp | #include<iostream>
#include<vector>
#include<stdlib.h>
using namespace std;
int firstPositiveMissing(vector<int> A);
int segregateIntegers(vector<int> &A);
int main(){
vector<int> A;
A.push_back(1);
A.push_back(1);
A.push_back(1);
cout << firstPositiveMissing(A);
}
int firstPositiveMissing(vector<in... | ALGO | 0.999917 | 3.724027 | {
"github_metadata": {
"branch": "master",
"commit_count": 202,
"repo_created_at": "2017-10-09T09:24:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e6aa4d0... |
ca5de522-f94a-4dcd-a68a-83323347a488 | rsummers11/CADLab | LymphNodeRFCNNPipeline/nifty_reg-1.3.9/nifty_reg/reg-apps/reg_aladin.cpp | /*
* reg_aladin.cpp
*
*
* Created by <NAME> and <NAME> on 12/08/2009.
* Copyright (c) 2009, University College London. All rights reserved.
* Centre for Medical Image Computing (CMIC)
* See the LICENSE.txt file in the nifty_reg root folder
*
*/
#ifndef _MM_ALADIN_CPP
#define _MM_ALADIN_CPP
#include "_... | TOOL | 0.938094 | 3.814996 | {
"github_metadata": {
"branch": "master",
"commit_count": 174,
"repo_created_at": "2014-09-10T19:16:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 453,
"forks": 185,
"issues": 14,
"pull_requests": 5
},
"file_meta": {
"content_id": "731... |
657df9e7-2211-4f2e-be00-40b014b0dc47 | guqiqi/Samoyeds-Kernel | benchmark/ssmm/horizontal_spmm_kernel_op.h | /*
* Copyright (c) 2025 <NAME> (<EMAIL>), <NAME> (<EMAIL>).
*
* 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.996427 | 6.260207 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-02-17T12:57: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": "8acdeb331304... |
d18f1fc2-f07c-47d0-8782-8ed02e902ec1 | ishandutta2007/codeforces-y | yousef_salama/normal/429/A.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int n, ui, vi, a[MAXN], b;
vector <int> G[MAXN];
vector <int> v;
void solve(int i, int p = -1, int f0 = 0, int f1 = 0){
if(a[i] ^ f0 != 0){
f0 ^= 1;
v.push_back(i + 1);
}
for(int u : G[i]){
if(u == p)conti... | ALGO | 0.999806 | 4.07479 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:40: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": "684f357d3d71... |
dc762b88-64bc-43c9-ab0b-d0708dfe9e7a | Source-Soul/CodeForces | Source_code/630I_ParkingLot.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define M_PI 3.1416
const long long M = 1e18 + 7;
long long mod(long long x)
{
return ((x % M + M) % M);
}
long long add(long long a, long long b)
{
return mod(mod(a) + mod(b));
}
long long mul(long long a, ... | ALGO | 0.999957 | 4.202602 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2023-10-26T05:35:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef55a9c8943... |
24372885-8b03-43af-8b87-5e55ebc09c65 | jose-dom/bitcoin_forecasting | env/lib/python3.9/site-packages/pystan/stan/lib/stan_math/stan/math/fwd/mat/fun/quad_form_sym.hpp | #ifndef STAN_MATH_FWD_MAT_FUN_QUAD_FORM_SYM_HPP
#define STAN_MATH_FWD_MAT_FUN_QUAD_FORM_SYM_HPP
#include <stan/math/fwd/core.hpp>
#include <stan/math/fwd/mat/fun/multiply.hpp>
#include <stan/math/fwd/mat/fun/dot_product.hpp>
#include <stan/math/prim/mat/fun/quad_form_sym.hpp>
namespace stan {
namespace math {
templa... | ALGO | 0.999605 | 6.845964 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-01-04T01:45:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 12,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "95ca5569... |
49588631-29a8-48d7-a0a6-f25f86e93800 | sbpl/sbpl | src/include/sbpl/utils/2Dgridsearch.h | /*
* Copyright (c) 2008, <NAME>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of cond... | ALGO | 0.999817 | 5.46572 | {
"github_metadata": {
"branch": "master",
"commit_count": 184,
"repo_created_at": "2012-11-21T15:09:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 344,
"forks": 177,
"issues": 15,
"pull_requests": 7
},
"file_meta": {
"content_id": "ba69... |
7aac771f-f1cd-4d5d-971c-8b1844b7f1bc | natasyayaya/G1F021024-Natasya-dita-Circular-single-link-list | G1F021024_CIRCULAR.cpp | #include <iostream>
using namespace std;
struct node{
int data;
node *prev;
node *next;
};
node *head, *tail, *cur, *newNode, *del, *afterNode;
void createCircular(int data){
head = new node();
head->data = data;
head->prev = head;
head->next = head;
tail = head;
}
void addFirst(int data){
if (head == NULL... | ALGO | 0.999794 | 5.082678 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-04-11T15:13: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": "39f446909a96... |
38f09d69-17d6-4726-9c50-e55f440f5703 | Raiiyf/USTC-COURSES-AI | 算法分析与设计/Lab_knapsack/DP.cpp | #include "Knapsack.h"
Result DP::solution() {
auto start = std::chrono::high_resolution_clock::now();
int n = knap.n;
int c = knap.c;
int m[n][c + 1] = {0}; // m[i][j]: choosing item from i to n - 1, with sack capacity j
int i,j;
std::chrono::high_resolution_clock::time_point now;
std::chr... | ALGO | 0.999979 | 4.658658 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2023-10-29T07:09: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": "6104bc17e41... |
736ece3b-f592-4b21-95b1-e7ce70e54c75 | vsisterolli/competitive-programming | usaco/coordinate-compression/meetings.cpp | typedef struct Cow {
int w, x, d;
Cow() {};
bool operator<(Cow &a) {
return x < a.x;
}
} Cow;
void solve() {
int n, S, sum = 0;
cin >> n >> S;
vector<Cow> cow(n);
for(int i = 0; i < n; sum += cow[i].w, i++)
cin >> cow[i].w >> cow[i].x >> cow[i].d;
sort(all(cow... | ALGO | 0.999987 | 3.449191 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2020-05-18T05:08: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": "8029420ec... |
7fd566ca-0d94-410d-b7b4-63eda2216899 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/08/0827/personal_submission/cf1290b_dinghc.cpp | #include <bits/stdc++.h>
using namespace std;
constexpr int N = 200'000;
constexpr int A = 26;
char s[N + 1];
int a[N + 1][A];
int main() {
scanf("%s", s);
int n = strlen(s);
for (int i = 1; i <= n; i++) {
for (int j = 0; j < A; j++) {
a[i][j] = a[i - 1][j];
}
a[i][s[i ... | ALGO | 0.999987 | 4.13519 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "cae2... |
5021a85d-0b0b-4f7d-b147-b097026f70d3 | gicky69/solutions-gicky | lowerboundstl.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int a;
cin >> a;
vector<int> b;
int c;
for (int i = 0; i < a; i++) {
cin >> c... | ALGO | 0.99997 | 3.62176 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2023-08-16T13:14:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf944e83ac9... |
becc8b24-876c-443c-a75b-f5e0aee368d9 | GAS-Gist-Algorithm-Study/ProblemSolving | PS_10942_PALINDROME/PJH/10942.cpp | #include <iostream>
#include <vector>
#define pii pair<int, int>
using namespace std;
int lut[2000][2000];
bool isPalindrome(const vector<int>& text, int s, int e)
{
if (lut[s][e] != -1)
return lut[s][e];
if (s + 1 == e)
return lut[s][e] = text[s] == text[e];
return lut[s][e]
= (text[s] == tex... | ALGO | 0.999966 | 4.434523 | {
"github_metadata": {
"branch": "master",
"commit_count": 260,
"repo_created_at": "2019-09-26T12:58:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "2ec310c4f... |
d1cde53b-5ac5-4bea-9935-ce32eb1090cd | pafin10/CompetitiveProgrammingExercises | competitive programming/implementation/pspspsps.cpp | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <fstream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <bitset>
#include <numeric>
#include <set>
#include <queue>
#include <unordered_map>
#include <deque>
using namespace std;
#define ll long long
... | ALGO | 0.999646 | 4.485419 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2023-09-09T12:04: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": "cee5a9cab4b... |
2dd5fa62-e5b6-4cdd-ba6c-cd43d10af0ee | Sinity/Entity-Component-System | src/utils/config.cpp | #include "config.h"
#include <fstream>
#include <boost/property_tree/xml_parser.hpp>
#include "loggerConsoleOutput.h"
#include "loggerFileOutput.h"
using namespace std::literals;
std::string loadFile(const std::string& filename);
std::pair<unsigned int, unsigned int> locationInConfig(const std::string config, size_t ... | TOOL | 0.943006 | 6.457395 | {
"github_metadata": {
"branch": "master",
"commit_count": 143,
"repo_created_at": "2014-06-01T12:12: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": "21c62ead... |
5932b1ff-9309-4073-9bc8-fac9b76995b9 | rasesh1/Leetcode | Medium/802 Find Eventual Safe States.cpp | typedef vector<int> vi;
typedef vector<vector<int>> vvi;
class Solution {
private:
bool dfs(vvi& graph, int src, vi& terminalNodes, vi& isSafe, vi& visited) {
vector<int> nbrs = graph[src];
isSafe[src] = 1;
if(terminalNodes[src] == 1) return true;
for(auto nbr :... | ALGO | 0.99999 | 6.126108 | {
"github_metadata": {
"branch": "main",
"commit_count": 99,
"repo_created_at": "2021-07-17T09:41: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": "82fdb5c2507... |
9543974e-d521-4f0b-a343-ff382e440af4 | goofycoder/goofytest | algo/include/linked_list.hpp | #ifndef LINKED_LIST_H
#define LINKED_LIST_H
/* Singly linked list */
typedef struct node {
int data;
struct node *next;
} SNode;
/* basic singly list APIs */
SNode*
buildListFromArray(const int *array, unsigned len);
/* Insert the node at the tail. */
void insertAtTail(SNode*& head, SNode* p);
void... | ALGO | 0.919178 | 5.714711 | {
"github_metadata": {
"branch": "master",
"commit_count": 237,
"repo_created_at": "2013-03-24T15:04:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "902f7b9a... |
ef30f230-03ba-420e-be01-44cce9a188cf | RK-41/GeeksForGeeks | Difficulty: Easy/Remaining String/remaining-string.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
string printString(string s, char ch, int count) {
// Your code goes here
// 16.07.24 POTD
int i=0, n=s.size();
while(i<... | ALGO | 0.999801 | 5.486587 | {
"github_metadata": {
"branch": "main",
"commit_count": 1176,
"repo_created_at": "2023-09-11T10:38:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "65a5e93d4... |
1d8b0632-e95f-4404-9287-0fb652241c54 | mgalang229/Codechef-Many-Chefs | sol.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int tt;
cin >> tt;
while (tt--) {
string s;
cin >> s;
// reverse the string (since we need to start at the back)
reverse(s.begin(), s.end());
for (int i = 0; i < (int) s.size();) {
// collect every su... | ALGO | 0.999988 | 3.806637 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-08-15T04:24: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": "93886f7ab87a... |
6e7a42aa-5f80-4c69-9f95-93a71a7a9b7c | tashpulatovaa/auca-ds-2021 | lab03/p05/main.cpp | #include <bits/stdc++.h>
template <typename C>
int sz(const C &c) { return static_cast<int>(c.size()); }
using namespace std;
class Computer
{
vector<int> registers;
vector<int> memory;
int instructionPointer;
void runCommand2(int d, int n)
{
registers[d] = n;
++instructionPointe... | ALGO | 0.999214 | 4.328306 | {
"github_metadata": {
"branch": "main",
"commit_count": 149,
"repo_created_at": "2021-09-17T05:35: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": "196cb8ed9c... |
1c3fb867-eed6-45f7-9e58-731d6f70bbcf | MHSHM/tinyrenderer | src/renderer.cpp | #include "mesh.h"
#include "Math.h"
#include "line.h"
#include "image.h"
#include "AABB.h"
#include "z-buffer.h"
#include "sampler.h"
#include "shader.h"
#include <glm/geometric.hpp>
using namespace mathy;
namespace tiny
{
inline static bool
_triangle_is_backfacing(const Triangle& triangle, const glm::vec3& ... | ALGO | 0.918147 | 6.78905 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2022-10-28T14:25:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2dffffb98c7... |
e6cd4ba8-eae9-425b-82dd-efab5c89fc82 | AmiEklasMohin/LeetCode | remove_element.cpp | /*https://leetcode.com/problems/remove-element/*/
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int removeElement(vector<int>& nums, int val) {
vector<int> result;
int counter = 0;
for (int i = 0; i < nums.size(); ++i) {
if (nums[i] != val) ... | ALGO | 0.999969 | 5.056402 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2023-10-21T06:47: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": "8e2e3517e74... |
cb072e41-9a73-4c88-93ba-ea3c73c2bafe | bodkal/cpp | A_star/a_star_3d_map_node/a_star_3d_map_node.cpp |
#include <iostream>
#include <list>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <chrono>
#include <fstream>
using namespace std;
#define size_x 1000
#define size_y 1000
struct short2 {
short x;
short y;
};
struct cell
{
short2 pos;
float g;
float f;
short val;
... | ALGO | 0.999058 | 3.487763 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2020-08-23T07:48: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": "178469a4e... |
2536e03e-23e0-4475-8bdc-aa7ca5def019 | DeniGarnica/Algoritmos2 | DenisseGarnica_problemasUVA/852 - Deciding victory in Go/852DecidingVictoryInGo.cpp | //<NAME>
//<EMAIL>
#include<bits/stdc++.h>
#define ll long long
char Go_board[10][10];
bool visitado[10][10];
int dfs(int i, int j){
if(i<0 || i>=9 || j<0 || j>=9) return 0; //Si se sale de los bordes
if(Go_board[i][j] == 'X') return 1; //Marcamos si estamos en un borde negro
if(Go_board[i][j] == 'O') return 2... | ALGO | 0.998712 | 4.377598 | {
"github_metadata": {
"branch": "main",
"commit_count": 168,
"repo_created_at": "2021-01-18T22: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": "b5a0ef5c72... |
cf0bb932-5424-4890-bc42-1240b42997e3 | NTK1100/CTF | reversing.kr/slove.cpp | #include <iostream>
#include <vector>
#include <iomanip> // Thêm thư viện này để dùng setw và setfill
int main() {
// Mảng kết quả sau khi qua các phép XOR
std::vector<uint16_t> a = {
0xD99C, 0xA9DD, 0xD98C, 0xA9CA, 0xD99D, 0xA9CF, 0xD9B2, 0xA9FA, 0xD9F8, 0xA9E4, 0xD9B9, 0xA9E5, 0xD9FA, 0xA9D6, 0xD9AF,... | ALGO | 0.999914 | 4.984081 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-25T04:33:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6118f42dd04b... |
80781952-320d-4018-ac9d-a461ded801e5 | IsraeliCoder/JobInterview-LeetCode-IL | Easy/SquaresOfASortedArray.cpp |
// https://leetcode.com/problems/squares-of-a-sorted-array/?envType=daily-question&envId=2024-03-02
class Solution {
public:
vector<int> sortedSquares(vector<int>& nums) {
/*
Given an integer array nums sorted in non-decreasing order, return an array of the squares of each numbe... | ALGO | 0.999941 | 6.447639 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2024-02-27T21:24: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": "b5130d086f4... |
80d22cca-79b7-4538-84f1-207c80bd3cd0 | aryan29/Competetive-Programming-codes | codeforces/Ehab Is an Odd Person.cpp | // Author: <NAME>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vll = std::vector<ll>;
using pll = std::pair<ll, ll>;
using vvll = std::vector<vll>;
using vpll = std::vector<pll>;
#define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define e... | ALGO | 0.999976 | 3.815566 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2019-10-01T21:06:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cfe6fa46b... |
fd8cea31-7185-492d-9db8-125974a6c6d1 | DarshanRokkad/DSA | 11_Binary_search_tree/01_BST.cpp | // Binary search tree
#include <iostream>
#include "Mystack.h"
using namespace std;
class treeNode
{
public:
int data;
treeNode *lchild;
treeNode *rchild;
treeNode(int x)
{
data = x;
lchild = rchild = NULL;
}
};
class BinarySearchTree
{
private:
treeNode *root;
public:
... | ALGO | 0.999979 | 4.791503 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-07-09T16:05:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19b974c6c8... |
2639aee1-a5f6-42ff-8327-676304152762 | kmjp/procon | srm/681-700/681/XorLists.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<to;x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ZERO(a) memset(a,0,sizeof(a))
#define MINU... | ALGO | 0.999799 | 4.655587 | {
"github_metadata": {
"branch": "master",
"commit_count": 3966,
"repo_created_at": "2015-02-15T11:25:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 2,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "d0e95b... |
c7708ae5-d7d2-40fc-a8d8-a4ed937034a4 | nukopy/libraries | beet_library/segtree/legacy/rangecountquery.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
//BEGIN CUT HERE
struct RCQ{
int n;
vector<vector<int> > dat;
RCQ(){}
RCQ(int n_,int* c){init(n_,c);}
void init(int n_,int *c){
n=1;
while(n<n_) n*=2;
dat.clear();
dat.resize(2*n-1);
build(n_,c);
}
void build(int n_,int... | ALGO | 0.999955 | 3.665854 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-02-23T12:11: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": "80b38363e2... |
1f4e7eac-ebb0-428b-8ddb-f321de6bf8f0 | doluong-opt/CodeContest | Timus/1086. Cryptography.cpp | /***********************************************
* Author - <NAME> *
* Problem 1086. Cryptography ->AC
* Algorithm number theory
* Time Limit 0.031s
* *********************************************/
#include <iostream>
#include <stdio.h>
#include <queue>
#include <stack>
#include <vector>
#include... | ALGO | 0.999793 | 3.80319 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-07-02T12:10: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": "621f70fc9c... |
fb352f54-4893-41d0-beee-744ace6f0c2e | sunhuachuang/study-demo | c_c++/demo1.cpp | #include <iostream>
#include "max.h"
using namespace std;
int a, b;
void exchange(int a, int b) {
int p;
p = a;
a = b;
b = p;
}
void exchange2() {
int p;
p = a;
a = b;
b = p;
}
void change_array(int a[]) {
a[0] = 20;
a[1] = 30;
}
int main() {
cin >> a >> b;
exchange(a, b);
cout << a << "... | ALGO | 0.999108 | 3.198206 | {
"github_metadata": {
"branch": "master",
"commit_count": 76,
"repo_created_at": "2016-08-25T03:16:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d42b3f84c... |
b4777db6-5419-4727-b802-7f43530e2dd6 | alexandraback/datacollection | solutions_5765824346324992_1/C++/numa/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define repf(i, f, l) for(int i = f; i < (int)l; ++i)
#ifdef ONLINE_JUDGE
#define DEBUG false
#else
#define DEBUG true
#endif
#define pb emplace_back
#define lb lower_bound
#define ul unsigned long
#define ull unsigned l... | ALGO | 0.999993 | 3.486471 | {
"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": "dca79513c... |
89bfcda3-3eba-4584-9183-fe8278b08898 | LSH3333/PS | baekjoon/1082.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int N,M;
// {price, num}
vector<pair<int,char>> v;
int arr[12];
int main() {
cin >> N;
for(int i = 0; i < N; i++) {
int n; cin >> n;
v.push_back({n, char(i+'0')});
arr[i] = n;
}
cin >> M;
sort(... | ALGO | 0.999971 | 4.025706 | {
"github_metadata": {
"branch": "master",
"commit_count": 1357,
"repo_created_at": "2021-07-07T06:42: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": "4c4f9c8... |
b4734d51-818d-41c4-918f-fbc60a967517 | AsadUllah-A/DSA-LabTask-Codes | Lab14_T#04.cpp | #include <iostream>
using namespace std;
// Define the Node structure to represent each node in the linked list
struct Node {
int data;
string position; // To store where the node was inserted ("Head" or "Tail")
Node* next;
// Constructor to initialize a new node
Node(int value, const string& pos)... | ALGO | 0.999707 | 7.055312 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-09-22T14:08: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": "a7228ea7038... |
3ef2da7e-4d03-460e-aacc-41cfbc2fd84a | pmoulon/groupsac | cpp/thirdParty/armadillo/include/armadillo_bits/op_var_meat.hpp | // Copyright (C) 2010 NICTA and the authors listed below
// http://nicta.com.au
//
// Authors:
// - <NAME> (conradsand at ieee dot org)
//
// This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness
// for any purpose. You can redistribute this file
// and/or modify it under t... | ALGO | 0.984373 | 6.174447 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2015-04-07T06:59:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0928c09e3... |
5b5c249f-f8eb-498f-a551-d1c4afd03fab | threalwinky/cp_library | Codeforces/1762B.cpp | /**
* author: winky
* created: 2023-05-30 00:07:51
**/
#include <bits/stdc++.h>
using namespace std;
#define tri(a, b, c) ((a) ? (b) : (c))
#define pb(x) push_back(x)
#define fi first
#define se second
#define debug(x) ... | ALGO | 0.999317 | 3.642466 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2022-06-21T15:00:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "242641d07d0... |
8b5d1b9d-e0d4-43bb-9c67-ec6c2a2dca51 | piano-man/coding | arrays/q26.cpp | //transform the array
//can't find error
#include<bits/stdc++.h>
using namespace std;
vector<int> transform(vector<int> v,int n)
{
int i;
for(i=0;i<n-1;)
{
int n1 = v[i];
int j = i+1;
while(v[j]==0)
{
j++;
}
int n2 = v[j];
if(n1==n2)
... | ALGO | 0.999929 | 3.366199 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2018-01-17T19:31: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": "96352699a... |
d99d3d3f-a5fc-4847-b163-6e2ef2bb2dd8 | cerredz/LeetCode-Problems | NeetCode 308/605.CanPlaceFlowers.cpp | class Solution {
public:
/*
Problem:
You have a long flowerbed in which some of the plots are planted, and some are not. However, flowers cannot be planted in adjacent plots.
Given an integer array flowerbed containing 0's and 1's, where 0 means empty and 1 means not empty, and an integer n,
return i... | ALGO | 0.999995 | 6.572923 | {
"github_metadata": {
"branch": "main",
"commit_count": 343,
"repo_created_at": "2023-01-04T21:25: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": "af402a20bf... |
d6061757-59c1-4ba7-9d7d-4f3a90507a94 | jose-dom/bitcoin_forecasting | env/lib/python3.9/site-packages/pystan/stan/lib/stan_math/stan/math/prim/mat/fun/qr_R.hpp | #ifndef STAN_MATH_PRIM_MAT_FUN_QR_R_HPP
#define STAN_MATH_PRIM_MAT_FUN_QR_R_HPP
#include <stan/math/prim/arr/err/check_nonzero_size.hpp>
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/scal/err/check_greater_or_equal.hpp>
#include <Eigen/QR>
#include <algorithm>
namespace stan {
namespace math {
... | ALGO | 0.997058 | 7.0053 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-01-04T01:45:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 12,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "baceed5d... |
c29b4eb3-8690-4679-9a2a-90a04b68230f | Autoquark/SdlBreakout | SdlBreakout/SdlBreakout.Library/GeneralFormLine.h | #include "Vector2.h"
#include <algorithm>
#include <assert.h>
#include "Constants.h"
#pragma once
// Represents a line defined by an equation in the form ax + by + c = 0
class GeneralFormLine
{
public:
GeneralFormLine(Vector2F point1, Vector2F point2)
{
if (point1.x > point2.x)
{
std::swap(point1, point2);
... | ALGO | 0.911994 | 5.205389 | {
"github_metadata": {
"branch": "master",
"commit_count": 196,
"repo_created_at": "2019-11-15T14:44:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "35584cb1... |
178afdc2-da7f-4024-93dd-ec174f8b716d | giraudsimon/ATTPCROOTv2-2 | compiled/StandAloneMC_Basic/MCSrc/MCQMinimization.cc | #include "MCQMinimization.hh"
#include <iostream>
#include <algorithm>
#include "TRandom.h"
#include "TH1F.h"
#ifdef _OPENMP
#include <omp.h>
#endif
#define cRED "\033[1;31m"
#define cYELLOW "\033[1;33m"
#define cNORMAL "\033[0m"
#define cGREEN "\033[1;32m"
ClassImp(MCQMinimization)
MCQMinimization::MCQMinimization... | ALGO | 0.977075 | 3.051421 | {
"github_metadata": {
"branch": "develop",
"commit_count": 444,
"repo_created_at": "2019-11-20T23:21: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": "9405d16... |
a07539f3-98de-4b8a-a3a5-7751f9ef2c4e | ZhangXinNan/Professional_CPP20 | Code/c01_code/28_References/06_OddsEvensRefs.cpp | #include <cstddef>
import <array>;
import <iostream>;
using namespace std;
void printIntArr(const int arr[], size_t size)
{
for (size_t i{ 0 }; i < size; ++i) {
cout << arr[i] << " ";
}
cout << endl;
}
void separateOddsAndEvens(const int arr[], size_t size, int*& odds,
size_t& numOdds, int*& evens, size_t& nu... | ALGO | 0.995503 | 5.52924 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-03T15:09:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e12ec477a2... |
b4f281c0-3769-4744-b0e0-5219922d77af | kiennd/saigo | finder/c_bbox/bbox.cpp |
#include <cv.h>
#include <vector>
#include <findvar.hpp>
#include <bbox.hpp>
vector<Rect>* bbox::get (IplImage *img,vector<Range>*ranges,int hpx)
{
int i,j,u;
vector<int> matched_rect;
vector<Rect> open,*closed;
Rect r;
closed = new vector<Rect>;
// Cada linha tem em ranges, os intervalos que contem texto e... | ALGO | 0.977558 | 3.726377 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2015-05-16T16:24: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": "49ea54bbc... |
b421c642-eea5-4f99-8ef3-cef4e22b2290 | pius338/BOJ | 20230326/_1874.cpp | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
int main()
{
int n, m, flag = 0;;
cin >> n;
stack<int> stc;
vector<int> arr(n + 1, 0);
vector<char> r_arr;
stc.push(0);
for (int i = 0; i < n; i++)
{
cin >> m;
if(stc.top() <= m)
... | ALGO | 0.999999 | 3.916316 | {
"github_metadata": {
"branch": "main",
"commit_count": 420,
"repo_created_at": "2023-03-07T05:39: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": "c7eff3a005... |
821e5a72-021b-4327-a9cb-87530d2e3e7f | FangGet/BundleFusion_Ubuntu_Pangolin | include/FreeImage/include/CGAL/linear_least_squares_fitting_tetrahedra_3.h | // Copyright (c) 2005 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// You can redistribute it and/or modify it under the terms of the GNU
// General Public License as published by the Free Software Foundation,
// either version 3 of the License, or (at your o... | ALGO | 0.997732 | 6.741653 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-06-29T03:53:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 132,
"forks": 34,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "7069b5f... |
32538785-5e68-4954-8095-2b3b3bf31855 | 99-wood/Algorithm_Lab | GreedyRunner.cpp | //
// Created by admin on 2025/7/4.
//
#include "GreedyRunner.h"
#include <queue>
#include <set>
namespace greedy {
constexpr int INF = 1e8;
constexpr double K = 1.5;
constexpr double r = 0.85;
constexpr std::pair<int, int> dir[] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
void GreedyRunner::buildTre... | ALGO | 0.999969 | 5.43248 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2025-06-24T14:43:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9cff3408c4d... |
ed14817e-287a-4575-bcc8-8eaf0f4de67e | Audquisha/P3Sort256 | P3Sort256/HashAlgorithm.cpp | #include "HashAlgorithm.h"
std::vector<int> HashAlgorithm::convertInputToHash(std::vector<std::pair<std::string, std::string>>& givenDataSet) {
// hashes each password inplace
for (auto& nameAndPass : givenDataSet) {
hash(nameAndPass.second);
}
//generates random keys from 0-31 and places them i... | ALGO | 0.997067 | 4.110643 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2025-04-02T21:14: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": "6e6c12b94... |
e8c85192-f321-40f5-be29-626967129c43 | N3xoX1/nxemu | src/nxemu-cpu/dynarmic/frontend/A32/translate/impl/misc.cpp | /* This file is part of the dynarmic project.
* Copyright (c) 2016 MerryMage
* SPDX-License-Identifier: 0BSD
*/
#include <mcl/bitsizeof.hpp>
#include "dynarmic/frontend/A32/translate/impl/a32_translate_impl.h"
namespace Dynarmic::A32 {
// BFC<c> <Rd>, #<lsb>, #<width>
bool TranslatorVisitor::arm_BFC(Cond cond, I... | TOOL | 0.957189 | 7.463144 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2025-03-03T08:00:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 229,
"forks": 6,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "71ac74... |
45730bfa-6baf-40a9-b246-60c2f4a995e6 | Amine-aichouba/Algorithms | Sorting/Cycle_Sort.cpp |
#include <iostream>
using namespace std;
void cycle_sort ( int arr [] , int n )
{
for ( int cycle_start = 0 ; cycle_start < n - 1 ; cycle_start ++ )
{
int item = arr [ cycle_start ] ;
int pos = cycle_start ;
for ( int i = cycle_start + 1 ; i < n ; i ++ )
... | ALGO | 0.999955 | 5.386178 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-03-07T22:31:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1d4ad8a634b... |
38a68aad-b4bc-4f2c-9bbd-1b4492e8dbeb | Mayurishinde27/Leetcode | 1662-check-if-two-string-arrays-are-equivalent/1662-check-if-two-string-arrays-are-equivalent.cpp | class Solution {
public:
bool arrayStringsAreEqual(vector<string>& word1, vector<string>& word2)
{
string str1 = "";
string str2 = "";
for(int i = 0; i<word1.size(); i++)
{
str1 += word1[i];
}
for(int i = 0; i<word2.size(); i++)
{
... | ALGO | 0.999896 | 6.255756 | {
"github_metadata": {
"branch": "main",
"commit_count": 1890,
"repo_created_at": "2021-12-21T15:05: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": "d82157d21... |
7701964a-0b4b-4e39-a5c3-e6d11bf15e4c | haoel/leetcode | algorithms/cpp/minimumDistanceToTheTargetElement/MinimumDistanceToTheTargetElement.cpp | // Source : https://leetcode.com/problems/minimum-distance-to-the-target-element/
// Author : <NAME>
// Date : 2021-05-03
/*****************************************************************************************************
*
* Given an integer array nums (0-indexed) and two integers target and start, find an in... | ALGO | 0.999935 | 6.452782 | {
"github_metadata": {
"branch": "master",
"commit_count": 788,
"repo_created_at": "2014-10-20T03:22:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17857,
"forks": 4931,
"issues": 26,
"pull_requests": 28
},
"file_meta": {
"content_id": ... |
357c61af-c373-47bc-a24a-d8d934d999f9 | xian-wen/pat | Advanced/PAT_A1055 the_world's_richest.cpp | /*
1055. The World's Richest (25)
时间限制:400ms 内存限制:128MB 代码长度限制:16KB
Description:
Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest people. Now you are supposed to simulate this job, but concentrate only on the people in a certain range of ages. That i... | ALGO | 0.999566 | 4.056148 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2018-05-29T09:46: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": "e668444a6... |
325755d7-578f-4b22-8378-79060c838b5f | 142ayushkumar/OJ-Submissions | codeforces/1283/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define int long long
#define all(c) (c).begin(),(c).end()
#define M 1000000007
#define INF LLONG_MAX
#define pr(...) dbs(#__VA_ARGS__, __VA_ARGS__)
template <... | ALGO | 0.999658 | 3.41438 | {
"github_metadata": {
"branch": "master",
"commit_count": 161,
"repo_created_at": "2020-12-22T08:58:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "912b2449... |
4563e01c-7113-4a17-86c1-63bec1054bdb | ganeshalamuru/prg | codeforces/cr992/A_Game_of_Division.cpp | #include <bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long long ll;typedef long double ld;typedef pair<int,int> pii;
#define F first
#define S second
#define PB push_back
#define MP make_pair
const ll mod = 1e9+7, N = 2e6+7, M = 2e6+7, INF = INT_MAX/10;
ll po... | ALGO | 0.99985 | 4.194724 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-08-02T10:36: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": "20a8d9f247dd... |
51c96691-cf28-4fb1-abc3-3dd2e2a5bd24 | yashrajsingh11/DSA_Practice | 160.BSTCheckBST.cpp | // Approach : We can perform inorder traversal and check if the previous element is smaller than the current element, if it is not then
// it is not a BST.
#include <iostream>
using namespace std;
struct node{
int data;
struct node* left;
struct node* right;
node(int x) {
data = x;
left = NULL;
right = NU... | ALGO | 0.999978 | 5.219015 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2021-03-18T17:26: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": "02621c1a0cc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.