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 |
|---|---|---|---|---|---|---|---|
664d97a9-eaf3-4250-bbac-26953ec25c25 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/04/0412/personal_submission/cf916c_WanderOvO.cpp | /*
连一条链,然后再加多余的边,链上的边权尽可能小,多余的边的边权尽可能大
如果 n - 1 是素数,则全都连 1 就行,其他的边连特别大的
如果 n - 1 是合数,则找 >= n - 1 的最大素数 p,(n - 1, n) 连 p - n + 2
其他边连无穷大
*/
void solve1() {
get_prime();
cin >> n >> m;
int pos = lower_bound(prime, prime + cnt, n - 1) - prime;
int p = prime[pos];
cout << p << " " << p << "\n";
for... | ALGO | 0.999464 | 3.263109 | {
"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": "70dd... |
7c26aeb6-7f5f-494a-8d1d-e2ab9778963b | KarlsruheMIS/KaMIS | mmwis/extern/struction/app/cyclic_blow_up_convergency.cpp | //
// Created by alex on 25.05.20.
//
/**
* reduction_evomis.cpp
* Purpose: Main program for the evolutionary algorithm.
*
******************************************************************************
* Copyright (C) 2015-2017 <NAME> <<EMAIL>>
*
* This program is free software: you can redistribute it and/or m... | ALGO | 0.99335 | 4.217504 | {
"github_metadata": {
"branch": "master",
"commit_count": 139,
"repo_created_at": "2015-10-19T11:21:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 78,
"forks": 29,
"issues": 7,
"pull_requests": 1
},
"file_meta": {
"content_id": "31468eb... |
2cee9f17-e6a6-4d42-8a8e-fabfb2096e57 | Ahmed-Aladdiin/Problem-Solving | codeforces/same_parity_summands/c.cpp | #include <iostream>
using namespace std;
void solve() {
int n, k;
cin >> n >> k;
if (k > n) {
cout << "NO\n";
return;
}
if ((n - k)%2 == 0) {
cout << "YES\n";
for (int i = 0; i < k - 1; i ++) {
cout << "1 ";
}
cout << 1 + n - k << endl;
} else if (2*k <= n && (n - 2*k) % 2 ... | ALGO | 0.999859 | 3.847794 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2024-06-20T12:29:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dbb357c6d6d... |
13606cb6-210f-4fa0-9926-1b77a029a451 | jd-opensource/dtc | src/core/tree/t_tree.h | /*
* Copyright [2021] JD.com, Inc.
*
* 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 wri... | ALGO | 0.968555 | 4.287099 | {
"github_metadata": {
"branch": "master",
"commit_count": 186,
"repo_created_at": "2021-08-22T13:52:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 32,
"forks": 11,
"issues": 20,
"pull_requests": 0
},
"file_meta": {
"content_id": "26ed3c... |
2e76e5b6-fae3-450a-843d-8c75fdc34ce7 | ZAHERSKIY/pp_2020_autumn_engineer-1 | modules/task_2/ognev_d_matrix_vector_vertical_multiplication/multiplication.cpp | // Copyright 2020 <NAME>
#include "../../modules/task_2/ognev_d_matrix_vector_vertical_multiplication/multiplication.h"
#include <mpi.h>
#include <random>
#include <ctime>
int* getRandomMatrix(int rows, int columns) {
if (rows < 1 || columns < 1) {
throw "Number of rows or columns can't be less than 1";
}
s... | ALGO | 0.999385 | 4.906595 | {
"github_metadata": {
"branch": "master",
"commit_count": 1448,
"repo_created_at": "2021-02-13T06:54:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc21caf... |
8dfc2f35-d48c-435a-ad77-8afe9ffe1ac9 | xSeanliux/CompetitiveProgramming | CF/1027D/1027D.cpp | #include <iostream>
#include <vector>
#define ericxiao ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
const int maxN = 2e5 + 10;
vector<int> go, cost, ord;
vector<bool> visited;
int n, a, b, ans = 0;
void dfs(int x){
visited[x] = true;
if(go[x] == x){
ans += cost[x];
return;
... | ALGO | 0.999913 | 3.262787 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2018-11-18T06:45: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": "aab37b2aa... |
1ab111be-9f1f-4bb4-a05b-8854e8a2517d | flakelolz/dsa | cpp/structures/HashTable.cpp | #include <iostream>
#include <string>
#include <unordered_map>
#include <vector>
class Node {
public:
std::string key;
int value;
Node* next;
Node(std::string key, int value) {
this->key = key;
this->value = value;
next = nullptr;
}
};
class HashTable {
private:
static const int SIZE = 7;
... | ALGO | 0.997998 | 6.612055 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-06-01T05:31:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "afaddada0b2... |
9a7060bb-c0f6-4573-9943-91bd468be2ea | Titiuu/leetcode | src/15.cpp | #include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <stdlib.h>
#include <algorithm>
#include <map>
#include <regex>
using namespace std;
class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
vector<vector<int>> ans;
if(nums.size()<3) return ans;... | ALGO | 0.999906 | 5.140594 | {
"github_metadata": {
"branch": "main",
"commit_count": 153,
"repo_created_at": "2021-06-25T12:39:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "42da3bb8df... |
5bb30cff-1330-4642-a918-d65dae303570 | arafatmisbawebdeveloper/ProblemSolutionForCodeforcses | HauntedHouse.cpp | #include<bits/stdc++.h> //
using namespace std;
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl '\n'
#define OR ||
typedef double dl;
typedef long long ll;
const int mx = 1e5+123;
ll dp[mx];
void solve()
{
int n;
cin>>n;
string s;
cin>>s;
reverse(s.begin(),s.... | ALGO | 0.999895 | 3.876536 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-01-24T13:24: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": "2e5454655338... |
f815190a-5990-4a49-9a3e-f6fb5c85e669 | maria2021831011/codefilecpp | dequeuspoj.cpp | #include <bits/stdc++.h>
using namespace std;
struct Query {
int l, r, i;
};
int block;
int v[30001];
int ans[200001];
int freq[1000001];
Query q[200001];
bool compare(Query x, Query y) {
if (x.l / block != y.l / block)
return x.l / block < y.l / block;
return x.r < y.r;
}
void queryResults(int ... | ALGO | 0.99998 | 4.77847 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-06-11T05:17:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f37133e0d9... |
93d45620-2226-4a73-9b36-e981944230a3 | Luckyblock233/OI-code | Luogu/P2341 [HAOI2006]受欢迎的牛.cpp | //知识点:Tarjan/强连通分量/缩点/topsort
/*
简略的题意:
求 被所有其他点直接/间接相连
的点的数量
分析题意:
可知:
用Tarjan缩点 ,
求得各强连通分量后
如果仅存在一个
出度为0的强连通分量
那么该强连通分量的元素个数
即答案要求
正确性证明:
如果存在多个出度为0的分量
则这些分量
缺少它们之中其他分量的相连
故不能满足题目要求:
被所有其他分量直接/间接相连
*/
#include<cstdio>
#include<stack>
#include<ctype.h>
#include<cstring>
#define min(a,b) a<b?a:b //懒得写al... | ALGO | 0.999935 | 4.18028 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-10-16T07:13:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a6149381eb... |
f69ff0c2-92ea-4613-aeb4-54be0cefe1cd | vive6271/Problems-Solved | Data Structures in C++/4.Recursion 2/RecursionPrintAllCodes.cpp | /*
Q. Print all Codes - String
Assume that the value of a = 1, b = 2, c = 3, ... , z = 26. You are given a numeric string S.
Write a program to print the list of all possible codes that can be generated from the given string.
Note : The order of codes are not important. Just print them in different lines.
Sample I... | ALGO | 0.999617 | 3.997582 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-01-27T16:58:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "42905ec68e18... |
863f21c9-5d88-43b1-9c0b-7c6c270b9613 | rlj1202/problemsolving | baekjoon/9253/main.cpp | #include <cstdio>
using namespace std;
char A[200005];
char B[200005];
char C[200005];
int pi[200005];
bool search(char *str, char *key) {
int j = 0;
for (int i = 0; str[i] != 0; i++) {
while (j && str[i] != key[j]) j = pi[j - 1];
if (str[i] == key[j]) {
if (key[j + 1] == 0) {
... | ALGO | 0.999979 | 3.738959 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2019-05-12T13:03: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": "73cf355c8b8... |
a9add814-2984-4365-b995-f15624d9eaf6 | DavidBertet/school-projects | chess/src/pieces/piece_move_visitor.cc | #include "piece_move_visitor.hh"
#include "use_listener.hh"
#include "move_error.hh"
#include "move.hh"
#include "queen.hh"
#include "king.hh"
#include "pawn.hh"
#include "rook.hh"
#include "bishop.hh"
#include "knight.hh"
PieceMoveVisitor::PieceMoveVisitor (const Move& move)
: move_ (move)
{
}
void
PieceMoveVisi... | TOOL | 0.930455 | 5.836998 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-12-01T00:10: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": "2a56810af495... |
1e21758a-fd31-4bbe-b2c2-6c5ba18ea356 | rsln-s/aggregative-coarsening-for-multilevel-hypergraph-partitioning | packages/stk/stk_unit_test_utils/algorithmTimer.hpp | #ifndef UNITTESTUTILS_ALGORITHM_TIMER
#define UNITTESTUTILS_ALGORITHM_TIMER
#include <stk_util/parallel/Parallel.hpp>
#include <stk_util/environment/CPUTime.hpp>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <stddef.h>
namespace unitTestUtils
{
struct RunInfo
{
RunInfo() : mean(0.0), max(0.0),... | TEST | 0.943495 | 6.654238 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-04-04T20:05:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "275bcf7824... |
98d5bc66-f6cf-464b-ab36-417b86f75439 | trivedip/Basic-Algorithms | cpp/driver.cpp | // Driver.cpp || Cpp file to act as driver for sorting algorithms, integrates STL vector utility & STL vector sorting algorithms
// IN: utility.h | utility.cpp, sort.h | sort.cpp
// OUT: Display
// Meta Info: <NAME> - 20/9/2019
#include <iostream>
#ifndef vector_utility
#include "utility.h"
#endif
#ifndef vector_s... | ALGO | 0.997777 | 3.000615 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2019-09-23T15:39: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": "1c22a3a39... |
b13ff6de-a061-42e2-898a-bfb311b9e383 | shirgho/dsAa_old | lists/linkedlists.cpp |
/* linked list scene
Mathematically, a list (L) is a sequence of zero or more elements of a given type.
END(L) : returns the position
1. INSERT(x, p, L) : insert x at p in L
2. LOCATE(x,L) : return p
3. RETRIEVE(p, L) : return x at p
4. DELETE(p, L) : remove x at p
5. NEXT(p, L) and PREVIOUS(p, L)
6. MAKENULL(L) ... | ALGO | 0.989689 | 5.213449 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2021-08-04T13:31:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "26bcb952b1b... |
864e51b9-855f-45df-9782-9783510d7bcf | nachiketkanore/Codeforces-Solved-Problems | 1374_C.cpp | #include <bits/stdc++.h>
using namespace std;
#define sz(x) (int)(x.size())
#define FOR(x,y,z) for(int x = y; x <= z; x++)
#define int long long
const int N = 1e5 + 2, inf = 1e18;
void solve();
int32_t main(){
ios::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
#ifndef ONLINE_JUDGE
freope... | ALGO | 0.999344 | 4.461196 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-06-03T14:49: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": "e06f619fc6... |
4ad559b3-4743-4bbb-bb43-95a1ded73c03 | KaranBararwal/PW | Lec86_Adjacancy_list.cpp | #include<iostream>
#include<vector>
#include<list>
using namespace std;
vector <list <int> > graph;
int v; // no. of vertices
void add_edge( int src , int dest , bool bi_dir = true){
// adding destination value at src index in array
graph[src].push_back(dest);
if(bi_dir){ // then destination also have di... | ALGO | 0.9998 | 5.335477 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-07-13T13:59: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": "49668048d69... |
f6bbfd3e-1129-41f6-8290-e73bfadad97e | chiragyadav916/GeeksforGeeks | Medium/Find missing in second array/find-missing-in-second-array.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
vector<int> findMissing(int a[], int b[], int n, int m)
{
// Your code goes here
unordered_set<int> b_vals(b, b + m);
// Create a vector to store missing elements
... | ALGO | 0.999929 | 5.196108 | {
"github_metadata": {
"branch": "main",
"commit_count": 597,
"repo_created_at": "2024-03-13T16:03: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": "3d94af796e... |
076a1e02-d3eb-4bb6-9bd3-fa9c5e70a276 | pragun-bansal/linked-list | linked_list_classes.cpp | #include<bits/stdc++.h>
#define LL long long
#define F first
#define S second
#define PB push_back
#define MP make_pai
using namespace std;
class Node{
public:
int data;
Node* next;
void Display(Node *p);
void RDisplay(Node *p);
void RReverseDisplay(Node *p);
void create(int A[], int n);
v... | ALGO | 0.999962 | 3.960494 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-06-12T11:16: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": "3998e043d5... |
2c0efc4e-5daa-4bc8-abb5-b61a04f77f57 | BongoJuniorrr/CP-Code | SAMAC.cpp |
//"----------------------------------------------------------------------------------------"
//"- Author: <NAME>ka BongoJuniorr"
//"- School: Le Quy Don High School for the Gifted"
//"- Date: dd/mm/yyyy"
//"- Problem: "
//"- File: "
//"- I/O File: "
//"------------------------------------------------------------------... | ALGO | 0.999991 | 4.19161 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-12-14T08:28:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d6638bec4780... |
c595944a-f48b-4b12-b643-66dc27aad9b7 | htmaths/Template | codedacode/race.cpp | #include<bits/stdc++.h>
#define file(name) if (fopen(name".inp", "r")) freopen(name".inp", "r", stdin), freopen(name".out", "w", stdout) ;
#define ll long long
#define bit(i , x) ((x >> i) & 1)
#define pb push_back
using namespace std ;
const int maxn = 1e4 + 10 ;
const ll base = 131 ;
const ll MOD = 1e9 + 7 ;
con... | ALGO | 0.999965 | 3.9276 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-02-09T02:56: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": "fb4cb58fd0ad... |
118a78d4-63f6-4247-b997-a7cd0916e024 | Milind-Palaria/milind-X-leetsync | 2280-count-good-triplets-in-an-array/count-good-triplets-in-an-array.cpp | class Solution {
public:
struct BIT {
vector<int> tree;
int n;
BIT(int size) : n(size) {
tree.resize(size+2, 0);
}
void update(int index, int value) {
for (++index; index <= n+1; index += index & -index)
tree[index] += value;
... | ALGO | 0.999956 | 5.700629 | {
"github_metadata": {
"branch": "main",
"commit_count": 306,
"repo_created_at": "2025-03-04T18:32: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": "fe99b0cf20... |
019dbf50-38ea-40c3-b206-6013c6098821 | weiyutang1010/Competitive-Programming | CodeForces/0236/0236A/Boy or Girl.cpp | /*
* author: weiyutang
* <NAME>
*/
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define ii pair<int, int>
#define f first
#define s second
#define endl "\n"
using namespace std;
void solve() {
string s;
cin >> s;
unordered_map<char, bool> m;
int ans = 0;
for (i... | ALGO | 0.999859 | 3.661048 | {
"github_metadata": {
"branch": "master",
"commit_count": 231,
"repo_created_at": "2020-03-23T00:25:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2604fd67... |
2f253b68-3c28-49dc-a362-b4c65a05a7ac | tokumaru-y/CompetitiveCPP | typical90/81_sample.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
vector<int> dx{ 1, 0, -1, 0 };
vector<int> dy{ 0, 1, 0, -1 };
int N,K;
vector<vector<int>>dp(5010,vector<int>(5010,0));
vector<int>A;
vector<int>B;
int ans = 0;
void input() {
cin >> N >> K;
... | ALGO | 0.999838 | 3.547183 | {
"github_metadata": {
"branch": "main",
"commit_count": 185,
"repo_created_at": "2024-07-01T14:30:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b7b8828125... |
a3d0a8ab-014a-4782-b451-dcbfb80b9621 | scottc11/ok-STM32F4 | utils/ArrayMethods.cpp | #include "ArrayMethods.h"
int arr_max(int arr[], int n)
{
int i;
// Initialize maximum element
int max = arr[0];
// Traverse array elements from second and
// compare every element with current max
for (i = 1; i < n; i++)
if (arr[i] > max)
max = arr[i];
return max;
}
... | ALGO | 0.999745 | 5.226972 | {
"github_metadata": {
"branch": "master",
"commit_count": 136,
"repo_created_at": "2023-05-05T03:40:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3657fc08... |
2fee2531-cc0b-4532-b5b2-06be4d92ab5a | lce4113/comp-prog | Contests/Round #720/Q2/main.cpp | // ––– CodeForces Round #720: Problem B –––
#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define mp make_pair
#define pb push_back
using str = string;
using ll = long long;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
int main()... | ALGO | 0.99993 | 3.661312 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2021-04-20T18:57: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": "433ff0a334b... |
d223ddb4-99bc-4574-8694-36b089a39e13 | maykonmarcosjunior/EstruturaDeDados | Estruturas/DoublyLinkedList.h | //! Copyright [2023] <<NAME>>
#include <stdexcept> // C++ Exceptions
#include <cstdint>
namespace structures {
template<typename T>
class DoublyLinkedList {
public:
DoublyLinkedList();
~DoublyLinkedList();
void clear();
void push_back(const T& data); // insere no fim
void push_front(const T&... | TOOL | 0.935283 | 5.115742 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-09-16T14:01: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": "177dec53fe32... |
adb58674-8082-451c-8062-bab5caa51c58 | singlarohan/leetcode_sol | 0300-longest-increasing-subsequence/2022-09-14 19.50.31 - Accepted - runtime 1270ms - memory 292.2MB.cpp | class Solution {
public:
int solve(int prev, int i, vector<int> &nums, vector<vector<int>> &dp){
if(i >= nums.size())
return 0;
if(dp[i][prev + 1] != -1)
return dp[i][prev + 1] ;
int take = 0;
int nottake = solve(prev, i + 1, nums, dp);
if(prev == -1 |... | ALGO | 0.999996 | 5.83215 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-08-05T02:14:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8aa3d31870b... |
4196d955-19b7-4b62-a3de-f254426e9b14 | johnpzh/bfs_simd_benchmarks | apps/connectedComponent_naive/cc.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <string>
#include <sstream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <omp.h>
#include <unistd.h>
using std::ifstream;
using std::string;
using std::getline;
using std::stringstream;
using std::cout;... | ALGO | 0.996026 | 4.091683 | {
"github_metadata": {
"branch": "master",
"commit_count": 279,
"repo_created_at": "2017-05-29T02:55:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc95b6c0... |
60a6bcc9-78bf-4a24-9ae3-1cc587a2a54e | Epyon99/CPPNH | Lab7/yankenpopoo.cpp | #include <iostream>
#include <ctime>
#include <cstdlib>
class Juego
{
public:
Juego()
{
std::srand(std::time(0));
}
void Jugar()
{
std::string playerChoice;
std::cout << "Elige Piedra, Papel o Tijers:";
std::cin >> playerChoice;
if (!isValidChoise(playerChoi... | ALGO | 0.987506 | 5.284262 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2024-06-21T00:02: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": "b03d6903f22... |
b34339f5-944c-4f05-be6e-3a1713867d29 | Teodor03/Informatika-SMG-10-b | bank_account.cpp | #include<iostream>
#include<string>
#include<set>
using namespace std;
class bank_account{
private:
string name;
int id;
string addr;
double amount;
public:
bank_account(): name{"test"},id{0},addr{"somewhere"},amount{0}{}
bank_account(string& n,int _id,string& adr,double st_am):name{n},id{_... | TOOL | 0.945004 | 3.882225 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-09-24T14:20:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4137a934a... |
ffdc53d4-7d22-4349-81d2-ad23e2bc5a18 | louisfghbvc/Leetcode | Dp/1706. Where Will the Ball Fall.cpp | // this is tag dp. but acutually just simulate.
// O(M*N). check same diagonal. and move. otherwise fail.
class Solution {
public:
vector<int> findBall(vector<vector<int>>& grid) {
int m = grid.size(), n = grid[0].size();
vector<int> res(n, -1);
for(int j = 0; j < n; ++j){
... | ALGO | 0.999969 | 5.514193 | {
"github_metadata": {
"branch": "master",
"commit_count": 2084,
"repo_created_at": "2019-12-13T14:09: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": "d930932... |
98c7e9a0-81ed-4ed0-ae09-7ee0fa4fa845 | ammarqaisar11a55/LeetCode-Solutions | 108. Convert Sorted Array to Binary Search Tree.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.999996 | 6.495721 | {
"github_metadata": {
"branch": "main",
"commit_count": 722,
"repo_created_at": "2024-05-21T18:20:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12e42a20e0... |
e5a0ea46-2d8b-46fe-bf97-193db3c3cc01 | BystrickyK/Algorithms-DataStructures | algorithm-toolbox/week4_divide_and_conquer/5_number_of_inversions/inversions.cpp | #include <iostream>
#include <vector>
using std::vector;
// #define DEBUG
long long merge(vector<int> &a, vector<int> &b, size_t left, size_t mid, size_t right)
{
long long number_of_inversions = 0;
size_t idx_left = left;
size_t idx_right = mid;
size_t i = left;
while ((idx_left < mid) && (idx_rig... | ALGO | 0.999967 | 4.722145 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2021-12-28T23:47:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "88ec1f571... |
f68d6af5-7e3e-4358-9435-79c41ec5a64c | llvm/llvm-project | clang/tools/clang-installapi/Options.cpp | //===-- Options.cpp -------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | TOOL | 0.964733 | 7.172122 | {
"github_metadata": {
"branch": "main",
"commit_count": 545188,
"repo_created_at": "2016-12-07T09:39:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 33545,
"forks": 14484,
"issues": 5000,
"pull_requests": 5000
},
"file_meta": {
"content_... |
ecf9d747-aa98-46bb-ad79-6e4020515381 | ajmarin/coding | uva/Volume IV/00437.cpp | /////////////////////////////////
// 00437 - The Tower of Babylon
/////////////////////////////////
#include<cstdio>
#include<cstring>
#include<algorithm>
typedef unsigned int UI;
struct block{
UI x,y,h;
block() {}
block(UI a, UI b, UI c): x(a),y(b),h(c) {}
}bks[90];
UI cnum, d[3], h[90], maxh, test;
unsigned char p... | ALGO | 0.998884 | 3.637399 | {
"github_metadata": {
"branch": "master",
"commit_count": 1044,
"repo_created_at": "2011-08-06T20:03:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 43,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c86ea... |
496e4157-8998-415d-8c28-25e841e8e6b1 | windystrife/UnrealEngine_NVIDIAGameWorks | Engine/Source/ThirdParty/PhysX/APEX_1.4/common/src/CurveImpl.cpp | /*
* Copyright (c) 2008-2017, NVIDIA CORPORATION. All rights reserved.
*
* NVIDIA CORPORATION and its licensors retain all intellectual property
* and proprietary rights in and to this software, related documentation
* and any modifications thereto. Any use, reproduction, disclosure or
* distribution of this so... | ALGO | 0.998855 | 6.657327 | {
"github_metadata": {
"branch": "4.18-GameWorks",
"commit_count": 14,
"repo_created_at": "2018-03-06T15:44:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 284,
"forks": 176,
"issues": 4,
"pull_requests": 2
},
"file_meta": {
"content_id"... |
9823af46-3ba3-4ea8-afbd-09721b0252a3 | Gihyu/GateAssignment | GateAssignment/Node.h | #pragma once
#include"Activity.h"
enum NodeType
{
N_ACT = 1,
N_OPRT = 2,
N_STAND = 3
};
class Cluster;
class ARC;
class Operation;
class Node
{
private:
int node_id;
NodeType node_type;
//one of these is NULL
Stand * thisStand;
Operation * thisOprt;
Activity * thisAct;
vector<ARC *> _connectArcSet;
//... | ALGO | 0.954471 | 5.810167 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-07-08T12:45:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df3387bbed... |
1d4ba47e-5f7d-4407-b98a-e41978918d8f | faranslab/ExtendedKalmanFilter | CarND-Extended-Kalman-Filter-Project/src/kalman_filter.cpp | #include "kalman_filter.h"
#include <math.h>
using Eigen::MatrixXd;
using Eigen::VectorXd;
/*
* Please note that the Eigen library does not initialize
* VectorXd or MatrixXd objects with zeros upon creation.
*/
// This code has many segments taken from the lessons
KalmanFilter::KalmanFilter() {}
KalmanFilter:... | ALGO | 0.906814 | 5.623729 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-04-09T20:22: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": "9a860bfe13... |
b3800255-144f-4bcb-9dc2-a6db28b4b10e | ElizavetaLoginova/02.03.16 | Loginova.Task4.cpp | #include <iostream>
#include <string.h>
using namespace std;
void ChangeString(char*, char*);
bool TheSame(char*str, char*word, int, int);
int main()
{
while (true)
{
const int length = 256;
char string[length], words[length];
cout << "Enter the string: ";
cin.getline(string, length, '\n');
cout << "Enter... | ALGO | 0.997825 | 3.520765 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2016-02-29T11:01: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": "f6bbc7e40... |
a569d2c1-9ae3-41b9-b760-d9aa43b7ec7e | djperillam/DannyRemoto | 2022-03-30-Assignment-stdlib/random_pdf.cpp | #include <random>
#include <iostream>
#include <cstdlib>
#include <vector>
void compute_pdf(int seed, int nsamples, double mu, double sigma, double xmin, double xmax, int nbins);
int main(int argc, char **argv)
{
const int SEED = std::atof(argv[1]);
const int NSAMPLES = std::atof(argv[2]);
const double MU = std... | ALGO | 0.996757 | 5.226443 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2021-10-17T01:12:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e1ab8e2c... |
e754dc14-056d-4d13-8a75-6b9ecfeaf1c6 | CoderSwarup/DSA_Mastery | 23_Linked_List/4_Problems/9_Reverse_LL_Group_wise/1_Reverse_First_Specipic_group.cpp | #include <iostream>
using namespace std;
struct Node {
int data;
Node* next;
Node(int x) : data(x), next(NULL) {}
};
// Function to print the linked list
void printList(Node* node) {
while (node != NULL) {
cout << node->data;
if (node->next != NULL)
cout << " -> ";
... | ALGO | 0.999995 | 5.369283 | {
"github_metadata": {
"branch": "main",
"commit_count": 140,
"repo_created_at": "2024-01-02T14:47:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "743181d022... |
122e6123-8e87-40cc-a357-8400d02e9885 | shreyaschavhan/100-days-of-code | Day 022 - 23rd October 2020/0003-parameterized-constructor-and-default-constructor.cpp | // Create a function (Hint: Make it a friend function) which takes 2 point objects and computes the distance between those 2 points
// Use these examples to check your code:
// Distance between (1, 1) and (1, 1) is 0
// Distance between (0, 1) and (0, 6) is 5
// Distance between (1, 0) and (70, 0) is 69
#include <ios... | TOOL | 0.932186 | 5.784833 | {
"github_metadata": {
"branch": "main",
"commit_count": 139,
"repo_created_at": "2020-10-02T15:40:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f76a36a72c... |
7254728d-b233-47b4-8c12-a86715c101a2 | thunil/tempoGAN | source/vortexsheet.cpp | /******************************************************************************
*
* MantaFlow fluid solver framework
* Copyright 2011 <NAME>, <NAME>
*
* This program is free software, distributed under the terms of the
* Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Vortex shee... | ALGO | 0.945349 | 4.670018 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2018-05-26T10:22:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 182,
"forks": 44,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f3d90... |
396ed0fe-bdd6-4fda-94c2-33e0be418069 | Muktesh9-11/CodeForces | D_Three_Activities.cpp | #include<bits/stdc++.h>
#include<iostream>
#include<string>
using namespace std;
#define ll long long
#define pb push_back
//INT_MAX=2,147,483,647
//LLONG_MAX=9,223,372,036,854,775,807
int main(){
int t;
cin>>t;
while(t-->0){
//code here
int n;
cin>>n;
vector<pair<i... | ALGO | 0.999964 | 4.253323 | {
"github_metadata": {
"branch": "main",
"commit_count": 133,
"repo_created_at": "2023-12-27T23:25: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": "b936aff30e... |
553d82b8-8b3f-4bed-b252-fc059674a51c | anouarac/CSES | Shortest Routes II.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("O2")
#define all(c) c.begin(), c.end()
#define pb push_back
#define ll long long
const int MAXN = 5e2 + 5;
const int mod = 1e9 + 7;
using namespace std;
ll dist[MAXN][MAXN];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, m, q;
cin >> n >> m >> q;
... | ALGO | 0.999992 | 4.344841 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-04-08T23:31: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": "23ede995e2... |
881b4891-8390-4729-80f9-d1d8d9664459 | zRegle/algorithm | dp/Min Distance with Min Cost.cpp | #include <iostream>
#include <climits>
#include <queue>
using namespace std;
struct edge {
int weight;
int cost;
};
/**
* 最短路径 + 最小花费:
* 每条路有一定的长度,经过每一条路要收取对应的路费,如果钱不够就不能通过
* 可能存在某一条路的长度小于另外一条路,但是收取的路费要高一点
* 现在手上有一定数额的钱,求一条最短路径并且花费最少
*
* 利用动态规划:
* dp[i][j]表示从起点出发到达顶点i的最短距离,并且剩下j元
*/
/**
* 找出未被遍历的状态中... | ALGO | 0.999655 | 3.649645 | {
"github_metadata": {
"branch": "master",
"commit_count": 272,
"repo_created_at": "2018-08-04T13:47:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "34ccd270... |
b5d6e8bf-ff3c-402d-8497-8500fe18d094 | gmtev/SoftUniCPPFundamentals | StringAndStreamsExercise.cpp | #include <iostream>
#include <string>
#include <sstream>
#include <vector>
using namespace std;
// Valid Usernames
bool isValidUsername(const string& username) {
if (username.length() < 3 || username.length() > 16)
return false;
for (char ch : username) {
if (!isalnum(ch) && ch != '-' &... | ALGO | 0.994607 | 3.746163 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2025-04-28T14:24: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": "b07df5293e3... |
1f638236-79f9-450a-b262-86d49973290b | tscmoo/tsc-bwai-merge | strat_base.h |
struct strat_base {
int my_zergling_count;
int my_queen_count;
int my_defiler_count;
int my_mutalisk_count;
int my_hatch_count;
int enemy_terran_unit_count = 0;
int enemy_protoss_unit_count = 0;
int enemy_zerg_unit_count = 0;
int enemy_marine_count = 0;
int enemy_firebat_count = 0;
int enemy_ghost_count ... | ALGO | 0.973895 | 4.312814 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-05-21T11:53:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "14a5429533... |
069a6f9f-a842-426f-b305-4ba85ca4b91a | yunruowu/LeetCode | 295.数据流的中位数.cpp | /*
* @Description:
* @Version: 2.0
* @Author: yunruowu
* @Date: 2020-02-02 20:42:46
* @LastEditors : yunruowu
* @LastEditTime : 2020-02-03 13:45:09
*/
/*
* @lc app=leetcode.cn id=295 lang=cpp
*
* [295] 数据流的中位数
*
* https://leetcode-cn.com/problems/find-median-from-data-stream/description/
*
* algorithms
... | ALGO | 0.999894 | 6.296739 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2019-12-28T00:10:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f971f52a... |
05a41642-89f4-46d9-b616-6dab05e19058 | Krakensttwo/Numerical-Methods | inthermit.cpp | /*
Task 10: Implement in C++ Hermite interpolation.
Compilation: g++ inthermit.cpp
Example program invocation:
./a.out -1.0 2.0 2.0 2.0 -7.2 2.0 -11.1 2.0
This command means that we are looking for a polynomial of degree at most 3 for the following interpolation nodes:
x: -1.0 2.0
---------------------------------... | ALGO | 0.999956 | 5.640995 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-03-18T11:11: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": "65c5b255423f... |
7ad970da-bf22-4c88-9d11-813f0dc488b3 | emilgoldsmith/heuristics-desertfoxes | auction/emil_test.cpp | #include "solver.h"
#include <iostream>
using namespace std;
int main() {
vector<int> itemsInAuction = {2, 0, 0, 1, 0, 2, 2, 1, 2, 0, 0, 2, 0, 2, 1, 1, 2, 0, 0, 2, 0, 2, 1, 1, 2, 1, 2, 1, 0, 1, 1, 1, 0, 2, 1, 1, 2, 0, 1, 1, 1, 2, 2, 1, 1, 0, 1, 1, 2, 2, 1, 0, 2, 2, 0, 2, 0, 0, 2, 0, 0, 1, 1, 0, 1, 0, 1, 2, 1, 0, 2... | ALGO | 0.999842 | 3.87087 | {
"github_metadata": {
"branch": "master",
"commit_count": 367,
"repo_created_at": "2017-09-13T02:25: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": "f6e2aa56... |
6c972d39-c305-44ac-a4f6-c82a0449c2c4 | BakiAdol/Data-Structure | Queue_using_linkedList.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
struct Node{
T data;
Node *next;
Node(T data):data{data},next{NULL}{}
};
template <typename T>
class Queue{
Node<T> *front, *rear;
public:
Queue():front{NULL},rear{NULL}{}
bool isEmpty()
{
return front =... | ALGO | 0.984538 | 4.318913 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2019-08-14T22:22:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0974a70e0... |
1bdf94f6-2693-431c-93c6-71a3936ec275 | chickenchobab/BOJ-problem-solving | 4_graph/1_search/17090.cpp | #include <iostream>
#include <algorithm>
#include <queue>
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int n, m, ans;
char map[501][501];
int di[] = {-1, 0, 1, 0}, dj[] = {0, 1, 0, -1};
void check(int i, int j){
bool con = 0;
char c = map[i][j];
con += (i ==... | ALGO | 0.999925 | 3.801109 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2023-07-26T09:20: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": "ba573bf5d11... |
9893f334-a74c-4516-80a1-323daac59a15 | MAZHARMIK/Interview_DS_Algo | Arrays/Leetcode Easy/Check if Array Is Sorted and Rotated.cpp | /* Scroll down to see JAVA code also */
/*
MY YOUTUBE VIDEO ON THIS Qn : https://www.youtube.com/watch?v=-o4vCUI7jmk
Company Tags : will update later
Leetcode Link : https://leetcode.com/problems/check-if-array-is-sorted-and-rotated
*/
/**************************... | ALGO | 0.999777 | 5.179719 | {
"github_metadata": {
"branch": "master",
"commit_count": 5946,
"repo_created_at": "2020-07-12T13:13:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2586,
"forks": 1357,
"issues": 7,
"pull_requests": 37
},
"file_meta": {
"content_id": "... |
cfd49dd2-3eae-410c-b60a-68c4a1193352 | chenyong2github/UnrealEngine | Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp | // Copyright Epic Games, Inc. All Rights Reserved.
#include "HeterogeneousVolumes.h"
#include "HeterogeneousVolumeInterface.h"
#include "LocalVertexFactory.h"
#include "MeshPassUtils.h"
#include "PixelShaderUtils.h"
#include "RayTracingDefinitions.h"
#include "RayTracingInstance.h"
#include "RayTracingInstanceBufferU... | TOOL | 0.984225 | 6.707733 | {
"github_metadata": {
"branch": "5.3",
"commit_count": 258706,
"repo_created_at": "2022-07-28T06:53:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 12,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "a7156b... |
ae865533-6d76-4b2d-b883-4bd467d9f976 | t3nsor/SPOJ | panic.cpp | // 2023-10-14
// The idea behind this problem is pretty simple, but the implementation is
// lengthy. First, we find a list of places that the panic will take the longest
// to reach. This can be done using Dijkstra's, but we have to keep in mind that
// it can also be somewhere along an edge---so we need to do some ma... | ALGO | 0.999839 | 4.30997 | {
"github_metadata": {
"branch": "master",
"commit_count": 392,
"repo_created_at": "2014-10-08T22:07:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 248,
"forks": 102,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "275d... |
560bd792-89bd-4ed6-9369-2aae4ffa4147 | mzeeshanzafar28/Semester-4 | tree.cpp | #include <iostream>
using namespace std;
#include<conio.h>
struct Node {
int data;
Node* left;
Node* right;
};
Node* createNode(int value) {
Node* n = new Node;
n->data = value;
n->left = nullptr;
n->right = nullptr;
return n;
}
void insert(Node *&root, int value) {
if (root == nu... | ALGO | 0.999904 | 5.759718 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-05-31T13:28:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a8ce35f88a3... |
c0e55856-3e04-4625-9b52-340150d2b026 | suhaas02/Data-structures-and-algorithms | Medium/Fractional Knapsack/fractional-knapsack.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Item{
int value;
int weight;
};
// } Driver Code Ends
//class implemented
/*
struct Item{
int value;
int weight;
};
*/
class Solution
{
public:
//Function to get the maximum total value in the knapsack.
double f... | ALGO | 0.999989 | 5.243843 | {
"github_metadata": {
"branch": "main",
"commit_count": 1225,
"repo_created_at": "2021-10-27T06:57: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": "83a415b6e... |
273d8223-61db-4eb1-bd0c-5cb3c0c91a0b | Alexisflipi/Club-de-Algoritmia | Online-judge/COJ/1016.cpp | #include <bits/stdc++.h>
#define MAX 5000
#define p pair< double, double >
using namespace std;
struct Edge{
int origen;
int destino;
double peso;
Edge(){}
bool operator<(const Edge &e ) const {
return peso < e.peso;
}
}arista[ MAX ];
int parent[ MAX ];
int rank[ MAX ];
void makeset( int n ){
for ( int i... | ALGO | 0.99988 | 4.12043 | {
"github_metadata": {
"branch": "master",
"commit_count": 261,
"repo_created_at": "2016-07-18T18:24: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": "7b8ec9fb... |
25fe45d8-94d4-4123-ae38-6bf0ed7bcad0 | jaman24/Online-Contest | codechef/Starters 123 Division 2 (Rated)/x.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const ll MOD = 202206214218227;
#define all(x) x.begin(),x.end()
#define FastIO ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
string minWindow(string s, string t) {
int n = s.size();
map<int, int> mp;
for(auto c:t){
... | ALGO | 0.999992 | 5.263036 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-05-19T17:52: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": "9c7c3b630cef... |
5a527445-5e32-4271-9019-85093a762514 | abdulhakimefti/DSA-Week-06-With-CPP | Linked List Deep Dive/LinearLinkedList.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int value;
Node *next;
Node(int val)
{
value = val;
next = NULL;
}
};
struct Test
{
int position[1000];
};
void InsertTail(Node *&head, int val);
void InsertHead(Node *&head, int val);
void InsertionAtSpecificPos... | ALGO | 0.999903 | 4.353663 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-09-30T04: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": "d28d2a601cea... |
d157d1b4-2b61-46ce-aa22-fde8d701d36e | 46zhang/Note | algorithm/剑指offer原题/maxValueGift.cpp | #include <iostream>
/*
算法名称: 礼物的最大价值
算法来源: 剑指Offer 面试题47
算法思想: 一开始想到的就是用回溯法,但是递归存在大量的重复计算
采用动态规划的方法会快很多
算法注意: 1.边界检查
2.递归终止条件
算法效率分析: 算法1时间复杂度 0(nm*nm)
算法2时间复杂度O(nm)
算法实现时间: 花了20min实现算法2,花了17min实现算法2
*/
int maxValue(int *matrix,int n,int m) {
if (matrix == nullptr || m <= 0 || n <= 0)
return 0;
i... | ALGO | 0.999906 | 4.360023 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2020-03-13T12:07:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 204,
"forks": 30,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "75914d... |
c7828133-ac79-4c30-8232-c55a425df656 | PX4/PX4-Autopilot | src/drivers/uavcan/libdronecan/libuavcan/include/uavcan/protocol/dynamic_node_id_server/distributed/cluster_manager.hpp | /*
* Copyright (C) 2015 <NAME> <<EMAIL>>
*/
#ifndef UAVCAN_PROTOCOL_DYNAMIC_NODE_ID_SERVER_DISTRIBUTED_CLUSTER_MANAGER_HPP_INCLUDED
#define UAVCAN_PROTOCOL_DYNAMIC_NODE_ID_SERVER_DISTRIBUTED_CLUSTER_MANAGER_HPP_INCLUDED
#include <uavcan/build_config.hpp>
#include <uavcan/debug.hpp>
#include <uavcan/util/method_bind... | TOOL | 0.90167 | 7.463475 | {
"github_metadata": {
"branch": "main",
"commit_count": 47555,
"repo_created_at": "2012-08-04T21:19:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9767,
"forks": 14212,
"issues": 1547,
"pull_requests": 574
},
"file_meta": {
"content_id"... |
1e4da98f-f022-4f4e-989d-c5cdc8b84a35 | rokyan/leetcode | medium/cpp/1396.cpp | // https://leetcode.com/problems/design-underground-system/
class UndergroundSystem
{
public:
UndergroundSystem()
{
}
void checkIn(int id, std::string stationName, int t)
{
checkins[id] = { stationName, t };
}
void checkOut(int id, std::string stationName, int t)
... | ALGO | 0.965236 | 6.255056 | {
"github_metadata": {
"branch": "master",
"commit_count": 2228,
"repo_created_at": "2022-09-17T09:45: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": "e1a85c8... |
145c9e81-ea09-45f2-a670-498ca40597e5 | DavidBergevoet/AdventOfCode | 2024/Day-04/part1.cpp | #include <iostream>
#include <vector>
#include "FileHandler.hpp"
#include "Matrix.hpp"
Matrix<char> fileMatrix;
const std::string wordToFind = "XMAS";
int FindWord(int row, int column, int charIndex, int horizontal, int vertical)
{
int returnValue = 0;
if (fileMatrix[row][column] == wordToFind[charIndex])
{
... | ALGO | 0.997315 | 5.113698 | {
"github_metadata": {
"branch": "main",
"commit_count": 165,
"repo_created_at": "2021-11-30T16:09: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": "586de7c8e3... |
3f7c80a9-62c3-426a-af8b-a74a02fc4b5c | aditi2802/LeetCode | Minimum Spanning Tree - GFG/minimum-spanning-tree.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class DisjointSet{
vector<int> rank;
vector<int> size;
vector<int> parent;
public:
DisjointSet(int n){
rank.resize(n+1, 0);
parent.resize(n+1);
size.resize(n+1, 1);
for(int i=0;i... | ALGO | 0.999958 | 5.97006 | {
"github_metadata": {
"branch": "main",
"commit_count": 1492,
"repo_created_at": "2022-01-12T19:28: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": "9ad1e5ed8... |
1f4696ed-2eed-4124-8fd1-8ef6dafb22c3 | adityanjr/code-DS-ALGO | GeeksForGeeks/Practice/Reorganize The Array.cpp | #include <iostream>
#include <vector>
using namespace std;
void printVector(vector<int>& temp){
for(int i = 0; i < temp.size(); i++){
cout << temp[i] << " ";
}
}
void swap(int& a, int& b){
int temp = a;
a = b;
b = temp;
}
void rearrangeVector(vector<int>& temp){
int n = temp.size();
... | ALGO | 0.999888 | 5.266675 | {
"github_metadata": {
"branch": "master",
"commit_count": 589,
"repo_created_at": "2019-10-25T15:50:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 32,
"forks": 46,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e43d96... |
a02540fe-f25f-4d92-92f2-35807857805a | ishandutta2007/codeforces-b | balbit/normal/1621/E.cpp | #include <bits/stdc++.h>
#define int ll
using namespace std;
#define ll long long
#define y1 zck_is_king
#define pii pair<ll, ll>
#define ull unsigned ll
#define f first
#define s second
#define ALL(x) x.begin(),x.end()
#define SZ(x) (int)x.size()
#define SQ(x) (x)*(x)
#define MN(a,b) a = min(a,(__typeof__(a))(b))
#def... | ALGO | 0.999652 | 3.225616 | {
"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": "b66a78489077... |
e62525c2-472a-413e-b043-6228bb826bc7 | ishandutta2007/codeforces-c | cmz/normal/835/F.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
#define M ((L+R)>>1)
#define lc o<<1
#define rc o<<1|1
#define ls lc,L,M
#define rs rc,M+1,R
const int N=200005,E=400005;
int n,x,y,z,e,fd,tp,hd[N],nx[E],to[E],w[E],v[N],st[E];
long long a1,a2=0x3f3f3f3f3f3f3f3fLL,s[E],d[N],mx[E*4],m1[E*4],m2[E*4];
struct nd ... | ALGO | 0.999376 | 3.759096 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17: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": "c7181a2c4e4b... |
63597999-aff9-4710-9635-2d1676fcf895 | ndvo/sandbox | cpp/QuickSort/quicksort.cpp | #include <iostream>
#include <chrono>
#include <thread>
void quickSort(int A[], int low, int high);
int partition(int A[], int low, int high);
void swap(int A[], int a, int b);
void printA(int A[], int size);
int main () {
int A[] = {2, 3, 7, 8, 5, 0, 6, 1, 9, 4};
std::cout << "Original ";
printA(A, 10);
quic... | ALGO | 0.999713 | 5.819323 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2019-04-22T22:22:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 29
},
"file_meta": {
"content_id": "9a490048... |
6d8abdad-dfc2-4639-80ef-098bed0db390 | RWTHmediTEC/TRTK | include/TRTK/FitCircle3D.hpp | /*
Estimates the parameters of a circle in 3D space from a set of points lying on
the circle.
Copyright (C) 2010 - 2014 <NAME>, <NAME>
Chair of Medical Engineering (mediTEC)
RWTH Aachen University
Pauwelsstr. 20
52074 Aachen
Germany
Version 0.2.0 (2012-03-20)
*/
/** \file FitCirc... | ALGO | 0.998713 | 5.08751 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2014-07-14T15:01:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 14,
"forks": 5,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "3061cb904... |
8b90ba56-0f0b-40fe-a860-ec73fd98817a | Ronnie-Git/LeetCode | 0.题库/21_合并两个有序链表.cpp | struct ListNode* mergeTwoLists(struct ListNode* l1, struct ListNode* l2) {
if (l1 == NULL && l2 == NULL) return NULL;
if (l1 == NULL || l2 == NULL) return l1 ? l1 : l2;
struct ListNode *root, *p1 = l1, *p2 = l2;
if (l1->val < l2->val) {
root = p1;
p1 = p1->next;
} else {
root... | ALGO | 0.999726 | 5.119183 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2020-07-14T02:18:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "104374909... |
94a297f7-5eee-4806-bf6b-80ae6d70c172 | BenjaminBLi/ccc-with-c | Timus/1114.cpp | #include <bits/stdc++.h>
#define fori(i, st, en) for(int i = st; i < (int) (en); i++)
#define rfori(i, st, en) for(int i = st; i >= (int) (en); i--)
#define f first
#define s second
#define pb push_back
#define left(i) (i<<1)
#define right(i) (i<<1|1)
#define mid(l, r) ((l+r)>>1)
using namespace std;
typedef long long ... | ALGO | 0.999932 | 3.80694 | {
"github_metadata": {
"branch": "master",
"commit_count": 116,
"repo_created_at": "2016-12-10T16:08:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47724ab9... |
837f6a1c-cfac-442f-b739-1a7167c9becd | korli/haiku-jarek | src/apps/haikudepot/List.h | /*
* Copyright 2009-2013, <NAME> <<EMAIL>>
* All rights reserved. Distributed under the terms of the MIT License.
*/
#ifndef LIST_H
#define LIST_H
#include <new>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <SupportDefs.h>
#define BINARY_SEARCH_LINEAR_THRESHOLD 4
template <typename Item... | TOOL | 0.924201 | 6.603348 | {
"github_metadata": {
"branch": "master",
"commit_count": 58200,
"repo_created_at": "2018-04-13T06:27:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7edd23... |
ae34f539-9237-4c53-8b23-494936202994 | Niranjan-GopaL/__Learning_JAVA_and_Cpp__ | Java Basics/Endsem_prep/Revision.cpp |
#include <bits/stdc++.h>
using namespace std;
class Class{
public:
int data;
Class(int data){
this->data = data;
}
};
int main(){
string input;
getline(cin,input);
stringstream ss(input);
string word; vector<string> words;
while(ss >> word)words.push_back(word);
for(string w: wor... | ALGO | 0.987418 | 3.488331 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2023-08-29T06:42: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": "1e59c6d3d10... |
ff4b477e-65ab-4869-8515-2e99cc1ab1bb | fael123programming/c | cpp-general/exercises/ex19/main.cpp | //Asks the user for a radius value and calculates the area of a circle and the volume of a sphere using it.
#include <iostream>
#include <cmath>
using namespace std;
const double PI = 3.141592;
double calculateArea(double);
//Calculates the area of a circle with the given argument as its radius.
double calculateVol... | TOOL | 0.994978 | 5.533183 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2021-10-19T02:47: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": "8e8eb9865c5... |
ea13caf4-7ac0-4b25-8d85-5739f185adbf | HuGuo-UNC-Chapel-Hill/Project-list | Parkland_College/CSC125/lab9/solution9/lab9.cpp |
#include <vector>
#include "Circle.h"
#include "Triangle.h"
#include "Rectangle.h"
Shape *CreateShape();
main()
{
vector <Shape *> shapes;
Shape *tmp;
// Create shapes
while( tmp = CreateShape() )
shapes.push_back( tmp );
// For each shape created
cout << "Your computed shape areas..." << endl;
f... | TOOL | 0.979645 | 5.079567 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-07-17T03:51: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": "02c183c7b944... |
1b502c37-5cbc-482b-be87-0b7d1b003491 | NicolasDe/AlienSwarm | src/game/client/swarm/gameui/swarm/vfoundpublicgames.cpp | //========= Copyright © 1996-2008, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=====================================================================================//
#include "cbase.h"
#ifdef IS_WINDOWS_PC
#undef INVALID_HANDLE_VALUE
#include "windows.h"
#endif
#include "tier1/fmtstr.h"... | TOOL | 0.936531 | 3.576379 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2016-03-13T23:43:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 91,
"forks": 30,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67043ec... |
f9bfb7da-af9c-449d-9450-1c3e4741e4ed | o3de/o3de | Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TreeView.cpp | /*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include <AzQtComponents/Components/Widgets/TreeView.h>
#include <QDrag>
#include <QEvent>
#inclu... | TOOL | 0.941676 | 3.313222 | {
"github_metadata": {
"branch": "development",
"commit_count": 26515,
"repo_created_at": "2021-04-05T06:38:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8421,
"forks": 2320,
"issues": 3293,
"pull_requests": 98
},
"file_meta": {
"conten... |
76dfe552-c1ab-48ea-83aa-0a81b067f283 | tlsghwns3366/baekjoon | C++/2294/2294.cpp | #include <iostream>
#include <climits>
using namespace std;
int main()
{
int n, k;
cin >> n >> k;
int kk[k + 1];
int nn[n];
for (int i = 0; i < n; i++)
{
cin >> nn[i];
}
fill(kk, kk + k + 1, INT_MAX);
kk[0] = 0;
for (int i = 1; i <= k; i++)
{
for (int j = 0; j... | ALGO | 0.999974 | 3.587449 | {
"github_metadata": {
"branch": "master",
"commit_count": 602,
"repo_created_at": "2021-05-18T16:36: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": "5f55cf75... |
a5c02e36-1e55-4a21-a43f-c00f7adea4fb | sunnynote/algorithm | Programmers/2019_블라인드_오픈채팅방.cpp | /**
* 21-10-29
* Programmers
* 2019 블라인드
* Lv2 오픈채팅방
* */
#include <string>
#include <vector>
#include <sstream>
#include <map>
using namespace std;
map <string, string> mp;
vector<string> split(string input, char c){
vector<string> ans;
stringstream ss(input);
string tmp;
while(getline(ss, tmp... | ALGO | 0.998401 | 4.671702 | {
"github_metadata": {
"branch": "master",
"commit_count": 401,
"repo_created_at": "2020-03-04T16:28: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": "4187df8b... |
d4290a2f-7e90-4933-bd50-4d4f23000eb9 | gargVader/CPP-Data-Structures-Algorithms-Launchpad | Binary Search Tree/3. Deletion.cpp | #include<iostream>
#include<queue>
using namespace std;
class node {
public:
int data = 0;
node* left = NULL;
node* right = NULL;
node(int d) {
data = d;
}
};
void printIn(node* root) {
if (root == NULL) {
return;
}
printIn(root->left);
cout << root->data << " ";
printIn(root->right);
}
void bfs(node... | ALGO | 0.999955 | 4.524107 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-08-23T05:54:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 54,
"forks": 31,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "40f4d9c... |
e150e44d-194a-4469-90ba-557809491093 | saratvemulapalli/LinearEquationSolver | EquationParser.cpp | //
// EquationParser.cpp
// EquationEvaluator
//
// Created by <NAME> on 8/14/17.
// Copyright © 2017 <NAME>. All rights reserved.
//
#include "EquationParser.hpp"
namespace {
/* Parser States */
enum ParserState
{
PARSE_TERM,
PARSE_OPERATOR
};
};
void EquationParser::Reset()
{
... | ALGO | 0.988191 | 5.118869 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-09-05T01:41:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4dc1595b7... |
10cfa1b4-71af-4967-99f2-e31575b29477 | QuyDatDamMaiKhongXanh/Ly_Thuyet_NOTE | graph_dinh_tru_canh_cau_code_trau.cpp | #include <bits/stdc++.h>
#define ll long long
#define ms(a) memset(a, 0, sizeof(a))
using namespace std;
ll n, m, cnt = 0, dem = 0;
bool visited[1001] = {0};
vector<ll> adj[1001];
void init()
{
cin >> n >> m;
for (int i = 0; i < m; i++)
{
int x, y;
cin >> x >> y;
adj[x].push_back(y);... | ALGO | 0.999979 | 3.888676 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2022-10-18T05:55: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": "dc24e5e3171... |
5f66b0c0-b976-4017-a413-1495c6b80b72 | vaibhav-zemo/DSA | array_intersection.cpp | #include <iostream>
#include <map>
using namespace std;
void intersection(int n, int m, int *arr1, int *arr2)
{
map<int, int> Map;
for (int i = 0; i < n; i++)
{
Map[arr1[i]]++;
}
for (int i = 0; i < m; i++)
{
if (Map.count(arr2[i]))
{
cout << arr2[i] << " ";... | ALGO | 0.999963 | 4.070973 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-04-16T08:10: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": "da5884592c... |
dcbdc997-a2ee-4aeb-8c19-bedc4d9bd588 | DevAgarwal24/DSA | DynamicProgramming/fibonacciNumbers.cpp | #include <iostream>
#include <vector>
using namespace std;
// Recursive Solution with memoization
// Time Complexity = O(N)
// Space Complexity = O(N) + O(N)
int f(int n, vector<int> &dp) {
if (n <= 1) return n;
if (dp[n] != -1) return dp[n];
return dp[n] = f(n-1, dp) + f(n-2, dp);
}
// Recusive to Tabula... | ALGO | 0.999998 | 5.869761 | {
"github_metadata": {
"branch": "main",
"commit_count": 128,
"repo_created_at": "2023-06-23T13:32: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": "823b79bec3... |
43af1de6-e60d-43a5-8aee-66d57f93ac4a | AnshulDesai/CS225-Labs-MPs | lab_quacks/quackfun.cpp | /**
* @file quackfun.cpp
* This is where you will implement the required functions for the
* stacks and queues portion of the lab.
*/
namespace QuackFun {
/**
* Sums items in a stack.
* @param s A stack holding values to sum.
* @return The sum of all the elements in the stack, leaving the original
* stack i... | TEST | 0.900574 | 6.893966 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-08-18T00: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": "fe29ce03ec... |
ba68d51d-a5f0-4202-b442-08bc4ccf8c9d | ishandutta2007/codeforces-u | unstoppablechillmachine/normal/803/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
int const INF = 1e9 + 10;
ll const BINF = 1e18 + 10;
int const MAXN = 1e6 + 10;
ld const EPS = 1e-6;
#define f first
#define sec second
#define pb push_back
#define pii pair<int, int>
#define ... | ALGO | 0.999752 | 3.744457 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:31: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": "e71385196e15... |
d63fda0c-f449-441d-a665-6fa1d7d77cb2 | driely01/competitive-programming | B_Said && Cakes.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* B_Said && Cakes.cpp :+: :+: :+: ... | ALGO | 0.999874 | 5.617538 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-02-26T19:04:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dfa96d841e9e... |
c6273e6b-a100-4b6c-89cb-21e6dfe50c23 | taketakeyyy/atcoder | abc/309/b.cpp | #define _USE_MATH_DEFINES // M_PI等のフラグ
#include <bits/stdc++.h>
#define MOD 1000000007
#define COUNTOF(array) (sizeof(array)/sizeof(array[0]))
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define intceil(a,b) ((a+(b-1))/(b))
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<long,... | ALGO | 0.999999 | 4.451637 | {
"github_metadata": {
"branch": "master",
"commit_count": 1317,
"repo_created_at": "2018-03-05T01:37:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e79e1a9... |
656f622d-f49f-4888-b1cd-00a27d39cf8c | RandomityGuy/hxDatachannel | cpp/libdatachannel/src/configuration.cpp | /**
* Copyright (c) 2019 <NAME>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#include "configuration.hpp"
#include "impl/utils.hpp"
#include <cassert>
... | TOOL | 0.928185 | 7.339474 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2024-01-21T19:06:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ec680954d8... |
78a08e78-9400-443a-a056-8d9c2d01358d | kovvas/leetcode-problems | problems/medium/994.cpp | // Number: 994
// Name: <NAME>
// Tags: BFS
// O(N), O(N)
class Solution {
public:
int orangesRotting(vector<vector<int>>& grid) {
int m = grid.size();
int n = grid[0].size();
queue<vector<int>> rotten;
int freshCounter = 0;
for (int i = 0; i < m; ++i) {
for (int... | ALGO | 0.999841 | 5.57719 | {
"github_metadata": {
"branch": "master",
"commit_count": 181,
"repo_created_at": "2019-05-14T08:32:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f6fa0436... |
c272f2fb-ee06-45d9-969f-4a8aa3a8210d | lheric/GitlHEVCAnalyzer | appgitlhevcdecoder/HM-12.0/source/Lib/TLibCommon/TComWeightPrediction.cpp | /* The copyright in this software is being made available under the BSD
* License, included below. This software may be subject to other third party
* and contributor rights, including patent rights, and no such rights are
* granted under this license.
*
* Copyright (c) 2010-2013, ITU/ISO/IEC
* All rights reser... | ALGO | 0.996914 | 6.765019 | {
"github_metadata": {
"branch": "master",
"commit_count": 244,
"repo_created_at": "2013-02-07T20:03:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 531,
"forks": 174,
"issues": 11,
"pull_requests": 1
},
"file_meta": {
"content_id": "a37... |
0f12e239-331c-458f-92a9-2df78663b03a | NelsonGomesNeto/Competitive-Programming | Competitions/ICPC/2005/Sub-Regionals/D (Cubos Coloridos)/D.cpp | #include <bits/stdc++.h>
#define DEBUG if(0)
#define lli long long int
using namespace std;
/*
0
1 3 4 5
2
*/
const int maxN = 1e3; int n;
int cubes[maxN][6], cubesColor[maxN][10], ans;
int read[6] = {0, 1, 3, 4, 5, 2};
int axis[3][6] = {{0, 1, 2, 4, 3, 5}, {0, 3, 2, 5, 4, 1}, {1, 3, 4, 5, 0, 2}};
bool repeated[maxN]... | ALGO | 0.99911 | 3.72659 | {
"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": "5fe672a... |
1cd84456-4459-4ea5-affd-72448f778305 | imperfect-12/Codeforces-800-rated | 4_gameWithIntegers.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int testCases;
cin>>testCases;
int win = 0;
while(testCases--)
{
int n;
cin>>n;
if(n%3 == 0)
{
cout<<"Second"<<endl;
}else if (n%3 != 0)
{
cout<<"First"<<endl;
}
... | ALGO | 0.99986 | 3.672751 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-06-03T08:06: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": "bd1b30d9c576... |
29bb79ad-dcc4-424b-bcf9-8484189a21b6 | rafaelapure82/C-Parte-3 | avan.cpp | #include <iostream>/*Librería, in out stream que se usa para las lineas cout y cin*/
#include <windows.h>/*Librería específico de Windows que contiene las funciones Windows API*/
#include <locale.h>/*Librería para establecer la configuración regional actual*/
using namespace std;
int suma(int, int);/*Se declara la func... | TOOL | 0.985002 | 4.011821 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-01-18T18:26: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": "1cec31bdc9... |
df412fbd-2d56-4fa7-b0f7-eaabf4c98dbb | Estherrr4/HazeRemoverVer2 | main.cpp | #include "dehaze.h"
#include "dehaze_parallel.h"
#include <cuda_runtime.h>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <string>
#include <vector>
#include <filesystem>
#include <chrono>
#include <iomanip>
#include <omp.h>
#ifdef _WIN32
#include <Windows.h>
#include <commdlg.h>
#include <conio.... | TOOL | 0.961454 | 4.704079 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2025-04-24T00:21: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": "be6b2724d73... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.