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 |
|---|---|---|---|---|---|---|---|
4f6a489b-8ec0-41af-8cb8-4d2f7061b331 | yrlin411/OOP-and-Data-Structure | HW2/HW2_109550069/Mergesort_109550069.cpp | #include <ctime>
#include <cstdio>
#include <vector>
#include <iostream>
using namespace std;
void merge(int* arr, int left, int mid, int right)
{
int indexL = mid - left + 1, indexR = right - mid;
int tmpArrL[500] = {0}, tmpArrR[500] = {0};
for (int i=0; i<indexL; i++) {
tmpArrL[i] = arr[left+i];... | ALGO | 0.999953 | 4.452822 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-02-02T07:53:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "07711f21c355... |
98eaccbf-0b9d-4378-8a21-e276cce2176a | isha141/LeetCode | 112-path-sum/112-path-sum.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.999952 | 5.391007 | {
"github_metadata": {
"branch": "main",
"commit_count": 5007,
"repo_created_at": "2022-05-10T13:20:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a369390f8... |
dd971438-d323-4cbb-b76a-eba621bfacaf | viennamath/viennamath-dev | viennamath/runtime/operations/constant.hpp | #ifndef VIENNAMATH_RUNTIME_OPERATIONS_CONSTANT_HPP
#define VIENNAMATH_RUNTIME_OPERATIONS_CONSTANT_HPP
/* =======================================================================
Copyright (c) 2012, Institute for Microelectronics,
Institute for Analysis and Scientific Computing,
... | TOOL | 0.937397 | 6.382624 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2013-07-17T22:49:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc4759af... |
1f9da294-ac5b-4d36-af01-6049119a55ca | kow/Meerkat-Viewer | indra/llmath/llvolume.cpp | /**
* @file llvolume.cpp
*
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
... | TOOL | 0.981641 | 3.598609 | {
"github_metadata": {
"branch": "master",
"commit_count": 275,
"repo_created_at": "2011-03-21T19:47:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff0fdb8e... |
cda9c336-19bd-4f6b-878d-2d17ec13e5da | NLS-SP/SLAM_Basics | SLAM_Demo/Frontend/Stero_Depth_Estimate/src/stereo_vision.cpp | //
// Created by Robotics_qi on 2021/2/22.
//
#include <vector>
#include <string>
#include <unistd.h>
#include <Eigen/Core>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace Eigen;
std::string left_file = "/Users/robotics_qi/Data/Kitti/sequences/00/image_2/000888.png";
std::string right_file = "/Use... | ALGO | 0.951976 | 4.732515 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2019-12-20T09:33:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 4,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "53b087aa61... |
66a72f0f-67c1-408f-82ca-71ebd5a16394 | torres07/competitive-programming | project_euler/138.cpp | #include <bits/stdc++.h>
using namespace std;
#define llu long long unsigned
#define lld long long int
#define ii pair<int, int>
#define pb(x) push_back(x)
bool is_quadrado_perfeito(llu n, llu num){
return num * num == n;
}
int main(){
llu b = 16;
int cont = 0;
llu sum = 0;
while (cont < 20){
llu op1 = (b ... | ALGO | 0.999667 | 3.454185 | {
"github_metadata": {
"branch": "master",
"commit_count": 101,
"repo_created_at": "2018-07-17T14:51:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f02c59a7... |
4dea62e2-3a65-4985-a9c6-e4e56fd1e6bc | intellistream/LibAMM | src/CPPAlgos/CoOccurringFDCPPAlgo.cpp | //
// Created by haolan on 5/29/23.
//
#include <CPPAlgos/CoOccurringFDCPPAlgo.h>
namespace LibAMM {
torch::Scalar get_first_element(const torch::Tensor &tensor) {
if (tensor.numel() == 1) {
return tensor.item();
} else {
return tensor[0].item();
}
}
bool is_empty_tensor(const torch::Tensor &tensor) {
... | ALGO | 0.999936 | 6.74008 | {
"github_metadata": {
"branch": "main",
"commit_count": 534,
"repo_created_at": "2023-05-09T02:41:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d2ca39ae72... |
bf0d9647-9a78-40ad-99d2-47be28c891b6 | ad1tyaydv/Leetcode-Questions | Array/Three Consecutive Odds.cpp | // Approach - 1 (Liner brute force)
// Time Complexity - O(n)
// Space Complexity - O(1)
class Solution {
public:
bool threeConsecutiveOdds(vector<int>& arr) {
int n = arr.size();
if(n < 3) return false;
for(int i=0;i<n-2;i++) {
if(arr[i] % 2 != 0 && arr[i + ... | ALGO | 0.999882 | 5.67836 | {
"github_metadata": {
"branch": "main",
"commit_count": 186,
"repo_created_at": "2024-12-30T16:42: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": "23918bc4af... |
807f5eeb-c832-4437-b0c9-f2fe8406f463 | dilenshah23/maya_deformers | collisionDeformer/cpp/source/CollisionDeformer.cpp | #include <maya/MFnNumericAttribute.h>
#include <maya/MFnMesh.h>
#include <maya/MItGeometry.h>
#include <maya/MPxDeformerNode.h>
class CollisionDeformer : public MPxDeformerNode
{
public:
CollisionDeformer();
virtual ~CollisionDeformer();
static void* creator();
static MStatus initialize();
virtua... | TOOL | 0.965597 | 6.466326 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2021-12-26T10:29:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c79a2bd75b... |
88003aa3-8550-4485-9cd5-f75ff2917f7b | francis-maes/lbcpp | extern/shark/src/ReClaM/VarianceEstimator.cpp | //===========================================================================
/*!
* \file VarianceEstimator.cpp
*
* \brief Offers the methods to deal with active learning of a neural
* network.
*
* Most neural networks are used as passive learners, i.e. they
* will work on a fixed training set. In na... | ALGO | 0.969835 | 5.278223 | {
"github_metadata": {
"branch": "master",
"commit_count": 3495,
"repo_created_at": "2015-03-21T09:43:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7b7f6e... |
2fe80476-9111-4d51-a096-7eca4720f578 | NuggetNuclear/Archivo-Codigos | Codigos Semestre 1/Rendimiento de auto (distancia y costo).cpp | #include <iostream>
using namespace std;
int main()
{
cout << "km recorridos y rendimiento de combustible" << endl;
float li, lf, pxl, kmxl;
float cv, dkm;
cout << "¿Cual es el precio por litro de bencina?" << endl;
cin >> pxl;
cout << "¿Cual es el rendimiento de su vehiculo? (en km/l)" << ... | ALGO | 0.96838 | 3.956222 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2024-04-01T15:23:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de7c6c28c81... |
5b2bfe9b-a21f-4fcc-950b-e19dcc650cef | Atom-Heart/Leetcode | BinarySearch/C++/209-Minimum-Size-Subarray-Sum.cpp | class Solution {
public:
int minSubArrayLen(int s, vector<int>& nums) {
int n = nums.size();
vector<int> preSum(n + 1, 0);
for(int i = 1; i <= n; i++) preSum[i] = preSum[i - 1] + nums[i - 1];
int ans = INT_MAX;
for(int i = 1; i <= n; i++){
int le... | ALGO | 0.999964 | 5.312409 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2020-08-06T03:34: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": "23b51ccba... |
a6eb58a9-e061-433e-a260-af6f752fd435 | 1592063346/Codes | Codes(since 12-01)/51Nod1647.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, max_len = 1e6 + 10;
int n, t, tt, q, all, ch[max_len << 1][26], father[max_len << 1], len[max_len << 1], c[max_len], sorted[max_len << 1], endpos[max_len << 1], trie_t[max_len][26], f[max_len << 1][21], last_node[max_len];
char s[max_len];
vector<i... | ALGO | 0.99997 | 4.454427 | {
"github_metadata": {
"branch": "master",
"commit_count": 436,
"repo_created_at": "2018-12-27T22:56:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b1bd6ed... |
2d68acf4-f1d5-4fca-ae32-43f43739fe08 | opddinx/atcoder | tenkei90/19(sec_dp).cpp | //include libraries
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
... | ALGO | 0.999923 | 3.790503 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2020-04-15T13:51: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": "2075f99dd... |
4f9afdd3-7228-4806-8d90-7e0575621645 | statismo/statismo | modules/core/include/RandSVD.h | /*
* This file is part of the statismo library.
*
* Author: <NAME> (<EMAIL>)
*
* Copyright (c) 2011 University of Basel
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribu... | ALGO | 0.998028 | 6.309059 | {
"github_metadata": {
"branch": "master",
"commit_count": 856,
"repo_created_at": "2012-01-19T21:12:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 279,
"forks": 101,
"issues": 29,
"pull_requests": 3
},
"file_meta": {
"content_id": "903b... |
06de2f53-f10e-423a-bee7-c41647d98ce2 | Daniil-Oberlev/sorting | src/binaryInsertion.sort.cpp | template <typename T>
int binarySearch(T *arr, T item, int low, int high, bool ascending = true) {
if (ascending) {
while (low <= high) {
int mid = low + (high - low) / 2;
if (arr[mid] == item)
return mid + 1;
else if (arr[mid] < item)
low = mid + 1;
else
high = mid... | ALGO | 0.999984 | 5.406405 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-17T19:28:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9935b43872e4... |
fe8db268-6c48-4e0a-80fb-e39dbf73cef4 | s53809/NewBaekjoon | 2667 단지번호붙이기/baekjoon_2667.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <string>
using namespace std;
int N;
vector<vector<pair<int, bool>>> x;
int d_x[] = { -1,1,0,0 };
int d_y[] = { 0,0,-1,1 };
int BFS(int posX,int posY) {
x[posY][posX].second = true;
queue<pair<int,int>> qu;
qu.push(make_pair(posX,... | ALGO | 0.999995 | 3.964247 | {
"github_metadata": {
"branch": "master",
"commit_count": 217,
"repo_created_at": "2022-02-06T05:44: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": "a83297ce... |
4f4dae13-b3ca-404b-952c-0752e43ecbe4 | saber110/C_review | acm/bst.cpp | #include <iostream>
#include <stdlib.h>
#include <stack>
#define elemType int
#define keyType int
using namespace std;
//节点内所存数据为int,节点上的键值为int
//二叉排序树的存储结构——二叉链表
typedef struct{
keyType key;
elemType content;
}selemType;
typedef struct BSTNode{
selemType data;
struct BSTNode *lchild,*rchild;
}BSTNode,*BST... | ALGO | 0.999987 | 3.884973 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2016-11-16T17:36: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": "ca7dd11a0... |
6735dfbd-8a1a-4376-9c1b-8ba17642406c | Alehandreus/bvh | src/cpu_traverse.cpp | #include "cpu_traverse.h"
// at the moment cpu and gpu implementations are the same
// hence this file can be compiled by both nvcc and g++
CUDA_HOST_DEVICE HitResult bvh_traverse(
const Ray &i_ray,
const BVHDataPointers &i_dp,
StackInfo &io_st,
TraverseMode mode,
TreeType tree_type,
bool allow... | ALGO | 0.998101 | 5.521919 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2025-01-19T21:08: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": "51727b15d25... |
32c5b8ac-8c90-4a21-8c90-3c1917784535 | zenvite2/DSAA_PTIT | _old C++/xauconchungdainhat.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define matrix vector <vector <int>>
#define vt vector <int>
void solution() {
string a, b, res;
cin >> a >> b;
matrix mt(a.size() + 1, vector <int>(b.size() + 1, 0));
for (int i = 1; i <= a.size(); i++) {
for (int j = 1; j <= ... | ALGO | 0.999977 | 5.013826 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2022-05-07T14:31:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f103319da4... |
b77adb0c-fac3-4cfb-a67e-63bdf4aaa466 | tntanvir/DSA | semister-2/Data Structures/Module-21 Binary search Tree/Insert_in_BST.cc | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int vlu;
Node *left;
Node *right;
Node(int vlu)
{
this->vlu = vlu;
this->left = NULL;
this->right = NULL;
}
};
Node *input_tree()
{
int val;
cin >> val;
Node *root;
if (val == -1)
{
... | ALGO | 0.99993 | 4.466316 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2024-01-21T14: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": "e56f67d75cc... |
85b801f3-f4ea-433b-9ff9-b5dbdd8e6948 | jigjnasu/discrete_mathematics_and_its_applications | chapter_8_advanced_counting_techniques/8.3_divide_and_conquer_algorithms_and_recurrence_relations/exercises/repo/solution_7.cpp | /*
Discrete Mathematics and Its Applications
by Dr. <NAME>
Chapter 8.3 Divide and Conquer Algorithms and Recurrence Relations
Solution 7
<NAME>, <EMAIL>
15/06/2018
*/
#include <bits/stdc++.h>
int power(int x, int y) {
if (y == 0) {
return 1;
} else if (y == 1) {
return x;
} else {
const... | ALGO | 0.995841 | 4.588189 | {
"github_metadata": {
"branch": "master",
"commit_count": 2690,
"repo_created_at": "2016-09-04T15:23:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 165,
"forks": 37,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "df7e... |
c610e366-d87c-40c7-bce3-3df7640806b3 | jw0293/Algorithm_Problem_Solving | week4/boj_#14890.cpp | #include <bits/stdc++.h>
#define fastio ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define INF 1e9 + 3
#define endl '\n'
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int N, L, answer;
const int MX = 100 + 1;
int board[MX][MX], temp[MX][MX];
void input(){
cin >> N >> L;
for(... | ALGO | 0.999941 | 3.892897 | {
"github_metadata": {
"branch": "main",
"commit_count": 96,
"repo_created_at": "2023-06-18T06:26: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": "6040b6b7ff2... |
a10fd6b7-219e-4229-8b00-6760801c9408 | rutwikdesh/My-Coding-Train | Problem Solving/C++/codes/3sum.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
vector<vector<int>> threeSum(vector<int> &nums)
{
sort(nums.begin(), nums.end());
int n = nums.size();
vector<vector<int>> ans;
for (int i = 0; i < n; i++)
{
int low = i + 1;
int high = n - 1;
while (low... | ALGO | 0.999798 | 5.691312 | {
"github_metadata": {
"branch": "main",
"commit_count": 94,
"repo_created_at": "2023-07-26T08:55: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": "d70cb44f9f4... |
bdf0ec85-b235-488f-88e9-48354c7bdeab | mhaoli/ACM-Source-Code | Problems/Codeforces/Bayan-2015-Contest-Warm Up(475)/C.cpp | /*
* Author: Plumrain
* Created Time: 2014/10/5 21:23:32
* File Name: C.cpp
*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <sstream>
#include <fstream>
#include <list>
#include <deque>
#include <queu... | ALGO | 0.99973 | 3.503407 | {
"github_metadata": {
"branch": "master",
"commit_count": 109,
"repo_created_at": "2015-04-15T04:55:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e89eb6f5... |
bd720b23-c790-4b3f-86df-c689fd967a53 | ishandutta2007/codeforces-t | tokusakurai/normal/407/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define each(e, v) for(auto &e: v)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x)... | ALGO | 0.999852 | 4.146815 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:27: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": "adf5f667171a... |
337cb11b-a88f-4703-8e58-83ad24335160 | chengcli/canoe | src/transport/stream_transport.cpp | // dealii headers
#include <deal.II/lac/precondition.h>
// athena headers
#include <athena/athena.hpp>
// IceChem headers
#include "stream_transport.hpp"
StreamTransport::StreamTransport(int rows, int cols, bool fourth_order)
: fourth_order_(fourth_order),
rows_(rows),
cols_(cols),
rank_(rows *... | ALGO | 0.997398 | 5.857146 | {
"github_metadata": {
"branch": "main",
"commit_count": 219,
"repo_created_at": "2023-05-14T21:30:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 17,
"issues": 7,
"pull_requests": 2
},
"file_meta": {
"content_id": "a641daac... |
bd3b7b98-06f6-45dc-ae94-f48d5efa89f2 | ishandutta2007/codeforces-p | pavement/normal/1520/C.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
#define int long long
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define ppb pop_back... | ALGO | 0.99937 | 3.891764 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:49: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": "41efc1a29d47... |
2daa7ae2-7311-4fa3-a87a-79be1f2343b1 | Deep-glitch1/Btech-Daa | week2a.cpp | #include <iostream>
using namespace std;
int firstOccurrence(int arr[], int n, int key) {
int left = 0, right = n - 1, result = -1;
while (left <= right) {
int mid = left + (right - left) / 2;
if (arr[mid] == key) {
result = mid;
right = mid - 1;
} else if (arr[m... | ALGO | 0.999945 | 4.74175 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2025-02-16T17:07: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": "132aaa2caab... |
2e38e148-2713-48ed-8d99-0f978a9aba62 | JGU-HPC/parallelprogrammingbook | chapter10/mandelbrot/mandel2.cxx | #include <upcxx.h>
// Output array
upcxx::shared_var<upcxx::global_ptr<int>> outImage;
// Array to know the busy threads
upcxx::shared_array<bool> busyTh;
void printMandel(int *image, int rows, int cols){
for(int i=0; i<rows; i++){
for(int j=0; j<cols; j++)
std::cout << image[i*cols+j] << " ";
std::cout ... | ALGO | 0.995487 | 4.628921 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2017-11-22T09:12:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 72,
"forks": 25,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "52074e5d... |
b80b80a4-0873-433f-8cff-0f7d75739d5e | saumyaagarg/100-Days-of-DSA | Day 10/2-reverse-linked-list.cpp | // Write a program to reverse a linked list.
#include <iostream>
using namespace std;
// Node structure
struct Node {
int data;
Node* next;
};
// Function to insert a new node at the end of the list
void insert_at_end(Node*& head, int data) {
Node* newNode = new Node();
newNode->data = data;
newN... | ALGO | 0.999871 | 6.010681 | {
"github_metadata": {
"branch": "main",
"commit_count": 132,
"repo_created_at": "2024-12-01T08:23: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": "c0d435de22... |
682997fc-615a-4bde-bb15-6aed80cfc5b1 | huihut/CloudCompare-Qt | CloudCompare/plugins/qCSF/Cloud2CloudDist.cpp | #include "Cloud2CloudDist.h"
//system
#include <cmath>
// For each lidar point, we find its neibors in cloth particles by Rounding operation.
//use for neighbor particles to do bilinear interpolation.
#if 1
bool Cloud2CloudDist::Compute(const Cloth& cloth,
const wl::PointCloud& pc,
double class_threshold,
std... | ALGO | 0.998227 | 5.131086 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-08-08T16:41:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 40,
"forks": 28,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "15c31b86... |
3fc636f9-3f6a-4d25-998a-803c2cc61e74 | ButinVladimir/Training-Algorithms | PlusPlus/cube_summation.cpp | #pragma comment(linker, "/STACK:64000000")
#include <stdlib.h>
#include <fstream>
#include <iostream>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <cstring>
#include <map>
#include <set>
#include <string>
#include <deque>
#include <algorithm>
#define _USE_MATH_DEFINES
#include <math.h>
#include <as... | ALGO | 0.999027 | 4.668232 | {
"github_metadata": {
"branch": "master",
"commit_count": 140,
"repo_created_at": "2016-10-18T19:02: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": "7a5d211f... |
f68ba98f-faea-42e3-a648-cff62cbf4c71 | Sommerfield3/LAB18_GRUPO_A_20213129_-EJECUTABLE_LIN | CCII laboratorio 18/Intento ejercicio 4.cpp | #include <iostream>
using namespace std;
template <int const x>
struct DecimalAHexadecimal{
static const char * const a=(DecimalAHexadecimal<x/16>::a)+(DecimalAHexadecimal<x%16>::a);
};
template <>
struct DecimalAHexadecimal<0>
{
static const char * const a;
};
const char* const DecimalAHexadecimal<0>::a = "0";
tem... | ALGO | 0.987654 | 3.241342 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-08-07T05:01: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": "4da8e24122af... |
c1535bdf-2f6f-4315-a7c2-e505ac12b53f | webclinic017/DeepHFT | src/data.cpp |
#include <cstdlib>
#include <vector>
#include <string>
#include <cmath>
#include <fstream>
#include "../lib/data.hpp"
std::vector<double> read(std::string path) {
std::vector<double> dat;
std::ifstream src(path);
if(src.is_open()) {
std::string line;
while(std::getline(src, line))
... | DATA | 0.969807 | 4.577444 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2022-04-20T22:18:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6996eaea3... |
6ddbd933-c684-44bf-ab3b-62e60bb0d81f | ye-htut-maung/CSCI-Lab | Labs/Homework_Extra/ex_6_4_2.cpp | #include <iostream>
#include <string> // Needed for string class.
#include <cstdlib> // Needed for randomization.
#include <ctime>
using namespace std;
int deck[52];
// string deck_rank[52];
string card_names[] = {"ace", "two", "three", "four", "five", "six",
"seven", "eight", "nine", "ten", "Jo... | ALGO | 0.985874 | 4.921467 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2022-11-07T16:42:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9fe0e84096f... |
c3262518-2870-445d-8b63-2a7197f1ac34 | DenisParyshev/Neuro-robot | Neuro_robot.ino | //#include <SoftwareSerial.h>
#include "Otto.h"
Otto Otto;
#define LeftLeg 8 // left leg pin, servo[0]
#define LeftFoot 9 // left foot pin, servo[2]
#define RightLeg 10 // right leg pin, servo[1]
#define RightFoot 11 // right foot pin, servo[3]
//SoftwareSerial BT(2,3); //Rx/Tx
#define BAUDRATE 57600
// system va... | TOOL | 0.950658 | 4.107474 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-03-14T16:28:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f09a27f6a76e... |
09ba7b0e-b149-4d7f-aaf4-d0878ce3abd2 | DenisaXXIV/FMI-UniTBv | Year_1/Semester_I/FAI-Algebraic_Fundamentals_of_Computer_Science/Problema/Problema FAI/Problema FAI.cpp | #include <iostream>
using namespace std;
void Citire(int& k, int& lp, int& lq)
{
cout << "k=";
cin >> k;
cout << "Lungimea cuvantului p = ";
cin >> lp;
cout << "Lungimea cuvantului q = ";
cin >> lq;
}
void Calcul_r(int lq)
{
cout << "r=";
for (int index = 1; index <= lq; index++)
{
cout << "a_" << index;
... | ALGO | 0.998941 | 3.410362 | {
"github_metadata": {
"branch": "master",
"commit_count": 196,
"repo_created_at": "2021-11-30T14:36:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "258696a1... |
8da4d6a8-62d0-46c7-9e56-9719eaea7a23 | imhuwq/algs4 | includes/sort/heap_sort.h | #ifndef ALGS4_SORT_HEAP_SORT_H
#define ALGS4_SORT_HEAP_SORT_H
#include "sort_base.h"
#include <error.h>
#include <vector>
#include <iterator>
#include <algorithm>
#include <functional>
using namespace std;
template<typename T>
class MaxHeap {
private:
unsigned int size;
vector<T> pq;
std::less<int> less... | ALGO | 0.999605 | 5.592409 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2018-08-14T16:28:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f595ee77... |
151c8f7f-e8bf-4f67-8fd9-b3072cc42a76 | ammarhusain/sandbox | vision/SfM/reconstruction.h | #pragma once
#include "camera_matrices.h"
#include "common.h"
#include "optical_flow.h"
#include "rich_feature.h"
#include "triangulation.h"
#include <map>
#include <vector>
class Reconstruction {
public:
Reconstruction() = delete;
explicit Reconstruction(std::vector<cv::Mat> images, cv::Mat K, cv::Mat distortio... | ALGO | 0.990571 | 6.358498 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2017-04-24T18:48: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": "0da52e4ee... |
bb0c04bb-cb7a-49a8-bdc6-5b45e82305f3 | pratham-0094/DSA-and-CP | Day-005/power.cpp | #include <iostream>
using namespace std;
// method - 1
// time - O(n)
// space - O(n)
int pow1(int m, int n)
{
if (n == 0)
{
return 1;
}
if (n % 2 == 0)
{
return pow1(m * m, n / 2);
}
else
{
return m * pow1(m * m, n / 2);
}
}
// method - 2
int pow2(int m, ... | ALGO | 0.999995 | 6.065301 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2023-01-10T16:32: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": "ad28bbdd15a... |
78bfd0b2-2c64-499b-b4c9-6f5a9f0a7bf5 | Youssif-1st/Games | Game3.h | #pragma once
#ifndef _GAME3_H
#define _GAME3_H
#include "BoardGame_Classes.h"
#include <iostream>
#include <iomanip>
#include <cctype> // for toupper()
#include <cstdlib> // for rand() and srand()
#include <ctime> // for time()
using namespace std;
template <typename T>
class game3_Board : public Board<T> {
publ... | ALGO | 0.932162 | 5.427355 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-12-16T15:48: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": "3ce5c512cd06... |
3239272e-890b-42e4-9613-a01b4331923e | sunilsch/IOI-Training | Training Websites/CSES/Graph Algorithms/message_route.cpp | #include <bits/stdc++.h>
#define MAXN 100000
using namespace std;
int n,m;
vector<vector<int>> network(MAXN);
vector<bool>visited(MAXN, false);
vector<int>previousStep(MAXN);
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m;
for(int i = 0; i < m; i++){
int node1, node2;
... | ALGO | 0.999984 | 3.967983 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-12-25T23:13:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b32084c5a6c... |
15dd26cd-384a-4fdc-9cef-494ecf90df7a | Manvityagi/Codechef-Codeforces-spoj | CODEFORCES/VIRTUAL CONTESTS/654 div2/E2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e5 + 5, INF = 0x3f3f3f3f, MOD = 1e9 + 7;
int T, n, m, p, A[N], cnt[N];
int s, t, l, r, mx;
bool check(int x)
{
int now = 1;
for (int i = 0; i < n; i++)
now = (now * (cnt[i + x] - i)) % p;
return now != 0;
}
int main(... | ALGO | 0.999983 | 3.798455 | {
"github_metadata": {
"branch": "master",
"commit_count": 95,
"repo_created_at": "2019-08-10T02:15:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ebd5fdcb... |
75c2f3b0-f348-40d7-8739-12998d4e76b9 | kiwibrowser/src | content/renderer/manifest/manifest_parser.h | // Copyright 2014 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.
#ifndef CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_
#define CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_
#include <stdint.h>
#include <memory>
#includ... | TOOL | 0.910455 | 7.826957 | {
"github_metadata": {
"branch": "master",
"commit_count": 672,
"repo_created_at": "2020-04-18T07:16:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2888,
"forks": 414,
"issues": 0,
"pull_requests": 5
},
"file_meta": {
"content_id": "9d5... |
adf80c1e-d735-4ccc-802b-2b5f79e63396 | Sonali2314/Computer_Algorithms | Job_Sequencing.cpp | #include<iostream>
using namespace std;
struct job{
char id;
int profit;
int deadline;
};
void jobsort(job arr[], int n)
{
for (int i = 0; i < n - 1; i++)
{
for (int j = 0; j < n - 1 - i; j++)
{
if (arr[j].profit < arr[j + 1].profit)
{
swap(arr[j... | ALGO | 0.999987 | 4.385844 | {
"github_metadata": {
"branch": "coding",
"commit_count": 7,
"repo_created_at": "2024-04-05T06:57: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": "09539a21b8... |
f2f1324f-6180-4d7a-9679-d505cf37724f | muhammadhasan01/cp | Library/Graph/LCA_RMQ_struct.cpp | template<class Info>
struct LCARMQ {
int n, l;
int tim;
vector<int> depth, tin, tout;
vector<vector<int>> up;
vector<Info> values;
vector<vector<Info>> sp;
LCARMQ(int n, int root, const vector<vector<int>>& adj, const vector<Info>& val) : n(n), values(val), depth(n), tin(n), tout(n) {
... | ALGO | 0.999958 | 4.954673 | {
"github_metadata": {
"branch": "master",
"commit_count": 1187,
"repo_created_at": "2019-07-13T15:49:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9cd7428... |
a967a6ab-9c6f-49d5-9414-772f7123e35d | shokolatca/Methods-pd-Programming-C- | lab_3_Methods_of_programming/include/mixer.h | #ifndef MIXER_H
#define MIXER_H
#include <cstdint>
/// @brief Генератор псевдослучайных чисел методом “перемешивания” (Mixer).
/// @details
/// Внутреннее состояние хранится в 32-битном регистре `state`.
/// При каждой итерации берутся два значения:
/// - `rotl(state, r1)`: циклический сдвиг влево на r1 бит,
/// -... | ALGO | 0.980043 | 6.078673 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-06-18T06:44: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": "37485729a5e3... |
571a35c7-5812-4d21-a8a6-9598a0e1ec2b | A7abhilash/dsa-cpp | Data Structures/queues/doubleEndedQueue/doubleEndedQueue.cpp | #include <iostream>
using namespace std;
class QUEUE{
int size;
int items[5];
int front,rear;
public:
QUEUE(){
size=5;
front=0;
rear=-1;
}
void insertRear(){
if(rear==4){
cout<<"Queue is full\n";
}else... | ALGO | 0.990867 | 3.958972 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-12-06T12:48: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": "3de926f5b... |
1343e291-4e89-425d-a346-47c79ab1b53b | shrey/templates_cpp | ConceptsAndQuestions/DP/max_path_2.cpp | // https://www.geeksforgeeks.org/maximum-path-sum-starting-cell-0-th-row-ending-cell-n-1-th-row/
//<NAME>
//Contact Me at <EMAIL>
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<unordered_map>
#include<vector>
#include<set>
#include<list>
#include<iomanip>
#include<queue>
#include<... | ALGO | 0.999952 | 4.026491 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2020-07-29T11:38: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": "a360eef98... |
ee7c8f49-05b4-466a-8fb2-b05bae8f7725 | meenyweeny/Algorithm | BOJ/2805.cpp | #include<iostream>
using namespace std;
const int sz = 1e6;
int n,m;
int arr[sz];
void input() {
cin>>n>>m;
for(int i=0; i<n; i++) {
cin>>arr[i];
}
}
unsigned long long get_length(unsigned long long cut) {
unsigned long long ret = 0;
for(int i=0; i<n; i++) {
if(arr[i]<=cut) {
... | ALGO | 0.999986 | 3.999682 | {
"github_metadata": {
"branch": "main",
"commit_count": 577,
"repo_created_at": "2022-02-02T15:50: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": "7d58506357... |
56ab9dac-86cb-46b9-9636-5ab1f1c42082 | RoboMash/Cpp_Lessons | Nesting.cpp | #include <iostream>
#include <string>
using namespace std;
/* Nesting of member function in C++ */
class binary
{
private:
string s;
public:
void read(void); //read binary
void chk_bin(void); //check binary
void ones_compliment(void); //Taking ones compliment
void display(void);... | TOOL | 0.944641 | 5.590641 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2022-02-05T09:46:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d05b4def6c... |
cf6fec6a-cf76-45c4-971d-c884f585dc9b | infiniflow/infinity | third_party/rocksdb/util/string_util.h | // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
// This source code is licensed under both the GPLv2 (found in the
// COPYING file in the root directory) and Apache 2.0 License
// (found in the LICENSE.Apache file in the root directory).
//
#pragma once
#include <cstdint>
#include <sstream>
#i... | TOOL | 0.92037 | 7.729465 | {
"github_metadata": {
"branch": "main",
"commit_count": 2749,
"repo_created_at": "2022-07-18T13:52:38.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3907,
"forks": 371,
"issues": 120,
"pull_requests": 14
},
"file_meta": {
"content_id": "14... |
a4c00b46-3199-480c-b782-8b9f2904992e | 0xff-dev/acm-problem | hdoj/1026.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
using namespace std;
const int MAX=100;
int n, m;
char labyrithn[MAX+1][MAX+1];
int map_value[MAX+1][MAX+1];
int value[MAX+1][MAX+1];
int recall_step[MAX+1][MAX+1];
int next_direction[4][2] = {
{0, 1},
{0, -1},
... | ALGO | 0.999819 | 3.356118 | {
"github_metadata": {
"branch": "master",
"commit_count": 223,
"repo_created_at": "2018-02-19T07:15:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be987ba7... |
2dd63ece-f93d-437c-8e2f-7f1295f43d25 | T208FOR2/T208FOR2_2015 | lectures/lecture14_01/main.cpp | #include <iostream>
using namespace std;
int* staekkafylki(int *p, int& n);
int main()
{
int *fylki;
int n = 2, currentnumber, usedelements = 0;
fylki = new int[n];
for (int i = 0; i < n; i++) {
fylki[i] = 0;
}
cin >> currentnumber;
while ( currentnumber >= 0 ) {
fylki[ ... | ALGO | 0.999833 | 3.691554 | {
"github_metadata": {
"branch": "master",
"commit_count": 416,
"repo_created_at": "2015-08-12T14:57:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "324a0bc42... |
8799c924-2810-49cb-9869-319db771a5ba | AngelOlanC/competitive-programming | CSES/Range Queries/Range Updates and Sums/sol.cpp | #include <bits/stdc++.h>
using namespace std;
// <NAME> Moy
using i64 = long long;
struct STree {
#define ls (k << 1) + 1
#define rs (k << 1) + 2
#define lp ls, s, m
#define rp rs, m, e
int n;
vector<i64> st, lazyInc;
vector<int> lazyChange;
STree(int n) : n(n), st((n << 2) + 5), lazyInc((n << 2) + ... | ALGO | 0.999838 | 5.680068 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2024-06-30T04:52:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "129a90dbf44... |
5bc836e1-c942-4a2f-a1b5-ab1995b83b0f | Ignasrocas1990/CDD | lab10/map/hello.cpp | // This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or (at
// your option) any later version.
//
// This program is distributed in the hope that it will be useful... | ALGO | 0.941005 | 3.74171 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2021-10-04T08:33: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": "eaf1e1245ca... |
72978f13-8241-4d9b-a5fb-4d810c366056 | pythad/OOP2Course | LAB1/OpenGl/main.cpp | #include <glad/glad.h>
#include <GLFW/glfw3.h>
#include "glm/glm.hpp"
#include "glm/gtc/matrix_transform.hpp"
#include "glm/gtc/type_ptr.hpp"
#include "shader_m.h"
#include "camera.h"
#include "Cube.hpp"
#include "Prizma.hpp"
#include "Wall.hpp"
#include <iostream>
#include <fstream>
#include <vector>
void framebuf... | TOOL | 0.927353 | 4.663646 | {
"github_metadata": {
"branch": "LAB1",
"commit_count": 1,
"repo_created_at": "2018-03-30T06:34:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c850284e284... |
ec128b03-7477-49bb-9727-acf003ab9ad8 | Triovista/Parallel-Life-Hack-Game-Bot-Auto-Farm-Clicker-Crypto-Energy-Api-Cheat | Parallel-Life-Exp/src/GOF_benchmark.cpp | #include <iostream>
#include <chrono>
#include <array>
#include <cmath>
#include <iomanip>
#include <fstream>
#include "ParallelTorusAlgorithm.hpp"
#include "SequentialVectorTorusGOFAlgorithm.hpp"
#include "RandomFiller.hpp"
using namespace GameOfLife;
inline constexpr size_t PROCESSOR_OVERALL_WARMUP_ITERATIONS = 50... | ALGO | 0.996792 | 6.659595 | {
"github_metadata": {
"branch": "main",
"commit_count": 11510,
"repo_created_at": "2025-01-20T21:19:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4830e2763... |
ce22afc8-bda6-4732-aafc-bbdf7c7c96ca | Hami0095/Data-Structures-Stack | Asssignment01-task-5-part-A.cpp | // Task 5 :
#include<iostream>
#include<string>
#include<queue>
#include<stack>
#include<vector>
using namespace std;
/*
Create an object of the STL stack of type character. Use this stack to detect whether a string of
0’s and 1’s entered by the user is such a string that it is a repetition of a certain number of... | ALGO | 0.991024 | 4.976778 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2021-03-23T19:32:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a61d0db173e7... |
99563977-588e-4551-a403-57b637f66f0b | PulkitChangoiwala/CP | Templates/Tree & Graphs/Euler_Path_Graph/eulerian_path.cpp |
//Adjancey Matrix
class Euler_Tour_{
//euler tour is euler path which is cycle
//euler path is a path in graph, which traverse through all edges only once
int n,m;
int v1,v2,first;
vector<vector<int>> graph;
vector<int> euler_path; //contains euler cycle if euler cycle exists
vector<int> degree;
public:
Eule... | ALGO | 0.999948 | 3.489752 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2021-02-16T20:57: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": "5c80e3fcbf4... |
58b4b298-bb43-4638-9b7a-f90bf25c8aca | Jake-Weiner/Constraint_Decomp_Latest | src/Problem_Adapter.cpp | #include "Problem_Adapter.h"
#include "Decomp.hpp"
#include "fstream"
#include <map>
#include <utility>
#include <algorithm>
using pagmo::algorithm;
using pagmo::Decomp;
using pagmo::nsga2;
using pagmo::population;
using std::vector;
using std::ostream;
#define largest_sp_idx 0
#define num_con_relaxed_idx 1
typedef... | ALGO | 0.999744 | 4.201236 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2020-08-03T02:43: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": "827b571fc... |
7a929ce0-cda5-4384-9a83-75e88761ae77 | hhrny/CDistRange | CDistRange/CDistRangeAlgebra.h | #ifndef CDistRangeALGEBRA_H
#define CDistRangeALGEBRA_H
#include "StandardTypes.h"
#include "Symbols.h"
#include "DateTime.h"
#include "Stream.h"
#include "Attribute.h"
#include "DateTime.h"
#include "RectangleAlgebra.h"
#include "TupleIdentifier.h"
#include "TemporalAlgebra.h"
#include "Symbols.h"
#include "RTreeAlgeb... | ALGO | 0.998944 | 3.147403 | {
"github_metadata": {
"branch": "master",
"commit_count": 90,
"repo_created_at": "2016-11-09T15:42:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0a9f59c9... |
434c49f7-455c-47de-b9cb-b7b194e2e302 | moondemon68/cp | TOKI/OSN21/D1/A/7.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define INF 1234567890
#define pii pair<int,int>
#define LL long long
using namespace std;
int main () {
//clock_t start = clock();
ios_base::sync_with_stdio(false);
cin.tie(NULL);
... | ALGO | 0.999988 | 3.346427 | {
"github_metadata": {
"branch": "master",
"commit_count": 184,
"repo_created_at": "2018-09-17T12:29: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": "845e1426... |
eb2bf41a-0790-4c40-8ce4-6954becaad28 | Sirajmolla/Hacktoberfest-2022 | C++/Trapping Rain Water.c++ | // Problem Statement: Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.
// Link: https://leetcode.com/problems/trapping-rain-water/
#include <bits/stdc++.h>
using namespace std;
int trap(vector<int> &height)
{
int n = ... | ALGO | 0.99998 | 5.918151 | {
"github_metadata": {
"branch": "main",
"commit_count": 468,
"repo_created_at": "2022-09-28T08:09:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 126,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "c37f24e... |
239c1624-2528-44f2-a631-e1d9557f5785 | RfaelPadua/Exercicios-de-Algoritmos-Faculdade | 3_Periodo/3. Exercicio Listas Dinamicas/3. Exercicio Listas Dinâmicas.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct TipoItem{
int codigo;
char descricao[7];
float valor;
};
typedef struct TipoCelula* TipoApontador;
struct TipoCelula{
TipoItem item;
TipoApontador Prox;
};
struct TipoLista{
TipoApontador primeiro, ultimo;
};
void FazerListaV... | TOOL | 0.981379 | 4.193692 | {
"github_metadata": {
"branch": "main",
"commit_count": 148,
"repo_created_at": "2023-08-05T18:21:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9fba30eabd... |
b9f9b58a-dd81-49b2-a580-25f5db64b533 | RevealMind/itmo | discrete_math/term_1/lab_3/task_13.cpp | #include<bits/stdc++.h>
int n;
long long Fact(int n)
{
long long ans = 1LL;
for(int i = 2; i <= n; i++)
ans *= i;
return ans;
}
std :: vector<bool> arr(19, false);
void num2perm(long long k)
{
std :: vector<int> ans;
for(int i = 0; i < n; i++)
{
long long fact = Fact(n - i - 1);
... | ALGO | 0.999963 | 4.116696 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-07-13T19:02:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 103
},
"file_meta": {
"content_id": "c7c42c1... |
b2ab701f-2136-41ce-b7c8-1a32a8e04630 | jihwan0123/Algorithm | BOJ/gold5/boj_9663.cpp | // N-Queen
#include <bits/stdc++.h>
using namespace std;
int n, cnt;
bool used[32];
bool used_right[32];
bool used_left[32];
void func(int y)
{
if (y == n)
{
cnt++;
return;
}
for (int x = 1; x <= n; x++)
{
// x + y 가 같으면 right_diag, x - y가 같으면 left_diag가 같다. (-index 방지용 x - y + n)
if (used[x] ... | ALGO | 0.999961 | 4.278635 | {
"github_metadata": {
"branch": "master",
"commit_count": 301,
"repo_created_at": "2021-03-05T15:56: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": "24300c79... |
6d402a9e-5028-4211-b779-12d3503c1e62 | yxtj/PSGD | src/train/psgd_poc/PSGD_point.cpp | #include "PSGD_point.h"
#include "util/Timer.h"
#include <algorithm>
#include <numeric>
#include <cmath>
using namespace std;
void PSGD_point::init(const std::vector<std::string>& param)
{
PSGD_poc::init(param);
}
std::string PSGD_point::name() const
{
return "psgd_poc_point";
}
void PSGD_point::ready()
{
PSGD_p... | ALGO | 0.931876 | 5.881494 | {
"github_metadata": {
"branch": "master",
"commit_count": 476,
"repo_created_at": "2018-12-24T22:14:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd063327... |
574fdaa6-aa29-43a9-bb61-8d5e80cd6ff2 | i-am-sergio/competitive_programming | contest-27sep/4_Mirror_Mirror.cpp | // UVA 0466
#include <bits/stdc++.h>
using namespace std;
void fazt()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
}
string getEstado2(vector<string> & A, vector<string> & B) {
int n = A.size();
bool _90 = true, _180= true, _270 = true;
bool vertically = true, preserv =... | ALGO | 0.999964 | 5.249834 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-09-15T18:55: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": "a6aa32cc217... |
20e8c1c2-a052-46e4-87af-55ac36fadbb6 | klb3713/aoapc-book | TrainingGuide/exercises/ch1/DP/Uva10130.cc | // Uva10130 SuperSale
// 陈锋
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
inline bool isnum(char c)
{
return c >= '0' && c <= '9';
}
inline int readint()
{
char c = getchar();
while(!isnum(c)) c = getchar();
int data = c - '0';
while(isnum(c = getchar()))... | ALGO | 0.99984 | 3.422677 | {
"github_metadata": {
"branch": "master",
"commit_count": 198,
"repo_created_at": "2013-09-22T01:26:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 181,
"forks": 56,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "20348... |
9c4727de-2cc0-42ca-9c09-27c0d79e1675 | ianloic/unladen-swallow | Util/llvm/lib/Transforms/Scalar/InstructionCombining.cpp | //===- InstructionCombining.cpp - Combine multiple instructions -----------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | ALGO | 0.997513 | 6.093811 | {
"github_metadata": {
"branch": "llvm-re",
"commit_count": 443,
"repo_created_at": "2009-08-18T18:14:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "701aaf5... |
5fb7cef9-c449-4f20-9fd6-96db0dc8bd5c | izlyforever/cf | contest/1651/c/c.cpp | #include <bits/stdc++.h>
#define cerr(x) std::cerr << (#x) << " is " << (x) << '\n'
using LL = long long;
LL f(std::vector<LL> a, std::vector<LL> b) {
LL ans = abs(a[0] - b[0]);
int ax = a.back(), bx = b.back();
{
LL tmp = INT64_MAX;
for (auto x : b) {
tmp = std::min(tmp, abs(x - ax));
}
an... | ALGO | 0.999972 | 5.157266 | {
"github_metadata": {
"branch": "master",
"commit_count": 306,
"repo_created_at": "2021-02-20T10:51:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f656f19... |
9a7b75a7-1c4b-4d33-bc01-a920e82156b5 | NaturezzZ/SpeedMonitor | init/BurstMonitor.h | #include "BOBHash32.h"
#include "CorrectBurstDetector.h"
#define START_SPEED 8
#define LEV_NUM 1024
uint32_t BUCK_NUM = (1000);
#define HASH_NUM 1
#define BURST_THRE 100*unittime
#define DECAY 1
#define stair 8
#define DECAY_CYCLE (unittime/4)
#define LEV 1.1
#define BURST_LEV 5
#define ULMAX (0xffffffffffffffffUL)
cla... | ALGO | 0.967379 | 3.836292 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2020-03-02T15:46:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17f8b6a2d... |
c0ca9845-7df0-45ef-a614-324e49458ade | vsupacha/tensailab-embc | skeletonMbed/mbed-os/features/lorawan/lorastack/mac/LoRaMacCrypto.cpp | /**
* / _____) _ | |
* ( (____ _____ ____ _| |_ _____ ____| |__
* \____ \| ___ | (_ _) ___ |/ ___) _ \
* _____) ) ____| | | || |_| ____( (___| | | |
* (______/|_____)_|_|_| \__)_____)\____)_| |_|
* (C)2013 Semtech
* ___ _____ _ ___ _ _____ ___ ___ ___ ___
* / __|_ ... | ALGO | 0.957801 | 6.474713 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2018-05-09T11:29:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 9,
"issues": 0,
"pull_requests": 12
},
"file_meta": {
"content_id": "a93a127b... |
d41bfd10-a2e8-4939-a12a-b8574bcecf6a | ZEUSRPA/CompetitiveProgramming | Training/Codeforces/ITMO Course/Two Pointers/NumberOfSmaller.cpp | #include <bits/stdc++.h>
#define ENDL '\n'
#define deb(u) cout << #u " : " << (u) << ENDL;
#define deba(alias, u) cout << alias << ": " << (u) << ENDL;
#define debp(u, v) cout << u << " : " << v << ENDL;
#define pb push_back
#define F first
#define S second
#define lli long long
#define ld long double
#define pii pair<... | ALGO | 0.999998 | 3.53443 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-02-17T17:25: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": "47c9e4c6e24d... |
93a5eec7-2230-4b66-912e-77dbba5ca2a8 | the-redback/competitive-programming | workspace/main.cpp | /***
* ____
* ____ ___ ____ ________ __/ __/
* / __ `__ \/ __ `/ ___/ / / / /_
* / / / / / / /_/ / / / /_/ / __/
* /_/ /_/ /_/\__,_/_/ \__,_/_/
*
* @link : https://maruftuhin.com
*/
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;... | ALGO | 0.999986 | 4.689607 | {
"github_metadata": {
"branch": "master",
"commit_count": 207,
"repo_created_at": "2015-05-31T20:55: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": "9c36a872... |
2f9f17d1-ff44-47d4-9cfb-c22d664f70f3 | mmm-da/archive | 2019/op_res/simplex_table/Simplex_shtraf.cpp | #include "pch.h"
#include "Simplex_shtraf.h"
#include <iostream>
#include <iomanip>
long search(long* a, long n, long k)
{
for (long i = 0; i < n; i++)
if (a[i] == k) return i;
return -1;
}
long check(long* a, long n, long k, long* j)
{
for (long i = 0; i < n; i++)
if (k == a[i]) {
*j = i;
return 1;
}
... | ALGO | 0.999729 | 3.718723 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2019-02-10T13:22:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 6
},
"file_meta": {
"content_id": "374497246... |
f65b4c9f-bfe7-4bd8-900b-de63fff2db0c | Cudd1es/eight_puzzle | test.cpp | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<queue>
#define COL 3
#define MAXSTEP 70
using namespace std;
void output(int [][COL]);/*输出函数*/
void input(int [][COL]);/*输出函数*/
int Astar(int [][COL], int [][COL], int, int path[]);/*核心函数,起始,终止,深度,方向*/
bool eq(int... | ALGO | 0.999866 | 3.580268 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-10-26T07:11: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": "ce4599fd49... |
8024546c-dc15-47ff-919a-1c0b62297300 | jimmy706/CauTrucDuLieu | lib/PLISTLIB.CPP | #include<stdio.h>
#include<conio.h>
#include<malloc.h>
typedef int ElementType;
typedef struct Node{
ElementType Element;
Node* Next;
};
typedef Node* Position;
typedef Position List;
//Create a null list
void MakeNullList(List *Header){
(*Header) = (Node*)malloc(sizeof(Node));
(*Header)->Next = NULL;
}
//Check e... | ALGO | 0.996743 | 3.27182 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2018-08-31T08:02:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e85e7e1cf... |
4223c358-3472-4cd5-803f-dd1a26b492b3 | MethodJiao/OCCGraphicDemo | OpenCASCADE/ProjLib_ComputeApproxOnPolarSurface.hxx | // Created on: 1994-10-07
// Created by: <NAME>
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser ... | TOOL | 0.993309 | 6.641582 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-01-04T03:52:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 39,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f8d0c362... |
ee1fb8ff-f745-4bc9-a4ef-6eabce026aa2 | GoblinJay/CSE2010 | Homework/Homework2/Homework2a.cpp | /*
<NAME>
File Name: Homework2a
Date: 10/11/23
File Description: Question 9 for Homework 2. Implements the factorial function */
#include <iostream>
#include <cmath>
using namespace std;
//function to determine factorial of number
int factorial(int n){
int f = 1;
for (int i = 1; i <= n; ++i){
f *= i;
... | ALGO | 0.999068 | 4.430976 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-01-24T07:35: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": "c132c0c3a889... |
d7fc015d-918c-4ab9-a12d-36967a3a5ea3 | shubham21699/My-LeetCode-Solutions | 210-course-schedule-ii/210-course-schedule-ii.cpp | class Solution {
public:
vector<int> findOrder(int numCourses, vector<vector<int>>& prerequisites) {
int n = prerequisites.size();
vector<int> result;
vector<int> indegree(numCourses); // indegree[i] denotes no. of prerequisite courses for ith course
vector<vector<int> > gra... | ALGO | 0.999979 | 6.5005 | {
"github_metadata": {
"branch": "master",
"commit_count": 3720,
"repo_created_at": "2022-01-07T07:56: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": "2c1dc54... |
28481e75-bd8f-4180-b880-51e023df5e0f | nausheen-ali/CPP | quick_sort/main.cpp | #include <iostream>
#include <utility>
#include <cstdlib>
#include <ctime>
using namespace std;
void quicksort(int a[], int length);
void quicksort_recursion (int a[], int low, int high);
int partition (int a[], int low, int high);
int main()
{
int length;
cout << "Enter number of elements: ";
cin >> le... | ALGO | 0.999829 | 5.548693 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2025-06-27T05:23: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": "d1890accc95... |
db970914-1e23-4d09-87d2-b527ff187709 | shubham21699/My-LeetCode-Solutions | 228-summary-ranges/228-summary-ranges.cpp | class Solution {
public:
vector<string> summaryRanges(vector<int>& nums) {
int n = nums.size();
if(n == 0) return {};
if(n == 1) return { to_string(nums[0]) };
vector<string> result;
if(n == 2) {
string s = "";
i... | ALGO | 0.999979 | 6.421813 | {
"github_metadata": {
"branch": "master",
"commit_count": 3720,
"repo_created_at": "2022-01-07T07:56: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": "1d4db0a... |
942066d5-e97b-4d0b-8385-842be235b34e | kchu-z/arena | 2022.12.18/table.cpp | #include <bits/stdc++.h>
using namespace std;
pair <int, int> delta[] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int m, n;
cin >> m >> n;
vector <vector <int>> arr(m + 2, vector <int> (n + 2));
vector <vector <bool>> che... | ALGO | 0.999995 | 3.603273 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-09-01T08:15: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": "d73d169e60... |
5157438f-7a80-4656-86f0-76ab54417704 | lumeng16/ProjectCode | LP/SSN.cpp | //
// Created by <NAME> on 2018/12/2.
//
#include "NU_ACDM.h"
#include "LP.h"
#include "LPuse.h"
#include "../use/Matrix.h"
#include "../use/DataRW.h"
#include "CG.h"
#include "LS_exact.h"
#include "SSN.h"
int main() {
std::string root_directory = "/Users/lumeng/Desktop/CCode/LP/data";
const std::string all_e... | ALGO | 0.998128 | 4.94628 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-03-17T13:11: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": "c072489092... |
c88d91ae-2221-4008-b9cc-1ccb919c1f76 | Vivekrathore2002/DSA-Coding | Tree from Postorder and Inorder - GFG/tree-from-postorder-and-inorder.cpp | //{ Driver Code Starts
/* program to construct tree using inorder and postorder traversals */
#include <bits/stdc++.h>
using namespace std;
/* A binary tree node has data, pointer to left child
and a pointer to right child */
struct Node {
int data;
struct Node* left;
struct Node* right;
Node(int x... | ALGO | 0.999855 | 6.37806 | {
"github_metadata": {
"branch": "main",
"commit_count": 1805,
"repo_created_at": "2023-03-22T13:58:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8577d407b... |
9a104d35-f795-4ce5-82b0-cc02c5727ea9 | csubhasundar/CodingPractice-Hacktoberfest23 | C++/DFS.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
private:
void dfs(int node, vector<int> adj[], int vis[], vector<int> &ls) {
vis[node] = 1;
ls.push_back(node);
// traverse all its neighbours
for(auto it : adj[node]) {
// if the neighbour is not visite... | ALGO | 0.999997 | 6.256717 | {
"github_metadata": {
"branch": "main",
"commit_count": 221,
"repo_created_at": "2023-10-01T03:13:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 31,
"forks": 289,
"issues": 0,
"pull_requests": 77
},
"file_meta": {
"content_id": "01b43f... |
e940f2d0-2e5c-43b6-b0f3-ed9af05221b3 | rwollman/NUPACK | src/source/external/boost-simd/include/boost/simd/arch/common/detail/scalar/d_invtrig.hpp | //==================================================================================================
/*!
@file
@copyright 2016 NumScale SAS
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
//===========================... | ALGO | 0.973746 | 6.604925 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2021-07-08T21:09:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c6e180953... |
b1e06bf4-b7c9-4008-ad94-e31ccfc2e213 | yhjin1096/study | cpp_prac/src/cpp_prac/src/5_reference.cpp | #include "cpp_prac/header.h"
void swap(int &ref1, int &ref2)
{
int tmp;
tmp = ref1;
ref1 = ref2;
ref2 = tmp;
}
int main()
{
// num2는 num1을 참조하는 reference
// 10을 저장한 메모리에 접근할 수 있는 변수 이름이 2개인 것임
int num1 = 10;
// 이때 &은 주소연산자가 아닌 참조연산자
// 이미 선언된 변수에 사용하면 주소연산자, 선언시 사용하면 참조연산자
int... | ALGO | 0.980278 | 4.351138 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2024-02-15T01:24: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": "f5378dab8... |
50e84012-b95e-4409-9a29-609a988efb6f | louisfghbvc/Other-Online-Judge | CodeForces/Round #664 (Div 2)/D - Boboniu Chats with Du.cpp | // so the key point is max the value.
// so when pick big. if will occur d+1 days.
// but if u put big in the last, it can just 1 days.
// why is (i-1)*(d+1) + 1 ? only 1 big. the day is 1.
// and two big. the day is 1 + (d+1).
// .... big.size(). the day is 1 + (d+1)*size.
// careful day can't > n. the total length.
... | ALGO | 0.999918 | 3.762786 | {
"github_metadata": {
"branch": "master",
"commit_count": 837,
"repo_created_at": "2018-10-29T11:02:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d28e6a4... |
c3b2f148-fc3c-4bd8-bb4d-dc66f368c24f | AutumnKite/Codes | Codeforces/1560F2 Nearest Beautiful Number (hard version)/std.cpp | #include <bits/stdc++.h>
int calc(std::string s) {
std::vector<bool> vis(10);
for (char c : s) {
vis[c - '0'] = true;
}
return std::accumulate(vis.begin(), vis.end(), 0);
}
void solve() {
std::string s;
std::cin >> s;
int lim;
std::cin >> lim;
if (calc(s) <= lim) {
... | ALGO | 0.999593 | 5.795063 | {
"github_metadata": {
"branch": "master",
"commit_count": 683,
"repo_created_at": "2019-08-18T00:53:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "079cb577... |
94c80c40-8fc0-4297-b5a5-b83be948ed43 | Fraunhofer-AISEC/ReCFI | llvm/lib/CodeGen/MachineScheduler.cpp | //===- MachineScheduler.cpp - Machine Instruction Scheduler ---------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | ALGO | 0.95128 | 7.678352 | {
"github_metadata": {
"branch": "main",
"commit_count": 316383,
"repo_created_at": "2021-11-12T14:37:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "bed1b105... |
51992000-b7b1-4a7e-b829-665e7398dca8 | zengbaocheng-996/C | 17/17.6/1-MergeSort/main.cpp | #include<stdio.h>
#include<stdlib.h>
#define N 7
typedef int ElemType;
//合并两个有序数组
void Merge(ElemType *A, int low, int mid, int high) {
static ElemType B[N];//加static的目的是无论递归调用多少次,都只有一个B[N]
int i, j, k;
for (i = low; i <= high; i++)//把A[i]里的元素都给B[i]
{
B[i] = A[i];
}
k=low;
for(i=lo... | ALGO | 0.999982 | 4.048779 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-02-26T23:44: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": "ee4d05866d9... |
065824b7-9dcf-489a-b655-65c448fe0329 | paavansaireddy/BezierCurves | main.cpp | #include <chrono>
#include <iostream>
#include <opencv2/opencv.hpp>
std::vector<cv::Point2f> control_points;
std::vector<cv::Point2f> intermediate_points;
void mouse_handler(int event, int x, int y, int flags, void *userdata)
{
if (event == cv::EVENT_LBUTTONDOWN && control_points.size() < 4)
{
std::... | ALGO | 0.996894 | 6.226376 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-03-16T15:35: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": "6b418c5302ab... |
6e03e913-2e67-4d95-ac72-24ce97744f4f | vartulbiet/uva | uva_10871.cpp | #include<iostream>
#include<vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <string>
#include <queue>
#include <sstream>
#include <iostream>
#include<string.h>
#include <io... | ALGO | 0.999751 | 3.385911 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-07-09T06: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": "fb300ac435... |
366a4b7a-11c6-43d2-942f-7e7847320a74 | sanjusss/leetcode-cpp | 0/0/10/18.hpp | /*
* @Author: sanjusss
* @Date: 2020-10-05 07:32:13
* @LastEditors: sanjusss
* @LastEditTime: 2020-10-05 09:20:55
* @FilePath: \0\0\10\18.hpp
*/
#pragma once
#include "leetcode.h"
// class Solution {
// public:
// vector<vector<int>> fourSum(vector<int>& nums, int target) {
// vector<vector<int>> an... | ALGO | 0.999707 | 5.997167 | {
"github_metadata": {
"branch": "master",
"commit_count": 2055,
"repo_created_at": "2019-04-04T03:17:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ecf6ae3... |
fefb49d7-bacd-45f9-99f7-b0345e2f3df6 | dhineshmuthukaruppan/my_solution__competitive_programming | hackerrank_datastructure/2 2d array - ds hour glass E15.cpp | #include <bits/stdc++.h>
using namespace std;
// Complete the hourglassSum function below.
int hourglassSum(vector<vector<int>> arr) {
int result = -32768000;
for(int i=0; i<arr.size() - 2; i++){ // iterate through rows
for(int j=0; j<arr[0].size() - 2; j++){ // iterate through columns
... | ALGO | 0.999837 | 4.983689 | {
"github_metadata": {
"branch": "master",
"commit_count": 908,
"repo_created_at": "2020-03-11T12:03: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": "361cb5b1... |
0adbcf3b-4b0a-4036-88f0-aeda239bcdd6 | raincross7/code-similarity | codes/train_code/problem440/problem440_298.cpp | #include <cstdio>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <algorithm>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <tuple>
#include <assert.h>
#include <deque>
#include <bitset>
#include <iomanip>
#include <limit... | ALGO | 0.999238 | 4.351794 | {
"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": "cae8f6a71264... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.