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 |
|---|---|---|---|---|---|---|---|
3acf3ad0-a00b-453b-8575-a2f3c8d46ad3 | CursedSpiderBoi/leetcode | Codes/medium-1020-number_of_enclaves.cpp | // You are given an m x n binary matrix grid, where 0 represents a sea cell and 1 represents a land cell.
// A move consists of walking from one land cell to another adjacent (4-directionally) land cell or walking off the boundary of the grid.
// Return the number of land cells in grid for which we cannot walk off th... | ALGO | 0.999981 | 6.16966 | {
"github_metadata": {
"branch": "main",
"commit_count": 136,
"repo_created_at": "2022-12-09T09:18:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c84439f79... |
11d06164-b553-4ecd-a0d3-0ccce1cf3b00 | pedro-augustof/Jogos-Unreal | Triple X/TripleX.cpp | #include <iostream>
#include <ctime>
void PrintIntroduction(int Difficulty)
{
std::cout << "\n\nYou are a secret agent breaking into a level " << Difficulty;
std::cout << " secure server room...\nEnter the correct code to continue...\n\n";
}
bool PlayGame(int Difficulty)
{
PrintIntroduction(Difficulty);
... | TOOL | 0.977342 | 3.347268 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-09-01T00:28: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": "94874c9ad9d1... |
5721c501-90ee-49e0-91c3-173f0ee5faad | alimasry/UVA-Problems | 1121 UVa.cpp | // 1121 UVa
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
const ll N = 100005;
const ll INF = 1e15;
const int MOD = 1e9 + 7;
const double EPS = 1e-7;
const double PI = acos(-1.0);
ll n, s, a[N];
int main()
{
ios::sync_with_stdio(false)... | ALGO | 0.999963 | 3.204338 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2019-01-11T22:25:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aae71202f... |
7fbe4645-b117-41cf-82b4-8726872bd5ee | NandanaRaol/DataStructures | WC5-3-1.cpp | #include<bits/stdc++.h>
using namespace std;
/*C. Bing Watcher Aditya
time limit per test2 s.
memory limit per test256 MB
inputstandard input
outputstandard output
Aditya from 6th class is an avid television enthusiast and has compiled
a list of TV programs he's eager to watch for the day. His list contains n
shows, ... | ALGO | 0.999933 | 3.687785 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2023-08-12T12:04: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": "fb52a845eb3... |
c7ccce9d-2068-4368-bbca-1121b5dab004 | DDor-H/leetcode_cpp | code/数据结构/leetcode_0112.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.999958 | 5.879086 | {
"github_metadata": {
"branch": "main",
"commit_count": 93,
"repo_created_at": "2021-08-22T05:24: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": "0924839ba3a... |
2328a884-3759-4902-9fcb-4e98d1c88180 | tancuong2596/OnlineJudge | Codeforces/Practice/369C.cpp | #include <stdio.h>
#include <set>
#include <string.h>
#include <vector>
using namespace std;
#define SZ 100005
typedef pair<int, int> ii;
int n, deg[SZ];
set<ii> G[SZ];
void init() {
int u, v, w;
scanf("%d", &n);
for (int i = 1; i <= n - 1; i++) {
scanf("%d %d %d", &u, &v, &w);
G[u].insert(ii(v, w ==... | ALGO | 0.999961 | 3.946231 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-11-07T23:30: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": "3dd60be358... |
7998c95a-4d78-431f-b969-c95ebc467a72 | ginny100/Leetcode-2023 | 4. April/Day23RestoreTheArray.cpp | /**
* @file Day23RestoreTheArray.cpp
* @author <NAME>
* @brief 1416. Restore The Array (https://leetcode.com/problems/restore-the-array/description/)
* @version 0.1
* @date 2023-04-23
*
* @copyright Copyright (c) 2023
*
*/
/**
* @brief Note:
* - I was not able to come up with the solution to this problem.
... | ALGO | 0.99992 | 6.006853 | {
"github_metadata": {
"branch": "master",
"commit_count": 270,
"repo_created_at": "2023-01-01T14:57:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc01394... |
55f5101b-3fc3-4008-8293-e061c584920a | csyang79/algorithms-and-oj | leetcode-algorithms/073. Set Matrix Zeroes/setMatrixZeros.cpp | //O(n^2)time and O(1) space,复用第一行和第一列
class Solution {
public:
void setZeroes(vector<vector<int>>& matrix) {
if (matrix.empty() || matrix[0].empty())
return;
bool row0 = false, col0 = false;
for (int j = 0; j < matrix[0].size(); ++j)
if (matrix[0][j] == 0)
{
row0 = 1;
break;
}
f... | ALGO | 0.998865 | 5.748239 | {
"github_metadata": {
"branch": "master",
"commit_count": 218,
"repo_created_at": "2018-03-20T05:22: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": "8b9e1271... |
8b6287b0-d610-4b8d-95e2-bd09ec789644 | ishandutta2007/codeforces-h | heart_blue/normal/15/B.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.995435 | 4.252966 | {
"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": "eb927990e4ee... |
78f5923b-6224-4d87-bd9d-0a1d7187fa84 | Maigo/gea | gea/libs/gea_math/src/gea/mth_vector/compression/comp_quaternion.h | #ifndef __GEA_MTH_VECTOR_COMP_QUATERNION_H__
#define __GEA_MTH_VECTOR_COMP_QUATERNION_H__
// gea includes
#include <gea/mth_vector/quaternion.h>
namespace gea {
namespace mth {
// ------------------------------------------------------------------------- //
// quaternion compression structs ... | ALGO | 0.955435 | 6.80252 | {
"github_metadata": {
"branch": "master",
"commit_count": 115,
"repo_created_at": "2013-12-12T18:14: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": "87a204e8... |
989fab8e-39eb-4ff8-920d-a17df28c6449 | heredaniyal/cpp_codes_dani | task2.cpp | #include <iostream>
using namespace std;
// DONE
// 2. Write a C++ code to find the average of 5 numbers using for loop and array.
int main()
{
int abdullah[5] = {1,2,3,4,5}; // input bhi ley sakta no issue mera nahi dil kar raha
// input lene ka
int sum = 0, average = 0; // 0 daalna zaroori hai taakay ga... | ALGO | 0.999233 | 3.501025 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-05-25T09:00: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": "2cb2f71d27a2... |
ad130fb8-bc35-4ab2-9990-7138d8fef951 | puneethsaikumar2000/CodeChef | long/07_jul/DRGNDEN.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ff first
#define ss second
#define pb push_back
#define mk make_pair
#define maxn 300005
#define mod 1000000007
#define inf 1000000007
typedef long long int lli;
typedef unsigned long lon... | ALGO | 0.999826 | 3.989124 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-07-28T12:13: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": "67781bd98... |
4c43b74f-e257-48da-8bf7-92a1b38c1726 | michaelma0311/Gold | closing/closing.cpp | #include <bits/stdc++.h>
using namespace std;
struct DSU {
vector<int> e;
DSU(int N) : e(N, -1) {}
int get(int x) { return e[x] < 0 ? x : e[x] = get(e[x]); }
bool same_set(int a, int b) { return get(a) == get(b); }
int size(int x) { return -e[get(x)]; }
bool unite(int x, int y) {
x ... | ALGO | 0.99999 | 4.819644 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-07-16T04:30: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": "b556e60da8cd... |
a140f0ba-9f6f-48a4-8973-56a69707326a | ishandutta2007/codeforces-r | radal/normal/311/C.cpp | #include <bits/stdc++.h>
#pragma GCC target ("avx,avx2,fma")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define X first
#define Y second
#define debug(x) cerr << #x << ": " << x << endl;
#define endl '\n'
#define pb push_back
#define rep(i,l,r) for (int i=l; i<r; i++)
#define repr(i,r,l) ... | ALGO | 0.999979 | 3.449221 | {
"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": "21b639a9926f... |
8832b652-3035-459b-9b26-4a6bf79f627c | ishandutta2007/codeforces-f | fedoseev.timofey/normal/1062/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int N = 1e5 + 7;
const int K = 20;
int tin[N], tout[N];
int go[K][N];
int h[N];
int timer = 0;
vector <int> g[N];
bool anc(int a, int b) {
return tin[a] <= tin[b] && tout[b] <= tout[a];
}
void dfs(int u = 0, in... | ALGO | 0.999985 | 4.589911 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "abb68f20e633... |
dcee3d82-845f-4185-8c3a-1e297e53e2f2 | gaeqs/Rush | src/rush/curve/bezier_impl.h | //
// Created by gaelr on 25/09/23.
//
#ifndef NEON_BEZIER_IMPL_H
#define NEON_BEZIER_IMPL_H
template<size_t Size, size_t Dimensions, typename Type, typename Allocator,
typename PointAllocator>
requires (Size > 0)
template<typename... T>
requires (sizeof...(T) == Size)
rush::BezierSegment<Size, Dimensions, Ty... | ALGO | 0.934927 | 7.519793 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2023-08-12T03:22: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": "5856b92b9... |
d0689e07-9d54-4ebc-8c75-64ba9cda0a25 | AsukaXX/id | id/scanf.cpp | #include"sort.h"
void createindex(index& index_m,const string word,const int line) {
index_it it_in;
set<int> set_t;
it_in = index_m.find(word);
if (it_in == index_m.end()) {
set_t.insert(line);
index_m.insert(make_pair(word, set_t));
}
else {
it_in->second.insert(line);
}
}
int main() {
ifstream c_f;
... | ALGO | 0.981825 | 3.757972 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-04-21T09:35: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": "7aebe708f9... |
3227cec9-0347-4b42-9dd6-885b0daf7dc7 | Bittu278/Data-structures-in-C- | ARRAYS/mergesortedarray.c++ | #include<iostream>
using namespace std;
void merge(int arr1[],int n,int arr2[],int m,int arr3[],int t){
int i=0;
int j=0,k=0;
while (i<n && j<m)
{
if (arr1[i]<arr2[j])
{
arr3[k]=arr1[i];
i++;
k++;
}
else if (arr1[i]>arr2[j])
{
arr3[k]=arr2[j];
j++;
... | ALGO | 0.999992 | 4.088797 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2023-12-03T11:55: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": "06f39291c1a... |
a59e8e92-5b04-4880-aeda-7d2c7e7aaa43 | fmuno003/CS012 | Assignments/Assignment1/part3.cpp | // =============== BEGIN ASSESSMENT HEADER ================
/// @file assn1/main.cpp
/// @brief Assignment 1 for CS 12 Summer 2015
///
/// @author <NAME> [<EMAIL>]
/// @date 07/31/2015
///
/// @par Enrollment Notes
/// Lecture Section: 201
/// @par
/// Lab Section: 221
/// @par
/// TA: <NAME>
///
/// @pa... | TEST | 0.961631 | 4.718501 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2016-03-28T19:40:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "804a7c70d... |
8db1d5f3-2972-40e8-9ab0-ab48f357366a | ds-umass/GraphMini | GraphMini/dependency/GraphPi/src/schedule_printer.cpp | #include <../include/graph.h>
#include <../include/dataloader.h>
#include "../include/pattern.h"
#include "../include/schedule.h"
#include "../include/common.h"
#include "../include/motif_generator.h"
#include <assert.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <chrono>
using namespace std... | ALGO | 0.99901 | 4.687423 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-09-12T18:30:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac4f669f98d1... |
0371d77f-ffcc-40d9-befd-561146430822 | yuyilei/Daily-Notes | offer/序列化二叉树.cpp | /*
请实现两个函数,分别用来序列化和反序列化二叉树
*/
/*
struct TreeNode {
int val;
struct TreeNode *left;
struct TreeNode *right;
TreeNode(int x) :
val(x), left(NULL), right(NULL) {
}
};
*/
class Solution {
public:
char* Serialize(TreeNode *root) {
stringstream ss;
serialize(root, ss);
... | ALGO | 0.99829 | 5.387934 | {
"github_metadata": {
"branch": "master",
"commit_count": 298,
"repo_created_at": "2017-12-21T09:07:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b0bea79... |
12a8df48-878d-42e4-875c-2fa3d3721ad3 | hytech-racing/code-2019 | Playground/pedal_noise_testing/frontecu_ADC_distribution/frontecu_ADC_distribution.ino | #include <ADC_SPI.h>
ADC_SPI adc;
int readings[15];
void setup() {
// adc = ADC_SPI(9); // Use if CS is not on pin 10
adc = ADC_SPI(10);
Serial.begin(115200);
pinMode(A9, OUTPUT);
//analogWriteFrequency(A9, 80);
analogWrite(A9, 128);
//digitalWrite(A9, HIGH);
}
void loop() {
// USE FOLLOWING CODE F... | TOOL | 0.927389 | 3.639603 | {
"github_metadata": {
"branch": "master",
"commit_count": 929,
"repo_created_at": "2018-08-09T06:28:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "26b88ca8d... |
bf812929-5818-44f3-b8f0-16f612fc4b64 | juancoariza/CPP-Projects-Summer-2018 | arrays.cpp | /*************************************************************************
* File: arrays.cpp
* Author: <NAME>
* Class: COP 2001; 201805; 50135
* Purpose: Demonstrate the usage of arrays in C++ with a GPA program
**************************************************************************/
#include <iostream>
#include <... | TOOL | 0.93752 | 3.615211 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-09-04T18:06:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1bcaa53aa8... |
1ab02eb6-ed7a-4c88-a75b-3eb989bdfaa8 | trunc8/100-days-of-code | Solutions/1423_Maximum Points You Can Obtain from Cards.cpp | // Solution 1: Quite redundant
class Solution {
public:
int maxScore(vector<int>& cardPoints, int k) {
vector<int> front_score( cardPoints );
vector<int> back_score( cardPoints );
int front_sum = 0;
int back_sum = 0;
for( int i=0; i<k; i++ ){
front_sum += car... | ALGO | 0.999981 | 6.039487 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2022-06-18T12:13: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": "04387321590... |
123f5ee1-bd61-4869-9ebf-879b6305f040 | ritishBhatoye/dsa | DAY 9/SearchRotateNSorted.cpp | //SEARCH IN ROTATE AND SORTED ARRAY
#include<iostream>
using namespace std;
void user_input(vector<int> &arr,int size){
cout<<"ENTER THE ELEMENTS IN AN ARRAY "<<endl;
int a;
for(int i=0;i<size;i++){
cin>>a;
arr.push_back(a);
}
}
void print(vector<int> &arr,int size){
for(int i=0;i<s... | ALGO | 0.999969 | 5.256078 | {
"github_metadata": {
"branch": "main",
"commit_count": 686,
"repo_created_at": "2023-07-01T07:57:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef2971d53d... |
26d2f7c7-b3ac-4c13-b8f1-f6025af3b414 | Tejas988/Algorithms | graphs.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
//array of list of size v here index represent the parent node
class Graphs
{
int V;
list<int> *l;
public:
Graphs(int V)
{
this->V=V;
l = new list<int> [V];//array of lists
}
void addEdge(int x,int y){
l[x].push_back(y);
l[y].push_bac... | ALGO | 0.999629 | 4.673898 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2021-06-24T10:50:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "add385654... |
c3167a77-e894-4bd3-a255-1abdc3ad8cda | berniegach/socoles-grader | backend/clauses/select/where_clause.h | #ifndef WHERE_CLAUSE_H
#define WHERE_CLAUSE_H
#include <string>
#include "../../abstract_syntax_tree.h"
#include "select_clause.h"
#include "from_clause.h"
class Where_clause
{
public:
// Enum to represent the type of condition
enum class ConditionType
{
SIMPLE, // A simple condition (e.g., a = b)... | TOOL | 0.977054 | 6.845974 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2025-06-23T10:00: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": "647a5ff306f... |
598dbd58-f13e-439c-b7d5-befccdd39d44 | AlgoPeek/leetcode | algorithm/105-ConstructBinaryTreefromPreorderandInorderTraversal/ConstructBinaryTreefromPreorderandInorderTraversal.cpp | // Source: https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/description/
// Author: <NAME>
// Date: 2018-07-12
//
// Description:
// Given preorder and inorder traversal of a tree, construct the binary tree.
//
// Note:
// You may assume that duplicates do not exist in the tree.
/... | ALGO | 0.999493 | 6.889895 | {
"github_metadata": {
"branch": "master",
"commit_count": 274,
"repo_created_at": "2018-07-09T15:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2cd58d50... |
a112886c-1199-4008-afd2-06ea5dd27d9d | readul-islam/DSA_C_Plus_Plus | Lecture_13/remove_all_adjacent_dublicates.cpp | #include <iostream>
#include <string>
using namespace std;
class Solution {
public:
string removeDuplicates(string s) {
int i = 0;
while (i < s.length()) {
// Check if the next character is the same
if (i < s.length() - 1 && s[i] == s[i + 1]) {
// Remove the... | ALGO | 0.996638 | 7.212401 | {
"github_metadata": {
"branch": "main",
"commit_count": 141,
"repo_created_at": "2024-08-13T10:28: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": "ca1e90e0ee... |
efa307c9-f12d-4068-8f45-e5c5fffc9820 | duong2179/EDCircles | src/EDCircles.h | #ifndef EDCIRCLES_H_
#define EDCIRCLES_H_
#include <cmath>
#include <cstdint>
#include <map>
#include <stack>
#include <vector>
#include <opencv2/opencv.hpp>
#include "CircleFitter.h"
#include "EDPF.h"
#include "LineFitter.h"
#define CLOSE_EDGE_THRES 3.0
#define CIRCLE_FIT_ERR_THRES 1.5
#define MIN_LINE_LEN 10
#de... | ALGO | 0.954331 | 6.218647 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2019-02-25T14:09:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "56edd6159... |
42393338-f82f-4f6a-b1e9-1173a973f62e | Dexter-99/Hacktoberfest-2020 | Greedy Algorithms/defkin.cpp | #include <iostream>
#include <climits>
#include <algorithm>
#define ll long long
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int w, h, n;
cin >> w >> h >> n;
if (n == 0)
{
ll ans1 = w * h;
cout << ans1 << '\n';
}
... | ALGO | 0.999814 | 3.446807 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2020-10-01T16:37:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 11,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "ef684e5d... |
bd7aab8b-7bc9-4e5a-9cf4-a4184c7e54fa | ishandutta2007/codeforces-l | lhic/normal/508/E.cpp | #include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <bitset>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <queue>
typedef long long ll;
typedef long double ld;
using namespace std;
vector<string... | ALGO | 0.999737 | 3.866735 | {
"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": "38344058893d... |
cadfaa62-9749-4cdf-8fe8-47a86cb3cde7 | yancouto/competitive-programming | ojs/uva/2039.cpp | #include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
template<typename T> inline T abs(T t) { return t < 0?... | ALGO | 0.999978 | 3.314777 | {
"github_metadata": {
"branch": "master",
"commit_count": 143,
"repo_created_at": "2016-08-26T11:17:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d9cd0369... |
1b991dc8-4993-466d-b6a8-a6b1c3038c5e | MarioMiranda98/Curso-Cpp | 11° Bloque/Ejercicio13.cpp | /*
Realiza una funcion que tome como parametros un vector de numeros y su tamaño y cambie de signo
los elementos del vector
*/
#include <iostream>
#include <conio.h>
using namespace std;
void cambiarSigno(int vec[], int tam);
void mostrar(int vec[], int tam);
int main() {
int elementos;
int vector[10... | ALGO | 0.998961 | 4.203081 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2019-07-28T02:07:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "24ba2a321... |
235da498-b8df-4d04-89e7-734cd5150ca3 | SamarthPandya/DSA-Codes | sorting algorithms/radix_sort.cpp | #include "tools.h"
#include <math.h>
void counting_sort_util(int a[], int n, int m)
{
int hasher[10] = {0};
for (int i = 0; i < n; i++)
{
hasher[(int)(a[i] / pow(10, m)) % 10]++;
}
for (int i = 1; i < 10; i++)
{
hasher[i] = hasher[i] + hasher[i - 1];
}
int b[n];
for ... | ALGO | 0.999598 | 4.487286 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2022-05-27T07:20: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": "40c1e6354... |
b712fe00-2d75-4b2a-90f3-838dbe3fdedd | ishandutta2007/codeforces-i | ivl/normal/1091/C.cpp | #include <bits/stdc++.h>
#define FOR(i,a,b) for (int i = (int)(a); i < (int)(b); ++i)
#define REP(i,n) FOR(i,0,n)
#define pb push_back
#define x first
#define y second
#define TRACE(x) cerr << #x << " = " << x << endl
#define _ << " _ " <<
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
in... | ALGO | 0.999351 | 3.737719 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39: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": "b35f4d8924f3... |
650385ed-8f04-4da5-9e82-d7a7c8d69791 | JelluSandro/olympic-code-cpp | inopolis/threeDO2/1.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
vector<long long> a;
vector<long long> b;
void build(int v, int l, int r) {
if (l == r) {
a[v] = b[l];
} else {
build(2 * v, l, (l + r) / 2);
build(2 * v + 1, (l + r) / 2 + 1, r);
a[v] = a[2 * v] + a[2 * v + 1];
}
}
void... | ALGO | 0.999224 | 4.622279 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-08-06T09:41: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": "a90cb4cb691c... |
275ae5ae-3558-41bd-b170-49d3cff7d883 | alexandraback/datacollection | solutions_5738606668808192_0/C++/Lunaro/c.cpp | #include <iostream>
#include <string>
#include <bitset>
#include <algorithm>
#include <cmath>
using namespace std;
unsigned long long n, j;
unsigned long long divisor (unsigned long long num) {
for(unsigned long long i=2; i<=sqrt(num)+1; ++i) {
if(num%i == 0) return i;
}
return -1;
}
string to_binstring (unsigne... | ALGO | 0.999859 | 3.529066 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aabdbe913... |
f07a95c8-1423-4f96-8fb4-9278b4a752de | rivertogg/Baekjoon | 백준/Bronze/2754. 학점계산/학점계산.cc | #include <iostream>
int main()
{
char grade[3];
std::cin >> grade;
if (grade[0] == 'A')
{
if (grade[1] == '+')
std::cout << "4.3";
else if (grade[1] == '0')
std::cout << "4.0";
else if (grade[1] == '-')
std::cout << "3.7";
}
else if (... | ALGO | 0.994251 | 3.612033 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2024-06-20T05:50:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62e9a472b54... |
9385ce17-ee86-4b00-a9aa-f89dacb910e3 | inkplume/lootcode | PartitionList.cpp | #include <stdio.h>
#include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode *partition(ListNode *head, int x) {
/* there is no need to partition if the whole list has no node
or only one node. */
i... | ALGO | 0.999974 | 4.960608 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2014-06-17T06:40: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": "cce78ad5ee... |
827748ea-58a0-4fc2-9afd-3b8ec9d387d9 | SamCode-BD/cosc320 | FunctionPointers/FunctionPointers008/main.cpp | /*
Author: <NAME>
Creation Date: 1/10/2022
Last Update: 1/22/2024
Description: Example of using a typedef to define a function pointer data type
and the construction of an array of these pointers.
*/
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <iostream>
using namespace std;
// Defines a YesNoF... | TOOL | 0.997826 | 6.280746 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2024-01-30T14:43: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": "d67da6815... |
15dcdfc0-7f48-462b-9c21-20bd1b6ddbc6 | infinity4471/SPOJ | blue mary needs help again/cashier.cpp | #include <cstdio>
#include <algorithm>
#include <cassert>
#define MAXN 500110
#define INF 1234567890
#define BASE 200000
using namespace std;
typedef long long ll;
struct node {
int sum, flag1, flag2;
bool isup1, isup2;
};
node segtree[ 4*MAXN + 1 ];
void init( int n, int l, int r )
{
if( l == r ) {
segtree[... | ALGO | 0.999543 | 3.389647 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-11-26T00:10:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 6,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "c856780bef... |
9ccb965e-c20f-48a0-a8ba-40d0b329d77e | WhiZTiM/coliru | Archive2/9b/e2351c24c1fa6b/main.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
struct ABC
{
int n;
char c;
double a[3];
};
void get( int & n, char & c, double a[3], const ABC & x )
{
n = x.n;
c = x.c;
for (int i = 0; i < 3; i++){
a[i] = x.a[i];
}
}
void get( int n[], char c[], double ... | TOOL | 0.992045 | 3.01917 | {
"github_metadata": {
"branch": "master",
"commit_count": 42630,
"repo_created_at": "2016-04-21T16:34: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": "d45b2f... |
190b675e-2ea7-4a25-b0b9-16133a47c375 | namangarg2002/gfg | Difficulty: Medium/Longest Subarray with Sum K/longest-subarray-with-sum-k.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int longestSubarray(vector<int>& arr, int k) {
unordered_map<int, int> prefixSumIndex;
int currentSum = 0;
int maxLength = 0;
for (int i = 0; i < arr.size(); i... | ALGO | 0.999413 | 6.457508 | {
"github_metadata": {
"branch": "main",
"commit_count": 202,
"repo_created_at": "2023-10-30T16:38: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": "b214f3874e... |
90b24ec4-6486-477f-a07f-bfab98926728 | Martins3/ACM | leetcode/0/72.cpp | #include "../dbg.hpp"
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstring>
#include <deque>
#include <forward_list>
#include <fstream>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#i... | ALGO | 0.999986 | 5.24372 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2018-03-05T11:57:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "77ebb111d... |
547d6d9d-941e-4433-b559-07a267265e01 | intheory0/data_structures | avltree.cpp | #include <algorithm>
#include "node.h"
#include "avltree.h"
AVLTree::AVLTree(Node *node)
{
root = node;
}
int AVLTree::height(Node *node)
{
return (node) ? node->height : 0;
}
int AVLTree::check_balance(Node *node)
{
return (node) ? height(node->left) - height(node->right) : 0;
}
void AVLTree::left_rotation(Node... | ALGO | 0.996237 | 3.850349 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2020-12-28T16:49:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46349a281032... |
100658a3-7698-4bf2-becf-37fd387abe05 | retrodump/vapor_engine | inc/Geometry/BoundingBoxTree.h | /************************************************************************
*
* vapor3D Engine © (2008-2010)
*
* <http://www.vapor3d.org>
*
************************************************************************/
#include "Engine/API.h"
#include "Math/Vector.h"
#include "Math/Ray.h"
NAMESPACE_ENGINE_BEGIN
//--------... | ALGO | 0.915662 | 6.866371 | {
"github_metadata": {
"branch": "master",
"commit_count": 504,
"repo_created_at": "2018-01-06T16:15:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "632c436e1... |
d9b2cfca-8db5-4348-800d-1476bf3c869c | aobolensk/pp_2020_spring | modules/task_4/suslov_e_batchers_sort/suslov_e_batchers_sort.cpp | // Copyright 2018 <NAME>
#include <vector>
#include <string>
#include <utility>
#include <random>
#include <ctime>
#include <iostream>
#include <cstring>
#include <thread>
#include <future>
#include "../../../modules/task_4/suslov_e_batchers_sort/suslov_e_batchers_sort.h"
double* getRandomArray(int size) {
std::r... | ALGO | 0.999907 | 4.415671 | {
"github_metadata": {
"branch": "master",
"commit_count": 1853,
"repo_created_at": "2020-02-27T13:09:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 70,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "86c24c... |
9913fbb5-a95b-4a91-bc73-0d422a2a37dd | raincross7/code-similarity | codes/train_code/problem049/problem049_440.cpp | #include "bits/stdc++.h"
using namespace std;
//?????????
#pragma region MACRO
#define putans(x) std::cerr << "[ answer ]: " ; cout << (x) << endl
#define dputans(x) std::cerr << "[ answer ]: "; cout << setprecision(40) << (double)(x) << endl
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define RREP(i,n,a) for... | ALGO | 0.999994 | 5.139304 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23e86f58a519... |
7d05874f-45b5-432d-8cef-9d58474d8f49 | Watermelon-1234/compete_programming | ap325_release/ch3/P_3_2/p_3_2_gen.cpp | #include <bits/stdc++.h>
using namespace std;
void one(int n, int l, int r) {
stack<int> S;
int c;
char left[4]="([{", right[4]=")]}";
int er=(rand()%10<r)? l-1-rand()%10:l+1;
fprintf(stderr,"%d\n",er<l-1);
for (int i=0;i<l;i++) {
if (i==er) { // insert error
if (S.empty()) ... | ALGO | 0.925047 | 3.199524 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-03-24T06:16: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": "3f989c777c59... |
519a79a5-5054-424d-9316-df916841561a | nefrttPrabhu/SDE-sheet | 45_linked list/Questions/add node values.cpp |
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* addTwoNumb... | ALGO | 0.999945 | 6.749604 | {
"github_metadata": {
"branch": "main",
"commit_count": 526,
"repo_created_at": "2024-11-22T20:03: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": "bd6b633bcb... |
1cd99471-8fc8-4ada-a543-9c26314f66ae | lasjg72/CompetetiveProgramming | program/Atcoder/ABC/ABC_D/D144.cpp | #include <iostream>
#include <algorithm>
#include <tuple>
#include <vector>
#include <string>
#include <queue>
#include <cmath>
#include <set>
#include <map>
using namespace std;
using ll = long long;
#define PI 3.141592653589793
int main()
{
int a, b, x;
cin >> a >> b >> x;
if(x == a*a*b){
cout <... | ALGO | 0.999549 | 4.057335 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-09-14T08:55: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": "28c6f2a64b... |
5e85d7d6-cd0c-4d43-8a77-89eeeaa953ca | mtszpater/Uniwersytet-Wroclawski | Kurs C++/Zad1/main.cpp | #include <cstdlib>
#include <iostream>
#include <climits>
#include <vector>
#include <stdexcept>
#include <sstream>
using namespace std;
vector <long long> podzial ( long long liczba ){
long long k = 2;
vector <long long> vect;
switch( liczba )
{
case -1:
vect.push_... | ALGO | 0.999573 | 4.303244 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2016-04-17T19:42:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a492706a... |
4afe0bdd-52e3-4f40-9095-5fecfabeed45 | Zelus120805/IsValid | maxProfit.cpp | #include <iostream>
using namespace std;
int maxProfit(int a[], int start, int end)
{
if (end - start == 1) return 0;
int Max = a[start + 1], tMax;
int Min = a[start + 1], tMin;
for (int i = start + 1; i < end; i++)
{
if (a[i] > Max)
{
Max = a[i];
tMax = i;
}
else if (a[i] < Min)
{
Min = a[i];
... | ALGO | 0.999909 | 4.01203 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2024-03-09T16:32: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": "e4a8a77a09... |
5a168d07-abcf-44db-a262-303f294400bd | kamyu104/LeetCode-Solutions | C++/length-of-the-longest-increasing-path.cpp | // Time: O(nlogn)
// Space: O(n)
// sort, binary search, longest increasing subsequence, lis
class Solution {
public:
int maxPathLength(vector<vector<int>>& coordinates, int k) {
const auto& longest_increasing_subsequence = [](const auto& arr) {
vector<int> result;
for (const auto&... | ALGO | 0.99997 | 5.410892 | {
"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": ... |
af62c2b5-3300-42ae-969b-203a6e09be00 | amateomi/OOP-Lafore | 06-Objects-and-Classes/02/main.cpp | #include <iostream>
using namespace std;
class TollBooth {
private:
unsigned int count;
double proceed;
public:
TollBooth() : count(0), proceed(0.0) {}
void payingCar() {
count++;
proceed += 0.50;
}
void noPayCar() {
count++;
}
void display() const {
... | TOOL | 0.947839 | 5.556779 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-07-06T15:29:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0eb9aa870e... |
145eb0d3-1f6e-412f-864a-70d0d12f9ec9 | Revolutionary-Games/Thrive | src/native/physics/ContactListener.cpp | // ------------------------------------ //
#include "ContactListener.hpp"
#include "Jolt/Physics/Body/Body.h"
#include "Jolt/Physics/Collision/CollideShape.h"
#include "Jolt/Physics/Collision/Shape/CompoundShape.h"
#include "Jolt/Physics/Collision/Shape/SubShapeID.h"
#include "DebugDrawForwarder.hpp"
#include "Physic... | TOOL | 0.96439 | 7.285582 | {
"github_metadata": {
"branch": "master",
"commit_count": 8823,
"repo_created_at": "2012-08-30T15:31:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3209,
"forks": 543,
"issues": 674,
"pull_requests": 18
},
"file_meta": {
"content_id": "... |
10ac7e1f-0676-4f5a-8695-1da86a8af1f3 | SalahAbotaleb/Competitive-Programming | SPOJ/ROHAAN/37656314_AC_40ms_5427kB.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <queue>
#include <string>
#include <cmath>
#include <set>
#include <stack>
#include <fstream>
#include <cassert>
#include <iomanip>
#define ll long long
using namespace std;
const ll loo = 0x3f3f3f3f3f3f3f3f;
co... | ALGO | 0.999691 | 3.762076 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2022-07-05T22:28: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": "04c4a0f55dc... |
76ba78be-ed46-434d-9d57-23eb9a15da15 | SrLancelot7/ProgramacionCompetitiva | SUPC/Conexiones en la Red Académica/main.cpp | #include<vector>
#include<stdio.h>
typedef std::vector<int> vi;
std::vector<vi> AdjList;
vi dfs_num;
void addEdge(int u, int v){
AdjList[u].push_back(v);
//AdjList[v].push_back(u);
}
void dfs(int u){
dfs_num[u] = 1;
for (int j = 0; j < (int)AdjList[u].size(); j++){
int v = AdjList[u][j];
... | ALGO | 0.999904 | 4.207993 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2023-08-16T03:03: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": "3aa8db3f56... |
6f1f72bc-75dc-47e0-b845-4e31b30be637 | qpwoeirut/competitive-programming | ojuz/ioi/2020/Day2/mushrooms/cpp/stub.cpp | #include <cstdio>
#include <cstdlib>
#include <cstdarg>
#include <string>
#include "mushrooms.h"
static char fmt_buffer[100000];
#define FMT_TO_STR(fmt, result) va_list vargs; va_start(vargs, fmt); \
vsnprintf(fmt_buffer, sizeof(fmt_buffer), fmt, vargs); \
va_end(vargs); fmt_buffer[sizeof(fmt_buffer)-1] = 0; \
std:... | ALGO | 0.999618 | 3.966838 | {
"github_metadata": {
"branch": "master",
"commit_count": 348,
"repo_created_at": "2020-09-17T05:10:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "35af3dd... |
ad0d1daa-a6ae-4775-9d60-6c80c30cb03a | TolimanStaR/Course-Work | media/code_files/9a35dd37fd88ef55cc74050e078418f4f95697a3.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef map<string, int> dict;
#define fo(i, n) for (int i = 0; i < (n); ++i)
#define rep(x) for (int i = 0; i < (x); ++i)
#define pb push_back
#define fi first
#define se second
void optimization() {
cin.tie(nullptr);
... | ALGO | 0.999917 | 3.532254 | {
"github_metadata": {
"branch": "master",
"commit_count": 144,
"repo_created_at": "2020-03-31T21:42:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 5
},
"file_meta": {
"content_id": "85c01d8c... |
40e041ff-8735-47e7-8cf5-037694b8e048 | AlonsoPaulino/competitive-programming | Codeforces/16B - Burglar and Matches.cpp | #include <bits/stdc++.h>
#define pi acos(-1)
#define sz(x) (int) x.size()
#define pii pair<int, int>
#define mii map<int, int>
#define vi vector<int>
#define vs vector<string>
#define vb vector<bool>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define popb pop_back
#define all(v) v.begi... | ALGO | 0.999946 | 3.47832 | {
"github_metadata": {
"branch": "master",
"commit_count": 749,
"repo_created_at": "2015-01-22T15:10:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a6d3f5c5... |
723a14fc-e6d1-409c-b79e-64a3083223df | troberson/exercises-euler | CXX/include/euler/euler009.hpp | /*
* Project Euler - 009 - Special Pythagorean triplet
* <NAME> <<EMAIL>>
* Copyright (c) 2019 <NAME>
*
* A Pythagorean triplet is a set of three natural numbers, a < b < c,
* for which,
*
* a^2 + b^2 = c^2
*
* For example,
*
* 3^2 + 4^2 = 9 + 16 = 25 = 5^2.
*
* There exists exactly one Pythagor... | ALGO | 0.999094 | 5.191497 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2018-10-26T11:21:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71534f7c8... |
c88b66ce-5ecf-4325-a469-85b190c26a31 | RickyLiu0w0/myLeetCodeCode | cpp/304_二维区域和检索-矩阵不可变.cpp | /*
* @lc app=leetcode.cn id=304 lang=cpp
*
* [304] 二维区域和检索 - 矩阵不可变
*/
#include "AllInclude.h"
// @lc code=start
/**
* Accepted 2023-10-11
* 22/22 (444 ms)
* Your runtime beats 24.57 % of cpp submissions
* Your memory usage beats 18.19 % of cpp submissions (139.6 MB)
*/
// 二维版本的前缀和
/*
//* 放一下一维的代码
cla... | ALGO | 0.999879 | 6.958199 | {
"github_metadata": {
"branch": "main",
"commit_count": 141,
"repo_created_at": "2022-06-30T02:06: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": "f002d71f69... |
95e83e7f-e94e-4b78-818b-0f5e73456bad | juanmanzanero/fastest-lap | src/core/applications/minimum_curvature_path.h | #ifndef MINIMUM_CURVATURE_PATH_H
#define MINIMUM_CURVATURE_PATH_H
#include "src/core/vehicles/track_by_arcs.h"
#include "src/core/vehicles/circuit_geometry.h"
#include "lion/thirdparty/include/cppad/cppad.hpp"
#include "src/core/foundation/fastest_lap_exception.h"
class Minimum_curvature_path
{
public:
struct O... | ALGO | 0.999386 | 6.390094 | {
"github_metadata": {
"branch": "main",
"commit_count": 204,
"repo_created_at": "2021-11-26T13:49:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 599,
"forks": 51,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "f592df8... |
dbc2112f-cfe2-441b-a8a7-5fcfa72e3b1d | HKLeeeee/BUT_C-programming | practice1/practice1/Main.cpp | #include <iostream>
#include <cmath>
//#include "Array.cpp"
//#include "Matrix.cpp"
using namespace std;
#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
class Matrix {
int row, col;
double** matx;
public:
Matrix(int r, int c) {
this->row = r;
this->col = c;
... | ALGO | 0.978684 | 3.616836 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-09-28T07:18: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": "f6d1909ac828... |
700922fc-4f3a-45cd-861f-d3f09661887b | ankitapuri/LeetCode-Solutions | Recursion and Backtracking/36. Valid Sudoku.cpp | class Solution {
public:
bool solveSudoku(vector<vector<char>> &board, int row, int col) {
// If the position is now at the end of the 9*9 grid
if(row == 8 and col == 9) return true;
// if column has reached upper bound
if(col==9) {
row++;
col=0;
}
... | ALGO | 0.998927 | 6.57988 | {
"github_metadata": {
"branch": "main",
"commit_count": 75,
"repo_created_at": "2021-09-19T04:37:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "01ff89ea2b... |
5b4acd3e-4714-4e85-98d0-447c9ce219a1 | Alexinfotech/molinari | lista-rand-arrei/main.cpp | #include <iostream>
#include <ctime>
#include "stack.h"
using namespace std;
int main()
{
int* v;
lista testaPari = NULL;
lista testaDispari = NULL;
lista tempPari = NULL;
lista tempDispari = NULL;
int numero, condizione;
int contaPari = 0;
int contaDispari = 0;
srand(time(NULL));... | ALGO | 0.9951 | 4.402726 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-06-20T18:35: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": "00add0a76ab... |
aaebf2fd-75b2-4148-8efa-20ea54002dc9 | djkovrik/EckelCpp | Volume 2/3. Strings/ex16.cpp | /*
Write a program that accepts two command-line arguments
(a filename and a number) and scrambles each word in the
file by randomly switching two of its letters the number
of times specified in the second argument. (That is, if 0
is passed into your program from the command-line, the
words should not be scrambled; if ... | ALGO | 0.970429 | 5.563367 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-07-01T15:39:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 95,
"forks": 36,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f1d7d42b... |
e1a4b174-4ab1-423a-a4d0-1a527a6071bd | ketsueki33/LeetCode | 48RotateImage.cpp | #include <bits/stdc++.h>
using namespace std;
#define turbo \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
// https://leetcode.com/problems/rotate-image/
// https://www.youtube.com/watch?v=Z0R2u6gd3GU
class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
... | ALGO | 0.999966 | 6.25765 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2023-09-07T21:32:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52b063f9b... |
b3fad0ae-f067-4003-af70-3fc5ca8690c9 | saketbyte/CP-DCS | Sheet and more/Dynamic Programming and Recursion/01memoizationKnapsack.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
int fun(int W, int wt[], int val[], int n,
vector<vector<int>> &A)
{
// Your code here
if(n==0 || wt==0)
{
return 0;
}
... | ALGO | 0.999997 | 5.322704 | {
"github_metadata": {
"branch": "master",
"commit_count": 1288,
"repo_created_at": "2021-01-24T07:18: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": "c24cf85... |
c69c171a-b163-4283-9434-e0efd2cb103d | dl8sd11/online-judge | 0contest/CF_1121/pC.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
typedef pair<double,double> pdd;
#define MEM(a, b) memset(a, (b), sizeof(a))
#define SZ(i) ll(i.size())
#define FOR(i, j, k, in) for (ll i=j ; i<k ; i+=in)
#define RFOR(i, j, k, in) for (ll i=j ; i>=k ; i-=in)
#define REP(i, j... | ALGO | 0.999963 | 3.721559 | {
"github_metadata": {
"branch": "master",
"commit_count": 332,
"repo_created_at": "2017-11-19T05:47:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12f22b7e... |
731194d6-3e83-4d1a-adce-b6e1457bcc80 | Cegax123/Competitive-Programming | contest/Contest by Topic/Easy Graph Theory/h.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(), (c).end()
#define rall(A) A.rbegin(),A.rend()
#define pb push_back
#define dbg(x) do {cerr << #x <<" = " << (x) << endl; } while (false)
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
//cout << s... | ALGO | 0.999824 | 4.116354 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-09-15T13:50: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": "4fd09e107af... |
85f6895e-2023-4487-8d75-90e1242b3331 | AmiteshSingh45/Decode-DSA-with-CPP | Queue/Circular_Q_from_Array.cpp | #include<iostream>
#include<vector>
using namespace std;
class CircularQueue{
public:
int f;
int b;
vector<int> arr;
CircularQueue(int size){
f=-1;
b=-1;
vector<int> v(size);
arr=v;
}
void push(int val){
if(f==-1 && b==-1){
f=b=0;
... | ALGO | 0.996602 | 4.36664 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-21T14:23:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9449e329ae1f... |
ce529137-e1f8-4997-9a2b-3ce711be5725 | cristian-albu/cpp | pbinfo-exercises/003-arrays/binary-search/cautare-binara/main.cpp | #include <iostream>
using namespace std;
int i, n, m, val;
int binary_search(int start, int end, int arr[], int target) {
if (end >= start) {
int mid = start + (end - start) / 2;
if (target == arr[mid])
return 1;
if (target > arr[mid])
return binary_search(mid + 1, ... | ALGO | 0.999988 | 4.688236 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2024-01-15T08:37: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": "202a17748e2... |
cfa0d569-a2e5-4ea7-ae4c-0ab13b4949d3 | cupeedrl/CODE | DSA PTIT/CODE PTIT/Sort/DSA06004_HOP_VA_GIAO_CUA_2_DAY_SO.cpp | #include<bits/stdc++.h>
using namespace std;
int n,m,a[100005],b[100005];
// condition: sorted array
void arrange()
{ //inter: intersection, uni: unnion;
int inter[min(m,n)], uni[m+n];
int j = 0,i = 0, x = 0 ,y = 0;
while(i<n && j < m)
{
if(a[i] == b[j])
{
inter[x++] =... | ALGO | 0.999991 | 3.46968 | {
"github_metadata": {
"branch": "main",
"commit_count": 144,
"repo_created_at": "2025-03-04T10:30:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52e78db0f3... |
3b8b5b86-46d5-4211-96c1-245296cd985d | tianmn2109/leetcode | code_c++/57/other_people_solution.cc | // 1
class Solution {
public:
std::vector<Interval> insert(std::vector<Interval> &intervals, Interval newInterval) {
auto partial_order =[](const Interval & a, const Interval & b){
return a.end < b.start;
};
auto less = std::lower_bound(intervals.begin(), intervals.end(), newInterval, partial_orde... | ALGO | 0.999971 | 5.911429 | {
"github_metadata": {
"branch": "master",
"commit_count": 403,
"repo_created_at": "2015-01-08T01:55:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a93afc5c... |
75746a81-59fc-4dd4-bfc4-4ae4dad524bc | saurabhsuman47/temp | range maximum query-segment tree.cpp | #include <bits/stdc++.h>
using namespace std;
struct seg{
int val;
int ind;
};
int A[10]={1,20,37,48,5,69,7,81,9,0};
int M[4000];
void initialize(int node, int b, int e){
if (b == e){
M[node] = A[b];
}
else{
initialize(2 * node, b, (b + e) / 2);
initialize(2 * node + 1, (b + e) / 2 + 1, e);
if (M[2... | ALGO | 0.999838 | 3.304163 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-10-07T06:41: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": "9ab7628de1... |
c97d0fc0-ffdd-414f-8fc1-5aa98bbf91c1 | anubroto37/CFandSTLs | 158A_NextRoundDone.cpp | // "Contestant who earns a score equal to or greater than the k-th place finisher's score will advance to the next round, as long as the contestant earns a positive score..." — an excerpt from contest rules.
// A total of n participants took part in the contest (n ≥ k), and you already know their scores. Calculate how... | ALGO | 0.999972 | 4.266673 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-01-31T19:52: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": "665ea7a0dbab... |
d9372ce5-95fb-4005-8ebd-50f7060a0c1f | binhho2607/codeforces | icpc-regionals-2016/robot.cpp | #define imax INT_MAX
#define imin INT_MIN
#define sz(x) (int((x).size()))
#define ll long long
#define pb push_back
#define mk make_pair
#define pii pair<int, int>
#define a first
#define b second
#define vi vector<int>
#define over(x) (x).begin(), (x).end()
#define umap unordered_map
#define uset unordered_set
#define... | ALGO | 0.999937 | 3.948633 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2023-01-17T22:54:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5a1793365... |
c7736387-4407-4f3f-9c93-d17d66f16d86 | UrosVuj/Connect-four-decision-tree-generator | Minimax_Game_Tree.cpp | #include <iostream>
#include <cmath>
#include <stdlib.h>
#include <time.h>
using namespace std;
class Tree {
struct node {
//array that holds minimax values for its children
int arr[5]{ -2,-2,-2,-2,-2 };
int who_plays;
int result;
int table[5][5];
node* father;
node** children;
/*
Node Constr... | ALGO | 0.99938 | 3.981441 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-10-11T17:52:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "77b5a9c5e0... |
b00775be-b675-4cde-94ad-c9693eb0d5dc | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1244/Standings2/28922428_62472386.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define ll long long int
#define let(x, a) __typeof(a) x(a)
#define all(a) (a).begin(), (a).end()
#define present(c, x) ((c).find(x) != (c).end())
#define tr(v, it) for (let(it, v.begin()); it != v.end(); it++)
#define rtr(v, it) for (let(it, v.rbegin()); it != v.rend(); it++... | ALGO | 0.999959 | 3.720817 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-11-22T14:40: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": "536d1676f... |
a0db68a8-1cfa-4b77-94b3-062f0f4b77b2 | nguyentuss/Competitive-Programming | CP/OnlineJudge/CSES/1654.cpp | //#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma,popcnt")
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define int long long
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vect... | ALGO | 0.999528 | 3.463049 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-01-20T04:18: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": "1e42a164b2d9... |
5177985e-94f3-4124-9049-82546df1c154 | switchpiggy/Competitive_Programming | CodeForces/Contests/CF Edu Round 102/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define benqueue queue
#define pbenqueue priority_queue
ll t, n, m, pref[200007][2];
string s;
struct segTreeMax {
vector<ll> v;
ll size;
void init(ll x) {
v.clear();
size = 1;
while(size <= x) size *= 2;
... | ALGO | 0.999841 | 4.101232 | {
"github_metadata": {
"branch": "master",
"commit_count": 164,
"repo_created_at": "2020-08-27T23:38:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2355ea57... |
c743bcae-875d-4154-b729-2b85af29a041 | ReichmanIvan/ProgrammingLanguages | 1.1.cpp | #include <cmath>
#include <iostream>
using namespace std;
/**
* \brief Функция расчета по заданной формуле.
* \param x Первый параметр функции.
* \param y Второй параметр функции.
* \param z Третий параметр функции.
* \return Значение функции.
*/
const double getA (const double x, const double y, const double z... | ALGO | 0.993593 | 4.52589 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2022-09-15T12:41:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 8,
"pull_requests": 5
},
"file_meta": {
"content_id": "05ec4f748... |
76a2f7ce-f4b4-4a19-ba4e-fdf17b910c3d | A-A7med-i/Funny-Projects | Hangman Game/Hangman.cpp | #include <iostream>
#include <random>
using namespace std;
int main()
{
string fruits[] = {
"apple", "apricot", "avocado", "banana", "blackberry", "blueberry", "cherry",
"coconut", "cranberry", "dragonfruit", "durian", "fig", "grape", "grapefruit",
"guava", "jackfruit", "kiwi", "kumquat",... | TOOL | 0.977675 | 3.947262 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-03-22T15:27: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": "30bdf0681119... |
4f3c307a-5ef5-4935-a8c7-1df53fa1f6e2 | vinod-jacob/Leet-code | 43.MultiplyStrings/mult.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
string multiply(string num1, string num2)
{
if(num1 == "0" || num2 == "0")
return "0";
vector<char> n1, n2;
for(auto it = num1.begin(); it != num1.end(); it++)
{
n1.push_ba... | ALGO | 0.99997 | 5.529117 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2020-03-01T18:33: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": "e2368fca... |
ccd56526-4636-4844-ba39-670e11c2e727 | IVANSINDOYAN/QT_Tasks | l1files/task5.cpp | #include<iostream>
int max(int *arr, size_t size){
int max = arr[0];
for(int i = 1; i < size; ++i){
if(arr[i] > max){
max = arr[i];
}
}
return max;
}
int min(int *arr, size_t size){
int min = arr[0];
for(int i = 1; i < size; ++i){
if(arr[i] < min){
min... | TOOL | 0.984178 | 3.281988 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-02-29T16:47:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8eb91e37fbeb... |
31063ad8-6087-4253-8899-81278ff02df4 | davidflam/OpenMoCap | OpenMoCap/Vendor/stlsoft/stlsoft/algorithms/bounded.hpp | /* /////////////////////////////////////////////////////////////////////////
* File: stlsoft/algorithms/bounded.hpp
*
* Purpose: Bounded algorithms.
*
* Created: 23rd October 2004
* Updated: 10th August 2009
*
* Home: http://stlsoft.org/
*
* Copyright (c) 2004-2009, <NAME> and Synesi... | ALGO | 0.987594 | 7.29379 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2014-08-02T16:35:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 83,
"forks": 35,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "1754852... |
36bee2dc-2efd-4f09-ae43-9bd9a575bdad | rinkeyrahman/university-course-projects | Algorithms/kruskal_Algo.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int mst[10],adj[10][10],vno,eno,d,cost[10][10],color[10];
enum color{WHITE,GREY,BLACK};
int *heap;
int size=0;
void min_push(int data)
{
int parent,curr,temp;
size++;
heap[size]=data;
parent=size/2;
curr=size;
while(heap[parent]>heap[curr])
... | ALGO | 0.999988 | 3.73733 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-11-24T16:37:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40c409dc51... |
de635cda-39dc-4d0f-a551-f6842d986f9d | EtienneHouze/Langton | ant.hpp | #ifndef ANT_HPP
#define ANT_HPP
#include <vector>
#include <iostream>
#include <cmath>
/**
* @brief Describes the Langton Ant
*
*/
class Ant{
private:
std::pair<int,int> currentPos;
short direction;
public:
/**
* @brief Initialize at (0,0), facing up.
*
*/
Ant(){
currentP... | ALGO | 0.980363 | 4.512146 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-12-14T18:07:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae53e13825... |
bdfbc000-7355-4621-bb6e-1d6947e865cb | HH-LFY/HH | CPP/AC自动机模版.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
struct node
{
node *fail;
node *next[26];
int count;
node( )
{
fail = NULL;
count = 0;
memset(next,NULL,sizeof(next));
}
}*q[500001];
char keyw[55];
char str[1000000+10];
int head,tail;
int n,... | ALGO | 0.99997 | 3.629243 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-08-08T02:29:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7620b7dcd8... |
bccb781b-3344-4b31-8aac-703a388578be | samueldong-us/Graphics-Software-Renderer | SoftwareRenderer/Renderer.h | #pragma once
#include <vector>
#include "Vector.h"
#include "Shader.h"
#include "Math.h"
namespace Library
{
class Renderer
{
private:
int width, height;
unsigned char* colorBuffer;
float* depthBuffer;
template<typename VertexOut> void LoadEdge(VertexOut& start, VertexOut& end, float* startInterpolants, f... | TOOL | 0.966731 | 5.578669 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2017-02-16T06:55: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": "fb6a6d6d53... |
ddbc61ee-7ace-4ddc-a1f2-768423c81049 | AlexLee1999/Leetcode-Practice | algorithm/C++/0269-Alien_Dictionary.cpp | class Solution {
public:
string alienOrder(vector<string>& words) {
unordered_map<char, int> indegree;
unordered_map<char, vector<char>> edge;
for (int i=0; i<words.size(); ++i) {
for (int j=0; j<words[i].size(); ++j) {
indegree[words[i][j]] = 0;
e... | ALGO | 0.999999 | 5.880825 | {
"github_metadata": {
"branch": "main",
"commit_count": 147,
"repo_created_at": "2021-01-21T02:44:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "abd581202f... |
99658d33-8944-4135-9918-ad1eb562d47d | bachev93/coursera_cpp | coursera_cpp/red_belt/week4/server_stats/stats.cpp | #include <iostream>
#include <vector>
#include "stats.h"
Stats::Stats() : methodStats_(), uriStats_() {
for (const auto& key : methods_) {
methodStats_[key] = 0;
}
for (const auto& key : uris_) {
uriStats_[key] = 0;
}
}
void Stats::AddMethod(string_view method) {
if (!methodStats_.count(method)) {... | TOOL | 0.954533 | 5.66489 | {
"github_metadata": {
"branch": "master",
"commit_count": 119,
"repo_created_at": "2019-12-31T16:27:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc4692dc... |
b25ebfd2-a017-4a72-9cd8-ea98e9957a92 | chilltycho/LeetCode | BackTracking/2/60getPermutation.cpp | /*n=3,[1,2,3]
所有排列情况:[[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
k=3,返回[2,1,3]*/
#include <iostream>
#include <vector>
using namespace std;
bool *used;
int *factorial;
vector<int> path;
// index为树深度
void dfs(int index, int n, int k) {
if (index == n)
// 刚好n个数时,即为答案
return;
// 当前层可减去的叶子
int cnt = fa... | ALGO | 0.999991 | 5.216022 | {
"github_metadata": {
"branch": "master",
"commit_count": 250,
"repo_created_at": "2020-07-25T13:45: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": "e7eb2c2a... |
8ea83f47-d8fb-460b-9a10-c573f7d4d9d7 | AlexWei061/cpp | practice/2021SummerVacation/August2021/20210827/dijkstra.cpp | #include<bits/stdc++.h>
using namespace std;
#define INFI 0x3f3f3f3f
#define MAXN 10010
#define MAXM MAXN * (MAXN - 1)
int n = 0/*点数*/, m = 0/*边数*/;
int tot = 0;
int first[MAXN] = { 0 };
int nxt[MAXM] = { 0 };
int to[MAXM] = { 0 };
int value[MAXM] = { 0 };
void add(int x, int y, int v){
nxt[++tot] = first[x];... | ALGO | 0.99998 | 3.670072 | {
"github_metadata": {
"branch": "master",
"commit_count": 499,
"repo_created_at": "2019-10-21T06:10:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d2815e3... |
82bc6eda-c367-4053-b074-4454dc90380b | Priyanshu150/DSA-problems | Dynamic Programming/DP on array/Solving Questions With Brainpower/memoization_approach.cpp | #include<bits/stdc++.h>
using namespace std;
// Time complexity :- O(n) // Where n is size of array
// Space complexity :- O(n+n) // n is space for dp arrays and stack space
// Approach :-
// we've to try all possibilities to get max score, we can use recursion for the same
// ind wil... | ALGO | 0.999856 | 5.274194 | {
"github_metadata": {
"branch": "main",
"commit_count": 485,
"repo_created_at": "2024-12-11T16:32:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5461056ad1... |
110f54a5-f329-4b9c-9da8-34e189dbed03 | DanDoge/course_pku | Practice of Data Structure and Algorithm/practice/003-001c.cpp | #include <iostream>
using namespace std;
int n, q;
long long a[100010];
struct node{
int l, r;
long long sum;
long long delta;
}seg_tree[100010 << 2];
void push_up(int pos){
seg_tree[pos].sum = seg_tree[pos * 2].sum + seg_tree[pos * 2 + 1].sum;
return ;
}
void push_down(int pos){
seg_tree[pos... | ALGO | 0.9994 | 5.10511 | {
"github_metadata": {
"branch": "master",
"commit_count": 169,
"repo_created_at": "2018-01-03T16:20:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f09ec51... |
de19f88b-a2d5-4324-a85a-1db8b9b09931 | AntelopeIO/bn256 | src/optate.h | #include "constants.h"
#include <tuple>
#include "twist.h"
#include "gfp6.h"
#include "gfp12.h"
namespace bn256 {
constexpr auto line_function_add(const twist_point& r, const twist_point& p, const curve_point& q, const gfp2& r2) noexcept {
// See the mixed addition algorithm from "Faster Computation of the
// T... | ALGO | 0.999651 | 6.865334 | {
"github_metadata": {
"branch": "main",
"commit_count": 161,
"repo_created_at": "2022-08-17T19:06:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba87f481651... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.