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 |
|---|---|---|---|---|---|---|---|
d5608c66-f5aa-425e-9c3d-d228736d5a3d | matthiashw/rectpack | src/DynamicSums.cc | /**
* Copyright (C) 2011 <NAME>
*
* This file is part of rectpack.
*
* rectpack is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.... | ALGO | 0.999667 | 6.489281 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-09-25T18:50:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d28bace8b... |
d338b068-55f0-4f7e-b620-4fe480e3fd86 | AbeLudlam/Euclidean-Graph-Algorithms | Ludlam_Abraham_CPSC335-02_Efficient_OptimizationP3.cpp | #include <iostream>
#include <iomanip>
#include <cstdlib>
#include <math.h>
using namespace std;
struct node {
float x; // x coordinate
float y; // y coordinate
};
void generate_perm(int n, int *A, int sizeA, node *P, float *smallest, node *ans) {
int i;
if (n == 1)
{
float sum=0;
for(i=0;i<sizeA-1... | ALGO | 0.999915 | 3.982283 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-04-26T21:09: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": "41822d81fe... |
d1e793c7-39cc-4066-a90d-fa969deb007e | Huberdoggy/cpp20_apps | Experiments/Starting_Out_Book/Exercises/Ch4/Magic_Dates/Magic_Dates.cpp | /*
The date June 10, 1960 is special because when we write it in the following
format, the month times the day equals the year:
6/10/60
Write a program that asks the user to enter a month (in numeric form),
a day, and a two-digit year. The program should then determine whether
the month times the day is equal to the ... | ALGO | 0.959429 | 5.079823 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2021-12-29T21:06: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": "195fce041... |
8706399b-c621-48ee-a004-a6b16256c7be | kamyu104/LeetCode-Solutions | C++/maximize-the-minimum-game-score.cpp | // Time: O(n * log(m * r))
// Space: O(1)
// binary search, greedy
class Solution {
public:
long long maxScore(vector<int>& points, int m) {
const auto& ceil_divide = [](int64_t a, int64_t b) {
return (a + b - 1) / b;
};
const auto& binary_search_right = [&](int64_t left, int6... | ALGO | 0.999888 | 5.583487 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
8bccfd52-b3d0-4e12-9916-a650aaafd158 | jack41402/Cplusplus | TNFSHOJ/102 Floating Point/102.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double a , c ;
char b ;
cin >> a >> b >> c ;
if (b=='+')
cout << fixed << setprecision (4) << a << " + " << c << " = " << a+c << endl;
else if (b=='-')
cout << fixed << setprecision (4) << a << " - " << c << "... | ALGO | 0.999152 | 3.620445 | {
"github_metadata": {
"branch": "main",
"commit_count": 98,
"repo_created_at": "2022-10-10T11:44: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": "456132b9091... |
4c78baad-0ea1-43f8-b087-9f64c7c6835d | WhereIsHeroFrom/Code_Templates | 动态规划/单调队列 模板.cpp | #include <iostream>
using namespace std;
#define MAXN 1000010
///////////////////////单调队列//////////////////////////
// 单调递增队列模板
// 单调递增队列的 data 域存的是原数组的下标,映射过去后要保证这些在 data 中的原数组数据是单调递增的
#define MAXN 1000010
#define Type int
#define NullIndex -1
class Deque {
private:
int* data; // 存储 rawdata 的下标
... | ALGO | 0.999884 | 3.876597 | {
"github_metadata": {
"branch": "master",
"commit_count": 193,
"repo_created_at": "2018-01-28T09:29:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 153,
"forks": 42,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5a5f... |
0cce221f-f569-435a-9279-b44e491c9c58 | pranitmodi/Learning_CPP | #Practice/Revision/Self - Revision/Revision/11_5_2023/test_pattern6.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cout << "Enter a number: " << endl;
cin >> n;
cout << "First Pattern: " << endl;
int i=1;
int j;
while(i<=n)
{
j=1;
while(j<=(n-i))
{
cout << " ";
j++;
}
j=1;
... | ALGO | 0.999899 | 4.099329 | {
"github_metadata": {
"branch": "main",
"commit_count": 447,
"repo_created_at": "2023-02-01T10:22:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "421903c975... |
2f91b543-b8a8-4e44-800f-4c50164c1b3a | ezhillragesh/college_dsa_codes | 2.Expressions/learning_postfix.cpp | #include<iostream>
#include<string.h>
#define MAX 30
using namespace std;
int a[MAX];
int top;
void init()
{
top=-1;
}
void push(int data)
{
int i;
top++;
a[top]=data;
}
int pop()
{
return(a[top--]);
}
int eval(int d1,int d2,char sym) // this function takes 2 operands and 1 operator as i... | ALGO | 0.999824 | 3.762438 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-11-14T00:30: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": "10fea69cfac5... |
8121b152-aef0-4cdb-b056-3abf7d6c923b | CaioBraz49/ATP1---UNESP-RC | Lista_de_exercicios_3/1.cpp | #include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
int numero, fatorial = 1; // definir fatorial como 1, ja que caso seja 0, sua multiplicacao sempre resultara em 0
char input[50];
bool eh_int = true;
// loop para forçar o usuario a escolher um numero inteir... | ALGO | 0.999145 | 4.020455 | {
"github_metadata": {
"branch": "Listas_de_exercicios",
"commit_count": 28,
"repo_created_at": "2025-03-16T20:26:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_i... |
13991b73-e40f-446d-b0ea-9bb92356052d | GolGol00/20250103_Exam3 | Project3/Project3/test.cpp |
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;
template <typename T>
class SimpleVector {
private:
T* data;
int currentSize;
int currentCapacity;
public:
//기본생성자
SimpleVector() : data(new T[10]), currentCapacity(10), currentSize(0) {
cout << "기본생성자가 생성되었습니다." << endl;
}
... | TOOL | 0.994271 | 5.014462 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-01-03T01:58: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": "dc4898f1f4d1... |
cf89c9a2-a4be-497a-b649-9ca698c2c86d | piotrcurious/esp8266_solar_battery_monitor | lead_acid_junkbox/voltage_epaper/junkbox/4fix3.ino | float monitorMeasurement(float measurement, unsigned long currentTime, float &timeWithinBounds) {
addSample(measurement, currentTime, monitor);
calculateDerivatives(monitor);
if (monitor.count < 2) {
timeWithinBounds = INFINITY;
return 0.0;
}
float predictedValue = weightedPredicti... | ALGO | 0.996391 | 7.114182 | {
"github_metadata": {
"branch": "main",
"commit_count": 631,
"repo_created_at": "2023-04-24T22:32: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": "dd46e59a62... |
38c6bc19-1e49-4d17-9e5d-3e3646fe7f0f | seokwonJ/baekjoon | 백준/Silver/1004. 어린 왕자/어린 왕자.cc | #include<iostream>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
int startx, starty;
int finishx, finishy;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> startx >> starty >> finishx >> finishy;
int k;
int count = 0;
cin >> k;
for (int z = 0... | ALGO | 0.999576 | 3.885227 | {
"github_metadata": {
"branch": "main",
"commit_count": 360,
"repo_created_at": "2024-02-18T01:19: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": "d7c1ffcd84... |
05cfca64-2b1b-4afc-a506-c3d40e3de340 | sourceinsight/leetcode | cpp/Add_Binary.cc | /*
Given two binary strings, return their sum (also a binary string).
For example,
a = "11"
b = "1"
Return "100".
*/
class Solution
{
public:
string addBinary(string a, string b)
{
string result;
int len1 = a.size();
int len2 = b.size();
int carry = 0;
int i = len1 - 1;
... | ALGO | 0.999987 | 6.142893 | {
"github_metadata": {
"branch": "master",
"commit_count": 143,
"repo_created_at": "2014-12-16T02:53:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ca7f96e... |
7e37539c-b149-4700-b926-919cbff71c2f | Erick-Andrade/Marathon_exercises | codeForces/749A.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define f first
#define s second
#define pb push_back
#define _ ios_base::sync_with_stdio(0); cin.tie(0);
const int MAX = 1e6+10;
const int IINF = INT_MAX;
const int INF = 0x3f3f3f3f;
const ll lINF = 0x3f3f3f3f3f3f3f3fll;
int m... | ALGO | 0.999984 | 4.096924 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2023-09-14T21:26:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7769d6a5514... |
1ed7a172-f08e-4b5e-afaf-f4aec2786ba6 | OlioDev22/DirectX9_Practice | Main/Codes/Collision.cpp | #include "StdAfx.h"
#include "Collision.h"
C_Collision::C_Collision()
{
}
C_Collision::~C_Collision()
{
}
bool C_Collision::AABB(D3DXVECTOR3 vDstMin, D3DXVECTOR3 vDstMax, D3DXVECTOR3 vSrcMin, D3DXVECTOR3 vSrcMax)
{
if (max(vDstMin.x, vSrcMin.x) > min(vDstMax.x, vSrcMax.x))
return false;
if (max(vDstMin.y, vSrc... | ALGO | 0.933844 | 3.512333 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-06-08T00: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": "dbe04a9c64... |
273ebf41-4c1b-4b67-a6c3-712497d4641f | Tarunagg1/Ds_Alog_notes | Matrix_Operations/C++/Matrix_Mirror_of_matrix_across_diagonal.cpp | /*
Author: <NAME>
C++ Program to find mirror of matrix across diagonal
Input : mat[][] = {{1 2 3 4 }
{5 6 7 8 }
{9 10 11 12}
{13 14 15 16} }
Output : 1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16
*/
#include <bits/stdc++.h>
us... | ALGO | 0.999968 | 5.978628 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-01-19T04:18: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": "89e99d007c... |
0cf61c16-f068-4696-86f5-4277425a74be | kadzior/DrzewoBinarne | DodanieKlasy.cpp | #include <iostream>
#include <fstream>
#include "./node.hpp"
using namespace std;
// Klasa reprezentująca operacje związane z plikami dla drzewa BST
class BSTFileHandler {
public:
// Metoda zapisująca drzewo do pliku binarnego
static void saveToBinaryFile(Node* node, const string& filename) {
ofstrea... | ALGO | 0.989127 | 5.138101 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2024-10-27T17:39: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": "6af9f6b63... |
20f80dc6-5505-4e88-8762-8fb4d436348d | andrewthenintendrone/Maths-Tests | Maths Tests/MathsLib/source/Vector4.h | #pragma once
#include <math.h>
#include <iostream>
#include <glm\glm.hpp>
#include <glm\ext.hpp>
namespace AMMaths
{
class Vector2;
class Vector3;
class Vector4
{
public:
// variables
union
{
struct
{
float v[4];
};
... | TOOL | 0.961184 | 5.573794 | {
"github_metadata": {
"branch": "master",
"commit_count": 135,
"repo_created_at": "2017-04-02T23:54: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": "71fbc157... |
b02eed94-4efd-42f9-bb0b-419eeed62f20 | vothuckhanhhuyen/algorithms | applied_algorithms/Training 2_DST/Training2_SIGNAL.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, b;
cin >> n >> b;
getchar();
int arr[n];
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int maxLeft[n];
int maxRight[n];
maxLeft[0] = arr[0];
maxRight[n - 1] = arr[n - 1];
for (int i = 1; i < n; i++... | ALGO | 0.999933 | 3.970466 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2021-10-05T09:00:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9cba6cd61... |
dcbe4cc7-6d99-4b2a-b58d-0218f02de37e | TomBeacock/atlas | include/atlas/math/matrix_func.inl | namespace Atlas::Math {
template<typename T>
constexpr MatrixT<4, 4, T> transpose(const MatrixT<4, 4, T> &m)
{
return MatrixT<4, 4, T>(VectorT<4, T>(m[0][0], m[1][0], m[2][0], m[3][0]),
VectorT<4, T>(m[0][1], m[1][1], m[2][1], m[3][1]),
VectorT<4, T>(m[0][2], m[1][2], m[2][2], m[3][2]),
Vect... | ALGO | 0.999287 | 6.585032 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-09-17T16:44:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "527bd794eaf... |
9626666a-5e28-47d0-8e69-8e2adf43d806 | Sahil1515/Competitive-Coding | 005_codechef/1_Easy/progB11_Max_weight_diff.cpp |
#include <bits/stdc++.h>
using namespace std;
// void heapify(int arr[], int n, int s)
// {
// int left=2*s+1;
// int right=2*s+2;
// int largest=s;
// if(left<n && arr[s]>=arr[left])
// largest=left;
// if(right<n && arr[s]>=arr[right])
// largest=right;
// if(largest!=s)
// {... | ALGO | 0.999918 | 4.199831 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2020-08-26T04:14: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": "af5397b5... |
abc8ab3d-1069-4959-b4f0-14f1ef0448a9 | zeroli/thrust-1.0.0-annotated | thrust/sorting/detail/radix_sort.inl | /*
* Copyright 2008-2009 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.999899 | 6.758807 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-02-25T01:05:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "371c2bc873... |
d5acb57b-688c-42c9-a7f5-3d81b651143f | gnathani/Parallel-Processing | hypercube_quick_sort/hqs.hpp | #ifndef HQS_HPP
#define HQS_HPP
#include <vector>
#include <cstring>
using namespace std;
void hyperquick_sort(vector<int>& Xi, MPI_Comm comm) {
int size, rank;
MPI_Comm_size(comm, &size);
MPI_Comm_rank(comm, &rank);
//Local Sort
sort(Xi.begin(), Xi.end());
int dim = log(size)/log(2);
M... | ALGO | 0.999758 | 4.737934 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-06-03T18:45: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": "ddbea82431aa... |
42096fe6-24eb-4b9c-a81b-4fb64185fc0a | ishandutta2007/codeforces-w | wild_hamster/normal/598/B.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstring>
#include <deque>
#include <stack>
#include <stdio.h>
#include <map>
#include <set>
#include <time.h>
#include <string>
#include <fstream>
#include <queue>
#include <bitset>
#include <cstdlib>
#define X first
#define Y second
... | ALGO | 0.999985 | 3.406886 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:34: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": "b386b0a5706b... |
923ec2d6-59c8-4361-8236-861a6fca19c4 | maxim5helopugin/Portfolio | Unbounded Nonblocking Queue/src/Node_trans.h | #include <iostream>
// define important flags
#define LN INT32_MAX
#define RN INT32_MIN
#define LS INT32_MAX-1
#define RS INT32_MIN+1
#define SZ 100000
typedef uint64_t slot;
// Node class, stores an array of slots
class Node{
public:
int left_slot_hint;
int right_slot_hint;
slot buffer[SZ];
Node(int split);
// ... | ALGO | 0.973706 | 3.998894 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2018-12-18T21:09: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": "c94ed3402... |
751ae784-624f-40d0-b4c3-eb6066779f75 | satyam15/Coding | Random/prism.cpp | #include<stdio.h>
#include<stdbool.h>
#include <limits.h>
#define V 5
void print(int tree[],int n,int adj[][V])
{
int i;
printf("Edge \tWeight\n");
for (i = 1; i < V; i++)
{
printf("%d--%d\t%d\n",tree[i],i,adj[tree[i]][i]);
}
}
int minkey(int key[],bool mst[])
{
int i;
int x=INT_MAX,y;
for(i=0;i<V;i+... | ALGO | 0.999978 | 4.356255 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-10-21T17:12:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45481d098e... |
42b16910-76d1-4f2a-a20a-83879ff1d292 | Ronnoc/Training | TopCoder/SRM 500-599/SRM 554/TheBrickTowerEasyDivOne[180.33OF250 2Y].cpp | // BEGIN CUT HERE
/*
PROBLEM STATEMENT
John and Brus are building towers using toy bricks.
They have two types of bricks: red and blue ones.
The number of red bricks they have is redCount and each of them has a height of redHeight.
The number of blue bricks they have is blueCount and each of them has a height of blueH... | ALGO | 0.992045 | 3.934981 | {
"github_metadata": {
"branch": "master",
"commit_count": 445,
"repo_created_at": "2013-10-11T04:01:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1eb3fc5... |
7336cb69-c859-42cd-a0f9-c542b8c6572b | EdricYeo117/DataStructure-AlgorithmsPracticeRepo | BinaryTreeDuplicates.cpp | #include <iostream>
#include <queue>
using namespace std;
// Tree Node Structure with Duplicate Handling
struct TreeNode {
int data;
int count; // Count occurrences of the value
TreeNode* left;
TreeNode* right;
TreeNode(int val) : data(val), count(1), left(nullptr), right(nullptr) {}
};
// --- Tr... | ALGO | 0.999972 | 5.540791 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2024-08-15T16:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7129db075ea... |
1794f73d-8b63-4dd0-8f11-d4e87debfea4 | yz1019117968/FSE-24-UniTrans | cleaned_data/transcoder_evaluation_gfg/cpp/HOW_TO_PRINT_MAXIMUM_NUMBER_OF_A_USING_GIVEN_FOUR_KEYS.cpp | // Copyright (c) 2019-present, Facebook, Inc.
// All rights reserved.
//
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include... | ALGO | 0.999569 | 4.904613 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-04-06T11:00:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a173eb13b2... |
16efeab2-9d56-4432-b2a5-956a9fc46d3b | yashaswashukla/A-Z | 09-Stack & Queue/9.2-Prefix, Infix, Postfix/10-Prefix-to-Infix.cpp | /*
}
GFG: https://practice.geeksforgeeks.org/problems/prefix-to-infix-conversion/1?utm_source=youtube&utm_medium=collab_striver_ytdescription&utm_campaign=prefix-to-infix-conversion
Leetcode:
*/
#include <bits/stdc++.h>
using namespace std;
/*
-->> Prefix notation during conversion will always be processed
-->> from l... | ALGO | 0.999912 | 6.103267 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2023-01-27T08:59: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": "0b81e8ba07f... |
a55460d7-3f57-45a2-a4e9-3d520ff3cd1a | Pulkitp2707/c-files | dummy3..cpp | #define ll long long
#define lld long double
#define cn(n) ll n;cin >> n;
#define tes(t) ll t;cin>>t;while(t--)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define repd(i, a, b) for (int i = a; i >= b; i--)
#define pii pair<int, int>
#... | ALGO | 0.999913 | 4.001106 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-07-12T19:39: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": "589b213ad6... |
a0c32b1c-eba8-4adf-ace0-0f4b6676b2b0 | shoraaa/CompetitiveProgramming | 2. Codes/Anh Vu/laser.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 5e5 + 5;
int n, m;
vector<pair<int, int>> pos;
void insert(int lef, int rig, int type) {
if (lef > rig) return;
pos.emplace_back(lef, -type);
pos.emplace_back(rig + 1, +type);
}
int cnt[N], tot = 0;
void insert(int t) {
if (!cnt[t]... | ALGO | 0.999984 | 3.672179 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-07-31T18:18: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": "665c505506ad... |
416962ef-54e0-4e34-a865-682c84a820a1 | krishukr/cpp-code | src/LG/lg-P4551.cpp | #include <cstdio>
#include <iostream>
#include <memory>
constexpr int MAX_N = 100050;
constexpr int MAX_L = 30;
struct Node {
int v;
int nxt;
int w;
} node[MAX_N << 1];
int head[MAX_N];
int cnt;
void create(int u, int v, int w);
int a[MAX_N];
void dfs(int x, int f);
class Trie {
protected:
str... | ALGO | 0.999924 | 4.787169 | {
"github_metadata": {
"branch": "master",
"commit_count": 193,
"repo_created_at": "2021-01-19T08:15:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "22684e3e... |
27f1f092-70ba-4d3b-a2e2-cf979927fdf0 | HPCGraphAnalysis/bicc | bcc-hipc14/bcc_serial.cpp |
using namespace std;
#include <cstdlib>
#include <assert.h>
#include <fstream>
#include <sys/time.h>
#include <vector>
#include <queue>
#include <getopt.h>
#include <string.h>
#ifdef _OPENMP
#include <omp.h>
#endif
#define PARALLEL_CUTOFF 10000
#define VERBOSE 1
#define VERIFY 1
#include "util.hpp"
#include "grap... | ALGO | 0.973103 | 4.953526 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2018-04-19T14:43:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd7ad5f1b... |
47e76328-9815-4a29-b6ee-a5b946bf5408 | gitzhzhg/SeismicPackage | CPSeis/spws_home/oop/pick/hurst.cc | /*<license>
-------------------------------------------------------------------------------
Copyright (c) 2007 ConocoPhillips Company
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software with... | ALGO | 0.991782 | 5.510493 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-11-24T03:32:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 70,
"forks": 30,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "68d5e908... |
6c218e61-0238-4122-bc9d-f62a5ff92021 | ishandutta2007/codeforces-y | yuukakazami/normal/119/E.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <climits>
#include <numeric>
#include <cmath>
#include <vector>
using namespace std;
const double EPS = 1e-8;
int sign(double x) {
return x < -EPS ? -1 : x > EPS;
}
namespace Geo3D {
struct Point {
double x, y, z;
void read(... | ALGO | 0.999876 | 4.642349 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:40:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed7999d3503d... |
307852ab-2c68-492b-a612-50ca60c33850 | arnav0309/coding-problem | DP/Wildcard_Matching.cpp | // https://leetcode.com/problems/wildcard-matching/
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_... | ALGO | 0.999947 | 4.487585 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2022-05-28T09:52: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": "84d7a051a... |
0092fae5-29e4-4c88-b843-eaa2ee67173c | Prookies/CodingInterview | code/src/NextNodeInBinaryTrees/nextNodeInBinaryTrees.cc | #include <iostream>
using namespace std;
struct BinaryTreeNode
{
BinaryTreeNode *m_pLeft;
BinaryTreeNode *m_pRight;
BinaryTreeNode *m_pParent;
int64_t m_nVal; // 为了实现对齐把int改成了int64_t
BinaryTreeNode(int val) : m_pLeft(nullptr), m_pRight(nullptr), m_pParent(nullptr), m_nVal(val) {}
};
// 尽量统一返回... | ALGO | 0.99988 | 4.366152 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-04-06T02:50: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": "a4d09dfa19... |
37dc36d9-9a00-4b70-a0b8-5e14e042bb4d | deliangyang/Data-Structure | chapter3/3.9/Calendar.cpp |
#include <iostream>
using namespace std;
struct Year
{
int yy;
int mm;
int dd;
};
class Calendar
{
public:
Calendar(Year year, int leapyr);
int NumDays(int mm, int dd);
int Leapyear(void)const;
void PrintDate(int days);
private:
Year year;
int leapyr;
};
Calendar::Calendar(Year year, int leapyr)
{
this->... | TOOL | 0.976173 | 4.012125 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2014-09-17T03:45: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": "0008b7c5d0... |
ef5e191a-c269-4d4b-8c7b-06228902f933 | mohsendb7008/Online-Judge-Solutions | Kattis/piecesofparentheses.cpp | #include <bits/stdc++.h>
using namespace std;
// Pieces of Parentheses
pair<int, int> interpret(string s){
int op = 0, cl = 0;
for(char c : s){
if(c == '(')
op++;
else if(c == ')'){
if(op) op--;
else cl++;
}
}
return {op, cl};
}
struct pack{... | ALGO | 0.999939 | 4.098489 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2020-10-07T18:13:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c21af2916... |
0713b421-c2a2-49c0-93da-b6ab89d1e712 | LittleYang0531/CQ-CSP-S-2021 | CQ-00142/traffic/traffic.cpp | #include <cstdio>
#define print(x,y) write(x),putchar(y)
template <class T>
inline T read(const T sample) {
T x=0; char s; bool f=0;
while((s=getchar())>'9' or s<'0')
f |= (s=='-');
while(s>='0' and s<='9')
x = (x<<1)+(x<<3)+(s^48),
s = getchar();
return f?-x:x;
}
template <class T>
inline void write(const ... | ALGO | 0.999926 | 3.523402 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-10-23T14:42:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7142da29043f... |
1c8ae497-17a0-49ac-a586-06aa2a9379b1 | Daejjyu/Algorithm | Baekjoon/2503.cpp | #include <iostream>
int arr[100];
int strike[100];
int ball[100];
int main()
{
int N;
scanf("%d", &N);
for (int i = 0; i < N; i++)
{
scanf("%d %d %d", arr + i, strike + i, ball + i);
}
int ans = 0;
for (int i = 123; i < 999; i++)
{
int idx = i;
int third = idx % 10;
idx /= 10;
int second = idx % 10... | ALGO | 0.999461 | 3.790302 | {
"github_metadata": {
"branch": "master",
"commit_count": 564,
"repo_created_at": "2020-04-22T03:20:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5936425c... |
fed7328e-d8bd-421a-a683-227124f67a77 | memo735/e-olymp | 0000-0999/0750 - Home by trains - Домой на электричках - Elektrik qatarları ilə evə - Додому на електричках.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <functional>
using namespace std;
#define INF 2000000000
int e, n, m, stations, PrevStation, CurStation, PrevTime, CurTime;
class Prior
{
public:
int Time, Vertex;
Prior(int Time, int Vertex) : Time(Time), Vertex(Vertex) {}
int operator< (const Prio... | ALGO | 0.999958 | 3.965827 | {
"github_metadata": {
"branch": "master",
"commit_count": 4186,
"repo_created_at": "2015-06-14T13:00:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 112,
"forks": 70,
"issues": 1,
"pull_requests": 4
},
"file_meta": {
"content_id": "9121... |
95b3c7ba-fed1-4a11-8f4d-4ce3f07d86d8 | AzertP/VNOI_SPOJ | NKCITY.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1100;
int n, m, res;
int dsu[N];
vector <pair<int, pair<int, int>>> edge;
int find(int i) {
return (dsu[i] == i)? i : dsu[i] = dsu[find(dsu[i])];
}
void merge(int i, int j) {
dsu[find(i)] = find(j);
}
void kruskal() {
int done = 0, cur = 0;
... | ALGO | 0.999933 | 4.049446 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-10-04T14:30:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "784cb35c21... |
27c38036-e11e-4ad9-afc8-0dd5bda95296 | CubbyFlow/CubbyFlow | Includes/Core/CUDA/CUDAParticleSystemSolver3.hpp | // This code is based on Jet framework.
// Copyright (c) 2018 <NAME>
// CubbyFlow is voxel-based fluid simulation engine for computer games.
// Copyright (c) 2020 CubbyFlow Team
// Core Part: <NAME>, <NAME>, <NAME>, <NAME>
// AI Part: <NAME>, <NAME>
// We are making my contributions/submissions to this project solely i... | TOOL | 0.978506 | 7.261467 | {
"github_metadata": {
"branch": "main",
"commit_count": 996,
"repo_created_at": "2018-05-05T13:13:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 286,
"forks": 34,
"issues": 33,
"pull_requests": 1
},
"file_meta": {
"content_id": "129bb0c... |
d8ab93a9-e370-4597-9064-29cf1827a15e | yuangu/sxtwl_cpp | src/sxtwl.cpp | #include "sxtwl.h"
#include "const.h"
#include "JD.h"
#include "eph.h"
#include "SSQ.h"
#include <cmath>
//获取干支索引
short getGanZhiIndex(GZ value)
{
short index = 0;
for (int i = 0; i < 6; ++i)
{
if ((value.tg + i * 10) % 12 == value.dz)
{
index = value.tg + i * 10;
break;
}
}
return index;
}
namespace... | ALGO | 0.955005 | 4.431154 | {
"github_metadata": {
"branch": "master",
"commit_count": 135,
"repo_created_at": "2017-05-19T15:49:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 226,
"forks": 80,
"issues": 14,
"pull_requests": 2
},
"file_meta": {
"content_id": "c564... |
7a31341f-4fb3-456e-b00f-c78b3aa2bf42 | SidiAbdullah/VectorLibrary | Vector.cpp | #include <iostream>
#include <vector>
using namespace std;
// 1. CRUDS
// A. createVector
vector <int> vNumbers = {10, 20, 30, 40, 50};
// B. readVector()
void readVector(vector <int> &vNums){
for (int i = 0; i < vNums.size(); i++){
cout << vNums[i] << "\n";
}
}
void readVector(vector <int> &vNums, int from, ... | TOOL | 0.990223 | 4.237747 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-06-29T03:32:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ee27272cffa... |
12068d55-8056-4776-bc87-758ef8e97cd7 | UserUnauthorized/OI-Codes | HZ/39.10.cpp | //HZ - 39.10
#include <bits/stdc++.h>
using namespace std;
constexpr int maxn = 10004, maxp = 20;
struct EDGE {
int next;
int to;
EDGE() : next(-1), to(-1) {};
EDGE(int _next, int _to) : next(_next), to(_to) {};
} edge[maxn];
int T, n, p, bin[maxp], degree[maxn], head[maxn], deep[maxn], fa[maxp][ma... | ALGO | 0.999972 | 4.627734 | {
"github_metadata": {
"branch": "main",
"commit_count": 673,
"repo_created_at": "2022-08-30T03:06:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "148eb5b17a... |
c9fc2072-f27a-4bf4-adfc-ed742993caa3 | cms-sw/cmssw | RecoHGCal/TICL/plugins/TracksterLinkingbyFastJet.h | #ifndef RecoHGCal_TICL_TracksterLinkingAlgoByFastJet_H
#define RecoHGCal_TICL_TracksterLinkingAlgoByFastJet_H
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ConfigurationDe... | ALGO | 0.909367 | 7.09171 | {
"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... |
cadabc6c-960f-4e05-b39f-0f0b94b1170c | ayush0209/Segmented_Least_Squares | Functions.cpp | #include<stdio.h>
#include<vector>
#include<cmath>
#include"Point.h"
#include"PointsOps.h"
#include"Functions.h"
using namespace std;
PointsOps pointsopsAPI;
/*! This function calculates beta for the equation of line of the form y=(beta)*x + (alpha)
\param points set of input points
\param start This is the starting i... | ALGO | 0.967456 | 3.887785 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-04-01T18:49: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": "7b2f1670c... |
a28f63e9-eb97-4b32-942f-959473037c53 | beanzinu/AlgorithmPractice | Coding practice/10866번 덱.cpp | #include <iostream>
#include <queue>
using namespace std ;
queue<int> q1 ;
queue<int> q2 ;
int main() {
int n;
cin >> n ;
for(int i= 0 ; i < n ;i ++ ) {
string input ;
cin >> input ;
if (input.compare("push_front")== 0) {
int number ; cin >> number ;
q2.push(number) ;
for(int j=0; j < q1.size... | ALGO | 0.999407 | 4.222737 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-10-27T11:22: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": "b789f93d2... |
96fefe77-0981-4022-a698-f5f7d1715e7f | andrei5055/Incidence-System-Enumeration | k-Factorization/TripleSys/Source/kOrbits.cpp | #include "kOrbits.h"
CKOrbits::CKOrbits(uint outGroupMask, int numElems, int groupSize, int numRows) :
m_numElems(numElems), m_numRows(numRows), m_groupSize(groupSize),
RowGenerators(outGroupMask, numRows * numElems / groupSize) {
m_outMask = 16;
m_sActionOn = "k-sets, |Aut(K)|";
unsigned int le... | ALGO | 0.997831 | 4.219609 | {
"github_metadata": {
"branch": "master",
"commit_count": 621,
"repo_created_at": "2014-09-24T04:25:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8690db69... |
9e3e3f4c-aefa-42a6-8a8e-daa4ded551bc | lugt/opencc_cmake | wgen-java/common/util/sorted_map.h | /*
* Copyright 2004 PathScale, Inc. All Rights Reserved.
*/
/*
Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2 of the GNU General Public License as
published by the Free Software Foun... | ALGO | 0.997801 | 6.223589 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2018-04-25T07:57:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f0a540d3... |
41f9ae03-dde1-4a71-ba46-ba5add8a91d1 | amritraj15/Programming | InterviewBit/BackTracking/letter-phone.cpp | /*
Given a digit string, return all possible letter combinations that the number could represent.
class Solution {
public:
string charmap[10];
Solution() {
charmap[0] = "0";
charmap[1] = "1";
charmap[2] = "abc";
charmap[3] = "def";
charma... | ALGO | 0.999936 | 5.957219 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-10-06T13:01:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b26ec2f5f... |
c17863f0-9002-41a2-bc1f-5ea17472819f | yao-matrix/mProto | auditory/package/voicelock/native/audiorecog/frontend/vad/vad.cpp | #include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <memory.h>
#include <string.h>
#include "AudioDef.h"
#include "AudioUtil.h"
#include "AudioRecog.h"
#include "AudioConfig.h"
#include "math/mmath.h"
#include "type/bufring.h"
typedef struct
{
AUD_Int16s *pSpeechBuf;
AUD_Int16s *pSpeechFlag;
... | TOOL | 0.905075 | 4.928982 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2014-11-26T06:40:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 4,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "5e06d3fc5... |
e5c973a7-e75b-449d-a5b5-e2b0a06bab49 | amolmathur2001/Leetcode-Solutions | LargestBST.cpp | #include<bits/stdc++.h>
using namespace std;
struct node{
int data;
node* left;
node* right;
node(int val){
data = val;
left = right = NULL;
}
};
class NodeValue{
public:
int maxNode,minNode,maxSize;
NodeValue(int minNode, int maxNode, int maxSize){
this->maxNode... | ALGO | 0.999896 | 5.188412 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2022-04-18T05:10:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7fe71c66932... |
90731e26-ad63-48ea-9eeb-db9c90de4852 | huntermBerkeley/denro_taskflow | BSSN_GR/src/RHSINCLUDE_taskflow_kodiss.cpp | auto [gt_rhs00_kodiss_g, gt_rhs01_kodiss_g, gt_rhs02_kodiss_g,
gt_rhs11_kodiss_g, gt_rhs12_kodiss_g, gt_rhs22_kodiss_g,
At_rhs00_kodiss_g, At_rhs01_kodiss_g, At_rhs02_kodiss_g,
At_rhs11_kodiss_g, At_rhs12_kodiss_g, At_rhs22_kodiss_g, a_rhs_kodiss_g,
b_rhs0_kodiss_g, b_rhs1_kodiss_g, b_rhs2_kodis... | ALGO | 0.994969 | 3.161479 | {
"github_metadata": {
"branch": "taskflow",
"commit_count": 92,
"repo_created_at": "2023-12-21T16:27: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": "34a865e... |
c5846b27-d866-4e15-bd8f-6d20242c377c | rezznchase/kodingan-semester-1 | tugas5rezky.cpp | #include <iostream>
using namespace std;
// Fungsi untuk menukar dua elemen
void swap(int &a, int &b) {
int temp = a;
a = b;
b = temp;
}
// Bubble Sort dengan perbandingan angka
void bubbleSort(int arr[], int n) {
int nums[n];
for (int i = 0; i < n; i++) nums[i] = arr[i]; // Salin data array
... | ALGO | 0.999856 | 4.913934 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2025-06-14T09:01:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f1d69c72793... |
383c7bb6-9f7b-4bdf-be76-aaf3f81a5be0 | manoj-sahu-dev/cpp | advance-class/bitwise/xor-min.cpp | #include <iostream>
#include <vector>
using namespace std;
void print(const vector<int> &A, string vn)
{
if (vn != "")
cout << "vector " << vn << " values: " << endl;
for (auto a : A)
{
cout << a << " ";
}
cout << endl;
}
int findMinXorBF(vector<int> &A)
{
sort(A.begin(), A.end... | ALGO | 0.999977 | 5.382112 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2022-06-25T06:32: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": "0b00e33ce... |
6102146f-b24c-4658-80e4-6d6b36128a87 | xLAva/JediAcademyLinux | code/zlib32/zipcommon.cpp | // -----------------------------------------------------------------------------------------------
// Table of CRC-32's of all single-byte values (made by make_crc_table)
// -----------------------------------------------------------------------------------------------
static const unsigned long crc_table[256] =
{
... | TOOL | 0.987481 | 5.893887 | {
"github_metadata": {
"branch": "HmdSupportDK2",
"commit_count": 227,
"repo_created_at": "2013-04-28T18:51:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 182,
"forks": 28,
"issues": 8,
"pull_requests": 1
},
"file_meta": {
"content_id":... |
d0df0551-4da0-441f-93ef-beccba4a8afb | kapadiyadarshan/Cpp_language | Extra Cpp by Milan Kathiriya/Phase 6/TASK8.cpp | /*
A 15 m fire-fighter’s ladder is leaning against the
wall. If the ground distance between the foot of the
ladder and the wall is 7 m, what is the wall’s height?
c = 15 meter
a = 7 meter
b = ??
*/
#include<iostream>
#include<math.h>
using namespace std;
class Triangle
{
private :
float a;
float... | ALGO | 0.998682 | 3.694308 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2023-02-20T11:09:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d8699db31a... |
258a7416-eb0e-4605-b8a7-33fcb50f2824 | MikamiTetsuro365/Atcoder | CPSCO2019_Session3/F.cpp | #include "bits/stdc++.h"
using namespace std;
typedef long long int ll;
typedef pair<ll, ll > pi;
typedef pair<pair<ll, ll >, ll > pii;
vector<ll > vec;
vector<vector<ll > > vec2;
ll MOD = 1000000007;
ll INF = 11451419194545;
ll bekijo[35];
ll fast_pow(ll a, ll n){
if(n == 0) return 1;
//べき数nが奇数, aを前にだし... | ALGO | 0.999943 | 3.910696 | {
"github_metadata": {
"branch": "master",
"commit_count": 521,
"repo_created_at": "2019-03-09T15:23:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd5b070d... |
8018925d-3cec-41a2-94a3-388942f51d0f | MBraedley/AdventOfCode2018 | AdventOFCode14/AdventOFCode14/AdventOFCode14.cpp | // AdventOFCode14.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <iostream>
#include <deque>
#include "AdventOFCode14.h"
using namespace std;
void printRecipies(std::deque<char> &recipies, int elf1, int elf2)
{
for (int i = 0; i < recipies.size()... | ALGO | 0.999572 | 5.316337 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2018-12-22T12:41: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": "b09dea571... |
228f0141-be6e-4bd1-8a60-ca7380534587 | dmorty42/CPP_Modules | Module_08/ex00/main.cpp | //
// Created by <NAME> on 24/02/2022.
//
#include "easyfind.hpp"
#include <iostream>
#include <vector>
#include <list>
#include <deque>
int main() {
std::vector<int> vector;
std::list<int> list;
std::deque<int> deque;
int tmp;
vector.push_back(0);
vector.push_back(1);
vector.push_... | ALGO | 0.964787 | 5.209896 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2022-01-26T20:32:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "49676e825... |
86ed1864-6e45-4f84-adb9-aade48a98212 | n-yata/AtCoder-ABC | A/A190.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1L... | ALGO | 0.999907 | 3.443636 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2021-01-29T20:45: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": "d15ba0f0cb5... |
0513917d-f8e7-435e-81cf-4f74e3dc61ce | ujunhwan/algorithms_cpp | BAEKJOON/11725.cpp | // 11725번 트리의 부모 찾기
#include <cstdio>
#include <vector>
#include <queue>
using namespace std;
const int MAX = 100000;
int n, vst[MAX + 1], ans[MAX + 1];
vector<int> node[MAX + 1];
queue<int> q;
int main() {
scanf("%d", &n);
int minVal = 1 << 30, maxVal = -1;
for (int i = 0; i < n-1; i++) {
int x, y;... | ALGO | 0.999998 | 4.632486 | {
"github_metadata": {
"branch": "master",
"commit_count": 374,
"repo_created_at": "2020-02-26T12:18: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": "480b7f4b... |
45ccb5de-9583-4ddc-9b9f-95b0c327f022 | Altu-Bitu/Notice | 10월 12일 - 투 포인터/라이브 코딩/21921.cpp | //
// Created by iw040 on 2021-10-12.
//
#include <iostream>
#include <vector>
using namespace std;
//슬라이딩 윈도우로 최대 방문자 수를 구하고, 그 기간의 수를 리턴
pair<int, int> maxVisitor(int n, int x, vector<int> &visitor) {
//윈도우 초기화
int section_visitor = 0;
for (int i = 0; i < x; i++) //첫날부터 x일 동안의 방문자 수
section_vis... | ALGO | 0.999976 | 4.954361 | {
"github_metadata": {
"branch": "main",
"commit_count": 290,
"repo_created_at": "2021-08-13T06:38:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 63,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02fa2e1fd... |
b04fac7d-3ae8-4c22-b11c-078c0f1272c6 | tcmytt/lab | lab_3/bai_5.cpp | #include<iostream>
using namespace std;
class PS {
private:
int tuso, mauso;
public:
PS(int tuso = 0, int mauso = 0) {
this->tuso = tuso;
this->mauso = mauso;
}
~PS() {}
friend istream& operator >> (istream& is, PS& temp) {
cout << "\t... | TOOL | 0.957366 | 4.210728 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-02-14T15:08:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb547797b159... |
0fdacc37-141d-4202-9aa3-c2cd0223c3de | q88239/HTCleanupVitis | MS_VLC_MEL.h | #pragma once
#include <stdint.h>
#define MAX_Scup 4079
#define MSNAIVE
/********************************************************************************
* state_MS_enc: state class for MagSgn encoding
*******************************************************************************/
class state_MS_enc {
private:
in... | ALGO | 0.962776 | 5.707619 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2022-01-13T08:32:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b29586094a2... |
f03ca7bd-6c8a-46b4-9314-8cde335e625a | sglee487/Coding-test | algospot/PI.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <string.h>
#include <vector>
#include <map>
#include <algorithm>
int C;
int N;
std::string numstr;
int cache[10002];
int INF = 987654321;
int difficulty(int index_A, int index_B){
std::string substr = numstr.substr(index_A, (index_B-index_A)+1);
... | ALGO | 0.999746 | 3.763314 | {
"github_metadata": {
"branch": "master",
"commit_count": 301,
"repo_created_at": "2020-04-28T04:06:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40858d53... |
8db878b0-4e78-4a71-9078-2c9b1adb99e0 | KeepACUnion/ACM_Templates | Search/sudoku.cpp | #include <cstdio>
#include <cstring>
const int maxn = 1e3+10;
const int maxnode = 5e5+10;
char s[100];
struct DLX
{
int n, m, size;
int U[maxnode], D[maxnode], L[maxnode], R[maxnode], col[maxnode], row[maxnode];
int H[maxn], S[maxn];
int ansd, ans[maxn];
void init(int _n, int _m)
{
n = _... | ALGO | 0.999853 | 3.091987 | {
"github_metadata": {
"branch": "master",
"commit_count": 248,
"repo_created_at": "2017-08-21T05:41:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "939fc80d0... |
26f29cb0-1eb2-47de-959e-ae807a21fbeb | gourabsingha1/LeetCode-and-GFG-Problems | 0935-knight-dialer/0935-knight-dialer.cpp | // brute force
class Solution {
public:
int dp[5001][10], M = 1e9 + 7;
int helper(int n, int u, vector<int> adj[]) {
if(n == 0) {
return 1;
}
if(dp[n][u] != -1) {
return dp[n][u];
}
int res = 0;
for(auto& v : adj[u]) {
res = ... | ALGO | 0.999917 | 5.137525 | {
"github_metadata": {
"branch": "main",
"commit_count": 4708,
"repo_created_at": "2022-10-15T08:00: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": "d52f25d66... |
027743a9-0030-4f0f-aaf2-ac99e290951c | lighttransport/nanort | examples/vdisp/render-config.cc | #include "render-config.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
#endif
#include "picojson.h"
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#include <fstream>
#include <istream>
namespace example {
bool LoadRenderConfig(example::RenderConfig* config,... | CONFIG | 0.91918 | 6.045742 | {
"github_metadata": {
"branch": "release",
"commit_count": 552,
"repo_created_at": "2015-09-24T17:08:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1106,
"forks": 93,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "9233... |
6c1c9941-45d3-444e-b5eb-9d08b1cac19d | BarkNMeow/Baekjoon | 11689.cpp | #include <iostream>
#define LL long long
using namespace std;
// Dummy variable to prevent misinterpretation
bool __dummy__ = ios::sync_with_stdio(false);
auto __dummy2__ = cin.tie(NULL);
auto __dummy3__ = cout.tie(NULL);
bool is_prime(LL n) {
for (LL i = 2; i * i <= n; i++) {
if (n % i == 0) return false... | ALGO | 0.999978 | 4.892005 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2024-07-18T05:21: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": "aa59c586271... |
fa4b66cd-9169-4902-a3ae-8a9cd6ad4cb4 | bamps53/atcoder | abc/abc274/f.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, a, b) for (int i = a; i < (int)(b); i++)
using v1d = vector<int>;
using v2d = vector<vector<int>>;
#ifdef LOCAL
#include "../../debug_print.hpp"
#define debug(...) debug_print::multi... | ALGO | 0.999555 | 4.323599 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-12-07T14:14: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": "37ef2d98f7... |
7058d545-d49c-4d5d-bfe9-ed4173abcc88 | shuaidongshuai/programming | C++传/树/先中后序创建树/源.cpp | #include <iostream>
#include <cstdlib>
#include <stack>
using namespace std;
typedef struct NODE{
char val;
struct NODE *left, *right;
}Node, *Tree;
//先序创建
void createTreeA(Tree &t, char a[], int &i)//注意这里我们必须用&引用,因为我们要改变传进来的root的地址(要为它分配内存)
{
if (i > 9 || a[i] == ' ')
{
t = NULL;
return;
}
t = new Node;
... | ALGO | 0.999351 | 3.654409 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2017-09-06T13:11:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50062edca... |
79796ec3-e95f-4f5d-a8e4-ab9a11db9ff6 | ana-GT/Tester | Planners/JNSFollower/JNSFollower.h | /*
* Copyright (c) 2012, Georgia Tech Research Corporation
* All rights reserved
* Author(s): <NAME> <<EMAIL>>
* Georgia Tech Humanoid Robotics Lab
* Under direction of Prof. <NAME> <<EMAIL>>
*
* This file is provided under the following "BSD-style" License:
*
*
* Redistribution and use in source and binar... | ALGO | 0.994289 | 5.9842 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2012-05-29T09:24:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2136a035b... |
50037453-d88d-4fb5-9218-ea39a7b49196 | masumbillah06/Beecrowd-Solutions | bee_2028.cpp | #include <iostream> //undone
using namespace std;
int main()
{
int n, i, j, count;
int casenum = 1;
while (cin >> n)
{
int ara[20101];
if (n == 0)
cout << "Caso " << casenum << ": " << 1 << " numero" << endl << 0 << endl << endl;
else
{
count = 0;
... | ALGO | 0.999792 | 3.751037 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2023-02-23T14: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": "3f12c475e0d... |
8a1ad449-fbf9-4cbc-895f-80196851cfad | Kingw413/FStest | extensions/prfs.cpp | #include "prfs.hpp"
#include "common/logger.hpp"
#include "ndn-wifi-net-device-transport-broadcast.hpp"
#include "ns3/mobility-model.h"
#include "ns3/ndnSIM/NFD/daemon/fw/algorithm.hpp"
#include "ns3/ndnSIM/model/ndn-net-device-transport.hpp"
#include "ns3/ndnSIM/model/ndn-l3-protocol.hpp"
#include "ns3/node.h"
#inclu... | ALGO | 0.987934 | 5.923443 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2023-07-23T08:09: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": "5a24c67d2... |
7f231119-9fdc-41f6-8d10-63f5ef005101 | Elet0s/Study | 2022/Homework20220222/SoltVector.h | #pragma once
#pragma once
#include <assert.h>
template<typename DataType>
class GameArray
{
public:
size_t Size_;
DataType* DataPtr_;
public:
size_t GetCapacity()
{
return Size_;
}
DataType& GetData(size_t _Index) const
{
return DataPtr_[_Index];
}
DataType& operat... | TOOL | 0.980349 | 3.389226 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2022-01-17T14:50:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0e59198d6f... |
187b9229-286e-474f-a655-a4a6dc405c7b | zaurus-yusya/Competitive-Programming | atcoder/abc/abc185/b.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define all(x) x.begin(),x.end()
#define br cout << "\n";
using namespace std;
using namespace atcoder;
const long long INF = 1e18;
const long l... | ALGO | 0.999991 | 4.715302 | {
"github_metadata": {
"branch": "master",
"commit_count": 418,
"repo_created_at": "2019-08-14T07:36: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": "1e7a4b92... |
47b8057a-c311-4a41-88da-b04ddbfdb2b4 | motherlode-cmd/comp_math_error | main.cpp | #include <iostream>
#include "math.h"
#include <cmath>
double two_sum(double * delta, double a, double b) {//сумма двух чисел
/* / | \
для остатка слагаемое 1 слагаемое 2 */
//std::cout<<d_a<<" "<<d_b<<std::endl;
double s = a + b;
double b... | ALGO | 0.999943 | 4.604855 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-01-19T01:09: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": "e6b2ce6c386c... |
c7871b2c-42a2-46f5-8bbf-410140e8e6d8 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/09/0914/personal_submission/cf682c_sjw712.cpp | const int N = 100010, M = N * 2;
int h[N], e[M], ne[M], w[M], idx;
int a[N], dist[N], sz[N];
int ans;
void add(int a, int b, int c){
e[idx] = b, ne[idx] = h[a], w[idx] = c, h[a] = idx ++;
}
void dfs1(int u, int fa){
sz[u] = 1;
for(int i = h[u]; ~i; i = ne[i]){
int j = e[i];
if(j == fa) continue;
dist[j] = dist... | ALGO | 0.999735 | 3.59342 | {
"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": "6069... |
14e31425-5ae2-450a-9f7c-457c9fa6f12c | ShamylZakariya/MarchingCubes | mc/volume.hpp | //
// volume.hpp
// MarchingCubes
//
// Created by <NAME> on 11/27/19.
// Copyright © 2019 <NAME>. All rights reserved.
//
#ifndef volume_hpp
#define volume_hpp
#include <array>
#include <memory>
#include <mutex>
#include <unordered_set>
#include <vector>
#include "marching_cubes.hpp"
#include "triangle_consumer... | ALGO | 0.9039 | 6.627006 | {
"github_metadata": {
"branch": "master",
"commit_count": 240,
"repo_created_at": "2019-11-23T21:34:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c318f7d... |
a4fd527a-ad3c-4f2b-a277-d14cdad03646 | viniciusjssouza/contests | ACM/2010/Final/D-Digits Count/digits.cpp | /*****************************************************************
* Digits Count - ACM 2010 - Final Sul-americana
*
* Autor: <NAME>
* Data:24/10/2010
* Tecnicas: teoria dos numeros
* Dificuldade(1-10): 6
*************************************************************/
#include<iostream>
#include<cstdio>
#include<cstrin... | ALGO | 0.99885 | 3.459838 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-06-18T23:26: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": "d06bcc6c4... |
6f32f507-9a73-4bf9-b5b9-34315d17b888 | Mistsink/PAT-Advanced | 1037-magic-coupon.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int n, m;
vector<int> add_coupon, div_coupon;
vector<int> add_good, div_good;
int main() {
cin >> n;
int t;
for (int i = 0; i < n; i ++) {
cin >> t;
if (t == 0) continue;
if (t < 0) div_coupon.push_ba... | ALGO | 0.999916 | 4.005972 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-08-08T12:44: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": "0809da803d93... |
7cd203cb-2cc1-4f8f-8147-a48318246e94 | ishandutta2007/codeforces-l | liti/normal/1559/D1.cpp | //be naame khodaa
#include <algorithm>
#include <iostream>
#include <cassert>
#include <iomanip>
#include <cstring>
#include <sstream>
#include <numeric>
#include <string>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <set>
using namespace std;
typedef l... | ALGO | 0.999952 | 3.862704 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:17: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": "c76f298b283c... |
d77c661f-c473-467b-8fe2-924b35b81334 | Fro-Z/MeshSplit | src/vorohelpers.cpp | #include "vorohelpers.h"
#include "geometry.h"
#include <numeric>
#include "glm/gtx/vector_angle.hpp"
Face::Face(const Triangle& triangle)
{
vertices.push_back(triangle.a);
vertices.push_back(triangle.b);
vertices.push_back(triangle.c);
}
glm::vec3 Face::getNormal() const
{
auto directions = getDirectionVectors()... | ALGO | 0.997556 | 6.377935 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2018-09-05T19:24:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d410e385... |
ea498b86-470f-4b69-ac97-2ac3d247ddcd | 16naman11/Leetcode-Top-150 | 68TextJustifiaction.cpp | class Solution {
public:
vector<string> fullJustify(const vector<string>& words, int maxWidth) {
vector<string> justifiedLines;
int N = words.size();
int i = 0, j = 0;
int counter = 0;
while (i < N && j < N) {
int len = words[j].length();
coun... | ALGO | 0.999974 | 6.563207 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2024-05-14T12:22: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": "c86f05caeaa... |
161021fd-399b-4976-96f3-d78f475fbc5b | xperroni/Yamabiko | 2013-2/Code/ZETA/Sources/sampler.hpp | /*
This file is part of ZETA.
ZETA is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZETA is distributed in the hope that it will be useful,
... | ALGO | 0.97614 | 6.288847 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2014-02-04T22:38:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e6d37a69... |
daa95fe8-d85b-4b89-9a84-da8934024bc6 | Abdullah-Jabbar786/OOP-LAB | Lab 5/Task 1.cpp | #include <iostream>
using namespace std;
class Car
{
public:
int registration_num;
string Model;
string owner_name;
Car() {}
Car(int reg, string model, string owner) {
registration_num = reg;
Model = model;
owner_name = owner;
}
// Copy Constructor
Car(const ... | TOOL | 0.912959 | 5.450331 | {
"github_metadata": {
"branch": "main",
"commit_count": 96,
"repo_created_at": "2025-02-10T17:16: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": "7cc436873ca... |
383cb5d3-e858-4ab2-b33d-8e13f6772adf | Derekwan1081546/1082 | 離散數學/1081546.cpp | #include<iostream>
using namespace std;
bool go(bool** route, int node1, int* node2, int n)
{
for (int i = 0; i < n; i++)
{
if (route[node1][i] == 1 && node2[i] == 0)
{
return true;
}
}
return false;
}
int main()
{
int n, a, s, node1, node2;
cin >> n;
while (n!=0)
{
cin >> a;
bool** route = new... | ALGO | 0.999457 | 3.887248 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2020-09-29T15:52: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": "8cd5a645c... |
c1965ad4-a22e-4377-9f25-77fb65292b9c | moderngpu/moderngpu | src/moderngpu/search.hxx | // moderngpu copyright (c) 2016, <NAME> http://www.moderngpu.com
#pragma once
#include "loadstore.hxx"
#include "operators.hxx"
#include "cta_search.hxx"
#include "memory.hxx"
#include "context.hxx"
BEGIN_MGPU_NAMESPACE
template<bounds_t bounds, typename a_keys_it, typename b_keys_it,
typename comp_t>
mem_t<typena... | ALGO | 0.990033 | 6.250422 | {
"github_metadata": {
"branch": "master",
"commit_count": 148,
"repo_created_at": "2013-05-20T01:53:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1731,
"forks": 283,
"issues": 13,
"pull_requests": 0
},
"file_meta": {
"content_id": "c01... |
5f2dcb8b-5f4e-4846-8357-f54719784185 | Snehal3704/CPP-DSA | intersection_usingTwoPointer.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n1;
cout << "size of 1st array: ";
cin >> n1;
vector<int> arr1;
vector<int> arr2;
cout << "values of 1st array: ";
for(int i = 0; i < n1; i++){
int temp;
cin >> temp;
arr1.push_back(temp);
}
c... | ALGO | 0.99998 | 3.889322 | {
"github_metadata": {
"branch": "main",
"commit_count": 215,
"repo_created_at": "2024-04-10T15:38:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cbac7344af... |
1148af04-e936-419a-8229-b5b198c2fac0 | Bynaryman/OSFNTC | flopoco/src/IntMult/IntKaratsubaRectangular.cpp | #include <iostream>
#include "IntKaratsubaRectangular.hpp"
#include "IntMult/DSPBlock.hpp"
#include "assert.h"
using namespace std;
namespace flopoco{
IntKaratsubaRectangular:: IntKaratsubaRectangular(Operator *parentOp, Target* target, int wX, int wY, bool useKaratsuba, bool useRectangularTiles) :
Operator(paren... | ALGO | 0.984344 | 3.792562 | {
"github_metadata": {
"branch": "main",
"commit_count": 340,
"repo_created_at": "2023-05-30T08:55:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0277da3dd0... |
4d45d913-3b62-4318-97d1-63a51344880a | acnokego/LeetCode | 967_Numbers_With_Same_Consecutive_Differenes/recursive.cpp | class Solution {
public:
/*
* Complexity: O(2^N)
* Space: O(N)
*/
void recursive(vector<int>&tmp_ans, string curr, int N, int K){
if(curr.length() == N){
tmp_ans.push_back(stoi(curr));
return;
}
if(curr == "0" && N != 1){
return;
... | ALGO | 0.999838 | 6.254582 | {
"github_metadata": {
"branch": "master",
"commit_count": 359,
"repo_created_at": "2018-05-16T09:38: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": "0fd53322... |
4e5138dd-da21-4eb0-8381-fd79c66cf7fe | ishandutta2007/codeforces-e | emengdeath/normal/1153/F.cpp | #include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#include <iostream>
#include <string>
#include <map>
using namespace std;
const int N = 5011;
const int mod = 998244353;
int n, k, l;
long long C[N][N];
long long a[N], b[N], help[N], v[N];
long long calc(long long x,long long y)
{
long long ... | ALGO | 0.999919 | 4.09917 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:34: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": "ab571ea34c1b... |
82ef888c-f3fb-4812-9b96-4c49580cfde1 | LittleNasia/Tetris-Bitboards | Tetris Bitboards/nn.cpp | #include "nn.h"
#include <iostream>
#include <fstream>
void NN::nn::read_weights(const std::string& filename)
{
std::ifstream weights_file(filename, std::ios::binary);
if (!weights_file.good())
{
std::cout << "loasdd" << "\n";
}
float accumulator_weights[input_size][layer_sizes[0]];
float accumulator_biases[l... | ALGO | 0.994911 | 4.488784 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-03-08T13:04: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": "17f6433aa5... |
dfc1e8fc-64b0-46f7-9fb3-905fa2329d8a | anuj2001310/Leetcode- | 3628-find-minimum-time-to-reach-last-room-ii/3628-find-minimum-time-to-reach-last-room-ii.cpp | class State {
public:
int r;
int c;
int dis;
State(int r, int c, int dis) : r(r), c(c), dis(dis) {}
};
class Solution {
private:
vector<vector<int>> dirs = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};
public:
const int inf = 0x3f3f3f3f;
int minTimeToReach(vector<vector<int>>& moveTime) {
int... | ALGO | 0.999982 | 5.641915 | {
"github_metadata": {
"branch": "main",
"commit_count": 3991,
"repo_created_at": "2024-10-08T13:40: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": "1bd0b9d38... |
f8fb01d1-158e-4d6c-b0a9-53da9daccc52 | BIDS/BSDS500 | grouping/source/buildW/util/kmeans.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.999405 | 6.29463 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-04-01T00:01:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 83,
"forks": 30,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "362f848a0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.