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 |
|---|---|---|---|---|---|---|---|
2a287420-58ba-4498-b567-90dfda584636 | raffopazzo/depc | dep0/lib/03_typecheck/src/proof_search.cpp | /*
* Copyright <NAME> 2023 - 2025.
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
*/
#include "private/proof_search.hpp"
#include "private/tactics/search_app.hpp"
#include "private/tactics/search_trivial_val... | ALGO | 0.999453 | 5.234335 | {
"github_metadata": {
"branch": "master",
"commit_count": 124,
"repo_created_at": "2023-07-09T17:36:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e61ac62... |
e00fd18e-9417-4249-8db9-df1077dab37e | uiuc-arc/Statheros | experiments/Models/Float/EightSchools_double.cpp | #include <chrono>
#include <ctime>
#include <iostream>
#include <string>
#include <vector>
#include <autoppl/math/math.hpp>
#include <autoppl/mcmc/mh.hpp>
#include <autoppl/expr_builder.hpp>
#include <autoppl/config.hpp>
#include <autoppl/globals.hpp>
using cont_param_t = ppl::util::cont_param_t;
using namespace ... | DATA | 0.959945 | 5.572924 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-12-04T21:00:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d8486b05643c... |
2b49613f-3b6d-4cba-bf26-9e0e5434047a | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/06/0619/personal_submission/cf1051d_buer.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=1e6+10,M=2*N,mod=998244353;
#define int long long
#define uLL unsigned long long
const long long inf=1e18;
typedef pair<int,int> PII;
typedef long long LL;
int n,m,k;
int a[N],b[N];
int f[1010][2010][1<<2];
void solve()
{
cin>>n>>k;
//0 black 1 write
... | ALGO | 0.999963 | 4.128687 | {
"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": "9da9... |
d883e228-45af-415c-836b-095fe9fc083f | memset0/OI-Code | 洛谷/CF194A Exams.cpp | // =================================
// author: memset0
// date: 2018.12.25 22:16:33
// website: https://memset0.cn/
// =================================
#include <bits/stdc++.h>
#define rep(i, l, r) for (register int i = l; i <= r; i++)
namespace ringo {
typedef long long ll;
typedef unsigned long long ull;
temp... | ALGO | 0.999959 | 3.536302 | {
"github_metadata": {
"branch": "master",
"commit_count": 294,
"repo_created_at": "2018-07-31T14:56:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d76269... |
1c7ad350-ccda-40a2-80d5-472fb7b3e89a | hleclerc/LMTpp | include/containers/lm_algorithms.h | ////////////////////////////////////
// Author : <NAME> //
// <EMAIL> //
////////////////////////////////////
#ifndef lm_algorithms_HEADER
#define lm_algorithms_HEADER
#include <containers/mat.h>
#include <containers/number.h>
namespace LMT {
/**
@author Gouttebroze
*/
template <int g=0, class T=double>
struc... | ALGO | 0.999558 | 6.155142 | {
"github_metadata": {
"branch": "master",
"commit_count": 1646,
"repo_created_at": "2015-06-16T12:48:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a15e8e7... |
9d8f6c82-44dd-4637-9e8b-a93469f03258 | AdamYuWen/LeetCode | C++/0567. Permutation in String.cpp | /* Given two strings s1 and s2, write a function to return true if s2 contains
* the permutation of s1. In other words, one of the first string's permutations
* is the substring of the second string.
* Example 1:
* Input:s1 = "ab" s2 = "eidbaooo"
* Output:True
* Explanation: s2 contains one permutation of s1 ("ba... | ALGO | 0.999739 | 6.507289 | {
"github_metadata": {
"branch": "master",
"commit_count": 329,
"repo_created_at": "2016-03-06T02: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": "3540b9f9... |
f1e8c6b7-4fe4-4e07-8228-82808dbe5d87 | Eperix/Toon-UE | Engine/Source/Runtime/Engine/Private/Matrix3x4.cpp | // Copyright Epic Games, Inc. All Rights Reserved.
#include "Matrix3x4.h"
static inline void TransposeTransform(FMatrix3x4& DstTransform, const FMatrix44f& SrcTransform)
{
#if PLATFORM_ENABLE_VECTORINTRINSICS
VectorRegister4Float InRow0 = VectorLoadAligned(&(SrcTransform.M[0][0]));
VectorRegister4Float InRow1 = Vec... | ALGO | 0.958142 | 7.27151 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2025-02-12T17:17:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9bfdbe47a02... |
5bc1361a-290b-42da-9962-fe6e5d133063 | D4PHOENIX/Semester-1-PF-Lab | Extras/RA3Q2.cpp | #include <iostream>
using namespace std;
int main(){
int num, onethDigit, tenthDigit;
string oneth, tenth;
while(num<1 || num>99){
cout<<"Enter a number: ";
cin>>num;
}
if (num<11 || num>19){
onethDigit = num%10; tenthDigit = num/10;
}
else{
onethDigit = num;
}
s... | TOOL | 0.992051 | 4.250963 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2023-01-24T18:58: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": "23a2097324e... |
29d76946-7b6a-41aa-9166-88457049e0dd | QbitQuantum/Basics | Исходники/PathSimplify.cpp | // fit a polyline to a bezier patch, return true is treshhold not exceeded (ie: you can continue)
// version that uses tables from the previous iteration, to minimize amount of work done
bool Path::AttemptSimplify (fitting_tables &data,double treshhold, PathDescrCubicTo & res,int &worstP)
{
Geom::Point start,end;
... | ALGO | 0.999739 | 4.371874 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2024-03-06T07:05:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "282bb81a6a0... |
268eec61-7450-4480-927e-65bd206749ca | SAYAN281/hacktoberfest-2022 | leetcode/union_of_two_sorted_array.cpp | #include <bits/stdc++.h>
using namespace std;
void PrintArray(int n, int c[])
{
for (int i = 0; i < n; i++)
{
cout << c[i] << " ";
}
cout << endl;
}
int Union(int n, int a[], int b[], int c[])
{
int i = 0;
int j = 0;
int k = 0;
while (i < n || j < n)
{
if (a[i] < b[... | ALGO | 0.999996 | 4.297867 | {
"github_metadata": {
"branch": "main",
"commit_count": 115,
"repo_created_at": "2022-10-21T19:52:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 19,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "ca3d525a0... |
7cb0b274-9a16-43c9-8822-e4df07127ebd | fh-technikum-heatwave/fprog | lv2/Example 3-20230917/median_t.cpp | #include <iostream>
// Silly square function that is not immutable and not pure
auto silly_square = [](double x) -> double
{
std::cout << "Calculating the silly square of " << x << "\n";
double result = 0;
for (int i = 0; i < x; ++i)
{
result += x;
std::cout << "Iteration " << i + 1 << ... | ALGO | 0.999973 | 6.72222 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-09-10T12:22:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "55da8bc39ac4... |
07954f97-45cb-4bfa-86f3-bf5f0a81f4ea | Alex-Oiko/3rd-Year-Project | Matrix/MatrixRun/WriteCore.h | //
// WriteCore.h
// Matrix
//
// Created by <NAME> on 23/02/2013.
// Copyright (c) 2013 <NAME>. All rights reserved.
//
#ifndef __Matrix__WriteCore__
#define __Matrix__WriteCore__
#include <iostream>
#include <map>
#include <vector>
#include <string>
#include "Task.h"
#include "Dealer.h"
#include "Cores.h"
#incl... | ALGO | 0.905607 | 5.059176 | {
"github_metadata": {
"branch": "master",
"commit_count": 134,
"repo_created_at": "2012-10-31T17:39: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": "c6accffd... |
9fd2d8c7-e116-415d-9b71-6751e22986a8 | satyajitnayk/dsa | DP/**0-1-knapsack.cpp | *Since the data are not uniform we can not apply greedy here, instead we will use Dynamic Programming.
**f(i,w) => Maximum profit gained if bag size is w & elements from index 0 to i are allowed.
Approach 1: Recursion
#CODE:
int f(int i,int W, vector<int> &A,vector<int> &wt) {
if(i==0) {
if(wt[0] <= W) return ... | ALGO | 0.999999 | 5.830157 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2022-07-31T17:07:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d408e8a862... |
9af165f2-4793-4772-99dd-cbd6a75e026a | makaravind/MissionRnD-C-BinarySearchTree-Worksheet | src/SortedArraytoBST.cpp | /*
Given a Sorted Array of integers .Create a new Balanced Binary Search Tree from the Array
and return the head of the new BST .
Ex : Input : [1,6,10]
Output : A new BST which structure is as follows
6
/ \
1 10
A BST is said to be balanced ,when it satisifes the following property
Every node's Difference of L... | ALGO | 0.999975 | 4.88992 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2016-03-24T12:47: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": "c21ccd0b7... |
df562717-3096-40f1-82e5-6089b0cf1ec9 | hyjk826/baekjoon | 백준/Gold/1727. 커플 만들기/커플 만들기.cc | #include <bits/stdc++.h>
#define fastio \
ios_base::sync_with_stdio(0); \
cin.tie(0);
#define vi vector<int>
#define vl vector<long long>
#define vc vector<char>
#define vs vector<string>
#define pi pair<int, int>
#define pl pair<ll, ll>
#define vp vector<pi>
#define vpl vector<pl>
#define ll long ... | ALGO | 0.99999 | 4.103014 | {
"github_metadata": {
"branch": "main",
"commit_count": 2540,
"repo_created_at": "2022-05-26T21:55:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "abbf9c6dd... |
da3e6c90-9550-4dfd-b32d-a954f3d8d190 | smaranikamondal/GFG-POTD-Solutions | Difficulty: Easy/Stock Buy and Sell – Max one Transaction Allowed/stock-buy-and-sell-max-one-transaction-allowed.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int maximumProfit(vector<int> &prices) {
// code here
int maxCount = 0;
int buyPrice = prices[0];
for(int i = 1;i<prices.size();i++) {
if(prices[i] > bu... | ALGO | 0.99792 | 6.087266 | {
"github_metadata": {
"branch": "main",
"commit_count": 742,
"repo_created_at": "2023-11-03T16:10: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": "c55bbefbd3... |
222fd0d6-2325-481f-9809-661a19abda3f | ipaljak/oj | codeforces/342/B.cpp | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <stack>
#include <string>
#include <vector>
#include <queue>
#define MAXN 100010
using namespace std;
typedef long long llint;
typedef pair<int, int> pii;
int ... | ALGO | 0.999913 | 3.287376 | {
"github_metadata": {
"branch": "master",
"commit_count": 518,
"repo_created_at": "2021-01-07T09:28:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "05021b1b... |
d43e1311-f175-45fe-bd91-fc16a7859935 | anagorko/kinf | zajecia/jbielecki/game of life/life.cpp | //
// Szablon gry w Allegro 5. (C) <NAME>
//
#include <allegro5/allegro.h>
#include <allegro5/allegro_primitives.h>
#include <allegro5/allegro_font.h>
#include <allegro5/allegro_ttf.h>
#include <iostream>
using namespace std;
const int screen_w = 1024; // szerokość ekranu (screen width)
const int screen_h = 530; ... | ALGO | 0.945926 | 3.431506 | {
"github_metadata": {
"branch": "master",
"commit_count": 1563,
"repo_created_at": "2013-01-29T15:23:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 12,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "91725c... |
f075b126-7d3a-450a-b3dd-ab3da5578677 | up210710/UP210710_CPP | U3 Fuctions/E02_cuadratica.cpp | #include <iostream>
#include <cmath>
using namespace std;
const double E=2.7182818284;
int doble(int a)
{
int r;
r = a * 2;
return r;
}
int sumatoria(int n)
{
int r = 0;
for (int i = 0; i <= n; i++)
{
r = r + i;
}
return r;
}
double Ec(int x)
{
double r;
r = pow(x, 2) - ... | ALGO | 0.997281 | 3.664571 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2022-09-09T18:23: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": "0c9389d0ade... |
db5d921a-c32a-4a06-9eb2-2b934730f1d8 | SurajBichkunde39/competitive_coding | 97_Change_Start_Node.cpp | /*
Make the nth node from end of linked list as starting node.
You just need to return the head of new linked list, don't print the elements.
Input format :
Line 1 : Linked list elements of length n (separated by space and terminated by -1)
Line 2 : An integer N i.e. the position of new head from last node.
Output fo... | ALGO | 0.999968 | 4.287628 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-01-21T15:01: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": "dd7d85accf... |
6af02de9-3779-43e9-ac72-07a22dbedc5d | alexdimitrov2000/FMI_UP | Seminar_Exam1/Task03/Task03.cpp | #include <iostream>
using namespace std;
int main()
{
int num;
cin >> num;
int leftTriangleSpaces = 0, rightTriangleSpaces = num - 3;
for (int rows = 1; rows <= num; rows++)
{
for (int spaces = 0; spaces < num - rows; spaces++)
{
cout << " ";
}
cout << "*";
if (rows == 1 || rows == num) {
for (in... | ALGO | 0.999964 | 4.044091 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-02-04T13:50:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e472a337a9... |
1143e276-10da-4da5-bb72-77286cf7e7ed | deepam20050/IOI-training-archive | solutions/ZCO15004.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 100010, Y = 500, X = 100000;
pair <int, int> a[N];
stack < pair <int, int> > s;
int main() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; ++i) {
int x, y;
scanf("%d %d", &x, &y);
a[i] = {x, y};
}
a[n] = {X, Y};
sort(a, a + n + 1);... | ALGO | 0.999916 | 3.526582 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-10-31T10:44: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": "9a8d4be9afb7... |
5a554fd7-e452-4b34-b76b-c0d3f5d03623 | MaxKuznets0v/HwProj | Files/HashTable.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <Windows.h>
#include "List.h"
using namespace std;
template <typename T>
class OurList
{
template <typename T>
class Node // typical list node but has a count field
{
public:
T data;
Node *next;
int count = 0; // shows how word count
Node(T ... | TOOL | 0.975108 | 3.879222 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2019-07-16T13:37: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": "82dbd2ab7... |
09bd5dcc-d3a7-4eb4-b431-5b17a6e3de15 | Nayem73/Problem_Solving | LeetCode/35.Search_Insert_Position.cpp | class Solution {
public:
int searchInsert(vector<int>& nums, int target) {
int n = nums.size();
int lo = 0, hi = n-1;
int got = -1;
while (hi >= lo) {
int mid = (lo+hi)/2;
if (nums[mid] == target) {
got = mid;
break;
... | ALGO | 0.999959 | 5.922192 | {
"github_metadata": {
"branch": "main",
"commit_count": 464,
"repo_created_at": "2022-12-29T10:31: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": "3d09c3054f... |
167fecf9-e003-48aa-baa4-8ebccdd71561 | davinchooo/Algoritmos | Preparcial.cpp | #include <iostream>
#include <vector>
using namespace std;
void bubble_sort(vector <string > & v){
int minimo=v[0].length();
int a;
string b,c;
for(int i=0; i< v.size(); i++){
for( int j=i; j<v.size(); j++){
if(v[j].length() <= minimo){
minimo=v[j].length();
... | ALGO | 0.999724 | 4.680359 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2022-09-06T13:42:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9f8c81a507... |
48e8db1d-bfa1-4534-a9b7-655bbce470d8 | greedkiss/ACM_practice | tree124.cpp | #include <iostream>
#include <cstdio>
#include <climits>
#include <algorithm>
using namespace std;
struct treeNode{
int val;
struct treeNode* left;
struct treeNode* right;
};
int res = INT_MIN;
int maxLength(treeNode* root){
if(root == NULL) return 0;
int left = maxLength(root->left);
int rig... | ALGO | 0.999958 | 4.063423 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-03-10T03:40: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": "85feb35f3... |
cbd08672-33bd-4150-9243-5986a8790843 | XUWENYUhohai/vins_select_ws | src/utility/state_defs.h | #pragma once
#include <vector>
#include <utility>//pair
#include <map>//map
#include <Eigen/Dense>
//! 11.30 数量有待测试 3 , 4
#define HORIZON 3 ///< number of frames to look into the future
#define STATE_SIZE 9 ///< size of state as defined in paper III-B1,
///< which comes from the linear IMU mod... | ALGO | 0.982473 | 5.824024 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-09-18T01:51: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": "f2763f2a030f... |
bbee2d2d-b20a-42a7-8e49-048d0650416a | nealwu/competitive-programming | flow/max_weight_closure.cc | #include <algorithm>
#include <array>
#include <cassert>
#include <iostream>
#include <limits>
#include <queue>
#include <vector>
using namespace std;
const int INF = int(1e9) + 5;
enum edge_type : uint8_t { DIRECTIONAL, DIRECTIONAL_REVERSE, BIDIRECTIONAL };
// Warning: flow_t must be able to handle the sum of flows... | ALGO | 0.999979 | 4.52405 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2021-08-09T18:52:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 348,
"forks": 73,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d29eae... |
4eb546d5-df03-4b94-aaad-6b02870173d3 | Epic-Doughnut/sleev | src/linear2ph.cpp | // [[Rcpp::depends(RcppEigen)]]
#include <RcppEigen.h>
#include <iostream>
#include <ctime>
#include <cmath>
#include <string>
#include "utility.h"
using namespace Rcpp;
double WaldLinearMEXYGeneralSplineProfile (MatrixXd pB, RowVectorXd p_col_sum,
VectorXd q_row_sum, MatrixXd p, MatrixXd p0, MatrixXd P_theta, Ma... | ALGO | 0.999971 | 5.232175 | {
"github_metadata": {
"branch": "main",
"commit_count": 117,
"repo_created_at": "2021-10-29T16:58:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34aea7ddb3... |
cc932278-3db2-49ed-838a-1042d08e5e88 | LorenzoMaci/Programmazione-I | MerryChrismas/PRIME_VOLTE/2.cpp | /*.Due stringhe si dicono sorelle se hanno lo stesso
numero di vocali. Scrivere un metodo che prenda in
input una matrice A di puntatori a stringhe, e
restituisca un boolean che indichi se esiste una
colonna di A in cui sono puntate almeno due stringhe
sorelle. */
#include<iostream>
#include<string>
using namespace s... | ALGO | 0.98474 | 3.596323 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-10-16T12:58: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": "3cf649fa39... |
a85249fd-3354-499b-8d73-7c6e40e44da6 | Gimet2507/Smart_Water_Treatment | Smart_Water_Treatment/smart_water_treatment.ino | /*---------- Mendefinisikan template ID, Nama, dan Token otentikasi pada Blynk ----------*/
//
#define BLYNK_TEMPLATE_ID "TMPL6pd_Fqf8J"
#define BLYNK_TEMPLATE_NAME "Smart Water Treatment"
#define BLYNK_AUTH_TOKEN "<PASSWORD>"
/*---------- Mengimport Library yang dibutuhkan ----------*/
#include <ESP8266WiFi.h> ... | TOOL | 0.959202 | 5.433746 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-07-14T13:40: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": "549e0c25e7d7... |
03e3e299-edee-4816-97dc-79abd98c7db6 | billsioros/Googolplex | src/trie.h | /* C++ Trie (Inverted Index) implementation by <NAME> */
#ifndef __TRIE__
#define __TRIE__
// Posting List Implementation:
class PList
{
friend class Trie;
PList(const unsigned);
~PList();
public:
double IDF; // Inverse Document Frequency
unsigned documentNum; // C... | ALGO | 0.973427 | 5.876621 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-03-20T14:27:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "5f185fced2... |
d2a7f831-0298-4a8e-b970-aac79ce7bcf1 | DongJunK/Algorithm | boj/1707.cpp | #include <iostream>
#include <cstring>
#include <vector>
using namespace std;
vector<int> node[20001];
int colored[20001];
int flag = true;
void dfs(int n,int color)
{
if(colored[n] == 0 )
{
colored[n] = color;
}
else if(colored[n] != color)
{
flag = false;
return;
}
... | ALGO | 0.999949 | 4.906519 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-04-04T05:56: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": "4367485d4... |
fcfa4984-d622-4d86-9e54-670c36a85fde | firiexp/contest_log | yukicoder/972.cpp | #include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>
#include <cassert>
static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using names... | ALGO | 0.999974 | 4.16251 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2018-09-25T02:26: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": "0faf8b39e... |
b11a43de-b17e-4a83-8558-27f0334b52d2 | Jeetu855/c- | Section 7 arr vec/vectors.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
// vector<char> vowels (5); //automatically set to zero
// vector<int> test_scores {100,98,91,78,81};
// vector<double> high_temp(365,80); //*365 is size of vector and all values initialised to 80;
//* vector have1)dynamic siz... | TOOL | 0.949019 | 3.343434 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2022-01-19T07:22: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": "9b04651e4a... |
bdbbe2e1-326c-4228-bad4-c8c14da7a3c7 | indjev99/Small-Projects | Art-Random-Generators/Ascii-Art-Random-Generators/Bunny-Generator.cpp | #include<iostream>
#include<vector>
#include<cstdlib>
#include<ctime>
#include<conio.h>
#include<math.h>
#include<windows.h>
using namespace std;
string m[6],c[6];
string MBD;
int w;
vector<string> vars[256];
vector<int> colours,scolours;
int cnt_small=0,cnt_mid=0,cnt_big=0,cnt_mega=0,cnt_white=0,cnt_light_gray=0,cnt_d... | TOOL | 0.90986 | 3.194766 | {
"github_metadata": {
"branch": "master",
"commit_count": 135,
"repo_created_at": "2015-12-10T13:28:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43b85086... |
58e711eb-060e-41d3-8b4d-6d0517412548 | brussell123/3drr2011 | code/LIBS/BSE-1.2/group/filterbank.hh | // Copyright (C) 2002 <NAME> <<EMAIL>>
// Copyright (C) 2002 <NAME> <<EMAIL>>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any la... | ALGO | 0.989566 | 5.978691 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2012-06-19T01:38:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "976fe556f... |
bf597ed3-36d0-4e26-b224-7cf824224398 | ShiboYao/Leetcode_cpp | 0013_roman_to_integer.cpp | #include <iostream>
#include <unordered_map>
using namespace std;
class Solution {
private:
unordered_map<char,int> mp;
public:
int romanToInt(string s) {
mp['I'] = 1;
mp['V'] = 5;
mp['X'] = 10;
mp['L'] = 50;
mp['C'] = 100;
mp['D'] = 500;
mp['M'] = 1000;... | ALGO | 0.999813 | 5.259379 | {
"github_metadata": {
"branch": "master",
"commit_count": 304,
"repo_created_at": "2019-06-17T12:20: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": "5b90d40b... |
8d8e273d-d764-4db2-8bfa-91d2c80610f0 | gagandeepahuja09/Hashing | LeetCode/Insert Delete GetRandom O(1).cpp | class RandomizedSet {
public:
int size;
unordered_map<int, int> mp;
vector<int> v;
/** Initialize your data structure here. */
RandomizedSet() {
v.clear();
mp.clear();
size = 0;
}
/** Inserts a value to the set. Returns true if the set did not already contain the... | ALGO | 0.962261 | 6.11994 | {
"github_metadata": {
"branch": "master",
"commit_count": 123,
"repo_created_at": "2019-03-20T10:16: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": "634829a9... |
461b6871-188f-4e02-9387-5f1eb5565737 | anveshi/Competitive-Programming | codeforces/148-D/148-D-7652607.cpp | #include<bits/stdc++.h>
using namespace std;
map<pair<int, int>, double> memo;
double jugnu(int W, int B) {
if (W <= 0) return 0;
if (B <= 0) return 1;
pair<int, int> args = make_pair(W, B);
if (memo.find(args) != memo.end()) {
return memo[args];
}
double ret = W * 1.0 / (W + B), cont_prob = B * 1.0 / (W + B);... | ALGO | 0.991428 | 4.002957 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-02-12T06:24: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": "4802cb304f... |
2f1a2af8-cbc5-42ff-8691-965e6c47995c | AgileTrossDev/codesignals | c_plus_plus/uber/closestLocation/closestLocation/main.cpp | //
// main.cpp
// closestLocation
//
// Created by <NAME> on 1/28/19.
// Copyright © 2019 <NAME>. All rights reserved.
//
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <ctype.h>
#include <set>
#include <math.h>
using std::vector;
using std::set;
using std::string;
using std::f... | ALGO | 0.999652 | 4.949439 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2018-12-14T21:24: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": "df98a680d... |
c05b523c-ba56-425c-b7a5-106446687161 | MarbinSpectrum/Algorithm- | StudyData/백준/1214(쿨한 물건 구매).cpp | #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif #include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstr... | ALGO | 0.999893 | 3.70567 | {
"github_metadata": {
"branch": "master",
"commit_count": 463,
"repo_created_at": "2019-05-27T15:30:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c21d8ebd... |
ba67d900-849c-425c-9a3f-4bb5b231aeb9 | alisw/AliPhysics | PWGMM/Mult/AliSPDppAnalysisTaskData.cxx | /**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
* Author: The ALICE Off-line Project. *
* Contributors ... | DATA | 0.955889 | 5.650325 | {
"github_metadata": {
"branch": "master",
"commit_count": 89208,
"repo_created_at": "2016-06-21T19:31:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 104,
"forks": 792,
"issues": 0,
"pull_requests": 9
},
"file_meta": {
"content_id": "050... |
287cb616-7876-46a6-b206-313594a15354 | MehmoonaAbbasi/LAB5-DSA | DSA LAB#5T3.cpp | #include <iostream>
#include <string>
using namespace std;
struct Player {
string name;
int score;
Player* next;
Player* prev;
};
class GolfTournament {
private:
Player* head;
public:
GolfTournament() : head(NULL) {}
Player* createPlayer(const string& name, int score) {
Player* ne... | ALGO | 0.998712 | 5.889323 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-03-04T17:23: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": "f210161f7809... |
1a081144-b13f-4686-975f-861458c9e918 | wdiiahk/procon-archive | atcoder.jp/abc107/abc107_b/Main.cpp | //デバッグ用オプション:-fsanitize=undefined,address
//コンパイラ最適化
#pragma GCC optimize("Ofast")
//インクルードなど
#include <bits/stdc++.h>
// #include <atcoder/all>
using namespace std;
// using namespace atcoder;
typedef long long ll;
using vint = vector<int>;
using vll = vector<ll>;
using vs = vector<string>;
using vbool = vector<bo... | ALGO | 0.999949 | 4.103835 | {
"github_metadata": {
"branch": "main",
"commit_count": 544,
"repo_created_at": "2021-03-07T00:32:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ff4533f02... |
e7dec212-a854-41e2-b4c7-5bdb941693ca | ishandutta2007/codeforces-h | hellkitsune/normal/424/C.cpp | #include <cstdio>
#include <cmath>
#include <string>
#include <sstream>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <map>
#include <set>
#include <list>
#include <queue>
#include <stack>
#include <vector>
using namespace std;
#define pb push_back
#define mp make_pair
#define REP(i, n) for (in... | ALGO | 0.999989 | 4.028338 | {
"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": "f12333889594... |
374e6ebc-9540-4b41-8bbf-119018016113 | sssSSSay/Code | Practice/USACO/[USACO]1547.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int Maxn = 20100;
int n, m, h[Maxn], ans, fa[Maxn];
struct node {
int u, v, c;
} e[Maxn];
int find(int x) {return x == fa[x] ? x : fa[x] = find(fa[x]);}
bool comp(node a, node b) {return a.c < b.c;}
int main... | ALGO | 0.999938 | 3.525671 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-01-08T07:25:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d248c7571d... |
36f98425-ebaa-4bc2-a634-ee57170b35f0 | eashwaranRaghu/Data-Structures-and-Algorithms | References/Competitive Programming 3/ch3/UVa11292.cpp | // The Dragon of Loowater
#include <bits/stdc++.h>
using namespace std;
#define MAX_nm 20010
int dragon[MAX_nm], knight[MAX_nm];
int main() {
int n, m;
while (scanf("%d %d", &n, &m), (n || m)) {
int d, k;
for (d = 0; d < n; d++) scanf("%d", &dragon[d]);
sort(dragon, dragon+n);
for (k = 0; k < ... | ALGO | 0.999936 | 3.247439 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2019-07-12T14:53:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba4f76a55... |
db8db33f-02f3-4bfd-a029-11a4e2241412 | ishandutta2007/codeforces-r | rama_pang/normal/1453/B.cpp | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
const lint MOD = 1e9 + 7;
lint Power(lint n, lint x) {
lint res = 1;
for (; x > 0; x /= 2, n = 1ll * n * n % MOD) {
if (x & 1) {
res = 1ll * res * n % MOD;
}
}
return res;
}
void Main() {
int n;
cin >> n;
vector<lint> a... | ALGO | 0.999759 | 4.743632 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:58: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": "88cdeb57882a... |
924df181-95dc-42e6-960a-257f76b44ce8 | lchriste07/Algorithms-code | radix-sort.cpp | #include <iostream>
using namespace std;
void countSort(int** arr, int size, int k) {
int* count = new int[4]; //accounting for all possible values in vectors
int** newArr = new int*[size];
int i, j;
//initializes counters to zero
for(i = 0; i < 4; i++) {
count[i] = 0;
}
//allocate space for all ... | ALGO | 0.999828 | 4.818094 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-04-23T23:10: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": "441086d6da39... |
2bd61ef6-59a0-4610-af1f-66661e6a8aa2 | genxium/Leetcode | p895_Maximum_Frequency_Stack/submission_slow.cpp | bool debug = false;
typedef pair<int, vector<int>> OCCURRENCE_T; // {value, stack of occurrence times of this value}, a "vector" is used here instead of "stack" to make use of fast continuous mem copying
struct OccurrenceCmp {
bool operator() (OCCURRENCE_T const& lhs, OCCURRENCE_T const& rhs) const {
return... | ALGO | 0.997893 | 5.642605 | {
"github_metadata": {
"branch": "master",
"commit_count": 510,
"repo_created_at": "2020-05-05T14:53:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e2a2bc7... |
e3fed64b-76d8-4b70-b5d4-6d159d5e6970 | chinuhub/ProofTraPar | src/ProofAFA/AFAGen.h | /*
* AFAGen.h
*
* Created on: 15-Jun-2015
* Author: jaganmohini
*/
#ifndef PROOFAFA_AFAGEN_H_
#define PROOFAFA_AFAGEN_H_
#include"../Parser/Program.h"
#include<memory>
#include<map>
#include<set>
#include<vector>
#include<unordered_map>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/graphvi... | ALGO | 0.980694 | 4.485179 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2015-09-28T09:13: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": "77e0b56e3... |
e93ec82b-8afd-49db-aea3-36f5a2731dd0 | syohex/leetcode | challenge/202410/permutation_in_string/main.cpp | #include <cassert>
#include <string>
#include <vector>
bool checkInclusion(const std::string &s1, const std::string &s2) {
int len1 = s1.size();
int len2 = s2.size();
if (len1 > len2) {
return false;
}
std::vector<int> v1(26, 0);
for (char c : s1) {
++v1[c - 'a'];
}
s... | ALGO | 0.999431 | 6.641826 | {
"github_metadata": {
"branch": "master",
"commit_count": 1794,
"repo_created_at": "2020-06-01T00:08:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e2f99b... |
efd18004-f035-4595-ac3b-cede3f9ef62a | jinianyoushang/xd_code_template | acm模板/拓扑排序.cpp | #include <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
//拓扑排序1
bool canFinish(vector<vector<int>> &prerequisites) {
if (prerequisites.empty()) return false;
unordered_map<int, int> inDegree; // 记录每个节点的入度
unordered_map<int, vector<int>> adjacencyList; // 邻接表表示的有向图
// 构建邻接表... | ALGO | 0.999989 | 6.120755 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2023-08-01T11:37:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8675cd07... |
df5b3559-13c4-45eb-8b86-1cfceaf83edc | resetius/linal | src/solver.h | #ifndef SOLVER_H
#define SOLVER_H
/* -*- charset: utf-8 -*- */
/*$Id$*/
/* Copyright (c) 2009-2015 <NAME>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source co... | TOOL | 0.919401 | 5.588465 | {
"github_metadata": {
"branch": "master",
"commit_count": 135,
"repo_created_at": "2020-05-15T14:58: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": "ebc7e6cb... |
5803981c-71c2-4c93-a3d2-9dc4b6c3d122 | Barada32/PD225 | SORT_VYBOR.cpp | #pragma once
#include "SORT_VYBOR.h"
template<typename Mytype>
void SortVybor(Mytype arr[], const int length)
{
int min, poz, kol = 0;
for (size_t i = 0; i < length; i++)
{
//записываеем в минимум первый элемент в неотсортированном участке массива
min = arr[i];//назначаем минимум
poz = i;//позиция минимума... | ALGO | 0.998796 | 4.018263 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-01-19T18:23: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": "9a6e1f0327... |
cb5e4f10-01f1-4137-b596-95207891d6ef | Gautam-J/cp-problems | src/cAPSlOCK.cpp | /* CF - 1000 */
/*
A. cAPS lOCK
time limit per test0.5 second
memory limit per test256 megabytes
inputstandard input
outputstandard output
wHAT DO WE NEED cAPS LOCK FOR?
Caps lock is a computer keyboard key. Pressing it sets an input mode in which typed letters are capital by default. If it is pressed by accident, it ... | ALGO | 0.999272 | 4.537871 | {
"github_metadata": {
"branch": "main",
"commit_count": 277,
"repo_created_at": "2021-07-25T08:32:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "961778dc52... |
da8b9515-3ecd-4cc0-8899-2baa02588246 | Vakhnovetsky/Algorithms | s4/Task_B_Break me.cpp | #include <iostream>
#include <random>
#include <string>
int GetHash(std::string& str, int q = 1000, int R = 123987123) {
uint64_t res = 0;
for (char ch : str) {
res = (res * q + (int)(ch)) % R;
}
return res;
}
void GetStringRandom(std::string& str, int n) {
for (int i = 0; i < n; ++i) {
std::random_device de... | ALGO | 0.987835 | 3.995911 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-01-15T19:49: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": "f09fb3d5df67... |
cba31467-6b6e-4dbe-a356-1ce791af3aca | Infisical/infisical-cpp-sdk | include/libinfisical/InfisicalClient.h | #pragma once
#include <string>
#include <optional>
#include "../../lib/json.hpp"
#include <cpr/cpr.h>
// we are using std::optional which nlohmann doesn't support by default, so we're overwriting the default serializer to support it
namespace nlohmann
{
template <typename T>
struct adl_serializer<std::optional<T>>... | TOOL | 0.926898 | 7.508247 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2025-04-15T23:37:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "80201e6b1932... |
7f141f53-1487-4d1e-9d8c-b7569b38001f | LisaMrc/IMAC_1-2_PA_TDs | TD07/src/graph.cpp | #include "graph.hpp"
#include <unordered_map>
#include <iostream>
#include <stack>
#include <queue>
#define FAR_AWAY 999
void Graph::WeightedGraph::add_vertex(int id)
{
auto it = adjacency_list.find (id);
if (it == adjacency_list.end())
adjacency_list[id];
else
std::cout << id << " is alrea... | ALGO | 0.999753 | 3.945813 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2024-02-26T16:25:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d237d52e10a... |
110c5cee-a8c9-4a90-b550-6c9a51e136bf | akotadi/Competitive-Programming | Interview/InterviewBit/Math/Combinatorics/Grid Unique Paths.cpp | /*
A robot is located at the top-left corner of an A x B grid (marked ‘Start’ in the diagram below).
Path Sum: Example 1
The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked ‘Finish’ in the diagram below).
How many possible unique... | ALGO | 0.999737 | 5.387749 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2019-03-21T19:12:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52429af99... |
53fac081-3214-41b2-a5c3-e940da7af2e0 | satya-supercluster/DSA | Graph/TopologicalSortBFS.cpp | #include<bits/stdc++.h>
using namespace std;
constexpr chrono::seconds TimeLimit = 3s;
// Code Here:
int Main(){
int n,m;
cin>>n>>m;
vector<vector<int>> adj(n+1);
vector<int> indegree(n+1,0);
for(int i{};i<m;i++){
int u,v;
cin>>u>>v;
adj[u].push_back(v);
indegree[v]+... | ALGO | 0.999998 | 4.668347 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-01-30T12:03:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc1772d4f361... |
a8a72635-4b21-41d3-b79b-e45b71473f8a | shantanuhallur/DSA-problems | Perfect Sum Problem - GFG/perfect-sum-problem.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
int t[1001][1001];
int mod = 1e9 + 7;
public:
int subsetSum(int arr[], int n, int sum) {
if(n==0&&sum==0) return 1;
if(n==0) return 0;
if(t[n][sum]!=-1) return ... | ALGO | 0.999845 | 5.487897 | {
"github_metadata": {
"branch": "main",
"commit_count": 6334,
"repo_created_at": "2022-04-14T11: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": "df6b6669b... |
f6d14324-d34b-4870-afaf-19d245c6bc46 | DeepanshuRohilla15/Constructive-Algo | Partitions with Given Differences.cpp | class Solution {
public:
int countPartitions(int n, int d, vector<int>& arr) {
const int MOD = 1e9 + 7;
int totalSum = accumulate(arr.begin(), arr.end(), 0);
// Check if it's possible to partition the array with the given difference
if ((totalSum - d) % 2 != 0 || totalSum < d) {
... | ALGO | 0.999949 | 6.367706 | {
"github_metadata": {
"branch": "main",
"commit_count": 186,
"repo_created_at": "2024-02-26T07:22:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f3844c6b8... |
2b511e87-35cd-46c4-8e3a-0264f3c37e4a | davisnguyen111195/Algorithm | 15_Xau/bai4.cpp | // [Xâu Ký Tự Cơ Bản]. Bài 4. Số đẹp
// Cho số nguyên dương N có ít nhất 2 chữ số, một số được coi là số đẹp nếu 2 chữ số liền kề của nó chỉ lệch nhau đúng 1 đơn vị, ví dụ về số đẹp : 12345, 121212, 78987.
// Hãy kiểm tra xem N có phải là số đẹp hay không?
// Đầu vào
// Dòng duy nhất chứa số nguyên dương N
// Giới h... | ALGO | 0.999963 | 4.961679 | {
"github_metadata": {
"branch": "cu",
"commit_count": 255,
"repo_created_at": "2024-04-01T01:31:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "1d51f4ca5a94... |
ea22fe5a-0e3f-45ec-bf74-c593b56e45da | bhuvaneshSankar/competitiveProgramming | leetcode/augustChallenge/largestComponentSizeByCommonFactor.cpp | #include <bits/stdc++.h>
#include <vector>
#include <map>
using namespace std;
//check if common factor exists between a and b
bool isCfExists(int a, int b)
{
if (a == 1 || b == 1)
{
return false;
}
else if (((a % 2) == 0) && ((b % 2) == 0) || a == b || a % b == 0 || b % a == 0)
{
r... | ALGO | 0.999442 | 4.007452 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-08-16T15:51: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": "9a84a7b91d... |
592ae773-ba26-4647-a223-06b1e260c5ff | takanokage/knn-bench | src/ref.cpp |
#include "ref.h"
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
// ----------------------------------------------------------------------------
// ---------------------------------------------... | ALGO | 0.9945 | 6.277001 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2019-02-24T17:36: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": "b5dce7a5e... |
1859b35d-62f8-437a-9cad-4bb9aa907194 | Youngwook-Jeon/algorithm-problems-solving | geeksforgeeks/LowerBound.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int binarySearch(vector<int> &arr, int target)
{
int ans;
int l = 0, h = arr.size() - 1;
while (l < h)
{
int mid = l + (h - l) / 2;
if (arr[mid] >= target)
{
h = mid;
}
e... | ALGO | 0.99998 | 5.890177 | {
"github_metadata": {
"branch": "main",
"commit_count": 252,
"repo_created_at": "2021-04-22T10:01: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": "08290b5a33... |
9b8b76b4-c6c8-422d-9a10-10a61297bf35 | miyunluo/myLeetcode | cpp-code/21-Merge_Two_Sorted_Lists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {
ListNode *result = new ListNode(0);
ListNode *tmp = result;
... | ALGO | 0.999992 | 5.975685 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-04-22T09:12: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": "99bffd88d2... |
39c55a6b-4802-4f1b-b1e2-03e91d7736c1 | pparkcoder/Algorithm | Programmers/거리두기 확인하기.cpp | // 2021 카카오 채용연계형 인턴십
// https://programmers.co.kr/learn/courses/30/lessons/81302
// Tip -> vector<vector<string>> places를 map에 복사하는 과정을 연습할 것
#include <string>
#include <vector>
#include <iostream>
#include <queue>
#define mp make_pair
using namespace std;
queue<pair<int, int> > q;
char map[5][5];
int visit[5][5];
in... | ALGO | 0.999723 | 5.134725 | {
"github_metadata": {
"branch": "main",
"commit_count": 280,
"repo_created_at": "2021-05-27T04:37: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": "76a052ab7c... |
3ae86b6e-602d-4d3c-8876-64c0d9c4e71c | SagenHansda19/Contest | AtCoder_Beginner_Contest_386/C_Operate_1.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int k;
string s, t;
cin >> k >> s >> t;
if (s == t) {
cout << "Yes\n";
return;
}
int n = s.size();
int m = t.size();
if (abs(n - m) > 1) {
cout << "No\n";
return;
}
int i = 0, j = 0;
... | ALGO | 0.999997 | 4.751233 | {
"github_metadata": {
"branch": "main",
"commit_count": 119,
"repo_created_at": "2024-09-04T18:11:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7da403c9c6... |
3d45f718-b845-4998-8ff2-e00e2bfae0f4 | ishandutta2007/codeforces-t | tutis/normal/1077/D.cpp | /*input
7 3
1 2 3 2 4 3 1
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
int A[200009];
int main()
{
ios_base::sync_with_stdio(false);
int n, k;
cin >> n >> k;
for (int i = 0; i < n; i++)
{
int a;
cin >> a;
A[a]++;
}
int lo = 1;
int hi = n;
while (lo < hi)
... | ALGO | 0.999992 | 3.330394 | {
"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": "7b093ce084bc... |
43703c27-c56d-4f7f-ab14-19ae3f33d1c6 | felipe-santos-swengineer/Tetris_2_players_duel | uteis/BKP Codes/main.cpp | #include <SFML/Graphics.hpp>
#include <iostream>
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
typedef struct p{
double px;
double py;
} Coord; //estrutura que vai guardar os valores de x e y de cada quadrado na matriz q vai montar a peça
typedef struct p2{
int px;
int py;
} Coord2;//estru... | TOOL | 0.93737 | 3.24214 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-04-15T12:59:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0bf8a6b4d500... |
274cf23b-35d1-4fbd-a616-baef328b2cf4 | jrobbin/platoengine | base/src/optimize/Plato_QuadraticLineSearch.hpp | /*
* Plato_QuadraticLineSearch.hpp
*
* Created on: Oct 22, 2017
*/
/*
//@HEADER
// *************************************************************************
// Plato Engine v.1.0: Copyright 2018, National Technology & Engineering
// Solutions of Sandia, LLC (NTESS).
//
// Under the terms of C... | ALGO | 0.97644 | 6.523545 | {
"github_metadata": {
"branch": "master",
"commit_count": 351,
"repo_created_at": "2018-11-12T17:05:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e347503e... |
1a7a72e5-3418-442d-8aa9-e718d498c55a | EduardoMSU/OOP-2143 | Assignments/P01/Main.cpp | // <NAME>
// <EMAIL>
// P01
// 2143 OOP
// FY24
// Description: This program will overload the +,-,*,/, and == operators to do fractions.
// Usage:
//Files: "input" and "header"
#include "fraction.h"
#include <iostream>
#include <fstream>
#include <stdexcept>
#include <string> // For std::string
int main() {
... | ALGO | 0.940746 | 6.038171 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2024-08-27T02:44:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d836f99139... |
a49e44aa-4b3c-4768-b36d-4362bac874fc | thienudomsrirungruang/competitive-programming-libraries | lib/mod.h | #include <bits/stdc++.h>
using namespace std;
#define u_map unordered_map
#define u_set unordered_set
#define u_multiset unordered_multiset
using ll = long long;
using vvi = vector<vector<int>>;
using vi = vector<int>;
using vvll = vector<vector<long long>>;
using vll = vector<long long>;
using vd = vector<double>;
... | ALGO | 0.99535 | 3.276932 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2021-10-24T09:30:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82959b7be7... |
f0733c0c-dd4c-44eb-984d-a48404b85478 | alberto-santini/cvrp-decomposition | src/alns/PALNS/DecompositionMethods/ArcBased/RandomPathDecomposition.cpp | #include "RandomPathDecomposition.h"
#include <cassert>
#include <random>
vector<ArcBasedDecomposition::Arc> RandomPathDecomposition::getArcsToFix(const CVRPSolution& sol) const {
std::vector<Path> paths;
for(auto r = 0; r < sol.getNRoutes(); ++r) {
const auto& route = sol.getRoute(r);
const a... | ALGO | 0.996564 | 5.35159 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2022-02-15T23:13:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 29,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e7eb063c... |
59090665-876c-48bd-a4b8-f217b324dc94 | sandry24/Competitive_Programming_Library | Data Structures/Segment_tree.cpp | #include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("O3,unroll-loops")
//#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define pb push_back
#define mp make_pair
#define f first
#define s second
vi st(4*200005);
void build(vi... | ALGO | 0.999951 | 4.070376 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-10-08T16:47: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": "f36bfc77878b... |
ab2497aa-dd9a-4b09-b8aa-29a2da61e49e | mridul891/DataStrutureAndAlgorithm | stack/redunadantbracket.cpp | #include <iostream>
#include <stack>
using namespace std;
bool checkredundant(string &s)
{
stack<char> st;
for (auto i : s)
{
if (i == '(' || i == '+' || i == '-' || i == '*' || i == '/')
{
st.push(i);
}
else if (i == ')')
{
int operatorCount... | ALGO | 0.999673 | 4.849214 | {
"github_metadata": {
"branch": "main",
"commit_count": 93,
"repo_created_at": "2024-03-23T00:22:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba52ee7cbc6... |
cbcfc7c0-eff8-4044-8c91-afe1d234f4f0 | EseOkonofua/CPP-and-Me | BnB01Knapsack/BnB01Knapsack/BnB01Knapsack.h | //Name : <NAME> SN:10107285
#pragma once
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
#ifndef bnb_13eio_H
#define bnb_13eio_H
class Item {
int id;
int value;
int mass;
float vm; // Value/Mass
public:
Item(const int& id, const int& value, const int& mass);
int getId() const;... | ALGO | 0.99123 | 3.733908 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2015-10-19T17:34:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0fe1c001e... |
f0d457e9-1087-4549-a8d2-9195045a36fb | fithisux/FSL | src/miscmaths/sparse_matrix.h | /* Sparse_Matrix.h
<NAME>, FMRIB Image Analysis Group
Copyright (C) 1999-2000 University of Oxford */
/* Part of FSL - FMRIB's Software Library
http://www.fmrib.ox.ac.uk/fsl
<EMAIL>
Developed at FMRIB (Oxford Centre for Functional Magnetic Resonance
Imaging of the Brain), Department o... | TOOL | 0.957867 | 4.3575 | {
"github_metadata": {
"branch": "fsl-5.0.9",
"commit_count": 2,
"repo_created_at": "2017-05-11T12:56:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2dac7... |
c96d0499-bb4d-4d7e-ac52-51b7cd12d19e | JarvisChu/algorithm | leetcode/024-swap-nodes-in-pairs/main.cpp | /*
* https://leetcode.com/problems/swap-nodes-in-pairs
* 题目:给定一个链表,将链表中相邻的元素,两两交换。如输入为[1,2,3,4] 输出[2,1,4,3]
* 思路:
* 增加一个虚拟的链表头,然后从表头开始,只要后面存在两个节点,就交换。最终返回虚拟表头的next 即可
*/
#include <iostream>
using namespace std;
// Definition for singly-linked list.
struct ListNode {
int val;
ListNode *next;
ListNo... | ALGO | 0.999983 | 6.001126 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2019-04-14T15:58: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": "899c1d21... |
08efce71-45d6-4851-a638-dc8ef8786ce3 | BulTTaeng/Algorithm | greedy/Hard_1092_배/1092.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
using namespace std;
int N, M;
vector<int> box;
vector<int> crane;
int num[1000001];
int ans = 0;
int main() {
ios_base::sync_with_stdio(false);
cout.tie(0);
cin.tie(0);
cin >> N;
int temp;
for(int i =0; i<N; i++){
cin >>... | ALGO | 0.999994 | 3.541033 | {
"github_metadata": {
"branch": "main",
"commit_count": 1049,
"repo_created_at": "2022-03-13T05:53: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": "6ccb3e2f9... |
bcfc971e-d45c-4dc9-9f51-303d3984caff | BrianDavJ/Algoritmos-Estructuras | codeos/Practica 1/ej2_cuadradoMagicoPoda.h | //
// Created by Brian on 2/4/2023.
//
#include <stdio.h>
#include <vector>
#include <iostream>
using namespace std;
#ifndef PRACTICA_1_EJ2_CUADRADOMAGICOPODA_H
#define PRACTICA_1_EJ2_CUADRADOMAGICOPODA_H
int cuadradoMagicoConPoda(vector<vector<int>> &cuadrado, int i, int j, vector<int> &numeros, vector<int> &sumas, ... | ALGO | 0.999432 | 5.494263 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2023-03-24T22:39: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": "cde53a96d74... |
78cdd91f-1502-4423-9be1-b6f7929caadb | nikitayusupov/TimSort-algorithm | params.h | enum EWhatMerge {
WM_NoMerge,
WM_MergeXY,
WM_MergeYZ
};
class ITimSortParams {
public:
virtual int minRun(int n) const = 0;
virtual bool needMerge(int lenX, int lenY) const = 0;
virtual EWhatMerge whatMerge(int lenX, int lenY, int lenZ) const = 0;
virtual int GetGallop() const = 0;
};
class TimSortParams: publ... | ALGO | 0.995455 | 5.560595 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2016-11-02T03:38: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": "109179467... |
027bfce9-da7f-4095-b0ca-2c2fbb422e5a | shivanibhat24/CPP-Programs | Leetcode Programs Part 2/countthenumberofinversions.cpp | int mod = int(1e9) + 7;
class Solution {
public:
int numberOfPermutations(int n, vector<vector<int>>& r) {
sort(r.begin(), r.end());
int k = r.back()[1];
vector<long long> dp(k+1);
dp[0] = 1;
for(int i=1;i<r.size();i++) if(r[i-1][1] > r[i][1]) return 0;
int pre = 0;
... | ALGO | 0.999952 | 5.154077 | {
"github_metadata": {
"branch": "main",
"commit_count": 1115,
"repo_created_at": "2024-10-06T04:35: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": "fa896a3c6... |
afc5bed1-f54d-4d39-a561-912504a3f3cb | joydip007x/CompetitiveCodeArchive | Gym/102254C/24585699_WA_31ms_27680kB.cpp |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define pb push_back
vector<int> capList[101];
int dp[35000][101];
int allmask,n,x,d,y,mx1;
std::vector<ll> v;
ll countWaysUtil(int mask, int i, int mn, int mx, int tot)
{
if (mask == mx1) return (abs(mn-mx)<=d && t... | ALGO | 0.999961 | 4.529821 | {
"github_metadata": {
"branch": "main",
"commit_count": 233,
"repo_created_at": "2023-05-01T09:25: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": "c2ee2d20ed... |
d8d25744-a3b9-4df4-8a51-9e43649e192a | iexpurgator/Major-Exercises | THCS2/131.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
int power(int a, int n)
{
if (a == 0)
return 0;
if (n == 1)
return a;
int poww = 1;
while (n > 0)
{
poww *= a;
--n;
}
return poww;
}
void check(int n)
{
int dem = 0, tmp = n, sum = 0;
while (tmp > ... | ALGO | 0.999349 | 4.201764 | {
"github_metadata": {
"branch": "master",
"commit_count": 76,
"repo_created_at": "2020-12-10T14:44: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": "57f6f1062... |
232057e2-9720-420b-9ff2-292be93cab0f | Bartholomew007/Word-Frequency | Fake words/Fake words/Source.cpp | #include <cstdlib>
#include <iostream>
#include <string>
#include "Node.h"
#include <fstream>
#include <map>
#include <vector>
#include <chrono>
#include <algorithm>
using namespace std::chrono;
//<NAME>
//<NAME>
//<NAME>
using namespace std;
void insertion(string word, Node* root) { //function used to make ... | DATA | 0.945632 | 3.554681 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-10-04T19:24: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": "ea222af94e91... |
4b1bc0a5-3497-4ca0-a479-a5c9ce7e7f5f | Mugdha-Hazra/180-Questions-Striver-SDE-sheet-in-CPP | convert-sorted-array-to-binary-search-tree/convert-sorted-array-to-binary-search-tree.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.999986 | 6.505906 | {
"github_metadata": {
"branch": "main",
"commit_count": 1760,
"repo_created_at": "2020-11-19T06:26:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 243,
"forks": 77,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb4036... |
e1d78b9c-d670-4b30-8ae6-873a9934331a | yugalgaur174/Leetcode-Problems | 1484-linked-list-in-binary-tree/1484-linked-list-in-binary-tree.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) {}
* };
*/
/**
* Definition for a binary tree node.
* struc... | ALGO | 0.999875 | 5.500478 | {
"github_metadata": {
"branch": "main",
"commit_count": 2395,
"repo_created_at": "2024-07-16T18:06: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": "d17dc32e7... |
d091aa00-2d02-47c9-8cbc-2eed3db3cbf4 | Masttf/XCPC | niuke/2025寒假/2/a.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
#define dbg(x...) \
do { \
cout << #x << " -> "; \
err(x); \
} while (0)
void err() {
cout << endl << endl;
}
template<class T, class... Ts>
void err(T arg, Ts ... args) {
cout << fixed << setprecision(10) << arg << ' ';
err(args.... | ALGO | 0.997797 | 3.935122 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2025-02-09T13:42:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab83779a5... |
0825adb0-ad60-4be6-9222-5fee48300787 | Catrobio/YogSothoth | Functions.cpp | #include <vector>
#include <algorithm>
#include <string>
#include <iostream>
#include <cstring>
using namespace std;
class Function
{
public:
static int Cuenta(string s, const char Separadorr, int TotalChars)
{
for (int i = 0; i < s.size(); i++)
{
if (s[i] == Separadorr)
TotalChars++;
}
return TotalC... | ALGO | 0.991152 | 4.127893 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-09-05T22:20:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b2620da15... |
41bb40b3-21dc-4e2e-90b1-0538e6469faa | rohan-goyal-1/CP | HPC/POTW/Week1/A.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
long long ans = 0;
void solve (vector<int>& digits, int idx) {
if (idx == digits.size()) {
int L = digits[0], A = digits[1], N = digits[2], D = digits[3], W = digits[4], I = digits[5], R = digits[6], T = digits[7], H = digits... | ALGO | 0.999421 | 3.981481 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-05-23T04:55: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": "abdddccb8be... |
9ba3a0a7-46f3-4761-8453-68a77fb57173 | DeNA/DeClang | libc/src/stdlib/qsort_data.h | //===-- Data structures for sorting routines --------------------*- 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.976293 | 7.047131 | {
"github_metadata": {
"branch": "swift/release/6.1",
"commit_count": 461869,
"repo_created_at": "2020-10-26T05:56:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 442,
"forks": 50,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"conten... |
6fc33d66-25f8-47c6-82c1-c3dc27109047 | hwnooy/PS_Practice | 백준/Bronze/2920. 음계/음계.cc | // 1 ~ 8 : ascending , 8 ~ 1 : discending, 그 외는 mixed
#include <iostream>
using namespace std;
int main() {
int n, cnt;
cnt = 0;
string result = "";
int arr[9];
for (n = 0; n < 8; n++) {
cin >> arr[n];
}
for (int i = 0; i < 7; i++) {
if (arr[i] < arr[i + 1] && arr[i]-arr[i+... | ALGO | 0.999984 | 3.862174 | {
"github_metadata": {
"branch": "main",
"commit_count": 137,
"repo_created_at": "2022-08-07T18:40: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": "1a8836eae8... |
239cd2ca-3d16-4839-b4a7-23a06b358fa8 | JunJun355/usacoContests | usacoGuide/Chapter3/Section1/agrinet.cpp | /*
ID: 06jajun
TASK: agrinet
LANG: C++17
*/
#include <iostream>
#include <algorithm>
#include <vector>
#include <fstream>
#include <set>
#include <string>
using namespace std;
#define MXN 100
#define INF 1000000000
int n;
int edges[MXN][MXN];
ifstream fin ("agrinet.in");
ofstream fout ("agrinet.out");
struct cmpA ... | ALGO | 0.999958 | 4.043724 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2021-12-05T03:53: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": "16d9e0451ce... |
47cdbece-9076-4dad-8d90-15593ecc9871 | nKadykov/leetcode | 647.cpp | #include <iostream>
class Solution {
std::string t;
int check(int l, int r) {
int result = 0;
while(l >= 0 && r <= t.size()) {
if(t[l--] == t[r++]) {
result++;
}
else {
break;
}
}
return result;
... | ALGO | 0.999961 | 6.231516 | {
"github_metadata": {
"branch": "main",
"commit_count": 399,
"repo_created_at": "2023-11-10T15:04: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": "e28e7357d9... |
b53d6e09-ad61-401f-a35c-9feb832e59d8 | Akash-Sharma1/All-Codes | loststrinng.cpp | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m,k;
cin >> n >> m >> k;
string interval[k];
while(n--){
int l,r,z;
cin >> l >> r >> z;
int i=0;
while(i<interval[z].size() && l>interval[z][i] && l>interval[z][i+1]){i+=2;}
if(... | ALGO | 0.999751 | 4.060134 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2018-12-15T17:49: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": "7a390d455... |
a3ba09f5-f113-4c6a-bd36-47af8bbeaf45 | DionysiosB/CodeForces | 0300-0399/363D-RentingBikes.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
long checkRent(const std::vector<long> &budget, const std::vector<long> &cost, long money, long count){
long n = budget.size();
long m = cost.size();
if(count > m || count > n){return -1;}
long extra(0), budgetSum(0), totalCost(0);
for(lon... | ALGO | 0.999988 | 3.596347 | {
"github_metadata": {
"branch": "master",
"commit_count": 4487,
"repo_created_at": "2013-06-27T18:15:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 690,
"forks": 163,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b5... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.