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 |
|---|---|---|---|---|---|---|---|
4bd7f304-097e-4334-95aa-87b3fecd3d56 | simran1901/Problem-Solving | 1697C-awoo-s-Favorite-Problem.cpp | // Codeforces
// Author: simranmakhijani55
// https://codeforces.com/contest/1697/problem/C
#include <bits/stdc++.h>
#define IOS \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define ll long long int
#define repn(i, m, n) for (ll i = m; i < n; i++)
#de... | ALGO | 0.999868 | 4.388289 | {
"github_metadata": {
"branch": "main",
"commit_count": 238,
"repo_created_at": "2022-03-30T10:17: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": "ee0323c8d2... |
d3c36834-647d-41ef-8f95-038339d8db2b | ephraim888sun/mst-analysis | prog2test.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include "MyGraph.h"
int main()
{
ifstream ifile("test2_1.txt");
int n, e;
vector<float> satcost;
ifile >> n >> e;
vector<Link> l, l2;
for (int i = 0; i < e; i++)
{
Link s;
ifile >> s.v1 >> s.v2 >> s.w;
l.push_back(s);
l2.push_back(s);
}
int m... | ALGO | 0.995621 | 3.999984 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-10-25T21:23: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": "a22d7ddbf1e7... |
a7f19e47-22dc-456c-a53d-8a22fd70b9f1 | dthai2424/NCKH2025 | Bit_Eclat/L0ngkute/DBV.cpp | #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <algorithm>
using namespace std;
int MIN_SUPPORT = 2; // Minimum support
// DBV - Dynamic Bit Vector
struct DBV
{
vector<bool> bits;
DBV(int size = 0) : bits(size, false) {}
void set(int tid)
{
if... | ALGO | 0.995223 | 5.971212 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2025-06-18T16:30: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": "610559f8c... |
44280a7b-0923-4188-864d-64cf9002ed17 | SoerenHoffstedt/raster-time-series | src/operators/cumulative_sum.cpp |
#include "operators/cumulative_sum.h"
#include "datatypes/raster_operations.h"
#include "util/raster_calculations.h"
using namespace rts;
template<class T1, class T2>
struct CumSumAdder {
static void rasterOperation(TypedRaster<T1> *sum_raster, TypedRaster<T2> *input_raster, Resolution tileResolution) {
... | ALGO | 0.995885 | 7.160637 | {
"github_metadata": {
"branch": "master",
"commit_count": 143,
"repo_created_at": "2018-09-12T11:55: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": "41a84541... |
03e37c30-d34f-4931-81d6-4e29aa623824 | megargayu/USACO-Solutions | contests/silver/2021/usopen/acowdemia/acowdemia.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAX_N 1e5
#define ll long long
int N, K, L;
vector<int> citations(MAX_N);
bool valid(int h)
{
ll need = 0;
int maxA = 0;
for (int i = 0; i < h; ++i)
if (citations[i] < h)
{
need += h - citations[i];
maxA = max(maxA, h - citations[i]);
... | ALGO | 0.999976 | 4.479247 | {
"github_metadata": {
"branch": "main",
"commit_count": 107,
"repo_created_at": "2022-04-14T06:22:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc6a2b1849... |
db6da65a-f71a-4614-9b24-44a25f4309c0 | chitranjali007/thodi_programming_ho_jaye | linklist/sortlinklist.cpp | /* SORTING A LINKED LIST IN ASCENDING ORDER */
/* LINKSORT.C */
#include <stdio.h>
#include<conio.h>
#include <malloc.h>
struct link
{
int data;
struct link *next;
};
int i;
int number ;
struct link *start, *node, *previous, *new1, *counter;
void doubly_link_sort()
{
printf("\n Input the number of node we nee... | ALGO | 0.999995 | 5.243926 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-12-23T15:32:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a188584b90... |
d9eac148-6225-4123-92e8-e8fd29a8c198 | robert-adrian99/DataStructures | Laborator/Lab2_05.03/Lab2_5.03/prb3.cpp | /*3. Sa se implementeze o coada circulara. Pentru aceasta se cere crearea unei
structuri COADA care sa contina un camp de tip vector de int numit DATA,
care stocheaza elementele din coada, un camp SIZE_MAX de tip int, care
reprezinta capacitatea maxima a cozii,doua campuri de tip int BEGIN si END,
care reprezinta pozit... | ALGO | 0.999518 | 4.499519 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2020-03-12T14:23: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": "7f8b633ef... |
91f62068-0e8e-4fea-8e2f-4787d2513778 | bitcoin/bitcoin | src/merkleblock.cpp | // Copyright (c) 2009-2010 <NAME>
// Copyright (c) 2009-2020 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <merkleblock.h>
#include <hash.h>
#include <consensus/consensus.h>
std::vector<... | ALGO | 0.998114 | 7.192072 | {
"github_metadata": {
"branch": "master",
"commit_count": 45499,
"repo_created_at": "2010-12-19T15:16:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 84603,
"forks": 37529,
"issues": 413,
"pull_requests": 342
},
"file_meta": {
"content_i... |
67204b43-04ce-479e-b490-34de600da0c1 | 239yash/Data-Structures-And-Algos | Tree/Lvlorder_traversal_line_by_line.cpp | # include<bits/stdc++.h>
using namespace std;
// Function declaration line, just below this comment.
struct node{
int key;
node * left;
node * right;
node(int x)
{
key = x;
left = NULL;
right = NULL;
}
};
void lvl_order_line(node * root)
{
if( root == NULL){return;}... | ALGO | 0.999971 | 4.019271 | {
"github_metadata": {
"branch": "master",
"commit_count": 411,
"repo_created_at": "2020-01-24T17:52:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6eae027a... |
d47c57d6-4941-4241-8530-abcd0785f1f6 | OpenSees/OpenSees | SRC/system_of_eqn/linearSOE/profileSPD/ProfileSPDLinSubstrSolver.cpp | /* ****************************************************************** **
** OpenSees - Open System for Earthquake Engineering Simulation **
** Pacific Earthquake Engineering Research Center **
** **
** ... | ALGO | 0.990193 | 3.580184 | {
"github_metadata": {
"branch": "master",
"commit_count": 8721,
"repo_created_at": "2018-09-12T00:49:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 667,
"forks": 719,
"issues": 42,
"pull_requests": 23
},
"file_meta": {
"content_id": "7d... |
2a0de35d-8c81-4f81-bb87-971aa6f3c87e | robsujunior/Lista2 | exercicio6For.cpp | #include <iostream>
using namespace std;
int main()
{
float base = 0.0f, altura = 0.0f, area = 0.0f;
int comando;
string decisao;
for(;;){
cout << "Escolha uma opção para calcular a área:\n";
cout << "Triângulo - 1\n";
cout << "Quadrado - 2\n";
cout << "Retângulo - 3\n... | TOOL | 0.983602 | 3.463063 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-06-15T16:44: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": "8aa8112b9a96... |
4c2938da-6af0-415b-abf9-3345a3506c74 | LuuuuuG/MyLeetCode | Source/172_Factorial Trailing Zeroes.cpp | #include <iostream>
using namespace std;
/*
Given an integer n, return the number of trailing zeroes in n!.
Example 1:
Input: 3
Output: 0
Explanation: 3! = 6, no trailing zero.
Example 2:
Input: 5
Output: 1
Explanation: 5! = 120, one trailing zero.
Note: Your solution should be in logarithmic time complexity.
172... | ALGO | 0.999642 | 5.985256 | {
"github_metadata": {
"branch": "master",
"commit_count": 226,
"repo_created_at": "2018-07-19T02:15:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6292b0d1... |
57e38cce-0193-4175-a827-7ec63e20a1be | KanavChopra/Coding-Ninjas-CPP-DataStructures-Solutions | LinkedList 1/InsertNodeRecursive.cpp | /****************************************************************
Following is the class structure of the Node class:
class Node
{
public:
int data;
Node *next;
Node(int data)
{
this->data = data;
this->next = NULL;
}
... | ALGO | 0.999677 | 5.179654 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2022-07-12T19:14:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51a26a48346... |
a3ccae7f-1342-4ad8-883d-253af9c6436e | gcamargo96/Competitive-Programming | problem-solutions/codeforces/educational/67/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define For(i,a,b) for(int (i)=(a);(i) < (b); ++(i))
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define PI acos(-1)
#define fastcin ios_base::sync_with_stdio(false);
typedef long long ll;
typedef unsigned long long u... | ALGO | 0.999982 | 3.581993 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2016-08-23T18:09: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": "b4a83e9fc... |
f3b1ef0e-34b9-4b23-b3cb-ebb79323edbd | MakerFace/work | nio/src/2.cpp | /**
* @file 2.cpp
* @brief
* @author chenqi (<EMAIL>)
* @version 1.0
* @date 2022-07-17
*/
#include <bits/stdc++.h>
using namespace std;
int binary_search(int *arr, int len, int val) {
int left = 0, right = len;
while (left < right) {
int mid = (left + right) / 2;
if (arr[mid] == val) {
return... | ALGO | 0.999937 | 4.799028 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2022-09-14T12:37: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": "630fa7606c5... |
347f6690-2024-45bd-9dbe-8114cdbe73de | hongjunliao/cpp-test | deps/sfslite-1.2/pm.h | // -*-c++-*-
/* $Id$ */
/*
*
* Copyright (C) 2005 <NAME> (mfreedman at alum.mit.edu)
*
* 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, or (at
* your option) any later v... | TOOL | 0.962371 | 6.107364 | {
"github_metadata": {
"branch": "master",
"commit_count": 347,
"repo_created_at": "2023-07-16T01:39: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": "cad048d5... |
6c2ccd9d-e59a-404d-b457-87acede2d0ac | nonoivan1234/nono-space | APCS/2022-06/3/3.cpp | #include<bits/stdc++.h>
using namespace std;
#define nono_is_handsome cin.tie(0); ios_base::sync_with_stdio(0);
#define int long long
struct glass{
int x, y, k;
};
vector<glass> v;
bool cmp(glass g1, glass g2){
if (g1.x!=g2.x) return g1.x<g2.x;
return g1.y<g2.y;
}
signed main(){
nono_is_handsome
... | ALGO | 0.99996 | 4.010654 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2021-12-19T05:38: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": "a6761f317895... |
9d5137fd-3fd8-4b6e-8a5a-6d36dcfe030b | skshohagmiah/Cpp_DSA | Text_Justification.cpp | class Solution {
public:
vector<string> fullJustify(vector<string>& words, int maxWidth) {
vector<string> result;
int i = 0;
while (i < words.size()) {
// Step 1: Calculate how many words fit in this line
int lineLength = words[i].length();
int j ... | ALGO | 0.999988 | 6.781541 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-12-23T05:35:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "64cde14c54e... |
9dc3962f-1b30-4687-9db1-5b23eb7afb71 | data61/MP-SPDZ | FHE/QGroup.cpp |
#include "Matrix.h"
#include "QGroup.h"
#include "Math/bigint.h"
#include <string.h>
#include <stdlib.h>
void QGroup::assign(int mm,int seed)
{
m=mm;
#define numsmallprimes 46
int small_primes[numsmallprimes]=
{ 2, 3, 5, 7,11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
73,79,83,89,... | ALGO | 0.992515 | 3.069733 | {
"github_metadata": {
"branch": "master",
"commit_count": 926,
"repo_created_at": "2018-10-11T01:16:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1050,
"forks": 323,
"issues": 10,
"pull_requests": 3
},
"file_meta": {
"content_id": "842... |
5f106b8f-2c64-45f6-b630-8316503ad022 | PacktWorkshops/The-CPP-Workshop | Chapter07/Activity07/Activity07.cpp | #include <iostream>
#include <memory>
using namespace std;
class word
{
friend class line;
unique_ptr<char[]> ptr_;
int letters_;
int spaces_;
word* next_;
public:
word(char const* srcp, int l, int spaces);
void to_string(char* dstp);
int size();
};// end word
word::word(cha... | TOOL | 0.952559 | 4.153236 | {
"github_metadata": {
"branch": "master",
"commit_count": 395,
"repo_created_at": "2019-10-08T09:57:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 129,
"forks": 79,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "a764db... |
310a2f69-6480-4e57-8dc3-76cc1f06b8f2 | ks1ksi/ps | 백준/Platinum/14868. 문명/문명.cc | #include <bits/stdc++.h>
using namespace std;
const int dy[4] = {1, -1, 0, 0};
const int dx[4] = {0, 0, 1, -1};
int N, K;
int arr[2000][2000];
int p[4000000];
vector<pair<int, int>> v;
int find(int n) {
if (p[n] < 0) return n;
return p[n] = find(p[n]);
}
void Union(int n1, int n2) {
n1 = find(n1);
n... | ALGO | 0.999854 | 4.372868 | {
"github_metadata": {
"branch": "master",
"commit_count": 198,
"repo_created_at": "2023-01-10T05:36: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": "1e6ad886... |
a8444413-2f8f-432f-a65a-cee335d4fa8e | Lyhoangem/practice_Phan_Minh_Quan | lesson 5/problem8.06.cpp | #include <iostream>
#include <string.h>
using namespace std;
#define MAX 300
int myStrcmp(char s1[], char s2[]);
int myStrlen(char s[], int k);
void myStrcpy(char s[], int vt, char s1[], int k);
void mySubstr(char s[], int b, int count, char ss[]);
bool myStrcat(char s1[], char s2[]);
void StringReverse(char st[]);
i... | ALGO | 0.999459 | 3.420421 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-02-02T01:47: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": "75306c9d4970... |
cf766cbf-41cd-4857-9d4e-bb3d74ca1f40 | kumasento/LeetcodeCollection | medium/SearchforaRange.cpp |
#include <iostream>
#include <vector>
using namespace std;
vector<int> searchRange(int A[], int n, int target)
{
vector<int> res(2, -1);
int l = 0, r = n-1, m;
// first check the existance.
while (l <= r)
{
m = (l+r) / 2;
if (A[m] == target)
break;
else if (A[... | ALGO | 0.999964 | 5.661054 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2014-11-19T04:28:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e48ff8444... |
54d38059-24f8-4473-9ab5-8fc964f70e84 | vatsalkudecha/SDE-Sheet | Day-9/N meetings in one room.cpp | /*
CS-> https://www.codingninjas.com/codestudio/problems/1062658?topList=striver-sde-sheet-problems&utm_source=striver&utm_medium=website
GFG-> https://practice.geeksforgeeks.org/problems/n-meetings-in-one-room-1587115620/1
---------------------------------------------
Input:
N = 6
start[] = {1,3,0,5,8,5}
end[] = {2,4... | ALGO | 0.999991 | 5.48641 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2022-06-05T14:37:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75dbaa2b8e1... |
c7795417-b101-4742-92d1-75b527ef330f | hbatmit/ns2.35 | pushback/rate-limit.cc | /* -*- Mode:C++; c-basic-offset:4; tab-width:4; indent-tabs-mode:t -*- */
/*
* Copyright (c) 2000 International Computer Science Institute
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:... | ALGO | 0.950105 | 4.718288 | {
"github_metadata": {
"branch": "master",
"commit_count": 741,
"repo_created_at": "2013-01-18T21:42:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 49,
"forks": 102,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "9b312... |
2cbfc889-2812-4ecf-a65f-67400b5c85f7 | ohinhyuk/PPS-2022-Coding-Test-Project | 0710_Day7/C029_오인혁_20220710.cpp | // BeakJun 1712
// Title : 손익분기점
// URL : https://www.acmicpc.net/problem/1712
/*
------------------------------------------------------------------------------
문제
월드전자는 노트북을 제조하고 판매하는 회사이다. 노트북 판매 대수에 상관없이 매년 임대료, 재산세, 보험료, 급여 등 A만원의 고정 비용이 들며, 한 대의 노트북을 생산하는 데에는 재료비와 인건비 등 총 B만원의 가변 비용이 든다고 한다.
예를 들어 A=1,000, B=7... | ALGO | 0.999771 | 3.718075 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2022-06-30T15:11: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": "f2a24650dcf... |
18de2f2e-8d1e-4638-af42-3bd527bd7149 | VinayakSingh001/Devops | codechef/missing_Numbers.cpp | // #include<bits/stdc++.h>
// using namespace std;
// int main() {
// // your code goes here
// int t;
// cin>>t;
// while(t--){
// long long int a[4],count = 0,x=-1,y=-1;
// for(int i =0; i<4; i++){
// cin>>a[i];
// }
// sort(a,a+4);
// if(a[1]==a[2]&&a[0]==a[1]-1&&a[3]==a[1]+1){... | ALGO | 0.99998 | 4.370991 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-01-16T09:52: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": "fd60fc558af8... |
5e43cd56-eaf6-4890-bd4c-a32c9cf783b7 | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1244/all/28892670_62491572.cpp | #include <iostream>
// Author: MrLolthe1st
#include <map>
#include <set>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;
#define vec vector
#define ms multiset
#define pb push_back
#define pll pair<long long, long long>
#define pii pair<int, int>
#def... | ALGO | 0.999984 | 3.758137 | {
"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": "0405387de... |
5dfca067-f168-4221-9cb0-d412b5e14c59 | samuko-things/adaptive_low_pass_filter | adaptive_low_pass_filter.cpp | #include "adaptive_low_pass_filter.h"
AdaptiveLowPassFilter::AdaptiveLowPassFilter(int orderVal, float f0)
{
// f0: cutoff frequency (Hz)
order = orderVal;
if (order < 1)
order = 1;
else if (order > 2)
order = 2;
omega0 = 6.28318530718 * f0;
for (int k = 0; k < order + 1; k++)
{
x[k] = 0;
... | ALGO | 0.999279 | 5.167149 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-05-28T21:40:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab270e080acc... |
19ce3d82-7135-455b-a45b-8e41d674ab0c | codebymahmud24/DSA | Heap/medium/kthSmallest.cpp | // ? Kth Smallest
// https://www.geeksforgeeks.org/problems/kth-smallest-element5635/1
//* Heap creation time: O(k), Heap insertion time: O(logK), Heap deletion time: O(logK)
//* Processing time: 0(n-k)logk, Total time: O(nlogk)
// * Same Type Problem IN Leetcode just use MIN Heap
// - 215. Kth Largest Element in an ... | ALGO | 0.999973 | 6.506074 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-07-05T04:10: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": "84d15e0691fd... |
53f2be5b-7a02-4201-89b4-4da885766fc5 | ayush931/C-Plus | Binary Search Algorithms/firstOccurance.cpp | // Find the first occurance of a given element x, given that the given array is sorted. If no occurance of x is found then return -1.
#include <bits/stdc++.h>
using namespace std;
int firstOccurance (vector<int> &input, int target) {
int lo = 0;
int hi = input.size() - 1;
int ans = -1;
while (lo <= ... | ALGO | 0.999986 | 5.769182 | {
"github_metadata": {
"branch": "main",
"commit_count": 97,
"repo_created_at": "2024-02-09T19:49:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e0413dfa39b... |
bb6a05e0-7de6-4be1-9e79-6376444d148e | nkorzh/Algorithms-DM | 3 semester/Algorythms/2 graphs/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
struct edge {
int to, w;
edge() : to(-1), w(INT_MAX) {}
edge(int t, int w) : to(t), w(w) {}
bool operator<(const edge & b) const {
return w < b.w;
}
};
int n, m, max_pathlen, s;
vector<vector<int>> d;
vector<vector<edg... | ALGO | 0.999874 | 3.974659 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-02-25T08:21: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": "4a6f6610e0... |
9dc0478f-b9c0-4928-a783-f40d44c417d5 | Aquib-Nawaz/SqliteV2 | src/BTreeIterator/iterator.cpp | //
// Created by <NAME> on 08/10/24.
//
#include "iterator.h"
#include <cassert>
BTreeIterator::BTreeIterator(BTree *btree) {
_btree = btree;
}
void BTreeIterator::iterNext(bool dir) {
if(_stack.empty())
return;
BNode* node = _stack.top().first;
uint16_t index = _stack.top().second;
_stac... | ALGO | 0.948116 | 4.760441 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2024-09-23T18:16: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": "a4d05779f0a... |
fa9029a2-0f3f-4223-b551-0fbe7ff96c53 | cswangjiawei/leetcode | C++/200.cpp | class Solution {
public:
int numIslands(vector<vector<char>>& grid) {
int m = static_cast<int>(grid.size());
int n = static_cast<int>(grid[0].size());
int ans = 0;
for (int i=0; i<m; ++i) {
for (int j=0; j<n; ++j) {
if (grid[i][j] == '1') {
... | ALGO | 0.99997 | 6.454383 | {
"github_metadata": {
"branch": "main",
"commit_count": 264,
"repo_created_at": "2021-01-17T13:02:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c54082703c... |
df0e616b-34ef-45de-9dae-51f43b61cea7 | alexhvzr/CPP-Projects | PartialSort/main.cpp | #include <vector>
#include <iostream>
#include <stdlib.h>
using namespace std;
extern void partialsort( vector<int> &items, int k);
// initialize a given array with random numbers.
void initArray( vector<int> &array, int randMax ) {
int size = array.size( );
for ( int i = 0; i < size; ) {
int tmp = (... | ALGO | 0.999858 | 4.742754 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-12-18T21:27: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": "5d714ecbce... |
ea7b574e-fd75-4223-a120-133a63983938 | taranyel/Matrix-calculator | taranyel/src/operators/Determinant.cpp | #include "Determinant.h"
Determinant::Determinant() = default;
Operand* Determinant::evaluate() {
if (variables.size() != 1){
return nullptr;
}
vector<vector<double>> matrix;
int rows, columns;
if (variables[0]->getType() == MATRIX){
matrix = variables[0]->getValue().second;
... | TOOL | 0.998254 | 5.227089 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-10-24T16:29: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": "9c5ec88377eb... |
30d74c4e-02f9-4ece-8733-14b2241cc069 | Kchanana2025/Coding-ninjas-Codes | Priority Queues/Priority_queues.h | #include <vector>
class Priority_Queue
{
vector<int> pq;
public:
Priority_Queue
{
}
bool isEmoty
{
return pq.size() == 0;
}
int getsize()
{
return pq.size();
}
int getMin()
{
if (isEmpty())
return INT_MAX;
return pq[0];
}
... | ALGO | 0.99986 | 5.19415 | {
"github_metadata": {
"branch": "main",
"commit_count": 193,
"repo_created_at": "2023-06-10T09:09: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": "421088ab3c... |
6e40133d-8953-44d2-a761-da95fe81534d | LucasGabriel021/Universidade | Disciplina-AP/Lista-06/Código Fonte Lista 6/EX.3.cpp | //Tem-se um conjunto de dados contendo a altura e o sexo (masculino, feminino) de até 10 pessoas. Fazer
//um programa que calcule e escreva: a maior e a menor altura do grupo; a média da altura das mulheres;
//o número de homens. Usar os três comandos de repetição na solução do problema.
//Bibliotecas
#include <ctype.... | ALGO | 0.996638 | 3.695155 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2022-09-18T01:13: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": "028ca92c475... |
c4f15260-e8e1-463a-9cdb-f43be00d5dd7 | 1010yyn/work-0.0 | 2048/2048/源.cpp | #include<iostream>
#include<ctime>
#include<cstdlib>
using namespace std;
const int m = 4;
class game
{
public:
int i, j;
game() {
count1 = 0;
for (i = 0; i < m; i++)
for (j = 0; j < m; j++)
chessboard[i][j] = 0;
srand((unsigned)time(NULL));
x = rand() % m;
y = rand() % m;
if (count1 == 1 || count1... | ALGO | 0.993866 | 3.233044 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-03-28T15: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": "0a91b8caa3... |
73c43a39-de7f-43ca-9afd-930154469b94 | LoganJoe/training-data | 2018.9/2018.09.26/task/girl.cpp | #include<bits/stdc++.h>
#define db double
int T;
struct point
{
db x, y;
}A, B;
db sqr (point a)
{
return a.x*a.x + a.y*a.y;
}
bool check (point A, point B)
{
if (A.x < B.x && A.y < B.y) return 1;
if (sqr (A) < sqr (B)) return 0;
db a = A.x / 2.0, b = A.y / 2.0;
db delt1 = sqrt (sqr (B) / 4 - b * b), delt2 = sqrt... | ALGO | 0.999534 | 3.429376 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-03-29T06:48:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b8898fa0b... |
9386465d-5f38-4cf3-b13a-dd19a72381a1 | ajourney1/Algorithms | merge sort.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
#pragma GCC target ("avx2")
#pragma GCC optimization ... | ALGO | 0.999999 | 5.139524 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-08-20T13:52: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": "aad4ff9032... |
7e747e00-0993-4863-a255-3e3d39e86f04 | jeet1439/dsa.cpp | linkedlist/reversell.cpp | #include <iostream>
using namespace std;
class Node
{ public:
int data;
Node* next;
Node(int val)
{
data = val;
next = NULL;
}
~Node(){
cout << "node destructor for data: " << data << endl;
if(next!=NULL){
delete next;
next = NULL;
... | ALGO | 0.970655 | 4.58075 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-07-04T14:55: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": "7644ea60dd86... |
056bc139-3aa3-4d3c-a181-e7adaf67a1aa | Rohan-s18/Artificial_Intelligence | High Performance ML/Linear Regression/single_output_lr.cpp | // Author: <NAME>
// Feb 17, 2023
// Imports
#include <iostream>
using namespace std;
#define MAX 100
// Class for Neural Networks
class NeuralNetwork{
// Instance Fields
private:
double* weights;
int dim;
double epsilon;
int max;
double* target;
int len;
// Methods
... | ALGO | 0.997927 | 4.376958 | {
"github_metadata": {
"branch": "main",
"commit_count": 199,
"repo_created_at": "2022-05-08T20:20:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba60e9552f... |
3c7405c7-8306-4833-a6d3-440cc2e362c1 | mansi1309/GeeksForGeeks | Difficulty: Basic/Implement Queue using array/implement-queue-using-array.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
struct QueueNode
{
int data;
QueueNode *next;
};
class MyQueue {
private:
int arr[100005];
int front;
int rear;
public :
MyQueue(){front=0;rear=0;}
void push(int);
int pop();
};
int main()
{
int T;
cin>>T;
... | ALGO | 0.998092 | 4.977917 | {
"github_metadata": {
"branch": "main",
"commit_count": 579,
"repo_created_at": "2023-11-01T08:01: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": "d14e9e7562... |
abd21228-5918-48da-afd3-7b5e6e35a913 | MYRADhub/CompetitiveProgramming | Solutions/permNumber.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define ll long long
#define vi vector<int>
#define elif else if
#define mp make_pair
#define vp vector<pair<int, int>>
#define pb push_back
#define uns unsigned
#define INF 1e9 + 7
#define ff first
#define ss second
#define N 101
using namespace std;
int fact(int n) {
if ... | ALGO | 0.999997 | 3.354126 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-03-09T03:34:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "afac7af27b41... |
ce3c656c-d688-4dc8-9527-313e13bfaadd | himu23/codebits | codechef/DSA/Algorithms/Number Theory/nooffactors.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define MOD 1000000007
vector<int> vec(1000001, 0);
const int MAXN = 1000001;
int spf[MAXN];
void Sieve() {
spf[1] = 1;
for (int i = 2; i < MAXN; i++)
spf[i] = i;
for (int i = 2; i * i < MAXN; i++) {
if (spf[i] == i... | ALGO | 0.999941 | 4.860504 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2023-12-26T05:14:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e9688f6caf6... |
1c954f24-8f59-4bb3-8965-d1f8352f3944 | dodo-is-dodo/cpp_class | 04/p07.cpp | #include <iostream>
#include <math.h>
int main(int argc, char *argv[])
{
std::string temp;
int n = 3;
int sum = 0;
int lst[n];
std::cout << "Put in a, b, c!\n";
for (int i = 0; i < n; i++) {
std::cin >> temp;
lst[i] = std::stoi(temp);
// std::cout << num << "\n";
}
double a = lst[0];
doub... | ALGO | 0.998976 | 3.861752 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-09-12T13:09:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf5e6a39cf... |
7f82080f-8d8b-4a87-b4cc-968e16eeb4ab | HumanHyeon/Algorithm_Book | archive/GyuMin/스킬트리.cpp | //https://programmers.co.kr/learn/courses/30/lessons/49993
#include <string>
#include <vector>
using namespace std;
int solution(string skill, vector<string> skill_trees)
{
int answer = 0;
vector<string> possible;
string possible_skill;
vector<char> core_skill;
vector<string> user_skills;
... | ALGO | 0.999617 | 4.870906 | {
"github_metadata": {
"branch": "master",
"commit_count": 1187,
"repo_created_at": "2019-11-07T13:26:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 3,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "0a2d9a... |
8261edf1-5d81-4d69-b11a-4da0e50f5d04 | NightTTQ/Algorithm-training-records | csen1B.cpp | //#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define fast_io() \
... | ALGO | 0.999996 | 4.099174 | {
"github_metadata": {
"branch": "master",
"commit_count": 174,
"repo_created_at": "2020-02-20T02:10: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": "83b57a72... |
4b141d22-05a0-47fe-b30a-b57906099e47 | AndySomogyi/chombo | versions/3.0/lib/src/OldAMRElliptic/AMRLevelMG.cpp | #ifdef CH_LANG_CC
/*
* _______ __
* / ___/ / ___ __ _ / / ___
* / /__/ _ \/ _ \/ V \/ _ \/ _ \
* \___/_//_/\___/_/_/_/_.__/\___/
* Please refer to Copyright.txt, in Chombo's root directory.
*/
#endif
// DTGraves, Thurs, July 15, 1999
#include <cstdlib>
#include <iostream>
#include ... | ALGO | 0.996477 | 4.550993 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-03-07T20:20:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e4b9df193... |
37ce14b8-1323-4057-81ab-8422ad1ad3ab | Codensity30/Strivers-A2Z-DSA-Sheet | 12. Binary Search Trees/2. Practice Problems/12. Largest BST in Binary Tree.cpp | /*
Question:
Given a binary tree. Find the size of its largest subtree that is a Binary Search Tree.
Explanation:
- We use a recursive function to traverse the binary tree in a bottom-up manner.
- At each node, we check if the left and right subtrees are binary search trees.
- If the current node satisfies the binary ... | ALGO | 0.999996 | 6.624032 | {
"github_metadata": {
"branch": "main",
"commit_count": 88,
"repo_created_at": "2023-05-29T13:38:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 213,
"forks": 70,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "5178eefa... |
d2d02630-597e-412c-bf22-cbc104e061a9 | ramalokeshreddyp/gfg-solutions | Difficulty: Basic/Uncommon characters/uncommon-characters.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
string UncommonChars(string A, string B)
{
// code here
string ans = "";
map<char, int> a;
for (char i: A) {
... | ALGO | 0.999902 | 5.53149 | {
"github_metadata": {
"branch": "main",
"commit_count": 667,
"repo_created_at": "2024-09-29T01:28: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": "da54f84fc8... |
bde4089b-3272-4906-aec7-27641460ca1d | joshua-dgeang/Thesis_code | thirdYear/August_17/dynamicProgramming/headers/simu.cpp | //simu.cpp
//this class is used to simulate cash problem for one stage;
//users should pass three pointers, two int pointers to the current state and one bool pointer to the stop condition and two parameters (cash demand, cash action);
//this class will return the currentReward in this stage as well as the cash value a... | ALGO | 0.999831 | 4.168261 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2017-11-27T15:37:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "06b09fa3c... |
6fcc33b9-eea7-42b7-a96b-3d9ea889a47e | nguyenvantu11052002/CTDL-GT | DSA04009 - LŨY THỪA MA TRẬN 1 cách tự làm.cpp |
#include<bits/stdc++.h>
using namespace std;
const long long m = 1e9 + 7;
long long n, f, a[15][15], ans[15][15];
void nhan(long long A[15][15], long long B[15][15]){
long long res[15][15];
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
res[i][j] = 0;
for(int k = 0; k < n; k++){
res[i][j] +=... | ALGO | 0.999881 | 3.674778 | {
"github_metadata": {
"branch": "main",
"commit_count": 304,
"repo_created_at": "2022-02-06T15:10: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": "c6fdf92daa... |
50d44b9f-ed1d-49c3-9f72-8606157be0a4 | Gilgameshgb-1/ProgrammingTechniques | T12/Z2/main.cpp | #include <iostream>
#include <set>
#include <algorithm>
#include <tuple>
template <typename NekiTip>
std::set<NekiTip> operator+(const std::set<NekiTip> &s1,const std::set<NekiTip> &s2)
{
std::set<NekiTip> s3{};
for(auto it = s1.begin(); it!=s1.end(); it++) s3.insert(*it);
for(auto it = s2.begin(); it!=s2.end(); it... | ALGO | 0.994044 | 4.98841 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2020-12-02T12:25: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": "0f4ac9a1bedc... |
44c58c29-8ce0-4157-a0d2-eec1f35a527c | Santiago25k/Analista-Funcional-de-Sistemas | C++/archivos_de_clase/guia2/ejercicio1.cpp | //n algoritmo que reciba como entrada 5 números enteros (ingresados de a uno),
//e indique como salida si el promedio de ellos es superior a 7 o no.
//Ejemplo:
//Entradas: 10, 8, 5, 3, 8, 2, 7, 7, 9, 6
//Salida: El promedio de los números ingresados no es superior a 7.
#include <iostream>
using namespace std;
int... | ALGO | 0.999286 | 3.560646 | {
"github_metadata": {
"branch": "main",
"commit_count": 126,
"repo_created_at": "2024-05-04T04:13:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "16a1a28aa2... |
37d62c1e-d598-4255-beaa-8f6d9c1e8c9e | trilinos/Trilinos | packages/triutils/src/Trilinos_Util_dusmm.cpp | // @HEADER
// ***********************************************************************
//
// TriUtils: Trilinos Utilities Package
// Copyright (2011) Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// license for use of this work by or on beh... | ALGO | 0.987462 | 5.791095 | {
"github_metadata": {
"branch": "master",
"commit_count": 104031,
"repo_created_at": "2015-11-16T19:39:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1299,
"forks": 593,
"issues": 263,
"pull_requests": 61
},
"file_meta": {
"content_id":... |
af9a09d4-8b38-45f9-ac04-b3cdceeff24f | SeungJL/BaekJoon-Study | 2022/12_Dec/12.26~01.01/17829/승주.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int arr[1025][1025] = {};
int secondMax(int a, int b, int c, int d) {
int arr[4] = { a,b,c,d };
sort(arr, arr + 4);
return arr[2];
}
int devideConquer(int totalSize) {
if (totalSize == 1) { cout << arr[0][0]; return 0; }
for (int i = 0; i < totalSiz... | ALGO | 0.999956 | 3.541282 | {
"github_metadata": {
"branch": "main",
"commit_count": 681,
"repo_created_at": "2022-01-28T04:31:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 3,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "5f07bf555c... |
7fc6f4dd-d9a7-4ce7-8f23-9452c82bc824 | bobur554396/PPI2018FALL | week5/G1/13.cpp | #include <iostream>
using namespace std;
int main()
{
/*
Symmetric matrix
input
3
2 3 4 #9
3 1 10 #14
4 6 0 #10
output
1 14
*/
int n;
cin >> n;
int a[n][n], maxi, ind, sum = 0;
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++){
cin >> a[i][j];
}
}
for (int i = 0;... | ALGO | 0.999852 | 3.546477 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2018-08-30T09:06: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": "67c9cb1d8... |
3a18b775-109c-4d51-8006-80377c061660 | plChao/leetcode | exercise_matrix_multi.cpp | // C++ program using memoization
#include <bits/stdc++.h>
using namespace std;
int dp[100][100];
int record[100][100] = {0};
// Function for matrix chain multiplication
int matrixChainMemoised(int* p, int i, int j)
{
if (i == j)
{
return 0;
}
if (dp[i][j] != -1)
{
return dp[i][j];
}
dp[i][j] = INT_MAX;
for... | ALGO | 0.999995 | 5.200125 | {
"github_metadata": {
"branch": "main",
"commit_count": 117,
"repo_created_at": "2022-02-05T20:03: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": "6d82cd90be... |
8f601b54-61f7-4485-abac-62e3f1108b56 | wctstc/MasterSlave | MasterSlave/Config.cpp | #include "Config.h"
#define R_SECTION (string("["))
#define L_SECTION (string("]"))
#define KEY_VALUE_GAP (string("="))
#define LINE_END (string("\n"))
#define SENTENCE_END (string("\n"))
#define ANNOTATION (string(";"))
#define BLACK (string(" "))
Config::Config( void )
{
}
Config::Config(... | TOOL | 0.901265 | 4.364336 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2015-06-15T01:37:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c4df3cddb... |
3b524b40-055c-4634-b8b1-1ef549dd20bb | SubhamSinghal/Programming | dp/MCARD1.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct card
{
int color, value, cost;
};
int main()
{
int c, n, totalCard, i;
vector<card> v[100000];
bool color[c + 1];
cin >> c >> n;
totalCard = c * n;
card arr[totalCard];
for(i = 0; i < totalCard; i++)
{
cin >> arr[i].colo... | ALGO | 0.999956 | 4.090617 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-06-15T09:42: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": "3e65a90d32... |
0ff422ae-41d2-483e-bec6-83e5fa9a6c3c | ajaybin/AOC-2024 | D6/P2.cpp | //Up : (-1, 0) : Right
//Right : ( 0, 1) : Down
//Down : ( 1, 0) : Left
//Left : ( 0,-1) : Up
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <utility>
int numRows{0};
int numCols{0};
using obs_v = std::set<std::pair<int,int>>;... | ALGO | 0.999924 | 4.15907 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-12-02T01:16: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": "238e0dcff14... |
411f6d5b-20a7-4a13-a358-5fa01b6a8057 | bodu93/algs | sort/heapsort/heapsort.cc | #include "heapsort.h"
#include "../include/swp.h"
// rank begin with 0
size_t parent(size_t k) {
if (k == 0) return 0;
return (k - 1) / 2;
}
size_t lchild(size_t k) {
return 2 * k + 1;
}
size_t rchild(size_t k) {
return 2 * (k + 1);
}
void sink(int *A, size_t k, size_t n) {
while (lchild(k) < n) {
size_t j =... | ALGO | 0.999979 | 4.595641 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2017-08-12T15:46: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": "2f5e251dc... |
10307063-662c-4c59-b001-ee8d9a370de2 | badouralix/adventofcode-2018 | day-11/part-2/thomas.cpp | #include <iostream>
#include <string>
#include <ctime>
using namespace std;
int fuel(int x, int y, int serial)
{
return (((x + 10) * y + serial) * (x + 10) / 100) % 10 - 5;
}
string run(string s)
{
int serial = stoi(s);
int sa_table[301][301];
;
for (int x = 1; x <= 300; x++)
{
for (i... | ALGO | 0.994821 | 4.084435 | {
"github_metadata": {
"branch": "master",
"commit_count": 629,
"repo_created_at": "2018-11-30T23:33:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 29,
"forks": 6,
"issues": 3,
"pull_requests": 2
},
"file_meta": {
"content_id": "0f23b7d... |
10676d2a-6454-4c69-baa7-0dd56db8d30d | tsutaj/cpp_library | structure/strc_024_static_wavelet_matrix.cpp | #pragma once
// @title Wavelet 行列 (wavelet matrix)
// @docs docs/structure/strc_024_static_wavelet_matrix.md
#ifndef call_from_test
#include "strc_023_compact_bitvector.cpp"
#endif
// ウェーブレット行列 (Wavelet Matrix)
// w は ビット幅, 30 bit で表現できる整数なら 30
template <uint64_t word_size = 30, typename value_type = int,
... | ALGO | 0.998898 | 5.780436 | {
"github_metadata": {
"branch": "master",
"commit_count": 264,
"repo_created_at": "2019-11-22T11:19:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "60312365... |
7a1e93a0-58fe-422e-ab00-7aad6bdc910a | jczh98/Algorithm | hdu/hdu6217.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
LL qpow(LL a, LL b, LL mod) {
LL ret = 1;
for(; b; b >>= 1) {
if(b & 1) ret = (ret * a) % mod;
a = (a * a) % mod;
}
return ret;
}
double bbp(int n, int co, int k) {
double ret = 0;
for(int i = 0; i <= n; ++i) {
... | ALGO | 0.999342 | 3.423434 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2016-07-02T08:52:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70d165db1... |
c9aaabc8-d3d2-4819-ba48-0e47e9efc9dc | ishandutta2007/codeforces-b | balintr/normal/1553/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, bool> pib;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<pib> vpib;
typedef int8_t int8;
typedef comp... | ALGO | 0.999979 | 4.478733 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "888d0eaaecdc... |
49b27d7e-4582-42ed-9226-0677799daf9a | cs-vietnguyen/leetcode | cpp/6.zig-zag-conversion.cpp | /*
* @lc app=leetcode id=6 lang=cpp
*
* [6] ZigZag Conversion
*/
// @lc code=start
class Solution {
public:
string convert(string s, int numRows) {
string result;
if (numRows == 1) return s;
for (int i = 0; i < numRows; i++) {
if (!i || i == numRows - 1) {
... | ALGO | 0.999997 | 6.708103 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2021-08-28T15:07: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": "8bb23c906... |
13807747-fc85-4dee-9f4f-19deeb98c4c7 | blender/blender | extern/quadriflow/3rd/lemon-1.3.1/lemon/static_graph.h | /* -*- mode: C++; indent-tabs-mode: nil; -*-
*
* This file is a part of LEMON, a generic C++ optimization library.
*
* Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
* Permission to use, modify and distribut... | ALGO | 0.954775 | 6.13926 | {
"github_metadata": {
"branch": "main",
"commit_count": 152123,
"repo_created_at": "2019-10-09T12:47:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 15670,
"forks": 2395,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f... |
3c4ecdde-8b9a-4894-93c8-b5f95ea3e3db | melike1818/CS202-HW1 | sorting.h | /*
* Title: Algorithm Efficiency and Sorting
* Author: <NAME>
* ID: 21702346
* Section: 2
* Assignment: 1
* Description: Sorting Header
*/
#ifndef SORTING_H
#define SORTING_H
#include <iostream>
using namespace std;
class sorting {
public:
void insertionSort(int *arr, int size, int &compCount, int &moveCount);
... | ALGO | 0.99925 | 6.164443 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-05-08T11:14: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": "bf9fe254ea... |
bdbc2d9f-981d-4da7-8054-7054f6e2fef6 | hanii-gerges/Leetcode-Training | 617-merge-two-binary-trees/617-merge-two-binary-trees.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999994 | 5.846497 | {
"github_metadata": {
"branch": "main",
"commit_count": 87,
"repo_created_at": "2022-06-07T17:16:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "376cbf5f18b... |
854e449b-bd1b-4aee-b732-e7695ab91c12 | SultanaAkterSumi/XPSC | Week 21/Day 2/Problem_A.cpp | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set1 = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T>
using ordered_set2 =... | ALGO | 0.998942 | 4.00309 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2024-03-16T13:21: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": "40284269990... |
244cdcf9-d5fc-4514-87d5-98bf16c9627e | Yansa27/stud | matahari.cpp | #include <iostream>
// Fungsi untuk menghitung berapa kali Matahari mengelilingi Bumi dalam waktu tertentu
int hitungPutaranMatahari(int waktu) {
int putaran = waktu / 365; // 1 tahun = 365 hari
return putaran;
}
int main() {
int tahun = 1;
int bulan = 1/12; // 1 bulan = 1/12 tahun
int minggu = 1... | ALGO | 0.999939 | 6.153222 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-10-13T02:34: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": "d60fd83eab... |
43ced24b-0382-41ee-8cfb-92568c75d3e0 | Simron-Bhuyan/TeamElves | main/database/p1.cpp | // Copyright (c) 2015 <NAME>
// License: AFL 3.0 | https://opensource.org/licenses/AFL-3.0
// http://vittorioromeo.info | <EMAIL>
#include <memory>
#include "../Other/Other.hpp"
// Let's begin thinking about the design of our example game
// in this code segment.
// We'll first implement the game using a traditional... | TOOL | 0.933592 | 7.458184 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2022-10-30T14:11:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce53e3234... |
86610a7d-be5d-40b4-bd01-e2bf8bb928ee | romnegrillo/arduino-snippets | ShiftOut/ShiftOut.ino | // Shift Out Register: 74HC595
// Output Pins: Q0 - Q7
// Vcc - 5V
// GND - GND
// OE - GND
// MR - 5V
const int latchPin = 8;
const int clockPin = 12;
const int dataPin = 11;
byte binToCompare = 0b00001111;
void setup()
{
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
shiftW... | TOOL | 0.947989 | 5.51398 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-11-12T11:09:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62f29ae804... |
ee5e449b-cf0e-4473-963d-25133d6b4fa1 | RafidNabil/Codeforce-Solutions | C_Training_Before_the_Olympiad.cpp | #include <iostream>
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
typedef long long ll;
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll tt;
tt = 1;
cin >> tt;
while (tt--)
{
ll n;
cin >> n;
... | ALGO | 0.999946 | 3.226142 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-26T16:34: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": "67cd47b7826d... |
f9c359cf-0e0f-40c3-a046-28ff5331ec75 | ishandutta2007/codeforces-a | acrush/normal/644/C.cpp | #ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <cstdio>
#include <iostream>
#include <cmath>
#include <string>
#include <list>
#include <vector>
#include <algorithm>
#include <functional>
#include <utility>
#include <set>
#include <map>
#include <complex>
#include <queue>
#include <stack>... | ALGO | 0.99686 | 3.616755 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "72fd6c55087f... |
539b4a14-9e01-4175-9d28-e38bc745ee11 | izlyforever/cf | contest/1678/e/e.cpp | #include <bits/stdc++.h>
#define cerr(x) std::cerr << (#x) << " is " << (x) << '\n'
using LL = long long;
void solve() {
int n;
std::cin >> n;
std::vector<int> a(n), b(n), p(n);
for (auto &x : a) std::cin >> x;
for (auto &x : b) std::cin >> x;
for (int i = 0; i < n; ++i) {
p[--a[i]] = --b[i];
}
std... | ALGO | 0.999927 | 4.081897 | {
"github_metadata": {
"branch": "master",
"commit_count": 306,
"repo_created_at": "2021-02-20T10:51:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3b80696... |
bc198c03-b097-4cbf-a866-ac6c6fea71c7 | limyunkai19/competitive-programming-codes | USACO Problem/Section 4.4/milk6.cpp | /*
ID: yunkai91
PROG: milk6
LANG: C++
*/
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#define INF (1<<30)
#define INFLL (1LL<<60)
using namespace std;
typedef pair<int, int> ii;
struct MaxFlow{
int n, s, t;
vector<vector<ii> > graph;
vector<long long... | ALGO | 0.999979 | 3.47499 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2015-10-31T03:06:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a081afae... |
719471e7-c850-450a-b192-9a76ac1a3370 | ir77/aizu_online_judge | 2ALDS/1_2_D/ALDS1_2_D.cpp | #include <iostream>
#include <cmath>
using namespace std;
int cnt;
void insertionSort(int *A, int n, int g) {
for (int i = g; i<n; i++) {
int v = A[i];
int j = i - g;
while (j >= 0 && A[j] > v) {
A[j+g] = A[j];
j = j - g;
cnt++;
}
A[j+g] = v;
}
}
void shellSort(int *A, int n) {
cnt = 0;
int m... | ALGO | 0.999855 | 3.478628 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2015-03-07T03:54: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": "a5934b1b2... |
9d492eb0-c483-4e22-993b-166ef24d4a6d | nsharsharaju/cppRbr | codingMinutes/binaryTree/buildFromLevelOrder.cpp | #include<bits/stdc++.h>
using namespace std;
class Node {
public:
int data;
Node* left;
Node* right;
Node(int data) {
this->data = data;
this->left = nullptr;
this->right = nullptr;
}
};
Node* buildTree(){
int root;
cin >> root;
... | ALGO | 0.999954 | 4.147392 | {
"github_metadata": {
"branch": "main",
"commit_count": 498,
"repo_created_at": "2021-01-23T01:53:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "410e847260... |
36d01c4c-cb0e-4b2a-958d-6b52da70366d | yozw/dbe | src/dbe.cc | /** De Bruijn-Erdos checker for Nauty-generated graphs.
Example usage:
NAUTY="../nauty26r11"
$NAUTY/geng -b -C 6 | ./dbe | $NAUTY/showg -A
**/
#include <algorithm>
#include <chrono>
#include <climits>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
#include <utility>
#include <vec... | ALGO | 0.989023 | 4.356514 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2018-01-28T14:23: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": "0f044a8fd... |
d16ff286-edf9-4ae3-ac11-965ece3b39a9 | julianferres/Competitive-Programming | CSES/Additional Problems/empty_string.cpp | /* AUTHOR: julianferres, jue 27 ago 2020 23:14:22 -03 */
#include <bits/stdc++.h>
using namespace std;
// DEBUGGER
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct... | ALGO | 0.999997 | 4.514938 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2018-08-31T18:53:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d3855a9b... |
8855c621-91cc-4595-97ca-8296e025c745 | italoucsp/ALGABS | RSA.cpp | #include "RSA.h"
RSA::RSA(){
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hConsole, 2);
cout << "GENERAR LLAVES?: "; cin >> op;
if(op == "si") {
cout << "->PC: Espere un momento mientras se generan sus claves...\n";
Generator(); system("cls");
Display(); SaveKey... | TOOL | 0.990731 | 3.971408 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2020-12-31T16:00: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": "bcea1b6b7608... |
a62a49af-0cc8-44cd-ab4c-23edbcf7755d | RenatAkramov/akinator | akinator.cpp | #include "akinator.h"
#include "dump.h"
int main()
{
FILE* file = fopen("akinator.txt","r");
if (file == NULL)
{
printf("File error!\n");
return -1;
}
NODE_T* root = read_tree(NULL, file);
fclose(file);
printf("%x\n", root);
GraphicDump(root);
printf("Enter \n 1 if ... | TOOL | 0.950682 | 3.232888 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-27T10:18: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": "c1bfab6d90b4... |
12c2e19e-42e0-4912-abec-5d5b6f87eac7 | DiegoNGonzalez/laboratorio1 | guia4/guia4ej3.cpp | //Nombre: <NAME>
//TP N°:
//EJ N°:
/* Comentarios
Hacer un programa para ingresar una lista de números que finaliza cuando se ingresa un cero, luego informar el máximo y la posición dentro de la lista.
Ejemplo: 5, 10, 20, 8, 25, 13, 35, -8, -5, 20, 0. Se listará Máximo: 35 - Posición: 7.
Ejemplo: 5, 10, 20, 8, 55, 13,... | ALGO | 0.999708 | 4.000585 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-05-31T00:04: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": "48fab2b427d6... |
a24f3fb4-5c05-498e-8fa5-64cb29f4a556 | ga-b0/Portafolio-c- | Período 1/Condicionales 1.cpp | //<NAME>
//Clase del 15-02-2021
//Nombre del programa: Condicionales 1
#include <iostream>
using namespace std;
/*
Programa que le dice al usuario que ingrese un numero y
le indica si el numero el positivo, negativo, cero, par o impar.
*/
int main()
{
int number;
cout << "Ingrese un numero entero: ";
cin >>... | ALGO | 0.998939 | 3.757952 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-06-09T21:33: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": "0b4f724d289b... |
0124ca0d-3b7a-4656-9564-1fd5570308ba | lishuhuakai/Parser | LR(1)/FiniteStateAutomaton.cpp | #include "FiniteStateAutomaton.h"
#include "ActionGoto.h"
#include <functional>
using namespace std;
FiniteStateAutomaton::FiniteStateAutomaton(Grammar& g) :
g_(g)
{
}
FiniteStateAutomaton::~FiniteStateAutomaton()
{
}
statusPtr FiniteStateAutomaton::makeNewStat(Item& it) {
int key = nextLabel();
statusPtr s(new ... | ALGO | 0.99551 | 4.503072 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2017-03-31T08:58:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da063c4ac4... |
6bf12d39-b800-4492-aa1d-185809b6a251 | ladamalina/leetcode-2022-cpp | 72. Edit Distance (medium)/main.cpp | // #include <bits/stdc++.h>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <nume... | ALGO | 0.99999 | 6.025584 | {
"github_metadata": {
"branch": "master",
"commit_count": 837,
"repo_created_at": "2022-07-23T05:09:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "85c469be... |
510b321c-f463-43be-afcf-9d82b61d484a | Saady47/DSA | simplesorting.cpp | #include <iostream>
using namespace std;
// Bubble Sort
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
for (int j = 0; j < n - i - 1; j++) {
if (arr[j] > arr[j + 1]) {
int temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = tem... | ALGO | 0.999959 | 5.349698 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-12-24T13:39: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": "a3fd085f2489... |
17f68b9b-84f1-4ac0-908f-8311d14bf75d | NelsonGomesNeto/Competitive-Programming | Competitions/ICPC/2015/Regionals/A (At Most Twice)/A.cpp | #include <bits/stdc++.h>
#define lli long long int
using namespace std;
lli u, l;
lli base = 998877665544332211LL;
int cnt[10];
lli getNumber(vector<int> digits, int pos)
{
lli number = 0; int c[10]; memcpy(c, cnt, sizeof(cnt));
for (int i = pos; i < digits.size(); i ++)
for (int d = 9; d >= 0; d --)
if... | ALGO | 0.999949 | 4.384365 | {
"github_metadata": {
"branch": "master",
"commit_count": 333,
"repo_created_at": "2019-08-07T17:50:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "87c03ea... |
fa93ac61-6c7c-4236-934d-ccabfdf15f17 | baactree/PS | BOJ/5575/5575.cpp14.cpp | /////////////////////////////////////////////////////
#ifdef _DEBUG
#include "bits_stdc++.h"
#else
#include "bits/stdc++.h"
#endif
using namespace std;
typedef pair<int, int> pii;
typedef vector<vector<pii > > Edge;
typedef unsigned long long llu;
typedef long long ll;
typedef priority_queue<pii > Pq;
typedef vector<in... | ALGO | 0.999265 | 3.349754 | {
"github_metadata": {
"branch": "master",
"commit_count": 224,
"repo_created_at": "2017-01-14T14:53:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36f5713c... |
f461a998-c21d-4004-b85e-bec91a646dc1 | kebabee/Programowanie-Cpp | thread_pool.h | /*
Klasa thread_pool zawiera listę zadań do wykonania (obiekty klasy std::function<double()>) oraz zestaw wątków procesujących,
które będą te zadania pobierają z listy i wykonują. Konstruktor tej klasy startuje zadaną w argumencie liczbę wątków procesujących.
Klasa ma trzy publiczne metody:
1. void add_task(std::fun... | TOOL | 0.984764 | 5.750207 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2023-06-01T12:46: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": "af02a30adc7... |
7e4f86a0-826e-451b-803e-e45f74b451ee | krypten/competitive-coding | competitive-coding/codechef/prpotion.cpp | /*
* Author : Krypten
* Algorithm : Greedy
*/
#include <bits/stdc++.h>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
using namespace std;
#define INF INT_MAX/2
#define ONLINE_JUDGE 1
#define ull unsigned long long
#define ill long long int
#define pii pair<int,int>
#define pb(... | ALGO | 0.999875 | 3.596841 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2014-02-24T08:29:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "675472d3fc... |
3900e32d-9977-4bf4-95c2-9e678b0b2bf7 | logantsai/On_the_way | leetcode/24_Swap_Nodes_in_Pairs/SNP.cpp | #include <iostream>
#include "LinkListTools.h"
using namespace std;
class Solution {
public:
static ListNode* swapPairs(ListNode* head) {
if (!head) return nullptr;
if (!head->next) return head;
ListNode *headNext = head->next;
head->next = swapPairs(head->next->next);
headNext->next = head;
return h... | ALGO | 0.999927 | 5.371912 | {
"github_metadata": {
"branch": "master",
"commit_count": 142,
"repo_created_at": "2018-05-12T09:02: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": "5f2879b0... |
0f68f22d-8499-4a3b-a517-3077c2dc1c4c | nanshen1987/VO | src/visualodometry.cpp | #include "lmars/visualodometry.h"
#include"lmars/config.h"
#include<opencv2/calib3d/calib3d.hpp>
namespace lmars {
VisualOdometry::VisualOdometry()
:state_(INITIALIZING),ref_(nullptr),curr_(nullptr),map_(new Map),num_lost_(0),num_inliners_(0)
{
num_of_features_ = Config::get<int> ( "number_of_features" );
sc... | TOOL | 0.933935 | 6.068567 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-08-12T03:54: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": "03a47d2786... |
3c78f983-0398-44bb-ad00-124f15558be4 | iamshm/myCppPractice | 450qstns/02matrix/37.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define mod 1000000007
#define inf 1e18
void shm() {
#ifndef ONLINE_JUDGE
freopen("D:\\cpp\\input.txt", "r", stdin);
freopen("D:\\cpp\\output.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
vector<int> spiralTravers... | ALGO | 0.999995 | 3.726121 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2021-02-03T18:57: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": "b934950aec0... |
49753aaa-c04c-4baf-943d-0646edc0b445 | param0037/backup_1 | srcs/cv/Gaussian filter/Gaussian_Filter.h | #pragma once
#include "Gaussian_Filter.cuh"
#include "../cv_classes/cv_classes.h"
static
void Gaussian_vec_gen(float *arr,
const int __radius,
const double __sigma,
const int len)
{
float res = 0, sum = 0;
const double tmp = 2 * __sigma * __sigma;
double x_axis = 0;
for (int i = 0; i... | ALGO | 0.984978 | 3.134801 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2021-11-16T15:18:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6b129190... |
a9b23bbc-c03c-4750-a02b-e089e0a73aae | alexandraback/datacollection | solutions_5658282861527040_1/C++/cjqcjq/b.cpp | #include <stdint.h>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
using namespace std;
int64_t Solve(int32_t a, int32_t b, int32_t k, int32_t idx) {
for (int32_t i = idx; i >= 0; i--) {
if ((1 << i) & k) {
if (!((1 << i) & a) || !((1 ... | ALGO | 0.999949 | 4.903328 | {
"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": "bb2d89e7f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.