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 |
|---|---|---|---|---|---|---|---|
d7114117-d9ca-4946-860b-6323c635bea7 | Ahmad-AlDeeb/Problem-Solving | Library/Prime & Factorization.cpp | vll P; vector<bool> Prime(N,true);
void sieve() { // (1e7 < 1s) <-- O(n loglogn)
Prime[0]= Prime[1]=false;
for(ll i{2}; i<N; ++i) if(Prime[i]) {
for(ll composite{i+i}; composite<N; composite+=i)
Prime[composite]=false;
P.pb(i);
}
}
// 49 (N=11) (SZ=4)
// 10201 (N... | ALGO | 0.99991 | 4.300718 | {
"github_metadata": {
"branch": "main",
"commit_count": 1500,
"repo_created_at": "2023-01-11T08:37:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af4fc600d... |
a6da539f-239c-458c-b2ab-1916c8a860da | DanielAraldiEDU/c-plus-plus | 22-08-2023/exercise-one/main.cpp |
#include <iostream>
using namespace std;
#define LENGTH 1000
template<typename T>
struct Stack {
T array[LENGTH];
int topLevel;
};
template<typename T>
void initialize(Stack<T> &stack) {
stack.topLevel = -1;
}
template<typename T>
bool pop(Stack<T> &stack, T &value) {
if (stack.topLevel < 0) re... | ALGO | 0.99884 | 4.908729 | {
"github_metadata": {
"branch": "main",
"commit_count": 213,
"repo_created_at": "2022-03-10T23:53:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e50dc6c7b5... |
5d4e7453-b2dd-4a01-bc48-f10de29e7ba3 | algorithm-hell/problems | week02/118669_1jeongg.cpp | #include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> mountain[50001];
int dist[50001];
vector<int> solution(int n, vector<vector<int>> paths, vector<int> gates, vector<int> summits) {
vector<int> answer;
int diff[50001] = {0, };
for (auto g: gates) diff[g] = 1;
for (auto s: summits) di... | ALGO | 0.999961 | 4.138691 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2023-09-04T14:21:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 1,
"pull_requests": 2
},
"file_meta": {
"content_id": "a08f6110a36e... |
e611b2c3-3663-42d7-a466-0f3b3a26b998 | gfg-course/dsa-hyd-1 | class-6/groupAnagrams.cpp | #include <bits/stdc++.h>
using namespace std;
string getHashKey(string &s) {
vector<int> freq(26, 0);
for (int i = 0; i < s.length(); i++) {
freq[s[i] - 'a']++;
}
string hashKey = "";
for (int i = 0; i < 26; i++) {
hashKey.append(to_string(freq[i]));
hashKey.append("#");
... | ALGO | 0.999994 | 5.397464 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2025-02-02T05:00:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc7b963fcfb... |
be37322a-1e4b-4f5f-a665-467100ec1655 | igaspard/LeetCode | 337_HouseRobberIII.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.999983 | 6.238497 | {
"github_metadata": {
"branch": "master",
"commit_count": 174,
"repo_created_at": "2017-11-19T17:18: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": "3ea8bea4... |
6056de42-1ea2-48ee-bce6-948e71043159 | LambdaRan/online-programming | nowcoder/swordOffer/prob27.cpp |
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <unordered_set>
using namespace std;
/*
* Name: 字符串的排列
* Description: 输入一个字符串,按字典序打印出该字符串中字符的所有排列。
* 例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc,acb,bac,bca,cab和cba。
* 输入描述:
* 输入一个字符串,长度不超过9(可能有字符重复),字符只包括大小写字母。
*/
cla... | ALGO | 0.999921 | 5.140763 | {
"github_metadata": {
"branch": "master",
"commit_count": 218,
"repo_created_at": "2018-01-18T13:17: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": "73a744d4... |
d0bd1a06-2c98-482e-a0bf-00d726fb9bb1 | amov-lab/Prometheus | Modules/ego_planner_swarm/path_searching/src/dyn_a_star.cpp | #include "path_searching/dyn_a_star.h"
using namespace std;
using namespace Eigen;
AStar::~AStar()
{
for (int i = 0; i < POOL_SIZE_(0); i++)
for (int j = 0; j < POOL_SIZE_(1); j++)
for (int k = 0; k < POOL_SIZE_(2); k++)
delete GridNodeMap_[i][j][k];
}
void AStar::initGridMap(... | ALGO | 0.999693 | 3.994965 | {
"github_metadata": {
"branch": "main",
"commit_count": 1572,
"repo_created_at": "2019-12-03T06:28:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2835,
"forks": 441,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "2ad47... |
8d4cca04-8d6a-4f8b-80fe-be4139e13d6a | ZYLZhuPP/OI | YYOJ/2663.cpp | #include<bits/stdc++.h>
using namespace std;
#define rFor(i, r, l) for (int i = (r); i >= (l); --i)
#define For(i, l, r) for (int i = (l); i <= (r); ++i)
const int N = 205, M = 2e4 + 5;
struct IO {
char c; int f;
#define gc() getchar()
template<class C>
inline IO& operator >> (C &x) {
x = 0; f = 1... | ALGO | 0.999995 | 3.512058 | {
"github_metadata": {
"branch": "ZYLZPP",
"commit_count": 115,
"repo_created_at": "2024-09-18T03:26:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "87788aed... |
df0aa0c3-b194-4c1a-b7e0-8cabd4f22441 | trilinos/Trilinos | packages/ml/examples/BasicExamples/ml_scalingtest.cpp | /* ******************************************************************** */
/* See the file COPYRIGHT for a complete copyright notice, contact */
/* person and disclaimer. */
/* ******************************************************************** */
//@HEADER
// Goal o... | TOOL | 0.951773 | 5.507373 | {
"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":... |
a444dc54-f8a6-4a80-8f6f-7f4f7d576303 | PaLy/Contest | src/codejam/s2013/round2/A.cpp | #include <cstdio>
#include <iostream>
#include <sstream>
#include <cstring>
#include <climits>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <ctime>
using namespace std;
#define FOR(i,n1,n2) for(in... | ALGO | 0.999243 | 3.221161 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2021-04-16T22:00: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": "3ee4fa0bc7e... |
8fa77d4a-6d61-4bce-81d3-3f6f91c4a387 | samsonovak8/ICT-1-semester-HW-5 | task_m/main2.cpp | #include <iostream>
#include <vector>
#include <string>
int find_difference(std::string s1, std::string s2) {
int n = s1.length();
int m = s2.length();
std::vector<std::vector<int> > diff(n + 1, std::vector<int> (m + 1, 0));
for(int i = 0; i <= n; ++i) {
for(int j = 0; j <= m; ++j) {
... | ALGO | 0.999966 | 4.636077 | {
"github_metadata": {
"branch": "main",
"commit_count": 98,
"repo_created_at": "2022-09-04T09:22: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": "eccdddb36e7... |
d82bb425-2daa-4efa-b04b-bbb367567838 | xcdot/Out-of-Order-CPU | procsim.cpp | #include <stdbool.h>
#include <stddef.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
#include <deque>
#include <vector>
#include <algorithm>
#include <set>
#include <inttypes.h>
#include "procsim.hpp"
using namespace std;
//
// TODO: Define any useful data structures and functions ... | ALGO | 0.952824 | 5.512505 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-28T19:20: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": "dfcc74242eca... |
87154ef7-1869-4fc3-a06e-6e71b4438652 | jigyansunanda/Leetcode-Practice | 1642-furthest-building-you-can-reach/1642-furthest-building-you-can-reach.cpp | class Solution {
public:
int furthestBuilding(vector<int>& heights, int bricks, int ladders) {
int n = heights.size();
vector<int> diff;
for (int i = 1; i <= n - 1; ++i) diff.push_back(max(0, heights[i] - heights[i - 1]));
int lo = 0, hi = n;
while (hi > lo + 1) {
... | ALGO | 0.999974 | 5.923888 | {
"github_metadata": {
"branch": "main",
"commit_count": 1805,
"repo_created_at": "2022-08-08T12:05:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97ae38880... |
6b82a972-0e99-4065-b121-73d72f46ab46 | cduckling/Competitive-Programming | Codeforces/learningpaint.cpp | #include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
using namespace std;
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2,fma,tune=native")
#define tc ll t; c... | ALGO | 0.999916 | 3.700077 | {
"github_metadata": {
"branch": "main",
"commit_count": 180,
"repo_created_at": "2024-09-28T16:31: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": "6db172de42... |
5dd6c58d-e890-48ee-bc18-414cd795e7c1 | darmawansaputra/PraktikumPemrograman | Tugas 9/2.cpp | #include<iostream>
#include<iomanip> //Library tambahan untuk menggunakan fungsi setw()
using namespace std;
//Fungsi untuk membentuk array
int** getArrayElement() {
//Membuat array 2 dimensi
int** arr = new int*[10];
for(int i = 0; i < 10; i++) {
arr[i] = new int[10];
for(int j = 0; j < 10; j++) {
... | ALGO | 0.995093 | 5.022482 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-11-15T03:14: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": "74e84f453f... |
535554eb-5118-4938-acfb-e11a2fc3e7f6 | m4oughi/100DaysofCode | pureCPP/0020. Day 20/Virtual Functions/014. Performance Considerations/007. Virtual Function Calls in Tight Loops/main.cpp | #include <iostream>
#include <chrono>
using namespace std;
class Base {
public:
virtual void process() {
// Simulate some heavy computation
}
};
class Derived : public Base {
public:
void process() override {
// Simulate some heavy computation
}
};
int main() {
const int N = 10000... | TOOL | 0.916765 | 6.768549 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2024-08-31T09:18:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ce8fbaade7... |
238cc213-83d9-4636-870b-cf37be34f99d | iliyian/CompetitiveProgramming | luogu.com.cn/CF1545/A.cpp | // date: 2024-03-29 16:58:20
// tag: 模拟,构造,排序
// AC
#include <bits/stdc++.h>
#define int long long
#define N 100005
using namespace std;
void solve() {
int n;
cin >> n;
vector<int> a(n + 1);
vector<array<int, 2>> cnt(N);
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
vector<int> b = a;
sort(b.begin... | ALGO | 0.999987 | 4.595153 | {
"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": "24d52766d9... |
991e4611-04c2-4361-a52f-cee8c3cfde91 | MaxKev1n/NEMU | src/profiling/ppm.cpp | #include <profiling/ppm.h>
#include <cassert>
#include <cmath>
#include <debug.h>
namespace PPMNS {
using boost::dynamic_bitset;
PPM::PPM(){
for (unsigned len = 0; len <= histLen; len++) {
masks.push_back(dynamic_bitset<>(histLen, (1 << len) - 1));
}
}
void PPM::update(uint64_t pc, dynamic_bitset<>... | ALGO | 0.988862 | 4.328815 | {
"github_metadata": {
"branch": "tracing_strides",
"commit_count": 1541,
"repo_created_at": "2022-05-27T14:43: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":... |
23289d4b-9c46-4c29-9cd7-6e04d8c80a6a | polyester-CTRL/procon-archive | atcoder.jp/intro-heuristics/intro_heuristics_c/Main.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
int main() {
int d;
cin >> d;
int c[26];
for(int i =... | ALGO | 0.999641 | 3.683433 | {
"github_metadata": {
"branch": "master",
"commit_count": 566,
"repo_created_at": "2020-09-04T07:46: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": "1430ea3d... |
166c3aa5-0418-4f0c-abf6-e76027e7e571 | ilyesbelahsen/AnalyseImage | V22/tracking.cpp | #include <opencv2/opencv.hpp>
#include <iostream>
#include "../V16_17_18/histogram.h"
#include "integral.h"
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
int main(){
cv::Mat image = cv::imread("bike55.bmp");
int xo = 97, yo = 112;
int width = 25, height = ... | ALGO | 0.994558 | 4.173007 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2024-12-17T11:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23e870d3a... |
6ba4b5e2-d2bd-4c59-842b-f7ea0ed25539 | jinwuui/algorithm | leetcode/576.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
class Solution {
public:
int dr[4] = {1, 0, -1, 0};
int dc[4] = {0, 1 , 0, -1};
int mod = 1000000000 + 7;
int findPaths(int m, int n, int maxM, int r, int c) {
vector<vector<int>> dp(m, vector<int>(n));
... | ALGO | 0.999905 | 4.488354 | {
"github_metadata": {
"branch": "main",
"commit_count": 100,
"repo_created_at": "2022-01-10T02:33:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8fd834655e... |
61f8484c-d2b2-494e-99b9-c8883482e5cd | yashyc7/GFG-Question-Solving-Series | Basic/Find minimum and maximum element in an array/find-minimum-and-maximum-element-in-an-array.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
#define ll long long
pair<long long, long long> getMinMax(long long a[], int n) ;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
ll a[n];
for (int i = 0; i < n; i++) cin >> a[i];
pai... | ALGO | 0.999311 | 5.052963 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2023-03-06T03:30: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": "8ff678cca8f... |
e7043c9c-2f89-49a3-981c-3b69cf1c3020 | Jialin/ICPC | Template/math/prime/miller_rabin64.h | #pragma once
#include "math/mod/exp.h"
#include "math/mod/fix.h"
using namespace std;
namespace math {
namespace {
inline bool checkComposite64(uint64_t n, uint64_t a, uint64_t d, int s) {
uint64_t x = expMod<uint64_t, uint64_t, __uint128_t>(fixMod(a, n), d, n);
if (x == 1 || x == n - 1) {
return false;
... | ALGO | 0.998328 | 6.595996 | {
"github_metadata": {
"branch": "master",
"commit_count": 886,
"repo_created_at": "2019-03-04T23:30:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb306d4e... |
e9c6c646-c55a-4940-a70c-cbe3d2307dfd | filipecn/ponos | poseidon/tests/pressure.cpp | #include <poseidon.h>
#include <ponos.h>
#include "solver.h"
poseidon::ConjugateGradient ps;
Solver s;
int width = 5, height = 5;
int ij(int i, int j) {return i*width + j;}
void solveCG() {
ps.solve();
DUMP_VECTOR(ps.p);
}
int main() {
ps.set(width, height);
s.set(width * height);
ps.reset();
for (int ... | ALGO | 0.999088 | 3.101832 | {
"github_metadata": {
"branch": "master",
"commit_count": 377,
"repo_created_at": "2016-04-26T23:00:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 12,
"pull_requests": 0
},
"file_meta": {
"content_id": "017b4c2... |
43b2e168-6645-482c-8c24-33be86898014 | M45UDrana/DS-Algo-Problem-Solving | codeforces/118B.cpp | #include <bits/stdc++.h>
using namespace std;
#define dcoutsssssssssss(a, b, c) cout << a << " " << b << " " << c << '\n'
#define IO ios_base::sync_with_stdio(false); cin.tie(NULL),cout.tie(NULL);
int main()
{
int n;
cin >> n;
for(int i = 0, k = 2, m; i < (2*n+1); i++)
{
if(n < i) { m = i - ... | ALGO | 0.999983 | 3.073776 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2021-06-08T17:09: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": "f9ce9d1c35c... |
b5b656bc-0aab-463d-8d4e-a7852d323ad9 | ningning772669569/algorithm | 11_1/b.cpp | #include "cstdio"
#include "cstring"
#include "iostream"
#include "algorithm"
#include "vector"
#include "queue"
#include "set"
#include "map"
using namespace std;
const int maxn=109;
int N,M;
int vis[maxn];
vector<int> G[maxn];
vector<int> point;
struct CUT_V
{
static const int maxn=10000+10;
int dfs_clock,low[maxn],n... | ALGO | 0.999955 | 4.236557 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-04-04T12:54:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4040651816... |
44dea854-9e83-4783-a499-e3f1b9984075 | luzhiled1333/comp-library | src/math/modular-arithmetic/modular-combinatorics.hpp | #pragma once
#include "src/cpp-template/header/rep.hpp"
#include "src/cpp-template/header/size-alias.hpp"
#include <vector>
namespace luz {
template < typename mint >
class Combinatorics {
static usize bound;
static std::vector< mint > fact, finv, inv;
static void expand(usize n) {
n += 1;
... | ALGO | 0.988638 | 6.197921 | {
"github_metadata": {
"branch": "main",
"commit_count": 254,
"repo_created_at": "2022-06-12T13:08:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 90,
"pull_requests": 2
},
"file_meta": {
"content_id": "ebc8e46036... |
eed05919-26e6-4544-a495-24875ba7ce76 | RomantsovS/Sadgewick | 05_Recursion_and_trees/5.08_Graph_traversal/examples/ex_5_21.cpp | #include <List.h>
#include <iostream>
#include <vector>
using namespace std;
const size_t V = 10;
void print(vector<link<int>>& adv, int i) {
auto t = adv[i];
while(t) {
cout << t->item << "->";
t = t->next;
}
cout << endl;
}
template <typename F>
void depth_first_search(vector<li... | ALGO | 0.999854 | 4.580131 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2019-04-06T05:43: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": "f310c77a6... |
5aa7b3f0-a5f8-4f19-bea8-0d6232d7cb2b | Ayush-523/C- | norm.cpp | #include <iostream>
using namespace std;
#define ROW 10
#define COL 10
int main()
{
int array[ROW][COL], norm[COL] = {0};
int i, j, row, col, max;
cout<<"Enter the number of rows:";
cin>>row;
cout<<"Enter the number of columns:";
cin>>col;
cout<<"Enter the entries... | ALGO | 0.999584 | 3.310367 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-02-20T08:40: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": "dc5ce13db175... |
41fc58b7-1490-4780-ad5b-b7a7bfd4aeac | henrytsui000/online-judge | trying_code/1A1B.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<ld, ld>;
#define IOS \
ios_base::sync_with_stdio(0); \
cin.tie(0)
#defi... | ALGO | 0.998898 | 3.059374 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2019-12-10T01:10:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "002cc289... |
7be5b9ee-810b-4738-ab04-ccc8d0a9b261 | AK18ert/TaMP_Lab_4 | Laba3-1/modAlphaCipher.h | /** @brief Шифрование методом Гронсфельда
* @details Ключ устанавливается в конструкторе.
* Для зашифровывания и расшифровывания предназначены методы encrypt и decrypt.
* @warning Реализация только для русского языка
*/
#pragma once
#include <locale>
#include <map>
#include <string>
#include <vector>
#include <iostream... | ALGO | 0.988841 | 4.543035 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-12-17T08:06:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8108597a7aa... |
02e0520d-de44-46d4-877f-0c4aae05c46e | rezwan4029/UVA-CODES | 10176 - Ocean Deep ! - Make it shallow !!.cpp | #include <bits/stdc++.h>
#define pb push_back
#define INF 1<<29
#define all(x) x.begin(),x.end()
#define ms(a,v) memset(a,v,sizeof a)
#define II ({int a; scanf("%d", &a); a;})
#define LL ({ll a; scanf("%lld", &a); a;})
#define EPS 1e-10
#define pi acos(0.0)
using namespace std;
typedef vector<int> vi;
typedef long lo... | ALGO | 0.999842 | 3.301612 | {
"github_metadata": {
"branch": "master",
"commit_count": 606,
"repo_created_at": "2012-10-24T09:51:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 32,
"forks": 22,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf8920... |
e1acb1f4-dbb1-474a-b54c-ea8d276fa2a1 | Arsegg/programming-languages-1 | HOMEWORK-2/main.cpp | #include <ctime>
#include <iostream>
#include <random>
#include "Game.h"
#include "Util.h"
using namespace std;
int main() {
srand(time(0));
int n;
cout << "Enter count of alive cells: ";
cin >> n;
bool isRandom;
cout << "Enter 1 for random initial position, 0 for custom initial position: "... | ALGO | 0.999575 | 5.404172 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2015-02-22T20:36:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "051baa4ce... |
09bf65be-3ee9-4bd7-b337-488ef19a8a73 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/09/0914/personal_submission/cf1065e_Bonelight.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
#define ll long long
#define pii pair<int, int>
void solve()
{
int mo = 998244353;
int n,m,k; cin >> n >> m >> k;
auto M = [&](int x){
return (x % mo + mo) % mo;
};
auto mypow = [&](int x, int y){
... | ALGO | 0.999985 | 5.018797 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "6747... |
0f5e0550-bd48-4e42-ab70-1c55193fbe0d | BenoGustavo/learning_C | C_projects/Lista 2/Calculadora de dias sem acidentes.cpp | /*11. Uma fábrica controla o tempo de trabalho sem acidentes pela quantidade de dias. Faça um
algoritmo para converter este tempo em anos, meses e dias. Assume que cada mês possui
sempre 30 dias.*/
#include<cmath>
#include<conio.h>
#include<stdio.h>
#include<iostream>
#include<math.h>
int DiasSemAcidentes,anos,meses,... | ALGO | 0.983545 | 3.167371 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-05-13T23:46: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": "c2de3af808e... |
a4813295-f706-4cfc-89e9-3b764d9ba10c | AndreMartins21/PDS2 | VPL4/list.cpp | #include <iostream>
#include "list.hpp"
void List::insertNode(int data) {
Node* aux = new Node;
aux->data = data;
aux->next = nullptr;
if (head == nullptr) {
head = aux;
tail = aux;
} else {
tail->next = aux;
tail = aux;
}
}
void List::display() {
Node *aux = head;
while (aux != nullpt... | ALGO | 0.993354 | 5.530625 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-07-12T01:23: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": "84ee9cef1406... |
3f36bbbb-77ee-4060-8f5c-048305873509 | pdrsa/maratona | codeforces/733/d.cpp | //JP - Not in Kansas Anymore
#include <bits/stdc++.h>
using namespace std;
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define f first
#define s second
#define pb push_back
typedef long long ll;
typedef pair<int, int> ii;
typedef pair<ll,ll> iill;
const int INF = 0x3f3f3f3f;
const ll LINF =... | ALGO | 0.999981 | 3.678963 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2020-05-06T13:38:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f7d801ff... |
3f392d03-db1b-4bb4-b560-8473cd642d00 | Samsung/ONE | compiler/nnc/passes/optimizations/CombineTransposes.cpp | /*
* Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless... | ALGO | 0.945855 | 7.536406 | {
"github_metadata": {
"branch": "master",
"commit_count": 11402,
"repo_created_at": "2020-04-16T09:33:50.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 497,
"forks": 164,
"issues": 354,
"pull_requests": 72
},
"file_meta": {
"content_id": "... |
8fb04051-4850-4520-9425-b74523eafffc | HXhlx/LeetCode | Problems/355_DesignTwitter.cpp | #include <bits/extc++.h>
#include "gtest/gtest.h"
using namespace std;
struct User
{
unordered_set<wint_t> fi;
map<wint_t, wint_t> ti;
};
class Twitter
{
array<User, 501> users{};
wint_t Time = 0;
public:
Twitter() = default;
void postTweet(int userId, int tweetId)
{
users[userI... | ALGO | 0.997327 | 6.063043 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2021-12-28T12:06: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": "76fd843ef... |
26136ad4-016a-42ec-8b27-cf64364ba55c | yu2924/BodeAnalyzer | Source/SimpleConv.h | //
// SimpleConv.h
// generic implementation
//
// created by yu2924 on 2023-02-25
//
#pragma once
#include <vector>
#include "SimpleFFT.h"
template<typename T> class SimpleConvT
{
public:
static void vclear(T* pd, size_t l)
{
for(size_t i = 0; i < l; ++i) pd[i] = 0;
}
static void vcopy(const T* ps, T* pd, ... | ALGO | 0.99935 | 6.964618 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-02-12T06:56:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a354b541bb... |
0a4be7d0-4b7f-4307-bf6b-3cdf5ed07e35 | barulicm/CPPGraphSearch | examples/11x11grid/PrintFunctions.hpp | #ifndef GRAPHSEARCH_PRINTFUNCTIONS_HPP
#define GRAPHSEARCH_PRINTFUNCTIONS_HPP
void print_map(const int map[11][11], const Location &start, const Location &goal) {
for(int x = 0; x < 11; x++)
{
for(int y = 0; y < 11; y++)
{
if(x == start.x && y == start.y)
{
std::cout << "S" << " ";
... | TOOL | 0.902851 | 5.814358 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2013-01-07T04:00:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a08dc2f2... |
9dbca3c7-ef61-4218-a150-ef0ae7f0a36a | cbarbes1/COSC-320 | Homework3/Program1/IntBinaryTree.cpp | /*
* Edited by: <NAME> on 09/20/2023
* This code is example code that was edited to perform a sort using a tree
*/
// Implementation file for the IntBinaryTree class
#include <iostream>
#include "IntBinaryTree.h"
using namespace std;
//***************************************************
// destroySubTree is calle... | ALGO | 0.999938 | 4.573374 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2023-08-30T13:21: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": "2c0db74ecad... |
ad7c0848-23a7-4281-b0a2-ea5da9d1ce78 | spartan289/Practical | quicksort.cpp | #include <bits/stdc++.h>
using namespace std;
int partitions(int A[], int l, int h)
{
int pivot = A[l];
int i = l, j = h;
while (i < j)
{
do
{
i++;
} while (pivot > A[i]);
do
{
j--;
} while (pivot < A[j]);
if (i < j)
... | ALGO | 0.999934 | 4.734502 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2022-04-30T01:22: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": "371672881b... |
5a10c4ef-b32d-4323-be6f-e38d90a357e0 | piyush1146115/Competitive-Programming | Uva Oj/12662..good teacher.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
//freopen("input.txt","r",stdin);
char s[105][6];
int n, q, i, j, k, pos, l_len, r_len;
cin >> n;
for(i = 0; i < n; i++)
scanf("%s",s[i]);
scanf("%d", &q);
for(i = 1; i <= q; i++){
scanf("%d", &pos);
if(str... | ALGO | 0.999977 | 3.092448 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2019-09-30T18:09:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d697bde35... |
609543c6-2313-4925-a2bc-56ca723892e5 | anboto/STEM4U | STEM4U/Rootfinding.h | #ifndef _STEM4U_Rootfinding_h_
#define _STEM4U_Rootfinding_h_
#include <STEM4U/Utility.h>
namespace Upp {
template <typename T>
static bool IsBracketed(T yfrom, T yto) {
return !(yfrom*yto >= 0.0);
}
template <typename T>
T Bisection(Function <T(T)> f, const T from, const T to, const T toly, const int maxIt = ... | ALGO | 0.999725 | 5.359679 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2022-07-22T13:54:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e9898a6c956f... |
c20dd522-aace-45c4-a90f-80c073f9b2b1 | ZettaScaleLabs/zenoh-ishapes | getargs.hxx | //
// Copyright (c) 2023 ZettaScale Technology
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License 2.0 which is available at
// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
// which is available at https://www.apache.org/licen... | TOOL | 0.968626 | 7.519893 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-01-07T16:38:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "891a3ddea6444... |
4065e3a6-5b87-47d4-ad9d-5f2d05c7be09 | peterhuang88/pyotrflow | parallel_exp2/MatrixCalculator.cpp | #include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <pthread.h>
#include "MatrixCalculator.h"
MatrixCalculator::MatrixCalculator() {
this->res = NULL;
}
// MatrixCalculator::MatrixCalculator() {
// int numThreads = 4;
// this->numTh... | TOOL | 0.996079 | 4.399688 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2020-03-22T22:35:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fee17a22c... |
bc43eb54-c328-4a5d-b61b-8e89412f1e8f | xlgames-inc/XLE | Foreign/cml-1_0_2/cml/vector/vector_products.h | /* -*- C++ -*- ------------------------------------------------------------
Copyright (c) 2007 <NAME> and <NAME> http://cmldev.net/
The Configurable Math Library (CML) is distributed under the terms of the
Boost Software License, v1.0 (see cml/LICENSE for details).
*------------------------------------------------... | ALGO | 0.943745 | 7.21403 | {
"github_metadata": {
"branch": "master",
"commit_count": 6572,
"repo_created_at": "2015-01-15T05:07:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 339,
"forks": 73,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b8f4... |
3fdbf752-bcd7-4aa2-bb22-63556c82c6e5 | chaitanyaram1204/GFG_Problems | Count Smaller elements.cpp | class Solution
{
public:
void merge(vector<int> &ans, vector<pair<int, int>> &nums, int left, int mid, int right)
{
vector<pair<int, int>> temp(right - left + 1);
int i = left, j = mid + 1;
int k = 0;
while (i <= mid && j <= right)
{
if (nums[i].first <= num... | ALGO | 0.999997 | 5.607605 | {
"github_metadata": {
"branch": "main",
"commit_count": 287,
"repo_created_at": "2024-01-28T09:33: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": "3d1ed730b2... |
cc789307-e9af-4ab3-85b9-47a8bd9b527b | hagmanen/aoc2023 | day5.cpp | #include "aoc.h"
#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <numeric>
std::vector<uint64_t> parseSeeds(const std::string& line) {
return aoc::int64vec(aoc::split(aoc::split(line, ": ")[1], " "));
}
struct RangeMap {
uint64_t dest;
uint64_t src;
uint64_t r... | ALGO | 0.999279 | 6.03541 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2023-12-02T14:56: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": "6a0407a2b... |
dd0f2a51-90dd-47af-b36e-007052819216 | Yawn-Sean/Daily_CF_Problems | daily_problems/2025/05/0527/personal_submission/cf73c_hum.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
string s;
int k, n;
cin >> s >> k >> n;
vector c(26, vector(26, 0));
for (int i = 0; i < n; i++) {
char u, v;
int x;... | ALGO | 0.999871 | 4.375659 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "7e6a... |
11580fe3-7855-4711-b29c-9b393ffd12fa | aanu2021/Leetcode-Solutions | Detect cycle in a directed graph - GFG/detect-cycle-in-a-directed-graph.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Function to detect cycle in a directed graph.
bool isCycle(int u,vector<int>adj[],vector<int>&vis,vector<int>&cvis){
vis[u] = 1;
cvis[u] = 1;
for(int v:adj[u]){
... | ALGO | 0.999741 | 6.331009 | {
"github_metadata": {
"branch": "main",
"commit_count": 8709,
"repo_created_at": "2022-05-12T19:00:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f329c270f... |
1ff9ba2a-5477-4035-b337-a3045fe39491 | Abhishek-Mallick/LeetCode | 2217-step-by-step-directions-from-a-binary-tree-node-to-another/step-by-step-directions-from-a-binary-tree-node-to-another.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.999998 | 6.391132 | {
"github_metadata": {
"branch": "main",
"commit_count": 1119,
"repo_created_at": "2022-05-27T18:58:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "07d33cfb0... |
8b5ec338-b32f-4505-921a-e96ca2c516c1 | ialhashim/topo-blend | TopoBlenderLib/kmeans.h | /* KMeansRexCore.cpp
A fast, easy-to-read implementation of the K-Means clustering algorithm.
allowing customized initialization (random samples or plus plus)
and vectorized execution via the Eigen matrix template library.
Intended to be compiled as a shared library libkmeansrex.so
which can then be utilized from... | ALGO | 0.999832 | 4.213188 | {
"github_metadata": {
"branch": "master",
"commit_count": 470,
"repo_created_at": "2015-03-13T03:22:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 27,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "76e22c7... |
3746a2b6-369c-4b37-aa31-0ecf6bbc2e38 | Santanujana2001/My-Leetcode-Solutions | Find all possible paths from top to bottom - GFG/find-all-possible-paths-from-top-to-bottom.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:
void helper(int n,int m, int i,int j,vector<vector<int>>&ans,vector<int>v,vector<vector<int>> &grid){
if(i>=n or j>=m){
... | ALGO | 0.99988 | 6.371826 | {
"github_metadata": {
"branch": "main",
"commit_count": 1240,
"repo_created_at": "2022-04-28T18:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7652e1923... |
0e5cc57b-e886-4951-b62f-4aa37e29989c | ishandutta2007/codeforces-m | mhq/normal/846/D.cpp | #include <bits/stdc++.h>
using namespace std;
struct cell {
int x;
int y;
int t;
};
int n,m,q,k;
int f[600][600];
cell l[500*500 + 10];
bool cmp ( cell a, cell b) {
return ( a.t < b.t );
}
bool ans ( int t ) {
for ( int i = 0; i <= n; i++) {
for ( int j = 0; j <= m; j++) {
f[... | ALGO | 0.99995 | 3.755645 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0dfcf81e198e... |
dba8dd69-6d3e-4ce6-add5-48135d78f557 | zhgn/whiteboard-code | leetcode/leetcode/Reverse_Linked_List_II.cpp | /*
Reverse a linked list from position m to n. Do it in-place and in one-pass.
For example:
Given 1->2->3->4->5->NULL, m = 2 and n = 4,
return 1->4->3->2->5->NULL.
Note:
Given m, n satisfy the following condition:
1 ¡Ü m ¡Ü n ¡Ü length of list.
*/
#include "stdafx.h"
#include <algorithm>
struct ListNode {
... | ALGO | 0.999989 | 5.651517 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2013-12-03T15:54:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f46f1a898... |
6958e481-2f16-421c-b4aa-2a0262207b2f | Sarmouts/fraction-simplification | fraction simplification/fraction simplification.cpp |
#include <iostream>
#include <cmath>
#include <string>
using namespace std;
//int CountDecimal(double num, double den)
//{
// string numer = to_string(num);
// string denon = to_string(den);
// int nonDecimalPartLength1;
// int nonDecimalPartLength2;
// int result1;
// int result2;
// for (int i = 0; i < numer.lengt... | ALGO | 0.996412 | 5.577958 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2021-09-03T18:59:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2ec710b1c... |
8a65236d-9718-4274-a09a-68cf5a42ee71 | Amoo-Srwsh/Practice | Project/AirportControlTower/src.cpp | // in the name of Allah
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "algo/debug.h"
#else
#define debug(...) 42
#endif
map<string, int> status;
map<int, string> band;
inline bool display_status (string B, int c, int y) {
int res = status[B];
if (res > 1) {
if (res == 2) {
cout << ... | ALGO | 0.981481 | 3.673423 | {
"github_metadata": {
"branch": "main",
"commit_count": 91,
"repo_created_at": "2022-03-31T14:38:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "204c350ab35... |
bdf21d61-f479-4ca5-908b-d7e53442f370 | dreamisdream/Leet_code | 无重复字符的最长子串.cpp | int lengthOfLongestSubstring(char * s){
int start = 0, end = 0, maxlen = 0;
char map[256] = {0};
map[(int)*(s+start)] = 1;
while( *(s+end) != 0 )
{
maxlen = maxlen>(end-start+1)?maxlen:(end-start+1);
++end;
while( 0 != map[ (int)*(s+end) ] )//将要加入的新元素与map内元素冲突
{
... | ALGO | 0.999717 | 3.691132 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2019-07-03T12:30: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": "5926433ff... |
56dd4c8b-eaa1-4fba-b657-d5ce52d54ecf | wqrqwerqrw/acm_code | contest/20-02-04/f.cpp | // Wqr_
// Time : 20/02/04
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
signed main(){
#ifdef Wqr_
freopen("in.txt","r",stdin);
#endif
std::ios::sync_with_stdio(false),cin.tie(0);
int T; cin >> T;
while(T--){
int n;
cin >> n;
vector<int> w(n);
bool flag = 0;
for(int i ... | ALGO | 0.998684 | 3.622735 | {
"github_metadata": {
"branch": "master",
"commit_count": 109,
"repo_created_at": "2019-03-28T10:09:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e71de96d... |
bdc84458-dae2-47c6-852e-46d2c25d8cbc | Jerling/leetcode | Chapter03/code/3.6.hpp | #include <iostream>
#include <algorithm>
#include <string>
#include <unordered_map>
#include <ctype.h>
#include <cmath>
#include <limits.h>
// Add Binary
// 时间复杂度O(n),空间复杂度O(1)
class MySolution {
public:
bool isMatch(const std::string &str, const std::string &expr){
int lenexpr = expr.length();
int... | ALGO | 0.998614 | 4.561083 | {
"github_metadata": {
"branch": "master",
"commit_count": 148,
"repo_created_at": "2018-08-06T12:46:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4082d61e... |
4e2e618b-fba4-4092-8630-fb2ea9c09638 | AKhats21/hw4 | avlbst.h | #ifndef AVLBST_H
#define AVLBST_H
#include <iostream>
#include <exception>
#include <cstdlib>
#include <cstdint>
#include <algorithm>
#include "bst.h"
using namespace std;
struct KeyError { };
/**
* A special kind of node for an AVL tree, which adds the balance as a data member, plus
* other additional helper funct... | ALGO | 0.975332 | 6.693908 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-04-01T22:04: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": "11156a401d67... |
19087b62-35e2-437a-8e3c-fe83198bbe3e | hulong138/java-leetcode | cpp/Word_Break_II.cpp | class Solution {
public:
vector<string> wordBreak(string s, unordered_set<string> &dict) {
string result;
vector<string> solutions;
int len = s.size();
vector<bool> possible(len + 1, true);
GetAllSolution(0, s, dict, len, result, solutions, possible);
return solutio... | ALGO | 0.999518 | 5.357361 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-06-16T09:39: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": "09396d3d2a... |
200bf308-6a85-4fd2-bb48-849e12151265 | vasiliilantratov/Algorithms | Module_1/TechP_M1_Z6/TechP_M1_Z6.cpp | #include <iostream>
typedef int my_type;
const int SIZE_MAS = 8;
class My_Heap {
private:
size_t last;
size_t size;
my_type *array;
void siftDown(int);
void siftUp(int);
void increase();
void swapElem(my_type &first, my_type &second) {
my_type tmp = first;
first = second;
second = t... | ALGO | 0.999786 | 3.807741 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2015-04-11T09:51:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ec99df59... |
15c65cdc-461c-4908-aab8-196409bbc019 | isopropylcyanide/Competitive-Programming | code-cpp/maxMinXor.cpp | #include <bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define MAX 200005
void scanint(int &x){
register int c = gc();
x = 0;
for(;(c<48 || c>57);c = gc());
for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
}
int t, n, k;
int A[MAX];
struct node{
int data;
... | ALGO | 0.999895 | 3.585888 | {
"github_metadata": {
"branch": "master",
"commit_count": 179,
"repo_created_at": "2015-12-31T07:54:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8dc476... |
147ed908-5443-4a34-b504-7952a976c5e9 | wudong/rmoead | src/EvolutionaryAlgorithm.h | /*
* EvolutionaryAlgorithm.h
*
* Created on: 14 Jun 2010
* Author: wudong
*/
#ifndef EVOLUTIONARYALGORITHM_H_
#define EVOLUTIONARYALGORITHM_H_
#include "Chromosome.h"
#include "Function.h"
#include "RandomGenerator.h"
template<typename T>
class EvolutionaryAlgorithm {
protected:
int runid;
int fesCount... | ALGO | 0.999426 | 4.686693 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2010-06-08T09:30:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dfe2c8c7c... |
92a16740-2dcf-49b6-813b-2b68dda335b1 | zukun/rcc | shape_sharing/code_release/mex/ComputePHOGMex.cc | // matlab include
#include "mex.h"
#include "matrix.h"
#include <stdlib.h>
#include <functional>
#include <numeric>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;
void MakeROI(double* ori_mat, double* roi, vector<size_t>& ptr_inds, size_t n_ptr, size_t im_dim[2], size_t roi_dim[2], si... | ALGO | 0.998655 | 5.151531 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2013-02-21T15:10:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 16,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "56ab62a... |
3a50a729-55b6-45a4-87a8-e15bec5121bc | girishchhonkar19/Intuit-Top-15-Questions | Count the paths - GFG/count-the-paths.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
void DFS(vector<int>adj[],bool visited[],int s,int d,int &count)
{
visited[s]=true;
if(s==d)
{
count++;
}
for(auto i:adj[s])
{
... | ALGO | 0.999847 | 5.145017 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2022-01-24T07:17: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": "0b6390fe8ae... |
10767232-e98b-460d-a256-9d466a68ab57 | shakhub/Interview | Interview/graph.cpp | #include<iostream>
#include"graph.hpp"
#define __GRAPH
#define SIZE 6
//char vertex[8] = {'A','B','C','D','E','F','G','H'};
bool Graph::loop()
{
// Detects cycle in the given graph
// uses DFS and extra stack to keep track of
// the visited vetices
return false;
}
void Graph::dfs_util(int start,bool visited[... | ALGO | 0.989191 | 3.635562 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2015-06-03T15:56: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": "0e92b862c... |
94f47de7-7586-42bc-9f33-87af50d7ed57 | gromit-95/algorithm | 13주차-2번[Kruskal]/13-2(1).cpp | #include<stdio.h>
#include<stdlib.h>
//미완성
typedef struct Vertex
{
int name;
struct Vertex* next;
}Vertex;
typedef struct Edge
{
Vertex* v1, * v2;
int weight;
struct Edge* next;
}Edge;
typedef struct Graph
{
Vertex* vHead;
Edge* eHead;
}Graph;
typedef struct Sack
{
Vertex* vHead;
Edge* eHead;
}Sack;
void initS... | ALGO | 0.999978 | 4.090179 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2022-11-26T14:57: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": "82aab5562... |
672e6375-5882-4ced-ae76-e7b32ec6db1d | abhiXsliet/Solved-DSA-Problems | Leetcode Daily Challenge/018-December-2024/023-minimum-number-of-operations-to-sort-a-binary-tree-by-level.cpp | // https://leetcode.com/problems/minimum-number-of-operations-to-sort-a-binary-tree-by-level/
#include <bits/stdc++.h>
using namespace std;
// Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
Tree... | ALGO | 0.999993 | 6.213169 | {
"github_metadata": {
"branch": "main",
"commit_count": 2156,
"repo_created_at": "2023-07-29T13:17:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "321bed1f7... |
72c311a8-f8d5-4f89-adce-07d4acd25593 | 14062005Hust/Demo_Timduong | demo3_map.cpp | #include <winsock2.h>
#include <windows.h>
#include "cpp-httplib/httplib.h" // Include the httplib header
#include <iostream>
#include <vector>
#include <queue>
#include <climits>
#include <string>
using namespace std;
// Define the structure to store edge information
struct Edge {
int node;
int weight;
};
... | WEB | 0.999958 | 5.972502 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2024-12-02T14:37:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "623837990... |
b380b5ea-60f6-4dd5-8292-52e7f4c99676 | LindongLi/Leetcode | 128 Longest Consecutive Sequence/128 LL.cpp | #include <vector>
#include <iostream>
#include <unordered_map>
using namespace std;
/*
https://leetcode.com/problems/longest-consecutive-sequence/
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
For example,
Given [100, 4, 200, 1, 3, 2],
The longest consecutive elem... | ALGO | 0.999937 | 5.554666 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2015-05-11T08:11:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce4452c4f... |
47f8aa6e-5df9-4688-aeb8-2aeb2503c0d5 | openvinotoolkit/openvino | src/plugins/intel_gpu/thirdparty/xetla/include/common/utils/cm/fastmath.hpp | /*******************************************************************************
* Copyright (c) 2022-2023 Intel Corporation
*
* 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... | ALGO | 0.985702 | 6.629328 | {
"github_metadata": {
"branch": "master",
"commit_count": 19551,
"repo_created_at": "2018-10-15T10:54:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8597,
"forks": 2656,
"issues": 303,
"pull_requests": 258
},
"file_meta": {
"content_id"... |
75d5df08-8f98-4c30-9d02-2d681e8e3fac | chiraagb/LeetCode | 0493-reverse-pairs/0493-reverse-pairs.cpp | class Solution {
public:
int _merge(vector<int> &nums,vector<int> &temp,int lo,int mid,int hi){
int inv = 0;
int j = mid+1;
for(int i=lo;i<=mid;i++){
while(j<=hi && nums[i] > 2LL*nums[j]){
j++;
}
inv+=(j-(mid+1));
}
int left... | ALGO | 0.999987 | 5.443955 | {
"github_metadata": {
"branch": "main",
"commit_count": 146,
"repo_created_at": "2023-03-29T21:01: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": "3511430465... |
7f609ea0-4e24-4ded-9e30-911f74360cdb | Adxzr/TKI3208-FUNDAMENTAR-PROGAMING | .vscode/Tugas2a.cpp | #include <iostream>
using namespace std;
int main()
{
int jumlahSiswa, nilaiAkhir;
int lulus = 0, perbaikan = 0, tidakLulus = 0;
// Meminta pengguna memasukkan jumlah siswa
cout << "Masukkan jumlah siswa: ";
cin >> jumlahSiswa;
// Perulangan untuk setiap siswa
for (int i = 1; i <= jumlahS... | ALGO | 0.985731 | 5.482681 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-09-19T18:25: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": "12e89cdffe8b... |
2b4ab3ab-d26d-437c-88ef-a549bc683a09 | matthewsamuel95/ACM-ICPC-Algorithms | DP/Coin Change Problem/MinCoins.cpp | #include<bits/stdc++.h>
using namespace std;
/*
Algorithm : Coin Change Problem (Minimum Coins)
Type : DP
Problem
Given a value V, if we want to make change for V cents, and we have infinite supply of each of C = { C1, C2, .. , Cm} valued coins, what is the minimum number of coins to make the change?
Example
Inp... | ALGO | 0.99998 | 4.48125 | {
"github_metadata": {
"branch": "master",
"commit_count": 1421,
"repo_created_at": "2017-10-21T21:46:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2203,
"forks": 1277,
"issues": 4,
"pull_requests": 48
},
"file_meta": {
"content_id": "... |
54de56a8-ba18-4a48-976e-42913e427d2e | rv02/Princeton-Algorithms | Divide&Conquer/max_min.cpp | // A program to display max and min elements in an array
#include <iostream>
#include <array>
int max_elem(std::array<int, 6> &a, int index, int size)
{
int max;
if (index >= size - 2){
if (a[index] > a[index + 1])
return a[index];
else
return a[index + 1];
}
max... | ALGO | 0.997376 | 5.26311 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-04-19T11:42: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": "58dbdc5cd7f5... |
23a5cddd-5e44-4106-9c50-e8a6ba8051e5 | Yeb02/SpaceSpanningNetwork | source/Network.h | #pragma once
#include "Random.h"
#include "config.h"
#include <memory>
#include <vector>
struct Network {
int inputSize, outputSize;
//= 1 if 0 hidden layers.
int nLayers;
std::vector<std::unique_ptr<float[]>> WGrads;
std::vector<std::unique_ptr<float[]>> BGrads;
// [in1, out1=in2, out2=in3, ...] so lengt... | ALGO | 0.979219 | 5.552644 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2023-07-07T13:29: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": "a1956e7d6... |
7fc436dc-16c8-43d1-9e0a-d72b05f2cf11 | zhangruichang/Algorithm | Hihocoder/Hihocode1135/main.cpp | /*
Author: richard
Contact: <EMAIL>
*/
#include<set>
#include<map>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<ctime>
#include<cstdio>
#include<string>
#include<vector>
#include<climits>
#include<cstdlib>
#include<cstring>
#include<fstream>
#include<sstream>
#include<iostream>
#include<algor... | ALGO | 0.999707 | 3.560929 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2015-08-08T12:06: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": "2739cd68d... |
a702fc5b-a3d8-47f5-a7f7-91652842208e | Hyper-Infinity/DsaCodes | linked_list/merge_sort.cpp | /* <<<<< CODE BY SRP >>>>> */
/* <<<<< SAMARTH >>>>> */
/* <<<<< <NAME> >>>>> */
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define PB push_back
#define MP make_pair
typedef vector<l... | ALGO | 0.999982 | 4.816548 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-07-28T14:00: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": "b56065342ac1... |
945eb2e3-ef2d-4673-849b-0853af657726 | ErenBtrk/CPPHowToProgramExercises | Chapter 9/Exercises/9.24/player.cpp | #include "player.h"
#include "card.h"
#include <iomanip>
#include <algorithm>
const std::array < std::string , 10 > Player::handNames = {"HIGH_HAND" , "PAIR", "TWO_PAIRS" , "THREE_OF_A_KIND" ,
"STRAIGHT" ,"FLUSH" , "FULL_HOUSE... | TOOL | 0.974623 | 4.488163 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2021-12-18T16: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": "10961f1cb... |
17a06077-3c9c-4e34-8f29-2303cbf5eb58 | mandalmohan2001/codingninjasprograms | 7.Test 1/SecondLargest.cpp | Take input a stream of n integer elements, find the second largest element present.
The given elements can contain duplicate elements as well. If only 0 or 1 element is given, the second largest should be INT_MIN ( - 2^31 ).
Input format :
Line 1 : Total number of elements (n)
Line 2 : N elements (separated by space)... | ALGO | 0.999973 | 4.02024 | {
"github_metadata": {
"branch": "main",
"commit_count": 503,
"repo_created_at": "2022-03-13T13:23:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a782a35b37... |
ec119da3-8e56-4e32-a8c7-97ad921fa0bf | hightuv/BOJ_Solutions | 백준/Gold/5427. 불/불.cc | #include <iostream>
#include <climits>
#include <string>
#include <queue>
#define MAX 1001
#define WALL '#'
#define SPACE '.'
#define FIRE '*'
#define START '@'
using namespace std;
int t;
int w, h;
char board[MAX][MAX];
bool visited[MAX][MAX];
int fireTime[MAX][MAX];
int time[MAX][MAX];
int minimum = INT_MAX;
queue<... | ALGO | 0.999829 | 4.418516 | {
"github_metadata": {
"branch": "main",
"commit_count": 59,
"repo_created_at": "2023-04-07T09:01: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": "8ba219ec3bd... |
5efcbaf0-5b63-4013-86cf-b8922afa6c3f | gahan9/ParallelProgramming | 02.vector_add/vector_add.cpp | /*
Vector Addition Program
REF: https://rocm.docs.amd.com/projects/HIP/en/latest/understand/programming_model.html#heterogeneous-programming
*/
#include <stdio.h>
#include <hip/hip_runtime.h>
#define N 1024
// HIP kernel for vector addition
__global__ void vector_add(const float* A, const float* B, float* C, int ... | ALGO | 0.99962 | 5.392339 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2025-03-09T18:30:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e188f1cbaeb... |
3126e57a-2cd9-4d27-8b8d-4ee12ec515fe | dhruv-yadav-nitj/striver-a2z-dsa-cpp | Step 03 ~ Arrays/06-MAX-CONSECUTIVE-ONES.CPP | #include <bits/stdc++.h>
using namespace std;
// https://practice.geeksforgeeks.org/problems/maximum-consecutive-ones/1
// approach : we need to find the largest window having atmost k zeros
class Solution {
public:
int longestOnes(int n, vector<int> &nums, int k) {
// Code here
int i =0 , j = 0 ,... | ALGO | 0.999938 | 5.336859 | {
"github_metadata": {
"branch": "main",
"commit_count": 173,
"repo_created_at": "2023-06-07T19:26:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 52,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f125e865... |
6d624b1a-9e8f-4cf9-883a-61cb73a8d278 | SleepySoldier/GAS_Aura | Source/Aura/Private/AbilitySystem/ModMagCalc/ExecCalc/ExecCalc_Damage.cpp | // Copyright SleepySoldier
#include "AbilitySystem/ModMagCalc/ExecCalc/ExecCalc_Damage.h"
#include "AbilitySystemComponent.h"
#include "AuraAbilityTypes.h"
#include "AuraGameplayTags.h"
#include "AbilitySystem/AuraAbilitySystemLibrary.h"
#include "AbilitySystem/AuraAttributeSet.h"
#include "AbilitySystem/Data/Charact... | TOOL | 0.923976 | 7.359749 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2025-04-25T02:44: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": "db7706641ba... |
81c1a156-93ba-4e2e-8a51-1dcc77318256 | liardanc3/algorithm | cpp/17383.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<int> vect;
int N, T;
cin >> N;
for (int i = 0; i < N; i++) {
cin >> T;
vect.push_back(T);
} sort(vect.begin(), vect.end());
int left = 1, right = vect[N - 1];
while (left <= right) {
int mid = (left + right) / 2;
vector<int> arr;
for (... | ALGO | 0.999987 | 3.849395 | {
"github_metadata": {
"branch": "master",
"commit_count": 673,
"repo_created_at": "2021-06-30T06:52: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": "8397b75d... |
afeb5aed-f7c0-4ec7-a6a0-4767f9d5468b | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/11/1101/personal_submission/cf992c_yawn_sean.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("O3,Ofast,unroll-loops")
// #include <bits/extc++.h>
// using namespace __gnu_cxx;
// using namespace __gnu_pbds;
using namespace std;
long long quickPow(long long base, long long power, long long mod) {
if (power == 0) return 1 % mod;
long long cur = quickPow(bas... | ALGO | 0.999974 | 5.196558 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "7484... |
6dbbea46-b2eb-4040-accf-934a874ff751 | Abir1373/XPSC | W7(Bit_Mask_2)/Extra/A_Easy_Problem.cpp | // <NAME>
// author : VaLEnT_DouLoS ( Abir )
#include <bits/stdc++.h>
using namespace std ;
#define f first
#define s second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define ll long long int
#define ld long double
#define nl '\n'
#define B begin
#define rb rbegin
#defi... | ALGO | 0.999397 | 4.523297 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2024-10-28T02:20:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bfe1dcc36cd... |
89972a9e-03b4-4031-b7a1-59f0b46886db | raincross7/code-similarity | codes/train_code/problem498/problem498_249.cpp | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend... | ALGO | 0.999981 | 3.245111 | {
"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": "a7713a0dc45f... |
2f292d0f-0123-42f8-b987-bd70a5dbfbf2 | CyberSilent10/AdventOfCode | Day9.CPP | /******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
******************************************... | ALGO | 0.999985 | 5.685633 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2021-12-05T05:40: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": "abf3e86142b... |
8aa1a528-1c95-4583-b2c0-2011947c303f | eighteight/CinderEight | alterscape-CinderCVBoids-924af31/src/SilhouetteDetector.cpp | /*
* SilhouetteDetector.cpp
* Boids
*
* Created by <NAME> on 12/1/10.
* Copyright 2010 __MyCompanyName__. All rights reserved.
*
*/
#include "SilhouetteDetector.h"
using namespace std;
using namespace boost;
using namespace ci;
SilhouetteDetector::SilhouetteDetector(int width, int height) {
cvThresholdLe... | ALGO | 0.942785 | 4.203346 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2014-01-22T21:09:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "35936efe0... |
d55dcd14-1e5f-45e4-a12f-9ff2251346f7 | ntua-el17897/ieeeXtreme2023 | dalvik/try1.cpp | #include <iostream>
using namespace std;
void solution(){
int v0, v1, v2, v3 = 1;
cin >> v0 >> v1 >> v2;
cout << v0 << v1 << v2 << endl;
int v4 = 0; //int v4 = v3 - v3;
int v5 = -1;//int v5 = v4 - v3;
int v6 = v3;
int v7 = -v1; //v7 -= v1;
int v8 = v0;
int v9 = v0;
v9 = v0 + v1;
int v10 = v4;
int v11 = ... | ALGO | 0.999961 | 3.411303 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-10-28T01:06: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": "d277c0a7981f... |
4c122d30-6f88-46f8-a903-5f4e9618ae9d | zhiyuXiao1221/Meshless-Deformations-Based-on-Shape-Matching | src/OpenGLShaderProgram.cpp | //#####################################################################
// Opengl shader program
// Copyright (c) (2018-), <NAME>, <EMAIL>
// This file is part of SLAX, whose distribution is governed by the LICENSE file.
//#####################################################################
#include <iostream>
#includ... | TOOL | 0.947801 | 4.977078 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2022-03-09T19:26:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "645cdfe0fd0... |
a1c23548-4142-43de-9f48-e20cc482aea4 | bhaveshlohana/HacktoberFest2020-Contributions | Algorithms/Hashing/hashing_with_chaining.cpp | #include<bits/stdc++.h>
using namespace std;
class Hash
{
int BUCKET;
list<int> *table;
public:
Hash(int V);
// inserts a key into hash table
void insertItem(int x);
// deletes a key from hash table
void deleteItem(int key);
// hash function to map values to key
int hashFunction(int x) {
ret... | ALGO | 0.999172 | 5.191005 | {
"github_metadata": {
"branch": "master",
"commit_count": 2347,
"repo_created_at": "2020-09-30T11:42:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 190,
"forks": 988,
"issues": 11,
"pull_requests": 546
},
"file_meta": {
"content_id": "... |
111e2df5-aa12-408e-a45d-6f2901fde72d | RishabhSinghla/DSA-450 | Lecture 17 BUBBLE SORT in 1 Video [Theory + Optimised Code] BestWorst Case Complexity/Bubble Sort Program.cpp | #include <iostream>
using namespace std;
//This program is for Bubble Sort
//We compare each element with its neighbour
//and swap if value of arr[j]>arr[j+1]
//Like this we do n-1 rounds and always after ith rounds, the ith largest element gets sorted
//Meaning, after every round...last m elements sorted hote jate h... | ALGO | 0.998764 | 3.775613 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-03-04T10:39: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": "fb1fbe4824e8... |
098bc858-4033-468b-a069-61f7ad882adf | thenromanov/Tinkoff-Generation | Tour 11/c.cpp | #include <bits/stdc++.h>
using namespace std;
struct circle {
double x, y, r;
};
struct dsu {
vector <int> p, sz;
dsu(int n) {
p.resize(n), sz.resize(n, 1);
iota(p.begin(), p.end(), 0);
}
int find(int v) {
if (p[v] == v) return v;
return p[v] = find(p[v]);
}
... | ALGO | 0.999672 | 4.6371 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-09-17T14:08:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ec902a847... |
eae64da5-8e76-4102-a440-8b9df8595b47 | danielx285/Bard-X-ChatGPT-Competitive-Programming-Analysis | AtCoder/AtCoder Beginner Contest 321/F/bard/bard-F3.cpp | #include <iostream>
#include <vector>
using namespace std;
const int MOD = 998244353;
int main() {
int Q, K;
cin >> Q >> K;
// Create a vector to store the balls in the box.
vector<int> balls(K + 1, 0);
// Create a 2D DP table to store the number of ways to pick up some number of balls from the box so th... | ALGO | 0.999865 | 5.359674 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2023-07-11T05:14:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "544c12773aa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.