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 |
|---|---|---|---|---|---|---|---|
62c53823-ff8c-46c3-91c4-4a658dd89957 | JosephJostar0/pat | 甲级cpp/1139 First Contact.cpp | #include <algorithm>
#include <iostream>
#include <string>
#include <unordered_map>
#include <vector>
int N, M, K;
std::unordered_map<int, std::vector<int>> table;
std::unordered_map<int, std::unordered_map<int, int>> G;
std::vector<std::pair<int, int>> temp;
std::unordered_map<int, int> gender;
int main() {
int u,... | ALGO | 0.999911 | 4.003115 | {
"github_metadata": {
"branch": "main",
"commit_count": 208,
"repo_created_at": "2022-01-17T08:40:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "325bb84614... |
52360acb-abc3-4c27-9f5b-a27b660df5ad | Michalos88/Randomized_SVD_in_CUDA | utils/math_util_gpu.cpp | #include "gpuErrorCheck.h"
#include "rsvd.h"
using namespace std;
void genLowRankMatrixGPU(cublasHandle_t &cublasH, double *d_A,
const uint64_t M, const uint64_t N,
const uint64_t K, const uint64_t ldA){
curandGenerator_t randGen;
CHECK_CURAND( curan... | ALGO | 0.998602 | 5.278551 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2019-04-11T19:40:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f2d6fa7... |
06c953a9-a72d-4dae-8c02-c9738b58594f | farukshin/e-olymp | 1000-1999/1746/1746.cpp | // https://www.e-olymp.com/ru/problems/1746
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
int n, m;
char v[505][505];
bool reserve[505][505];
int dist[505][505];
pair<int, int> start, finish;
int runX[4] = {0, 1, 0, -1};
int runY[4] = {1, 0, -1, 0};
bool isArea(int a, ... | ALGO | 0.999816 | 4.394172 | {
"github_metadata": {
"branch": "master",
"commit_count": 293,
"repo_created_at": "2020-05-09T06:07:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1c9c70d... |
6919971c-4429-4a77-9be9-f107346ec3b1 | or-tools/data | roadef_challenge_2011/solution_checker/solution_checker_run.cc | // Copyright 2010-2021 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... | TEST | 0.920625 | 6.382883 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-06-01T08:49:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1abcea9d30bc4... |
cbd68002-47bc-4f86-bd1f-31c4d4520ce1 | CFOP2357/competitive_programing | codeforces/Codeforces Round #604 (Div. 2)/D.cpp | //#include <bits/stdc++.h>
#include <iostream>
#include <climits>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <assert.h>
//#include <time.h>
using namespace std;
/*
#include <ext... | ALGO | 0.99997 | 3.177697 | {
"github_metadata": {
"branch": "master",
"commit_count": 325,
"repo_created_at": "2020-06-28T20:56:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c51dd19... |
edf0e32f-02e8-4cc7-bb41-87d503b8f46d | ttnhathuy313/cp-career | Codeforces/Contest474/TaskE.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair <int, int> ii;
const int oo = 1e9 + 7;
struct SegmentTree {
int n;
vector <ii> st;
SegmentTree() {}
SegmentTree(int _n) {
this -> n = _n;
st.assign(4 * n + 5, {-oo, 0});
}
int Left(int x) {return (x << 1);}
int Right(int x) {... | ALGO | 0.99999 | 3.503124 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2023-09-11T04:12: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": "b05cf2652e... |
957badd7-ebfe-4ce9-9b8e-de15d3f888cb | Nozidoali/exact-xyz | include/qgate.hpp | #pragma once
#include "qstate.hpp"
#include <array>
#include <cmath>
#include <complex>
#include <cstdint>
#include <iostream>
#include <memory>
#include <vector>
namespace xyz {
using namespace std::complex_literals;
namespace constants {
constexpr double sqrt2 = 1.4142135623730951;
constexpr double sqrt2_inv =... | ALGO | 0.94603 | 4.375959 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2024-06-14T14:12: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": "26e1b070d... |
c928e065-96b7-42de-b4f4-bf6cb0943bd5 | bkorayoz/Prefix-to-Postfix-converter-and-calculator | main.cpp | /* @Author
Student Name: <NAME>
Student ID: 150130281
Date: 24.12.2016
*/
#include "structs.h"
using namespace std;
queue answers;
operations islem;
MODE mode;
int main(int argc, char* argv[]) {
system("color 0A");
if (argv[1] == NULL) {
mode = CONSOLE;
}
else {
mode = BATCH;
char temp[30];
strcpy(tem... | TOOL | 0.991052 | 3.634658 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-02-05T19:58:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b95a82a75d... |
0177937b-b8d1-481d-aad8-1722aaaa2b5c | raincross7/code-similarity | codes/train_code/problem263/problem263_53.cpp | #include <bits/stdc++.h>
// #include <atcoder/all>
#define ll long long int
#define ld long double
#define yorn(f) cout<<((f)?"Yes":"No")<<endl;
#define YORN(f) cout<<((f)?"YES":"NO")<<endl;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, n) for (ll i = 1; i < (ll)(n); i++)
#define all(x) (x).begin()... | ALGO | 0.999903 | 4.306 | {
"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": "482572c4663f... |
b53203d8-3208-4b78-98ce-c70f160e6392 | anmamun0/cp-problem-solving-zone | Week_8/Week8_Practive/Day_2/C_T_primes.cpp | #include <bits/stdc++.h>
typedef long long ll;
#define vl vector<ll>
#define vi vector<int>
#define in_range(i,s,n) for(int i=s; i<=n; i++)
#define in_range(i,s,n) for(int i=s; i<=n; i++)
#define in_range_back(i,s,n) for(int i=n ; i >= s; i--)
#define take_array(v,n) in_range(i,0,n) cin>>v[i]
#define print_array(v) f... | ALGO | 0.999804 | 4.702604 | {
"github_metadata": {
"branch": "main",
"commit_count": 194,
"repo_created_at": "2024-03-16T09:32:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4336fac4b... |
9ccc383a-b82f-4e1a-9b7e-77a3079c882f | XUN-XIE/IC-ACSE | ACSE5/ACSE5-CW/Interface.cpp | #include <iostream>
#include <ctime>
#include <fstream>
#include "Matrix.cpp"
#include "Solver.cpp"
#include "CSRMatrix.cpp"
#include "Interface.h"
using namespace std;
double test_data_1[100] = { 76, 2, -31, 5, -4, -4, 73, 9, -15, -25, 2, 84, -6,
36, 23, 10, 14, 33, -26, -34, -31, -6, 52, -5, -... | ALGO | 0.957629 | 3.922506 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-11-03T04:45:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 27,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8de8084... |
b6d7e3ed-2a7b-4fca-b6fc-16330754ddd0 | Aniket0304/tushar | intersectionArray.cpp | #include<iostream>
using namespace std;
void findDuplicate(int arr[],int brr[], int n){
bool a=false;
for(int i=0; i<n;i++){
for(int j= 0; j<n;j++){
if(arr[i]==brr[j]){
int count = arr[i];
cout<<count<<' ';
a=true ;
}
... | ALGO | 0.999559 | 5.415349 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-01-19T15:24: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": "02bdf641fd58... |
281d7975-606b-467f-9018-f05cb36911a7 | sxz1113/algorithms | DataStructure/480.SlidingWindowMedian.cpp | #include "../Common.h"
class Solution {
public:
vector<double> medianSlidingWindow(vector<int>& nums, int k) {
vector<double> res;
// 选用能够自动排序的容器multiset, 初始化喂nums的前k个数
multiset<int> s{nums.begin(), nums.begin() + k};
auto iter = s.begin();
for (int i = 0; i < k / 2; ++i)
... | ALGO | 0.99999 | 6.203405 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-08-03T02:42:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "355715364b5... |
64faab29-d2ca-4152-acfe-4ccc3261fae1 | abhinav-os/SDE-450 | Graph/4_cycle_detection_in_directed_graph.cpp | /*
Time Complexity: O(V+E)
Space Complexity: O(V+E) + O(V)
*/
#include <bits/stdc++.h>
using namespace std;
/**
* cycle_bfs usues logic of Kahn's algorithm for topological sorting, by storing indegree
*/
bool cycle_bfs(vector<vector<int> > adj) {
int n = adj.size();
vector<int> indegree(n, 0);
... | ALGO | 0.999991 | 5.695116 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2021-06-05T17:35: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": "9b48e71546... |
6d98921c-4881-45cf-9e24-b8b795fd6b6d | ProfFL028/TwilightStruggle | Interview/Codeforces/array/MarinAndPhotoshop.cpp | // https://codeforces.com/contest/1658/problem/A
#include <bits/stdc++.h>
using namespace std;
//gcc optimization
#pragma GCC optimize("Ofast")
#pragma GCC optimize "trapv"
#define fast(); ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;
typedef unsigned long long ull;
typedef l... | ALGO | 0.999628 | 4.329191 | {
"github_metadata": {
"branch": "main",
"commit_count": 857,
"repo_created_at": "2021-06-15T03:02:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71152dd7ce... |
7fb0e2e0-da04-459b-b86c-3509440d3fbf | amanzi/amanzi | src/pks/mpc_pk/TransportMatrixFractureImplicit_PK.hh | /*
Copyright 2010-202x held jointly by participating institutions.
Amanzi is released under the three-clause BSD License.
The terms of use and "as is" disclaimer for this license are
provided in the top-level COPYRIGHT file.
Authors: <NAME>
*/
/*
MPC PK
Process kernel that couples transport in matrix a... | ALGO | 0.978524 | 6.250651 | {
"github_metadata": {
"branch": "master",
"commit_count": 14660,
"repo_created_at": "2016-07-22T18:50:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 50,
"forks": 38,
"issues": 103,
"pull_requests": 5
},
"file_meta": {
"content_id": "531... |
f84f627b-ccde-4598-bcbd-66f6d10691eb | suthesanvj/data-structure | day 1 (25-08-2023)/merging of list.cpp | #include <stdio.h>
#include <stdlib.h>
struct Node {
int data;
struct Node* next;
};
struct Node* createNode(int data) {
struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
newNode->data = data;
newNode->next = NULL;
return newNode;
}
struct Node* mergeLists(struct Node* list1, ... | ALGO | 0.999776 | 4.746178 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-08-25T03:27: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": "0ef59f6da4b... |
f72c099a-dbb9-4502-b2f6-73a4e4d7ea6c | scp-fs2open/PCS2 | src/BSPDataStructs.cpp | //****************************************************************************
// BSPDataStructs.cpp
// Author: <NAME>
// Code for member functions;
//****************************************************************************
/*
* $Logfile: /BSPDataStructs.cpp $
* $Revision: 1.7 $
* $Date: 2008/09/17 19:34:00 $
... | TOOL | 0.927331 | 3.760099 | {
"github_metadata": {
"branch": "master",
"commit_count": 258,
"repo_created_at": "2015-10-16T08:21:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 11,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "63c4d86f... |
e4cc90b2-8743-4679-aea5-2684046b7c5c | nihuiping08/ACM | 搜索/二分/hoj 2278 IP Filtering.cpp | /*
题目:
给出n段IP地址,然后给出一个IP地址,问你这个IP地址在不在这些IP地址段里
分析:
a.b.c.d,可以先把所有的数字转为a*2^24+b*2^16+c*2^8+d,然后存入到结构体中,
对一个起始的IP地址进行排序,然后二分查找询问的IP地址是否在这些IP段
*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int X = 1000005;
char s[20];
int n;
struct node
{
... | ALGO | 0.999421 | 3.879002 | {
"github_metadata": {
"branch": "master",
"commit_count": 109,
"repo_created_at": "2013-11-30T15:45:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11eae3fc... |
9b205c3c-236a-4bbc-9dab-62e0fc161764 | wyukai/coding | array/mergeSort.cpp | //
// Created by wangkai on 2019/9/2.
//
/*
* 归并排序:
* 归并是指将若干个已排序的子文件合并成一个有序的文件。
* 常见的有两路归并排序,多路归并排序 Strand排序。
*
* 两路归并排序
* 最差时间复杂度:O(nlogn)
* 平均时间复杂度:O(nlogn)
* 最差空间复杂度:O(n)
* 稳定排序
*/
/*
* 思路:
* 分治:
* 1. 分解 : 将当前区间一分为二,求分裂点
* 2. 求解 : 递归地对两个子区间L[low,mid]和R[mid+1,high]进行归并排序
* 3. 组合 : 将已排序的两个子区间归并为一个有... | ALGO | 0.999996 | 5.366446 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2019-08-11T07:40:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d093c5e61... |
6a27fdb8-21b3-4a4c-990e-67a31d622305 | WaizungTaam/Data-Structure-and-Algorithm | include/tree/avl_tree.h | /*
* Copyright 2016 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in... | ALGO | 0.97726 | 6.639024 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-09-23T11:58:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "445a92d9cf... |
849a23b0-28e7-458d-ba93-d2ba8ab67810 | movetk/movetk | src/include/movetk/metric/DistanceTraits.h | /*
* Copyright (C) 2018-2020 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... | ALGO | 0.943257 | 6.920983 | {
"github_metadata": {
"branch": "master",
"commit_count": 383,
"repo_created_at": "2020-09-09T14:43:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 74,
"forks": 15,
"issues": 28,
"pull_requests": 5
},
"file_meta": {
"content_id": "fede12... |
52a726d3-f89f-49ec-b342-c2b430bbfefc | vikhalv/devilution | Source/encrypt.cpp | //HEADER_GOES_HERE
#include "../types.h"
int encrypt_table[1280];
void __fastcall encrypt_decrypt_block(void *block, int size, int key) // DecryptMPQBlock
{
unsigned int v3; // edx
int v4; // eax
unsigned int v5; // edi
unsigned int v6; // edx
int v7; // eax
int v8; // esi
v3 = (unsigned int)size >> 2;
v4 =... | ALGO | 0.995069 | 4.04646 | {
"github_metadata": {
"branch": "master",
"commit_count": 126,
"repo_created_at": "2018-06-20T18:19: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": "7260aa7e... |
359d3fbf-8d03-4232-b621-2fa24a0e4f33 | KhangBen/CS-Review | Pointers/pointerToArray.cpp | #include <iostream>
using namespace std;
void example1() {
int arr[5] = { 1, 2, 3, 4, 5 };
int *ptr = arr;
// printing first element of an array using array name
// and dereferencing operator
cout << "*arr = " << *arr << endl;
cout << "arr = " << arr << endl;
cout << "*ptr = " << *ptr << endl;
cout <... | ALGO | 0.91986 | 4.535658 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2025-05-21T00:48:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "578b821b3d2... |
20425489-cc00-4257-9fe5-85cffc7f3a09 | pdrsa/maratona | codeforces/638/c.cpp | #include <bits/stdc++.h>
using namespace std;
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define f first
#define s second
#define pb push_back
typedef long long ll;
typedef pair<int, int> ii;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;
int main(){ _
int t; cin >> t;... | ALGO | 0.999988 | 3.953337 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2020-05-06T13:38:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9db88b1ab... |
96ee7742-9621-4e3c-882a-c601473a731e | ammardab3an/AleppoCPC | level_2/subjects/complete search/dynamic programming/during session codes/cc_1.cpp |
// By AmmarDab3an - Aleppo University
#include "bits/stdc++.h"
using namespace std;
//#define int int64_t
//#define lli int64_t
typedef unsigned int uint;
typedef long long int lli;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<lli, lli> pll;
typedef pair<int, pii... | ALGO | 0.999959 | 3.90855 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2021-02-26T22: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": "914cf18af38... |
9089b8fd-6d54-4241-9265-bc2f6e40baee | cms-sw/cmssw | RecoLocalMuon/GEMSegment/plugins/ME0SegmentAlgorithm.h | #ifndef GEMRecHit_ME0SegmentAlgorithm_h
#define GEMRecHit_ME0SegmentAlgorithm_h
/**
* \class ME0SegmentAlgorithm
*
* This algorithm is very basic no attemp to deal with ambiguities , noise etc.
* The ME0 track segments is built out of the rechit's in a the 6 ME0 Layer denoted
* as the ME0 Ensabmle .<BR>
*
* \a... | ALGO | 0.97185 | 5.946846 | {
"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... |
5f3bb92b-b08a-4e01-909d-9fc90b7ddefd | deepanshu210306/Binary-search-Tree | Deletion.cpp | #include <iostream>
using namespace std;
class Node {
public:
int data;
Node* left;
Node* right;
Node(int val) {
data = val;
left = right = NULL;
}
};
// Insert a new node in BST
Node* insert(Node* root, int val) {
if (root == NULL) {
return new Node(val);
}
i... | ALGO | 0.999986 | 6.122084 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-07-11T07:41: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": "238e93202647... |
7ae1e0ab-b599-4b64-ae59-1f6e927f038a | Shanboy5566/myleetcode | 208.implement-trie-prefix-tree.cpp | /*
* @lc app=leetcode id=208 lang=cpp
*
* [208] Implement Trie (Prefix Tree)
*/
// @lc code=start
class Trie {
public:
/** Initialize your data structure here. */
Trie(): root(make_unique<TrieNode>()) {}
// Trie(): root(new TrieNode()) {}
// Trie() {
// root = new TrieNode();
// }
... | ALGO | 0.997732 | 6.707229 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2020-04-07T06:55: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": "59d3a2768... |
e92136cc-7508-44a8-b1e2-a682c1e252bc | Rohit-8/Leetcode | 2499-minimum-total-cost-to-make-arrays-unequal/2499-minimum-total-cost-to-make-arrays-unequal.cpp | class Solution {
public:
pair<int, int> majorityElement(vector<int> &ar, int size){
int ele, count = 0;
for(int i = 0; i < size; i++){
if(count == 0)
ele = ar[i];
if(ele == ar[i]){
count++;
}
else
count--... | ALGO | 0.999981 | 5.097284 | {
"github_metadata": {
"branch": "main",
"commit_count": 2195,
"repo_created_at": "2022-06-26T18:05:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "27e8683e4... |
7f58cc01-b3a2-4718-b62a-5b37b822a677 | tetraloba/competitiveProgramming | AtCoder/ABC/3XX/320/ABC320_D.cpp | // 2024/03/17 20:21:53
// 2024/03/17 20:50:25 10WA overflow
// 2024/03/17 20:55:44 10WA 違ったかも
// 2024/03/17 21:16:16 AC.
#include <iostream>
#include <vector>
#include <set>
#include <stack>
#define POS_MAX INT64_MAX
using namespace std;
int main(){
int N, M;
cin >> N >> M;
vector<set<pair<int, pair<int, in... | ALGO | 0.999957 | 4.794468 | {
"github_metadata": {
"branch": "main",
"commit_count": 364,
"repo_created_at": "2023-06-01T11:09: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": "c4bc8c3718... |
78e33eab-a0cf-4e9c-a1ae-a9bb58a44e97 | OsamaFahim/CompetitiveProgramming | 1200-1500/Scoring_Subsequences.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
void fastIO();
template<class T> void inp(T [],ll);
template<class T> void print(T [],ll);
#define mod 998244353
#define nl '\n'
#define pb push_back
#define inf LLONG_MAX
#define ninf LLONG_M... | ALGO | 0.999526 | 4.214436 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2023-11-11T20:22: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": "41a58d78b19... |
109da330-2752-40b5-82e7-e3a417a6e740 | saurabhsaini400/Data-Structures | 1354-construct-target-array-with-multiple-sums/1354-construct-target-array-with-multiple-sums.cpp | class Solution {
public:
bool isPossible(vector<int>& target) {
if(target.size() == 1) return target[0] == 1;
using LL = long long;
int n = target.size();
LL sum = accumulate(target.begin(), target.end(), 0LL);
auto q = priority_queue(less<int>(), move(target)); // O(n) time
... | ALGO | 0.999904 | 5.300199 | {
"github_metadata": {
"branch": "main",
"commit_count": 561,
"repo_created_at": "2022-01-08T15:45:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "05155f4e65... |
06bda868-b38c-475b-a868-ac06036f22e7 | ariloc/complejidad-jueces-jujuy-2025 | code/selection_sort_main.cpp | #include <random>
#include <iostream>
#include <vector>
using namespace std;
void sort(vector<int> &arr, int n) {
for (int i = 0; i < n; i++)
for (int j = i+1; j < n; j++)
if (arr[j] < arr[i])
swap(arr[i],arr[j]); // Intercambia los números
}
int main(int argc, char *argv[]) {... | ALGO | 0.999245 | 4.892365 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2025-06-01T05:35: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": "cbd2507e01... |
9b67e787-90e5-4e4d-8cb2-26b91d5d111c | coolyuyuyu/leetcode | algorithm_3000-3999/3048-Earliest Second to Mark Indices I/main.cpp | class Solution {
public:
int earliestSecondToMarkIndices(vector<int>& nums, vector<int>& changeIndices) {
int n = nums.size(), m = changeIndices.size();
nums.insert(nums.begin(), -1);
changeIndices.insert(changeIndices.begin(), -1);
std::function<bool(int)> checkOk = [&](int t) {
... | ALGO | 0.999966 | 5.663764 | {
"github_metadata": {
"branch": "master",
"commit_count": 4422,
"repo_created_at": "2017-03-26T16:52: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": "1eae702... |
25146aa0-e6aa-4e35-a343-d4de55355775 | defUserName-404/Online-Judge | LeetCode/557_ReverseWordsInAString.hpp | #include <iostream>
class Solution
{
void reverseStringInPosition(int i, int &left, int &right, bool printSpace,
std::string &reverse, const std::string &s);
public:
std::string reverseWords(std::string s);
};
void Solution::reverseStringInPosition(int i, int &left, int &ri... | ALGO | 0.99996 | 5.984193 | {
"github_metadata": {
"branch": "master",
"commit_count": 773,
"repo_created_at": "2021-03-14T12:15: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": "4e54517e... |
74c37821-494c-4dc5-9e99-f1629e931b61 | java9494/AvalosJoel_CSC_5_Winter_2018 | Hmwk/Assignment_4/Gaddis_8thEd_Chap5_Prob5_MembershipFees/main.cpp | /*
* File: main.cpp
* Author: <NAME>
* Created on January 20, 2018, 2:58 PM
* Purpose: Create a program that displays a projected rate increase for a
* country club for the next six years.
*/
//System Libraries
#include <iostream>
using namespace std;
//User Libraries
//Global Constants - Math/Physics Con... | ALGO | 0.945888 | 3.657533 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2018-01-11T20:53: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": "bc77551d2... |
fcecb756-2dd3-471b-bfcf-505dfbdf34bd | lukembalmer/CPP-Junior-Year-Assignments | balmer_ch7_program1.cpp | /**************************************************/
/* Assignment #1- Largest/Smallest Array Values */
/* <NAME> */
/* Computer Engineering Technology 3 */
/* Period #3 */
/* Due: 2/12/21 */
/******... | ALGO | 0.999869 | 4.37914 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-02-27T07:07: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": "dcdcad6b664b... |
6ac057ff-59e3-4445-b377-cd0f5f435ac7 | Gilpop8663/Altudy | BOJ/2659_십자카드문제/Gilpop8663.cpp | #include <bits/stdc++.h>
using namespace std;
int arr[5];
string ans;
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0);
vector<int> tmpp;
for (int i = 0; i < 4; i++)
{
cin >> arr[i];
}
tmpp.push_back(arr[0] * 1000 + arr[1] * 100 + arr[2] * 10 + arr[3]);
tmpp.push_back(ar... | ALGO | 0.999729 | 4.24614 | {
"github_metadata": {
"branch": "master",
"commit_count": 1719,
"repo_created_at": "2022-03-01T10:54:28.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "zerochae/Altudy",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_i... |
b0ff9233-6219-437d-8de7-40a4bb2d546f | lballabio/QuantLib | ql/experimental/barrieroption/perturbativebarrieroptionengine.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2008 <NAME>
Copyright (C) 2008 <NAME>
Copyright (C) 2008 <NAME>
Copyright (C) 2008 StatPro Italia srl
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and develo... | ALGO | 0.999963 | 7.356904 | {
"github_metadata": {
"branch": "master",
"commit_count": 17543,
"repo_created_at": "2015-12-17T16:29:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6151,
"forks": 1964,
"issues": 51,
"pull_requests": 11
},
"file_meta": {
"content_id":... |
ff95be44-12e0-4371-83e6-aded03134246 | samuel-feibel/RobotsNRoses | 12_4_shit/code_10_25.ino | #include <Servo.h>
#define LOG_OUT 1 // use the log output function
#define FFT_N 256 // set to 256 point fft
#include <FFT.h> // include the library
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
#include "printf.h"
//servos
Servo left;
Servo right;
//IR hat detector constants
bool hat_detected = false;
//m... | ALGO | 0.977393 | 4.00718 | {
"github_metadata": {
"branch": "master",
"commit_count": 373,
"repo_created_at": "2018-09-07T15:19:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "aa026512... |
cec0a9cb-e830-4084-a39d-643cad15465b | wizebin/ulti | ULTI_Collision.cpp | #include "ULTI_Collision.h"
namespace ulti{
bool collide (sprite* o1, sprite* o2){
/*int px=o1->getpos().x;
int py=o1->getpos().y;
int sx=o1->getsize().x;
int sy=o1->getsize().y;
int px1=o2->getpos().x;
int py1=o2->getpos().y;
int sx1=o2->getsize().x;
int sy1=o2->getsize().y;
ret... | ALGO | 0.965645 | 3.983318 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-06-21T23:01: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": "718af0d354... |
05e2a149-5392-4954-b1ed-568bf21f6679 | Gautam-2002/best-DSA-problems | Clone a linked list with next and random pointer.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
/* Link list Node */
struct Node
{
int data;
Node *next;
Node *arb;
Node(int x)
{
data = x;
next = NULL;
arb = NULL;
}
};
// } Driver Code Ends
class Solution
{
private:
void insertAtTail(Node *&h... | ALGO | 0.999672 | 5.41643 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2022-09-12T14:54: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": "34c7cd0bdda... |
f64f1829-6a50-411f-b40b-5ac4f2ac01fc | leefell/Estrutura-de-Dados | Estrutura de Dados I/Lista de Exercícios/Lista de Exercícios - Revisão/Lista 1 - Ex 2 - 04 08 2023 - Expressão Com Atributo/cExpressao.cpp | #include "cExpressao.h"
#include <iostream>
#include <cmath>
using namespace std;
cExpressao::cExpressao() {
}
cExpressao::cExpressao(const cExpressao& orig) {
}
cExpressao::~cExpressao() {
}
void cExpressao::lerNumeros(){
cout << "Digite o valor de A: " << endl;
cin >> this -> a;
cout << "Digite ... | TOOL | 0.993345 | 3.109031 | {
"github_metadata": {
"branch": "main",
"commit_count": 149,
"repo_created_at": "2023-07-28T14:30: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": "2969e6d491... |
08da0e9e-9d91-488b-a5af-2334572095b1 | vfolunin/archives-solutions | UVa Online Judge/10912.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
int rec(int count, int sum, int from) {
if (count < 0 || count >= 27 || sum < 0 || sum >= 1000 || from >= 27)
return 0;
static vector<vector<vector<int>>> memo(27, vector<vec... | ALGO | 0.994839 | 3.570269 | {
"github_metadata": {
"branch": "master",
"commit_count": 2367,
"repo_created_at": "2017-11-27T10:19:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 5
},
"file_meta": {
"content_id": "6cabdca... |
d3d8b887-946c-402f-97f4-863a75060e29 | IljaSir/CopilotSolverForLeetCode | C++/Medium/CompileError/prime-subtraction-operation_9.cpp | class Solution {
public:
bool primeSubOperation(vector<int>& nums) {
bool ret = false;
for (int i = 0; i < nums.size(); ++i) {
if (isPrime(nums[i])) {
nums[i] -= 1;
ret = true;
}
}
return ret;
}
bool isPrime(int... | ALGO | 0.999981 | 5.601436 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-07-28T08:23: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": "43f99741268c... |
0c9e2325-7943-4983-b6e6-2c572044302a | mirthfulLee/AlgorithmExecise | LeetCode/数据结构/set/2657. 找到两个数组的前缀公共数组.cpp | // 2657. 找到两个数组的前缀公共数组
#include <iostream>
#include <set>
#include <vector>
using namespace std;
template <typename T>
inline bool contains(set<T>& s, T v) {
return s.find(v) != s.end();
}
vector<int> findThePrefixCommonArray(vector<int>& A, vector<int>& B) {
set<int> cura, curb;
int n = A.size(), cnt = 0;
vec... | ALGO | 0.999926 | 5.403493 | {
"github_metadata": {
"branch": "master",
"commit_count": 112,
"repo_created_at": "2021-08-28T13:05: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": "cfebc5c7... |
9547b48c-886f-41df-83f1-290c21b81b87 | milithome/Counter2D-2025c1-grupo9 | common/utilities/config.cpp | #include "config.h"
ServerConfig load_server_config(const std::string& filename) {
YAML::Node root = YAML::LoadFile(filename);
YAML::Node server = root["server"];
ServerConfig config;
config.port = root["server"]["port"].as<std::string>();
config.tick_rate = server["tick_rate"].as<int>();
... | CONFIG | 0.905 | 6.123185 | {
"github_metadata": {
"branch": "main",
"commit_count": 544,
"repo_created_at": "2025-05-10T03:45:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8a0fb77b4... |
2536123a-0c66-43fa-bb4e-fe641e0ebebd | DrLubos/DataStructuresSP | SortingManager.h | #include <libds/adt/sorts.h>
#include <libds/heap_monitor.h>
auto comparePrefix = [](const RoutingTableRow* first, const RoutingTableRow* second) {
if (first->ipAddress.to_ulong() < second->ipAddress.to_ulong()) {
return true;
}
if (first->ipAddress.to_ulong() == second->ipAddress.to_ulong()) {
... | ALGO | 0.986278 | 5.592349 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2024-03-09T10:42: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": "8b646e780be... |
18e99cf3-9dfc-46ee-87d8-cca032895608 | akshit-a9/University | 2024 EVEN SEM/Computer Networks Lab/exp4c- Kruskal's Algorithm/main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;
#define INFINITY 9999999
#define NUM_VERTICES 6
int graph[NUM_VERTICES][NUM_VERTICES] = {
{0, 7, 9, INFINITY, INFINITY, 14},
{7, 0, 10, 15, INFINITY, INFINITY},
{9, 10, 0, 11, INFINITY, 2},
{INFINITY, 15... | ALGO | 0.999964 | 5.205152 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2024-02-11T06:09: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": "4b0d67f987d... |
66ec60d6-8529-4fe2-8906-9a5b0f3eee52 | luhtalam/Algoritmit-ongelmanratkaisussa | Viikko10_metrot/Viikko10_metrot/main.cpp | #include <iostream>
#include <vector>
using namespace std;
int f[100001];
vector<int> r[100001];
int k[100001];
int ans[100001];
vector<int> sykli;
int haku(int s) {
k[s] = 1;
int c = 1;
int l, M = 0;
for(auto u: r[s]) {
if(k[u]) continue;
l = haku(u);
if(l > M) swap(l,M);
... | ALGO | 0.99984 | 3.561143 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-12-28T12:10:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34cfb55c6f... |
1dea365a-7d4d-44f6-af68-187321aa56bc | iamslash/learntocode | leetcode/DesignExcelSumFormula/a.cpp | /* Copyright (C) 2019 by iamslash */
#include <cstdio>
#include <vector>
#include <map>
#include <string>
// 4ms 96.77% 10MB 72.55%
class Excel {
private:
std::vector<std::vector<int>> m_M;
std::map<std::pair<int, char>, std::vector<std::string>> m_smp;
public:
Excel(int H, char W) {
m_M = std::vector<std... | ALGO | 0.937807 | 4.763891 | {
"github_metadata": {
"branch": "master",
"commit_count": 2102,
"repo_created_at": "2020-11-23T21:43:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf4f84b... |
9f7dd816-3095-499d-b407-8689ce78e075 | facebookresearch/faiss | c_api/utils/distances_c.cpp | /*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// -*- c++ -*-
#include "distances_c.h"
#include <faiss/utils/distances.h>
#include <cstdio>
void faiss_pairwise_L2sqr(
... | CONFIG | 0.994268 | 6.842757 | {
"github_metadata": {
"branch": "main",
"commit_count": 1500,
"repo_created_at": "2017-02-07T16:07:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 36174,
"forks": 3965,
"issues": 228,
"pull_requests": 47
},
"file_meta": {
"content_id": "... |
f01bb98d-b253-4bff-a9c3-7eac320fb38c | dekaaa115/2311102148_Muhammad-Deka-Maulana | Pertemuan08 - Algoritma Searching/Unguided/unguided3.cpp | /*
<NAME> - 2311102148
*/
#include <iostream>
using namespace std;
int main() {
cout << "\n\t=-=-= Searching Data Angka 4 Deka =-=-=" << endl;
int data_148[] = {9, 4, 1, 4, 7, 10, 5, 4, 12, 4}; // Array data
int cari_148 = 4; // Angka yang dicari
int jumlahAngka_148 = 0; // Jumlah angka 4 dalam data
... | ALGO | 0.99983 | 5.463921 | {
"github_metadata": {
"branch": "main",
"commit_count": 116,
"repo_created_at": "2024-03-06T08:02:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7bdc9ec8a0... |
c79a826f-8159-4186-b802-8a15bd558775 | jungh150/PS | baekjoon/9935.cpp | #include <iostream>
#include <stack>
#include <algorithm>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
string s, bomb;
cin >> s >> bomb;
stack<char> stk;
int n = bomb.size();
for (char c: s) {
if (c == bomb[n - 1]) {
for... | ALGO | 0.999977 | 4.262756 | {
"github_metadata": {
"branch": "main",
"commit_count": 526,
"repo_created_at": "2023-08-28T16:01: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": "1a8c25d7c7... |
afa328fa-4b5c-4269-b5b7-e058bfca2534 | tushar-kamra/Data-Structures-and-Algorithms | cpp/tree/binary tree/deletion.cpp | #include<iostream>
#include<queue>
using namespace std ;
struct Node {
int data ;
Node* left ;
Node* right ;
};
Node* createNode(int x){
Node* temp = new Node() ;
temp->data = x ;
temp->left = NULL ;
temp->right = NULL ;
return temp ;
}
Node* insertNode(Node* root, int x){
if(root... | ALGO | 0.999915 | 4.711149 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-06-08T08:37:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f87db32853... |
b1adf668-5915-4e7f-b21f-9ccf364c47d0 | gjf7/cs106l | read.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <sstream>
int main() {
std::cout << "What's name of the file containing the graph to visualize?" << std::endl;
while (true) {
std::string filename;
getline(std::cin, filename);
std::ifstream file(filename);
if (!file.is_open()) {
... | TOOL | 0.961328 | 4.108565 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-07-11T03:59:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e3658756fe91... |
4576b942-fe80-473f-8653-66c1114743c2 | LauraCuellarCa/CP2_Session17_19 | src/STLexercises19.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <sstream>
#include <map>
#include <set>
#include <numeric> //std::accumulate
#include <algorithm> //std::sort, std::copy, std::transform, std::count
//milestone 1
std::vector<char> readBook(std::string pg2701){
std::ifstream file(p... | ALGO | 0.998454 | 4.40868 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-11-03T11:22: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": "f8d09812a29e... |
83f8e4d7-98e3-405d-bf9f-a439bd7be25f | richardtr123/Colas-y-ventanillas | Colaporventanilla.cpp | #include <iostream>
#include <conio.h>
#include <stdlib.h>
#include <stdio.h>
#include <windows.h>
void tituloPrincipal()
{
int i;
cout<<"===============================================================================\n";
cout<<" Simulacion de Cola por ventanilla "<<endl;
... | ALGO | 0.996603 | 3.483831 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-06-07T18:01: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": "3ca429daff... |
28d8123d-5ab8-469d-9b7e-02e8a057b654 | Shreyashpatil056/Codeforces | DAY35/D_Corrupted_Array.cpp | //this code belongs to <NAME>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
//this code belongs to <NAME>
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int>... | ALGO | 0.999663 | 4.673176 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-12-31T05:52: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": "2da4868b6b... |
206e3bbe-98c8-4bf2-9bed-2484178b4961 | joaander/hoomd-blue | hoomd/md/ForceCompositeGPU.cc | // Copyright (c) 2009-2021 The Regents of the University of Michigan
// This file is part of the HOOMD-blue project, released under the BSD 3-Clause License.
// Maintainer: jglaser
#include "ForceCompositeGPU.h"
#include "hoomd/VectorMath.h"
#include "ForceCompositeGPU.cuh"
namespace py = pybind11;
/*! \file Force... | ALGO | 0.976234 | 6.797866 | {
"github_metadata": {
"branch": "master",
"commit_count": 17444,
"repo_created_at": "2016-03-07T01:34:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 19,
"forks": 14,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "d85f... |
20624b75-04c8-4c92-8a95-a9202a8fc749 | mssj2008/cp_owuh | owuh temp study/study 69.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
int n,m,t;
cin >> n >> m >> t;
vector<int> p(n);
for(int i = 0; i < n; i++) cin >> p[i];
auto r = p.end();
auto l = p.begin();
int tot = 0;
while(m)
{
// get next creature from both l & r, proceed with the better ... | ALGO | 0.999948 | 3.896835 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2024-12-01T17:38: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": "fd8922d5b20... |
ba4f135d-9e4c-451d-979c-d6132084d9c3 | google/google-ctf | 2018/finals/crypto-ble/arduino/challenge/ecc.ino | /*
Copyright 2018 Google LLC
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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... | TOOL | 0.99852 | 5.536679 | {
"github_metadata": {
"branch": "main",
"commit_count": 400,
"repo_created_at": "2018-04-27T15:56:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4752,
"forks": 575,
"issues": 0,
"pull_requests": 18
},
"file_meta": {
"content_id": "9e969... |
a09dccd9-dc82-41d7-81e1-a5e92e75f9f6 | SwapnanilHalder/CodingFiles | CSES/1639_edit_distance.cpp | #include <bits/stdc++.h>
#define SPEED1 ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL)
#define int long long int
#define For(i, a, b) for(int i=a; i<b; i++)
#define endl '\n'
#define pl(x) cout << x << "\n"
#define deb(x) cout << '\t' << #x << "= " << x << endl
#define vi vector<int>
#define vi2d vector<v... | ALGO | 0.999974 | 4.186115 | {
"github_metadata": {
"branch": "master",
"commit_count": 185,
"repo_created_at": "2020-06-12T18:02:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 30
},
"file_meta": {
"content_id": "78b6a4e... |
c51c2a2e-90b2-4358-b7de-f3a7b8516260 | switchpiggy/Competitive_Programming | CodeForces/1400-1600/pipes.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll q, n, out[200007];
bool curved[200007];
string s, t;
int main() {
cin >> q;
while(q--) {
cin >> n >> s >> t;
memset(out, 0, sizeof(out));
for(ll i = 1; i <= n; ++i) {
if(s[i - 1] == '1' || s[i - 1] ... | ALGO | 0.999981 | 4.594443 | {
"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": "66a350cf... |
743b451e-d392-4d7e-9b36-50fd63d804c1 | micmacIGN/micmac | BenchElise/bench/b_0_35.cpp | /*eLiSe06/05/99
Copyright (C) 1999 <NAME>
eLiSe : Elements of a Linux Image Software Environment
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 yo... | ALGO | 0.998292 | 5.363099 | {
"github_metadata": {
"branch": "master",
"commit_count": 10879,
"repo_created_at": "2016-11-24T22:09:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 785,
"forks": 163,
"issues": 83,
"pull_requests": 30
},
"file_meta": {
"content_id": "7... |
f513ec8f-a87e-46d7-a4a6-1dd7810960b5 | 2praisehim/Portfolio | matgo_game/Server/Server/MatgoGame.cpp | #include "Matgo.h"
#include "server.h"
extern int User1;
extern int User2;
extern Player player1;
extern Player player2;
extern Pae Cpae;
int Totalpae[50]; //모든 패
int Point = 0; //뒤집어진 패의 위치
void Start_Game()
{
int overlap;
srand((unsigned)time(NULL));
for (int i = 0; i < 50; i++) {
while (1) {
T... | TOOL | 0.930712 | 3.139471 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2021-07-16T18:14:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0b2d6944c9... |
cc5b3fef-8069-443f-8ade-eef41f28c9f1 | triffon/ip-2021-22 | practicum/6/week3/solutions/3.cpp | #include<iostream>
int main() {
int numberOfDigits = 0;
std::cin >> numberOfDigits;
int digit = 0;
int result = 0;
for (int i = 0; i < numberOfDigits; i++) {
int powerOfTen = 1;
for (int j = i; j < numberOfDigits - 1; j++) {
powerOfTen = powerOfTen * 10;
}
std::cin >> digit;
result = result + digit ... | ALGO | 0.999239 | 4.980445 | {
"github_metadata": {
"branch": "master",
"commit_count": 455,
"repo_created_at": "2021-10-03T21:01:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23bca09... |
71d9af8a-8df4-477d-9b9c-f2ebafeadee0 | R-Grigala/TSU_discrete | Discrete_Lab/Lab_9.cpp | #include <iostream>
#include <string>
using namespace std;
void decimalToBinary(int n) {
string binary = "";
while (n > 0) {
binary = to_string(n % 2) + binary;
n /= 2;
}
cout << "Binary: " << binary << endl;
}
void decimalToHexadecimal(int n) {
string hexadecimal = "";
while (... | ALGO | 0.963201 | 5.575381 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2021-12-29T10:29:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1736eee9a... |
18a7b501-dcca-4e6d-bc28-4dde101f10c0 | tuogy/usaco-solutions | contact.cc | /*
USER: guobich1
TASK: contact
LANG: C++
*/
#ifndef __clang__
#include <bits/stdc++.h>
#endif
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
char buf[200000];
int main() {
ifstream fin("contact.in");
ofstream fout("contact.out");
int A, B, N;... | ALGO | 0.999946 | 3.078396 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2020-08-03T10:46: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": "00fe65d4d... |
30758e16-2ae4-403c-a521-e86900964a75 | madhurpurohit/cpp-dsa-essentials | 16_Insertion-Sort.cpp | #include <iostream>
using namespace std;
void InsertionSort(int arr[], int n)
{
// for (int i = 1; i < n; i++)
// {
// for (int j = i; j > 0; j--)
// {
// if (arr[j] < arr[j - 1])
// swap(arr[j], arr[j - 1]);
// else
// break;
// }... | ALGO | 0.999922 | 5.370589 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2024-09-04T12:13: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": "21c62792646... |
2560b14d-4240-4621-97bf-bfe202fbf3d7 | qiaozishun4/CSP2024_BJ | BJ-Senior/answers/BJ-S01588/duel/duel.cpp | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cmath>
using namespace std;
int n,r[100010],ans,rmax=0;
bool flag=true;
bool vis[100010];
int t[100010]={};
int eat[100010]={};
vector<int>v;
bool cmp(int x,int y){
return x<y;
}
bool check(int x){
for(int i=x+1;i<=n;i++){
... | ALGO | 0.999957 | 3.316272 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2024-11-01T16:05:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad8d9acfbe... |
11020791-b1cd-46bf-b7ca-d9989c04e3ee | cshue1/cisc1600 | lab6.cpp |
//<NAME> - March 9, 2016
//Lab 6
#include<iostream>
#include<iomanip>
#include<cmath>
const int COUNT_TOTAL = 10000;
double random (unsigned int& seed);
double fraction (double f1, double f2, double f3);
using namespace std;
int main()
{
unsigned int seed;
double x,y,z,f1,f2,f3,t,min_t,min_x,min_y,min_z;
... | ALGO | 0.99937 | 3.650185 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-10-18T04:41:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd57445917... |
c8f89730-91cf-4d64-943b-a2aa37114623 | blasbarbagelata/modelo-y-simulacion | TP2/atomics/continuous/pintegrator_sci.cpp | #include "pintegrator_sci.h"
void pintegrator_sci::init(double t,...) {
//The 'parameters' variable contains the parameters transferred from the editor.
va_list parameters;
va_start(parameters,t);
//To get a parameter: %Name% = va_arg(parameters,%Type%)
//where:
// %Name% is the parameter name
// %Type% is th... | ALGO | 0.992509 | 4.653594 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2025-04-03T18:54: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": "bcf8ecec63e... |
54ac384b-6888-478c-a19b-b9fb35d70247 | ishandutta2007/codeforces-h | heno239/normal/1270/F.cpp | #include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#in... | ALGO | 0.999925 | 3.476598 | {
"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": "26f78cffd33e... |
275528da-66da-4797-9732-8396cc4d300e | UCI-CARL/CARLsim4 | tools/eo_pti/include/pti_eoEasyEA.h | // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
//-----------------------------------------------------------------------------
// eoEasyEA.h
// (c) GeNeura Team, 1998
/*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU L... | ALGO | 0.998234 | 6.611837 | {
"github_metadata": {
"branch": "master",
"commit_count": 1840,
"repo_created_at": "2016-02-18T00:19:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 85,
"forks": 86,
"issues": 22,
"pull_requests": 4
},
"file_meta": {
"content_id": "5082b... |
59e48503-7953-448d-ac49-88cf51a66309 | google/earthenterprise | earth_enterprise/src/common/khCalcHelper.h | /*
* Copyright 2017 Google Inc.
* Copyright 2020 The Open GEE Contributors
*
* 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
*
* U... | TOOL | 0.924341 | 7.194438 | {
"github_metadata": {
"branch": "master",
"commit_count": 1779,
"repo_created_at": "2017-03-20T21:40:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2699,
"forks": 891,
"issues": 252,
"pull_requests": 0
},
"file_meta": {
"content_id": "9... |
cc79c03d-3b39-42a8-9d9a-fe3993b23f7c | ankur-357/GFG-solution | Easy/Number and the Digit Sum/number-and-the-digit-sum.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int sumOfDigits(int num) {
int sum = 0;
while (num > 0) {
sum += num % 10;
num /= 10;
}
return sum;
}
int countNumbers(int N, int K)... | ALGO | 0.999907 | 5.967761 | {
"github_metadata": {
"branch": "main",
"commit_count": 579,
"repo_created_at": "2023-07-17T04:13: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": "c4e3a6a655... |
338b6273-0fc6-47df-9e82-7c995fa4b8f4 | micheeeeell/AtCoder | ABC/ABC066/D.cpp | #include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<fstream>
using namespace std;
#define rep(i,x) for(int i = 0; i < (int)(x); i++)
#define pb push_back
#define mp make_pair
#define debug(x) cerr << #x << ": " << (x) << "\n";
#define ... | ALGO | 0.999896 | 3.600053 | {
"github_metadata": {
"branch": "master",
"commit_count": 237,
"repo_created_at": "2019-06-21T04:33: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": "3e27a01b... |
75f2b684-c633-426c-ad13-43c1bbcd3703 | sontanon/OllinBrill | src/ah_mask.cpp | #include "tools.h"
#include "param.h"
#include "arrays.h"
#include "ah_param.h"
double linear_interpolator(const int k1, const double k, const double *f)
{
return f[k1] + (f[k1 + 1] - f[k1]) * (k - k1);
}
double cubic_interpolator(const int k1, const double k, const double *f, const double *df, const double dx)
{
... | ALGO | 0.985678 | 3.604285 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-04-10T19:13:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe47203492... |
12dbc861-20b4-4d5a-bf04-9c88901e9bc3 | ishaanjav/USACO-Solutions | Silver 2014 Open/fairphoto.cpp | #include <iostream>
#include <fstream>
using namespace std;
#define ll long long
#define pb push_back
#define ins insert
#define mp make_pair
#define pii pair<int, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>
#define pib pair<int, bool>
#define SET(a,c) memset(a,c,sizeof(a))
#define MOD 1000000007
#define E... | ALGO | 0.99991 | 3.336844 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2020-11-22T17:38:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b57e4a2fd87... |
2ecae770-944b-4022-8b66-d45d6425b566 | Tickin/SinbaramAlgorithm | 2015_winter/Week 02/NUMBERGAME/coconot01.cpp | #include <iostream>
using namespace std;
int board[50];
int cache[50][50];
int n, left, right;
int max(int x, int y)
{
if (x < y)return y;
else return x;
}
int numberGame(int left, int right)
{
int ret = cache[left][right];
if (ret != -2000000000) return ret;
if (left > right) return 0;
ret = max(board[left] ... | ALGO | 0.999932 | 3.901667 | {
"github_metadata": {
"branch": "master",
"commit_count": 140,
"repo_created_at": "2015-10-30T09:27:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12f9831... |
4e5710be-f311-42e4-a101-a74a4bae94be | AnshSingh0443/C- | CD LAB/cd.cpp | #include <iostream>
#include <string>
#include <cctype>
using namespace std;
bool is_terminal(char symbol) {
return islower(symbol) && isalpha(symbol);
}
bool is_non_terminal(char symbol) {
return isupper(symbol) && isalpha(symbol);
}
bool is_valid_type_3(const string& input) {
for (char symbol : input)... | ALGO | 0.998941 | 4.351606 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2024-08-13T09:16: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": "9a662235383... |
b4f2688a-b329-48c2-8cfd-1b967907c4af | sploadie/piscine_cpp | d07/ex00/whatever.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: ... | TOOL | 0.925727 | 4.899804 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-01-15T17:04: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": "9c2331125b... |
4628cbdb-35db-4880-8044-33a08314c25a | profeIMA/Exercicis-Programacio | ExercicisT7/T7-EX8_2-unioVectors.cpp | #include<iostream>
using namespace std;
const unsigned N_MAX = 100;
typedef int Vector_enter[N_MAX];
void unio_vectors(const Vector_enter vec1, const Vector_enter vec2, unsigned n1, unsigned n2, Vector_enter vec_unio, unsigned &n) {
//Pre: 0<=n1+n2<=N_MAX i vec1[0..n1-1] i vec2[0..n2-1] sense repetits i ordenats
//... | ALGO | 0.999892 | 4.037698 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2018-07-23T09:59: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": "9706beb82... |
d1ab2910-c5cf-4a53-bfe5-5cb17457b77c | lokesh234/Algorithms | HW3/palindromecheck.cpp | #include "palindromecheck.h"
using namespace std;
string cleanString (string str1){
str1.erase(remove(str1.begin(), str1.end(), ' '), str1.end());
transform(str1.begin(), str1.end(), str1.begin(), ::tolower);
str1.erase(remove_if(str1.begin(), str1.end(), ispunct), str1.end());
return str1;
}
bool p... | ALGO | 0.989574 | 3.953931 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-11-17T19: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": "fc019eae0d... |
8cfb1a51-a182-4e8a-b7aa-085a281be17a | manas2308/csa-1355 | exp16.cpp | #include <stdio.h>
#include <stdbool.h>
#include <string.h>
// Function prototypes
bool match_S(char *input);
bool match_A(char *input);
// Function to match the production rule S -> A00A
bool match_S(char *input) {
if (*input == '\0') {
return false; // Empty string not allowed for S -> A00A
}
/... | ALGO | 0.988812 | 5.17236 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-06-22T02:36:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c828a69a335d... |
c89c0cf3-1e81-46ca-9b64-c6353962410c | diamondIPP/DRS4-v5-shared | src/Measurement.cpp | /*
* Measurement.cpp
* Measuremnet class implementation
* $Id: Measurement.cpp 21273 2014-02-20 13:01:57Z ritt $
*/
#include "DRSOscInc.h"
Measurement::Measurement(DOFrame *frame, int index)
{
m_frame = frame;
m_index = index;
memset(m_param, 0, sizeof(m_param));
m_statIndex = 0;
m_nMeasured = 0;
... | TOOL | 0.923576 | 5.454224 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2015-04-21T08:15:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f93157903... |
9bdd2292-cca4-4049-98ce-421dccc11a29 | amanjain200/leetcode_daily | 1stApr2023.cpp | /*
704. Binary Search
Easy
8.7K
183
Companies
Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then return its index. Otherwise, return -1.
You must write an algorithm with O(log n) runtime complexity.
Example 1:... | ALGO | 0.999994 | 5.951965 | {
"github_metadata": {
"branch": "master",
"commit_count": 299,
"repo_created_at": "2023-01-01T04:10: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": "3d1a033f... |
6c438144-912f-4c5f-bd23-a4d4afa39f4b | opticSquid/optic-DSA | graph/DijkstrasAlgorithm.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
// Function to find the shortest distance of all the vertices
// from the source vertex S.
vector<int> dijkstra(int V, vector<vector<int>> adj[], int S)
{
// set will store in the format {dist,node}.
// storage format... | ALGO | 0.999928 | 5.332688 | {
"github_metadata": {
"branch": "main",
"commit_count": 298,
"repo_created_at": "2023-11-15T14:54: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": "ea9d5f2942... |
83d9d910-9c8b-4aef-ad94-ce696931fad5 | DamianArado/LeetCode-tracker | 1993-operations-on-tree/1993-operations-on-tree.cpp | class LockingTree {
public:
struct Node {
vector<Node*> ch;
int lock = -1;
};
vector<Node> tree;
vector<int> parent;
LockingTree(vector<int>& parent) : parent(parent) {
tree = vector<Node>(parent.size());
for (int i = 1; i < parent.size(); ++i)
t... | ALGO | 0.999387 | 5.553414 | {
"github_metadata": {
"branch": "master",
"commit_count": 4716,
"repo_created_at": "2021-10-28T18:31:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e2d74e... |
573dd7c7-8002-4456-8dae-74f837593ea3 | ruimao/UMAD | UMAD/UMAD/HeaderFiles/index/MVPIndex.h | #ifndef MVPINDEX_H
#define MVPINDEX_H
#include "../index/PartitionMethod.h"
#include "../index/PivotSelectionMethod.h"
#include <cstring>
#include <thread>
#include <mutex>
#include <memory>
#ifdef __GNUC__
#include <sys/timeb.h>
#include "/usr/include/sys/times.h"
#include <sys/wait.h>
#include <sys/types.h>... | ALGO | 0.978907 | 4.742793 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2015-11-02T23:59:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "057160986... |
ee10d1a1-6314-4f53-8fc1-3da9320e5351 | CrealityOfficial/crslice | impl/cura5.0/include/InsetOrderOptimizer.h | //Copyright (c) 2021 <NAME>.
//CuraEngine is released under the terms of the AGPLv3 or higher.
#ifndef INSET_ORDER_OPTIMIZER_H
#define INSET_ORDER_OPTIMIZER_H
#include <unordered_set>
#include "sliceDataStorage.h" //For SliceMeshStorage, which is used here at implementation in the header.
#include "settings/ZSeamCon... | ALGO | 0.964287 | 7.381882 | {
"github_metadata": {
"branch": "version-0.0.3",
"commit_count": 436,
"repo_created_at": "2023-08-25T12:00:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "20... |
fdcdfcf1-e636-4680-8c76-754be195312c | BambooTree/koneti | Tower_of_Hanoi.cpp | // C++ recursive function to
// solve tower of hanoi puzzle
/*
Take an example for 2 disks :
Let rod 1 = 'A', rod 2 = 'B', rod 3 = 'C'.
Step 1 : Shift first disk from 'A' to 'B'.
Step 2 : Shift second disk from 'A' to 'C'.
Step 3 : Shift first disk from 'B' to 'C'.
The pattern here is :
Shift 'n-1' disks from 'A'... | ALGO | 0.999986 | 6.012433 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-01-21T18:52:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ac80986c... |
ee3f57cb-5eec-4c0c-a3be-50bd7dd166d0 | HUMASoft/SimuladorNeck | lib/fcontrol/src/PIDBlock.cpp | #include "PIDBlock.h"
using namespace std;
long PIDBlock::Initial(double new_Ts)
{
Ts=new_Ts;
std::cout << "Ts : " <<Ts << std::endl;
iBlock = SystemBlock(
std::vector<double> {Ts/2,Ts/2},
std::vector<double> {-1,1});
// std::vector<double> {0,Ts*1},
// ... | ALGO | 0.936725 | 4.676116 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-05-04T15:36:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0f330d8a4c... |
c1c90b42-5b19-4a25-aa07-aa98b2e1cbc5 | ShivamAgarwal-code/May-Challenge_Angelhack | 08-05-2023/08-05-2023.cpp | #include <bits/stdc++.h>
using namespace std;
struct Runner {
string name;
int speed;
int runningTime;
int restingTime;
};
int calculateDistance(const Runner& runner, int totalTime) {
int distance = 0;
while (totalTime > 0) {
if (totalTime >= runner.runningTime) {
distance ... | ALGO | 0.999941 | 5.532596 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-05-05T11:50: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": "eb8d5142c44... |
28ab5d8c-9794-4099-a815-b2ce3999a532 | OpenPPL/ppl.kernel.cpu | src/ppl/kernel/arm_server/conv2d/neon/fp32/depthwise/conv2d_n4cx_depthwise_fp32.cpp | // Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... | ALGO | 0.952748 | 5.235466 | {
"github_metadata": {
"branch": "master",
"commit_count": 223,
"repo_created_at": "2022-12-21T06:59:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 17,
"forks": 12,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "ba08cef... |
12b47b3a-130e-4ac4-9c34-b0f58ec87f22 | Kejing-Xu/Traversal | src/imageTraversal/ImageTraversal.cpp | #include <cmath>
#include <iterator>
#include <iostream>
#include "cs225/HSLAPixel.h"
#include "cs225/PNG.h"
#include "../Point.h"
#include "ImageTraversal.h"
/**
* Calculates a metric for the difference between two pixels, used to
* calculate if a pixel is within a tolerance.
*
* @param p1 First pixel
* @param... | ALGO | 0.962931 | 4.817245 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-03-07T00:59:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "348bc6a8c5... |
b7503d74-45d1-49ca-a345-a4ccbb59c183 | Liu-YT/LeetCode | cpp/155.Min_Stack.cpp | class MinStack {
public:
/** initialize your data structure here. */
MinStack() {
minIndex = 0;
}
void push(int x) {
nums.push_back(x);
if(x < nums[minIndex]) {
minIndex = nums.size() - 1;
}
}
void pop() {
if(minIndex == nums.size() -... | ALGO | 0.999921 | 6.231275 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2019-06-05T14:27:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6bb56ccae... |
cf68416d-5451-4a68-9286-2a6725e9fd24 | ocaml-opam/ocaml-mccs | src/lp_solver.cpp | /*******************************************************/
/* CUDF solver: lp_solver.c */
/* Interface to the lp format solvers */
/* (c) <NAME> (UNSA-CNRS) 2009,2010,2011 */
/*******************************************************/
#include <cstdio>
#include <cstdlib>
#i... | TOOL | 0.998486 | 5.659945 | {
"github_metadata": {
"branch": "master",
"commit_count": 215,
"repo_created_at": "2017-07-13T10:09:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 23,
"forks": 13,
"issues": 6,
"pull_requests": 3
},
"file_meta": {
"content_id": "d075d5b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.