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 |
|---|---|---|---|---|---|---|---|
733d59b9-3f40-4a0d-9427-ffb02713abc3 | AhJo53589/leetcode-cn | problems/happy-new-year-lol/SOLUTION.cpp |
//////////////////////////////////////////////////////////////////////////
void printCodes(int sum, vector<int>& cur, vector<string>& codes)
{
cout << sum << " \t";
for (size_t i = 0; i < cur.size(); i++)
{
cout << codes[cur[i]];
}
cout << endl;
}
string happy(int n, vector<vector<int>>& roads, vector<string... | ALGO | 0.999988 | 4.8413 | {
"github_metadata": {
"branch": "master",
"commit_count": 891,
"repo_created_at": "2019-04-22T05:43:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 252,
"forks": 39,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e311... |
acb12983-bfc2-4c62-a0b3-89039f4d67e1 | GlebsHlebs/NIM | NUM/StateGraph.cpp | #include "StateGraph.h"
StateGraph::StateGraph(const std::vector<int>& piles, int current_player) {
// Create the root node with the initial state of the game
root_node = new StateSpaceGraphNode(State(piles, current_player));
// Generate the state space graph using a depth-first search
generateStateSp... | ALGO | 0.997517 | 6.431479 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-04-12T16:15: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": "9eef8ed63206... |
28e819a2-d2e9-4c94-957e-4ccac448eecc | ace-5/competitive-programming-solutions | monkAndRotation.cpp | // https://www.hackerearth.com/practice/codemonk/ Array and String
// Monk and Rotation
/* Mishki will be provided with an integer array A of size N and an integer K , where she needs to rotate the array in the right direction by K steps and then print the resultant array. As she is new to the school, please help her t... | ALGO | 0.999915 | 4.237996 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2021-07-02T02:46:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e90704a92... |
b9a66356-c8d2-4108-aebb-60c8ac04d6cd | 3NCRY9T3R/H4CKT0B3RF3ST-2020 | Programs/sieve of eratosthenes.cpp | //sieve of eratosthenes
#include<bits/stdc++.h>
using namespace std;
#define ll long long
//it finds prime numbers from 1 to n :
void sieve(ll n)
{
bool p[n+1]; //declaration of a boolean array
for(ll i=0;i<=n;++i) //for loop to initialize the array
{
if(i==2||i==3) ... | ALGO | 0.999807 | 4.517099 | {
"github_metadata": {
"branch": "main",
"commit_count": 660,
"repo_created_at": "2020-10-01T19:52:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 55,
"forks": 111,
"issues": 0,
"pull_requests": 40
},
"file_meta": {
"content_id": "865b56... |
4a84ae9c-77b4-40b2-aae5-80561cea20f7 | cusplibrary/cusplibrary | cusp/system/detail/sequential/graph/breadth_first_search.h | /*
* Copyright 2008-2014 NVIDIA Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | ALGO | 0.999703 | 6.91571 | {
"github_metadata": {
"branch": "main",
"commit_count": 1316,
"repo_created_at": "2012-08-24T01:13:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 415,
"forks": 134,
"issues": 33,
"pull_requests": 6
},
"file_meta": {
"content_id": "0e922... |
2745d19c-edeb-406b-b986-509d6015d268 | StrawHatWess/Competitive-Programming-Solutions | Dmoj/UTS 21/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.999909 | 4.187016 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-04-18T12:51: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": "92941b7437f8... |
a9b13cd5-8e8d-44b0-883d-694762312ff1 | AlbertWang0116/KrwlngsACMFile | ACM-2011-practise/ZOJ/The_8th_Zhejiang_Provincial_Collegiate_Programming_Contest/ProD.cpp | #include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<cstdlib>
#include<ctime>
#include<cmath>
#include<algorithm>
using namespace std;
#define N 200
#define M 200
char itv[N][N];
int pos[N], lft[M], rit[10];
int n, m;
void init()
{
int i;
memset(lft, 0, sizeof(lft));
for (i = '0'; i <= '... | ALGO | 0.99997 | 3.376388 | {
"github_metadata": {
"branch": "master",
"commit_count": 224,
"repo_created_at": "2011-09-08T01:09:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23049620... |
ad1f903b-9aba-43ab-8738-8b4ccc25bce9 | phitronio/Batch-4-Basic-Data-Structures | Module 17/postorder_traversal.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *left;
Node *right;
Node(int val)
{
this->val = val;
this->left = NULL;
this->right = NULL;
}
};
void postorder(Node *root)
{
if (root == NULL)
{
return;
}
postorder(r... | ALGO | 0.999909 | 4.170515 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-11-27T09:01:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 58,
"forks": 30,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2cb20ad35e... |
4becbd14-c7de-4d52-8bee-4eadaddc54cf | himanshu-10/GFG-Questions | 1721-swapping-nodes-in-a-linked-list/1721-swapping-nodes-in-a-linked-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* swapNodes(L... | ALGO | 0.999997 | 6.043387 | {
"github_metadata": {
"branch": "main",
"commit_count": 541,
"repo_created_at": "2023-04-02T08:53:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d90b04ee3... |
c0a4d877-b0a2-4834-b90c-d9d8be670a73 | GonzagaCPSC122/MA1Solution | Main.cpp | #include <fstream>
#include <iostream>
using namespace std;
/*
(5 pts) Suppose a file exists called numbers.txt and it is filled with integers,
one integer per line, with 1 to 10 integers in the file. Write a modular C++
program that:
*/
void openFile(ifstream &, string);
int countNums(ifstream &);
void loadNums(ifst... | TOOL | 0.967831 | 4.36739 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-01-30T19:31:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7b01d1592e... |
b8b2f66d-8ea0-466a-bd18-09e53b1a395a | tranHieuDev23/solution-spoj-cf | SPOJ/BGBOARD/BGBOARD.cpp | #include <bits/stdc++.h>
#define FOR(i, j, k) for (int i = j; i <= k; i ++)
#define FORD(i, j, k) for (int i = j; i >= k; i --)
#define mn 405
#define mn2 1000001
#define maxC 100000000700000ll
using namespace std;
int m, n, dem = 0, val[mn2], mark[mn * mn], mark2[mn * mn], ans = 0;
int t[mn][mn], pos[mn][mn * mn], f[... | ALGO | 0.999989 | 3.027147 | {
"github_metadata": {
"branch": "master",
"commit_count": 111,
"repo_created_at": "2016-10-25T13:40:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "271c8a9c... |
d86cbfd3-c6cc-4e0a-8c34-e284e78c8c59 | 13ngjc1/Physics-Projects | lab4c++/main.cpp | #include <iostream>
#include <cstdlib>
#include <fstream>
#include <ctime>
#include <cmath>
#define lightspeed 2997924.58
#define Ar 39.938
#define u 9.314e8
#define Kb 8.6173324e-5
#define sigma 3.40 //length in angstrom
#define epsilon 1.03e-2 //energy in eV
#define PI 3.14159265
//declaration of constants
double c... | ALGO | 0.999618 | 4.053153 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2020-03-07T15:43:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b62811259... |
9fcf6fd3-dd47-4a7e-97c0-c145fcc7995a | IlyaMolochko/LeetCode | Algo/DP_II/213_House_Robber_II.cpp | class Solution {
public:
int get_answ(vector<int> &nums, int add) {
vector<int> dp(nums.size());
dp[add] = nums[add];
dp[add + 1] = nums[add + 1];
int answ = max(dp[add], dp[add + 1]);
for (int i = add + 2; i + (add == 0) < nums.size(); ++i) {
dp[i] = max(dp[i - ... | ALGO | 0.999992 | 5.333295 | {
"github_metadata": {
"branch": "master",
"commit_count": 176,
"repo_created_at": "2023-01-24T18:31: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": "2f80c5e0... |
920bb70e-2bcb-4041-85a9-3301fa192c54 | mayankKushwaha13/Algorithms-Specialization---Stanford | Assignments/Programming Assignments/04/programming_assignment_2.cpp | /*
* File Name : programming_assignment_2.cpp
*
* Credit : Course - Shortest Paths Revisited, NP-Complete Problems and What To Do About Them, Stanford University on Coursera
* Instructor - <NAME>, Professor
*
* Author : <NAME>
* Created Date : 2025-06-08
*
* Description : Pro... | ALGO | 0.999007 | 4.147394 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2025-05-06T16:52: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": "c6caed55902... |
90dfb30f-f1a8-4fb0-ad13-a85cd6e06f34 | fadyat/ITMO-PROBLEMS | algorithms/term1/binary-tree/validation.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
freopen("check.in", "r", stdin);
freopen("check.out", "w", stdout);
int n; cin >> n;
vector<int> v(n);
vector<int> l(n);
... | ALGO | 0.999989 | 4.045768 | {
"github_metadata": {
"branch": "master",
"commit_count": 1021,
"repo_created_at": "2020-09-25T17:33:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 31,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f6293... |
59bb9e3c-b241-46d6-b6f1-483898d3666e | Priyanshu-Ganatra/Leetcode-Codestudio-And-DSA-problems | LC_69_CombinationSum2.cpp | #include <bits/stdc++.h>
using namespace std;
void combinationSumHelper(vector<int> &candidates, int target, vector<int> &temp, vector<vector<int>> &ans, int index)
{
// base cases
if (target == 0) // target is achieved
{
ans.push_back(temp);
return;
}
if (target < 0) // target is n... | ALGO | 0.999976 | 6.081781 | {
"github_metadata": {
"branch": "main",
"commit_count": 293,
"repo_created_at": "2023-08-08T09:24:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 26,
"forks": 15,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3051c59... |
f8570c24-37aa-41d2-a1a6-ae62e1a61d81 | davisking/dlib | dlib/optimization/elastic_net_abstract.h | // Copyright (C) 2016 <NAME> (<EMAIL>)
// License: Boost Software License See LICENSE.txt for the full license.
#undef DLIB_ElASTIC_NET_ABSTRACT_Hh_
#ifdef DLIB_ElASTIC_NET_ABSTRACT_Hh_
#include "../matrix.h"
namespace dlib
{
// -------------------------------------------------------------------------------------... | ALGO | 0.963004 | 7.023632 | {
"github_metadata": {
"branch": "master",
"commit_count": 8325,
"repo_created_at": "2014-01-29T00:45:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14068,
"forks": 3436,
"issues": 41,
"pull_requests": 5
},
"file_meta": {
"content_id": ... |
74d5ee2c-0715-43a7-b46c-5f27ec52dd18 | NikhilMJagtap/iDoCpp | supplements/flood-fill/softBorderColorPicker.cpp | #include "softBorderColorPicker.h"
#include<cmath>
SoftBorderColorPicker::SoftBorderColorPicker(unsigned int width, PNG& inputimage, double tol)
{
/* your code here */
img = inputimage;
tolerance = tol;
borderwidth = width;
}
HSLAPixel SoftBorderColorPicker::operator()(point p)
{
/* your code here... | ALGO | 0.985447 | 5.651701 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2020-04-20T05:31:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f580a0a9b... |
8f536181-3ba8-4d7a-b94e-f594d4bf730e | wlghsp/cpp_ps | cpp_study/code_tree/novice_mid/BruteForce/part1/14.cpp | #include <iostream>
#include <climits>
#define MAX_N 100
using namespace std;
/*
인접하지 않은 2개의 숫자
내 풀이
*/
int n;
int arr[MAX_N];
int ans;
void Input() {
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
}
int findMaxSum() {
int maxVal = INT_MIN;
for (int i = 0; i < n - 1; i++)
{
for (int j... | ALGO | 0.999822 | 3.834034 | {
"github_metadata": {
"branch": "master",
"commit_count": 223,
"repo_created_at": "2022-09-01T13:49: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": "4c761cf2... |
88d9b53b-2aac-48ba-acd1-0dc17562d632 | Andwerpz/Competitive-Programming-Practice | - cpp -/redenvelopes.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef array<int, 2> pii;
typedef array<ll, 2> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<ld> vd;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvl;
typedef vector... | ALGO | 0.99997 | 3.8129 | {
"github_metadata": {
"branch": "main",
"commit_count": 339,
"repo_created_at": "2021-02-26T19:38: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": "fe84275bf2... |
1e82da96-8599-44be-aba7-a96d68d18ea2 | whattadarsh/competitive-coding-online-platforms-solutions | DSA/trees/medium/nodes_at_distance_k_from_node.cpp | #include<iostream>
#include<vector>
#include<map>
using namespace std;
///Problem Statement: https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree/
///Solution: https://leetcode.com/submissions/detail/534248739/
///Concepts: DFS , hashMap,
///Complexity: T(n): O(n), S(n): O(n)
//Macros
#define endl "\n"... | ALGO | 0.999998 | 5.98353 | {
"github_metadata": {
"branch": "master",
"commit_count": 121,
"repo_created_at": "2020-07-15T12:09:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd27cafb... |
e3fa7723-9c43-4484-977f-600c22e66f57 | ytsaurus/ytsaurus | contrib/python/scipy/py3/scipy/_lib/highs/src/presolve/PresolveComponent.cpp | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the HiGHS linear optimization suite */
/* */
/* Written an... | ALGO | 0.981646 | 6.935008 | {
"github_metadata": {
"branch": "main",
"commit_count": 83261,
"repo_created_at": "2022-12-05T16:32:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2063,
"forks": 164,
"issues": 335,
"pull_requests": 38
},
"file_meta": {
"content_id": "7... |
9c8d1540-f187-4db6-a392-40684fd8991c | Vishalcc1/codefores | 116a.c++ | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define deb(...) logger(#__VA_ARGS__, __VA_ARGS__)
template<typename ...Args>
void logger(string vars, Args&&... values) {
cout << vars << " = ";
string delim = "";
(..., (cout << delim << value... | ALGO | 0.999879 | 4.209428 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-11-27T12:30: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": "68c1b30075ef... |
056b932f-da53-42ab-a71a-a2a27512cd85 | PierreVon/DataStructure | Find/bTree/btree.h | //
// btree.h
// Data
//
// Created by PierreVon on 2019/5/14.
// Copyright © 2019年 PierreVon. All rights reserved.
//
#ifndef btree_h
#define btree_h
#include "bnode.h"
#include <queue>
class btree {
bnode* root;
public:
btree(){
// root = new bnode;
}
btree(int list[],int len){
... | ALGO | 0.996083 | 3.955347 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2019-05-02T06:17: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": "5e737fc86... |
d581300b-bc72-463a-b02d-8ae8dc63651e | EdHuayllasco/ParallelComputing | Laboratorio02/Matrices.cpp | #include <iostream>
#include <chrono>
#include <cstdlib>
using namespace std;
// Función para multiplicar matrices de forma clásica con punteros
void multiplyMatrices(int **A, int **B, int **C, int N) {
for (int i = 0; i < N; ++i) {
for (int j = 0; j < N; ++j) {
C[i][j] = 0;
for (in... | ALGO | 0.999043 | 5.242177 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-09-18T04:28:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f975947db1cf... |
ab6eb818-393c-475b-83a8-5b18f4e94f89 | Muhammad-Ahsan-Ali/leetcode-practice | 8.Tress/5.all-possible-full-binary-trees.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.999891 | 6.190218 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-03-20T04:48: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": "d46c364c9f7b... |
b3120bb4-3d03-400c-93b6-479864970310 | minjoongkim99/algorithm | 250320/코드트리 빵/codetree-mon-bread.cpp | #include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
int n, m;
int dy[4] = {-1, 0, 0, 1};
int dx[4] = {0, -1, 1, 0};
int arr[17][17];
int visited[17][17];
int pre[17][17][2];
struct player{
int cy, cx, ey, ex, died;
};
player P[32];
bool canBreak(){
for(int i = 1; i <= m; ++i)
... | ALGO | 0.999953 | 3.997566 | {
"github_metadata": {
"branch": "main",
"commit_count": 435,
"repo_created_at": "2024-05-11T04:03: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": "8363de62a3... |
b2e69a33-a443-4a4e-b264-1b18b1188668 | MasterOfTheBus/MyThreads | spooler.hpp | /*
* <NAME>
* 260507001
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <semaphore.h>
#include <unistd.h>
#define TIMEOUT 5
#define NUM_EXECUTION 5
int buffsize;
int clients;
int printers;
/*
sem_t mutex;
sem_t full;
sem_t empty;
*/
#define err_exit(no, msg) errno = no; perror(msg); exit(EXI... | TOOL | 0.916403 | 4.332174 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2014-11-06T15:29: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": "a666ee0f0... |
91af669a-f215-4244-8903-3f059fb60111 | LroseC/OI | Luogu/LGR-096/D/main.cpp | #include <map>
#include <vector>
#include <string>
#include <cctype>
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
const int N = 5e3 + 10;
using vecint = vector<int>;
template<typename T = int>
T read(void)
{
T res = 0, f = 1; char ch = getchar();
while (!isdigit(ch)) { if (ch ==... | ALGO | 0.999881 | 4.038732 | {
"github_metadata": {
"branch": "main",
"commit_count": 914,
"repo_created_at": "2021-04-05T03:53: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": "f35be5668d... |
8070b6d9-fa64-48c8-9dd7-f2333f00f1e4 | HMProgrammingClub/NYCSL | problems/starterpackages/RM_Starter.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <fstream>
#include <time.h>
// Loads in names of all roommates from the input file into a string vector
vector<string> getProblem(const string f) {
ifstream input(f);
vector<string> answer;
for(string line; getline(input, line);) {
answer.push_back... | ALGO | 0.996427 | 3.952968 | {
"github_metadata": {
"branch": "master",
"commit_count": 1028,
"repo_created_at": "2015-12-12T13:10:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a66a1116... |
0342084c-5fb8-431b-954c-34754eec4757 | shaoyulee1995/C-HASH-FALL-2017 | chain_hash.h | #ifndef CHAIN_HASH_H
#define CHAIN_HASH_H
#include <iostream>
#include "../../../Documents/CS8(assignment)/AVLclass/avl.h"
#include "struct_record.h"
using namespace std;
template <class RecordType>
class chained_hash
{
public:
enum
{
TABLE_SIZE = 811
};
// Or: static const int TABLE_SIZE = 81... | ALGO | 0.984652 | 3.835066 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-03-03T06:45: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": "0f5f05fa60... |
71e3f3b6-2161-431b-ab33-f253a9b0c005 | alexandraback/datacollection | solutions_1484496_0/C++/aay/c.cpp | #include<iostream>
#include<vector>
#include<set>
#include<map>
using namespace std;
class mysum{
public:
mysum(){};
mysum(int x){
data.insert(x);
};
mysum(const mysum& o){
data=o.data;
}
mysum add(int x){
mysum tmp;
t... | ALGO | 0.999921 | 3.183609 | {
"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": "cbe9659f5... |
b4202efa-a78d-474f-a10c-238e82baacc4 | yash56244/CP-Contest-Problems-and-templates | codeforces/D1_Mocha_and_Diana_Easy_Version_.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
#define FOR(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define FORL(i, a, n) for (int(i) = (a); (i) <= (n); (i)++)
#define FORR(i, a, n) for (int(i) = (a); (i) >= (n); (i)--)
#define FORSQ(i... | ALGO | 0.999865 | 3.633959 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2021-01-11T12:49: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": "2377b7e5911... |
72c1cb3d-cfe6-4988-ad38-68a5e4d6409f | Linsanity81/Data-Structure | 4. LkQueue/main.cpp | #include <iostream>
#include <queue>
using namespace std;
template <typename T>
class LkQueue
{
struct Node
{
T data;
Node * next;
};
Node* front;
Node* back;
public:
LkQueue();
bool push(T e);
bool pop();
T& front_item()
{
if (front == back) throw "Emp... | TOOL | 0.936662 | 4.16475 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-11-17T22:33:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b992ae6d145... |
161b26eb-43e8-4b51-b296-893179f0e74c | aqfaridi/Competitve-Programming-Codes | SPOJ/FACTMUL.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <sstream>
#include <vector>
#include <iomanip>
#include <cmath>
const long long MOD = 1LL*186583*587117;
using namespace std;
typedef long long LL;
typedef pair<int,int> pii;
LL fact[10000010],res[10000010];
LL mulmod(LL a,LL b)
{
... | ALGO | 0.999994 | 4.319569 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-02-14T20:28: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": "2d89da916a... |
84ad8d39-3d06-49dc-9047-eb12f383cebf | hoshinon57/Algorithm | AtCoder/ABC201-300/ABC261-270/ABC270-D-2.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
typedef long long ll;
const ll INF64 = 1LL << 60;
const int INF32 = 0x3FFFFFFF; // =(2^30)-1 10^9より大きく、かつ2倍しても負にならない数
#define YesNo(T) cout << ((T) ? "Yes" : "No") << endl; // T:bool
/*
* メモ化再帰で解く。
*... | ALGO | 0.999834 | 3.778909 | {
"github_metadata": {
"branch": "master",
"commit_count": 2016,
"repo_created_at": "2022-04-21T13:54: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": "3e3e5fe... |
8daa8cc8-c8ed-4e33-bece-7671355d38be | hasan042021/codeforces_contests | round_920_div_3/D_Very_Different_Array.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
int t;
cin >> t;
while (t--)
{
ll n, m;
cin >> n >> m;
deque<ll> a(n), b(m);
vector<int> v;
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = 0; i < m; i++)... | ALGO | 0.999972 | 3.753623 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-12-18T16:52: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": "5da49f3959aa... |
6f9c1e70-555d-4ec4-9bf8-1cb6891cc527 | NG-Geeks/Leetcode_POTD | December_2023/867. Transpose Matrix.cpp | 867. Transpose Matrix
Given a 2D integer array matrix, return the transpose of matrix.
The transpose of a matrix is the matrix flipped over its main diagonal, switching the matrix's row and column indices.
Solution::
Approach
For the matrix create the matrix of same size and then
assing
matrix2[j][i] ... | ALGO | 0.999965 | 6.430669 | {
"github_metadata": {
"branch": "main",
"commit_count": 161,
"repo_created_at": "2023-10-07T15:43: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": "53aab4370c... |
38b4bc3a-aacf-4405-bd8f-1b71389f3dbb | DHUer/Algorithm-and-Data-Structure | 2017-2018s_Summer/maximum_submatrix.cpp | #include<iostream>
#include<cstring>
#define MIN -999999
using namespace std;
int maxSum(int n,int *a)
{
int local_sum = 0, global__sum = MIN;
for (int i = 1; i <= n;i++)
{
local_sum = local_sum + a[i];
local_sum = max(local_sum, a[i]);
global__sum = max(local_sum, global__sum);
... | ALGO | 0.99998 | 3.575901 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2018-08-14T15:12: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": "123fbd4dc... |
df16eb83-307f-453c-ad1e-b7054a05df0d | MakinoRuki/Codeforces | R575/1196F.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <queue>
#define N 200005
using namespace std;
typedef long long ll;
int n, m, k;
vector<pair<pair<int, int>, int>> edg... | ALGO | 0.999986 | 3.78453 | {
"github_metadata": {
"branch": "master",
"commit_count": 3630,
"repo_created_at": "2017-11-19T03:14: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": "eadc4d4... |
30b023f9-4cdb-498b-bfc0-bb01a98cbdad | sauvik-d/practice_prog | practice_cmi/dp/try2_6.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int minimumMismatches(const string& x, const string& y) {
int m = x.length();
int n = y.length();
// Create the cost matrix c[i][j]
vector<vector<int>> c(m + 1, vector<int>(n + 1, 0));
// Fil... | ALGO | 0.999969 | 5.338047 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-23T14:23: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": "98384bf52292... |
fb7ee3d1-0a7b-4003-b4cb-5eaafca13f60 | ishandutta2007/codeforces-k | kort0n/normal/1158/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
ll n, m;
int main() {
//cout.precision(10);
cin.tie(0);
ios::sync_with_stdio(false);
cin >> n >> m;
multiset<l_l> bo... | ALGO | 0.999912 | 3.026281 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06: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": "e180a4d93d17... |
44723f85-6c3a-4d02-8b67-4a2d9bf620dd | ishandutta2007/codeforces-j | jerome_wei/normal/1070/A.cpp | #include <bits/stdc++.h>
#define IL __inline__ __attribute__((always_inline))
#define For(i, a, b) for (int i = a, i##end = b; i <= i##end; ++ i)
#define FOR(i, a, b) for (int i = a, i##end = b; i < i##end; ++ i)
#define Rep(i, a, b) for (int i = a, i##end = b; i >= i##end; -- i)
#define REP(i, a, b) for (int i = a -... | ALGO | 0.999794 | 3.3748 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:42: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": "5d7f54b3db03... |
6699e045-7b4e-4ef7-a1be-f7d44b3c5043 | HamazingCoding/Lab_Exercises | Lab_Exercises/CDLab/LEQ2/main.cpp | #include <iostream>
#include <fstream>
#include <cctype>
#include <cstring>
using namespace std;
struct Token {
int row;
int col;
const char* type;
char value[100];
};
int lin=1, col=1;
Token getNextToken(FILE *file) {
int i = 0, j, flag;
char c, c1, str[100];
Token token;
token.row ... | TOOL | 0.945533 | 3.545083 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-09-17T03:36: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": "bccfce075307... |
90626a95-7767-4ae3-8bcb-c06fa7b54aca | Mihir8968/ArrayADT | main.cpp | #include "Array.h"
int main() {
// Create an array of size 10
Array arr(10);
// Create the array by taking input from the user
arr.create();
// Display the array
cout << "Array elements after creation: ";
arr.display();
// Append an element to the array
arr.append(5);... | TOOL | 0.961783 | 5.599301 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-08-02T17: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": "95bf47fc291a... |
29850fcb-2223-49e8-9ffb-466152457803 | kivvix/vlasovpp | code/phib.cc | #include <iostream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <fstream>
#include <valarray>
#include <sstream>
#include <complex>
#include <tuple>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
#include <boost/math/constants/constants.hpp>
#include "vlasovpp/f... | ALGO | 0.999724 | 4.375346 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2020-07-18T13:55: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": "f640589d1... |
fdb63463-89fb-4097-82f8-a50f89d0f7ef | amirphl/learning | data-structures/geeks-for-geeks/array/sorting/ropes-left-every-cut.cpp | // https://www.geeksforgeeks.org/ropes-left-every-cut/
//{ Driver Code Starts
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// time: O(nlogn), memory: O(1)
vector<int> RopeCutting(int arr[], int n)
{
vector<int> res;
sort(arr,... | ALGO | 0.99978 | 5.297396 | {
"github_metadata": {
"branch": "main",
"commit_count": 1441,
"repo_created_at": "2022-02-26T18:21:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8167bef8... |
ced77456-952e-4c75-baf1-0ae49e6d5121 | rlatjwls7882/Baekjoon | 04xxx/4055. 파티가 좋아 파티가 좋아/파티가 좋아 파티가 좋아.cc | #include<bits/stdc++.h>
using namespace std;
bool chk[48];
struct party {
int s, e;
bool operator<(const party p) const {
if(e!=p.e) return e < p.e;
return s < p.s;
}
};
int main() {
ios::sync_with_stdio(0); cin.tie(0);
for(int tc=1;;tc++) {
int p; cin >> p;
if(p==... | ALGO | 0.998708 | 3.969914 | {
"github_metadata": {
"branch": "main",
"commit_count": 1418,
"repo_created_at": "2024-09-15T04:27: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": "f02c0145e... |
fae32c58-eb82-457d-b8d0-a3b2cae86bc9 | ruokaizhao/data_structures_and_algorithms | my_code_school/data_structure/reverse_using_stack.cpp | #include <cstring>
#include <iostream>
#include <stack>
template <typename T>
class Stack
{
T C[51];
int topIndex = -1;
public:
void push(T c)
{
C[++topIndex] = c;
}
void pop()
{
topIndex--;
}
T top()
{
return C[topIndex];
}
bool isEmpty()
{
if (topIndex == -1)
ret... | ALGO | 0.993996 | 5.367422 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-03-24T00:23: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": "652cee99f323... |
eaf3eeb4-ae86-46af-b826-c07c2acd14d6 | AvaisSherlocked/LeetCoding | CPP_Files/100.Same Tree.cpp | //
// 100.cpp
//
// Created by Ava on 2018/4/18.
// Copyright © 2018年 Ava. All rights reserved.
//
/**
* 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 {
publ... | ALGO | 0.999608 | 5.85453 | {
"github_metadata": {
"branch": "master",
"commit_count": 159,
"repo_created_at": "2018-04-08T11:04:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aee9a98c... |
8cbf6bd6-8ba8-41ff-9a26-bc76f81045b2 | nishantdhiman30/DAA-Lab | Week-2/1. Repeating Element Count/solution.cc | #include<iostream>
using namespace std;
int binary_search(int *arr, int st, int en, int k){
if(st>en){
return -1;
}
int mid = (st+en)/2;
if(arr[mid]==k){
return mid;
}
if(arr[mid]<k){
return binary_search(arr, mid+1, en, k);
}
else return binary_search(arr, st, m... | ALGO | 0.99984 | 4.09515 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-07-17T17:02:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9c579e15baf... |
3f549ed5-8e17-4d12-a30b-da961080dc8a | ETO-leader/OI | 7fa4/7fa4-5.3.4.2.cpp | #include<bits/stdc++.h>
#define cir(i,a,b) for(int i=a;i<b;++i)
using namespace std;
using VI=vector<int>;
static constexpr int maxsiz=3e4+7;
class ac_automaton{
private:
vector<VI> tr;VI fx,cx;
int cnt,rt;
auto allocm(){return ++cnt;}
public:
auto insert(const VI a){
int u=rt;
for(auto&... | ALGO | 0.999966 | 4.613436 | {
"github_metadata": {
"branch": "main",
"commit_count": 116,
"repo_created_at": "2024-07-08T01:50: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": "8fef72e89e... |
56b3741b-dab4-4fcd-93c2-6c62abcf2235 | OpenFOAM/OpenFOAM-dev | src/MomentumTransportModels/momentumTransportModels/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.H | /*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\... | ALGO | 0.91106 | 6.642208 | {
"github_metadata": {
"branch": "master",
"commit_count": 8589,
"repo_created_at": "2014-12-10T15:47:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1770,
"forks": 642,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "42... |
509552ae-9cf6-44c3-849d-4210083c1ac4 | muhammadhasan01/cp | Online Judge/Codeforces/Contests/EDU-DIV2/EDU-DIV2-74/C.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int q;
long long h;
int n;
int a[N];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> q;
while (q--) {
cin >> h >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
... | ALGO | 0.999868 | 3.726415 | {
"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": "e1f94a8... |
2a16cc94-6358-4fc1-8238-67213cb70e15 | Ashutosh-Badave/JetsonTx2_OpenCV_Basics | CornerHarris_and_NHS.cpp | //
// Created by ashutosh on 03.09.20.
//
#include <iostream>
#include <numeric>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/features2d.hpp>
#include "BCR_adjustment.hpp"
using namespace std;
using namespace cv;
Mat img, imgGray;
string windowName;
void... | ALGO | 0.969902 | 5.297875 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-08-31T08:41: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": "b3bedc94c... |
56e8ca3b-45f7-4c18-9bdf-91c4cafaed72 | ChromiumWebApps/chromium | net/tools/flip_server/create_listener.cc | // Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/tools/flip_server/create_listener.h"
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
#include <netinet/... | TOOL | 0.925566 | 6.961384 | {
"github_metadata": {
"branch": "master",
"commit_count": 260366,
"repo_created_at": "2014-02-21T14:19:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 231,
"forks": 307,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "72... |
756343d0-d162-4242-bff3-6a885b92d418 | facebookarchive/BOLT | libc/src/string/string_utils.h | //===-- String utils --------------------------------------------*- C++ -*-===//
//
// 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
//
//===---------------------------... | TOOL | 0.968015 | 7.213044 | {
"github_metadata": {
"branch": "main",
"commit_count": 410387,
"repo_created_at": "2018-04-24T23:40:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2530,
"forks": 183,
"issues": 66,
"pull_requests": 2
},
"file_meta": {
"content_id": "47... |
84ed6297-263f-4a32-8c2b-8fdeb2f03dee | mingzheTerapines/modern_comipler_learning | 分支预测器实现/多算法并发的预测器/1_bit_predictor.cpp | #include <iostream> // std::cout
#include <thread> // std::thread
#include <mutex> // std::mutex
#include <vector> // std::vector
#include <string> // std::string
#include <set> // std::set
#include <fstream> // std::fstream
#include <algorithm> // std::algo... | ALGO | 0.955614 | 3.760671 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-04-11T07:15: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": "e6f2a624743... |
fc732e84-5db6-4de2-a90b-d14d8db1c447 | Parkhyunseo/PS | SDS/time/time_K_2842.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include <string.h>
using namespace std;
int N;
int result = 100000000;
int dx[8] = {-1, -1, -1, 1, 1, 1, 0, 0};
int dy[8] = {0 , -1, 1, 0, -1, 1, -1, 1};
int sx, sy;
int post_office_count;
char grid[52][52];
int stemina[52][52];
int visited[52][52];
vector... | ALGO | 0.999792 | 3.508119 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2018-11-01T07:20: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": "2354bc004... |
2e72e10c-0366-432b-befd-22b733543676 | truonghuy1011/AlgorithmsofAnalysis | Bai1.8.cpp | //Xay dung Class vector
#include <iostream>
using namespace std;
class Vector{
public:
Vector(const Vector &vt);
Vector(int a);
Vector();
~Vector();
friend istream &operator >> (istream &input, Vector &tmp);
friend ostream &operator << (ostream &output, const Vector &tmp);
Vector operator = (const Vector &tmp);... | ALGO | 0.993608 | 3.20104 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-08-20T08:51: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": "6a7b778b4f... |
548589d7-b912-4a84-abae-587e6a14140b | Yawn-Sean/Daily_CF_Problems | daily_problems/2025/03/0304/personal_submission/cf923c_ntxyl.cpp | #include <bits/stdc++.h>
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define endl '\n'
// #define int long long
#define all(v) v.begin(), v.end()
//#define x first
//#define y second
using namespace std;
typedef pair<int, int> PII;
const int N = 3e5 + 10;
int n, idx;
int Tr[N * 30 + 10][2], sz[N ... | ALGO | 0.999971 | 4.162606 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "6f08... |
84c6bcc4-830b-4a9f-8f5b-f027c90d0208 | SaintCEN/Data-Structure | 算法/动态规划/例题/地雷.cpp | #include <iostream>
#include <cstring>
using namespace std;
void dfs(int x, int *p) {
dfs(p[x], p);
cout << x << " ";
}
int main() {
int N;
cin >> N;
int num[N + 1];
int con[N + 1][N + 1];
int p[N + 1];
memset(con, 0, sizeof(con));
for (int i = 1; i <= N; i++) {
cin >> num[i]... | ALGO | 0.999994 | 3.931978 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2025-02-19T09:28:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3447e516b6c... |
28f00d17-ba50-4776-9670-81acc73734ea | boro741/Daily_Coding | minPalindrome.cpp | #include<iostream>
using namespace std;
bool isEven(int n){
return n%2;
}
typedef struct{
int c;
string s;
}countNode;
countNode insertS2(string s1,string s2,int index){
countNode res;
res.c = 0;
for(int i = index,j=0;i < index + s2.length();){
if(s1[i] != s2[j]){
s1[i] = ... | ALGO | 0.999961 | 4.325549 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2019-02-08T03:20: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": "b3655db69... |
d28cbe73-9899-43e6-9376-10b26486acfc | LykeeKylee/PAT | A_2/1127.cpp | #include<bits/stdc++.h>
using namespace std;
struct node {
int data;
int left_node;
int right_node;
int level;
};
int n, inorder[35], postorder[35];
map<int, int> position;
vector<node> tree;
int build(int pos, int low, int high, int level) {
if(low > high) return -1;
int value = postorder[pos], mid;
mid = posit... | ALGO | 0.999992 | 4.589622 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2020-02-12T10:39:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b3a60c28a... |
65d91760-463a-4c66-af28-5fc0e26615e4 | Alsdnworks/BOJ | 풀이중인문제/BOJ2667푸는중.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
int board[101][101], M, N, i, j, nX, nY, m_lvl;
char b_buffer[101];
pair<int, int> nxt;
bool f_deadend;
void flagtest(int x, int y){
if (board[x][y + 1] == 1){
nxt.first = x;
nxt.second = y + 1;
}
else if (board[x... | ALGO | 0.999982 | 3.388216 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2021-06-22T09:45: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": "362b01c55... |
f6739249-3a0a-4f00-95c7-0c6a33d77050 | shwetajadhav09/a2z-dsa-sheet | Linked List/DLL.cpp | #include<bits/stdc++.h>
using namespace std;
class Node {
public:
int data; // Data of the node
Node* next;
Node* back; // Pointer to the next node in the list
// Constructor for a node with both data and next node provided
Node(int data1, Node* next1, Node* back1) {
data = da... | ALGO | 0.999908 | 5.054175 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2024-01-18T07:45: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": "73526c1b15a... |
533c5745-0fb0-4867-97ee-429dc3f37d83 | gefeng/cp | codeforces/r767div2/D.cpp | #include <iostream>
#include <utility>
#include <cassert>
#include <algorithm>
#include <cmath>
#include <array>
#include <string>
#include <vector>
#include <map>
void run_case() {
int N;
std::cin >> N;
std::vector<std::string> A(N);
std::map<std::string, int> m;
for(int i = 0; i < N; i++) {
... | ALGO | 0.999948 | 5.485429 | {
"github_metadata": {
"branch": "main",
"commit_count": 980,
"repo_created_at": "2022-07-19T19:38: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": "83f9290844... |
bc7458ac-1e00-44f3-bcd3-fd54d2166102 | cms-sw/cmssw | PhysicsTools/PatUtils/plugins/BoostedJetMerger.cc | #include "PhysicsTools/PatUtils/interface/BoostedJetMerger.h"
BoostedJetMerger::BoostedJetMerger(const edm::ParameterSet& iConfig)
: jetToken_(consumes<edm::View<pat::Jet>>(iConfig.getParameter<edm::InputTag>("jetSrc"))),
subjetToken_(consumes<edm::View<pat::Jet>>(iConfig.getParameter<edm::InputTag>("subjetS... | TOOL | 0.948681 | 6.123461 | {
"github_metadata": {
"branch": "master",
"commit_count": 251237,
"repo_created_at": "2013-06-26T14:09:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1144,
"forks": 4480,
"issues": 947,
"pull_requests": 108
},
"file_meta": {
"content_id... |
95329e1b-d5e9-4030-bb88-d1aeb36afb22 | tysm/cpplib | include/cpplib/graph/erdos-gallai.hpp | #pragma once
#include <cpplib/stdinc.hpp>
#include <cpplib/utility/sort.hpp>
/**
* <NAME>.
*
* Provides a graph realization check given
* its vertices degrees.
*
* Time Complexity: O(n).
* Space Complexity: O(n).
* Where n is the size of the graph.
*/
bool erdos(vector<int> degrees)
{
int n = degrees.size... | ALGO | 0.997666 | 6.003477 | {
"github_metadata": {
"branch": "master",
"commit_count": 236,
"repo_created_at": "2019-02-07T02:36:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58dfd637... |
5a1dc1e4-f50e-4a44-95fc-90fdd379f0d2 | marcosa97/CurveDrawer | lineAlgorithms.cpp | #include <iostream>
#include "lineAlgorithms.h"
/*
TEST CASES:
lineDDA (0, 0, 200, 200, pixelBuffer); //dx = dy
lineDDA (0, 200, 200, 0, pixelBuffer); //dx = -dy
lineDDA (0, 0, 30, 299, pixelBuffer);
lineDDA (0, 0, 200, 20, pixelBuffer);
lineDDA (0, 200, 200, 50, pixelBuffer); //Negative
... | ALGO | 0.992964 | 5.280423 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-07-05T23:43: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": "74ee770d87... |
8cd18d62-5633-4a58-b868-20d7db048839 | HeinerOV97/IE0217 | Tareas Previas/Sesion 3/Recursividad.cpp | #include <iostream>
using namespace std;
/*Prototipo de la funcion deberia ir en un archivo .hpp aparte*/
int factorial(int);
int main() {
/*Se declaran las variables*/
int n, result;
cout << "Enter a non-negative number: ";
cin >> n;
/*Se llama a la funcion factorial*/
result = factorial(n);... | ALGO | 0.997812 | 5.29125 | {
"github_metadata": {
"branch": "main",
"commit_count": 179,
"repo_created_at": "2024-01-03T01:28: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": "be83020a12... |
bd16fde6-fac7-4f12-bd72-7289e1d1ee2f | Abu-Taher-Siddiki-Adnan/IIUC | Codeforces/B_Medians.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define all(a) a.begin(), a.end()
#define vi vector<int>
#define vvi vector<vi>
#define vll vector<ll>
#define rev(n) n.rbegin(), n.rend()
#define sz(x) (int)x.size()
#define pb push_back
#define Y cout << "YES" << endl
#d... | ALGO | 0.999816 | 4.008495 | {
"github_metadata": {
"branch": "main",
"commit_count": 200,
"repo_created_at": "2024-10-29T18:17:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40dc16e591... |
fee7d517-ac33-453b-8793-dac30c4cabde | Sonawane-Punam/STL-Library | STL.cpp | /************************************************************
Structure of Singly LL And CL
***********************************************************/
using namespace std;
#include<iostream>
template <class T>
struct node
{
T data;
struct node *next;
struct node *prev;
};
/************... | ALGO | 0.984892 | 3.378709 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-01-24T08:59: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": "8ff2331dcb47... |
9a5f338a-cd50-4956-83ef-75366885d41a | hjosullivan/manihot-lignum | manihot-sf/maniot.cpp | //Your L-system will be similar to this. See
//LEngine README for user caveats, e.g. please do not
//use C++ keywords in comments.
#include <iostream>
using namespace std;
#include <mathsym.h>
#include <ParametricCurve.h>
#include <Uniform.h>
using namespace cxxadt;
#include <LGMUnits.h>
using namespace Lignum;
#in... | ALGO | 0.999664 | 3.787217 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2020-01-30T08:48:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17e0a9176... |
0c7d93b7-2b0b-446c-8be9-c901479df486 | obulshizo/CSA1434-COMPILER-DESIGN | 9.Grammer/9.Grammar.cpp | #include <stdio.h>
#include <ctype.h>
#include <string.h>
#define MAX_LENGTH 100
// Function prototypes
int parse_expr(char *expr, int *index);
int parse_term(char *expr, int *index);
int parse_factor(char *expr, int *index);
int parse_number(char *expr, int *index);
// Function to check if the current character is ... | ALGO | 0.998072 | 6.236321 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-20T04:59:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "536b54cfb472... |
fd7e4910-57fb-4ade-9a82-422c15f11972 | abolshov/Analysis | analyzer/src/EstimatorSingleLep.cpp | #include "EstimatorSingleLep.hpp"
#include <algorithm>
#include <numeric>
#include <unordered_set>
#include "TVector2.h"
#include "Math/GenVector/VectorUtil.h" // DeltaPhi
using ROOT::Math::VectorUtil::DeltaPhi;
#include "EstimatorUtils.hpp"
#include "EstimatorTools.hpp"
EstimatorSingleLep::EstimatorSingleLep(TStri... | ALGO | 0.997996 | 5.355279 | {
"github_metadata": {
"branch": "main",
"commit_count": 475,
"repo_created_at": "2023-03-06T16:07:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d04a35f69a... |
25fff277-01da-44c6-ad34-90354adfbe0c | Lancelof2019/wlgOpenMP04 | functionspace/distanceTransform.cpp | #include "../headerspace/WatershedAlg.h"
#include <queue>
#include <cstdlib>
#include <vector>
#include <string.h>
#define NUMSIZE 8
#define NSIZE 4
using namespace cv;
Array2D<int> &WatershedAlg::distanceTransform(Array2D<int>& matArr, Array2D<int> &markers,int &rows,int &cols,Array2D<int> &plots,Array2D<bool>& vis... | ALGO | 0.999897 | 3.883075 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-11-22T18:02: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": "bac63cb7cee6... |
3ea12306-2c6f-43f8-a38b-0aaa92c2ea64 | suraj-iitb/algorithm-identification | BERT/Data_Dump/Selection/C++14/Code/selection3724452.cpp | #ifdef LOCAL
#pragma GCC optimize ("O0")
#else
#pragma GCC optimize ("O3")
#endif
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9 + 7;
const int MOD = INF;
const ll INF_LL = 1e18 + 7;
#define __overload3(_1, _2, _3, name,...) name
#define rep(...) __overload3(__VA_ARGS__, r... | ALGO | 0.999956 | 3.983411 | {
"github_metadata": {
"branch": "main",
"commit_count": 229,
"repo_created_at": "2020-05-24T06:21:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 10
},
"file_meta": {
"content_id": "302c7e4ff... |
2196d6dd-580a-40d8-acea-dd46c2f4dde9 | GabrielBrasilMelodeOliveira/Estudos_CPP | logica_vetores.cpp | /*Testes usando a lógica de vetores. */
#include <iostream>
#include <vector>
using namespace std;
int main(){
vector <int> vector1;
vector <int> vector2;
vector1.push_back(10);
vector1.push_back(20);
for(int i = 0; i < vector1.size(); i++){
cout << "\nEsse é o valor do vetor 1 na posiç... | TOOL | 0.951027 | 4.699497 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2023-01-27T13:43: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": "bbae87cad27... |
ac2fb634-0dba-43b1-8ee2-56f9123fe18b | inrittik/DSA_Problems | 463-island-perimeter/463-island-perimeter.cpp | class Solution {
public:
int islandPerimeter(vector<vector<int>>& grid) {
int m = grid.size();
int n = grid[0].size();
int r = 0, c = 0;
for(int i=0; i<m; ++i){
for(int j=0; j<n; ++j){
if(grid[i][j]==1){
r = i; c= j;
... | ALGO | 0.999858 | 5.706747 | {
"github_metadata": {
"branch": "master",
"commit_count": 1483,
"repo_created_at": "2022-02-06T15:35:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "851bd85... |
41902858-d9b8-4a21-9035-f2214d12c8d1 | n1uf/USTC-CS-COURSES | 数据结构/sjjgtest2.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXSIZE 100
typedef struct node
{
char ele;
struct node *next;
}LinkNode, *LinkList;
LinkList InitList()
{ // 初始化链表
LinkList p = (LinkList)malloc(sizeof(LinkNode));
p->next = p;
return p;
}
void AddEles(LinkList L, char *str)
{ // 向每个结点加入字符串中的... | ALGO | 0.999988 | 3.509273 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2024-05-28T09:01: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": "738797b1f... |
c2f8dfd2-32a1-4dbf-a6a4-8fc4f29f9c8e | BelisaDi/Algoritmos | Taller 12 (Hash Table)/hashTable.cpp | #ifdef _hashTable_hpp_
template <typename dataType>
class hashFunction{
public:
size_t operator()(const dataType & data){
return static_cast<size_t>(data);
}
};
template <typename dataType>
size_t hashTable<dataType>::hashing(const dataType & data){
hashFunction<dataType> hashFunctor();
return hashFunctor... | ALGO | 0.923695 | 5.70691 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2019-06-10T14:56: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": "b3230e2f6... |
21ceb0ea-728e-41ca-a325-919951a23cee | raghhavtaneja/CSES-ProblemSheet | Introductory Problems/towerOfHanoi.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int long long int
#define toggle(x) x=!x
#define inf 1e9
//VECTOR
#define vi std::vector<int>
#define vc std::vector<char>
#define vl std::vector<long long>
#define pb push_back
const int M = 1000000007;
//PAIR
#define pi pair<int,int>
#define... | ALGO | 0.999853 | 4.211553 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2020-12-29T16:51:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fed939da703... |
6a1c092a-ea29-4a6f-91dd-2c338d9ddfe9 | mehra-deepak/CN-DS-ALGO | DP/02_Min_Steps_To_One/02_Min_Steps_To_1_Using_Memoization.cpp | #include<iostream>
using namespace std;
#include<climits>
int minStepsHelper(int n, int *ans)
{
if(n==1)
{
ans[n] = 0;
return 0;
}
if(ans[n-1]==-1)
{
ans[n-1] = minStepsHelper(n-1,ans);
}
int y = INT_MAX;
int z = INT_MAX;
if(n%2==0)
{
if(ans[n/2... | ALGO | 0.999987 | 4.227575 | {
"github_metadata": {
"branch": "master",
"commit_count": 153,
"repo_created_at": "2020-08-02T12:07: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": "794ca5c9... |
8aaffd11-88ed-406a-b8f0-6ba286e8eff7 | UCLeuvenLimburg/vpw | cat4/tripartite/cpp/WouterE.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
int nrs;
cin >> nrs;
vector<int> getallen;
int sum = 0;
for (int k = 0; k < nrs; k++) {
int x;
cin >> x;
sum += x;
getallen.push_back(x);
}
if (sum % 3 == 0) {
... | ALGO | 0.999745 | 3.296056 | {
"github_metadata": {
"branch": "master",
"commit_count": 329,
"repo_created_at": "2018-12-06T12:16:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b9e84534... |
794c3492-6386-47a6-9922-9cc8cc5bf31e | alexandraback/datacollection | solutions_5756407898963968_0/C++/yyjhao/a.cpp | #include <cstdio>
#include <set>
#include <vector>
using namespace std;
int main() {
int t;
scanf("%d", &t);
for (int ca = 0; ca < t; ca++) {
set<int> nums;
int r1, r2;
scanf("%d", &r1);
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
... | ALGO | 0.994576 | 3.362684 | {
"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": "b2a6ca48f... |
438df040-c2dc-4c12-9cd8-1e123781f88e | S1lver0/Ordenamientos-y-busqueda-con-ficheros-binarios-en-c | Ordenamientos.cpp | #include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
struct alumno
{
char codigo[50];
char nombre[50];
int edad;
}alu2[50];
//prototipos de funcion
//BUSQUEDA Y INTERCAMBIO
void busquedasecuencial(alumno[],int,int);
void inserciondirecta(alumno[],int,int);
void insercionbinaria... | TOOL | 0.997038 | 4.166478 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2022-02-21T17:34: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": "2af3b4320d... |
f8e5fb1f-ed82-43a5-a8aa-4048b646c747 | diegoacuna/tup_ant | ant.h | /**
* Ant+TUP - IA Avazada
* ant.h
* Purpose: Class representing an ant entity.
* @author dacuna <<EMAIL>>
* @version 1.0 10/10/2013
*/
#ifndef ANT_H
#define ANT_H
#include <vector>
#include <lemon/list_graph.h>
#include "array_3d.h"
#include "tup.h"
#include "mersenne_random.h"
#include "game.h"
using namespa... | ALGO | 0.992278 | 4.61669 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2013-10-20T23:04:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a7d49999... |
d5911de8-aec1-4316-bb9b-627974807bc5 | maiphuonghoang/AppleOfMyEye | CTDLGT/BuoiTroGiang/Buoi18/g31.cpp | #include <bits/stdc++.h>
#define el cout << "\n";
#define f0(i,n) for (int i = 0; i < n; i++)
#define f1(i,n) for (int i = 1; i <= n; i++)
#define maxn 100006
using ll = long long;
using namespace std;
int mod = 1e9+7;
/**
* Các ptu k thuộc cùng 1 tplt với 1 số
6 4
1 3
2 3
1 2
4 5
=> 4 5 6
*/
int n, m;
vector<int> ... | ALGO | 0.999883 | 3.485868 | {
"github_metadata": {
"branch": "main",
"commit_count": 178,
"repo_created_at": "2023-05-17T18:10: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": "77c260af15... |
b605adc9-c7b5-4ea8-92c2-eb88193abeeb | youngguncho/ComputerGrahpicsStudy | homework/hw1_raytracing/src/polygon.cpp | #include "math.h"
#include "polygon.h"
Polygon::Polygon(Material mat, int m) : GObject()
{
material() = mat;
N = 0; //number used so far
Max = m; //max number
P = new Point[m];
}
void Polygon::set(Point p)
{
if (N < Max) {
P[N] = p;
N++;
}
}
void Polygon::planeEquation(void)
/*this establishes... | ALGO | 0.966904 | 4.704779 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-04-03T15:29: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": "e9755305be... |
dc2721f4-27c2-4b63-8bc8-e4c2fc591707 | IRMV-Manipulation-Group/SpherizedURDFGenerator | third_party/header_only/igl/segment_segment_intersect.h | // This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2016 <NAME> <<EMAIL>>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
... | ALGO | 0.998443 | 6.377508 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2024-11-01T15:33:57.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 23,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e190518b12... |
4d662ad8-2262-488c-a2cf-6391f476f44f | mao-dongyang/VScode | ADT/labReport/Graph/main.cpp | #include <iostream>
#include <queue>
using namespace std;
queue<int> wait4BFS;
typedef struct Graph
{
int matrix[6][6];
int size;
} Graph;
void enterMatrix(Graph &g, int m[6][6])
{
for (int i = 0; i < g.size; i++)
{
for (int j = 0; j < g.size; j++)
{
g.matrix[i][j] = m[i][... | ALGO | 0.999956 | 4.728432 | {
"github_metadata": {
"branch": "myFirstBranch",
"commit_count": 83,
"repo_created_at": "2020-09-16T21:59:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "c6... |
5447447d-e63c-4d2a-8083-982a3e7fda63 | gbuzykin/lexegen | src/valset.h | #pragma once
#include <array>
#include <cassert>
#include <cstddef>
#include <iterator>
#include <memory>
namespace detail {
constexpr unsigned lsb(unsigned long v) {
unsigned r = 0;
while (!(v & 1)) { v >>= 1, ++r; }
return r;
}
constexpr unsigned alignUp(unsigned v, unsigned base) { return (v + base - 1... | TOOL | 0.915731 | 7.108912 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2021-08-06T13:27:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23b25f1f3... |
e5b23bbd-2be7-4605-a9ef-73c7da80401d | hikaru2003/CPP09 | ex02/PmergeMe.hpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* PmergeMe.hpp :+: :+: :+: ... | TOOL | 0.968513 | 5.746243 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-09-18T09:04: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": "564093350f7e... |
f8f061f2-0ff9-48f0-b9ff-63ae6973e33f | CoderVicky23/Problems | codeforces/1992D.cpp | #include <bits/stdc++.h>
using namespace std;
string Love(string s, int n, int m, int k) {
int ind = 0;
while (ind < s.size()) {
if (s[ind] == 'L') {
ind++;
}
else if (s[ind] == 'C') {
int c_len = 0;
while (ind < s.size() && s[ind] == 'C') {
... | ALGO | 0.999896 | 4.006247 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2024-06-02T17:08: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": "3b04f4e91... |
af1ef1d9-a933-4e10-808c-812e727ff251 | huangminzhe/Program-Files | Luogu/P1063.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 105;
int a[N * 2],dp[N * 2][N * 2],mx;
int main(int argc, char **argv){
int n;
cin >> n;
for (int i = 1;i <= n;i++){
cin >> a[i];
a[n + i] = a[i];
}
a[2 * n + 1] = a[1];
for (int i = 1;i <= 2 * n - 1;i++){
// dp[i][i + 1] = a[i] * a[i + 1] * a[i + ... | ALGO | 0.999931 | 3.354796 | {
"github_metadata": {
"branch": "main",
"commit_count": 247,
"repo_created_at": "2025-01-04T12:45: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": "3c0fa8bd91... |
06f2e2c1-35d0-4332-97a5-bfdd2e5264e6 | shubhi6/DSA_Problems_CPP | sort_K-sorted_array.cpp | //..............Sort K-Sorted Array...........
#include <bits/stdc++.h>
using namespace std;
void sortK(int arr[], int n, int k)
{
int size;
size=(n==k)?k:k+1;
priority_queue<int, vector<int>, greater<int> > pq(arr, arr +size);
int index = 0;
for (int i = k + 1; i < n; i++) {
arr[index++]... | ALGO | 0.999988 | 5.463974 | {
"github_metadata": {
"branch": "main",
"commit_count": 690,
"repo_created_at": "2023-12-30T15:40:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "071a83be1f... |
9401a7a6-742f-414d-ad79-5890c6ae00ba | Yawn-Sean/Daily_CF_Problems | daily_problems/2025/06/0610/personal_submission/cf2044f_mkswll.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 2e5;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
vector divs(MAXN + 1, vector <int> ());
for(int i = 1; i <= MAXN; ++i){
for(int j = i; j <= MAXN; j += i){
divs[j].push_back(i);
}
}
int n, m, q;
cin >> n >... | ALGO | 0.999844 | 3.919388 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "315b... |
245f3db6-14e6-4c5f-9d78-7ca105de57ee | ja10109/CSCI-235-Assignments | Project 8/CodewordGenerator.cpp | /*
<NAME>
CSCI - 235
Project 8
CodewordGenerator.cpp
--implementation for the codewordgenerator class--
*/
#include "CodewordGenerator.hpp"
CodewordGenerator::CodewordGenerator(){}
//default constructor
/**
@post generateShortestWord takes a string pattern and returns the shortest string that matches the pattern
exp... | ALGO | 0.945931 | 4.86828 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2020-11-25T07:15: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": "8b0c9fa6d14... |
dcc9d1b1-e199-4b8a-a439-4502bcb95c8a | voreen-project/voreen | voreen/modules/flowsimulation/ext/openlb/src/particles/subgrid3DLegacyFramework/twoWayCouplings/twoWayHelperFunctionals.h | /* Lattice Boltzmann sample, written in C++, using the OpenLB
* library
*
* Copyright (C) 2019 <NAME>
* E-mail contact: <EMAIL>
* The most recent release of OpenLB can be downloaded at
* <http://www.openlb.net/>
*
* This program is free software; you can redistribute it and/or
* modify it under the ter... | TOOL | 0.913103 | 5.931324 | {
"github_metadata": {
"branch": "main",
"commit_count": 2506,
"repo_created_at": "2024-10-29T14:44:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 18,
"forks": 7,
"issues": 17,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8727887... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.