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 |
|---|---|---|---|---|---|---|---|
124377b3-7b7a-4431-8956-be6962ffb25c | iShubhamRana/Graphs | SPFA&Belllman.cpp | #include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define INF INT_MAX
using namespace std;
void checkjudge() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt" , "w" , stdout);
#endif
}
struct edge {
int a, b, cost;
};
vector<edge> edges(1000001);
/*
Complex... | ALGO | 0.999875 | 3.873072 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2021-11-12T13:14:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c1069f3a... |
f3885270-43c5-4b0f-9368-729de2d4ac73 | Dhananjay-shrivastav/CxxPrimerPlus | chapter11/ex3.cpp | /*
Modify Listing 11.15 so that instead of reporting the results of a single trial for a
particular target/step combination, it reports the highest, lowest, and average number
of steps for N trials, where N is an integer entered by the user.
*/
// Listing 11.15
//
// randwalk.cpp -- using the Vector class
// compile ... | ALGO | 0.996234 | 4.07642 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2012-10-04T06:35:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 20,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "18a84d96... |
5f38b3a4-1e98-47a6-a485-0af123981fd3 | EduardoGPinheiro/robcdcc | src/simCDCC_C.cpp | //' @importFrom Rcpp evalCpp
#include <stdio.h>
#include <stdlib.h>
#include <RcppArmadillo.h>
using namespace arma;
using namespace Rcpp;
// set seed
void set_seed(double seed) {
Rcpp::Environment base_env("package:base");
Rcpp::Function set_seed_r = base_env["set.seed"];
set_seed_r(std::floor(std::fabs(seed)... | ALGO | 0.994924 | 6.597176 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2021-09-26T14:16:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "49efac69e76... |
6bfe09c7-1887-4e33-afdc-0e2c49f4eb6b | lemonilemon/algo | prob/CSES/2181.cpp | #include <bits/stdc++.h>
/*
* Created : 2024-08-11 19:00:59 lemonilemon
* Time complexity : O()
* Space complexity : O()
* Description :
*/
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long int;
#define LOCAL
// debug template
#ifdef LOCAL
#define debug(args...)... | ALGO | 0.999974 | 4.194823 | {
"github_metadata": {
"branch": "main",
"commit_count": 233,
"repo_created_at": "2022-10-24T11:06: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": "b455e422bc... |
d9840dca-cfde-4794-a9ec-850ed8c9ba3e | mosta7il/Competitive-programming | Educational Rounds/Round 4/C.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
const long long OO = 1e17;
const long long mod = 1e9 + 7;
const long double EPS = (1e-18);
int dcmp(long double x, long double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
int dx[] = { 0, 0, 1, -1 , 1 , 1 , -1 , -1};
int dy[] = { 1... | ALGO | 0.999629 | 3.88711 | {
"github_metadata": {
"branch": "master",
"commit_count": 519,
"repo_created_at": "2017-08-15T22:37:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d6b1a4b9... |
03097888-8946-48b4-97d1-27a7cbbf23c9 | Fighohji/Competitive-Programming | Record/PassRecord/1.31/C.cpp | #include <map>
#include <set>
#include <array>
#include <cmath>
#include <queue>
#include <stack>
#include <tuple>
#include <bitset>
#include <cctype>
#include <cstdio>
#include <random>
#include <string>
#include <vector>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <algorithm>... | ALGO | 0.999825 | 3.590967 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-20T12:40: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": "be4764850717... |
b7972021-bb33-4b95-b81d-f46f72369099 | mlpack/ensmallen | include/ensmallen_bits/padam/padam_update.hpp | /**
* @file padam_update.hpp
* @author <NAME>
*
* Implementation of Partially adaptive momentum estimation method (Padam).
*
* ensmallen is free software; you may redistribute it and/or modify it under
* the terms of the 3-clause BSD license. You should have received a copy of
* the 3-clause BSD license along ... | ALGO | 0.993469 | 6.741047 | {
"github_metadata": {
"branch": "master",
"commit_count": 3534,
"repo_created_at": "2018-10-03T01:53:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 790,
"forks": 128,
"issues": 7,
"pull_requests": 5
},
"file_meta": {
"content_id": "089f... |
186e550b-1dc4-4298-b25d-97bec3216e76 | chirtesionut22/custom-tic-tac-toe | main/main.cpp | #include <iostream>
#include <cstring>
using namespace std;
char choose[99999][4];
int dimension;
char get_mark(int pos)
{
if(pos >= 100)
{
return choose[pos][1];
}
else
{
return choose[pos][0];
}
}
void check()
{
for(int i = 1; i <= dimension; i++)
{
bool all... | ALGO | 0.999559 | 4.023147 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-07-06T21:21: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": "1d11c7ee9cce... |
cd819fce-746a-42f2-bc9e-1bc9fb62a522 | egils/Grafika--1-u-duotis | draw.cpp | /**
* Draws line on various algorithms.
* Drawing windows size: 640x640. Window should not be resized - algorithmic line do not recalculate.
*
* To draw lines simply mouse-click on drawing window where to start and end the lines.
*
* Function calls and algorithms they use:
* - lineNO(): Not optimized line... | ALGO | 0.996649 | 5.776629 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2013-03-10T11:06: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": "e623cfc23b... |
e96a7fa4-9525-49b6-870d-ef447f2e99da | MaiESHA0001/DSA_-CodingNinja_cpp | Test 3/Check cousins.cpp | Problem statement
Given the binary Tree and two nodes say ‘p’ and ‘q’. Determine whether the two nodes are cousins of each other or not. Two nodes are said to be cousins of each other if they are at same level of the Binary Tree and have different parents.
Do it in O(n).
Detailed explanation ( Input/output format, No... | ALGO | 0.999965 | 4.583518 | {
"github_metadata": {
"branch": "main",
"commit_count": 317,
"repo_created_at": "2024-01-03T10:13: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": "b2a3da6855... |
c32ea318-c267-4fd0-a77c-34d38970b2ae | jhamill34/aoc2023 | day5/src/day5.cpp | #include "common/common.h"
#include <algorithm>
#include <iostream>
#include <map>
#include <ratio>
#include <set>
struct SourceDestRange {
long source;
long dest;
long range;
};
struct SourceDestMap {
std::string name;
std::vector<SourceDestRange> ranges;
};
struct Farm {
std::vector<long> seeds;
std::map<s... | ALGO | 0.998941 | 5.049375 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2023-12-01T15:28: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": "243a0aa584d... |
be625680-6e2a-4394-8da0-e188a7858136 | xiaojiang-li/xd_leecode | src/01.array_string/006.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
// 向右翻转数组
class Solution {
public:
void rotate(vector<int>& nums, int k) { Fun2(nums, k); }
// 两种方法
// 额外数组
void Fun1(vector<int>& nums, int k);
// 翻转整个数组
void Fun2(vector<int>& nums, int k);
};
void Solution::Fun1(vector<int... | ALGO | 0.999905 | 5.298595 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2023-05-21T06:18: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": "68cb2a47a2... |
a90a27d2-6cf8-4f0d-a2eb-2a2e3d359e6c | jash-git/jashliao_VC | 166_類神經網路/C++ OPENCV 神經網路範例實作收藏/CB_OPENCV249_ANN_EX01/main.cpp | #include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/ml/ml.hpp>
#include <iostream>
#include <cstdio>
using namespace cv;
using namespace std;
void Pause()
{
printf("Press Enter key to continue...");
fgetc(stdin);
}
int main()
{
... | ALGO | 0.983255 | 4.043704 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2020-05-11T03:05:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5752d217... |
42563ec9-7fe3-4ad1-9340-23c0b619bdf6 | dhrubajyotinath6/Preparation | DSA/TOPICS/TREE/1080. Insufficient Nodes in Root to Leaf Paths.cpp | Given the root of a binary tree and an integer limit, delete all insufficient nodes in the tree simultaneously, and return the root of the resulting binary tree.
A node is insufficient if every root to leaf path intersecting this node has a sum strictly less than limit.
A leaf is a node with no children.
Example ... | ALGO | 0.999982 | 6.361246 | {
"github_metadata": {
"branch": "master",
"commit_count": 465,
"repo_created_at": "2022-01-24T17:01:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f9b704a... |
b99531a4-0b1d-499f-9de1-6dbe5002e2ef | Marwanthe0/XPSC | Week_16/Day_1/D_Buying_Shovels.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define M 1000000007
#define N 1000000
#define endl "\n"
#define all(v) v.begin(), v.end()
#define forn for (int i = 0; i < n; i++)
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
void marwan()
{
int n, k;
cin >> n >> k;
i... | ALGO | 0.999959 | 4.566155 | {
"github_metadata": {
"branch": "main",
"commit_count": 144,
"repo_created_at": "2024-10-27T17:56: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": "2dfcd44650... |
a66c38de-fd3f-4490-b850-4f52ca810a41 | mjggodoy/jMetalRosetta | src/core/scoring/util.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.997893 | 6.978 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2019-01-16T21:03:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4716eaad8... |
ed1f9bed-283e-4089-bc4b-46ef814943b3 | 12Andy12/lab10_on_STP | ModernCodingPolinom/Member.h | #pragma once
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
class Member
{
private:
int cooef = 0;
int degree = 1;
public:
Member();
Member(int new_cooef, int new_degree);
int getCooef();
int getDegree();
void setCooef(int new_cooef);
void setDegree(int new_degree);
Member D... | ALGO | 0.988312 | 4.464209 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2024-03-12T07:43:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "471ea6d034... |
a39315eb-54c9-4253-bffa-8a20e6678f81 | elinorblumen/C-CPP | C-CPP/ex6/AVL.cpp | //
// Created by ElinorB on 29/12/2021.
//
#include "AVL.h"
AVL::AVL (std::vector<std::pair<double, double>>& coordinates)
{
for(auto pair:coordinates){
Apartment cur(pair);
insert (cur);
}
}
AVL::iterator AVL::find (const Apartment &data)
{
for(auto it = begin(); it != end(); ++it){
... | ALGO | 0.99463 | 4.263036 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-04-02T12:46: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": "b2522e4ad851... |
1d4bf1c4-03fb-406c-8b62-d60ee5d33bac | hellocomrade/happycoding | leetcode/CheckWordValidAfterSubstitutions.cpp | #include <vector>
#include <string>
using namespace std;
//https://leetcode.com/problems/check-if-word-is-valid-after-substitutions/
/*
1003. Check If Word Is Valid After Substitutions
We are given that the string "abc" is valid.
From any valid string V, we may split V into two pieces X and Y such that X + Y (X con... | ALGO | 0.999716 | 5.861089 | {
"github_metadata": {
"branch": "master",
"commit_count": 1008,
"repo_created_at": "2015-11-28T18:57:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2847957... |
ac9157d8-6161-4099-aca4-c78a6624886b | webserver3315/Desktop_PS_BOJ | PS_BOJ/SiSoSil2-2_ans.cpp | #include <stdio.h>
#include <string.h>
#define _CRT_SECURE_NO_WARNINGS
//#include <bits/stdc++.h>
using namespace std;
#define MAX_DIC_SIZE 1000
#define MAX_LINE_LENGTH 80
#define MAX_WORD_LENGTH 16
static char dic[MAX_DIC_SIZE][MAX_WORD_LENGTH + 1];
static char line[MAX_LINE_LENGTH];
static unsigned int dic_size;
s... | ALGO | 0.999904 | 3.112488 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2020-02-21T12:37: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": "155a11009... |
a9cb9c0c-9c8a-4872-856f-191e69a179ab | arm1nasyan/chp | lab7/LZ77.cpp | #include <iostream>
#include <vector>
#include <string>
#include <tuple>
using namespace std;
class LZ77 {
public:
LZ77(int bufferSize) {
this->bufferSize = bufferSize;
}
void compress(string& text) {
int n = text.length();
for (int i = 0; i < n;) {
... | ALGO | 0.999608 | 4.698828 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-09-17T08:25: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": "d53e91a6d93... |
46d91390-c87a-49e0-91af-ac58deffef30 | AkhilSoni0102/Learning-Data-Structures | Graphs/Is_Connected.cpp | #include<bits/stdc++.h>
using namespace std;
void DFS(int** edges, int n, int sv, bool* visited){
visited[sv] = true;
for(int i = 0; i < n;i++){
if(i == sv)
continue;
if(edges[sv][i] && !visited[i]){
DFS(edges, n, i, visited);
}
}
}
bool isConnected(int** ed... | ALGO | 0.999963 | 4.488438 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2021-03-13T12:15: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": "c9bf34a4fca... |
d6fdc0a0-f49f-4d02-96a2-f5a68df354d0 | mcc12357/acm- | bc.cpp | #include<iostream>
using namespace std;
#include<stdio.h>
#include<string.h>
int main()
{
int t;
cin >> t;
while(t--)
{
int m,k,i;
cin >> m >> k;
if(m<(1+k)*k/2) cout << -1 << endl;
else
{
int av = m / k;
int n = m - av * k;
_int64 res = 1;
int *p1 = new int[5 * 100000000 + 5];
int *p2 = ne... | ALGO | 0.999744 | 3.656494 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-10-30T20:36: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": "ad6125722c... |
2ae019d2-2249-49b3-9527-c7b5f0fb5178 | sanesedu/CompetitiveProgramming | codeforces/B/433a/main.cpp |
#include <bits/stdc++.h>
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fori(i, n) for(int i = 0; i < (int)(n); ++i)
#define forid(i, n) for(int i = (int)(n) - 1; i >= 0; --i)
#define forl(i, n) for(long long i = 0; i < (long long)(n); ++i)
#define forld(i, n) for(long long i = (long long)(n) - 1;... | ALGO | 0.999919 | 4.83575 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2020-06-23T16:29: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": "7f1d1e12d... |
366c19a0-eb88-4a70-8546-a1ae30548e2e | JoeyManso/AdventOfCode2016 | Source/Day18.cpp | #include "Days.h"
#include <vector>
// Rules to determine traps in next row based on current row
// Its left and center tiles are traps, but its right tile is not.
// Its center and right tiles are traps, but its left tile is not.
// Only its left tile is a trap.
// Only its right tile is a trap.
static const char CH... | ALGO | 0.999684 | 6.104363 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2016-12-05T03:09:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6fd3f33e... |
7a89b57b-e85f-4d10-ad88-49fb783dca0d | yjl9903/XCPC | NJUST/2019Winter/w5/e.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#define ms(a,b) memset(a,b,sizeof(a))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int seed = 135;
const int maxn = 1000000 + 10;
const int p1 = 1e9 + 7, p2 = 1e9 + 9;
ull xp1[maxn], xp2[... | ALGO | 0.999894 | 3.790734 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-03-25T19:33:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c105d6d230a0... |
38fd2f54-90c6-48c4-9f16-814a5822c38e | hajime-te/progcomp | atcoder/union.cpp | #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a)... | ALGO | 0.999979 | 3.961699 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2017-07-22T08:45: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": "88439add7... |
433ca9e6-97d3-46ea-9af5-2e9cd378f7c5 | ishandutta2007/codeforces-a | abc864197532/normal/1383/B.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
#define lli long long int
#define fop(i,m,n) for (int i=(m);i<(n);i++)
#define FOP(i,m,n) for (int i=(m)-1;i>=(n);--i)
#define test(x) cout << #x << ' ' << x << endl;
#define printv(a) {\
for ... | ALGO | 0.9997 | 3.937407 | {
"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": "dac3b432506e... |
ff9fefb3-6e5c-465f-95e5-5c23cf81e1ff | manu-chroma/cp | codeforces/350/3.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int li;
int main(int argc, char const *argv[])
{
ios::sync_with_stdio(false);
li n;
cin >> n;
map <li,li> sci;
for (int i = 0; i < n; ++i)
{
li temp;
cin >> temp;
if(sci.find(temp) == sci.end())
sci[temp] = 1;
else sci[temp]++;
}
li... | ALGO | 0.999959 | 3.532327 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2015-10-10T16:28:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "157d26bc5... |
26f16317-7475-4b88-9228-793658722cd0 | goblivend/Courses | ing2/TELE/project/tele/tele.ino | //Arduino PWM Speed Control:
#include <Servo.h>
#define FORWARD LOW
#define BACKWARD HIGH
int car_speed_pin = 6;
int car_way_pin = 7;
int direction_servo_pin = 13;
Servo servo;
int r = 345; // [cm]
int L = 9.5; // [cm] Distance between front and back wheels
float turningAngle = 2 * degrees(atan2(L, r));
float con... | ALGO | 0.973866 | 5.73386 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2023-01-24T13:38: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": "e8c82eeeb6f... |
31177373-23ac-459b-8156-ac8046191395 | ishandutta2007/codeforces-a | arsijo/normal/542/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define files(x) freopen(x ".in", "r", stdin); freopen(x ".out", "w", stdout);
#define input freopen("input.txt", "r", stdin);
#define output freopen("output.txt", "w", stdout);
#define io input; output;
#define x first
//#define y second
#define sync ios_base::sync_with_st... | ALGO | 0.999933 | 3.143968 | {
"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": "89a5901e5d8f... |
0e04812b-1d7b-42b1-b4ae-68e00239ba08 | ishandutta2007/codeforces-r | rns_mhb/normal/456/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define N 100010
#define mc 26
int sz, n, k;
bool a[N], b[N];
char in[N];
struct node{
int nxt[mc];
}P[N];
int newnode() {
sz ++;
for (int i = 0; i < mc; i ++) P[sz].nxt[i] = 0;
return sz;
}
void add(char *s) {
int len = strlen(s), v = 0;
for (i... | ALGO | 0.99999 | 3.731007 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:58:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf464fc100e7... |
61979a55-f01e-4488-885a-243adbee5012 | cuom1999/CP | UTIPC2019_Fall/G/G.cpp | #include <bits/stdc++.h>
#define ld long double
#define sf scanf
#define pf printf
#define pb push_back
#define PI ( acos(-1.0) )
#define IN freopen("input.txt","r",stdin)
#define OUT freopen("output.txt","w",stdout)
#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 INF... | ALGO | 0.999273 | 3.573783 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2020-02-24T01:23:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "080e82bdc... |
d2ec022f-88c9-4e77-a0be-11d1368bd74a | injoe90/Algorithm-Study | CPP_STUDY/CPP_STUDY/BackupQueue.cpp | int main3() {
// 큐 구현하기: 10845번
/* int rangeNumber;
cin >> rangeNumber;
int queueList[10000];
int top = 0; int bottom = 0;
while (rangeNumber--) {
string queueMethod;
cin >> queueMethod;
if (queueMethod == "push") {
int inputNumber;
cin >> inputNum... | ALGO | 0.998783 | 3.980447 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2022-03-19T03:12:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0dc1f1bb92... |
9aa6276e-4dab-49bd-be4b-ffc9daeddea4 | AkashKumarMaurya01/LEET-POTD | Graph/1719_find_center_of_star_graph.cpp | #include <bits/stdc++.h>
using namespace std;
// time O(n) spaceO(m)
class Solution
{
public:
int findCenter(vector<vector<int>> &edges)
{
unordered_map<int, int> mp;
int n = edges.size();
for (auto i : edges)
{
mp[i[0]]++;
mp[i[1]]++;
}
... | ALGO | 0.999936 | 5.415607 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2024-06-16T19:37:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d785f5eaede... |
19601051-ef82-405c-ab33-97b7b0f34f8a | little-rookie-at-UJS/c | od/cf/500/cf822/c.cpp | #include "bits/stdc++.h"
using namespace std;
#ifndef ONLINE_JUDGE
#include "test.h"
#else
#define debug(...) 42
#define debug_assert(...) 42
#endif
#define IOS ios::sync_with_stdio(0),cin.tie(0)
using ll = long long;
using ull = unsigned long long;
#define endl '\n'
#define int ll
using VI = vector<int>;
usin... | ALGO | 0.999903 | 3.973161 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2024-04-02T11:29: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": "6b00474ca... |
98a3a03b-1593-4a55-8cd2-a2676793dc5c | patflick/mxx | include/mxx/sort.hpp | /*
* Copyright 2015 Georgia Institute of Technology
*
* 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 applicab... | ALGO | 0.999703 | 7.091517 | {
"github_metadata": {
"branch": "master",
"commit_count": 222,
"repo_created_at": "2015-05-03T19:58:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 74,
"forks": 20,
"issues": 7,
"pull_requests": 0
},
"file_meta": {
"content_id": "f16757... |
808c3b1d-3c05-40ee-bfe1-3a27130c5286 | Argons/LeetCode | Longest_Substring_Without_Repeating_Characters.cpp | // Given a string, find the length of the longest substring without repeating characters.
// For example, the longest substring without repeating letters for "abcabcbb" is "abc",
// which the length is 3. For "bbbbb" the longest substring is "b", with the length of 1.
class Solution {
public:
int lengthOfLongest... | ALGO | 0.999943 | 6.045656 | {
"github_metadata": {
"branch": "master",
"commit_count": 142,
"repo_created_at": "2013-12-06T04:26: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": "3fb911de... |
204e42f6-5fc4-4f30-aca2-84d2f45b1d52 | Yostita/ArbolesBinarios | ABB.cpp | /*----------------------------------*/
/* Practica 9. <NAME> */
/*----------------------------------*/
#include "ABB.h"
#include "assertdomjudge.h"
#include "iostream"
using namespace std;
ABB::ABB() {
raiz = NULL;
n = 0;
}
void ABB::insertar(int nuevoElemento) {
Nodo *nodo = new Nodo;
nodo->contenido = nuevo... | ALGO | 0.999824 | 4.002011 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2020-10-29T14:32:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d94160a943dd... |
76fcaee7-5a4e-4364-bffb-a711989ca38c | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/allpro_train/0_0_633.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> arr(n);
vector<int> firstSet, secondSet, thirdSet;
for(int i = 0; i < n; i++) {
cin >> arr[i];
}
for(int i = 0; i < n; i++) {
if(arr[i] < 0) {
fir... | ALGO | 0.999944 | 4.342226 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-04-28T03:59: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": "a58dce818f1... |
ad9d115b-38ea-45c4-b96a-483f1e8148e6 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Mixtral/top0-100/find-edges-in-shortest-paths-Solution.findAnswer/177911_Exec_Code_Overflow.cpp | tt_cmap10_validate( FT_Byte* table,
FT_Validator valid )
{
FT_Byte* p = table + 4;
FT_ULong length, count;
if ( table + 20 > valid->limit )
FT_INVALID_TOO_SHORT;
length = TT_NEXT_ULONG( p );
p = table + 16;
count = TT_NEXT_ULONG( p );
if (... | ALGO | 0.99469 | 5.484469 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-03-22T14:39:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "05779c83c69e... |
7dc8e66a-ac31-412b-9421-8b9ea85a9e47 | Ninja-nick-s/algorithms_cpp | heapsort.cpp | /*************************************Ninja-nick-s*****************************************/
#include <bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long long ll;typedef long double ld;typedef pair<int,int> pii;
#define F first
#define S second
#define PB push... | ALGO | 0.999899 | 4.183382 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2021-02-19T16:00: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": "5534922ad03... |
3a3de3d6-3b9c-4927-9010-4e3d56580570 | LucasRibbs/D.I.A-ExerciciosBeecrowd | PontosCocirculares/PontosCocirculares.cpp | #include <iostream>
#include <cmath>
#define QZERO 0.00000001
using namespace std;
struct ponto {
double x, y;
};
struct reta {
double a, b, c;
};
ponto P[101];
ponto PontoMedio(ponto p1, ponto p2) {
ponto p;
p.x = (p1.x+p2.x)/2;
p.y = (p1.y+p2.y)/2;
return p;
}
double DistanciaEntrePon... | ALGO | 0.999946 | 4.510591 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2022-02-21T01:40: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": "c41597965cf... |
ecb44534-1fad-4a60-8cc1-0bcf09dd06fd | Chunming/CS267-hw2 | particles/mpiChngFile/mpi.cpp | #include <mpi.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <math.h>
#include "common.h"
#include <string.h>
#include <vector>
#define subBlockLen 0.025
int compare(const void *a, const void* b) {
particle_t *a0 = *(particle_t**) a;
particle_t *b0 = *(particle_t**) b;
if (a0->global... | ALGO | 0.998367 | 4.528094 | {
"github_metadata": {
"branch": "master",
"commit_count": 291,
"repo_created_at": "2012-02-22T06:41:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "22412bef... |
fbdb4dd1-9abf-41f2-992b-b2f0f1631b1c | alvinhang/Projects | CECS325 Assignments/prog5/mysort.cpp | // <NAME>
// Class (CECS 325-01)
// Project Name(Prog 5 - Sorting Contest using Threads)
// Due Date (11/01/2023)
// I certify that this program is my own original work.I did not copy any part of
// this program from any other source.I further certify that I typed each and
// every line of code in this program.
#incl... | ALGO | 0.999705 | 4.995513 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-07-17T21: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": "405d69d6d2db... |
4f66a2ec-4b2d-45b8-a4cb-6edf0eb04d15 | iyzyi/KCTF-KeyME-Cracker | KCTF-zhuceji/KCTF-zhuceji.cpp | // KCTF-zhuceji.cpp : 开发者写出的注册机
//
#include "stdafx.h"
#include <stdint.h>
#include "md5.h"
#include <windows.h>
#include <math.h>
unsigned char ROL1(unsigned char x, unsigned char n) {
return (x >> (8 - (n % 8))) | (x << (n % 8));
}
void threeBaseOperation(uint8_t* user_md5_part2_md5, uint8_t* step2_1) {
// 三种基... | ALGO | 0.994479 | 3.170532 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2020-10-08T16:58:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b224ec6603e7... |
81ea905b-20bb-4b99-8d00-a5000c1879a4 | gnomegeek/cp-submissions | Leetcode/insert-into-a-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.99994 | 6.210184 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2021-03-17T18:52: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": "d881ffd0031... |
4eb30fdb-1a77-4729-9218-7e50b6bc127f | devangSinghh/dsa_question_bank | cp/cp/dp.cpp | #include "allheaders.h"
#ifdef _MSC_VER
# include <intrin.h>
# define __builtin_popcount __popcnt
#endif
using namespace std;
const int mod = 1e9 + 7;
/*
Given an array nums of integers, return the length of the longest arithmetic subsequence in nums.
subsequence of an array nums is a list nums[i1], nums[i2], ..., nu... | ALGO | 0.999503 | 3.605862 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2021-05-18T06:43: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": "3daca1ff9da... |
b6697831-2ff6-44c6-9671-038bbeb0776c | Sahil12S/LeetCode | Cplusplus/other/disjointSets2.cpp | // Implementation of Disjoint sets using Quick Find of Fast Union
#include <iostream>
using namespace std;
class DisjointUnionSets
{
private:
int* size;
int* height;
int* parent;
int numItems;
void makeSet();
void print();
public:
DisjointUnionSets(int n);
~DisjointUnionSets();
... | ALGO | 0.999106 | 5.64082 | {
"github_metadata": {
"branch": "master",
"commit_count": 335,
"repo_created_at": "2018-08-22T17:23: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": "cc16e86b... |
be96891e-a1f8-47a7-ba47-55ddd30226d4 | KeepCodeing/AlgorithmRecords | LuoGu/并查集/P2256 一中校运会之百米跑.cpp | #include <iostream>
#include <map>
using namespace std;
// 主要是怎么把字符串映射成下标,大概可以用map来
struct unionFind {
int bin[20010];
unionFind() {
for (int i = 1; i <= 20010; i++) bin[i] = i;
}
int anc(int x) {
if (x == bin[x]) return x;
bin[x] = anc(bin[x]);
return bin[x];
}
void uni(int x, int y) {
bin[anc(x)] = ... | ALGO | 0.999982 | 4.436076 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-08-04T00:50: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": "a27c2e5fb4b6... |
386bb91a-7dfc-4afd-a693-be4f7dc8c77d | MichaelRuhnke/ssa | ssa/types/edge_xycov_xycov.h | // Sparse Surface Optimization 2D
// Copyright (C) 2011 <NAME>, <NAME>, <NAME>, <NAME>
//
// SSA2D is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your opti... | ALGO | 0.970334 | 6.08348 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2012-10-03T19:37:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 12,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea90038... |
0bb75b92-a6a5-49cb-97da-fc0bad1ec321 | weehowe-z/Backup | os/memory.h | //this file is the main memory
//first version by array (pretent to implement as red black tree
#ifndef MEM_H
#define MEM_H
#include <queue>
#include <math.h>
#include <vector>
int process_name_to_int(string process_name);
int process_address_to_int(string address);
class addressinfo//to combine two important par... | ALGO | 0.995626 | 3.948309 | {
"github_metadata": {
"branch": "master",
"commit_count": 173,
"repo_created_at": "2015-10-02T13:30:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "125b9026... |
2018a2b6-8603-4556-83e4-273841083148 | xnmng/LeetCode | 0098-validate-binary-search-tree/98-validate-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.99996 | 6.301245 | {
"github_metadata": {
"branch": "main",
"commit_count": 4708,
"repo_created_at": "2022-08-08T03:21:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec5f110ab... |
9396e241-6c49-4451-adf7-9a1f888615ac | Azura-yuwi/Code | CSES/Graph/FlightRoutes.cpp | //CSES Graph
//Shortest Path
//** to review
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define f first
#define s second
//ll setmax = (1e9)*5000 + 100;
int main()
{
int n,m,k;
cin >> n >> m >> k;
vector<pair<int, int>> adj[n];
for(in... | ALGO | 0.999992 | 4.295537 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2021-05-02T04:12: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": "3b3fc688b68... |
1e942c60-83fa-4038-ba0e-b79b0d6cf527 | Ceedz1/DSA_SUMMER_2024 | myGraphs/myGraph.cpp | #include <stdio.h>
#include <stdlib.h>
#define MAX_VERTICES 26 // Assuming vertex labels are characters A-Z
// Structure for a node in adjacency list
struct AdjListNode {
char dest;
struct AdjListNode* next;
};
// Structure for adjacency list
struct AdjList {
struct AdjListNode *head;
};
// Structure fo... | ALGO | 0.999753 | 5.975516 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-06-13T15:32:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c132e19f37a... |
f2882e57-048d-4861-a137-21bd3dff54d8 | mariyaeggs/C_Methodology_Collection | C++_I_2015/W8 C++/W8_Prg_Eggensperger_Q3.cpp | // Week8.cpp
// Description: Write a program that computes total earnings for an employee.
// Date: 10.25.2015
// Name: <NAME>
// Compiler: Dev-C++ 5.11
#include <iostream>
using namespace std;
float get_hours();
float get_rate();
float earnings(float total);
int main() // main() function
{
float hours, // call v... | ALGO | 0.959966 | 3.265341 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2017-03-10T18:25:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "968df080e... |
c685c23d-4a46-44c7-b40f-4f8511c80567 | ishandutta2007/codeforces-r | radewoosh/normal/573/C.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
int p1, p2;
vector <int> graf[1000007];
//int wyw[1000007];
//int tak[1000007];
int lis[1000007];
int lis2[1000007];
int licz;
/*void czys(int v)
{
for (int i=0; i<graf[v].size(); i++)
{
if (wyw[graf[v][i]])
{
swap(graf[v][i]... | ALGO | 0.999974 | 3.755282 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:58:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "decf75f0b058... |
11d0aa9e-e199-4dfa-acb9-c442a6cd6ee9 | ssalinasfe/Compact-Polylla-Mesh | external/sdsl-lite/include/complementary/utils.hpp | #include <fstream>
#include <cstdlib>
#include <string.h>
#include "Graph.hpp"
/*
Format of the expected input/output file:
<number of nodes>
<number of edges>
<source vertex> <target vertex>
....
The list of edges (<source vertex> <target vertex>) must be ordered:
- First, all edges where vertex 0 i... | ALGO | 0.98038 | 5.58169 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2021-11-04T12:32:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "815438a21b1... |
f818191c-d98d-4f6f-823f-ce2ceaff5f6c | kammoh/pagsuite | oscm/inc/pagsuite/pagexponents.hpp | #ifndef PAGEXPONENTS_H
#define PAGEXPONENTS_H
#include <set>
#include <string>
//#include <cstdint>
//typedef long long int int64_t;
//typedef long long int int_t;
#include "pagsuite/compute_successor_set.h"
#include "pagsuite/types.h"
using namespace std;
namespace PAGSuite
{
bool getExponents(int_t a, int_t b,... | ALGO | 0.983638 | 3.873082 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2020-03-23T15:55:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8d39491... |
b29ec216-2470-42d9-99f5-6a4403d324c6 | TheTenzou/C-- | c++/sm2_1/sm2_1/sm2_1.cpp | // sm2_1.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <iostream>
#include <time.h>
#include <stdlib.h>
using namespace std;
int fvp(int a)
{
int b = 1;
int res;
while (a > b)
{
b *= 5;
}
a == b ? res = 1 : res = 0;
return res;
}
int ... | ALGO | 0.999702 | 4.305715 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-08-11T04:36:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac738f1e6... |
22651537-2aa3-4229-81f0-31f05c745501 | wengchic/Parallel-Programming | Simple OpenMP Experiment/main.cpp | #include <omp.h>
#include <stdio.h>
#include <math.h>
#define NUMT 1
#define SIZE 16384 // can change
#define NUMTRIES 20 // can change
float A[SIZE];
float B[SIZE];
float C[SIZE];
int
main( )
{
#ifndef _OPENMP
fprintf( stderr, "OpenMP is not supported here -- sorry.\n" );
retur... | ALGO | 0.998121 | 4.224038 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2022-09-02T00:43:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc38884baa2... |
99aee7f7-9c36-4763-97dc-74350486aefd | Superb-Man/Automaton-Solver | NFA-DFA-Regex/draw.cpp | #include"DFA.hpp"
#include <nlohmann/json.hpp>
using json = nlohmann::json;
void drawParseTree(const std::shared_ptr<AstNode>& root, const std::string& filename) {
std::ofstream dot_file(filename + ".dot");
if (!dot_file.is_open()) {
throw std::runtime_error("Unable to open file");
}
dot_fi... | ALGO | 0.979859 | 5.383558 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2024-05-17T14:52:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eded41dd8... |
d5a449cb-045f-4caf-bc79-2982d0928800 | Assylzhan-Izbassar/Codeforces | Training/#697 (Div. 3)/D?.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// sum(a[i]) >= m
// sum(b[i]) -> min
typedef pair<int, int> pii;
vector<pii> v;
bool f(pii a, pii b){
if(a.second < b.second){
return true;
}else if(a.second == b.second){
if(a.first > b.first){
ret... | ALGO | 0.999985 | 3.364083 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2020-07-29T15:54: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": "25201cec8... |
3accb235-af2f-4508-a369-4f0201206141 | jp-zuniga/Project-Euler | problems_cpp/044.cpp | // Problem URL: https://projecteuler.net/problem=44
// ---------------------------------------------------------------------------------
// P-n = (n * (3n - 1)) / 2
// ---------------------------------------------------------------------------------
// Find the pair of pentagonal numbers, j and k, for which:
// -> thei... | ALGO | 0.999737 | 5.881166 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2024-07-16T17:10:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ca0f469fd7... |
5adc92e4-9cdd-4796-a918-158ae0597d6d | shreyashji/SDE-Problems-Solutions | 17.Dynamic Programming/2. SubSequence & Subsets/15.Partition Equal Subset Sum.cpp | //memoization
#include <bits/stdc++.h>
//Time Complexity: O(N*K)here are N*K states therefore at max ‘N*K’ new problems will be solved + O(N) a for loop for ‘N’ times to calculate the total sum
//Space Complexity: O(N*K) + O(N) We are using a recursion stack space(O(N)) and a 2D array ( O(N*K)).
using namespace std;
b... | ALGO | 0.999968 | 5.634055 | {
"github_metadata": {
"branch": "main",
"commit_count": 214,
"repo_created_at": "2021-11-28T14:01:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92050fed6e... |
12176638-4cf7-424d-9fd5-aa78b271c99a | srabanimitra/my_codes | .vscode/codeforces solves/c.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
const int MAX_LIMIT = 1000000;
vector<int> distinct_primes(int max_limit) {
vector<int> count1(max_limit + 1, 0);
for (int i = 2; i <= max_limit; ++i) {
if (count1[i] == 0) {
for (int multiple = i; multiple <= max... | ALGO | 0.999838 | 5.217298 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-12-16T15:18: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": "cdfeee0af086... |
6f180148-3af8-43ee-9719-5ee28b9bcd5c | ja153903/problem-solving | main/leetcode/179.cpp | #include "lib/string_ops.h"
#include <string>
#include <vector>
class Solution {
public:
std::string largestNumber(std::vector<int>& nums) {
std::vector<std::string> nums_as_str;
for (const auto& num : nums) {
nums_as_str.push_back(std::to_string(num));
}
// custom s... | ALGO | 0.999898 | 6.828799 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-09-01T17:55: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": "f90bddc0c47... |
6d62e436-376b-4698-9027-debbc58a982d | yingl/LeetCodeInCpp | word_ladder_ii.cpp | class Solution {
protected:
void build_ladder(unordered_map<string, vector<string> > &traces,
const string &word,
vector<string> &ladder,
vector<vector<string> > &ladders) {
if (0 == traces[word].size()) {
ladder.push_back(word);
vector<string> tmp = ladder;
reverse(tmp.begin... | ALGO | 0.999796 | 4.851963 | {
"github_metadata": {
"branch": "master",
"commit_count": 152,
"repo_created_at": "2014-04-02T08:41:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 50,
"forks": 25,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aab9b9... |
4f4b576e-43bb-438b-b10b-aba85e9332ca | Snak0067/Algorithm-brush-problem | leetcode刷题笔记1/p1219 优化中间步骤.cpp | //#include<iostream>
//#include<unordered_map>
//#include<set>
//#include<vector>
//#include<string>
//#include<cmath>
//#include<algorithm>
//#include<map>
//#include<stack>
//#include<unordered_set>
//#include<queue>
//#include<limits.h>
//using namespace std;
//int n;
//vector<vector<int>>ans;
//vector<int>temp;
//... | ALGO | 0.999923 | 3.443052 | {
"github_metadata": {
"branch": "master",
"commit_count": 148,
"repo_created_at": "2022-09-14T13:23: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": "d70b17d8... |
4909902f-ca53-4d35-8c20-1c5ad7a48e15 | iitiansohan/important-algos | Graphs/DAGfromSCC.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
void dfs(int u,vector<bool> &vis,vector<vector<int>> &adj,stack<int> &order)
{
vis[u]=true;
for(auto ch:adj[u])
{
if(vis[ch]) continue;
dfs(ch,vis,adj,order);
}
order.push(u);
}
void dfsOnRev(int u,vector<bool> &vis,... | ALGO | 0.999991 | 4.263587 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-06-24T07:18:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "074fc2484f55... |
29f537da-73a7-49e0-a922-496eab0c8aba | vanpham1411/thuattoanungdungHUST | TRAINING 5/D. MAX EVEN SUBSEQUENCE.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 1e6+1;
int a[N];
int n;
long long s0[N],s1[N];
bool visited0[N],visited1[N];
long long ans = -1e9;
void input(){
cin>>n;
for(int i = 0; i<n;i++){
scanf("%d",&a[i]);
}
}
void compute(int k ){
if(a[k]==0){
if(k%2 == 0) {
visited0[0] = true;
s0[0... | ALGO | 0.999931 | 3.812122 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-05-26T16:24: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": "3ea80060f0... |
05d65200-460e-4cf6-9c1c-a1a6c184bb94 | Xyrotechnology/Project-Aidro | SD/libraries/Scripts/ultrasonic_avoidance/code_v3.ino |
#include<Servo.h> // Servo Library outputs PPM signal so we are adding the library
int mill=0,oldmill=0,curr=0;// Variables for calculating the time taken for one loop
int setpoint=110,Kp=2; // Process variables Setpoint is in centimeters below which the collision avoidance kicks in
// Kp is pr... | ALGO | 0.984413 | 4.693339 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2015-11-11T08:30:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7dcb4c8a7c... |
d631f8b4-e93d-4a53-8497-a8b1f43c01c1 | nielsSkov/p8-vessel-main | aauship_832_ws/src/aauship_control/src/lqr-controller-node.cpp | #include "ros/ros.h"
#include <std_msgs/Float32.h>
#include "aauship_control/LLIinput.h"
#include "aauship_control/Ref.h"
#include "aauship_control/AttitudeStates.h"
#include "aauship_control/PositionStates.h"
#include "aauship_control/KFStates.h"
#include <sstream>
#include <stdint.h>
#include <string>
#define _USE... | ALGO | 0.995278 | 5.265232 | {
"github_metadata": {
"branch": "master",
"commit_count": 169,
"repo_created_at": "2017-02-03T10:26:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e7619647... |
4ea548be-89c9-47a0-b123-a811d845644b | GarimaChaubey/DSA | Difficulty: School/Reversing the vowels/reversing-the-vowels.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
string modify (string s)
{
string vow;
for(char c : s)
{
if(c=='a'|| c=='e' || c=='i' || c=='o' || c=='u')
... | ALGO | 0.998512 | 5.73613 | {
"github_metadata": {
"branch": "main",
"commit_count": 247,
"repo_created_at": "2024-07-05T04: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": "adfa9e3ecb... |
f9a17166-afd9-4e65-b51e-8f9a308a8c05 | ishandutta2007/codeforces-z | zuza/normal/362/D.cpp | #include <algorithm>
#include <ctime>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
#include <iostream>
#include <set>
using namespace std;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define TRACE(x) cout << #x << " = " << (x) << endl
inline int... | ALGO | 0.99994 | 3.358135 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:43: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": "bb601263b8ed... |
83653f18-f5bc-45fd-8d01-9099fc5705f5 | microsoft/onnxruntime | onnxruntime/core/providers/cuda/tensor/scatter_nd.cc | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "core/providers/cuda/tensor/scatter_nd.h"
#include "core/providers/cuda/tensor/scatter_nd_impl.h"
#include "core/providers/cuda/tensor/scatter_nd_common.h"
#include "core/providers/cuda/shared_inc/cuda_utils.h"
#in... | TOOL | 0.974014 | 7.133611 | {
"github_metadata": {
"branch": "main",
"commit_count": 13200,
"repo_created_at": "2018-11-10T02:22:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 17252,
"forks": 3340,
"issues": 2017,
"pull_requests": 268
},
"file_meta": {
"content_id"... |
88ed617b-2abf-4972-b44a-4268e561beee | nkufree/vsprogram | sui7/sui7/sui7.cpp | #include<iostream>
using namespace std;
char a[20][10] = {};
int b[20] = {};
void swapstr(int j, int k)
{
char temp[10];
for (int i = 0; i < 10; i++)
temp[i] = a[j][i];
for (int i = 0; i < 10; i++)
a[j][i] = a[j - 1][i];
for (int i = 0; i < 10; i++)
a[j - 1][i] = temp[i];
}
void swap(int i, int j)
{
int te... | ALGO | 0.999993 | 3.394083 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-03-09T07: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": "57f5161009a6... |
11f08fff-2181-43de-9b9f-aef9c9501b43 | Cube219/PS | BOJ/1000~2000/1585 - 경찰.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#define _CRT_DECLARE_NONSTDC_NAMES 0 // for using y1 as variable name
#include <iostream>
#include <cstdio>
#include <utility>
#include <algorithm>
#include <queue>
#include <vector>
using namespace std;
using ll = long long int;
constexpr int INF = 987654321;
template <int N>
class... | ALGO | 0.999984 | 3.992195 | {
"github_metadata": {
"branch": "main",
"commit_count": 1172,
"repo_created_at": "2021-01-20T03:42:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "24c60acef... |
8f89e00e-01c5-4ab6-afb6-9ba105f0550a | p-adic/Mathematics | Geometry/AffineSpace/ConvexHull/a_Body.hpp | // c:/Users/user/Documents/Programming/Mathematics/Geometry/AffineSpace/ConvexHull/a_Body.hpp
#pragma once
#include "a.hpp"
#include "../Area/a_Body.hpp"
template <typename INT , template <typename...> typename PAIR> template <template <typename...> typename VEC> inline ConvexHull<INT,PAIR>::ConvexHull( const VEC<PA... | ALGO | 0.988518 | 4.895368 | {
"github_metadata": {
"branch": "master",
"commit_count": 2368,
"repo_created_at": "2019-12-14T13:17:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "532d4ba... |
1181bae0-aa98-4179-a4db-be6cc8b02a3e | F-0728/atcoder | ABC/D/349D.cpp | #include <atcoder/all>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
using namespace std;
using namespace atcoder;
// using mint = modint1000000007;
using mint = modint998244353;
using ll = long long;
const ll inf = 1 << 30;
const ll INF = 1LL << 60;
#define rep(i, n) for (ll i ... | ALGO | 0.999704 | 3.858497 | {
"github_metadata": {
"branch": "main",
"commit_count": 708,
"repo_created_at": "2024-04-09T10:20: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": "897c9a0e9d... |
6d400811-eb3d-473f-9426-3c05d3966bf1 | sujaljain11/CodeChef | A_Game_23.cpp | #include <bits/stdc++.h>
#define pi (3.141592653589)
#define pb push_back
#define pp pop_back
#define py cout<<"YES"<<endl
#define pn cout<<"NO"<<endl
#define ll long long int
#define rrep(i, n) for(ll i=n-1;i>=0;i--)
#define lp(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i... | ALGO | 0.999958 | 3.83764 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2022-08-28T09:33: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": "00eb14b3a... |
6d7b9458-bfdf-4e69-b10e-f4aa09a4d0a7 | Hariscoding/Alghoritms-Data-structures | ASP C++/Haris_Hrustic_Zadaca3_ind_46/Z32_Haris_Hrustic_46.cpp | #include <iostream>
#include<list>
#include<cmath>
//<NAME> br:46 H.H
using namespace std;
void heapify(int niz[], int duzina, int i){
int najveci = i;
int lijevi = 2 * i + 1;
int desni = 2 * i + 2;
if (lijevi < duzina && niz[lijevi] > niz[najveci])
najveci = lijevi;
if (desni < duz... | ALGO | 0.999876 | 3.950621 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-04-28T13:44: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": "343729ab50... |
06970d08-7831-40cb-8fb9-6800b4f44910 | bryan23567/SUSTECH-CS205-C-CPP-2023 | project2/main.cpp | #include <cmath>
#include <chrono>
#include <iostream>
#include <vector>
using namespace std;
using namespace std::chrono;
int main(int argc, char const *argv[])
{
srand((float)time(NULL));
for (int n = 1; n < 1000000000; n *= 10)
{
float *vec1 = (float *)malloc(n * sizeof(float));
float *v... | ALGO | 0.991575 | 4.86972 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-02-19T10:37:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "828ef8f46df9... |
a1262b4f-afcd-45ce-9692-f6d9cd58f8c7 | satyamjha2001/More-on-Functions-in-CPP-Part-2 | 7.More on Functions in C++/4SwapTwoArrays.cpp | #include <iostream>
using namespace std;
void swapArray(int *, int *, int, int);
int main()
{
int m, n, a[30], b[30];
cout << "Enter size of 1st array" << endl;
cin >> m;
cout << "Enter size of 2nd array" << endl;
cin >> n;
cout << "Enter elements of 1st array" << endl;
for (int i = 0; i < m... | ALGO | 0.999864 | 4.125844 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-08-20T18:43: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": "e2727f481328... |
11c26f31-5c1a-4997-80ce-ff2fde96a6e9 | Gautham-JS/ROS_Stereo_SLAM | src/bundleAdjust.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include "Eigen/Core"
#include <opencv2/core.hpp>
#include <opencv2/features2d.hpp>
#include <opencv2/xfeatures2d.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include "opencv2/highgui/highgui.hpp"
#include <opencv2/opencv.hpp>
... | ALGO | 0.997291 | 4.881609 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2021-01-27T16:48:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "30f974803ed... |
8eb10587-d818-4536-861e-ffbe95bc116d | omgulshan/Dsa-leetcode-gfg-nextleap | 0807-max-increase-to-keep-city-skyline/0807-max-increase-to-keep-city-skyline.cpp | class Solution {
public:
int maxIncreaseKeepingSkyline(vector<vector<int>>& grid) {
vector<int>rowMax;
vector<int>colMax;
int maxi = -1;
for(int i = 0; i<grid.size(); i++){
maxi = -1;
for(int j = 0; j < grid.size(); j++){
maxi = max(maxi, grid[... | ALGO | 0.99996 | 6.187929 | {
"github_metadata": {
"branch": "main",
"commit_count": 81,
"repo_created_at": "2023-09-08T11:29: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": "d2592b29cf8... |
a84b4932-3bc8-4676-9f7a-9752b1ed01e7 | oneapi-src/oneAPI-samples | DirectProgramming/C++SYCL/Jupyter/oneapi-essentials-training/04_SYCL_Sub_Groups/lab/sub_group_shuffle.cpp | //==============================================================
// Copyright © Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <sycl/sycl.hpp>
using namespace sycl;
static constexpr size_t N = 256; // global size
static constexpr size_t B ... | ALGO | 0.960963 | 5.462675 | {
"github_metadata": {
"branch": "main",
"commit_count": 2599,
"repo_created_at": "2020-05-27T04:52:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1054,
"forks": 727,
"issues": 59,
"pull_requests": 7
},
"file_meta": {
"content_id": "959b... |
e8f5275a-2246-4ece-9340-3cc9dd8bb889 | rsenn/plot-cv | opencv/disabled/benchmark.cpp | #include "opencv2/core/utility.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/tracking.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/plot.hpp"
#include "samples_utility.hpp"
#include <fstream>
#include <iomanip>
#include <iostream>
using namespace std;
// using namespace cv;
// TODO: do normalization a... | ALGO | 0.997017 | 5.946367 | {
"github_metadata": {
"branch": "main",
"commit_count": 5134,
"repo_created_at": "2019-09-11T10:28: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": "92da0a235... |
532fd9ff-5ec4-4788-8281-c7049a589c6a | OnurCelebiii/DataStructuresClasses | src/DoubleLinkedListClass.h | #include<iostream>
using namespace std;
template<class T>
struct Node{
Node* next;
Node* prev;
T variable;
};
template<class T>
class DoubleLinkedList{
private:
Node<T>* head;
Node<T>* tail;
int m_length;
void createFirstItem(Node<T>* item){
item->next = nul... | ALGO | 0.986572 | 4.488797 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2023-11-03T21:22:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f1a527db9a... |
e8a3fb95-302a-4fc1-803e-83a2ea768dea | lcy960729/Algorithm_Solution_Collection | Baekjoon/DynamicProgramming/1520.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
int arr[501][501];
long long memo[501][501];
int N, M;
long long dp(int n, int m)
{
long long &memoValue = memo[n][m];
if (n == 0 && m == 0)
{
return 1LL;
}
if (memoValue != -1)
{
return memoVal... | ALGO | 0.999995 | 3.997726 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2020-10-19T13:03:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45b74a73273... |
d6ba5a77-51d9-41ee-b94f-a591eb3ecb57 | oecu-class-advanced-cpp2/ht18a052-cpp2 | ex-1-main.cpp | #include <iostream>
#include<ios>
#include<iomanip>
#define CPP2_PRIME_UPPER_LIMIT 1000000 //探索する値の上限値。
using namespace std;
/* --------------------------------------------------------------- /
/*
* nth_prime
*
* 与えられた正整数 a と d と n に対して、この等差数列に含まれる n 番目の
* 素数を返す。
*
* TODO: この nth_prime 関数を実装せよ。必要であれば他に関数や
* ファイルを作成せよ。... | ALGO | 0.999864 | 3.583191 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-10-20T03:37:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5bd9095553... |
94fda036-4f74-4dd2-bb97-759874320152 | qx1551/Vector | vector/vectordes.h | #pragma once
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <chrono>
#include <random>
using Rank = unsigned int; //秩
#define DEFAULT_CAPACITY 3 //默认的初始容量(实际应用中可设置为更大)
using namespace std;
template <typename T> class Vector { //向量模板类
protected:
public:
Rank _size; Rank _capacity; T* _elem; //... | TOOL | 0.996208 | 4.273104 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-03-19T07:25: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": "fe77ca0f453... |
ed853bbd-ce9d-4c46-b852-d1b9e69523d1 | divcs/I-am-neo | I_am_neo/Unit 3/Lec 14/Coding Que/Q4/4.cpp | /*
Create a program that manages distances using the Distance class. The program should allow you to input two distances in feet and inches, and it will calculate their sum. The Distance class contains methods for setting distances, adding distances, and displaying distances. The program will create two Distance object... | ALGO | 0.986145 | 5.262403 | {
"github_metadata": {
"branch": "main",
"commit_count": 174,
"repo_created_at": "2024-09-06T18:15:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f95d0dcca... |
87e68f5a-4cca-4322-bac0-ad40e0e5faca | RafaelSchmidtDP/Code | SudokuProgamaçãoTrabalho.cpp | // Autores: <NAME>, <NAME>, <NAME> E JÕAO. V DE PAULA.
// TRABALHO SUDOKU - ALGORITMOS 1
#include <cstdlib>
#include <ctime> // para utilizar a função de números aleatórios
#include <iostream>
#include <time.h>
#include <unistd.h>
using namespace std;
#define TAM 9
int main() {
int inicio, escolhademat; // vari... | ALGO | 0.992219 | 4.308543 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-07-03T23:49:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a8f4453524... |
850115f6-9959-486f-abbf-da6664dcd061 | pavel-ryzhov/global_vars | runs/003250.cpp | #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
//#include <fstream> //////////////////////////////////////////
//#include <time.h> /////////////////////////////
using namespace std;
void matr_view (vector <pair <int, int> >&, int, int);
int main (void)
{
unsigned int num... | ALGO | 0.999977 | 4.374671 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-07-04T20:43: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": "04a3a8624d26... |
794361d8-f493-46cb-9c92-9e43c609c2ed | Forreca05/Delivery-Truck-Pallet-Packing-Optimization | src/main.cpp | /**
* @file main.cpp
* @brief Entry point for the Delivery Truck Pallet Packing Optimization project with enhanced CLI and tabular results.
*/
#include <chrono>
#include <filesystem>
#include <iomanip>
#include <iostream>
#include <limits>
#include <string>
#include <vector>
#include "algorithms.h"
#include "parser... | TOOL | 0.994627 | 7.270791 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2025-04-21T22:18: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": "c6d4f87581a... |
9a5def99-97f0-418b-a0e6-cb50a4bca398 | ishandutta2007/codeforces-t | timmyfeng/normal/590/A.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 500000;
int a[N], b[N];
bool diff[N];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
for (int i = 1; i < n - 1; ++i) {
diff[i] = (a[i - 1] != a[i] && a[... | ALGO | 0.999986 | 3.611598 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:27: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": "e4a7db454e54... |
1270669d-2467-428c-a131-3c4408ea6065 | DominicaLxd/cmake_learning | MFCC/main.cpp | #include <iostream>
#include <fstream>
#include "opencv2/opencv.hpp"
//#include "include/mfcc.hpp"
//#include "include/sas_util.h"
#include "wavreader/wavreader.hpp"
#include "include/AudioFFT.hpp"
int nSamplesPerSec = 16000; //采样率(每秒样本数) //Sample rate.(keda, thchs30, aishell)
int length_DFT = 2048... | ALGO | 0.973953 | 4.848194 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2020-12-14T23:15:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dde61be0daff... |
4e68d446-6c33-4dee-ac5b-41e92bd60694 | Vishwa-0502/5-State-CPU-Simulator | Exit.cpp | /*#include <iostream>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <fcntl.h>
#include <string.h>
#include <chrono>
#include <ctime>
#include "Queue.h"
#include "Procs.h"
using namespace std;
#define newline write(fd, "\n", 1)
#define writevalue write(fd, to_string(value).c_str(), strlen(... | TOOL | 0.950593 | 4.973897 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-07-04T14:26:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "033ec390d96f... |
0d54b842-91d9-4fc9-a1bb-74636cc52525 | jiy12345/Beakjoon-Online-Judge | Graph Theory/1944 - 복제 로봇.cpp | #include<iostream>
#include<queue>
#include<cstring>
#include<algorithm>
using namespace std;
#define MAX 50
// 출발점을 포함한 최대 키 개수 251개 이므로
#define MAX_KEY 252
int N, M;
int maze[MAX][MAX];
bool isVisited[MAX][MAX];
int Parent[MAX_KEY];
vector<vector<int>> keyLocations;
vector<vector<int>> possibleLinks;
int di[4] = {... | ALGO | 0.999815 | 3.77024 | {
"github_metadata": {
"branch": "master",
"commit_count": 1571,
"repo_created_at": "2020-09-04T08:24:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 11,
"pull_requests": 0
},
"file_meta": {
"content_id": "023b33... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.