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 |
|---|---|---|---|---|---|---|---|
eb33c6e5-2e95-4b57-be69-80548436c9eb | nikolaCh6/nikolaCh6 | klasa 2/cpp/fibonacci.cpp | /*
* fibonacci.cpp
*/
#include <iostream>
using namespace std;
float fibonacci_re(int n)
{
if (n == 0) return 0;
if (n == 1) return 1;
return fibonacci_re(n-1) + fibonacci_re(n-2);
}
int fibonacci_it(int n)
{
int a = 0; // n-2
int b = 1; // n-1
if (n < 1) return a;
else if (n < 2... | ALGO | 0.999439 | 5.106642 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2017-10-02T07:11: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": "bf23e50f6... |
39e1cd41-4ffa-4ceb-bd9e-8c4dc55ff59d | stan-dev/math | stan/math/opencl/rev/lmultiply.hpp | #ifndef STAN_MATH_OPENCL_REV_LMULTIPLY_HPP
#define STAN_MATH_OPENCL_REV_LMULTIPLY_HPP
#ifdef STAN_OPENCL
#include <stan/math/opencl/rev/adjoint_results.hpp>
#include <stan/math/opencl/kernel_generator.hpp>
#include <stan/math/rev/core.hpp>
#include <stan/math/rev/fun/adjoint_of.hpp>
#include <stan/math/rev/fun/value_o... | ALGO | 0.957635 | 6.6204 | {
"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": ... |
3bb7e1c4-aea2-4193-9643-873104d3b0a0 | Yeon09a/AlgorithmStudy | ๋ฐฑ์ค/Silver/1260.โ
DFS์โ
BFS/DFS์โ
BFS.cc | #include <stdio.h>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
void DFS(int node, vector<int> graph[], bool visited[]) {
visited[node] = true;
printf("%d ", node);
for (int i = 0; i < graph[node].size(); i++) {
int next = graph[node][i];
if (!visited[next]) {
DFS(next, graph... | ALGO | 0.999993 | 4.303068 | {
"github_metadata": {
"branch": "main",
"commit_count": 138,
"repo_created_at": "2024-01-08T07:33: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": "83b4bb3acf... |
a4600f02-df1d-4483-876d-e94aed9c5ea6 | sam1322/100DaysOfCode | Leetcode solutions/300-fighting-spartans/Gauss-Jacobi.cpp | # include <bits/stdc++.h>
# define int long long
# define endl "\n"
# define ld long double
# define vld vector <ld>
# define vvld vector <vld>
using namespace std;
const ld epsilon = 1e-4;
const int epochs = 1e3;
/*
3
8 -3 2 20
4 11 -1 33
6 3 12 35
*/
void solve() {
int n;
cin >> n;
vvld A(n, vld(n + 1));
for (i... | ALGO | 0.999983 | 4.159706 | {
"github_metadata": {
"branch": "master",
"commit_count": 585,
"repo_created_at": "2021-08-09T05:34: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": "4cca83ef... |
cb181d77-0066-45e6-b9fb-fb712e992e0f | zayim/OOP | LV4/LV4Z4.cpp | #include <iostream>
#include <cmath>
//#include "TestCurenja.h"
using namespace std;
template <typename tip>
tip* f(tip niz[], int n)
{
tip *dinamickiNiz=new tip[n];
for (int i=0, j=n-1; i<n; i++, j--)
dinamickiNiz[i]=niz[j];
return dinamickiNiz;
}
int main()
{
int n;
double a[100],*b;
... | ALGO | 0.999468 | 3.805532 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-09-20T21:05: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": "0d9e022cff... |
0be83d5e-64cf-4054-a4e5-be83c1c8a1df | duckdb/duckdb | src/execution/nested_loop_join/nested_loop_join_mark.cpp | #include "duckdb/common/operator/comparison_operators.hpp"
#include "duckdb/common/uhugeint.hpp"
#include "duckdb/common/vector_operations/vector_operations.hpp"
#include "duckdb/execution/nested_loop_join.hpp"
namespace duckdb {
template <class T, class OP>
static void TemplatedMarkJoin(Vector &left, Vector &right, ... | TOOL | 0.962027 | 5.545357 | {
"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":... |
0657a540-379e-4067-8eba-d27578545c73 | ishandutta2007/codeforces-e | ershov.stanislav/normal/626/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define all(s) (s).begin(), (s).end()
#define sz(s) ((int) ((s).size()))
typedef long long ll;
typedef long double ld;
const int INF = (int) 1e9 + 100;
const ll lINF = ... | ALGO | 0.999906 | 4.079163 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:34:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51ab74855b80... |
bec9e8d1-21cd-4a2d-8fea-5645c20758a7 | Lagoon6/Algorithm | SAMSUNG_SDS/๊ทธ๋ํ/2_์ค์ธ์ฐ๊ธฐ/์์ค.cpp | #include<iostream>
#include<queue> //In-dgree๊ฐ 0์ด๋๋ ์ ์ ์ push/popํ๋ ์๋ฃ๊ตฌ์กฐ ๊ณต๊ฐ
#include<vector>
using namespace std;
const int MAXN = 32001;
const int MAXM = 100001;
int N, M, a, b;
int indegree[MAXN]; // ํด๋น ์ ์ ์ ๋ํ In-degree์ฐจ์ ์ ์ฅ
vector<int> A[MAXN]; //์ธ์ ๋ฆฌ์คํธ : ์ ์ ๋ณ๋ก ํฌ๊ธฐ๊ฐ ๋ค๋ฅด๋ฏ๋ก ๋์ ๋ฐฐ์ด(๋ฆฌ์คํธ)
queue<int> q; //In-dgree 0์ด ๋๋ ์ ์ ์ ์ฅ... | ALGO | 0.999996 | 4.125718 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2022-02-19T07:17: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": "2bae0a7d1e5... |
1a8baf11-a1db-4628-84f9-7343e0e9ed12 | strange-suraj/LeetCode-Susbmission | Longest K unique characters substring - GFG/longest-k-unique-characters-substring.cpp | //{ Driver Code Starts
//Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
int longestKSubstr(string s, int k) {
// your code here
int ans = 0, j = 0;
map<char, int> m;
for(int i=0;i<... | ALGO | 0.999726 | 5.893637 | {
"github_metadata": {
"branch": "main",
"commit_count": 3434,
"repo_created_at": "2022-01-13T06:50:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d07951785... |
d329b05f-193b-4ca4-ad82-74d41fedd8d1 | agnik2019/Data-Structure-Algorithm | Trees/98_validate_bst.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.999976 | 6.379102 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2021-01-08T16:37: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": "517807e619c... |
4aeb6913-9beb-4a32-9935-64c075e32452 | sjnov11/Baekjoon-Online-Judge | p15684_2.cpp | #include <iostream>
using namespace std;
int N, M, H;
int ladder[11][31];
int go2(int hor, int ver) {
if (ver > H) return hor;
if (ladder[hor][ver] == 1)
hor += 1;
else if (hor - 1 >= 1 && ladder[hor - 1][ver] == 1)
hor -= 1;
ver += 1;
return go2(hor, ver);
}
bool go(int hor, int ver) {
int start_hor =... | ALGO | 0.999982 | 3.637798 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-10-23T06:04: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": "cd483012c7... |
3e05a222-813d-4ae8-984f-a4f87c916c42 | ralfholly/const_map | const_map.h | #ifndef CONST_MAP_H
#define CONST_MAP_H
#include <algorithm>
#include <functional>
#include <cassert>
// Version Date Remark
// ---------------------------------------------------------------------------
// 1.0.1 2020-02-28 Fixed bug in binary search (const_map::lookup)
// 1.1.0 2020-02-28 Added suppo... | CONFIG | 0.958181 | 6.161695 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2018-12-16T19:14:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de1d8a132... |
9f7b1df9-71a5-499e-a25d-9e3627ae7058 | Mooophy/Path-Planning | planning/planning/transform.cpp | #include "transform.h"
using namespace std;
/////////////////////////////////////////////////////////////////////////////////
// World-to-Device Coordinates Transformation
int xDev(WorldBoundaryType WorldBound,DevBoundaryType DevBound,float xworld)
{
float xslope,xint;
int devX;
if((WorldBound.x2-W... | ALGO | 0.937753 | 3.366219 | {
"github_metadata": {
"branch": "master",
"commit_count": 277,
"repo_created_at": "2015-09-04T04:14:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 91,
"forks": 34,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef7cf9... |
9fea73b7-d7c2-4328-8e0c-492d75452cd9 | raihanthecooldude/ACM | Codes/Beginner/AIUB Beginners Long Contest - Counting+Bitmasks/I - Prime Ring Problem/PrimeRingProblem.cpp | #include<bits/stdc++.h>
using namespace std;
#define pi 2.0*acos(0.0)
#define MOD 1000000007
#define MAX 100005
#define UMAX 9223372036854775807
#define MAXARRAY 2000002
#define ll long long
#define nl '\n'
#define xx first
#define yy second
#define pb push_back
#define ss stringstream
int T = 0, n;
int circle[20];
... | ALGO | 0.999967 | 4.09713 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2018-07-03T07:29: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": "beffeb9d3... |
8f17cead-1667-4759-abe4-f822761dce56 | SBolo/GitComputationalPhysics | dmc_backup/dmc_n_dim.cpp | #include <iostream>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <gsl/gsl_rng.h>
#include <time.h>
using namespace std;
//#define DEBUG
//------------------------------------------MACROS-----------------------------------------
#define N (1) //number of particles
#define MDIM (10) //mesh dimensi... | ALGO | 0.999834 | 3.939431 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2015-05-22T06:26: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": "e279e62c98... |
421cefbe-46bb-4a19-b09b-2883d1d96457 | vanilla111/MiniDatabase | src/index/bPlusTreeNode.cpp | #include <cstring>
#include <iostream>
#include <algorithm>
#include "global.h"
#include "main.h"
#include "buffer/bufferManager.h"
#include "index/bPlusTreeNode.h"
using namespace std;
BPTreeNode::BPTreeNode(
const char *_filename, int _id, int _keyLength
): filename(_filename), id(_id), keyLength(_keyLengt... | ALGO | 0.989294 | 3.886402 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-12-03T11:33:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "59fe50d036... |
02844f35-3956-4608-a3df-692cfbdf3109 | ArindamRawat/Maze_Generator | Example_Pro_02/Example_Pro_02/Source.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <ctime>
#include "olcConsoleGameEngine.h"
using namespace std;
class MazeGenerator : public olcConsoleGameEngine
{
public:
MazeGenerator()
{
m_sAppName = L"Maze Generator";
}
private:
int nMazeWidth;
int nMazeHeight;
vect... | ALGO | 0.982488 | 6.042019 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-11-13T11:40: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": "928860ec298f... |
8798e59a-7b0f-4efb-9791-efb459c2b5ba | BIC-MNI/N3 | src/SharpenHist/sharpen_hist.cc | /* ----------------------------- MNI Header -----------------------------------
@NAME : sharpen_hist.c
@INPUT : argc, argv - command line arguments
@OUTPUT : (none)
@RETURNS : error status
@DESCRIPTION: Creates a mapping for minclookup to sharpen a volume's histogram
@METHOD :
@GLOBALS :
@CAL... | ALGO | 0.948407 | 4.878295 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2012-03-07T04:30:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 5,
"issues": 5,
"pull_requests": 2
},
"file_meta": {
"content_id": "2ea1aec1f1... |
8e88de3a-50d3-4b18-bfc3-3ad00771fd72 | leodestiny/BGL_NSDI2023 | src/graph/sampling/randomwalks/randomwalks_cpu.h | /*!
* Copyright (c) 2018 by Contributors
* \file graph/sampler/generic_randomwalk_cpu.h
* \brief DGL sampler - templated implementation definition of random walks on CPU
*/
#ifndef DGL_GRAPH_SAMPLING_RANDOMWALKS_RANDOMWALKS_CPU_H_
#define DGL_GRAPH_SAMPLING_RANDOMWALKS_RANDOMWALKS_CPU_H_
#include <dgl/base_heter... | ALGO | 0.992716 | 7.352032 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-04-13T08:32:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 2,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "2abed55da03... |
dda335ce-dfaa-4373-b876-2bc304091d59 | sabina9797/Algorithm-Lab-work-2.2-sem_220102 | 14_Bubble_selection_.cpp | #include <bits/stdc++.h>
using namespace std;
void bubbleSort(vector<int>& arr) {
int n = arr.size();
for (int i = 0; i < n - 1; i++) {
for (int j = 0; j < n - i - 1; j++) {
if (arr[j] > arr[j + 1]) {
swap(arr[j], arr[j + 1]);
}
}
}
}
void selectionS... | ALGO | 0.99983 | 5.196518 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-11-30T13:02: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": "580cd97286b8... |
9a7accf9-4fc2-4ca6-bf9c-a422fcb62cb9 | 22026559NguyenThuyQuynh/BT_hackerank | BT_05/Bai_3.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 N; cin >> N;
vector<int> v;
for( int i=0; i<N; i++)
{
int tmp; cin >> tmp;
... | ALGO | 0.999835 | 3.524721 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2023-07-10T07:50: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": "d25404025da... |
4b7b7994-ee78-4272-adf0-20203fd2a1a5 | RubyTsai/geeksforgeeks | Print_Diagonally.cpp | //http://practice.geeksforgeeks.org/problems/print-diagonally/0
#include <iostream>
#include <vector>
using namespace std;
vector<int> print(vector<int> vec, int size) {
vector<int> ret;
for (int a = 0; a < size; a++)
for (int i = 0, j = a; j >= 0; i++, j--)
ret.push_back(vec[i*size + j... | ALGO | 0.998296 | 4.185746 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-09-26T23:56: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": "e91cd6cec2... |
666b261c-f076-4c63-a882-ddb789b4f543 | Sophistt/LeetCode-Practice | LongestCommonPrefix/solution.cpp | /*================================================================
* Copyright (C) 2019 Sangfor Ltd. All rights reserved.
*
* @file:solution.cpp
* @author: Sophistt
* @date:2019-11-11 19:04
* @description:
*
================================================================*/
#include<iostream>
#include<ve... | ALGO | 0.999941 | 5.349083 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2019-11-04T04:17:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea2d1b26a... |
944cbdab-677a-4872-8824-b2af18cac619 | FABhishek/CodeforcesContests | Sublime/CSES ProblemSet/AtcoderPracticeB&C/C/2dArrayprefixsum.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
// Policy based data structure
template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define ll long long int
#define pii pair<ll,ll>
#define rep(i,s... | ALGO | 0.999729 | 4.939409 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-06-15T16:58:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f88bf1bc40... |
c53021d4-2293-49be-9e77-255b4486c684 | 543877815/algorithm | ๅๆ offer๏ผไธ้กน็ชๅป็๏ผ/ๅๆ Offer II 008. ๅๅคงไบ็ญไบ target ็ๆ็ญๅญๆฐ็ป.cpp | // ้ๅ
// ๆถ้ดๅคๆๅบฆ๏ผO(n)
// ็ฉบ้ดๅคๆๅบฆ๏ผO(n)
class Solution {
public:
int minSubArrayLen(int target, vector<int> &nums) {
int n = nums.size();
queue<int> q;
int res = INT_MAX;
int sum = 0;
for (int i = 0; i < n; i++) {
sum += nums[i];
q.push(nums[i]);
... | ALGO | 0.999997 | 6.199988 | {
"github_metadata": {
"branch": "master",
"commit_count": 283,
"repo_created_at": "2019-05-26T12:35:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1c6f84a... |
75a575bc-66f5-480a-b778-5f184b9b4366 | xcf1992/leetcode | C++/remove_invalid_parenthese.cpp | /*
301. Remove Invalid Parentheses
Remove the minimum number of invalid parentheses in order to make the input string valid.
Return all possible results.
Note:
The input string may contain letters other than the parentheses ( and ).
Example 1:
Input: "()())()"
Output: ["()()()", "(())()"]
Example 2:
Input: "(a)())(... | ALGO | 0.999556 | 5.479605 | {
"github_metadata": {
"branch": "master",
"commit_count": 1784,
"repo_created_at": "2017-12-26T04:19:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db4996f... |
e2751409-c44d-40e8-aa71-877ea7a34907 | YongHoonJJo/BOJ | 6593.cpp | #include <cstdio>
#include <vector>
#include <queue>
using namespace std;
struct P { int l, r, c; };
int L, R, C;
int safe(int l, int r, int c)
{
return (0 <= l && l < L) && (0 <= r && r < R) && (0 <= c && c < C);
}
int main()
{
while(1) {
char g[31][31][31]={0};
int visited[31][31][31]={0};
int dL[] = {1, ... | ALGO | 0.999563 | 4.089241 | {
"github_metadata": {
"branch": "master",
"commit_count": 362,
"repo_created_at": "2016-07-21T09:20:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d784ebc... |
f4173908-f70f-43e8-83c1-c7e86977de04 | SKP2005/CS254---220001069 | Lab3/Q2/main.cpp | #include <bits/stdc++.h>
using namespace std;
//Kande's algorithm
int maxSubarraySum(vector<int>& arr) {
int max_current = arr[0];
int max_global = arr[0];
for (int i = 1; i < arr.size(); ++i) {
max_current =max(arr[i], max_current + arr[i]);
max_global =max(max_global, max_current);
}... | ALGO | 0.999834 | 5.035457 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-01-14T13:28:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a36b1d3fdc5... |
0afb1df9-9ff2-4b53-b967-4fa64184a62c | mfujiwara/atcoder-ruby | PAST/past202107-open/l.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
long long op(long long a, long long b) {
return min(a,b);
}
long long e() {
return 1e10;
}
int main() {
int N,Q;
cin >> N >> Q;
map<long long,set<int>> memo;
vector<long long> A(N);
for (int i=0;... | ALGO | 0.999908 | 4.462421 | {
"github_metadata": {
"branch": "master",
"commit_count": 1975,
"repo_created_at": "2020-05-10T13:32:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7baf657... |
f45759b5-da0b-43ec-a590-5ed7a207d93e | fantaosha/SCOPE | C++/scope/factor/JointLimitFactor.h | #pragma once
#include <scope/factor/Factor.h>
namespace scope {
class JointLimitFactor : public Factor {
public:
struct Evaluation : public Factor::Evaluation {
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
AlignedVector<Eigen::Array<Scalar, 6, 1>> outputs;
AlignedVector<Eigen::Array<Scalar, 6, 1>> fin;
AlignedV... | TOOL | 0.955684 | 7.453193 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-10-08T03:42:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 60,
"forks": 9,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "95d2e7303... |
0bb6341a-22d3-4b21-a574-e76797a01e9e | 1shra/dsalgo | Tree/Genric_Tree/L7aIMP_levelOrderGenricTree_2.cpp | // Implimentaion of genric tree
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
using namespace std;
class Node
{
public:
int data;
vector<Node *> vec;
Node(int val)
{
data = val;
}
};
void levelOrder(Node* root){
queue<Node*> que;
queue<Node*> Childque;
... | ALGO | 0.999848 | 4.554291 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2025-04-30T17:32: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": "092a9c34402... |
6a7aa008-ebed-4c62-a1ab-8cfdea54c9eb | iliyian/CompetitiveProgramming | vjudge.net/zjut2023week6/H.cpp | // date: 2023/12/10
// tag: dp on tree, sizๆฐ็ป็ๆฏๆ ไธๆๅ
ถ้่ฆ็ๆฐ็ป
// wa#01: ๆ้้ป่พไบ
#include <bits/stdc++.h>
#define N 100005
using namespace std;
vector<vector<int>> g;
int d[N], siz[N], n;
void dfs(int u, int prev, int len) {
d[1] += len;
siz[u] = 1;
for (int v : g[u])
if (v != prev) {
dfs(v, u, len + 1);
... | ALGO | 0.99978 | 4.537838 | {
"github_metadata": {
"branch": "main",
"commit_count": 354,
"repo_created_at": "2024-04-21T10:50:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0412598967... |
70cee2ca-26fe-49d3-b2c9-3e121c9532f4 | sqmedeiros/sblp2023-time-vs-energy | 1640-Sum_of_Two_Values/c++/rand30/2545079.cpp | /* Author: <NAME>
E-mail: <EMAIL>
Don't stop until you feel proud.(P.S. don't feel proud;)
*/#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll int
#define ld long double
#define vll vector<ll>
#define vvll vector<vector<ll>>
#define vpll vector<pa... | ALGO | 0.999946 | 3.465855 | {
"github_metadata": {
"branch": "main",
"commit_count": 196,
"repo_created_at": "2023-07-26T18:18:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ad16c546f... |
6393a4cb-337a-4a39-8a2b-46ca8f9dece4 | vitalybelo/SkillBox_practice_works_9.7 | ะะฐะดะฐะฝะธะต 4. ยซะัะบะธ ะธ ะบะพัะพะฒัยป.cpp | #include <iostream>
using namespace std;
bool digitsInStringOnly (string inString);
int main() {
setlocale(LC_ALL, "Russian_Russia.1251");
string number1, number2;
do {
cout << "ะะฒะตะดะธัะต ะฟะตัะฒะพะต ัะธัะปะพ (ะธะท 4ั
ัะธัะตะป) = ";
cin >> number1;
} while (!digitsInStringOnly(number1) || number1.s... | ALGO | 0.999508 | 3.964197 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-09-03T11:54: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": "ee32bec0df... |
055348e5-2bda-454c-9c28-a486a006b923 | prakashharsh009/DSA-DONE_AND_DUSTED | Linked-List ๐/GFG/Insertion_at_the_end_of_Circular_Linked_List - Copy.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node{
int data;
Node *next;
Node(int x){
data = x;
next = NULL;
}
};
Node *insertionEnd(Node *head, int x){
Node *current = head->next;
while(current->next != head){
current = current->next;
}
Node... | ALGO | 0.999874 | 4.34024 | {
"github_metadata": {
"branch": "main",
"commit_count": 191,
"repo_created_at": "2022-10-11T10:21:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff02ce82f3... |
3de75171-4320-4a2c-9f22-2b462ccc7160 | shriiar/Problem-Set-Contests | D. Array and Operations.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define li long long int
#define ul unsigned long long int
#define pb push_back
#define pf push_front
#define mp make_pair
#define sz size()
#define mod 1000000007
#define fr first
#define se second
#define pii pair<int, int>
#define pll pair<ll, ll>
#... | ALGO | 0.999921 | 3.624229 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2022-04-02T10:47: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": "fd8381d34d6... |
b973fb12-78b1-4e15-9a20-11a4b0af7d6b | Bathui/Compression-Tool | compress.cpp | #include "HCTree.hpp"
#include <stdexcept>
#include <string>
void writeHeader(FancyOutputStream& out, vector<int> & freqs){
int uniqueSymbol = 0;
for(int i = 0; i < 256; i++){
if(freqs[i] > 0)
uniqueSymbol++;
}
// cout<<uniqueSymbol<<endl;
out.write_int(uniqueSymbol);
for(i... | ALGO | 0.979036 | 4.755075 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-03-02T08:48: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": "7b1c074b936f... |
65521776-ccce-4294-ab19-d2397cf2d182 | oakfire/aoc-2024 | day06/main.cpp | #include <fstream>
#include <iostream>
#include <set>
#include <utility>
#include <vector>
std::pair<int, int> Next(int x, int y, int di)
{
switch (di) {
case 0:
return {x, y - 1};
case 1:
return {x + 1, y};
case 2:
return {x, y + 1};
case 3:
... | ALGO | 0.999876 | 5.070753 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2025-01-08T07:24:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f810057414... |
cbac4d66-117a-4bc5-9c50-ffdbbf63ab3a | robert-anderson/M7 | src/M7_lib/parallel/RankAllocator.h | /**
* @file
* @author <NAME> <<EMAIL>>
*
* @section LICENSE
*
* @section DESCRIPTION
* FCIQMC and other stochastic wavefunction methods in electronic structure rely on the
* ability of the implementation to store large arrays in a distributed manner, with each
* rank in the communicator assigned to a subset... | TOOL | 0.987217 | 3.956903 | {
"github_metadata": {
"branch": "dev",
"commit_count": 2515,
"repo_created_at": "2020-02-10T17:33:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 1,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "4834fb01fd... |
9f4f958a-1486-4446-9e2e-d69b56c038f2 | Blackmane/adventofcode | 2022/day05/test.cpp | /**
* @file test.cpp
* @project advent of code
*
* @author <NAME>
* @date 05 Dec 2022
*
****************************************************************************
*
* _ _ o __ __ __ _ o _ ,_ _
* / |/ | | / / / \_|/ \_| |/ / | |/
* | ... | ALGO | 0.969702 | 6.370263 | {
"github_metadata": {
"branch": "main",
"commit_count": 284,
"repo_created_at": "2020-12-01T10:42:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32cd0317a5... |
c9b6beda-0e6d-4f0e-9904-da37391dd8cc | RJD02/DSA-Practice | codechef/contests/codechef_july_long_challenge_2/maximize_difference.cpp | #include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstring>
#include <chrono>
#include <complex>
#define endl "\n"
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector < vi >
#define vb vector<bool>
#define vs vector<stri... | ALGO | 0.999971 | 4.423542 | {
"github_metadata": {
"branch": "master",
"commit_count": 160,
"repo_created_at": "2022-04-22T01:57:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b00394ff... |
026a187a-abec-45fe-8da5-b60ef21f9899 | Nightmare4214/connect_four | Project1/ConnectFourState.cpp | #include "ConnectFourState.hpp"
ConnectFourState::ConnectFourState(const uint64_t & board,
const uint64_t & mask,
const int & round) :board(board), mask(mask), round(round), lastMove(-1)
{
}
ConnectFourState::ConnectFourState(const int & col,
const uint64_t & board,
const uint64_t & mask,
const int & round) : bo... | ALGO | 0.965961 | 4.617532 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2019-05-27T14:31:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "25d94c1f5... |
33a9dd75-8c69-45c6-b86f-93ff1a9c181b | borer/traceraptor | src/Transform.h | /*
* Transform.h
*
* Created on: May 30, 2017
* Author: bogdan
*/
#ifndef SRC_TRANSFORM_H_
#define SRC_TRANSFORM_H_
#include <Vec.h>
#include <MathUtil.h>
#include <Ray.h>
#include <Intersection.h>
#include <BBox.h>
namespace traceraptor {
struct Matrix4x4 {
Matrix4x4() {
m[0][0] = m[1][1] = ... | TOOL | 0.955088 | 6.39715 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2016-11-19T19:12: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": "87d94b5ff... |
dddc5c9c-3694-4515-9072-6db7f0ff1a61 | aswinvk28/nd131-people-counter-project-1 | student-repositories/motion-tracking/detection/reference_interval_estimation.h | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math>
using namespace std;
/**
** estimated using exponential functions
**/
float estimate_distance(float camera_known_proximity, float camera_known_distant,
float estimated_dimension, float wall_reference_center_dimension, std::vector<float> refe... | ALGO | 0.997663 | 5.266249 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2020-12-01T15:08:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ee37128772c... |
22b03d5f-c368-4dc1-b3ae-301b74a1c147 | himanshulikhar55/programming-journey | striver-a2z-dsa-problems/recursion/combination-sum.cpp | /*
Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target.
You may return the combinations in any order.
The same number may be chosen from candidates an unlimited number of times. Two combinations are un... | ALGO | 0.99994 | 5.660203 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2023-03-11T06:49:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d84d177cda9... |
c997e7fa-7eb8-4433-97eb-814dd2974381 | habanero-rice/hclib | test/performance-regression/full-apps/qmcpack/src/einspline/nubspline_eval_sse_z.h | /////////////////////////////////////////////////////////////////////////////
// einspline: a library for creating and evaluating B-splines //
// Copyright (C) 2007 <NAME>, Jr. //
// //
// This program i... | ALGO | 0.996643 | 6.257383 | {
"github_metadata": {
"branch": "master",
"commit_count": 705,
"repo_created_at": "2014-08-11T16:15:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 71,
"forks": 36,
"issues": 11,
"pull_requests": 0
},
"file_meta": {
"content_id": "fcfcb2... |
8af2f063-37ba-4f40-8c04-b569918c9b00 | zjswhhh/ConvexHull | Grahamโs.cpp | #include <iostream>
#include <stack>
#include <stdlib.h>
//#define LOCAL
//#include<unordered_map>
using namespace std;
struct Point
{
int x, y;
int index;
};
Point p0;
Point next2top(stack<Point> &S){
Point p = S.top();
S.pop();
Point res = S.top();
S.push(p);
return res;
}
/*
0 for co... | ALGO | 0.999961 | 4.505247 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-05-02T01:30:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "116996a773... |
11e2082a-8b0b-4a7a-9881-194061917afe | bj-jiwrajka/Strivers-SDE-Sheet-Challenge | 0297-serialize-and-deserialize-binary-tree/0297-serialize-and-deserialize-binary-tree.cpp | /**
*Definition for a binary tree node.
*struct TreeNode {
*int val;
*TreeNode * left;
*TreeNode * right;
*TreeNode(int x) : val(x), left(NULL), right(NULL) {}
*};
*/
class Codec
{
public:
// Encodes a tree to a single string.
string serialize(TreeNode *root)
{
string s ... | ALGO | 0.999415 | 4.675433 | {
"github_metadata": {
"branch": "main",
"commit_count": 182,
"repo_created_at": "2023-06-10T07:09: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": "01af54c379... |
e8d160cf-8600-476c-be4f-7bc468769d1b | destinyson7/All-Codes | CodeChef/COOLCHEF_final.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pii pair <int, int>
#define pll pair <ll, ll>
#define gcd __gcd
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size(... | ALGO | 0.999944 | 4.073178 | {
"github_metadata": {
"branch": "master",
"commit_count": 213,
"repo_created_at": "2019-12-02T11:53: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": "46959788... |
fe50febb-d0d0-4276-8d75-35a39bc269a8 | xcf1992/leetcode | C++/combination_sum_IV.cpp | /*
377. Combination Sum IV
https://leetcode.com/problems/combination-sum-iv/
Given an integer array with all positive numbers and no duplicates,
find the number of possible combinations that add up to a positive integer target.
Example:
nums = [1, 2, 3]
target = 4
The possible combination ways are:
(1, 1, 1, 1)
(1, 1... | ALGO | 0.999988 | 6.34269 | {
"github_metadata": {
"branch": "master",
"commit_count": 1784,
"repo_created_at": "2017-12-26T04:19:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "539470c... |
1bf486e9-67ec-48ea-8091-b77f8900c057 | seed93/reconstruction | include/armadillo/armadillo_bits/fn_pinv.hpp | // Copyright (C) 2009-2013 <NAME>
// Copyright (C) 2009-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2009-2010 <NAME>
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/... | TOOL | 0.99256 | 5.882988 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2014-11-14T06:55:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 53,
"forks": 25,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab7c012... |
0bfc3505-9d6d-464c-b09a-348b8b164642 | Mooliecool/windows | shared source/sscli20/palrt/src/inifile.cpp | // ==++==
//
//
// Copyright (c) 2006 Microsoft Corporation. All rights reserved.
//
// The use and distribution terms for this software are contained in the file
// named license.txt, which can be found in the root of this distribution.
// By using this software in any fashion, you are agreeing to ... | TOOL | 0.952147 | 6.5671 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2018-01-06T16:45:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 49,
"forks": 34,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23674bf... |
0b349113-8362-4266-9c16-1972037ee6bc | subhajit4980/DATA-STRUCTURE-AND-ALGORITHM | Linkedlist/sorted_inserted_linked_list.cpp | #include <bits/stdc++.h>
using namespace std;
//1st create a struct node for linkedlist
struct Node
{
int data;
Node *next;
Node(int x)
{
data = x;
next = NULL;
}
};
//2nd create a function for inserting node in linkedlist
Node *insertsort(Node *head, int x)
{
Node* temp=new Nod... | ALGO | 0.999971 | 4.913439 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2021-10-05T22:02:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0cf9b4ac2... |
68e024b6-b6d6-4c1e-b070-4211f6a08189 | claytonjwong/Algorithms-UCSanDiego | 1_course/2_week/5_fibonacci_number_again/cpp/main.cpp | /**
*
* C++ implementation to find the N mod M-th fibonacci number
*
* (c) Copyright 2019 <NAME> ( http://www.claytonjwong.com )
*
**/
#include <iostream>
#include <vector>
using namespace std;
template< typename Type >
class Solution {
public:
using Collection = vector< Type >;
Type fibonacci( Type ... | ALGO | 0.999993 | 5.092985 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2019-03-11T17:16:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 6,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "de623ae... |
9672ced6-072a-4649-85c0-391326a0477c | MasterHoracio/Contest-Archive | The 2022 ICPC Gran Premio de Mexico/Primera Fecha/K.cpp | #include <bits/stdc++.h>
int dp[51][55001];
using namespace std;
int main(){
int k, p, presentations[51], dinner, max_dinner, left, min_left;
vector <int> dinners;
scanf("%d %d",&k,&p);
for(int i = 0; i < p; i++)
scanf("%d",&presentations[i]);
sort(presentations, presentations + p);
max_dinner = -1;
fo... | ALGO | 0.999891 | 3.496839 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2017-02-13T03:32: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": "0b8e6b62c... |
6f918e06-cc60-43f6-9586-28d3773c0f0d | mindspore-ai/mindspore | mindspore/lite/src/litert/kernel/cpu/base/custom_tensor_scatter.cc | /**
* Copyright 2022 Huawei Technologies Co., Ltd
*
* 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.995471 | 6.612921 | {
"github_metadata": {
"branch": "master",
"commit_count": 83896,
"repo_created_at": "2020-02-11T08:43:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4559,
"forks": 740,
"issues": 181,
"pull_requests": 20
},
"file_meta": {
"content_id": ... |
49c84794-95a7-4b91-b2ce-35071f42becb | ruddropust/Competitive-Programming | 1794A.PrefixandSuffixArray.cpp | #include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define fr(a,b) for(int i = a; i < b; i++)
#define rfr(a,b) for(int i = b-1; i>=0; i--)
#define rep(i,a,b) for(int i = a; i < b; i++)
#define mod 1000000007
#define inf (1LL<<60)
#define all(x) (x).begin(), (x).end()
#define prDouble(x) cout << fixed << ... | ALGO | 0.999898 | 4.040131 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-03-31T00:16: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": "600cbf9c3a38... |
41461b9d-7a42-4370-96b8-13fa36ccd5d4 | youngclaus/klopp | emrecan/Classwork/linkedLists/linkedLists.cc | #include <iostream>
using namespace std;
class Chunk {
public:
int info;
Chunk* next;
Chunk() {
info = 0;
next = NULL;
}
};
class LinkedList {
public:
Chunk* head;
int count;
LinkedList() {
head = NULL;
count = 0;
}
// 1 Add at head
void atHead(int value) {
Chunk* temp;
... | ALGO | 0.99644 | 5.057699 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-08-22T20:51: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": "4505d42b1317... |
b9065f1a-6f76-458f-b1bd-a8e53b93126b | nlzza/boolean-retrieval-model | Indexer/Tries/Trie.hpp | #pragma once
#ifndef TRIE_HPP
#define TRIE_HPP
#define TOTAL_DOCS (30)
#include "HashTable.hpp"
#include <queue>
#include <vector>
#include <ostream>
#include <numeric>
class Trie
{
public:
using Results = std::vector<std::pair<std::string, Posting *>>;
// Constructor and deconstructor
Trie()
{
... | ALGO | 0.984254 | 4.962638 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-08-12T18:14: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": "efdf8f04ebd7... |
0648ee33-222b-46d3-bf25-fd5cd7189ac2 | szge/algorithms_data_structures | algorithms_data_structures/include/bubble_sort.h | #pragma once
namespace alg {
template <typename T>
/* Perform bubble sort on array <arr> starting from <start> until <end>
@param arr the array to be sorted
@param start the starting index of the subarray to be sorted
@param end the ending index of the subarray to be sorted
Notes: mutates arr;
start and end a... | ALGO | 0.99944 | 5.985651 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-08-12T10:19:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f68e35a8f5... |
38affb12-6dad-41ea-801d-d26cc560d23d | sha-ou/cppPrimerPlus | ch11/ch11-vector/randwalk.cpp | #include <iostream>
#include <stdlib.h>
#include <time.h>
#include "vector.h"
int main(void)
{
using namespace std;
using VECTOR::Vector;
srand(time(0));
double direction;
Vector step;
Vector result(0.0, 0.0);
unsigned long steps = 0;
double target;
double dstep;
cout << "Ent... | ALGO | 0.986862 | 3.475747 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2020-03-05T07:40: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": "604122484... |
1365e40d-0692-4afd-9e9f-0900fe7d7eea | GasimV/Self-Study-Tech-Projects | Algorithms & Data Structures/Select.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
// Function to partition the array around the pivot
int PartitionAround(vector<int>& A, int p, int r, int pivot) {
int pivotIndex = -1;
for (int j = p; j <= r; ++j) {
if (A[j] == pivot) {
pivot... | ALGO | 0.999997 | 6.09828 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2025-05-24T05:25: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": "239b9e80c... |
0c740385-cae7-4bf9-ab31-622fc065457d | salah-sorour-dev/Algorithms-Problem-Solving-Level-3 | problem 33.cpp | // problem 32.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <string>
using namespace std;
string ReadString()
{
string S1;
cout << "Please Enter Your String? \n";
getline(cin, S1);
return S1;
}
bool IsVowel(char Char)
{
Char = tolower(Cha... | ALGO | 0.997511 | 4.906589 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-02-14T20:56: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": "13b530145156... |
1fa78a71-efd8-40c0-8e2c-2e8e34d1e371 | choijoohee213/Algorithm | Baekjoon/graph/21.์ด๋_baekjoon1956.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 987654321
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int v, e, result=INF;
cin >> v >> e;
vector<vector<int>> d(v + 1, vector<int>(v + 1, INF));
for (int i = 0; i < e; i++) {
int a, b, c;
cin >> a >> b >> c;
d[a][b] = min(d[a]... | ALGO | 0.999798 | 3.826643 | {
"github_metadata": {
"branch": "main",
"commit_count": 662,
"repo_created_at": "2020-10-20T06:05:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a6aa7a8bd9... |
92d3f56a-767c-4d5e-9620-d566261e5c3b | borglab/gtsam | gtsam_unstable/base/DSF.h | /* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: <NAME>, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* ------------... | ALGO | 0.947494 | 6.08244 | {
"github_metadata": {
"branch": "develop",
"commit_count": 19360,
"repo_created_at": "2017-03-27T17:12:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3002,
"forks": 845,
"issues": 99,
"pull_requests": 25
},
"file_meta": {
"content_id": ... |
736d8263-426e-44bb-84aa-1558881593b3 | ishandutta2007/codeforces-a | aid/normal/781/A.cpp | #ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif
#define sz(x) ((int) (x).size())
#define TASK "text"
const int inf = (int) 1.01e9;
con... | ALGO | 0.999759 | 4.81056 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "ec5558e47c6d... |
7202635a-dcf4-4f29-b64b-021b43dc621f | qiyancos/leetcode | 1139/main.cpp | #include "debug_helper.h"
using namespace std;
class Solution {
public:
int largest1BorderedSquare(vector<vector<int>>& grid) {
int height = grid.size();
int width = grid[0].size();
vector<vector<int>> right(height, vector<int>(width, 0));
vector<vector<int>> down(height, vector<in... | ALGO | 0.999883 | 5.765091 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2023-02-17T13:09:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd65b13e6... |
01246f43-62e5-4844-b5b8-ba4c4537bee9 | Qube404/qube-cpp-projects | group1/permuted_index/permuted_index.cpp | #include <vector>
#include <string>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <cctype>
#include "permuted_index.h"
#include "split_string.h"
using namespace std;
string str_to_lower(string s) {
for (str_sz i = 0; i != s.size(); i++) {
s[i] = tolower(s[i]);
}
return s;
... | ALGO | 0.998871 | 4.551878 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2023-06-21T12:17: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": "a397062ca... |
82c234f8-b9f7-414d-8e4c-c0f551e6a776 | Liansheng-Wang/2022Offline | src/P&C/include/plan/planner.h | #pragma once
#include <common/base.h>
#include <cmath>
#include <mutex>
#include <tuple>
#include <vector>
#include <thread>
#include <iostream>
#include <Eigen/Core>
#include <Eigen/Dense>
namespace UP = UAVparam;
class Planner
{
public:
Planner(){}
~Planner(){
std::cout<< "\033[... | ALGO | 0.981545 | 3.839744 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2022-10-20T13:53:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a575ea260b3... |
ef9a5a31-c85b-483e-b6af-9efdfc45938d | SilkSilkSilk/datastruct | datastruct/datastruct/Leetcode.cpp | #include "Leetcode.h"
#include <deque>
#include "9.1.h"
class Solution
{
public:
//้พๆฅ๏ผhttps ://leetcode-cn.com/problems/3sum-closest
int threeSumClosest(vector<int>& nums, int target)
{
deque<int> dq;
int value = 0;
int v_abs_min = -1;
sort(nums.begin(), nums.end());
for (int i = 0; i < nums.size() - 2; i... | ALGO | 0.999902 | 5.393939 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2018-01-21T03:20:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc3045989... |
36f72f54-81b0-4e56-aa14-57c23cde38d0 | Ashish0253/csesProblemSet | graphAlgorithms/mailDelivery.cpp | #include <bits/stdc++.h>
using namespace std;
#define deb(x) cout << #x << " = " << x << endl
#define ll long long
const int MOD = 1e9 + 7;
const int mod = 998244353;
const int N = 1e5 + 5;
vector<vector<pair<int, int>>> adj;
vector<int> degree, path;
vector<bool> seen;
void dfs(int node)
{
// deb(node);
... | ALGO | 0.999989 | 4.311564 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2023-07-22T19:45: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": "792bee8617c... |
4f1cb396-c45f-4f1e-b0c4-9ede562d568d | davxis/2-semestr | main.cpp | // M_PI
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include "Point.h"
#include "Angle.h"
#include "Rectangle.h"
#include <cstdlib> // exit()
using namespace std;
Point readPoint();
/*
* @brief ะัะฝะพะฒะฝะฐั ััะฝะบัะธั ะฟัะพะณัะฐะผะผั.
* @return ะะพะทะฒัะฐัะฐะตั 0 ะฒ ัะปััะฐะต ััะฟะตัะฝะพะณะพ ะทะฐะฒะตััะตะฝะธั ะฟัะพะณัะฐะผะผั.
*/
int m... | ALGO | 0.997275 | 4.560338 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2025-02-19T14:47:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 2
},
"file_meta": {
"content_id": "ae58e6bf27c... |
f0e2f902-5269-4f9b-96c0-9794fbcff322 | ylochman/babelcalib | core/solvers/m2m_fit/solver_ds_to_rat.cpp | #include <Eigen/Dense>
#include "mex.h"
using namespace Eigen;
MatrixXcd solver_ds_to_rat(const VectorXd& data)
{
// Compute coefficients
const double* d = data.data();
VectorXd coeffs(14);
coeffs[0] = -1;
coeffs[1] = -2*d[3];
coeffs[2] = std::pow(d[2],2) - d[1];
coeffs[3] = -2*d[2];
... | ALGO | 0.998697 | 4.491025 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2021-09-21T11:37:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 94,
"forks": 17,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "8916022e4... |
d709502f-bd87-4953-a194-8e17608d2595 | maryushp/knapsack-problem | AG_project/CKnapsackProblem.cpp | #include "CKnapsackProblem.h"
#include <iostream>
#include <stdlib.h>
#include <fstream>
#include <cmath>
CItem::CItem(double dWeight, double dValue)
{
weight = dWeight;
value = dValue;
}
bool CKnapsackProblem::randomProblem(double dLimit, int iItemsAmount)
{
if (dLimit <= 0 || iItemsAmount <= 1)
{
return ... | ALGO | 0.999454 | 4.792311 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-02-07T18:43: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": "8f3d16c103... |
410fb381-2afc-4baa-af78-7b8bea69c7e2 | GameFoundry/bsf | Source/Foundation/bsfUtility/ThirdParty/simdpp/core/f_add.h | /* Copyright (C) 2013-2014 <NAME> <<EMAIL>>
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)
*/
#ifndef LIBSIMDPP_SIMDPP_CORE_F_ADD_H
#define LIBSIMDPP_SIMDPP_CORE_F_ADD_H
#ifndef LIBSIMDPP_SIM... | ALGO | 0.947109 | 6.849327 | {
"github_metadata": {
"branch": "master",
"commit_count": 5221,
"repo_created_at": "2018-03-15T10:17:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1752,
"forks": 194,
"issues": 99,
"pull_requests": 8
},
"file_meta": {
"content_id": "2a... |
02d68008-289a-473e-b627-440e0afc61e5 | ahlinist/cmssw | TauAnalysis/CandidateTools/src/mTauTauMinAlgo.cc | #include "TauAnalysis/CandidateTools/interface/mTauTauMinAlgo.h"
#include "CLHEP/Random/RandFlat.h"
#include <cmath>
double mTauTauAtFixedKxKy(const double kx, const double ky,
const double se, const double sx, const double sy, const double sz,
const double te, const double tx, const double ty, const doubl... | ALGO | 0.999136 | 5.684638 | {
"github_metadata": {
"branch": "master",
"commit_count": 121140,
"repo_created_at": "2013-04-16T10:19:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 21,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89d6... |
b0dbab72-d86b-4064-bd05-1072151ac2d8 | SilverJun/ProblemSolving | baekjoon/2293.cpp | /**
* Title: ๋์ 1
* Problem no. 2293
* Author: <NAME>
* Link: https://www.acmicpc.net/problem/2293
*/
#include <iostream>
#include <numeric>
using namespace std;
enum { MAX_N = 100, MAX_K = 10000 };
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int coin[MAX_N] = {0};
int dp[MA... | ALGO | 0.999956 | 4.59865 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2020-07-08T12: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": "6bdbfc04c... |
1e1df7fe-a464-4011-98bb-361af091b057 | Anshit01/Competitive-Programming | leetcode/array-101/check_if_n_and_its_double_exists.cpp | #include <bits/stdc++.h>
#define ll long long
#define f(i, x, n) for(int i = x; i < n; i++)
#define dbg(x) cout << x << endl
#define dbg2(x, y) cout << x << ' ' << y << endl
#define dbg3(x, y, z) cout << x << ' ' << y << ' ' << z << endl
#define mod 1000000007
using namespace std;
bool checkIfExist(vector<int>& arr) {... | ALGO | 0.998708 | 4.05616 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2020-05-23T11:21:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b3bdc9f7... |
d1cbbbd0-9cd5-437f-b650-8d7e1b841d6b | IamRiddhi/Competitve-Coding | Contests/Codevita 2018/Digital Time.cpp | #include<bits/stdc++.h>
#include<cmath>
#include<climits>
#define test ll t; cin>>t; while(t--)
#define rep0(n) for(ll i=0;i<(n);i++)
#define rep1(n) for(ll i=1;i<=(n);i++)
using namespace std;
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
ll digits[9];
... | ALGO | 0.989431 | 3.45792 | {
"github_metadata": {
"branch": "master",
"commit_count": 132,
"repo_created_at": "2018-04-28T08:12:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 14,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "b57319... |
3ab66171-2228-487a-9b88-6adddfb069f2 | ammardab3an/ACM | problems/done/codeforces/A. Average Rank.cpp | // Problem: A. Average Rank
// Contest: Codeforces - 2019-2020 ICPC Northwestern European Regional Programming Contest (NWERC 2019)
// URL: https://codeforces.com/gym/102500/problem/A
// Memory Limit: 256 MB
// Time Limit: 5000 ms
//
// Powered by CP Editor (https://cpeditor.org)
// By AmmarDab3an - Aleppo Universit... | ALGO | 0.999874 | 3.900861 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2021-10-06T07:54:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d585e17f01c... |
c7dc6a13-5971-4738-bf4b-4d3a58bcacd3 | bsurmanski/brickgl | src/matrix.cpp | #include "matrix.hpp"
#include <stdio.h>
#include <math.h>
#include <float.h>
#include <string.h>
#include <assert.h>
void mat4::reset()
{
v[0] = v[5] = v[10] = v[15] = 1.0f;
v[1] = v[2] = v[3] = v[4] =
v[6] = v[7] = v[8] = v[9] =
v[11] = v[12] = v[13] = v[14] = 0.0f;
}
mat4::mat4(const mat4 ... | ALGO | 0.976357 | 5.196022 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2014-01-17T15:04:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97663de91... |
aa8a848c-8fd3-4d46-b483-d8d95666a876 | Micuks/code | kb_ans/topic18/t18pl/t18pl.hpp | #ifndef _t18pl_20210813_
#define _t18pl_20210813_
#include <algorithm>
#include <assert.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <st... | ALGO | 0.999625 | 4.112801 | {
"github_metadata": {
"branch": "master",
"commit_count": 541,
"repo_created_at": "2020-11-12T05:37:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b89da7e6... |
5b5d7a39-31bd-4cbf-8510-e8bbccfd1ea0 | StanfordPL/stoke | examples/bansal/fxn.cc | // Copyright 2013-2016 Stanford University
//
// 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 ag... | ALGO | 0.997066 | 3.258406 | {
"github_metadata": {
"branch": "develop",
"commit_count": 3489,
"repo_created_at": "2014-02-12T15:57:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 787,
"forks": 79,
"issues": 62,
"pull_requests": 2
},
"file_meta": {
"content_id": "581... |
a81a1c8f-815c-42cb-85f6-cd8d5467241f | SteveNo10/cppworkspace | train/17_demo.cpp | /*============================================================================
* Copyright (C) 2019 Ltd. All rights reserved.
* Author : SteveNo10
* Time : 2019-01-16
* Descript:
*
============================================================================*/
#include <iostream>
using namespace std;
template <t... | ALGO | 0.999882 | 5.532526 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2018-08-24T14:27:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c7f3390d... |
a70c9465-a474-43df-a6b3-39cc906af009 | ajmarin/coding | uva/Volume I/00190.cpp | /////////////////////////////////
// 00190 - Circle Through Three Points
/////////////////////////////////
#include<cstdio>
#include<cmath>
#define PI 3.141592653589793
double abscx,abscy,cx,cy,xa,xb,xc,ya,yb,yc,s1,s2,s3,r;
char sig1, sig2, sig3;
bool show = 0;
int main(void){
while(scanf("%lf %lf %lf %lf %lf %lf",&xa... | ALGO | 0.998156 | 3.837 | {
"github_metadata": {
"branch": "master",
"commit_count": 1044,
"repo_created_at": "2011-08-06T20:03:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 43,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db535... |
fed158ac-598c-472d-a409-272dc38e981e | iliasazizi/GVS | code/LSH-APG/src/space_l2.h | #pragma once
#include <atomic>
//#include "fastL2_ip.h"
extern int _G_COST;
template<typename MTYPE>
using DISTFUNC = MTYPE(*)(const void*, const void*, const void*);
static float
L2Sqr(const void* pVect1v, const void* pVect2v, const void* qty_ptr) {
++_G_COST;
float* pVect1 = (float*)pVect1v;
float* ... | ALGO | 0.988156 | 5.966331 | {
"github_metadata": {
"branch": "main",
"commit_count": 142,
"repo_created_at": "2025-02-17T14:40:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fab86b6a84... |
894b6709-fd56-4bcf-913f-6804fa032b9c | SafaruzzamanShovo/Problem-Solving---Competitive-Programming | CF-solved/1787B.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define fi(n) for(ll i=0; i<n; i++)
#define fj(n) for(ll j=0; j<n; j++)
#define rfi(n) for(ll i = n-1; i >=0; --i)
#define fa(n) for(auto i:n)
#define fa2(n) for(auto i:n) cout<<i<<' ';
#defin... | ALGO | 0.999929 | 3.655017 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-11-22T09:09: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": "f19f61bb434b... |
1e031b80-ae56-41b8-b6b2-37f663be3b70 | ishandutta2007/codeforces-w | wiwiho/normal/1265/B.cpp | //#define NDEBUG
#include <bits/stdc++.h>
#define StarBurstStream ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define iter(a) a.begin(), a.end()
#define riter(a) a.rbegin(), a.rend()
#define lsort(a) sort(iter(a))
#define gsort(a) sort(riter(a))
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(... | ALGO | 0.999984 | 3.690197 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:34: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": "d30f3e9f45d0... |
9d376d92-a5e7-4f06-bd84-e0c402d7bc82 | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/ai_code/test/0_1_137.cpp | #include <iostream>
#include <string>
using namespace std;
long long reverseBinary(long long num) {
string binary = "";
while (num > 0) {
binary += to_string(num % 2);
num /= 2;
}
reverse(binary.begin(), binary.end());
return stoll(binary, nullptr, 2);
}
bool canReach(long lon... | ALGO | 0.999964 | 4.963479 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-04-28T03:59: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": "211ae4ea0c0... |
2395fcff-4a88-4393-bee4-4b216b1250dd | meo-s/problem-solving | 17000/800/17836_๊ณต์ฃผ๋์_๊ตฌํด๋ผ/BJ_17836_๊ณต์ฃผ๋์_๊ตฌํด๋ผ.cc | // https://www.acmicpc.net/problem/17836
#include <array>
#include <cstdint>
#include <deque>
#include <iostream>
#include <iterator>
#include <limits>
#include <tuple>
#include <utility>
#include <vector>
using i32 = std::int32_t;
using u32 = std::uint32_t;
constexpr auto WALL = i32(1);
constexpr auto SWORD = i32(2)... | ALGO | 0.999775 | 4.892284 | {
"github_metadata": {
"branch": "main",
"commit_count": 961,
"repo_created_at": "2022-11-14T11:43:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b3c1d133b... |
3ce58fbf-866f-48b3-848b-be8f16d2dbb0 | watermantle/LeetCode_watermantle | 542-01-matrix/542-01-matrix.cpp | class Solution {
public:
vector<vector<int>> updateMatrix(vector<vector<int>>& mat) {
int m = mat.size(), n = mat[0].size();
if (m == 0) return mat;
vector<vector<int>> res(m, vector<int> (n, INT_MAX - 100000));
for (int i = 0; i < m; ++i) {
for (int j = 0; j < n... | ALGO | 0.999961 | 6.114448 | {
"github_metadata": {
"branch": "main",
"commit_count": 1446,
"repo_created_at": "2021-07-16T03:08: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": "79afaa3b8... |
ae38bfe7-0838-4274-901d-5460ef4efa2c | Amankapil/DSA | Sorting/bubbleSort.cpp | #include <bits/stdc++.h>
using namespace std;
// ? repeatedly swap two adjacent element if they are in wrong order.
void swap(int arr[], int i, int j)
{
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
int partitjion(int arr[], int l, int r)
{
int pivot = arr[r];
int i = l - 1;
// int j = ... | ALGO | 0.999956 | 5.339447 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-12-02T13:33: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": "d261a7d794... |
2a0aac5c-9647-43b8-86c6-5d681686f686 | linqiu15/Leetcode | Algorithm/shortest_distance_to_a_character.cpp | //--------------------Description----------
// Given a string S and a character C, return an array of integers representing
// the shortest distance from the character C in the string.
//--------------------Results--------------
// Runtime: 8 ms, faster than 26.15% of C++ online submissions for Shortest
// Distance to ... | ALGO | 0.999959 | 5.88454 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2020-07-30T00:13:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c1c9fd52... |
84eed573-546c-4316-b824-e69c859647db | arrows-1011/CPro | AOJ/Volume25/2583.cpp | #include <iostream>
#include <cctype>
using namespace std;
#define MAX 1050
char S[MAX][MAX];
int K[MAX];
void print(int N){
for(int i = 0 ; i < N ; i++){
for(int j = 0 ; j < K[i] ; j++){
if(S[i][j] == '.'){
cout << " ";
}else{
cout << S[i][j];
}
}
cout << endl;
}
}
int main(){
... | ALGO | 0.999566 | 3.770642 | {
"github_metadata": {
"branch": "master",
"commit_count": 258,
"repo_created_at": "2015-11-18T15:08:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "209a8156... |
f41ff737-0c18-4751-b8f7-6a9650fc3369 | trilinos/Sundance | src-std-framework/Elements/SundanceGauss1D.cpp | /* @HEADER@ */
// ************************************************************************
//
// Sundance
// Copyright 2011 Sandia Corporation
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this ... | ALGO | 0.964712 | 6.100253 | {
"github_metadata": {
"branch": "master",
"commit_count": 901,
"repo_created_at": "2015-12-01T22:07:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "840770881... |
b5f66c8d-0e0e-4b10-89f2-639ed55497bd | pranavjangir/CompetitivePrograming | CodeForces/CF749-D2-E.cpp | /*
Easy problem on BIT trees, editorial : https://codeforces.com/blog/entry/49186
*/
#include <bits/stdc++.h>
typedef long double ld;
typedef long long ll;
using namespace std;
ll n;
ll a[100005];
class BIT
{
public:
vector<ll> tree;
BIT(){
tree.resize(200005, 0LL);
}
v... | ALGO | 0.999863 | 4.305724 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2018-11-15T18:12: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": "13a271629... |
f3ca4f07-70e6-47e7-8cf8-831401d88d9d | HaWind08/DSLK-University | dslk.cpp | #include<bits/stdc++.h>
#define max 10
using namespace std;
//count < size 1 don vi
struct SinhVien{
string maSV;
string tenSV;
string gioiTinh;
int namSinh;
int diemTK;
};
struct List{
int count;
SinhVien e[max];
};
List L;
//khoi tao rong
void khoiTao(List &L){
L.count = -1;
}
//kiem tra rong
int ktRong(L... | TOOL | 0.991393 | 3.318297 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-04-15T03:18:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "10e5a70b1acb... |
e6ee4b70-3c90-4181-afbc-72e3fa2f56a3 | thethanh02/cpp-dsa | DSA09014.cpp | #include <bits/stdc++.h>
using namespace std;
int v, e, x, y, ans;
bool vs[1001];
vector<vector<int>> ls;
bool DFS(int u, int par) {
vs[u] = 1;
for (int i : ls[u]) {
if (!vs[i]) {
if (DFS(i, u)) return 1;
} else if (i != par) return 1; // co canh nguoc (i, u)
}
return 0;
}
v... | ALGO | 0.999982 | 5.07409 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2022-03-10T12:55:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f66a10198... |
66c61877-1346-4322-8659-80f560391451 | MObaidullahFsl/Data-Structures- | LinkedLists.cpp | #include<iostream>
using namespace std;
class node {
public:
int data;
node* next;
node(int a): data(a) {
}
void insert(node*&);
void endInsert(node*&);
void randomInsert(node*&, int);
void print();
};
void node::insert(node*& head) {
node* temp = head;
head = this;
this->next = temp;
}
void node::e... | ALGO | 0.99836 | 4.386704 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-07-29T18:16: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": "7b6ca5b91acb... |
77c725c5-7ca4-4a24-a0d6-fbb441421897 | elben6exam/docker_raspberry_yolo | arm_docker/thirdparty/ComputeLibrary/src/core/NEON/kernels/arm_gemm/kernels/a64_hybrid_u8u32_mmla_6x16/generic.cpp | /*
* Copyright (c) 2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights ... | ALGO | 0.915022 | 5.477672 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-08-05T13:35: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": "77c1a4cb7258... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.