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 |
|---|---|---|---|---|---|---|---|
db999c19-29f0-4e6d-b8b7-082c8d97a5f0 | Paras-Gherwada/leetcode | find_lucky_integer_in_an_array.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
int findLucky(vector<int>& arr) {
int size = *max_element(arr.begin(), arr.end()) + 1;
vector<int> lucky(size, 0);
// cout << endl << "Size : " << size;
for(int val : arr)
++luc... | ALGO | 0.999726 | 4.377986 | {
"github_metadata": {
"branch": "master",
"commit_count": 90,
"repo_created_at": "2021-08-09T06:05:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc1f2365a... |
38e02a7f-41b7-4d2c-83e4-f7e7e11318ea | hzhou/usaco | 1612/harry/moocast_gold.cpp | //<NAME>
//more than 1hr
//11-9-2019
//In the end, it was because I didn't use a reference in the capture
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <limits.h>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <... | ALGO | 0.999913 | 3.690032 | {
"github_metadata": {
"branch": "master",
"commit_count": 266,
"repo_created_at": "2019-03-24T18:04:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ae4393... |
7daf1347-0423-4df0-ab04-f84f92b6252c | ou3slati/competitive-programming | Implementations/IOI 2022 Prep/Training/[prep][#6]/B.cpp | //Never stop trying
#include "bits/stdc++.h"
using namespace std;
#define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
typedef long long ll;
#define int ll
typedef string str;
typedef long double ld;
typedef pair<int, int> pi;
#define fi first
#define se second
typedef vector<int> vi;
typedef vector... | ALGO | 0.999977 | 3.825827 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2025-06-30T20: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": "8037aed78a8... |
afbd4df7-c9e0-4cd6-86a2-f2e08b5ef39e | dvt4523/CodingPractices | Misc/PalindromicSeries/main.cpp | #include <iostream>
using namespace std;
bool checkPalindrome(string str) {
int len = str.length();
for (int i = 0; i < len / 2; i++) {
if (str[i] != str[len - i - 1])
return false;
}
return true;
}
string stringConstruct(string str, int len) {
string result;
int index;
... | ALGO | 0.999972 | 4.542641 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2023-03-03T04:13: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": "a83c6c720... |
86cf5f88-7fe4-455f-812c-e2507cb2d779 | ashok2811/DS | stack_linked_list_reverse.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node* next;
};
struct Node* Insert(struct Node* head, int data, int n){
Node* temp1 = new Node();
temp1 -> data = data;
temp1 -> next = NULL;
if (n==1)
{
temp1 -> next = head;
head =temp1;
return head;
}
Node* temp2 = head;
fo... | ALGO | 0.99989 | 4.21724 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-07-31T05:24: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": "5c38217ab... |
7f98f794-adbd-4443-bc5f-10b006f35ab2 | maparham/flow_update | src/main.cpp | #define OMP 0
#include <stdio.h>
#include <execinfo.h>
#include <gurobi_MIP.hpp>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
#include <algorithm>
#include <time.h>
#if OMP
#include <omp.h>
#endif
#include "testcases.hpp"
#include "Saeed_alg.hpp"
#include "gurobi_MIP.hpp"
#include<all_flowpairs.hpp>
#in... | ALGO | 0.999204 | 4.047957 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2017-10-06T08:29:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0cf822e83... |
e3de959e-8676-43d9-9f2f-befd54316ca5 | gfouzie/Data-Structures-and-Algorithms | Sequential and Doubly Linked List/doubly-linked-list.cpp | #include "doubly-linked-list.h"
#include <iostream>
using namespasce std;
//define the doubly linked list with the given data
DoublyLinkedList::Node::Node(DataType data)
{
value = data;
}
//constructor
DoublyLinkedList::DoublyLinkedList()
{
//start with nothing meaning that the head/tail are null and the size... | ALGO | 0.998969 | 5.628623 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-12-29T20:17: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": "8f7515cd16fe... |
a8e521b7-fa8d-4db1-8190-4f3a044de745 | alexandraback/datacollection | solutions_1482494_1/C++/moshiur/B.cpp | #include<stdio.h>
#include<string.h>
#include<math.h>
#include<ctype.h>
#include<stdlib.h>
#include<time.h>
#include<assert.h>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
#define FOR(i,n) for(int i=0;i<(n);+... | ALGO | 0.99992 | 3.441465 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "87539f0d6... |
13e21c7f-40ee-4deb-a20e-f26420c0529c | achilles99500/Graph-Algorithms-Applications | maze_solver.cpp |
#include <bits/stdc++.h>
using namespace std;
using Coord = pair<int,int>;
const vector<int> dR = {1,-1,0,0}; // row offsets
const vector<int> dC = {0,0,1,-1}; // col offsets
/*------------------------------------------------------------
1. Is there any path? – Breadth-First Search
------------------------... | ALGO | 0.99996 | 5.251931 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-07-06T08:21: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": "c342201bc67f... |
707dfac3-a8c3-4f81-91fd-73690328e06b | arthur-bouton/TF_ODE | src/rover_1_mt.cc | #include "rover_mt.hh"
using namespace ode;
using namespace Eigen;
using namespace std;
namespace robot
{
Rover_1_mt::Rover_1_mt( Environment& env, const Vector3d& pose, const std::string yaml_file_path_1, const std::string yaml_file_path_2,
bool oblique_trees, unsigned int degree, bool in... | ALGO | 0.990025 | 4.70795 | {
"github_metadata": {
"branch": "master",
"commit_count": 124,
"repo_created_at": "2019-11-10T21:12:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cbd99968... |
b5c3ae73-ef76-4fb7-b783-58dfd8495812 | dh5252/PS | 백준/Gold/10868. 최솟값/최솟값.cc | #include <iostream>
#include <string>
#include <vector>
#include <cstring>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <set>
#include <limits.h>
#include <list>
#include <stack>
#include <unordered_set>
#define ABS(x) ( ((x)<0)?-(x):(x) )
#define MAX_SIZE 100001
using namespace std;
... | ALGO | 0.999998 | 4.828113 | {
"github_metadata": {
"branch": "main",
"commit_count": 286,
"repo_created_at": "2022-07-03T10:51: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": "16429daacb... |
2744b593-bed7-4714-839d-e9593f1b32a2 | jerebenitez/IFE-simpact-openfoam | src/quadl/gaus17.inc | SUBROUTINE gaus17(heade,coord,istop,gauss,angdf,ntype,ngaus,as)
!-------------------------------------------------------------------
!--- evaluates gauss points constants for shell element 17
!--------------------------------------------------------------------
IMPLICIT NONE
INTEGER (kind=4), INTENT(IN) :: ntype... | ALGO | 0.964139 | 3.622325 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2019-08-29T20:55: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": "0ef16a60d... |
08d2d398-7ee8-43a2-94c8-a9f84ce16b14 | StevenL2017/Codeforces | problem/archive/1778/1778A.cpp | #include <iostream>
#include <cstdio>
#include <climits>
#include <cmath>
#include <cstring>
#include <string>
#include <array>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <algorithm>
#include <functional>
using namesp... | ALGO | 0.999829 | 4.182819 | {
"github_metadata": {
"branch": "master",
"commit_count": 1534,
"repo_created_at": "2022-09-26T06:10:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b430e5... |
58176fdf-7a79-49c1-909a-63a659ec94d0 | Simple-Robotics/proxsuite | include/proxsuite/linalg/dense/update.hpp | /** \file */
//
// Copyright (c) 2022 INRIA
//
#ifndef PROXSUITE_LINALG_DENSE_LDLT_UPDATE_HPP
#define PROXSUITE_LINALG_DENSE_LDLT_UPDATE_HPP
#include "proxsuite/linalg/dense/core.hpp"
namespace proxsuite {
namespace linalg {
namespace dense {
namespace _detail {
inline auto
bytes_to_prev_aligned(void* ptr, usize alig... | TOOL | 0.992888 | 7.776758 | {
"github_metadata": {
"branch": "devel",
"commit_count": 2050,
"repo_created_at": "2022-05-05T16:01:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 479,
"forks": 61,
"issues": 17,
"pull_requests": 1
},
"file_meta": {
"content_id": "c426b... |
253c04c3-17cd-4dbe-ba05-8345531f5b62 | igorjoz/potyczki-algorytmiczne | 2021/[B]ora.cpp | #include <iostream>
#include <set>
using namespace std;
int main()
{
int n, requiredUnique;
int totalTime = 0;
set<int> uniqueNums;
cin >> n >> requiredUnique;
int* nums = new int[n];
for (int i = 0; i < n; i++) {
cin >> nums[i];
}
int replaceIndex = 1, replaceIndexNum = nums[1];
uniqueNums.insert(nums[0]... | ALGO | 0.999931 | 4.175398 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2021-03-31T19:03:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ceb2f3a1... |
0483f16f-89fb-47a0-a784-0c1ca6e04c83 | SeanStarkey/uva | uva10038.cpp | /**
* UVa Online Judge - Problem 10038 - <NAME>
*/
#include <iostream>
#include <vector>
#include <algorithm>
int absDiff(int x, int y)
{
if (x < y)
return y - x;
else
return x - y;
}
int main()
{
while (std::cin.good())
{
unsigned numberOfInts;
std::cin >> numberOfI... | ALGO | 0.999459 | 3.945314 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2012-06-22T18:35: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": "47d7498f7... |
9c21369c-ba11-48fa-b85b-2aae530d27a1 | ssolaric/leetcode-patterns | DFS/Easy/lc111-minimum-depth-of-binary-tree-dfs.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.999834 | 6.171114 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2020-06-12T16:40:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bfd29e370... |
f4656dc7-5593-40bb-8323-c21ac221f59d | storabic/algorithms | scc_horse.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
bool sortComponentsByName(vector<string> c1, vector<string> c2)
{
return c1[0] < c2[0];
}
void dfs1(const vector<vector<bool>>& r, vector<bool>& used, vector<int>& order, int n, int v)
{
used[... | ALGO | 0.999951 | 4.874249 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-05-30T09:29:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ef2a5fadc... |
e99f19f9-d653-4894-a302-6161ef0f9522 | apple/turicreate | src/external/boost/boost_1_68_0/boost/geometry/algorithms/union.hpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2014 <NAME>, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2014, 2017.
// Modifications copyright (c) 2014-2017 Oracle and/or its affiliates.
// Contributed and/or modified by <NAME>, on behalf of Oracle
// Contributed a... | ALGO | 0.957466 | 7.825168 | {
"github_metadata": {
"branch": "main",
"commit_count": 1571,
"repo_created_at": "2017-12-01T00:42:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11198,
"forks": 1137,
"issues": 502,
"pull_requests": 21
},
"file_meta": {
"content_id": "... |
00969342-a0b6-428d-af9b-031ee948c464 | jkuzm/2020repo | BinaryTreeAlgs/BinaryTreeAlgs.cpp | // BinaryTreeAlgs.cpp : This file contains the 'main' function. Program execution begins and ends there.
// I'll skip questions with all those inorder, preorder, postorder traversals (depth first)
// will implement only level order that I prefer for visual tree presentation
#include <iostream>
#include "BinarySearchTr... | ALGO | 0.999774 | 3.769426 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-03-07T21:23: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": "65a96111d... |
2f5f9bae-5c03-4402-bbf3-4b3d3a4a1080 | upesacm/21DaysOfCode-2024 | DSA/Devansh-Nishchal-Mandloi/day16que1.cpp | #include <iostream>
#include <vector>
using namespace std;
// Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode* left;
TreeNode* right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
// Function to perform postorder traversal.
void postorderTraversal(TreeNode* root, vecto... | ALGO | 0.999929 | 6.726123 | {
"github_metadata": {
"branch": "main",
"commit_count": 5391,
"repo_created_at": "2024-06-21T06:40:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 114,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8975fd14... |
e6c154f6-e317-48d6-9ace-3ef58cf0a37b | unisa-hpc/synergy-sc-ae | training-dataset/micro/ArithMixedUnitOp.cpp | #include <iostream>
#include <vector>
#include <sycl/sycl.hpp>
using namespace sycl;
template <typename ValueType, size_t AddPerc, size_t MulPerc, size_t DivPerc, size_t SpecPerc>
void run(size_t n, size_t compute_iters)
{
sycl::queue q(gpu_selector_v);
std::vector<ValueType> a(n);
std::vector<ValueType> c1(n... | ALGO | 0.994858 | 5.995742 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2023-05-29T14:34:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8cabb6dc66c8... |
11ed0f6b-7ef0-49d5-b46c-ff29da13b37d | LinusHenke99/openfhe-mnist-test | apps/mnist_inference_very_sensible_model.cpp | #include <iostream>
#include <vector>
#include <string>
#include "openfhe.h"
#include "LinTools.h"
#include "Deserialize.h"
#include "LoadModel.h"
#include "LoadImage.h"
using namespace lbcrypto;
const std::string MODEL_PATH = "../model/very_sensible_nn/";
const std::string PATH_TO_IMAGE = "../img/very_sensible_nn/"... | DATA | 0.966957 | 4.716712 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2023-02-02T15:13: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": "5a8abec08b1... |
2ecf8d94-1727-4b17-b234-01456421644f | rahulx64/DSA_CP_TEMPLATES | segment_tree.cpp | #include <iostream>
#include <vector>
using namespace std;
class SegmentTree {
private:
vector<int> tree;
int n;
// Build the tree
void buildTree(const vector<int>& arr, int node, int start, int end) {
if (start == end) {
// Leaf node will have a single element
tree[no... | ALGO | 0.999981 | 6.918051 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2024-08-21T05:41: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": "0e34cede6b8... |
c4f23cce-a03b-4466-8367-16f1041fa779 | yjl9903/XCPC | Codeforces/edu96/b.cpp | #include <iostream>
#include <cstdio>
#include <cassert>
#include <cstring>
#include <cmath>
#include <functional>
#include <algorithm>
#include <utility>
#include <vector>
#include <string>
#include <map>
#include <set>
#define ms(a,b) memset(a,b,sizeof(a))
using namespace std;
using ll = long long;
using PII = pair<i... | ALGO | 0.999944 | 4.678896 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-03-25T19:33:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3fe84e999793... |
e19b2dd9-3316-4b75-a338-064ae9e0ba9a | himakiran/CarND-Extended-Kalman-Filter-Project | src/tools.cpp | #include "tools.h"
#include <iostream>
using Eigen::VectorXd;
using Eigen::MatrixXd;
using std::vector;
using std::cout;
using std::endl;
Tools::Tools() {}
Tools::~Tools() {}
VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations,
const vector<VectorXd> &ground_truth) {
/*... | ALGO | 0.983157 | 5.855513 | {
"github_metadata": {
"branch": "master",
"commit_count": 116,
"repo_created_at": "2019-02-18T15:50: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": "1fff2805... |
8d16b100-d354-42f5-acb0-7297e11309c9 | artfin/classical-trajectories | MPI_TRAJ/src/MISC/mcmc_generator.cpp | #include "mcmc_generator.hpp"
MCMC_generator::MCMC_generator( std::function<double(VectorXd)> f,
Parameters& parameters,
vector<pair<int, double>>& to_wrap ) :
parameters(parameters),
subchain_length(subchain_length),
to_wrap(to_wrap),
f(f)
{
}
MCMC_generator::~MCMC_generator()
{
}
doubl... | ALGO | 0.994701 | 5.797924 | {
"github_metadata": {
"branch": "master",
"commit_count": 243,
"repo_created_at": "2017-03-05T17:10:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1621ac7f... |
7b53681c-b8d3-4937-b3c6-71375896d435 | blender/blender | extern/ceres/internal/ceres/single_linkage_clustering.cc | // Ceres Solver - A fast non-linear least squares minimizer
// Copyright 2023 Google Inc. All rights reserved.
// http://ceres-solver.org/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of so... | ALGO | 0.999961 | 6.705271 | {
"github_metadata": {
"branch": "main",
"commit_count": 152123,
"repo_created_at": "2019-10-09T12:47:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 15670,
"forks": 2395,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5... |
9118e5ba-8676-4e17-b1ff-0556e3614403 | Leijoma/spirit_ap | spirit AP/src/pid.cpp | #include "PID.h"
#include "logger.h"
PID::PID(float kp, float ki, float kd, float outputMin, float outputMax, bool degrees)
: _degrees(true) ,_kp(kp), _ki(ki), _kd(kd), _integral(0), _previousError(0), _outputMin(outputMin), _outputMax(outputMax), _integralWindupLimit(outputMax), _zeroLimit(0) {}
void PID::setTun... | ALGO | 0.97795 | 5.704746 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-05-17T13:22: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": "18f84e53828c... |
9c82f1ee-8e5c-4ccc-b720-39241e1c2671 | shriramch/SInversion | rgf2.cpp | #include "rgf2.hpp"
/**
* @brief Performs a two-sided RGF inversion on a given matrix.
*
* This function performs a two-sided RGF inversion on a given matrix. The
* inversion is performed in parallel using MPI, with different processes
* handling different halves of the matrix.
*
* @param A The matrix on which ... | ALGO | 0.999788 | 5.003521 | {
"github_metadata": {
"branch": "main",
"commit_count": 139,
"repo_created_at": "2023-10-25T17:10:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71a3f89188... |
977b26d5-aada-404a-a07a-be48e2dc7460 | PeeKoo87/PortfolioWebsite | assets/CodeExamples/ChessAI/Main.cpp | #include <iostream>
#include "Position.h"
#include "Move.h"
#include <vector>
#include <string>
#include <chrono>
using namespace std;
using namespace std::chrono;
int PieceColor(int piece)
{
switch (piece)
{
case wR: case wN: case wB: case wQ: case wK: case wP:
return WHITE;
break;
... | ALGO | 0.983537 | 4.785766 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2025-01-06T19:02: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": "159ccbf1e04... |
6cbc37b0-48ba-4323-b03b-a0f45366080a | Pyramiding/CodingInterview | 剑指offer/49.丑数.cpp | //
// Created by W on 2019/3/5 0005.
//
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
using namespace std;
//
// NowCoder提交格式
//
class Solution {
public:
int GetUglyNumber_Solution1(int index) {
if(index <= 0)
return 0;
vector<int> uglyNumbers(index, 1);
... | ALGO | 0.999947 | 4.732655 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-05-27T14:27: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": "b9f4ef4a38... |
711cd255-213e-43c3-b73c-c7c4938b154a | ixray-team/ixray-1.6-stcop | src/xrCore/_sphere.h | #ifndef _F_SPHERE_H_
#define _F_SPHERE_H_
template <class T>
struct _sphere {
_vector3<T> P;
T R = 0;
public:
IC void set(const _vector3<T> &_P, T _R) { P.set(_P); R = _R; }
IC void set(const _sphere<T> &S) { P.set(S.P); R=S.R; }
IC void identity() { P.set(0,0,0); R=1; }
enum ERP_Result{
rpNone ... | ALGO | 0.97248 | 5.486146 | {
"github_metadata": {
"branch": "default",
"commit_count": 2678,
"repo_created_at": "2019-06-29T15:22:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 232,
"forks": 47,
"issues": 43,
"pull_requests": 2
},
"file_meta": {
"content_id": "a13... |
e037246d-4ec6-4781-996b-7e683b005118 | bharatchudasama/asksenior | stl/J next element.cpp | // Problem: J. Next Element
// Contest: Codeforces - Standard #2 (binary search , stack , queue, deque , priority queue)
// URL: https://codeforces.com/group/c3FDl9EUi9/contest/263096/problem/J
// Memory Limit: 256 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)
// Problem: L. Diverse Team... | ALGO | 0.9999 | 4.682218 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-04-18T05:36: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": "1887aca0324d... |
9dba85c0-bcfb-490f-9102-c58dd90198b1 | surya3214/coding | Codeforces/ThreeBlocksPalindrome.cpp | // AC Adhoc, Palindrome
#include <bits/stdc++.h>
#define BUFFER 5
#define BUFF(x) x + BUFFER
#define POS_MAX (int) 2e5
#define TYPE_MAX 200
#define mp make_pair
// #pragma GCC optimize "O4"
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int, int> pii;
typedef pair<string... | ALGO | 0.999827 | 3.994362 | {
"github_metadata": {
"branch": "master",
"commit_count": 86,
"repo_created_at": "2017-11-09T17:29: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": "c2537a3b1... |
5ddb1199-31fe-4934-83a2-68112d8cd68d | elador/FeatureDetection | libRender/src/render/MeshUtils.cpp | /*
* MeshUtils.cpp
*
* Created on: 12.12.2012
* Author: <NAME>
*/
#include "render/MeshUtils.hpp"
#include "render/utils.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <array>
#include <iostream>
#include <fstream>
using cv::Mat;
using cv::Point2f;
using cv::Vec2f;
... | ALGO | 0.98256 | 5.431262 | {
"github_metadata": {
"branch": "master",
"commit_count": 803,
"repo_created_at": "2012-06-08T20:48:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 160,
"forks": 102,
"issues": 75,
"pull_requests": 2
},
"file_meta": {
"content_id": "295... |
fff36295-f001-49dc-b374-d6ea30259fea | ComiteMexicanoDeInformatica/OMI-Archive | 2021/omi/OMI-2021-Restauracion/validator.cpp | #include <algorithm>
#include <cmath>
#include <fstream>
#include <iostream>
#include <optional>
#include <set>
#include <vector>
const int MAX = 5e5 + 5;
int64_t N, K;
int64_t ini[MAX], same[MAX], user[MAX];
int64_t correct[MAX];
bool impossible;
int64_t mini, maxi, inflection;
const long double xx = 0.25;
void rea... | ALGO | 0.999624 | 3.766501 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2020-02-08T22:52:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 12,
"forks": 9,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "c0b495f3751... |
0a476eb2-d527-4ec9-a678-387b6d9a8a30 | blacksea3/leetcode | cpp/leetcode/5148. binary-tree-coloring-game.cpp | #include "BinaryTree.h"
//
//如果1号玩家选择的节点所在子树不包含根的节点总数量正好等于一半的(总节点量-1), 那么false 否则true
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
private:
int total... | ALGO | 0.999992 | 4.981795 | {
"github_metadata": {
"branch": "master",
"commit_count": 306,
"repo_created_at": "2019-05-03T02:48:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "837159a3... |
900e8ea5-bde5-42f5-9c3a-50ccb60c37ae | AndryDeveloper/LD_potential | modeling/main.cpp | #define _USE_MATH_DEFINES
#include <cmath>
#include <random>
#include <optional>
#include <future>
#include <iostream>
#include <fstream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
#include "molecule.h"
#include "vector3d.h"
template <typename T>
class Environment{
private:
char* config_path;
... | ALGO | 0.99812 | 4.792612 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-11-01T20:47: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": "8704029581... |
9579bcd8-bf9e-4336-a0e3-025ccb6884e1 | AbhishekGargcoder/Top-interview-problems | Knapsack with Duplicate Items - GFG/knapsack-with-duplicate-items.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:
vector<vector<int>>dp;
int mxWt, s;
int f(int i,int w,int *val,int *wt){
if(i==s) return 0;
// cout<<28;
int ... | ALGO | 0.999992 | 5.02672 | {
"github_metadata": {
"branch": "main",
"commit_count": 921,
"repo_created_at": "2023-06-30T14:25: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": "fb3a077b62... |
1302f79d-daf9-4df2-8699-15a52adb310f | Newcit/University | semlab2/2C/main.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <iterator>
#define INPUT_FILE "bipartite.in"
#define OUTPUT_FILE "bipartite.out"
enum {White, Green, Black};
struct Graph;
void dfs(std::vector<Graph>& , int , int , bool&);
struct Graph {
int check_on_cycle = White;
std::set<i... | ALGO | 0.999986 | 5.165702 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-03-03T20:58: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": "3e080967cc... |
75e73681-27bd-4e25-bcce-dab617c85728 | divykantsharma/Leetcode-Solution | 0583-delete-operation-for-two-strings/0583-delete-operation-for-two-strings.cpp | class Solution {
public:
//TABULATION
int minDistance(string word1, string word2){
int n=word1.length();
int m=word2.length();
vector<vector<int>> dp(n+1,vector<int> (m+1,0));
for(int i=0;i<=n;i++) dp[i][0]=0;
for(int j=0;j<=m;j++) dp[0][j]=0;
for(int i=1;i<=n;i++... | ALGO | 0.999996 | 5.871451 | {
"github_metadata": {
"branch": "main",
"commit_count": 633,
"repo_created_at": "2023-07-27T07:10: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": "7751f293d7... |
2c08efb9-87d9-497a-936c-54ca706e65a0 | swan0421/RobotControl2024 | qp_practice/qp_practice.cpp | /*
* ============================================================
* qp_practice Class
*
* Robotics & Control Lab.
*
* File : qp_practice.cpp
* Author : <NAME>
*
* First developer : <NAME>
* Second developer :
*
* Update date : 2024. 06. 10 by <NAME>
* ===... | ALGO | 0.993861 | 4.865509 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2024-03-15T11:16:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1d54c43cf... |
6e5c4c79-4da7-4353-a626-a019888f3d83 | Anirudh-Sharma-/Thesis | CPUCode and Paper/CPUCode/Hist.h | //
// Hist.h
// alf
//
// Created by <NAME> on 02/05/2014.
// Copyright (c) 2014 <NAME>. All rights reserved.
//
#ifndef __alf__Hist__
#define __alf__Hist__
#include <iostream>
#include <opencv2/opencv.hpp>
#include "Vec.h"
namespace GG {
/**
* 3D Histogram and mean shift clustering
*/
cl... | ALGO | 0.964714 | 6.034076 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-01-31T19:30:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0dafa75d80... |
171b7ed3-e4ce-4faa-a933-4bbc8a79ee73 | jmtucker6/Project5 | Project5/main.cpp | #include "Heap.h"
#include "Table.h"
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
Node* find(Node*, char);
std::string preorder(Node *);
std::string inorder(Node *);
std::string removeSpaces(std::string);
void generateEncodingTable(Node*, Table*, std::string);
int main(int argc, char* a... | ALGO | 0.999763 | 3.528031 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2015-11-08T23:54: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": "1d1c5cf7ae... |
1a47799f-662d-46af-80a9-95b435e84334 | dziwGH/C-plus-plus | Ch2_ExamAverage/ExamAverage2.cpp | // Ch2_ExamAverage.cpp
// <NAME>
// 8/31/22
#include <iostream>
#include <string>
using namespace std;
// Declare Function - copy function header and put ; on end
double exam_avg_funct(double x, double y, double z, double a, double b);
// Named Constant
const int NO_OF_EXAMS = 5;
int main()
{
// Variable Declarat... | ALGO | 0.979511 | 5.044791 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-04T01:52: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": "c178a1e443b8... |
a8a8da9f-b61c-4bdc-b2ea-7dff490728e8 | ishandutta2007/codeforces-h | hellkitsune/normal/746/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
typedef long long LL;
typedef pair<int, int> PII;
#define sz(x) int(x.size())
const int INF = int(1e9);
int n, w, k;
int a[200005];
int t[200005];
struct Cmp {
inline bo... | ALGO | 0.999977 | 3.539909 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01: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": "86669a15a7f7... |
0b1a1b26-b898-4920-9cf4-9171c9486b82 | Naathan404/Data-Structures-Algorithms | BT_Thuc_hanh/Assignment_01_dot2/bai01_merge_2_sorted_array.cpp | /*###Begin banned keyword - each of the following line if appear in code will raise error. regex supported
###End banned keyword*/
#include <iostream>
#include <climits>
#include <bits/stdc++.h>
#define MAXN 150000
void NhapMang(int A[], int &N) {
std::cin >> N;
for (int i = 0; i < N; i++)
std::cin >> ... | ALGO | 0.999928 | 4.69749 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-05-25T14:29: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": "5e6d1c84a660... |
c82f3905-ca79-4f79-b5e5-38daf308fcf9 | TuGraph-family/tugraph-db | procedures/algo_cpp/ppr_standalone.cpp | /**
* Copyright 2022 AntGroup CO., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed... | ALGO | 0.954286 | 5.425736 | {
"github_metadata": {
"branch": "master",
"commit_count": 710,
"repo_created_at": "2022-08-25T08:46:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1596,
"forks": 207,
"issues": 125,
"pull_requests": 15
},
"file_meta": {
"content_id": "2... |
2c99707c-e139-42c0-b414-bfdbfb4fd0a6 | userzenox/DSA_C- | Queue_60-62/Lecture_61/First_Negative_window.cpp | #include <iostream>
#include <vector>
#include <deque>
using namespace std;
class Solution {
public:
vector<int> firstNegInt(vector<int>& arr, int k) {
deque<int> q;
vector<int> ans;
// Process first window
for (int i = 0; i < k; i++) {
if (arr[i] < 0) {
... | ALGO | 0.999987 | 6.279512 | {
"github_metadata": {
"branch": "main",
"commit_count": 200,
"repo_created_at": "2025-01-11T19:23: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": "af71816ea4... |
9f855306-4be2-491f-b213-599a09ba15c2 | officefish/HackerRankChallenges | HackerRankChallenges/Arrays/HourglassChallenge.cpp |
/*
Hackerrank::Challenges::Hourglass
description: https://www.hackerrank.com/challenges/2d-array
*/
#include <algorithm>
#include ".././Challenges.h"
#include ".././HackerRankMiscellaneous.h"
using hr::split_string;
using std::cout;
using std::endl;
using std::cin;
using std::streamsize;
using std::numeric_limits;
... | ALGO | 0.999478 | 5.577493 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2021-02-19T22:51: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": "ec6cb7221... |
426fb6d1-15d3-4fe2-9167-455fab98b6f2 | Nafyaz/my-codes | Atcoder/dp_m(2).cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
ll dp[100005];
ll pref[100005], temp[100005];
ll a[102];
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
ll N, K, i, j;
cin >> N >> K;
for(i = 1; i <= N; i++)
cin >> a[i];
for(i = 0; i <... | ALGO | 0.99994 | 3.989854 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2022-04-17T23: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": "de2d9e4be... |
ca9ac37a-8e82-4e0f-9401-c14235a0c4e6 | LABYRINTH3/oop-2024 | HW3/HW3-1/main.cpp | #include <iostream>
using namespace std;
// 함수 오버로딩을 이용해 입력값을 정수로 설정해 두 값을 더한 후 반환했다.
int add(int a1, int b1){
return a1 + b1;
}
// 함수 오버로딩을 이용해 입력값을 실수로 설정해 두 값을 더한후 반환했다.
float add(float a2, float b2){
return a2 + b2;
}
// 함수가 배열을 받고 반복문을 이용해 반복해 배열 안의 값을 더한다.
int add(int arr[], int num){
int arrSum = ... | ALGO | 0.995797 | 4.754435 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2024-03-07T14:00: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": "47f4f9fcf... |
5931ca30-ca3a-4ff9-b7af-d8309fa7d455 | ShigaMitsuki/MT3_00_02 | main.cpp | #include <Novice.h>
#include <Math.h>
#include "Vector2.h"
#include "Vector3.h"
#include "Matrix4x4.h"
#include "Polygon.h"
#include<imgui.h>
const char kWindowTitle[] = "LD2A_07_シガ_ミツキ";
static const int kColmnWidth = 100;
static const int kRowHeight = 20;
void VectorScreenPrintf(int x, int y, const Vector3& vector,... | TOOL | 0.902561 | 4.54067 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2023-04-21T19:54: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": "41a67fdd7... |
822b4227-8af6-4fd5-8c49-e3e02efd6399 | EstebanFS/Competitive-Programming | Contests/Intern RPC Contests/2015/RPC-November-7/e.cpp | //<NAME>
using namespace std;
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <sstream>
#include <fstream>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#include... | ALGO | 0.999711 | 3.190902 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2013-05-28T15:40: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": "e9d4cdbfc... |
8ebfbed6-b693-42f1-82d7-71819c6861ca | huibosa/programming | algorithm/algorithms-4ed/ch2/client.cpp | #include <cstdlib>
#include <ctime>
#include <iostream>
#include <vector>
#include "25_Cutoff_to_insertion_sort.h"
int main() {
const int n = 1000000;
std::vector<int> a;
for (int i = 0; i < n; ++i) {
a.push_back(rand() % 100000);
}
QuickInsertion<int> quick;
quick.sort(a);
/* auto t1 = clock();... | ALGO | 0.999699 | 5.008963 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2022-03-20T09:18: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": "10eb01cc944... |
95e28d62-c759-4613-a249-5233484adc9e | liuchuo/LeetCode | C++/330. Patching Array.cpp | 330. Patching Array
Given a sorted positive integer array nums and an integer n, add/patch elements to the array such that any number in range [1, n] inclusive can be formed by the sum of some elements in the array. Return the minimum number of patches required.
Example 1:
nums = [1, 3], n = 6
Return 1.
Combinations ... | ALGO | 0.999978 | 5.694601 | {
"github_metadata": {
"branch": "master",
"commit_count": 354,
"repo_created_at": "2016-04-01T13:53:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 534,
"forks": 154,
"issues": 5,
"pull_requests": 4
},
"file_meta": {
"content_id": "c62e... |
f9aabaf7-fcb6-47d8-b25d-1648f7b030fa | thomasisebeck/Artificialntelligence-COS314 | NeuralNetwork/Matrix.cpp | #include "Matrix.h"
#include <iostream>
using namespace std;
Matrix::Matrix() {
this->rows = 0;
this->cols = 0;
this->values = {};
}
Matrix::Matrix(int cols_x, int rows_y) {
this->cols = cols_x;
this->rows = rows_y;
this->values = {};
this->values.resize(cols_x * rows_y, 0.0);
for (in... | ALGO | 0.907757 | 4.78255 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2023-04-07T19:43: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": "1414468bc07... |
0e4740e7-e202-4a18-b207-13ce0584ebe0 | duscob/drl | src/pdlrp.cpp | #include <iostream>
#include <stack>
#include "drl/pdlrp.h"
//--------------------------------------------------------------------------
const std::string PDLRP::EXTENSION = ".pdlrp";
const std::string PDLRP::SET_EXTENSION = ".pdlset";
PDLRP::PDLRP(const RLCSA& _rlcsa, const std::string& base_name, bool compress_se... | TOOL | 0.900708 | 6.520358 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2020-04-16T17:19:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c24de9a0b... |
25cd3274-8108-48d2-90bc-378cfd221ff3 | chenhengqi/learn-rust-the-hard-way | leetcode/lc-0111/solution.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
int minDepth(TreeNode* root) {
int depth = INT_MAX;
int currentDepth = 0;
... | ALGO | 0.999969 | 6.239215 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2020-05-05T12:54: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": "7fcbd54dc... |
d782867a-2dd1-470b-beb2-4d1037237551 | leo2105/Plantillas | BinarySearch.cpp | #include <bits/stdc++.h>
using namespace std;
int BS( int lo, int hi, int key, vector<int> A ) {
int mid;
while ( lo <= hi ) {
mid = lo + ( hi - lo ) / 2;
if ( A[mid] == key )
break;
if ( A[mid] < key )
lo = mid + 1;
else
hi = mid - 1;
}
... | ALGO | 0.999961 | 4.516581 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2015-08-06T07:18:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca8293ca3... |
9d0427d5-398a-4801-9a0b-f49a33c8b7b2 | sankalp567/CPP | 12-nexting/01-basic.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
// in case of nexting in map and set
// the inner datatype campare from first to last element
// eg set1={2,3,4} and set2={2,5,4} then set1 < set2
//as fiirst element is same but second element of set2 is greater
// we can use any type of d... | ALGO | 0.999698 | 3.680224 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2025-04-19T10:53:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7dba38fcad... |
e25d8880-f622-4445-b4ad-c3fef8a805a8 | SyedAbdulNafay/DSA | infix2prefix.cpp | #include <iostream>
using namespace std;
#include <math.h>
#include <algorithm>
struct Node
{
char value;
Node *next;
Node(char input)
{
value = input;
}
};
struct ENode
{
double value;
ENode *next;
ENode(double input)
{
value = input;
}
};
struct ExNode
{
... | ALGO | 0.999966 | 4.455835 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2024-03-14T03:17: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": "f0b1d0bde5b... |
5aa366a2-5daa-48c9-b01a-d453f835eb2d | Rohit-Ahuja1/Medicine-Dispencere | medicine.ino | #include <SPI.h>
#include <MFRC522.h>
#include <Servo.h>
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
// WiFi credentials
const char* ssid = "Sagar";
const char* password = "<PASSWORD>";
// Google Apps Script Web App (original deployment URL)
const char* host = "script.google.com";
const int httpsPort = 443... | WEB | 0.974225 | 5.695555 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-04-21T08:36: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": "d490752d5825... |
ab875d39-e932-4dc9-af8b-d496065543bb | rettetdemdativ/POS_HTBLA | algorithms/recursion/chesscombinations.cpp | #include <iostream>
#include <vector>
#include <string>
std::vector<int> field = {1, 2, 3, 4, 5, 6, 7, 8};
std::vector<std::string> alph = {"A", "B", "C", "D", "E", "F", "G", "H"};
int count = 0;
void out() {
for(int i = 0; i <= field.size() - 1; i++) {
std::cout << (i+1) << ". queen:" << alph[i] << field[i] << " ... | ALGO | 0.986384 | 4.105269 | {
"github_metadata": {
"branch": "master",
"commit_count": 180,
"repo_created_at": "2014-09-21T19:03: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": "13ba449a... |
8685fd48-e8d2-4a61-a728-d17e366cb855 | wCloudRain/orp | alg/bucket.cpp | #include <random>
/********************************************************************
Implementation of Bucket Oblivious Permutation
<NAME>., <NAME>., <NAME>., <NAME>., <NAME>. and <NAME>., 2020.
Bucket oblivious sort: An extremely simple oblivious sort.
Created by <NAME> on 21/07/21.
MIT License
Copyright... | ALGO | 0.999105 | 5.208034 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-02-02T21:55:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4cb18df33... |
d21da20c-2f85-4682-beeb-1df953c81854 | Moozaheed/All-Code | C_Kill_the_Monster.cpp | //<NAME>
#include<bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define pb push_back
#define mp make_pair
#define pob pop_back
#define in insert
#define vi vector<int>
#define vs vector<string>
#define pii pair<int,int>
#define psi pair<string,int>
#define pis pair<int,string>
#define S string
#d... | ALGO | 0.99926 | 3.075786 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2021-10-06T11:52:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d173bf14be... |
cabbf6b2-0ade-4e0a-ae9e-0a4808e22f28 | ishandutta2007/codeforces-t | theoneyouwant/normal/1267/I.cpp | //By TheOneYouWant
#pragma GCC optimize ("-O2")
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define memreset(a) memset(a,0,sizeof(a))
#define... | ALGO | 0.999882 | 3.42506 | {
"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": "b44a20785d4d... |
e832aca2-faa6-4dc8-a1a6-02f8f88f5fe6 | David-5-5/tutorial | cplus/leetcode/202503/algo3366.cpp | #include <bits/stdc++.h>
using namespace std;
// 动态规划 - 多维 DP
class Solution {
public:
int minArraySum(vector<int>& nums, int k, int op1, int op2) {
int ans = accumulate(nums.begin(), nums.end(), 0), n = nums.size();
vector<vector<vector<int>>> dp(n+1, vector<vector<int>>(op1+1, vector<int>(op2+1... | ALGO | 0.999941 | 4.807889 | {
"github_metadata": {
"branch": "main",
"commit_count": 2940,
"repo_created_at": "2022-11-22T17:09:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "914788e7d... |
a685a4a5-cf6c-46cc-b611-d12d34c41925 | KanishkRastogi46/cpp_tut | functions/main.cpp | #include<iostream>
#include "add.h"
using namespace std;
int callByValue(int a, int b, int ans){
++a;
++b;
return ans=a+b;
}
int callByReference(int &a, int &b, int &ans){
++a;
++b;
return ans=a+b;
}
int callByPointer(int * a, int * b, int * ans){
* a= * a + 1;
* b= * b + 1;
retur... | ALGO | 0.988982 | 4.435062 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-01-21T07: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": "54069d9af256... |
998dc5cd-ea11-496a-84ba-686e09a4324a | vladescualexandra/ism-dpss | omp-complex-directive/main.cpp | #include<string>
#include<omp.h>
using namespace std;
void main() {
long sum = 0;
const int N = 10000;
int* array = new int[N];
for (int i = 0; i < N; i++) {
array[i] = i + 1;
}
// Standard solution.
for (int i = 0; i < N; i++) {
sum += array[i];
}
printf("Standard solution: sum = %d \n", sum);
// Par... | ALGO | 0.99932 | 4.264679 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2022-04-04T17:06: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": "69f4e4271... |
3949433b-6c15-4316-a2f1-92d02d55ffb2 | AbhayDixitDev/cpp-cybrom | search_palindrome_from_array_of_strings.cpp | //WAP to create a function named search_palindrome (string A[],int size ) in which u have to find out the count of strings which is palindrome and return it.
//string ar[]={“mom”,”Rahul”,”raj”,”nitin”};
//Count=2
#include <iostream>
//#include <string>
using namespace std;
bool isPalindrome(string str) {
int star... | ALGO | 0.999455 | 5.64273 | {
"github_metadata": {
"branch": "main",
"commit_count": 112,
"repo_created_at": "2024-05-27T06:10:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d04a7f1a9b... |
e7c1b4f7-8f93-4062-94f9-0af582920706 | lisendong/ACM | usaco/3/3.3.2.cpp | /*
ID: lisendo1
PROG: shopping
LANG: C++
*/
//#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<iostream>
#include<fstream>
#include<algorithm>
#include<assert.h>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<stack>
#include<queue>
#include<list>
#include<... | ALGO | 0.991742 | 3.580159 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2013-07-01T03:22:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e3277ae5... |
774abef3-528a-482e-9317-7fcddf00ba9b | helinaazer/Binary-Search-Tree-Project | bstmap.cpp | // <NAME> <EMAIL>
// 17 Jan 2021
// BST class
// Creates a BST to store values
// Uses Node which holds the data
#include "bstmap.h"
#include <cassert>
using namespace std;
// copy constructor
BSTMap::BSTMap(const BSTMap &bst) { root = copyNode(bst.root); }
// helper function for the copy constructor
BSTMap::Node ... | ALGO | 0.998175 | 5.286672 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-09-14T18:05:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd8396ebd23d... |
12c4248c-4a2a-4ef4-9d68-45fa4ab9aabd | eholt765/OS | PA3/prob1/part1.cpp | /*
Author: <NAME>
Date: 3/12/2022
CSCE 451 PA3
*/
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <semaphore.h>
#include <unistd.h>
void* producer(void* prod);
void* consumer(void* cons);
sem_t mutex;
sem_t empty;
sem_t full;
char* buffer;
volatile int numb_insert_items;
volatile int index ... | ALGO | 0.972442 | 4.418994 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-06-24T18:25: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": "7569667f3991... |
898dffb3-e72d-4be8-b042-86378edb3c98 | HungNguyenBa1811/CTDLGT-PTIT-2024 | 55.SapXepDonGian.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ed "\n"
#define use(x) freopen(x".inp", "r", stdin); freopen(x".out", "w", stdout);
#define BidenJr 0
int x_4axis[] = {-1, 0, 0, 1};
int y_4axis[] = {0, -1, 1, 0};
int x_8axis[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int y_8axis[] = {-1, 0, 1, -1, 1, -... | ALGO | 0.999914 | 3.777952 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-10-07T11:13: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": "7653def029c4... |
848388ee-0cb0-45f2-abe3-5a3fced0e146 | taitruong256/Competitive-programming | IUH_Olympic_ICPC/Practice_ICPC_MienBac/A.cpp | /*==============================================================================================================
__ __ _____ ______ _______
| | | | / __ \ / _____| / __... | ALGO | 0.999711 | 4.738911 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-04-14T06:59:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "228a7367bde0... |
ddb9a3c7-e1d4-4c21-a3a5-7b5c24ff3175 | Fatummm/university | algorithms/fourth_contes/4new.cpp | #include <iostream>
#include <vector>
#include <cstdint>
#define ll long long
ll build_path(std::vector<std::vector<ll>>& am, std::vector<bool>& visited, std::vector<ll>& path, ll current, ll start) {
if (current == start && path.size() == am.size()) {
ll ans = 0;
for (int i = 1; i != path.size();... | ALGO | 0.999911 | 4.039195 | {
"github_metadata": {
"branch": "cheesedom",
"commit_count": 74,
"repo_created_at": "2024-11-13T12:25: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": "b6cbd2... |
e89d26e4-31be-4149-9a9b-5535e4b6a9b3 | AyahRamahi/30days-leetcoding-challenge | MayChallenge/Week1/cousins_in_binary_tree.c++ | /**
* 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.999972 | 5.909674 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2020-04-05T20:13:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b7b214823... |
d920122b-de24-4820-bb66-4c1653556d58 | chem12346789/deom_mpi | bose/1d-corr/equilibrium.cpp | #include "deom.hpp"
#include "mr.hpp"
// Calculate equilibrium state. You will find in small system, equilibrium_sc2 is faster than equilibrium.
// The target is equilibrium state, but you can use it to do some "propgator" in \rho.
// i/o parameter:
// frho_name: each step of ddos0
// some contorl parameter:
// ti: ini... | ALGO | 0.999786 | 3.460784 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2021-08-30T16:37: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": "97fd7755a45b... |
1daa5fc4-5435-4aeb-9cca-3653574a5b4f | vexsnare/cpp-prog | codeforces/553/B.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <list>
#include <cstdlib>
#include <map>
#include <set>
#include <stack>
#include <queue>
using namespace std;
#define debug(x) cout<<#x<<" = "<<x<<"\n"
int main() {
int n, m, x;
cin>>n>>m;
int XOR = 0;... | ALGO | 0.999983 | 3.024005 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2018-11-26T09:37:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b031d367... |
07af5f3a-a545-49a4-ab64-f7882edb2396 | sanchit123k/DS-Algo | Graphs/Prims.cpp | #include<iostream>
#include<stdbool.h>
#include<limits.h>
using namespace std;
void InitializeMatrix(int adjM[15][15], int nodes)
{
for (int i = 1; i <= nodes; ++i)
{
for (int j = 1; j <= nodes; ++j)
{
adjM[i][j]=-1;
if(i==j)
adjM[i][j]=0;
}
}
}
void addEgde(int adjM[15][15], int source, int destn... | ALGO | 0.999806 | 4.068056 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-09-05T17:10: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": "d8460a9311... |
00ad3e12-91c1-4ffa-b0f4-ba479a9ce5a4 | sniper-fly/AOJ | archive/ALDS1_6_D/main.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pll = pair<ll, ll>;
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define all(c) begin(c), end(c)
#define PI acos(-1)
#define oo 2e18
template<typename T1, typename T2>
bool chmax(T1& a, T2 b) {
if (a <... | ALGO | 0.999981 | 4.062674 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2020-05-09T13:22: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": "c091d5f3d... |
4db6c90e-ffa5-4d23-b6c1-36402956d216 | chorogchip/PS | PS_BOJ/22345.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
pair<ll,ll> v[201010];
ll s[201010];
ll c[201010];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n, q; cin >> n >> q;
for (int i = 1; i <= n; ++i) cin >> v[i].second >> v[i].first;
sort(v + 1, v + n + 1);
... | ALGO | 0.999976 | 3.958435 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-06-23T14:21: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": "d4cba69675c3... |
52eebe4b-2089-4040-aa7f-a7398c27afab | Staok/Cpp-Learning | C++学习相关Github仓库收集/linux-cpp-tutorial-andy-upp/01.C++基础教程/05.C++提高编程/3.STL常用容器/3.7 list容器/3.7.8 排序案例.cpp | #include <list>
#include <string>
#include<iostream>
using namespace std;
/*
案例描述:将Person自定义数据类型进行排序,Person中属性有姓名、年龄、身高
排序规则:按照年龄进行升序,如果年龄相同按照身高进行降序
总结:
* 对于自定义数据类型,必须要指定排序规则,否则编译器不知道如何进行排序
* 高级排序只是在排序规则上再进行一次逻辑规则制定,并不复杂
*/
class Person {
public:
Person(string name, int age , int height) {
m_Name = name;
m_... | ALGO | 0.990784 | 4.68975 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2022-08-20T11:24:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "37f253dc09b... |
389800c8-b8d5-464c-9955-ace840ebc6d0 | ishandutta2007/codeforces-m | mstczuo/normal/722/F.cpp | # include <cstdio>
# include <cstring>
# include <utility>
# include <vector>
using namespace std;
const int P[] = {2, 4, 8, 16, 32, 3, 9, 27, 5, 25, 7, 11, 13, 17, 19, 23, 29, 31, 37, 39};
const int pn = 20;
int a[pn], b[pn];
void init() {
memset(a, 0, sizeof(a));
memset(b, 0, sizeof(b));
}
const int maxn = 100... | ALGO | 0.999764 | 3.538941 | {
"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": "b1a9c6f6ea87... |
cbff6a4f-258e-4f7a-a4ac-3d1b06e02a24 | RobotLocomotion/drake | multibody/inverse_kinematics/polyhedron_constraint.cc | #include "drake/multibody/inverse_kinematics/polyhedron_constraint.h"
#include <limits>
#include "drake/math/autodiff_gradient.h"
#include "drake/multibody/inverse_kinematics/kinematic_evaluator_utilities.h"
using drake::multibody::internal::RefFromPtrOrThrow;
using drake::multibody::internal::UpdateContextConfigura... | ALGO | 0.924281 | 7.198575 | {
"github_metadata": {
"branch": "master",
"commit_count": 33726,
"repo_created_at": "2014-01-26T16:11:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3630,
"forks": 1305,
"issues": 690,
"pull_requests": 46
},
"file_meta": {
"content_id":... |
c427c748-5411-4036-a8b9-44f5d754e8dc | YoungchoKim/LeetCode | 0624-maximum-distance-in-arrays/0624-maximum-distance-in-arrays.cpp | struct number{
int idx;
int value;
};
class Solution {
public:
int ABS(int x){
return x < 0 ? -x: x;
}
int maxDistance(vector<vector<int>>& arrays) {
number minNum = {0, 10001};
number secondMinNum = {0, 10001};
number maxNum = {0, -10001};
number secondMaxNu... | ALGO | 0.999823 | 5.007424 | {
"github_metadata": {
"branch": "main",
"commit_count": 1286,
"repo_created_at": "2024-06-23T01:43: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": "5091803b7... |
a6de9f8a-3cb8-497a-99af-9591c8b23a1e | GabreuSenra/Trabalho-Grafos | main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <math.h>
#include <utility>
#include <tuple>
#include <iomanip>
#include <stdlib.h>
#include <chrono>
#include "Graph.h"
#include "Node.h"
#include <limits>
using namespace std;
Graph* leitura(ifstream& input_file, int directed, int weightedEdge, int we... | ALGO | 0.999431 | 4.221968 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2021-12-16T03:37:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "95d65a6632b... |
e8b682e4-b89e-4ffc-ad35-54a09ade3503 | ishandutta2007/codeforces-s | se1ka2/normal/1257/D.cpp | #include <functional>
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef pair<int, int> P;
template<typename Monoid>
struct SegmentTree {
using F = function<Monoid(Monoid, Monoid)>;
int sz;
vector<Monoid> seg;
const F f;
const Monoid M1;
SegmentTree(int n... | ALGO | 0.999523 | 3.693112 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "05832c93fa33... |
c4b31701-7ee2-4e64-971c-dff3f700fec7 | msneubauer/matrixelement | matrix/matrix/WW1jLeptonsBaseIntegrand.hh | //
// authors: <NAME> (doug dot schouten at triumf dot ca)
//
//
#ifndef WW1JLEPTONSBASEINTEGRAND_HH
#define WW1JLEPTONSBASEINTEGRAND_HH
#include "matrix/WW1jFeynDiagram.hh"
#include "matrix/FeynIntegrand.hh"
#include "matrix/TransferFunction.hh"
#ifndef __CINT__
#include "matrix/WWFinalStateSolver.hh"
#en... | ALGO | 0.963269 | 5.176219 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-04-29T02:43:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70aa0d6018... |
36ecd55f-8a5a-4315-b13a-05aaa18fa062 | user557742/PC1 | OLP_KHTN/2024_ngay1_bai_A.cpp | // đề bài tìm một hoán vị có độ dài n sao cho phần tử thứ i là p[i]
// tìm một dãy hoán vị sao cho số lượng gcd(p[i],i)=1 đúng là k
// in ra nó (n<=10^6)
// input : n , k (1<=k<=n<=10^16)
// OUT :in ra dãy số
// sub1:(n<=10) dpbitmask dp[x][i] là số vị trí thỏa mãn thuộc tập hợp con có vị trí cuối là i
// dp[x][i] --... | ALGO | 0.99996 | 3.554104 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2025-04-17T06:37: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": "70026e33c2f... |
b051402a-1466-4220-9743-6ef4aea432fa | menaehab/Codeforces-Solutions | 0 - 1000 problems/Binary Cut.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include<iomanip>
#include <string>
#define speedup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define el "\n"
#define all(arr) arr.begin(), arr.end()
#define allr(arr) arr.... | ALGO | 0.999898 | 4.169245 | {
"github_metadata": {
"branch": "main",
"commit_count": 117,
"repo_created_at": "2024-08-24T15:38: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": "d8ce4f5f64... |
5d43cb02-1ef2-4e7d-8a82-b3784dde70ce | Lanova/sjcc-cpp-course | Lab3_3.cpp | //===========================================
// Course: CIS 054 (100616) C/C++ Programming
// Assignment: Week 3 - Lab Assignment 3 Christmas Tree
// Name: <NAME>
// ID: 0910134
// Date: 02/11/2020
// Platform: Linux
// ===========================================
#include <iostream>
#include <iomanip>
using namespac... | ALGO | 0.992317 | 3.036922 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-04-13T04:54: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": "2e3ce6b240... |
4ac65801-4505-4055-ad7a-f3cfabb4a483 | task4233/contest | AtCoder/ABC/087/rere_d.cpp | #include <bits/stdc++.h>
using namespace std;
#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" <<... | ALGO | 0.999919 | 4.744018 | {
"github_metadata": {
"branch": "master",
"commit_count": 143,
"repo_created_at": "2018-03-08T13:28:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "f5321f9a... |
dd7b4aa6-9a6e-474f-8a96-f21caaf6fecb | vetal045/LeetCodePatterns | patterns/TwoPointers/main.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<int> twoSum(vector<int>& nums, int target)
{
// Old solution
// unordered_map<int, int> map;
// for (int i = 0; i < nums.size(); i++) {
// int complement = target - nums[i];
// if... | ALGO | 0.999986 | 6.035324 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-07-14T21:05:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "500c95684526... |
08b7548a-de75-414b-8755-b93ef928b96b | SamSweet04/PP1 | Lab10/b.cpp | // // required to solve
// #include <iostream>
// #include <vector>
// #include <cmath>
// #include <algorithm>
// using namespace std;
// unsigned long long gen(){
// static int i = -1;
// i++;
// unsigned long long x = 1;
// for(int j = 1; j <= i; j++) x *= i;
// return x;
// }
// int main()... | ALGO | 0.999967 | 5.758155 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-11-05T19:07: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": "cf0d50af84f0... |
7ed662a9-3d75-4df2-afb2-134ffda8b9b7 | Chickenbumps/BOJ | #test10971/#test10971/main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define MAX 11000000
int main(){
int n;
cin >> n;
int w[11][11] = {0};
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
cin >> w[i][j];
}
}
vector<int> v;
int minScore = MAX;
int sum = 0;
for (int k = 1; k ... | ALGO | 0.999994 | 3.354389 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2018-12-27T07:06:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b8f4fae6... |
5b602bd7-1ec6-493b-9c6b-cb546ff350e3 | xSeanliux/CompetitiveProgramming | CF/460C/460C.cpp | #include <iostream>
#include <deque>
#include <vector>
#include <utility>
#define pii pair<int,int>
#define S second
#define F first
#define int long long int
#define ericxiao ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
const int maxN = 1e5;
int n, m, w, arr[maxN + 10];
bool can(int x){ //x is minhe... | ALGO | 0.999993 | 4.076178 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2018-11-18T06:45: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": "ae4efa173... |
c04db2b6-46be-417a-a8c2-6abdd4fed561 | gazlan/Test-Parser | parser/Parserdlg.cpp | /* ******************************************************************** **
** @@ Parser
** @ Copyrt :
** @ Author :
** @ Modify :
** @ Update :
** @ Dscr :
** ******************************************************************** */
/* ******************************************************************** **
** ... | TOOL | 0.971004 | 5.597269 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-02-05T19: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": "aa5c7d398f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.