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 |
|---|---|---|---|---|---|---|---|
94b0761f-0e60-428d-8341-3f42dd293ff7 | philleer/coding | leetcode/387_firstUniqueChar.cc | /******************************************************************************
* The source is part of my coding practice, a lightweight C++ solution for
* leetcode program practice.
*
* For all of my code, after check it online by submit, I also compile and run
* it by my offline machine
* =====================... | ALGO | 0.999411 | 5.456167 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2019-04-13T14:52:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "b4ebd4f49... |
e297d871-52cb-4da9-8747-0d18a44aeccd | rezoo/cvutil | cvutil/algorithm/integrate.hpp | /* The MIT License
*
* Copyright (c) 2011 <NAME> <<EMAIL>>
*
* 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 to use, co... | ALGO | 0.980952 | 6.515583 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2011-09-17T05:43:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "792a7c7d... |
ea46559a-c13c-486a-a973-1bd025f5ced8 | ishandutta2007/codeforces-s | sonechko/normal/1110/D.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
const int N = 1e6 + 11;
int a[N],dp[N][6][6];
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n,m;
cin>>n>>m;
for (int i=1; i<=n; i++... | ALGO | 0.999951 | 3.251582 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de4107d3179d... |
2576ff55-9b7a-449d-98f8-33d31e900844 | alonaratsebarska/university | lab_works/laboratory_10.cpp | /* Лабораторна робота № 10
Варіант No1.
Умова:
Дано рядок. Підрахувати кількість цифр, що містяться в ньому. Знайти найбільшу кількість цифр, що йдуть у тексті поспіль.
***
Що робить ця програма/цей код:
У цій програмі ми спочатку зчитуємо рядок із... | ALGO | 0.998479 | 5.154895 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-02-17T00:55: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": "8054afbb51... |
79de58d4-b796-4f85-9993-ea52642ab0ba | Akvgatr/Ai-codes | bfs , dfs 5 aug 2024.cpp | #include <iostream>
#include <queue>
#include <vector>
#include <map>
using namespace std;
void bfs(vector<vector<int> >& adjList, int startNode,
vector<bool>& visited)
{
queue<int> q;
// current node as visited and enqueue it
visited[startNode] = true;
q.push(startNode);
// Iterat queu... | ALGO | 0.999967 | 5.641704 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-18T06:27:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "303695f17f8d... |
e8b9ebad-91f2-4d1d-ac76-3a761714207c | KingVinay/LeetcodeChallenge | DailyCodingChallenge/June25/SumOfKMirrorNumbers.cpp | #include<bits/stdc++.h>
using namespace std;
int digit[100];
long long kMirror(int k, int n) {
auto isPalindrome = [&](long long x) -> bool {
int length = -1;
while (x) {
++length;
digit[length] = x % k;
x /= k;
}
for (int i = 0, j = length; i < ... | ALGO | 0.99995 | 5.392858 | {
"github_metadata": {
"branch": "main",
"commit_count": 191,
"repo_created_at": "2025-01-31T15:39: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": "7acb047ca8... |
35a0f158-4198-4c82-a147-66ec2c07b9df | trilinos/Trilinos | packages/rol/src/function/simopt/ROL_Constraint_SerialSimOpt.hpp | // @HEADER
// *****************************************************************************
// Rapid Optimization Library (ROL) Package
//
// Copyright 2014 NTESS and the ROL contributors.
// SPDX-License-Identifier: BSD-3-Clause
// *************************************************************************... | ALGO | 0.993568 | 3.166696 | {
"github_metadata": {
"branch": "master",
"commit_count": 104031,
"repo_created_at": "2015-11-16T19:39:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1299,
"forks": 593,
"issues": 263,
"pull_requests": 61
},
"file_meta": {
"content_id":... |
f85067c2-157f-49e5-add4-34e3fa2905cc | lintsaihsin/Coding | uva1401.cpp | #include <bits/stdc++.h>
using namespace std;
string str;
int sz;
struct node
{
int next[30];
int val;
};
node tree[300005];
int dp[300005];
int mod = 20071027;
void insert(string word){
int u = 0;
for(int i = 0; i < word.size(); i++){
int v = word[i] - 'a';
if(tree[u].next[v]){
... | ALGO | 0.999979 | 4.119657 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-05-15T10:39: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": "b0a8f31b4945... |
b1a5b3c3-131c-4186-9c4a-644fbac44964 | Jack-mi/leetcode- | src/cpp/动态规划/股票(k=K)-188.cpp | class Solution {
public:
int INF = -999999;
// 当k>len/2的时候,相当于k=inf
int maxprofit(vector<int>& prices) {
int len = prices.size();
int dp[len][2];
dp[0][0] = 0;
dp[0][1] = -prices[0];
for (int i = 1; i < len; ++i) {
dp[i][0] = max(dp[i-1][0], dp[i-1][1]+pri... | ALGO | 0.999684 | 5.354979 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2019-11-14T13:05: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": "451c36414... |
98b8ef22-a71b-416c-bb9a-4ae54ee43954 | MicroNanoFlows/OpenFOAM-2.4.0-MNF | src/lagrangian/molecularDynamics/general/boundedBox/boundedBox.H | /*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
-------------... | TOOL | 0.967751 | 7.635396 | {
"github_metadata": {
"branch": "master",
"commit_count": 240,
"repo_created_at": "2015-09-11T12:57:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 55,
"forks": 40,
"issues": 7,
"pull_requests": 1
},
"file_meta": {
"content_id": "d5f6852... |
b642e488-f0a2-4ebe-af6d-5bc9f498d3e8 | ComiteMexicanoDeInformatica/OMI-Archive | 2022/OMI-presencial/OMI-2022-frases-ocultas/solutions/sol_sub1.cpp | #include <iostream>
#define debugsl(x) std::cout << #x << " = " << x << ", "
#define debug(x) debugsl(x) << "\n";
#define MAX 100000
int t, n, largo;
std::string st, palabra[MAX + 2];
int main() {
std::cin >> t >> n >> st;
for (int i = 1; i <= n; ++i) std::cin >> largo >> palabra[i];
bool o, m, i;
o = m =... | ALGO | 0.999788 | 3.128536 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2020-02-08T22:52:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 12,
"forks": 9,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "b02a3b05571... |
4e495990-8872-4c5c-901d-4ea512aae642 | greeshma0601/Arrays | STL/priorityqueue/pqoperations.cpp | /*
C++ STL Priority Queue Submissions: 1279 Accuracy: 16.93% Difficulty: Easy Marks: 2
Problems
Implement different operations on Priority Queue .i.e. adding element, removing element, size of priority queue, print the queue and top element of queue.
Input:
The first line of input contains an integer T... | ALGO | 0.99886 | 4.869534 | {
"github_metadata": {
"branch": "master",
"commit_count": 310,
"repo_created_at": "2018-12-28T18:06: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": "ee3edb9d... |
82b1f2d1-d25a-44f3-a734-38422e144fc0 | XieJiongyan/LuoguSolver | P1119 灾后重建/P1119 灾后重建/源.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <array>
using namespace::std;
constexpr int arrsize{ 200 };
array< array<int, arrsize>, arrsize> afloyd{};
int n, m, q;
vector<int> ntime{};
void update(int time) {
for (auto i(0); i < n; i++) for (auto j(0); j < n; j++) afloyd[i][j] = min(afloyd[i... | ALGO | 0.999969 | 4.935964 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-07-24T13:38:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32903793b2... |
dbbd4190-7245-4456-828b-17bc8ccf51a8 | RacleRay/CodeSpace | CodePractice/数学问题/415StringAdd.cpp | #include "../header.h"
class Solution {
public:
string addStrings(string num1, string num2) {
string output{""};
reverse(num1.begin(), num1.end());
reverse(num2.begin(), num2.end());
int len1 = num1.length();
int len2 = num2.length();
if (len1 <= len2) {
... | ALGO | 0.999955 | 6.744804 | {
"github_metadata": {
"branch": "master",
"commit_count": 244,
"repo_created_at": "2019-08-03T15:46:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "44dd6f46... |
85ae233b-6915-452e-abaa-b10446bc6da6 | pawxnsingh/chai-code-cpp-challenge | day3/solution.cpp | // this include the header file which tell the computer to include the istream and ostream
// which gonna be used in the taking input from the keyboard and displaying output to the screen
#include<iostream>
#include<vector>
#include <algorithm>
// this below line tell which name space to use, in this case standard name... | ALGO | 0.99999 | 4.280333 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-01-18T01:24: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": "0f732faefc8e... |
5a8f6b66-e1e0-4f67-962d-4c1d88cccf48 | revenant899/APOSTOL | APOSTOL.cpp | //#include <iostream>
//using namespace std;
//int main() {
// int rows, cols, num;
//
// cout << "Введіть кількість рядків: ";
// cin >> rows;
// cout << "Введіть кількість стовпців: ";
// cin >> cols;
// cout << "Введіть початкове число: ";
// cin >> num;
//
// int arr[rows][cols];
//
// ar... | ALGO | 0.999022 | 4.973312 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-09-27T14:05: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": "541e91767d... |
db8f1fbd-5740-46d6-a525-7ce3f784c115 | wrg2674/BaekJoon | 백준 문제/7576.cpp | // إن¸¶إن 7576¹ّ
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
#define X first
#define Y second
void bfs(int** mat, int** dis, int n, int m, queue<pair<int, int>>& q) {
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };
while (!q.empty()) {
pair<int, int> cur = q.front();
q.pop... | ALGO | 0.999985 | 3.586969 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2022-12-30T12:39: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": "e2e5e726a57... |
62423cf0-3200-4cc5-90b2-4c3120c6f93a | nguyenhoang4875/CompetitiveProgramming | codejam/2024_final_r2/B.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
//*** define ***//
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(a) (int)(a).size()
#define el '\n'
#define F first
#define S second
#define For(i, a, b) for (int i = (a); i <= (int)(b); i++)
#define Rof(i, a, b) for (int i = ... | ALGO | 0.999969 | 5.431521 | {
"github_metadata": {
"branch": "main",
"commit_count": 328,
"repo_created_at": "2023-02-28T01:38:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1445f0e1d8... |
4d085f03-14fb-4bc1-9537-b2a1f4c0bcc7 | Prabhu260902/leetcode | Alex Travelling - GFG/alex-travelling.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 check(vector<int> &dis, vector<bool> &vis){
int n = dis.size(), res = INT_MAX, idx = -1;
for(int i=1;i<=n... | ALGO | 0.999839 | 5.336071 | {
"github_metadata": {
"branch": "main",
"commit_count": 1338,
"repo_created_at": "2022-07-29T05:17: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": "015a3e8d7... |
bb7d0363-5eab-42bd-9a37-0e13ea4abe89 | touhidul2100/codeforces | B_JoJo_s_Incredible_Adventures.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vl vector<ll>
#define ff first
#define ss second
#define pb push_back
#define read(_a, _n) \
for (auto i = 0; i < _n; i++) \
cin >> _a[i];
#define show(_a) \
for (auto &val : _a) \
{ ... | ALGO | 0.999868 | 4.235094 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-02-04T11:51: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": "bd9c433338b7... |
b98cffb4-b9e4-4587-9b44-02fbc0238c84 | raincross7/code-similarity | codes/train_code/problem266/problem266_427.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int MOD = 1000000007;
//組み合わせの数nCrを計算
ll nCr(ll n, ll r)
{
ll num = 1;
for (ll i = 1; i <= r; i++)
{
num = num * (n - i + 1) / i;
}
return num;
}
int main()
{
... | ALGO | 0.999963 | 4.101557 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1948dc93d10d... |
b025c72f-4129-4351-a101-81613aca62a8 | Hypersand/Algorithm | 백준/Gold/11265. 끝나지 않는 파티/끝나지 않는 파티.cc | #include <iostream>
using namespace std;
int main() {
long INF = 10000000000;
int N, M;
cin >> N >> M;
long arr[N+1][N+1];
for (int i = 1; i <= N; i++) {
for (int j = 1; j <= N; j++) {
cin >> arr[i][j];
if (arr[i][j] == 0) {
arr[i][j] = INF;
... | ALGO | 0.99999 | 4.11599 | {
"github_metadata": {
"branch": "main",
"commit_count": 933,
"repo_created_at": "2022-09-22T05:29:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5c5c1c06f... |
a566ef6b-8d16-4a07-859b-4c810e94b1d0 | DenialRiver1434/USACO-Study | 1-CSES/1093.cpp | #define pb push_back
#define mt make_tuple
#define mp make_pair
#define is insert
#define ll long long
#define for_loop(i, begin, n) for (int i = begin; i < n; i ++)
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main () {
ios_base::sync_with_stdio(0); cin.tie(nullptr);
int N; cin >> N;
... | ALGO | 0.999946 | 3.964593 | {
"github_metadata": {
"branch": "main",
"commit_count": 276,
"repo_created_at": "2021-12-13T00:32:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de47df4b49... |
4a330382-af98-42d9-887b-e74516fd3ab8 | VictorDarvariu/graph-construction-rl | relnet/objective_functions/objective_functions_ext.cpp | #include <iostream>
#include <utility>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <vector>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/connected_components.hpp>
#include <boost/graph/copy.hpp>
#include <boost/graph/graph_utility.hpp>
... | ALGO | 0.974343 | 6.204001 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-12-15T18:54:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "088c8a4f17d6... |
590f2854-7819-49d7-94b0-65c5f8a79f10 | Gaoyuanlong/Q_new | User/Code_C++/src/Elipsoid.cpp | #include "Elipsoid.h"
float A,B,C,D,E,F;
Vector newv;
u8 start = 0;
void Elipsoid_::Input(Vector NewValue)
{
float Tmp[7];
if(start == 0)
{
Tmp[0] = NewValue.x * NewValue.x;
Tmp[1] = NewValue.y * NewValue.y;
Tmp[2] = NewValue.z * NewValue.z;
Tmp[3] = NewValue.x;
Tmp[4] = NewValue.y;
Tmp[5] = NewValue.z;
Tmp... | ALGO | 0.995784 | 4.15257 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-01-11T06:26:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc1fa37613... |
2e0e86d5-bb19-4c20-9b4f-8edae6cbcb22 | David-5-5/tutorial | cplus/codeforce/algo2b-n.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
int read()
{
char ch = getchar();
int f = 1, x = 0;
while (ch < '0' || ch > '9')
{
if (ch == '-')
f = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9')
{
x = x * 10 + ch - '0';
ch = getchar();
}
return f * x;
}
const int maxn =... | ALGO | 0.999987 | 3.456273 | {
"github_metadata": {
"branch": "main",
"commit_count": 2940,
"repo_created_at": "2022-11-22T17:09:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad98c71c2... |
4f827cad-6b7d-4369-86ac-f1e063da9a59 | EthanPham03/BeginningProgrammingHomework | PC4-12.cpp | // A program that computes the total cost of the purchase
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
dounble quantity, regularPrice, discountCost, totalPrice;
const double REGULAR_PRICE = 99.00;
double discount = 0.0;
cout << "Please enter quantity: ";
cin >> quantity;
if... | ALGO | 0.982603 | 4.100728 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2024-08-23T17:44:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c8896aed683... |
9aa29992-5731-45ea-95f8-de1aa2577541 | saketbyte/CP-DCS | 1657-determine-if-two-strings-are-close/1657-determine-if-two-strings-are-close.cpp | class Solution {
public:
bool closeStrings(string word1, string word2) {
vector<int>w1(26,0),w2(26,0),w3(26,0),w4(26,0);
// w1 and w3 are to store the count of each letter and track the unique characters present
// we can do so using w1 only as well but it would increase time compl... | ALGO | 0.999994 | 5.997433 | {
"github_metadata": {
"branch": "master",
"commit_count": 1288,
"repo_created_at": "2021-01-24T07:18: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": "e47a588... |
d8d4112e-fd4e-451a-961a-daf4f1ff635d | Aman24114/leetcode-imp | 905-length-of-longest-fibonacci-subsequence/length-of-longest-fibonacci-subsequence.cpp | class Solution {
public:
int lenLongestFibSubseq(vector<int>& arr) {
if (arr.size() <= 2) return 0;
int n = arr.size();
unordered_map<int, int> mp;
for (int i = 0; i < n; i++) {
mp[arr[i]] = i;
}
int maxi = 0;
for (int i = 0; i < n; i++) {
... | ALGO | 0.99992 | 5.320701 | {
"github_metadata": {
"branch": "main",
"commit_count": 743,
"repo_created_at": "2025-02-17T07:22: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": "b8213bf8fa... |
db71a8c8-48cb-41b7-8891-aa4d8ad65d56 | csci-1730-group-7/Logans-Codes | CSCI-1500/Assign 8 Prob 3.cpp | #include <iostream>
using namespace std;
//prompts user for an amount of money, an interest rate, and then calculates how many years
//it would take to obtain an inputted amount of money
double compound (double deposit1, double rate1, double amount1, int& years){
double balance = deposit1 + deposit1*(rate1/100.0)... | ALGO | 0.990603 | 3.749345 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2019-02-06T17:53:38.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "589d8a7e88... |
95ce900f-fe84-4b23-8d74-0d2df4f2e081 | abg101/metnum | tp2/src/metodos_reduc.hpp | #ifndef METODOS_REDUC_HPP
#define METODOS_REDUC_HPP
#include "matriz_aux.hpp"
#include "normas_aux.hpp"
//Metodo de la potencia
//Asume que vec y autovec son filas
//Vec es el vector inicial
//Se ejecuta hasta que no cambian mucho los valores generados o hasta niter
double met_potencia(const Matriz<double>& b, const ... | ALGO | 0.997811 | 4.357386 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2018-03-24T04:00:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "90983603... |
f5c9bb9b-95d4-4aba-a539-0ca6a69f0b96 | NakulChauhan1/Data-Structure | Other_Platform_Problems/d (2).cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin>>T;
while ( T-- )
{
int n, x, y, z;
cin>>n>>x>>y>>z;
vector<int> arr(n);
int LCM = 1;
for ( int i = 0; i<n; i++ )
{
cin>>arr[i];
LCM *= arr[i];
}
... | ALGO | 0.999393 | 3.258843 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-03-25T06:07:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "87ceeaf61... |
d43a7d41-8276-4e08-a0cf-17c96d5984ec | watemus/cp-prog | codeforces/cf647/A.cc | //
// Created by watemus on 04.06.2020.
//
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define ff first
#define ss second
using ll = long long;
using ld = long double;
#define int ll
constexpr ll INF... | ALGO | 0.99979 | 4.106834 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2020-03-24T15: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": "5744ce45a... |
916e6a07-2caa-41e8-b560-aee8ce32b77d | hkchekc/qmm | include/hugget.hpp | #include <Eigen/Dense>
#include <vector>
#include <iostream>
#include <stdio.h>
using Eigen::MatrixXd;
using std::vector;
#ifndef HUGGET_H
#define HUGGET_H
struct PARAM{
const double beta=0.993362, gamma=3.0;
const double a_min=-3.0, a_max=24.0;
const double net_agg_asset=0.0;
const double vf_crit=1e-6, dist_crit... | ALGO | 0.99983 | 3.977905 | {
"github_metadata": {
"branch": "master",
"commit_count": 95,
"repo_created_at": "2021-09-28T10:05: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": "f4e341522... |
046c98a8-64d0-41c7-b264-c82949a0c131 | ahmadel1/LeetCode | 1202-smallest-string-with-swaps/1202-smallest-string-with-swaps.cpp | class Solution {
public:
typedef vector<vector<int>> GRAPH;
void add_undirected_edge(GRAPH &graph, int from, int to) {
graph[from].push_back(to);
graph[to].push_back(from);
}
void dfs(GRAPH& graph, vector<int>&visited, int node, vector<int>& connection){
visited[node] = 1;
... | ALGO | 0.999999 | 5.763855 | {
"github_metadata": {
"branch": "main",
"commit_count": 241,
"repo_created_at": "2023-08-28T13:18: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": "259f891c5e... |
658598c7-cab4-49b0-9601-5afb26764457 | beshubh/competitive-programming | dynamicProgramming/Lis.cpp | // Problem : Given a sequence of numbers you have to find the longest increasing subsequence
#include <iostream>
using namespace std;
int lis(int *arr, int n)
{
int *dp = new int[n];
dp[0] = 1;
for (int i = 1; i < n; i++)
{
dp[i] = 1;
for (int j = i - 1; j >= 0; j--)
{
... | ALGO | 0.999992 | 5.088732 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2019-03-01T02:08:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b7248e96... |
359b121b-fc3d-4cf4-953d-7a6586113661 | pratyush2905/cfprog | B_Stand_up_Comedian.cpp | #include <bits/stdc++.h>
#define int long long
#define fr(a, b) for (int i = a; i < b; i++)
#define rep(i, a, b) for (int i = a; i < b; i++)
#define all(x) (x).begin(), (x).end()
#define mod 1000000007
// जय श्रीराम //
using namespace std;
void solve()
{
int c1, c2, c3, c4;
cin >> c1 >> c2 >> c3 >> c4;
int ... | ALGO | 0.999975 | 4.337674 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-01-23T13:57: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": "9b867ccb2e7... |
537dca99-52d8-48b1-817d-35f5cfd96dbe | jianningzhuang/CS2040C-Data_Structures_and_Algorithms | PS3/lexico.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
ld numberfy(string name){
ld result = 0;
int count = 0;
for (auto &c : name){
result += double(int(tolower(c)) - int('a'))/double(10);
result *= double(26)/double(10);
count++;
}
for (int i = 0; i < 10-co... | ALGO | 0.999688 | 3.456225 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-07-03T13:56:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d9dac7c8180... |
f441df89-f04d-4fa9-ad09-30a30afd1df5 | sanyaarora2/DSAseries | day10.cpp | class Solution {
public:
vector<int> rearrangeArray(vector<int>& nums) {
vector<int>result(nums.size(),0);
int positive=0;
int negative=1;
for(int i=0; i<nums.size();i++){
if(nums[i]>0){
result[positive]=nums[i];
positive+=2;
}
... | ALGO | 0.999993 | 5.591485 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2025-03-03T06:57:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "27395a6b2bd... |
6d090a1a-2705-40c8-8886-5559d91d1d7b | monali24u/65290 | dataStructure/linkedList/addTwoListsIntoNumber.cpp | #include <iostream>
using namespace std;
struct node
{
int value;
node *next;
};
void addNode(node **root, int val)
{
if(*root == NULL)
{
node *newnode = new node;
newnode->value = val;
newnode->next = NULL;
*root = newnode;
}
else
{
node *begin = *root;
while(begin->next !=... | ALGO | 0.999659 | 4.92199 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-08-05T18:47:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71a6fd098... |
c371b21c-f9b3-40ab-adf1-c1dc392459e5 | Pfftz/Tirtayosha | Sems_2/Pertemuan2/cpp_file/binary.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <chrono>
#include <algorithm>
using namespace std;
using namespace std::chrono;
int binary_search(vector<pair<string, string>> data_list, string x)
{
int l = 0, r = data_list.size() - 1;
while (l <= r)
{
int m = l ... | ALGO | 0.998246 | 5.464094 | {
"github_metadata": {
"branch": "cpp",
"commit_count": 201,
"repo_created_at": "2023-09-04T09:26:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc1c0681118... |
3fd73939-0650-4b4b-b756-283fa09938b8 | NachoTorress/CSES-ProblemSet | Prefix Sum Queries.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define INF -1e18
#define MAX_N 200000
ll n;
ll ST [MAX_N*4], R[MAX_N*4], L[MAX_N*4], lazy[MAX_N*4];
ll sigPot(ll n){
ll pot=1; while (pot<n) pot*=2; return pot;
}
void propagar(ll nodo){
if (lazy[nodo]!=0){
ST[nodo]+=lazy[nodo];
if (L[nodo]!=R[n... | ALGO | 0.999923 | 4.610851 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2024-04-29T22:49:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bddb45122e2... |
33de1b0c-10ee-4139-9b34-6ea5c49a96e1 | rheami/empire | tp1/polygone.cpp | /*
INF3105 -- Structures de données et algorithmes
UQAM | Département d'informatique
Automne 2014 | TP1 | polygone.cpp
*/
#include <cmath>
#include <limits>
#include "polygone.h"
#include "segment.h"
// constructeur
Polygone::Polygone(const Point* _points[])
{
}
Polygone::Polygone()
{
}
// destructeur
Polygon... | ALGO | 0.993203 | 4.154154 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2020-10-13T19:19: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": "876e6b825... |
b0217ed0-7a76-4f90-a308-25a9178e301e | joaomarcosth9/competitive-programming | codeforces/166-edu-div2/B.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL_DEBUG
#include "debug.h"
#else
#define debug(...)
#endif
#define endl '\n'
using ll = long long;
#define int ll
void solve() {
int n; cin >> n;
vector<int> a(n), b(n + 1);
for (int &i : a) cin >> i;
for (int &i : b) cin >> i;
int who = 2e9... | ALGO | 0.999975 | 4.606685 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2022-07-20T11:23: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": "942b6a2db73... |
70bd78cd-1898-4d87-8510-a10e2c0fcb8e | nntile/nntile | include/nntile/tile/adam_step.hh | /*! @copyright (c) 2022-present Skolkovo Institute of Science and Technology
* (Skoltech), Russia. All rights reserved.
* 2023-present Artificial Intelligence Research Institute
* (AIRI), Russia. All rights reserved.
*
* NNTile is software f... | ALGO | 0.990514 | 7.681633 | {
"github_metadata": {
"branch": "main",
"commit_count": 967,
"repo_created_at": "2024-01-24T11:38:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 54,
"forks": 10,
"issues": 44,
"pull_requests": 9
},
"file_meta": {
"content_id": "2e9853d0... |
6a9e2f53-aeb8-4d81-b703-3b528f69af32 | MaksimZotov/probability-theory | C-plus-plus-sources/sources/tasks/Task_7_17.cpp | #include <iostream>
#include "../../headers/helpers/NumberGenerator.h"
void StartTask_7_17(int numberOfIterations, int numberOfBatches, double percentOfSecondRate)
{
int count1 = 0; // Число случаев, когда 1-ая взятая деталь, оказавшаяся
// 1-сортной, была взята из партии с 2-сортными деталями
... | ALGO | 0.90418 | 3.507096 | {
"github_metadata": {
"branch": "master",
"commit_count": 95,
"repo_created_at": "2021-02-16T23:12: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": "9b85fd014... |
45fddbf8-892a-47d0-b2dd-55cf1788117f | pranav142/ChessAI | src/core/move_generation.cpp | //
// Created by pknadimp on 11/19/24.
//
#include "move_generation.h"
bool is_promotion_move(const Piece &piece, int to_row) {
if (piece.type != PieceType::PAWN) {
return false;
}
int end_row = (piece.color == PieceColor::WHITE) ? 0 : 7;
return to_row == end_row;
}
std::vector<Move> genera... | ALGO | 0.994898 | 5.812571 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-11-01T05:18:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "484b558ce91... |
5cc8f2e2-bdfe-4221-84d5-f3887c3879cc | nxp-imx/ethos-u-vela | ethosu/regor/common/hash.cpp | //
// SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates <<EMAIL>>
//
// SPDX-License-Identifier: Apache-2.0
//
// 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
//
// www.... | ALGO | 0.998192 | 7.338346 | {
"github_metadata": {
"branch": "lf-6.12.20_2.0.0",
"commit_count": 1299,
"repo_created_at": "2022-08-22T18:39:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 25,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id"... |
92b2c3e9-8044-4518-aa9f-63518b20a170 | jomael/NaroCAD | Lib/AlternateWrapper/NaroOccCore/NaroOccCore-build-desktop/OCWrappersExt/out/AppDef/AppDef_Compute.cpp | // File generated by CPPExt (CPP file)
//
#include "AppDef_Compute.h"
#include "../Converter.h"
#include "../TColStd/TColStd_HArray1OfReal.h"
#include "../AppParCurves/AppParCurves_HArray1OfConstraintCouple.h"
#include "AppDef_MultiLine.h"
#include "AppDef_MyLineTool.h"
#include "AppDef_MyGradientOfCompute.h"
#include... | TOOL | 0.989935 | 5.599947 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-05-07T04:31:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d6141dfa7... |
1798457e-064c-4357-966f-fe345ccd59e6 | DanDragan/LeetCode | rotate_image/rotate_image.cpp | #include <iostream>
#include <vector>
class Solution {
public:
void rotate(std::vector<std::vector<int>>& matrix) {
unsigned int size = matrix[0].size();
for (auto i = 0; i < size; i++)
{
for (auto j = i + 1; j < size; j++)
{
int tmp = matrix[i][j];
... | ALGO | 0.999831 | 6.201112 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2023-05-14T06:45:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c28562702e4... |
21ab1625-a442-4a36-87e4-4737e4f063fe | markotny/RayTracer | RayTracer/Object.cpp | #include "pch.h"
#include "Object.h"
bool solve_quadratic(const float &a, const float &b, const float &c, float &x0, float &x1)
{
const auto delta = b * b - 4 * a * c;
if (delta < 0) return false;
if (delta == 0) {
x0 = x1 = -0.5 * b / a;
}
else {
float q = (b > 0) ?
-0.5 * (b + sqrt(delta)) :
-0.5 * ... | ALGO | 0.921203 | 5.271265 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-01-26T14:05: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": "02f5083c1c... |
3593bef9-b279-40c1-adde-b2ae5326f168 | iammanjunathnr/dsa | 2.cAndCppBasics/18.arrayAsParameter.cpp | #include <iostream>
using namespace std;
// Passing array as parameter (through pointer)
// void fun(int *A, int n)
// {
// for (int i = 0; i < n; i++)
// {
// cout << A[i] << " ";
// }
// }
// Function returning an array
int *fun(int n)
{
int *p;
p = new int[n];
for (int i = 0; i < ... | TOOL | 0.991898 | 4.219832 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2025-06-01T15:46:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82f960b18fe... |
9732c2c8-59c8-4384-8791-cd85ffc62c10 | junkyn/for-practice | 백준/Silver/10828. 스택/스택.cc | #include <iostream>
using namespace std;
int* stack;
int i = 0;
int j = 0;
int N;
void push() {
int n;
cin >> n;
stack[j] = n;
j = (j + 1) % N;
}
bool isEmpty() {
return i == j;
}
void top() {
if (isEmpty()) {
cout << -1 << "\n";
return;
}
int idx = j - 1;
if (idx < 0) {
idx = N - 1;
}
cout << st... | ALGO | 0.997517 | 4.237918 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2023-01-15T08:39: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": "94a14a83f... |
c59aadc7-4952-4fff-bc6d-d5b05eeaa844 | Manzi-Cedrick/more-dsa | graph/vector_based_matrix.cpp | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
void printDFS(vector <vector <int>> v, int sv, vector <bool> &visited) {
cout << sv << endl;
visited [sv] = true;
int n = v.size();
for(int i = 0;i < n;i++) {
if(v[sv][i] == 1 && visited[i] == false) {
print... | ALGO | 0.999972 | 4.938726 | {
"github_metadata": {
"branch": "main",
"commit_count": 109,
"repo_created_at": "2022-09-29T06:32:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a030ba9e8... |
9a077e6a-045f-4db8-9dd4-458a7e6c21dd | As1i1/Competitive-programming | SPBGU otbor/B.cpp |
//
// Created by AMD on 26.12.2021.
//
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
typedef long double ld;
const int INF = 1e9, MOD = 998244353, Q = 38;
const ld eps = 1e-9;
const ll ll_INF = 1e18;
//mt19937 gen... | ALGO | 0.999985 | 4.338199 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2021-12-24T10:33: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": "ec4ba0fb2... |
674ce60d-11df-427d-98d2-4ee30144fb4c | jpreher/cassie_description | MATLAB/simulink/evaluate_holonomics.cpp | /*
* MIT License
*
* Copyright (c) 2020 <NAME> (<EMAIL>)
*
* 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
* to use, cop... | ALGO | 0.998559 | 5.694824 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-03-11T02:43:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c09930ad... |
d0c66676-ed7b-4d8c-865c-221a9713d339 | pkapulkit/binary_code | binary/v1.cpp | #include<bits/stdc++.h>
#include<string>
#include<unistd.h>
using namespace std;
class buddy
{
int size;
vector<pair<int, int>> free_list[100000];
map<int, int> mp;
public:
void start()
{
cout<<"\n ----------------------------------------------------------------------------------------";
cout<<"\n ... | ALGO | 0.991216 | 3.696895 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-01-09T07:36: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": "8aa4c48b8abf... |
d75e4c0e-0bd0-4f7b-a9c8-0bf6cabd37db | tiennguyen03/MonteCarloPhotonSimulation | C++MonteCarlo/MonteCarlo_MultiLayer.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include <random>
#include "Photon.h"
#include "CurrentTissueMedia.h"
#define M_PI 3.14159265358979323846
const double EPSILON = 1e-4; // Threshold weight for roulette
const int M = 10; // Roulette survival multiplier
const int NPHOTO... | ALGO | 0.984281 | 5.250615 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-01-16T14:46:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7efa742a26a... |
3c01d9a0-005a-439c-991d-40396fcaefe1 | NoaGoldberg/cs234901 | lesson7/heritage.cpp | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using name... | ALGO | 0.999894 | 4.012252 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2020-07-28T14:38: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": "98ebad008... |
9bf491ed-eb30-42f2-b122-012b167a9e3a | ictlyh/LeetCode | Algorithm/cpp/125.cc | class Solution {
public:
string strToLower(string s) {
for (int i = 0; i < s.size(); i++)
s[i] = tolower(s[i]);
return s;
}
bool isPalindrome(string s) {
if (s.size() < 2) return true;
s = strToLower(s);
for (int i = 0, j = s.size() - 1; i < j; i++, j--) {
wh... | ALGO | 0.999765 | 5.986201 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2016-03-12T06:01: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": "8a69ad7e... |
8b1c50ba-bd93-4463-b14a-0ec96ccc354b | programmingduo/ACMsteps | 数据结构/树状数组/acm11-A.cpp | #include<stdio.h>
#include<iostream>
#include<string.h>
#include<iostream>
using namespace std;
const long long MAXN=100010;
long long first[MAXN], second[MAXN], num[MAXN], l[MAXN], r[MAXN], d[MAXN];
long long lowbit(long long x)
{
return x&(-x);
}
void add(long long i,long long val, long long c[], long long n... | ALGO | 0.999975 | 3.246931 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2016-07-11T03:01:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec30d7bd2... |
ccd9f7ab-f97a-417e-abc0-f467f1a84562 | Pellesaxon/PDP-Project | shearSort.h | #ifndef SHEARSORT_H_
#define SHEARSORT_H_
#include <mpi.h>
#include <vector>
#include <array>
#include <algorithm>
#include <math.h>
#include <iostream>
#include <fstream>
// Enable/disable debug-prints
#ifndef DDEBUG
#define DDBUG 0
#endif
// Enable/disable writing to outputfile
#ifndef OUTPUT
#define OUTPUT 1
... | ALGO | 0.99938 | 4.6916 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2025-05-19T19:51:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c21386f187... |
00bfeb6a-7309-4144-b7a5-6b0c4c06e11e | prachibalodia/DSA_with_CPP | optimised_diameter_of_bt.cpp | #include <iostream>
using namespace std;
#include <bits/stdc++.h>
class Node
{
public:
int data;
Node *left;
Node *right;
Node(int d)
{
data = d;
left = right = NULL;
}
};
Node *buildLevelOrderTree()
{
int d;
cin >> d;
Node *root = new Node(d);
queue<Node *> q;... | ALGO | 0.99958 | 4.074488 | {
"github_metadata": {
"branch": "main",
"commit_count": 334,
"repo_created_at": "2022-07-23T11:30: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": "10282bec65... |
29344efb-dff1-4c92-9f1e-bd43150235bc | dedsec092/DSA-code-dump | Dynamic Programing/2D dp/longestIncreasingSubsequence(IMP).cpp | /*
QUESTION:Given an array of integers, find the length of the longest (strictly) increasing subsequence from the given array.
Input:
N = 16
A = {0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15}
Output:
6
Explanation:
There are more than one LIS in this array. One such Longest increasing subsequence is {0,2,6,9,13,15}.
TIME CO... | ALGO | 0.999992 | 5.12556 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-01-26T16:49: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": "81332186a0b7... |
a149c591-7f0c-43ee-9fea-6628a1d28319 | PrasannaPDixit/Projects | Program319.cpp | #include<iostream>
using namespace std;
template <class T>
struct node
{
T data;
struct node *next;
};
template <class T>
class SinglyLL
{
public:
struct node<T> * First;
SinglyLL();
void InsertFirst(T no);
void Display();
int Count();
};
template <class T>
Singly... | ALGO | 0.999166 | 4.946392 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2022-11-28T04:44: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": "fa69958952a... |
70af7fe8-6e4c-4d9c-9cc0-d4a5a2a3119e | GeorgeWeb/parallel-nbody | nbody-sycl/src/kernels/compute_force_kernel.hpp | #ifndef NBODY_SYCL_COMPUTE_FORCE_KERNEL_HPP_
#define NBODY_SYCL_COMPUTE_FORCE_KERNEL_HPP_
// ...
#include "common.hpp"
// sycl helper abstractions and type aliases
#include <sycl_utils.hpp>
namespace sycl = cl::sycl;
#include <limits>
namespace kernels {
// gravity constant
static constexpr float k_grav = 6.67408f... | ALGO | 0.998393 | 6.541832 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2018-12-06T06:13:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0dca40197... |
fd0391d1-fe4b-4f0e-b345-2fe4ff10ac05 | swapgupt/InterviewBit | LinkedLists/ReverseLinkListIi.cpp | ListNode* Solution::reverseBetween(ListNode* A, int B, int C) {
if (A == NULL || B == C) return A;
ListNode *head = A;
ListNode *prev = NULL;
ListNode *first = NULL, *second=NULL;
int i=0;
ListNode *p = A;
while (p != NULL){
i++;
if (i == B-1){
... | ALGO | 0.999973 | 5.195482 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-05-27T06:12: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": "1e48d3788f... |
8b09f182-e6bb-4c4a-a9d8-d25491ae73d0 | PrinceBanerjee04/cpp-programming | NUMBERS/unique.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int m, n;
cout<<"ENETR M : ";
cin >> m;
cout<<"ENTER N : ";
cin >> n;
if (m < 1 || m > 30000 || n < 1 || n > 30000 || m > n)
{
cout << "INVALID INPUT";
}
else
{
int c = 0, i, d, n1;
for (i = m; i <... | ALGO | 0.999644 | 4.841985 | {
"github_metadata": {
"branch": "main",
"commit_count": 438,
"repo_created_at": "2023-12-13T13:38:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2ae79aad6... |
d7302139-9c5e-4efd-bcec-8c15478d1de9 | AbdulrhmanAnsary/CPP_Algorithms_DS_Mastery | dynamicProgramming/longestCommonSubsequence/LCSValueByTabulationSpaceOptimizedSingleArray.cpp | // C++ program to find the longest common subsequence of two strings
// using space optimization and single array
#include <iostream>
#include <vector>
#include <string>
using namespace std;
string getLCS(string str1, string str2)
{
int lenStr1 = str1.length();
int lenStr2 = str2.length();
// store the L... | ALGO | 0.999978 | 6.266931 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-09-25T13:22: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": "c78e5f852e3... |
fd682aea-4397-4892-b5f2-7a5883360d61 | Kawser-nerd/CLCDSA | Source Codes/AtCoder/arc031/B/4437747.cpp | #include <iostream>
using namespace std;
constexpr int MAX_H = 10;
constexpr int MAX_W = 10;
int H, W;
int sh{-1}, sw{-1}, gh{-1}, gw{-1};
char grid[MAX_H][MAX_W + 1];
bool reached[MAX_H][MAX_W];
int land_num;
int landed;
//#define OCTAS
#ifdef OCTAS
constexpr int dh[]{-1, -1, -1, 0, 0, +1, +1, +1};
constexpr int dw... | ALGO | 0.999956 | 4.560428 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-09-30T05:38:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "599f52e9... |
2f7131a1-9e36-4aff-a383-ed156236f31d | ankitsumitg/mrnd-c | Step_7/spec/sortLinkedListSpec.cpp | #include "stdafx.h"
#include "../src/sortLinkedList.cpp"
using namespace System;
using namespace System::Text;
using namespace System::Collections::Generic;
using namespace Microsoft::VisualStudio::TestTools::UnitTesting;
namespace spec
{
[TestClass]
public ref class sortLinkedListSpec
{
private:
TestContext^ t... | TEST | 0.952299 | 6.122182 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-03-22T19:08:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d6d4f3ecbad... |
b8d91ccb-2552-4bfc-a48e-81bc0eea79ea | srisuryaprakashreddy/C-and-C-learnings | 76swappikngusingfriendfunctiontwoclassobjectvariabels.cpp | //WAP to swap private data members of classes named as class_1, class_2 using friend function.
#include<iostream>
using namespace std;
class class_2;
// defining class 1 having friend function swap
class class_1
{ // member data
protected:
int num1;
public:
class_1()
{
num1=10;
}
... | TOOL | 0.943285 | 6.368445 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-03-30T08:44: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": "818e2aca24... |
7e9c0e1b-a868-4770-8b40-b861e09cf57e | kvrancic/Competitive-Programming | mi-2021/domino6.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
// Rješenje vašeg zadatka
int n, q;
vector<pair<int, int>> arr;
cin >> n;
for(int i = 0; i < n; i++){
int x, h;
cin >> x >> h;
pair<int, int> par;
par.firs... | ALGO | 0.999951 | 4.0395 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-02-19T15:13:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d6fce1e3a7... |
d37d4249-49f8-4b62-a6b6-2a5362d1ec49 | h3902340/leetcode | 3600.cpp | #include "Jutil.h"
using namespace std;
#define KNRM "\x1B[0m"
#define KRED "\x1B[31m"
#define KGRN "\x1B[32m"
struct Data {
int u;
int v;
int s;
};
const int N = 1e5;
int parent[N];
class Solution {
public:
int maxStability(int n, vector<vector<int>>& edges, int k) {
memset(parent, -1, si... | ALGO | 0.999919 | 5.093278 | {
"github_metadata": {
"branch": "main",
"commit_count": 478,
"repo_created_at": "2025-02-25T15:17: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": "b114d93480... |
6477dd23-e90b-455e-92b2-2a0197f3f066 | neamul-haq/XPSC_DailyCodes | week5/Day6(12.7.23)/B_Odd_Sum_Segments.cpp | /*
*/
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef long long int ll;
#define ndl... | ALGO | 0.999991 | 3.715021 | {
"github_metadata": {
"branch": "main",
"commit_count": 88,
"repo_created_at": "2023-06-16T17:42: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": "6d10777f101... |
f508a71d-99e3-4245-985c-e7214b3823f0 | m7moudGadallah/leetCode_Solutions | Hash_Table/496-Next_Greater_Element_I.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<int> nextGreaterElement(vector<int>& nums1, vector<int>& nums2) {
int n = (int) nums2.size();
unordered_map<int, int> mp; //map of (nums2 element, next greater of it)
stack<int> stk; ... | ALGO | 0.999961 | 5.623412 | {
"github_metadata": {
"branch": "main",
"commit_count": 448,
"repo_created_at": "2022-10-18T09:30:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc24ef27e1... |
ee50f9a8-2629-4953-aa07-be1b99f83e0a | VOID001/CodeTogetherNEU | specialVolumeByType/Vol_1/M/M.cpp | /*************************************************************************
> File Name: M.cpp
> Author: VOID_133
> ###################
> Mail: ###################
> Created Time: 2015年03月18日 星期三 18时58分05秒
************************************************************************/
#include<iostream>... | ALGO | 0.999935 | 3.579287 | {
"github_metadata": {
"branch": "master",
"commit_count": 199,
"repo_created_at": "2014-04-18T07:37:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ece14a13... |
05387820-ebf4-4726-9752-5fa976ea49a7 | biggysmith/advent_of_code_2023 | src/day09/day9.cpp | #include <vector>
#include <iostream>
#include <fstream>
#include <regex>
std::vector<std::string> parse(const std::string& line, std::regex& reg) {
return std::vector<std::string>(std::sregex_token_iterator(line.begin(), line.end(), reg), std::sregex_token_iterator());
}
using report_t = std::vector<int64_t>;
usi... | ALGO | 0.998649 | 6.499358 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2023-12-02T18:14:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47e13d5b1... |
77b03980-3460-4c88-aa06-859594c0a516 | khalidfarooq/Leetcode-Journey | 1022-sum-of-root-to-leaf-binary-numbers/1022-sum-of-root-to-leaf-binary-numbers.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.999934 | 5.69991 | {
"github_metadata": {
"branch": "main",
"commit_count": 351,
"repo_created_at": "2021-11-26T01:16:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "566cdbd54b... |
5643fdce-5740-4b26-9390-f070b8984a51 | jromero132/online-judges-problem-solutions | Codeforces/Contests/0001/B-2.cpp | // Problem name: Spreadsheet
// Problem link: https://codeforces.com/contest/1/problem/B
// Submission link: https://codeforces.com/contest/1/submission/27363961
#include <bits/stdc++.h>
#define MAX (int)(1e5 + 1)
#define MOD (int)(1e9 + 7)
#define INF (int)((1 << 31) - 1)
#define EPS (double)(1e-6)
#define pf(i) pus... | ALGO | 0.999806 | 4.294376 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2021-09-24T15:56:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e02ac3186... |
f3955d2e-eaad-406e-afa2-5a80c9bc9096 | MatheusFerreiradeOliveira/Codes | Questões Aleatórias/USP/ORD e BB/Books.cpp | #include <bits/stdc++.h>
using namespace std;
int vet[100010];
int prefix_sum[100010];
int n,m;
// To pensando em começar de I, ai faz N buscas salvando oq cada uma retorna em vencedor ( o max)
// N tem pq olhar antes do cara, já q vai rodar N vezez
int buscaB(int i){
int ini = i;
int fim = n-1;
int said... | ALGO | 0.999997 | 4.108067 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-01-21T13:33: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": "985b5a6dd1... |
5dc84411-5481-43e3-bdf0-9719d0c5f2ca | oreillymedia/Learning-OpenCV-3_examples | example_17-01.cpp | // Example 17-1. Kalman filter example code
#include <vector>
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <opencv2/opencv.hpp>
using std::cout;
using std::endl;
#define phi2xy(mat) \
cv::Point(cvRound(img.cols / 2 + img.cols / 3 * cos(mat.at<float>(0))), \
cvRound(img.rows / ... | ALGO | 0.993418 | 6.555227 | {
"github_metadata": {
"branch": "master",
"commit_count": 228,
"repo_created_at": "2016-12-06T14:06:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2279,
"forks": 904,
"issues": 15,
"pull_requests": 3
},
"file_meta": {
"content_id": "d21... |
05718f08-111c-434f-abec-f7e0919d7ba2 | Nashar-Ahmed/UVA-Problems | 439 - Knight Moves/439 - Knight Moves.cpp | #include<bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
int fx[] = {1,1,2,2,-1,-1,-2,-2};
int fy[] = {2,-2,1,-1,2,-2,1,-1};
bool valid(int x,int y)
{
if(x>=0 && x<8 && y>=0 && y<8)
return 1;
else
return 0;
}
int BFS(int sx,int sy,int ex,int ey)
{
int visited[10][10] = {0};
... | ALGO | 0.999939 | 3.612608 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-09-17T05:27: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": "497f6f360d... |
81b7ff11-8ff2-491c-b555-daa86f736b2b | Kowsihan-sk/GeeksforGeeks-Solutions | Medium/Minimize-the-heights.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAX 1000000007
#define ll long long
int minimizeHeight(vector<int> a, int k)
{
if (a.size() == 1)
return 0;
sort(a.begin(), a.end());
if (k >= a[a.size() - 1] - a[0])
return a[a.size() - 1] - a[0];
int small = a[0] + k, big = a[a.... | ALGO | 0.999959 | 4.512616 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-07-03T18:29:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c2d546cc... |
d0612bf3-9879-4a70-a196-dab517c8b3c2 | developerMathi/WindTurbine | Main.cpp | #include <stdio.h>
#include <math.h>
#include <GLFW/glfw3.h>
#include <GL/gl.h>
#include <GL/freeglut.h>
#include <iostream>
#include <fstream>
#include <string>
#include "sstream"
using namespace std;
int refreshCount = 0; // intial refresh count, it will increase by one in every frame refresh
int speedFactor = 1; ... | TOOL | 0.975583 | 3.90641 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2023-07-07T11:37: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": "c8521dfd44... |
f53e5e29-d002-489d-9884-8b0f8606bb9e | zhu8655/OI_Solution | BZOJ_1009.cpp | #include<cstdio>
#include<cstdlib>
#include<algorithm>
using namespace std;
typedef long long LL;
const int MAXN = 50010;
const int INF = 0x7777777f;
inline int read() {
int x=0,f=1;char c=getchar();
while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
return x*f;
}/*===... | ALGO | 0.99999 | 3.844051 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2015-05-10T03:48: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": "6788db7e6... |
1cf443ab-7d67-4a8a-9445-4ceb597b1898 | SiyangShao/codes | codeforces/2022/R798/E.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
class DSU {
public:
vector<ll> fa, siz;
ll n;
DSU(ll _n) : n(_n) {
fa.resize(n);
iota(fa.begin(), fa.end(), 0);
siz.assign(n, 1);
}
auto find(ll u) {
if (u == fa[u])
return fa[u];
... | ALGO | 0.999931 | 3.700658 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-04-08T14:41:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fbfbddc28a9c... |
fe30b5f5-6469-445f-8c3a-8277e9d47c14 | XiaoHuanzzz/Numerical-Analysis-Exercise | Exercise2_3/NewtonMethod.cpp | /*
* @Author: (xiao_huan) <EMAIL>
* @Date: 2023-09-14 11:57:26
* @LastEditors: (xiao_huan) <EMAIL>
* @LastEditTime: 2023-09-14 12:09:59
* @FilePath: \Exercise2_3\NewtonMethod.cpp
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
... | ALGO | 0.999974 | 4.780675 | {
"github_metadata": {
"branch": "main",
"commit_count": 110,
"repo_created_at": "2023-07-23T17:04: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": "f070872ea9... |
4e4ee16f-4d1f-463c-bd08-9bfd6f96fe1e | ipa-alb/seher | src/seher/src/distance_calculation/distance_calculation.cpp | /*This node calculates the minimal distance between the occupancy map and the robot TCP and publishes it.
*/
#include <ros/ros.h>
#include <tf/transform_listener.h>
#include <visualization_msgs/Marker.h>
#include <cmath>
#include <sensor_msgs/PointCloud2.h>
#include <sensor_msgs/PointCloud.h>
#include <sensor_msgs/po... | TOOL | 0.972306 | 5.022748 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-03-26T14:02:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "437fa4099a... |
84d75e38-371e-4c4c-8ab7-6dc2257afa98 | STEllAR-GROUP/hpx | libs/core/algorithms/include/hpx/parallel/container_algorithms/minmax.hpp | // Copyright (c) 2014-2023 <NAME>
//
// SPDX-License-Identifier: BSL-1.0
// 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)
// make inspect happy: hpxinspect:nominmax
/// \file parallel/container_algorithms/minma... | ALGO | 0.999931 | 7.530183 | {
"github_metadata": {
"branch": "master",
"commit_count": 29939,
"repo_created_at": "2012-05-26T15:02:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2693,
"forks": 480,
"issues": 124,
"pull_requests": 43
},
"file_meta": {
"content_id": ... |
c1e484ee-7613-4ee0-abad-f88744b9f269 | akshita1204/gfg160 | Dp/Day127.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int f(string &digits,int i,vector<int>&dp)
{
int n=digits.size();
if(i==n) return 1;
if(digits[i]=='0') return 0;
if(dp[i]!=-1) return dp[i];
//single digit
... | ALGO | 0.998766 | 5.891974 | {
"github_metadata": {
"branch": "master",
"commit_count": 168,
"repo_created_at": "2024-12-24T09:48: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": "df6f026f... |
d9b75f6e-744f-4f7c-b91c-bf45ea433b13 | titilima/blinkit | src/blinkit/blink/renderer/core/editing/EditingStrategy.cpp | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "core/editing/EditingStrategy.h"
#include "core/editing/EditingUtilities.h"
#include "core/layout/LayoutObject.h"
namespace blink {
// If a no... | TOOL | 0.961171 | 7.601426 | {
"github_metadata": {
"branch": "1.4",
"commit_count": 5244,
"repo_created_at": "2019-02-03T11:26:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b3ec91d7... |
d85456ea-3349-45b9-865c-caef775dd142 | DineshMeegada/Striver_A2Z_Sheet | 13. Binary Trees/13.2 Medium Problems/3_DiameterOfTree.cpp | #include <bits/stdc++.h>
using namespace std;
struct TreeNode {
int data;
TreeNode *left;
TreeNode *right;
TreeNode() : data(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : data(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, TreeNode *right) : data(x), left(left), r... | ALGO | 0.999067 | 4.059321 | {
"github_metadata": {
"branch": "main",
"commit_count": 327,
"repo_created_at": "2023-07-23T07:53:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "87038398e9... |
4fa6412e-504b-43a2-a28e-7ebbba90c083 | PDAL/PDAL | vendor/kazhdan/PoissonRecon.h | /*
Copyright (c) 2006, <NAME> and <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
conditions and the following ... | ALGO | 0.992475 | 5.185964 | {
"github_metadata": {
"branch": "master",
"commit_count": 10210,
"repo_created_at": "2011-08-19T15:57:50.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1253,
"forks": 466,
"issues": 114,
"pull_requests": 8
},
"file_meta": {
"content_id": "... |
296a016a-8829-45bf-8373-aeee057ca12c | isthatm/leet | ransomNote.cpp | #include <iostream>
#include <set>
#include "./minh_hash/HashOps.h"
using namespace std;
class Solution {
public:
bool canConstruct(string ransomNote, string magazine) {
HashOps<int, int, int_hash> hashMap;
set<char> mag_keys(magazine.begin(), magazine.end());
for (char K: mag_keys) { // s... | ALGO | 0.999805 | 5.730128 | {
"github_metadata": {
"branch": "main",
"commit_count": 94,
"repo_created_at": "2023-10-30T07:02:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ef7bc52177... |
9b8ab5d3-6104-4fa2-9907-468590f55f31 | rakib181/Phitron | Week 05/V.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int tt;
cin >> tt;
while(tt--) {
int n;
cin >> n;
vector<int> ar(n); vector<char> ans(n);
for(int i = 0; i < n; i++){
cin >> ... | ALGO | 0.999966 | 4.535235 | {
"github_metadata": {
"branch": "main",
"commit_count": 220,
"repo_created_at": "2023-03-31T19:17:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f6fceb0b0... |
18a37162-2c20-4262-91f3-559b43270279 | ishandutta2007/codeforces-a | andr0901/normal/1304/A.cpp | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
//vector string deque break continue
#define forn(i, s, f) for (int i = (int)s; i < (int)f; i++)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define fs first
#define sc second
#define... | ALGO | 0.99879 | 3.460377 | {
"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": "2f3453d887b9... |
def39916-0e7e-4fed-8416-015306313629 | ishandutta2007/codeforces-a | andrew/normal/1013/A.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define p_b push_back
#define pll pair<ll,ll>
#define endl "\n"
#define m_p make_pair
#define all(x) x.begin(),x.end()
#define ld long double
using namespace std;
typedef long long ll;
const ll MAXN = 1123456;
template <typename T>
T sqr(T x){
return x ... | ALGO | 0.999937 | 3.012172 | {
"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": "d0a17fbb61ba... |
8db28f48-1665-421d-8f90-759f351cd70b | Joshoccas/DGIIM | Segundo/Primer Cuatrimestre/Estructura de Datos/Códigos/Árboles/4.2. Arboles/ArbolBinario/ArbolBinario/ArbolBinario.hpp | /**
* @file ArbolBinario.h
* @brief Fichero cabecera del TDA Arbol Binario
*
*/
#ifndef ArbolBinario_hpp
#define ArbolBinario_hpp
#include <iostream>
#include <cassert>
using namespace std;
/**
@brief T.D.A. ArbolBinario
Una instancia @e a del tipo de dato abstracto ArbolBinario sobre un
dominio Tbase se pued... | ALGO | 0.992935 | 4.778714 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2022-03-17T09:47:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 48,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "167ed33aea... |
3c6540e1-6701-4a63-a442-e24c1fb5638d | Aster1912/practices | c++/.cpp/60. Ejercicio 3.cpp | //3. Realizar un programa que lea un arreglo de estructuras los datos de N empleados de la empresa y que iprima los datos del empleado con mayor y menor salario
#include<iostream>
#include<conio.h>
using namespace std;
struct Empleado{
char nombre[20];
float salario;
}emp[100];
int main(){
int n_empleados, posM ... | ALGO | 0.942628 | 3.473955 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2022-11-04T02:28: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": "45834653dc4... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.