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 |
|---|---|---|---|---|---|---|---|
8d9085eb-17c5-4d25-b01b-26c6c6edb2b1 | Vishu-hp/FJP-DSA | Level 2/Recursion And Backtracking/friendsPairing2.cpp | // FRIENDS PAIRING (PRINTING ALL CONFIGURATIONS) - BACKTRACKING
#include<bits/stdc++.h>
using namespace std;
int cnt=1;
void solve(int cf,int tf,vector<int>&f,string asf){
if(cf>tf){
cout<<to_string(cnt)+"."+asf<<endl;
cnt++;
return;
}
if(f[cf]==1){
solve(cf+1,tf,f,asf... | ALGO | 0.99993 | 4.854298 | {
"github_metadata": {
"branch": "main",
"commit_count": 338,
"repo_created_at": "2022-08-16T16:00:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6bf5ff7d15... |
1dbe861e-6dac-4f9f-89fa-d9ca005cd1eb | hitesharora1997/Leetcode-c--solution | frequency-of-the-most-frequent-element/main.cpp | // C++ program for the above approach
#include <bits/stdc++.h>
using namespace std;
// Function to find the maximum possible
// frequency of a most frequent element
// after at most K increment operations
void maxFrequency(int arr[], int N, int K)
{
// Sort the input array
sort(arr, arr + N);
int start = 0, end = ... | ALGO | 0.999979 | 6.00946 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-07-01T16:20:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9fb768f7baef... |
7635979b-bc66-45ee-ad6e-5d0ccf81832a | Gumgo/WaveLang | source/compiler/lr_parser.cpp | #include "compiler/lr_parser.h"
#include <limits>
#include <stack>
c_lr_symbol::c_lr_symbol() {
m_index = 0;
m_is_nonterminal = 0;
m_is_nonepsilon = 0;
m_padding = 0;
}
c_lr_symbol::c_lr_symbol(bool terminal, uint16 index) {
m_index = index;
m_is_nonterminal = !terminal;
m_is_nonepsilon = 1;
m_padding = 0;
}... | ALGO | 0.966346 | 7.600201 | {
"github_metadata": {
"branch": "master",
"commit_count": 124,
"repo_created_at": "2015-06-20T06:10:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2a70055... |
4401035e-b5f7-4a37-b7fc-13d4680ff33b | ThugMS/Baekjoon_Solve | 삼성-기념품 수집.cpp | //#include <iostream>
//#include <algorithm>
//#include <vector>
//
//using namespace std;
//
//int dy[4] = { -1,1,0,0 };
//int dx[4] = { 0,0,-1,1 };
//
//char arr[21][21];
//
//
//int T, R, C;
//
//int ans = 0;
//
//void find(int r, int c, int cnt, bool isPur[26], bool isArr[21][21]) {
//
// if (r < 0 || r >= R || c ... | ALGO | 0.999731 | 3.917824 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2022-05-08T16:24: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": "60ced9a84f7... |
96ffb87a-f60a-469e-addf-7c806c0d4374 | Swaraj2259/Semester-2 | dsa_in_c++/dsa_in_c++/arrya.cpp | // #include<iostream>
// using namespace std;
// int main(){
// int arr[5] = {1, 2, 3, 4, 5};
// for (int i=0;i<5;i++){
// cout<<arr[i]<<" ";
// }
// return 0;
// };
// wap take 10 numbers from user and make array and print it and one loop
// int main(){
// int abb[10];
// cout << "En... | ALGO | 0.993524 | 3.295599 | {
"github_metadata": {
"branch": "main",
"commit_count": 236,
"repo_created_at": "2025-01-03T14:38:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2305093a23... |
4f3a0a40-9bae-4849-96c1-1f7e8f966752 | AlekseyKravchuk/cpp | Yandex_Practicum/sprint_07/00_small_experiments/exp_06_01_09_using_iterators_in_algorithms.cpp | #include <algorithm>
#include <iostream>
#include <map>
#include <ostream>
#include <set>
#include <utility>
#include <vector>
using namespace std;
template <typename Iterator>
void PrintRange(Iterator range_begin,
Iterator range_end) {
for (auto it = range_begin; it != range_end; ++it) {
... | ALGO | 0.957298 | 4.126767 | {
"github_metadata": {
"branch": "main",
"commit_count": 505,
"repo_created_at": "2022-08-10T11:17:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c77f6e513... |
d711ddf0-d1a9-4abf-8a29-5dca44fc5b2f | mimibetty/CP-Training- | 2 Online Judge/Codeforce/2023/867 (D3)/A.cpp | /*
link submit:
Note:
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef long double ld;
#define MS(s, n) memset(s, n, sizeof(s))
#define All(v) (v).begin(),(v).end()
#define cntBit __builtin_popcount
#define fi first
#define se second
#define pb push_back... | ALGO | 0.999926 | 3.536778 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-04-12T06:16: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": "c8481b8c408... |
add24466-0db1-46ff-8044-0ef2216c2b06 | hhsdev/huffman-compression | huffman-compression/src/huffman_node.cpp | #include <cmath>
#include "./huffman_node.hpp"
HuffmanNode::HuffmanNode()
: left(nullptr), right(nullptr), frequency(-1), ch(-1), height(0) {}
HuffmanNode::HuffmanNode(unsigned char ch, int frequency)
: left(nullptr), right(nullptr), frequency(frequency), ch(ch), height(0) {}
HuffmanNode::HuffmanNode(Huffma... | ALGO | 0.997407 | 5.572294 | {
"github_metadata": {
"branch": "master",
"commit_count": 107,
"repo_created_at": "2019-09-29T01:28: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": "1ad3b1fc... |
d87c48c5-e51f-442f-8d8d-b4632ed0c564 | it-dieuanh/CompetitiveProgramming_bydieuanh | hackdream_dulich.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int MN = 1e3 + 3;
int n, m, k, dir[MN], l[MN], r[MN], nxt[MN], vis[MN], step = 0, st = 1, st1 = 1;
char a;
signed main() {
ios_base::sync_with_stdio(0); cin.tie(NULL);
cin >> n >> m >> k;
for (int i = 1; i <= n; i++) {
cin >> l[i] >> r[i... | ALGO | 0.999997 | 3.388099 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-02-18T14:20: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": "ee657eed2909... |
f111140b-39a0-457f-917c-6fa9124c31d0 | wwlonno/DS_Algorithm | chap2/majority.cpp | // 2.19 practice
// findmajority_v1 is the recursion version
// findmajority_v2 is the simple version
#include <iostream>
using std::cout;
using std::endl;
int findmajority_v1(int *arr, int size)
{
// this is the base case, in recursion size will 0 or 1
if (size <= 1)
return arr[0];
int len = 0;
for (int i=0; ... | ALGO | 0.999986 | 4.776284 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2015-10-19T09:30:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73e0c4b6e... |
c2e807e1-4f93-491a-8731-58213e535279 | AntiO2/LeetCode | leetcode_cpp/binary-tree/2415_reverse-odd-levels-of-binary-tree.cpp | /**
* @author Anti
* @date 2023-12-15
* @see https://leetcode.cn/problems/reverse-odd-levels-of-binary-tree
*/
#include "fmt/core.h"
#include "gtest/gtest.h"
#include "logger.h"
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* Tre... | ALGO | 0.999964 | 6.491516 | {
"github_metadata": {
"branch": "master",
"commit_count": 258,
"repo_created_at": "2023-09-01T14:55:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad09cd0f... |
03f33dd1-61eb-4660-ae6d-18bb6292f295 | vansh-codes/Complete-Interview-Preparation-GFG | 4_Data-Structures-(Advanced)/6_Sorting/Problems/1_CountInversions.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
// arr[]: Input Array
// N : Size of the Array arr[]
// Function to count inversions in the array.
long long int inversionCount(long long arr[], int n)
{
long long int count =... | ALGO | 0.99986 | 5.819392 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2024-06-06T20:42:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "32513e09af... |
3133a246-4ec0-4f19-8fd0-830716081071 | umeshsuwal/OOP | Assignment 1/qn-4.cpp | // 4.Write a C++program that reads a number and tests whether is it multiple of 5 but not 11
#include <iostream>
using namespace std;
int main() {
int num;
cout << "Enter a Number: ";
cin >> number;
if (num % 5 == 0 && num % 11 != 0) {
cout << num << " is a multiple of 5 but not 11." << e... | TOOL | 0.987927 | 3.926992 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-08-12T23:55:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5f113e995b6... |
69700a09-cd64-4eb4-ac44-def96426fd59 | LeeHyogon/cs- | 백준/Gold/14499. 주사위 굴리기/주사위 굴리기.cc | #include<iostream>
#include<vector>
#include<cstring>
#include<queue>
#include<stack>
#include<algorithm>
#include<string>
#include<cmath>
#include<functional>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define INF 987654321
#define LINF 321321321321
#define MAX 1100
in... | ALGO | 0.999947 | 3.550927 | {
"github_metadata": {
"branch": "main",
"commit_count": 192,
"repo_created_at": "2023-04-18T04:02: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": "49f22f23ae... |
5641a0f5-c67e-4e1f-9aab-fc7e46f869a4 | ernestogo99/faculdade | estrutura de dados em c++/aula10/exercicios aula 10/somat.cpp | #include <iostream>
#include <new>
using namespace std;
struct matriz{
double *v;
int l;
int c;
matriz(int num_linhas,int num_colunas){
cout<<"construtor";
v=new double[num_linhas*num_colunas];
l=num_linhas;
c=num_colunas;
}
~matriz(){
cout<<"destrutor"... | ALGO | 0.964354 | 6.041689 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2023-12-11T16:09:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ea6992a4c... |
f78a26e9-89da-4d72-8f5b-e132e2dfad65 | laijx03/artifact | air-infra/include/air/driver/global_config.h | //-*-c++-*-
//=============================================================================
//
// Copyright (c) Ant Group Co., Ltd
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//=============================================================================
#ifndef AIR_DRIVER_GLOBAL_CONFIG_H
#define AIR... | CONFIG | 0.927738 | 6.733921 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2025-03-25T09:55: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": "bbdde7e2c7b... |
86ad2330-93d0-47f1-8ddf-7e09d508bf4f | apache/mesos | src/files/files.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... | TOOL | 0.966903 | 6.104723 | {
"github_metadata": {
"branch": "master",
"commit_count": 18448,
"repo_created_at": "2013-07-17T07:00:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5328,
"forks": 1676,
"issues": 0,
"pull_requests": 12
},
"file_meta": {
"content_id": "... |
ab37af77-066e-4c4a-8641-fa5358f4b70b | PacktPublishing/The-Modern-Cpp-Challenge | Chapter01/problem_10/main.cpp | #include <iostream>
#include <bitset>
#include <string>
unsigned int gray_encode(unsigned int const num)
{
return num ^ (num >> 1);
}
unsigned int gray_decode(unsigned int gray)
{
for (unsigned int bit = 1U << 31; bit > 1; bit >>= 1)
{
if (gray & bit) gray ^= bit >> 1;
}
return gray;
}
std::stri... | ALGO | 0.992346 | 5.342549 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2018-05-18T11:28:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 326,
"forks": 109,
"issues": 3,
"pull_requests": 2
},
"file_meta": {
"content_id": "7b3b0b... |
10b6e71f-7f7e-4cc6-a9e5-60da304b5c2d | CYL199709/data_structer_cpp | code/02栈和队列/01顺序栈/LinearStack.h | #include <iostream>
using namespace std;
template <class T>
class LinearStack {
public:
LinearStack(int LSMaxSize); //构造函数,创造空栈
~LinearStack(); //析构函数,删除栈
bool IsEmpty(); //栈空返回true,否则false
bool IsFull(); //栈满返回true,不满返回false
int GetElementNumber(); /... | ALGO | 0.996481 | 4.294384 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-05-23T14:27: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": "7ab4f8ea36... |
b8da9cfc-7dc9-44cf-a1a8-0ac228693adb | tdm1223/Algorithm | acmicpc.net/source/1937.cpp | // 1937. 욕심쟁이 판다
// 2019.05.19
// 다이나믹 프로그래밍
#include<iostream>
#include<algorithm>
using namespace std;
int d[500][500]; //d[i][j] : i,j에 판다의 최대 이동횟수 저장
int a[500][500]; // a[i][j] : i,j에 있는 대나무의 양
int dx[4] = { 0,0,1,-1 };
int dy[4] = { 1,-1,0,0 };
int n;
int DFS(int x, int y)
{
if (d[x][y])
{
return d[x][y];
... | ALGO | 0.999957 | 4.218258 | {
"github_metadata": {
"branch": "master",
"commit_count": 864,
"repo_created_at": "2018-08-02T14:16:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "258de9ad... |
566fa548-cb83-452e-9d5c-0130796368e7 | MagisterYodaa/Chudovihe | pervay dz cdelanay v klasse.cpp | НАЧАЛО fraction.cpp НАЧАЛО
#include "fraction.h"
fraction::fraction()
{
this->numerator = 0;
this->denominator = 0;
}
fraction::fraction(const unsigned int num, const unsigned int den)
{
this->numerator = num;
this->denominator = den;
}
fra... | TOOL | 0.910604 | 4.347674 | {
"github_metadata": {
"branch": "main",
"commit_count": 128,
"repo_created_at": "2021-12-13T14:06:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "65068cc6a2... |
988773a0-7878-4463-bb09-24aba6683067 | AndroidBBQ/android10 | frameworks/compile/mclinker/include/mcld/ADT/HashBase.tcc | //===- HashBase.tcc -------------------------------------------------------===//
//
// The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------------------... | TOOL | 0.965873 | 6.851222 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-06-01T12:36:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 204,
"forks": 69,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "c30a9fec3... |
ee5da576-4b05-4675-aad8-bbd6e7732620 | leoagea/AdventOfCode | 2024/day5/part2/main.cpp | #include <iostream>
#include <map>
#include <fstream>
#include <sstream>
#include <vector>
#include <unordered_map>
using namespace std;
int main()
{
ifstream file("../data.txt");
string line;
string mid = "\n";
vector<pair<int, int>> rules;
long long sum = 0;
while(getline(file, line) && !line.empty()){
in... | ALGO | 0.999844 | 4.008574 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2024-12-01T17:52: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": "9376bd28389... |
dc7fdf28-4692-4968-b735-492f786b578d | cse-child/Study_Coding_Test | Study_Coding_Test/Backjoon/골드/2580_스도쿠.cpp | #include <iostream>
#include <string>
#define SIZE 9
using namespace std;
int puzzle[10][10];
int row[10][10];
int col[10][10];
int square[10][10];
int SquareNum(int x, int y)
{
return (x / 3) * 3 + (y / 3);
}
bool DFS(int num)
{
if(num == SIZE*SIZE)
{
for (int i = 0; i < SIZE; i++)
{
for (int j = 0; j <... | ALGO | 0.999883 | 4.939904 | {
"github_metadata": {
"branch": "main",
"commit_count": 206,
"repo_created_at": "2022-09-25T17:39: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": "fbb426ab4c... |
9f6ec610-e3d5-43bb-9b65-7bf84580e115 | ardabbour/omplgp | src/omplgp.cpp | /**
* OMPL global planner implementation.
* Author: <NAME>
* Email: <EMAIL>
* License: MIT
*/
#include <omplgp/omplgp.hpp>
namespace omplgp {
Point2D::Point2D(const double x_coordinate, const double y_coordinate) {
x = x_coordinate;
y = y_coordinate;
}
OMPL2DPlanner::OMPL2DPlanner(const Algorithm algorithm... | ALGO | 0.997825 | 6.667539 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-04-12T00:24: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": "2d1eb3e101... |
3798c1be-11b5-457c-b181-b2b07089199f | RosettaCommons/rosetta | source/src/protocols/membrane/OptimizeProteinEmbeddingMover.cc | // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// (c) Copyright Rosetta Commons Member Institutions.
// (c) This file is part of the Rosetta software suite and is made available under license.
// (c) The Rosetta software is developed by the co... | ALGO | 0.995656 | 5.33251 | {
"github_metadata": {
"branch": "main",
"commit_count": 11737,
"repo_created_at": "2023-11-17T16:42:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 296,
"forks": 100,
"issues": 27,
"pull_requests": 9
},
"file_meta": {
"content_id": "9437... |
8f6b3c1c-ef2c-40fe-a4d0-ca6834960bc6 | CompRD/BroadCRD | src/paths/UnipathCoverageCore.cc | /////////////////////////////////////////////////////////////////////////////
// SOFTWARE COPYRIGHT NOTICE AGREEMENT //
// This software and its documentation are copyright (2006) by the //
// Broad Institute/Massachusetts Institute of Technology. All rights //
// are... | ALGO | 0.992202 | 5.126518 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2015-04-16T17:15:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9b963b759... |
2e0f57ac-94c5-4afd-9bdd-982aef6b978f | lm040466/CodingStudy | Baekjoon/No4963/Solution.cpp | #include <iostream>
#include <string.h> // memset
#include <queue>
using namespace std;
int w, h, count; // w, h 주의
int dx[] = {1, 0, -1, 0, -1, -1, 1, 1};
int dy[] = {0, 1, 0, -1, -1, 1, -1, 1};
int map[51][51];
queue<pair<int, int>> q;
// 초기화
void init()
{
memset(map, 0, sizeof(map));
count = 0;
}
// 탐색
vo... | ALGO | 0.999941 | 4.10414 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2020-06-27T08:31:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e15d23211... |
92a5bfd9-7ce7-4ed9-8291-93274b0daef6 | ishandutta2007/codeforces-a | andr0901/normal/1260/D.cpp | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
//vector string deque break continue
#define forn(i, s, f) for (int i = (int)s; i < (int)f; i++)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define fs first
#define sc second
#define... | ALGO | 0.99995 | 3.863158 | {
"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": "54584ba2d568... |
9634497b-ebbf-4083-b52d-232adb518cd3 | keshav57/ioi-training | IOITC/2009/Library.cpp | #include <algorithm>
#include <iostream>
#include <cstdio>
#include <vector>
#include <cassert>
#define NMAX 40010
#define SQRT 310
using namespace std;
vector<int> lists[SQRT*2];
int next[SQRT*2];
int prev[SQRT*2];
int inc[SQRT*2];
int A[NMAX];
int L,N,st,en;
void print_list(){
int i,j,h,t;
for(i = next[st]; i... | ALGO | 0.999953 | 3.761722 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2014-04-21T06:24:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 93,
"forks": 51,
"issues": 5,
"pull_requests": 1
},
"file_meta": {
"content_id": "028d8dc... |
e84a093c-a78d-437d-80e3-cb7d382e291c | puneet73/Connect4-Mastermind-AI | min_max_connect4.cpp | #include <stdio.h>
#include <iostream>
#include <vector>
#include <limits.h>
#include <array>
#include <sstream>
#include <omp.h>
#include <chrono>
#define min(a,b) (((a) < (b)) ? (a) : (b))
#define max(a,b) (((a) > (b)) ? (a) : (b))
using namespace std;
void printBoard(vector<vector<int>>&);
int userMove();
void m... | ALGO | 0.994555 | 5.303017 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-04-22T02:31: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": "2495bc8e9864... |
0eb69b73-059f-463c-bed3-d7b2ee1af2b2 | s-rifat/Competitve-Programming | Codeforces/Codeforces Round #656 (Div. 3)/E.cpp | #include<bits/stdc++.h>
using namespace std;
int const N = 200009;
vector <int> V[N],ans;
int color[N];
bool cycle = false;
void DFS(int u)
{
color[u] = 1;
for(int i=V[u].size()-1;i>=0;i--)
{
int v = V[u][i];
if(color[v]==0)
DFS(v);
else if(color[v]==1)
cyc... | ALGO | 0.999985 | 3.862356 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2020-06-17T06:42:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "56ade6ed6... |
74888493-08bc-4c54-83a4-ae8761930eb6 | arin17bishwa/myCP_sols | SPOJ/SAMER08F.cpp | //
// Created by bishwajit on 08/12/20.
//
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#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 rge { c... | ALGO | 0.999904 | 4.352922 | {
"github_metadata": {
"branch": "master",
"commit_count": 1067,
"repo_created_at": "2020-10-22T11:52:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a77613... |
948c5c30-da27-4df2-adda-9ca0352a9376 | robotbrigade/mappingRobot | Arduino code/velocityPID/motorStuff.ino | // Things in this file relate to driving the motors.
void setupMotorStuff()
{
// Set up the encoder interrupts
// By default the external interrupts have higher priority than timer interrupts. That is what I want.
attachInterrupt(digitalPinToInterrupt(LEFT_ENCODER_A), leftEncoderInterrupt, CHANGE);
attachI... | TOOL | 0.947108 | 4.574582 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-08-28T14:58: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": "9df49ca0e6... |
035b8e5e-1996-45c7-be01-ff2f15f93e90 | javierborja95/JB_CSC5 | Hmwk/Assignment_1/Gaddis_5thEd_CHap2_Prob13_CBSalesPrice/main.cpp | /*
* File: main.cpp
* Author: <NAME>
* Created on June 20, 2016, 12:27 PM
* Purpose: Circuit Board sale price
*/
//System Libraries
#include <iostream>//Input/ Output Stream Library
using namespace std;//iostream uses the standard namespace
//User LIbraries
//Global Constants
//Function Prototypes
//Execut... | TOOL | 0.941006 | 4.170602 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2016-06-23T19:23: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": "63006848d... |
536b1f70-cce1-4691-8e01-aedf42292567 | whmrtm/Pat-DataStructure | ds-graph3.cpp | #include <iostream>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <queue>
using namespace std;
vector<int> visited;
int Num = 0;
class node{
public:
int value;
node* next = NULL;
};
void Inse(node* N, int value){
node* current = N;
while(current->next != NULL){
current =... | ALGO | 0.999738 | 3.612019 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2015-05-28T22:48: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": "93a1953fc... |
ab93a698-ac57-44a2-ac60-81f3af91a294 | imtiazdeepto/XPSC-solved-Problem | Week-7/Day-4/Minimum_Types.cpp | //
// Solved at:
#include <bits/stdc++.h>
#define Code ios_base::sync_with_stdio(false);
#define By cin.tie(NULL);
#define ImtiazDeepto cout.tie(NULL);
using namespace std;
#define all(x) (x).rbegin(), (x).rend()
#define int long long
#define tc \
int x; \
cin >> x; \
while (x--)
const int N = 1e8;
s... | ALGO | 0.999696 | 3.702338 | {
"github_metadata": {
"branch": "main",
"commit_count": 279,
"repo_created_at": "2024-10-27T12:19: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": "3532cad178... |
6b141394-0e64-4ada-aef3-d70d845447b6 | Bis-kunal09/DSnAlgo-Array | Smallest window in a string containing all the characters of another string - GFG/smallest-window-in-a-string-containing-all-the-characters-of-another-string.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find the smallest window in the string s consisting
//of all the characters of string p.
string smallestWindow (string s, string p)
{
unordered_map<ch... | ALGO | 0.999981 | 5.924618 | {
"github_metadata": {
"branch": "main",
"commit_count": 97,
"repo_created_at": "2022-03-09T06:10:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ed9e9fd2b7... |
6991dc1a-336b-4820-ab4f-3a2421749844 | topology-tool-kit/ttk-paraview | Utilities/VisItBridge/Library/VisItLib/common/utility/BJHash.h | // Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
// Project developers. See the top-level LICENSE file for dates and other
// details. No copyright assignment is required to contribute to VisIt.
// ************************************************************************* //
// ... | ALGO | 0.978759 | 5.971142 | {
"github_metadata": {
"branch": "5.13.0",
"commit_count": 133,
"repo_created_at": "2020-09-16T10:00:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b49a01b... |
3b2e6c9a-609c-4a50-b92a-3928920440cd | goodstudyqaq/ACM | codeforces/1600-1699/1620/G.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const s... | ALGO | 0.999984 | 4.426569 | {
"github_metadata": {
"branch": "main",
"commit_count": 844,
"repo_created_at": "2021-05-25T15:11:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "24cc932fdd... |
a005137f-aafc-4871-940d-03cc9deabebb | ishandutta2007/codeforces-l | ljecll/normal/925/C.cpp | /*
PROG: cf966c
LANG: C++11
_____
.' '.
/ 0 0 \
| ^ |
| \ / |
\ '---' /
'._____.'
*/
#include <bits/stdc++.h>
using namespace std;
template<class T>
void readi(T &x)
{
T input = 0;
bool negative = false;
char c = ' ';
while (c < '-')
{
c = getchar();
}
if (c == '-')
{
ne... | ALGO | 0.99999 | 3.483641 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:17:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b2caf410a21... |
2ce35469-5c24-4fc6-bd55-fa246c18c17f | memset0/vjudge-code | CodeForces/1148H/28044617_AC_1512ms_377196kB.cpp | #include<bits/stdc++.h>
using namespace std;
using i64=long long;
template<class T> inline void read(T &x){
x=0; register char c=getchar(); register bool tr=0;
while(!isdigit(c))tr^=c=='-',c=getchar();
while(isdigit(c))x=x*10+c-'0',c=getchar(); if(tr)x=-x;
}
template<class T> inline void print(T x){
if(x<0)putc... | ALGO | 0.999799 | 3.923235 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-11-05T04:40:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "20a843917... |
28d87e13-89fc-4ae5-964d-c5320c294b34 | ReZeroS/LeetCode | 965.Univalued Binary Tree/test.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.999349 | 6.779669 | {
"github_metadata": {
"branch": "master",
"commit_count": 293,
"repo_created_at": "2018-03-20T05:48: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": "385e5b3a... |
3ee5f0a7-255f-43ba-8251-a6a2f46091f9 | epam/Indigo | core/indigo-core/graph/src/edge_subgraph_enumerator.cpp | /****************************************************************************
* Copyright (C) from 2009 to Present EPAM Systems.
*
* This file is part of Indigo toolkit.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You ma... | ALGO | 0.996632 | 6.802461 | {
"github_metadata": {
"branch": "master",
"commit_count": 5135,
"repo_created_at": "2015-06-16T14:45:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 357,
"forks": 115,
"issues": 565,
"pull_requests": 38
},
"file_meta": {
"content_id": "6... |
e10d61e0-e996-465e-8a04-365a400b6690 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/12/1218/personal_submission/cf479d_mrsuns.cpp | void Solve() {
int n, L, x, y;cin >> n >> L >> x >> y;
vector<int> a(n + 1);
set<int> exist;
for (int i = 1;i <= n;i++) cin >> a[i], exist.insert(a[i]);
set<int> A, B;
for (int i = 1;i <= n;i++) {
int t = a[i] - x;
if (t >= 0) {
A.insert(t);
}
t = a[i]... | ALGO | 0.999964 | 3.822103 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "4ee5... |
ac8591d3-eb12-4bf4-8958-d34c12f7aec4 | a121781699/myStudy | source/EulerIntegral.h | #ifndef EULERINTE
#define EULERINTE
#include"../../source/VectorMath.h"
#include"../../source/Particle.h"
#include"../../source/Box.h"
class EulerIntegral
{
public:
EulerIntegral(int argc, char *argv[])
{
readCmdInfo(&p, &b, argv[1]);
dt_step = _clock.timeScale;
}
void readCmdInfo(Particle **particle, Box **b... | ALGO | 0.994027 | 4.243467 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2021-05-27T02:45:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "073262455... |
b748b84d-aa4f-483a-b8b5-2a52c944f944 | Kamosphere/GraphXwithGPU | cpp_native/edu_ustc_nodb_GPUGraphX_algorithm_shm_PageRank_GPUNativeShm.cpp | #include "edu_ustc_nodb_GPUGraphX_algorithm_shm_PageRank_GPUNativeShm.h"
#include "util/JNIPlugin.h"
#include <sys/mman.h>
#include <fcntl.h>
#include <cerrno>
#include <cstring>
#include <zconf.h>
#include <algorithm>
#include <algo/PageRank/PageRank.h>
#include <unordered_map>
using namespace std;
template <typen... | TOOL | 0.993224 | 5.024137 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2019-04-01T05:05:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4acb909a8... |
2c1de526-e3cc-48fd-8acd-0cf1e74de680 | Johannyjm/c-pro | AOJ/ALDS1/10_b.cpp | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
typedef long long ll;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n;
cin >> n;
vector<int> r(n), c(n);
rep(... | ALGO | 0.999944 | 3.458874 | {
"github_metadata": {
"branch": "main",
"commit_count": 1006,
"repo_created_at": "2019-10-28T00:51:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "1213a4b8c... |
4ea6a50a-2c23-40b5-ae16-479f6b5632dc | marioyc/Online-Judge-Solutions | Timus Online Judge/1557 - Network Attack.cpp | #include <cstdio>
#include <cstring>
#include <vector>
using namespace std;
#define MAXN 2001
#define MAXE 2 * 100000
int E = 0,last[MAXN],nxt[MAXE],to[MAXE];
void add_edge(int u, int v){
to[E] = v; nxt[E] = last[u]; last[u] = E++;
to[E] = u; nxt[E] = last[v]; last[v] = E++;
}
bool visited[MAXN];
vector<in... | ALGO | 0.999797 | 3.689378 | {
"github_metadata": {
"branch": "master",
"commit_count": 364,
"repo_created_at": "2010-09-24T16:07:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 603,
"forks": 359,
"issues": 1,
"pull_requests": 9
},
"file_meta": {
"content_id": "44ab... |
f40c6ed2-50e1-4ac2-9aa1-56ff22fda2f5 | RsynTeam/rsyn-x | x/src/x/nfl/Blockage.h | /* Copyright 2014-2018 Rsyn
*
* 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 wr... | TOOL | 0.909485 | 5.03815 | {
"github_metadata": {
"branch": "master",
"commit_count": 184,
"repo_created_at": "2017-03-19T00:46:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 126,
"forks": 44,
"issues": 7,
"pull_requests": 2
},
"file_meta": {
"content_id": "45285b... |
244afc0f-ceb2-4e51-947d-5b49307b0a20 | Chirag-Shilwant/Peer-to-Peer-Group-Based-File-Sharing-System | tracker/commands.cpp | #include "tracker_header.h"
int createUser(vector<string> inpt){
string user_id = inpt[1];
string passwd = inpt[2];
if(loginCreds.find(user_id) == loginCreds.end()){
loginCreds.insert({user_id, passwd});
}
else{
return -1;
}
return 0;
}
int validateLogin(vector<string> inp... | WEB | 0.963624 | 3.118133 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-10-26T16:18:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e17fd2901d8... |
486cf326-2944-4ce6-a8b2-97a1c9755e3d | tsetimmy/Programming-Puzzles | 2013/qual/c/small/c.cpp | // C++
#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <limits>
#include <queue>
#include <stack>
#include <utility> // pair
// C
#include <stdlib.h> // atoi, qsort
#include <math.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define ullmax std::num... | ALGO | 0.999657 | 4.00681 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2015-02-08T19:55: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": "cf1e05075... |
8d9be8e2-77ce-4d6c-b027-0d5484342df5 | helohuka/mlbb | server/scene/DetourLocalBoundary.cpp | //
// Copyright (c) 2009-2010 <NAME> <EMAIL>
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including c... | ALGO | 0.99384 | 6.074419 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2019-09-02T05:30:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "31905ef... |
9000cad3-8380-4e0a-b2b6-9f2716a56044 | bikramjitdas/Daily-Data-Structure-and-Algorithm | arrays and related/reversing arrays in groups/reversearrayingroup.cpp | /*Given an array arr[] of positive integers of size N. Reverse every sub-array of K group elements.
Input:
The first line of input contains a single integer T denoting the number of test cases. Then T test cases follow. Each test case consist of two lines of input. The first line of each test case consists of an integ... | ALGO | 0.99991 | 4.991586 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-05-03T17:42: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": "7a5eddd51b... |
759b0ccc-607f-4d3a-9268-4dad9a519caf | Tacomies/brainfuck | src/transpiler.cpp | #include <vector>
#include <string>
const char LOOP_START = '[';
const char LOOP_END = ']';
const char POINTER_INCREMENT = '>';
const char POINTER_DECREMENT = '<';
const char BYTE_INCREMENT = '+';
const char BYTE_DECREMENT = '-';
const char OUTPUT_BYTE = '.';
const char INPUT_BYTE = ',';
int match_loop(std::vector<c... | TOOL | 0.994771 | 4.853633 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2024-06-23T19:04:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f97c3140a... |
d9362f74-010e-44c0-a00d-00dfd4da3284 | qqricky/XCPC_Tranning | CFT16D.cpp | #include<bits/stdc++.h>
#define next NEXT
using namespace std;
typedef long long ll;
const int N = 1e5+5;
int head[N],next[N],ver[N],tot,fa[N],a[N];
int Head[N],Next[N],Ver[N],Tot,A[N];
vector<int>mp[N];
int ind[N];
int cnt ;
int val[N];
bool vis[N]={};
void add(int x,int y){
ver[++tot] = y;
next[tot] = head[x];
hea... | ALGO | 0.999917 | 3.75369 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-11-23T06:42:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "516afcba69... |
80fd9151-7579-4716-ace7-a6933962df26 | qhb1001/For-that-dream | Kuangbin/Kuangbin专题五 并查集/qhb2/G_failed.cpp | #include <iostream>
#include <cstdio>
#include <string>
#include <queue>
#include <algorithm>
using namespace std;
const int MAX = 1e4 + 5;
struct Node {
int val, t;
Node(int a = 0, int b = 0): val(a), t(b) {}
bool operator < (const Node b) const {
return val < b.val;
}
}good[MAX], now;
bool cmp... | ALGO | 0.999941 | 3.271969 | {
"github_metadata": {
"branch": "master",
"commit_count": 126,
"repo_created_at": "2018-04-11T00:45:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "181396b2... |
bed38f36-cdf3-43ec-b658-77ec3368e0e2 | BryanValeriano/marathon | codeforces/626div2/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define fr(i,n) _back
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define fi first
#define se second
#define endl '\n'
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
... | ALGO | 0.999182 | 3.333781 | {
"github_metadata": {
"branch": "master",
"commit_count": 188,
"repo_created_at": "2018-07-19T13:13:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8476df0... |
c1febe92-98f4-4fdc-ba34-83a41ff66f47 | Orca0917/Algorithm | BaekjoonOnlineJudge/11873.cpp | #include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int n, m;
while (cin >> n >> m && n && m) {
vector<int> H(m + 1, 0);
int result = 0;
for (i... | ALGO | 0.999971 | 3.462612 | {
"github_metadata": {
"branch": "main",
"commit_count": 826,
"repo_created_at": "2021-12-01T08:06:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "79edd91285... |
c757220f-dc8e-467f-b1ad-30cbec574bd0 | linkumokunn/code_la | CSES/1687.cpp | /*
=============================================================================
/\ \ / /\ |\ /| |===========
/ \ \ / / \ | \ / | |
/ \ \ / / \ | \ / | |
/ \ | / \ | ... | ALGO | 0.999964 | 3.888292 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2021-11-23T02:23:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2fe65a70cb... |
0f41b5c7-eaf5-43cd-b6f8-38a8585a9722 | suraj-iitb/algorithm-identification | BERT/Data_Dump/Insertion/C++/Code/insertion3831025.cpp | #include <iostream>
// #include <bits/stdc++.h>
using namespace std;
void trace(int A[], int N) {
cout << A[0];
for (int i=1; i < N; i++) {
cout << " ";
cout << A[i];
}
cout << endl;
}
void insertionSort(int A[], int N) {
int v;
int j;
for (int i=1; i < N; i++) {
v ... | ALGO | 0.999955 | 5.485625 | {
"github_metadata": {
"branch": "main",
"commit_count": 229,
"repo_created_at": "2020-05-24T06:21:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 10
},
"file_meta": {
"content_id": "3bcc1d703... |
6acd5b8c-ddb1-4a6e-86c5-1ebe68094621 | ishandutta2007/codeforces-f | fruwajacybyk/normal/825/B.cpp | #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORD(i, a, b) for(int i = (a); i >= (b); --i)
#define all(v) (v).begin(),(v).end()
#define PII pair<int,int>
#define st first
#define nd second
#define pb push_back
#define lint long long int
#define VI vector<int>
using namespace std;
t... | ALGO | 0.999578 | 4.199873 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17a49d7c3b0f... |
f94cbe5d-9c39-4e63-b1b2-daf865aa13d0 | AyushOJOD/DSA-codes | Dynamic programming/ninja_training.cpp | #include <bits/stdc++.h>
using namespace std;
// int f(int day, int last, vector<vector<int>> &points, vector<vector<int>> &prev)
// {
// if (prev[day][last] != -1)
// {
// return prev[day][last];
// }
// if (day == 0)
// { // base case
// int maxi = 0;
// for (int i = 0; ... | ALGO | 0.999891 | 4.490799 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2023-11-03T15:45:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e3c97f804c... |
c72ea332-e445-44fb-873a-74fd2eccfbdc | blake6489/DigitalHerbariumOCR | search.h | #include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <cstring>
#include <cstdlib>
using namespace std;
#include "tools/distance.h"
#include "tools/utils.h"
#include "tools/UnsharpConfigs.h"
#include "my_fitness.h"
UnsharpConfigs search(UnsharpConfigs center, vec5 bound, vector <string... | ALGO | 0.996136 | 3.957717 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2010-02-05T22:47:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ba48d418... |
3c404ac6-f4d8-4982-87aa-1420e39e3a84 | ano373/Data-Struture | Doubly Linked List--doc.cpp |
struct double_linked_list_node
{
int dd ;
double_linked_list_node *prev , *next;
};
class double_linked_list
{
private:
double_linked_list_node *first , *last ;
public:
double_linked_list() { first = last = NULL; }
bool is_empty(void) { return first == NULL; }
void insert_first(int data) ;
void insert_last(i... | ALGO | 0.999737 | 3.625501 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2022-11-23T19:16:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f31f6d7a... |
e630ff98-2cf8-40fa-924d-1486bf64981f | krisckk/Cpractice | c practice/FeelingCold/main.cpp | #include <iostream>
#include <set>
#include <vector>
#include <algorithm>
using namespace std;
set<long long> SET;
vector<long long> arrayA;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int testcase;
cin >> testcase;
while(testcase--){
string type;
cin >> type;
i... | ALGO | 0.998968 | 5.053024 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-29T17:02: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": "1e7739c0aedb... |
6dd3ee29-6892-4284-84c3-e2e143a33802 | AhmedAtef07/JavaCompiler | syntax/ParsingTableGenerator.cpp | //
// Created by <NAME> on 123 / 2 / 16.
//
#include "ParsingTableGenerator.h"
ParsingTableGenerator::ParsingTableGenerator(vector<GrammarRule *> rules) {
this->rules = rules;
this->firsts = calculate_firsts();
this->follows = calculate_follows();
generate_indexes();
generate_table();
}
bool Pars... | TOOL | 0.900476 | 5.156531 | {
"github_metadata": {
"branch": "master",
"commit_count": 132,
"repo_created_at": "2016-04-13T23:17:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b8ad83... |
a435757a-ff27-440c-a2c7-bbc68ac57a9a | zegameiro/MEI_UA_1ano | 2ºSemestre/CLE/Projetos/Projeto1/multi_thread/word-count/src/word_count.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <mutex>
#include "utf-8.h"
#include "word_count.h"
#include "globals.h"
extern bool use_atomic;
std::mutex mtx;
using namespace std;
void word_count(const WordCountFlags& flags, const string file_name)
{
int chars = 0, lines = 0, words = 0;... | TOOL | 0.917971 | 5.945352 | {
"github_metadata": {
"branch": "main",
"commit_count": 80,
"repo_created_at": "2025-02-15T16:16: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": "edbac6a45fe... |
48bac5ea-0d68-4121-90af-dae972f2f278 | FlyMachinee/binary-tree | src/AbstractBinaryTree.cpp | #include "AbstractBinaryTree.hpp"
/**
* @brief 删除以p为根节点的二叉树
* @param p 二叉树的根节点地址
*/
template <typename Elem, typename Position>
void BinaryTree::AbstractBinaryTree<Elem, Position>::
delete_tree(Position& p)
{
if (p != null())
{
delete_tree(lchild(p));
delete_tree(rchild(p));
delete_node... | ALGO | 0.991782 | 4.864529 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-09-23T05:50:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd1718d32f32... |
fb588200-9061-4e74-a648-37b8cca2c6c5 | ishandutta2007/codeforces-s | siberian/normal/1709/D.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define pbc push_back
#define pob pop_back()
#define mp make_pair
#define all(a) (a).begin(), (a).end()
#define vin(a) for (auto& i : a) cin >> i
// mt19937 rnd(chrono::steady_clock::now().tim... | ALGO | 0.999852 | 3.633446 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07: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": "836ddc31105d... |
02034800-9ac0-4dc6-84ec-37b2bd1cb7c8 | HelmiB/Competitive-Programming | E_Chocolate_Bar.cpp | #include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
const long double EPS = 1e-14;
const int maxn = 100500;
const int mod = 1e9 + 7;
long long dp[35][35][55];
long long solve(int n, int m, int k){
if(n > m) swap(n, m);
if(!k || k == n * m) return 0;
... | ALGO | 0.999967 | 4.908247 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2020-02-13T14:22:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ddb33b614... |
554b546d-0ec3-43c1-8cf3-b623a8a62053 | zhangyy103/cpp_study_project | MySTL/include/myLinkedlist.h | #pragma once
#include<iostream>
using namespace std;
#include<string>
class myNode {
public:
string n;
myNode* next = nullptr;
myNode(string str = "") { this->n = str; }
};
class myLinkedlist {
public:
typedef char* iterator;
myLinkedlist() {
head = new myNode();
tail = head;
}
~myLinkedlist() {
myNode*... | TOOL | 0.991547 | 3.726148 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-06-17T13:11:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7bcc291a4... |
9ae1058c-0281-436e-9cf0-72e8884bfc7f | AhmedMabrouk22/Competitive-Programming | Codeforces/Div2-C/C. Basketball Exercise.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<unordered_map>
#define endl "\n"
#define Ceil(x,y) ((x+y-1)/y)
#define clr(arr, x) memset(arr, x, sizeof arr)
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define rt(s) return cout<<s,0
#define watch(x) cout<<(#x)<<" = "<<x<<endl
#... | ALGO | 0.999994 | 3.775823 | {
"github_metadata": {
"branch": "main",
"commit_count": 159,
"repo_created_at": "2022-05-20T13: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": "d682efb50d... |
6e076d41-3a92-47c7-a236-b6ba3ad82b75 | rose839/Algorithms | Queue/LFRingQueue.h | #ifndef LFRINGQUEUE_H
#define LFRINGQUEUE_H
/* Lock free ring queue */
#include <mutex>
#include <atomic>
#include <chrono>
template <typename _TyData, long _lCount = 100000>
class LFRingQueue {
public:
LFRingQueue(long lCount = _lCount) :
m_lHeadIterator(0), m_lTailIterator(0), m_lCount(lCount) {
m_queue = ne... | TOOL | 0.929435 | 6.296891 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2019-07-23T12:09: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": "7eff8e9c2... |
c1249d33-2612-4187-a8e2-75a17e895606 | Abel-Tessema/Data-Structures-and-Algorithms | New folder/Binary Tree[Edited]/Binary Tree/BinaryTree.hpp | //
// Created by <NAME> on 2/11/2024.
// Edited by Pyankie.
//
#ifndef BINARYTREE_HPP
#define BINARYTREE_HPP
#include <memory>
#include <iostream>
using namespace std;
template <class T>
class BinaryTree {
private:
struct Node {
using smartNodePointer = shared_ptr<Node>; // Modern way of defining alias... | ALGO | 0.999746 | 7.211264 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-08-18T11:25: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": "302536e0fabe... |
94388c13-80f4-4663-b496-8c0658e8f048 | jerry7991/Competitive-Programming-Lib | Target LeetdCode 200/trap.cpp | #include <bits/stdc++.h>
using namespace std;
int trap(vector<int>& height) {
int n = height.size();
vector<int> leftMax(n + 1), rightMax(n + 1);
leftMax[0] = 0, rightMax[n] = 0;
for (int i = 1; i <= n; i++) {
leftMax[i] = max(leftMax[i - 1], height[i - 1]);
rightMax[n - i] = max(rightM... | ALGO | 0.999987 | 5.646289 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-10-15T07:46:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58eec9bcf... |
7f7a5ca1-af66-4be1-a40b-df1b9a70f499 | cdh981009/Algorithm | codeforces/767/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 1e9
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FOR_(i, a, b) for (int i = (a); i <= (b); ++i)
using ll = long long;
using pii = pair<int, int>;
constexpr int N = 1e5;
int ans;
string str[N];
int n;
int main() {
#ifndef ONLINE_JUDGE
fr... | ALGO | 0.999841 | 4.530157 | {
"github_metadata": {
"branch": "master",
"commit_count": 850,
"repo_created_at": "2020-02-16T08:17:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e722f13... |
592ed8fb-c709-48ff-84ca-46595858d02f | sebas095/Competitive-Programming | Codeforces/Educational Round 1/Chocolate Bar.cpp | #include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL)
#define endl '\n'
#define inf 1000000000
using namespace std;
int memo[31][31][51];
int DP(int n, int m, int k){
if( k == 0 || k == n*m) return 0;
if(memo[n][m][k] != -1) return memo[n][m][k];
int ans = inf;
// Elegir el costo... | ALGO | 0.999962 | 4.177599 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2015-10-30T03:19: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": "58998998... |
e849e970-8290-4b8f-a4ba-f0cc894f4608 | rnbguy/MCSV17 | SAT/codes/clause.cpp | #include <minisat/core/Dimacs.h>
#include <minisat/core/Solver.h>
#include <zlib.h>
#include <iostream>
using namespace Minisat;
int main(int argc, char** argv) {
// create Solver
Solver S;
gzFile gf;
if(argc == 1) {
// no argument given, will read from STDIN
gf = gzdopen(0, "rb");
} else {
/... | ALGO | 0.99785 | 5.323274 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-01-19T09:32: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": "76037724d2... |
bc037449-6d5a-4b3e-90ff-502b2efe6eaf | HassanChowdhry/competitive-programming | CSES/Range_Queries/Range-Update-Queries/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define fs first
#define sc second
#define all(a) a.begin(),a.end()
#define mod(num, n) (num % n + n) % n
#define flash ios_base::sync_with_stdio(false);cin.tie(NULL)
#define test int t;cin>>t;while(t--)
#define rep(i,n) for(int ... | ALGO | 0.999929 | 4.718561 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2024-10-06T03:29:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2fa6ecee137... |
a656c122-e550-4852-83b3-3844a6976731 | ishandutta2007/codeforces-d | dj3500/normal/60/B.cpp | #include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <cmath>
#include <algorithm>
using namespace std;
#define pb push_back
#define INF (int)1e9
#define FOR(i,n) for(int (i)=0;(i)<(n);++(i))
#define FORI(i,n) for(int (i)=1;(i)<=(n);++(i))
#def... | ALGO | 0.999529 | 3.72523 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "625e08dfb8c5... |
7d536727-bfb8-40d0-acf6-21f612fccfed | d4n0f/projektmunkak | C++/pattogo_labda/pattogo_labda.cpp | // Fordítás: g++ pattogo_labda.cpp -o pattogo
// Futtatás: ./pattogo
#include <iostream>
#include <thread>
#include <chrono>
#include <ctime>
using namespace std;
//globális változók
int szelesseg = 30;
int magassag = 50;
int xpoz = szelesseg / 2;
int ypoz = magassag / 2;
void keret()
{
for (int x = 0; x <= sze... | TOOL | 0.956824 | 4.457688 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-02-01T21:00: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": "a5acec1fd00b... |
0db9bbf4-d58d-4286-9a72-ed4a5090c19a | yuenshome/yuenshome.github.io | resource/cpp/primer-ppt/class7_code/23_list_sort_1.cpp | ///虚函数 + 运行时类型识别
#include <iostream>
#include <cstring>
#include <string>
#include <cassert>
#include <typeinfo>
using namespace std;
class Obj { //基类
public:
virtual ~Obj() = default;
virtual void print()const = 0;
virtual Obj *clone()const = 0; //虚clone
virtual bool operator<(const Obj&)const = 0;
};
class IntOb... | TOOL | 0.998837 | 5.067091 | {
"github_metadata": {
"branch": "master",
"commit_count": 556,
"repo_created_at": "2017-11-04T02:12:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 86,
"forks": 15,
"issues": 140,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8233... |
1c81f0df-91de-40ae-94c1-8b18294dc14b | wangtongxue-369/xcpc_Code_file | file/qoj/icpc网络赛24_9_15/F/FC.cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
const int N = 2e5 + 5;
int a[N], l[N], r[N];
void solve()
{
int n;
cin >> n;
for (int i = 1; i <= n; i++)
{
cin >> a[i];
}
stack<int> st;
for (int i = 1; i <= n; i++)
{
if (st.empty() || a[i] < a[st.to... | ALGO | 0.999838 | 4.980514 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-02-24T09:13:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9ff5fece71... |
d99eb05c-a9d7-4924-ad47-447be27ca65f | aylax/cspj_questions | solutions/solutions.cc/concurrent/birthday.cc | // --------------------------------------------------------
// File: 一起送上生日祝福
// Require: __cplusplus >= 201402
// --------------------------------------------------------
// Author: zbye
// --------------------------------------------------------
#include <iostream>
#include <string>
#include <thread>
#include <vector... | TOOL | 0.997883 | 5.523355 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2023-12-07T03:41: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": "2837baa39... |
6d01befa-94b7-408a-aaaf-3fb716ff3165 | liuhhaiffeng/TheCppStandardLibrary_v2_SourceCode_LiuHaiFeng_NoteVersion2 | algo/简单的/count1_lhf.cpp | /* The following code example is taken from the book
* "The C++ Standard Library - A Tutorial and Reference, 2nd Edition"
* by <NAME>, Addison-Wesley, 2012
*
* (C) Copyright <NAME> 2012.
* Permission to copy, use, modify, sell and distribute this software
* is granted provided this copyright notice appears in all... | ALGO | 0.983507 | 4.516552 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-01-24T07:09:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "430d58a72f... |
fc3839f9-a852-460b-8155-6913ff1a53c3 | tiwason/practice | LinkedList/circularLL/splitCLLinTwo.cpp | #include <iostream>
using namespace std;
struct Node
{
int data;
Node* next;
};
void printLinkedList(Node* head)
{
Node* temp = head;
do
{
cout << temp->data << " -> ";
temp = temp->next;
}while(temp != head);
cout <<head->data <<endl;
}
void push(Node** head_ref, int da... | ALGO | 0.999953 | 5.099511 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-11-25T05:26: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": "dd747cdb4f... |
a8aa0fb2-e328-4965-894a-590c5f02c540 | Cattle0Horse/algorithm-problem | leetcode/leetcode_994.cpp | /**
* @file leetcode_994.cpp
* @author Cattle_Horse (<EMAIL>)
* @brief https://leetcode.cn/problems/rotting-oranges/description/?envType=daily-question&envId=2024-05-13
* @version 0.1
* @date 2024-05-13
*
* @copyright Copyright (c) 2024
*
*/
#include <queue>
#include <utility>
#include <vector>
using namespac... | ALGO | 0.999949 | 5.840639 | {
"github_metadata": {
"branch": "main",
"commit_count": 81,
"repo_created_at": "2024-04-23T11:31:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c0ffc854a7... |
9fa4986b-0bf8-4fad-a78c-c4cc72feb74c | harrySentinel/DSA | Array/ArrayUnion.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<int> findUnion(const vector<int>& nums1, const vector<int>& nums2) {
vector<int> unionResult;
vector<int> nums2Copy = nums2; // Make a copy of nums2 to track used elements
// Add all elements from first array
for (int i = 0; i < nums1.... | ALGO | 0.999736 | 6.251327 | {
"github_metadata": {
"branch": "main",
"commit_count": 238,
"repo_created_at": "2025-01-28T17:14: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": "19b9080118... |
c235470b-3c64-42ed-9d3c-c76543a0f8e9 | AyeshaNoor6/DSA | double ended queue functions.cpp | //#include <iostream>
//using namespace std;
//
//class Deque {
//private:
// int* dequeArr;
// int maxSize;
// int front;
// int rear;
// int size;
//
//public:
// Deque(int capacity) {
// maxSize = capacity;
// dequeArr = new int[maxSize];
// front = -1;
// rear = 0;
// size = 0;
// }
//
// ~Deque()
// {
// del... | ALGO | 0.946219 | 5.303794 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-09-03T15:59:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f29c5b5292b... |
4c84b864-7121-4dfd-bb62-88f0ab287fb5 | Stachnikov/Studia-II-UWR | C++/zad6/wyrazenie.cpp | #include "definitions.hpp"
Liczba :: Liczba(double liczb){
priorytet=5;
wartosc=liczb;
}
double Liczba :: oblicz(){
return this->wartosc;
}
std::string Liczba :: opis(){
std::ostringstream strs;
strs << wartosc;
std::string str = strs.str();
return str;
}
Stala :: Stala(){
priorytet=5;
wartosc=0;
nazwa=""... | TOOL | 0.962048 | 3.894536 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2019-04-22T20:58:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92c4f10d1... |
0b1385b4-68ba-4cbb-abe0-de0342f062af | GYPpro/ACM | 1_Contests/CF920.3/C_Sending_Messages.cpp | #define _USE_IOSTREAM_
// #define _PRIV_TEST_
#ifndef _USE_IOSTREAM_
#define _USE_STDIO_
#endif
#ifdef _USE_IOSTREAM_
#include <iostream>
#endif
#ifdef _USE_STDIO_
#include <stdio.h>
#endif
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <vector>
#include <ma... | ALGO | 0.999477 | 3.961971 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-10-29T07:31:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7316a90210... |
e51935e1-5d84-4322-89e3-909966f2b6be | YOGDEV/DAA | CycleDetectionUsingBFS.cpp | #include<bits/stdc++.h>
#include<vector>
using namespace std;
class Sol
{
public:
bool CheckForCycle(int s,int v,vector<int> adj[],vector<int>& visited)
{
queue<pair<int,int>> q;
visited[s]=true;
q.push({s,-1});
while(!q.empty()){
int node=q.front().first;
int par=q.front().second;
q.pop();
... | ALGO | 0.99997 | 5.037865 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-05-24T08:54:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d1427cb6a43... |
53b5b407-a700-4541-ade2-7f81dfe6870d | shazilkp/leetcode-solutions | 0165.cpp | class Solution {
public:
int compareVersion(string version1, string version2) {
int l1 = version1.length();
int l2 = version2.length();
int c1 = count(version1.begin(),version1.end(),'.');
int c2 = count(version2.begin(),version2.end(),'.');
int k = -1;
int j;
... | ALGO | 0.999658 | 5.357325 | {
"github_metadata": {
"branch": "main",
"commit_count": 114,
"repo_created_at": "2025-05-02T09:28: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": "5d0ca3ab22... |
d35c2b0f-840e-4677-8384-add42dfcb4e1 | LoveTheCoder/python-arcade-game | Test/Claude/q8/linked_list.cpp | #include <iostream>
struct Node {
int data;
Node* next;
Node(int d) : data(d), next(nullptr) {}
};
Node* insertAtTail(Node* head, int data) {
Node* newNode = new Node(data);
if (head == nullptr) {
return newNode;
}
Node* current = head;
while (current->next != nullptr... | ALGO | 0.998347 | 6.263419 | {
"github_metadata": {
"branch": "main",
"commit_count": 106,
"repo_created_at": "2024-11-05T15:16:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe60463cab... |
826edfa2-1098-4d07-8356-f03d9d40f6bf | crackersamdjam/DMOJ-Solutions | CCO/cco01p6.cpp | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
const int MM = 105;
template <class _FlowUnit> struct FlowEdge {
using FlowUnit = _FlowUnit; int to, rev; FlowUnit cap, resCap;
FlowEdge(int to, int rev, FlowUnit cap)
: to(to), rev(rev), cap(cap), resCap(cap) {}
};
template <cla... | ALGO | 0.999565 | 3.667034 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2021-08-08T18:36: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": "9d6cd297f... |
6d354094-c3e7-448f-8e16-060bf84f7e8a | surajgate/Assignments | C++/Assign5/Assign5.cpp | #include "Assign5.h"
#include <iostream>
using namespace std;
double compute(Loan* l)
{
return l->EMI();
}
double taxcompute(Loan* l)
{
double rate;
auto tax = dynamic_cast<Taxable*>(l);
auto tax1 = dynamic_cast<Discountable*>(l);
if(tax)
rate = tax->GST();
if(tax1)
rate = tax1->Discount();
return l-... | ALGO | 0.946063 | 3.900753 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-10-23T11:23: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": "d120f2c6487... |
85e680e5-8be7-45aa-8353-11c804d1e0c6 | piyush-qumar/datastructalgo | c++/pattnet.cpp | #include <bits/stdc++.h>
using namespace std;
char findL(string s)
{
char l = 'Z';
for (char x : s)
{
if (x <= l)
{
l = x;
}
}
return l;
}
int main()
{
int n;
cin >> n;
vector<string> s(n);
for (int i = 0; i < n; i++)
{
cin >> s[i... | ALGO | 0.999959 | 3.304389 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2022-10-07T19:14:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5eac91dd69a... |
3143f2cc-7faa-4432-964a-d14fcca60766 | HaiZeizhouyuan/HZOJ | 566.cpp | /*************************************************************************
> File Name: 566.cpp
> Author: zhouyuan
> Mail:
> Created Time: 2020年08月24日 星期一 18时58分26秒
************************************************************************/
#include<iostream>
#include<map>
using namespace std;
int n, m, ans;
stri... | ALGO | 0.999851 | 3.453902 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2020-06-24T02:31: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": "85497cba2... |
f9d7892d-9ddb-40c2-a0dc-a34dab0e1406 | IrtazaTanveer19/Wolfram-Alpha-2.0 | Wolfram Alpha 2.0/Integration.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int input;
//generates numerical values for the function the user chooses
double numerical_value(double x, int* input) {
double function; //numerical function values are returned into this variable
if(*input == 1)
function = x*x;
e... | ALGO | 0.960066 | 4.205369 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-06-26T07:26: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": "72276819c541... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.