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 |
|---|---|---|---|---|---|---|---|
47f36cb8-5f7b-445d-bd41-61e83746acaa | aleksShif/CSCI135 | SoftRec_Notes/10_10/vigenere.cpp | /*
Author: <NAME>
Course: CSCI-135
Instructor: Professor <NAME>
Assignment: Lab6C
This program incorporates the vigenere shift to the user's input plaintext, using the user's input keyword.
*/
#include <iostream>
using namespace std;
string encryptVigenere(string plaintext, string keyword) {
string res;
in... | ALGO | 0.999913 | 5.341212 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-10-11T16:12: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": "7ec81314eae3... |
bae192a5-1fe4-4cb6-92fa-dc7eed494879 | piotrcurious/Grothendieck_legacy_junkbox | Weyl/filter10.ino | #include <Arduino.h>
#include <arduinoFFT.h>
#include <stdint.h>
#include <limits.h>
// ***************************************************************************
// Fixed‑Point Arithmetic Setup (Q16 Format)
// ***************************************************************************
#define Q_SHIFT 16 ... | ALGO | 0.999542 | 6.896013 | {
"github_metadata": {
"branch": "main",
"commit_count": 396,
"repo_created_at": "2024-07-23T22:27: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": "9e1627df8a... |
470e2c78-0a9c-4e36-8651-845d1e2b447e | youfoundmee/CP-Problems | D_Kevin_and_Competition_Memories.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <bits/stdc++.h>
#include <string>
#include <cstring>
#define ll long long
#define nl endl
#define ld long double
#define gcd(a,b) __gcd<long long>(a,b)
#define lcm(a,b) (a * (b / gcd(a,b)))
#define pb push_back
#define umii unordere... | ALGO | 0.999968 | 4.159495 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-05-05T13:08: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": "57c2413af02... |
338ecb29-1f55-4350-8fc4-aebb78cb0676 | tibi-p/steam-roll | codechef/challenge/sept13/leexams/leexams.cpp | #include <algorithm>
#include <cstdio>
#define MAX_N 50
#define MAX_VALUE 16
#define pow2i(x) (1 << (x))
using namespace std;
int a[MAX_N];
int b[MAX_N];
int p[MAX_N];
pair<double, int> dp[1 << MAX_VALUE];
int skip_whitespace()
{
int ch;
while (true) {
ch = getchar_unlocked();
if (ch != ' ' && ch != '\n')
... | ALGO | 0.998728 | 4.052895 | {
"github_metadata": {
"branch": "master",
"commit_count": 241,
"repo_created_at": "2012-10-21T17:41: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": "c68e1b19... |
8510add2-de0a-4df9-9780-1f30723d5f98 | dl8sd11/online-judge | 0contest/FB2019_R2/pC.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
typedef pair<double,double> pdd;
#define MEM(a, b) memset(a, (b), sizeof(a))
#define SZ(i) int(i.size())
#define FOR(i, j, k, in) for (int i=j ; i<k ; i+=in)
#define RFOR(i, j, k, in) for (int i=j ; i>=k ; i-=in)
#define REP(i... | ALGO | 0.999676 | 3.231042 | {
"github_metadata": {
"branch": "master",
"commit_count": 332,
"repo_created_at": "2017-11-19T05:47:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d9900f80... |
89e7c6f8-6d8d-4d47-ad6e-9cb461fc2a9b | ahqmrf/desktopUva | 195 -Anagram.cpp | #include <iostream>
#include<string>
#include<cctype>
using namespace std;
int compare(char a, char b)
{
if(tolower(a) == tolower(b))
{
if(a == b) return 0;
else if(a<b) return -1;
else return 1;
}
else if(tolower(a) < tolower(b)) return -1;
else return 1;
}
string mySor... | ALGO | 0.999917 | 4.318031 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2015-03-19T06:49: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": "399cc5d319... |
0ccfaf54-a496-4dbc-a78c-0e6afef4bd0d | ishandutta2007/codeforces-e | ezladder/normal/1146/D.cpp | #include <bits/stdc++.h>
#define pb push_back
#define all(a) a.begin(), a.end()
#define mp make_pair
#define x first
#define ll long long
#define y second
using namespace std;
int a, b, m;
bool was[5000007];
int cnt = 1;
int MA;
void go(int pos){
vector<int> t;
t.pb(pos);
int uk = 0;
while(uk < t.size()){
int... | ALGO | 0.999784 | 3.333238 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:34: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": "e25f1c63fde0... |
8c428df6-8dcd-4148-af72-1772188af172 | VieuxThomas/SLAM_Acheter_Ok_S-bastienMaciolek_ThomasVieux | main.cpp | /**
* @file main.cpp
* @author <NAME>
* @date vendredi 4 septembre
* @brief ce programme sert a determiner si un nombre entrer par l'utilisateur est premier
*/
#include<iostream>
using namespace std ;
int main ()
{
//Déclaration des variables
int faux, compteur, total, nbr;
//Demande a l'utilisateur un nombre
... | ALGO | 0.99862 | 3.04122 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2015-10-16T11:58:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac1c0b614... |
43a58f9d-bf12-4519-bf85-b167970fc09e | DEVANGBAJPAI23/DS-LAB-WORK-DEVANG-BAJPAI | 30 stack using linked list.cpp | #include <iostream>
using namespace std;
class Node {
public:
int data;
Node* next;
Node(){
this->data = 0;
this->next = NULL;
}
};
class Stack {
private:
Node* top;
public:
Stack() {
top = nullptr;
}
void push(int value) {
Node* newNode = new Node;
newN... | ALGO | 0.982893 | 5.306319 | {
"github_metadata": {
"branch": "main",
"commit_count": 182,
"repo_created_at": "2023-10-14T16:17: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": "2bdaada47f... |
a33769d0-2b88-48b6-ac91-2643d2d5fd7b | Farama-Foundation/ViZDoom | src/vizdoom/tools/re2c/dfa.h | /* $Id: dfa.h 569 2006-06-05 22:14:00Z helly $ */
#ifndef _dfa_h
#define _dfa_h
#include <iosfwd>
#include <map>
#include "re.h"
namespace re2c
{
extern void prtCh(std::ostream&, uint, bool useTalx = true);
extern void prtHex(std::ostream&, uint, bool useTalx = true);
extern void prtChOrHex(std::ostream&, uint, bool... | ALGO | 0.94516 | 6.306183 | {
"github_metadata": {
"branch": "master",
"commit_count": 1911,
"repo_created_at": "2015-06-26T18:38:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1862,
"forks": 418,
"issues": 31,
"pull_requests": 2
},
"file_meta": {
"content_id": "9e... |
5951ba9b-7772-4ec2-ac9f-6f7515570c62 | thahn106/Codeforces | Competition Rounds/Educational Codeforces Round 118/1613E.cpp | #include <bits/stdc++.h>
#define forn(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main()
{
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int t;
cin >> t;
while (t--)
{
int N, M;
cin >> N >> M;
auto bc = [&](int y, int x)
{ return 0 <= y && y... | ALGO | 0.999931 | 4.05058 | {
"github_metadata": {
"branch": "master",
"commit_count": 376,
"repo_created_at": "2021-11-28T06:41:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc5236d8... |
3b4644e8-6aec-4c7c-995a-b01f01bbca9e | ruudkoot/Ammeraal | ex2_8/ex2_8.cpp | // ex2_8.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
int main()
{
int n, k;
cin >> n >> k;
for (int i = n; i > 0; i--)
for (int u = 0; u < k; u++)
{
for (int j = n; j > 0; j--)
... | ALGO | 0.999944 | 4.280983 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-08-30T10:26: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": "029460ab2e... |
ea9ed685-ded3-40de-8ffd-5b5f90e0c797 | sakiib/RandomSolving | Kickstart/2022/Round A/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define Case "Case #" << tc << ": "
const int N = 5e4 + 5;
int len;
string s;
int dp[N][3][3][3][3][3][3];
bool palindrome(int l, int b1, int b2, int b3, int b4, int b5, int b6) {
if (l == 5) {
return b1 == b5 && b2 == b4;
}
if (l == 6) {
... | ALGO | 0.999981 | 4.57361 | {
"github_metadata": {
"branch": "master",
"commit_count": 394,
"repo_created_at": "2020-08-16T10:57: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": "1b13993f... |
753e16a4-e5a9-41bc-b29e-bc42ba30909f | purebluee/Leetcode | cpp/79-WordSearch.cpp | class Solution {
public:
bool exist(vector<vector<char>>& board, string word) {
int m = board.size(), n = board[0].size();
vector<vector<bool>> visited(m, vector<bool>(n, false));
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
if (checkWord(board, w... | ALGO | 0.999808 | 6.475933 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2016-10-02T00:17: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": "10e94018... |
19e83902-7599-4be8-a012-3cdf3db4e183 | RyanBarbalho/Teoria-de-grafos | prim/prim.cpp | #include <iostream>
#include <list>
#include <queue>
#include <vector>
#include <limits.h>
#include <stdlib.h>
#include <string>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <ostream>
#include <string.h>
using namespace std;
#define inf 9999999
// algoritmo de prim
class grafo
{
private:
in... | ALGO | 0.999377 | 4.15542 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2023-05-18T13:45: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": "a2896f9530... |
57928397-1254-4e77-89a6-219613868377 | BCLCommons/bcl | source/quality/bcl_quality_lcs.cpp | // (c) Copyright BCL @ Vanderbilt University 2014
// (c) BCL Homepage: http://www.meilerlab.org/bclcommons
// (c) BCL Code Repository: https://github.com/BCLCommons/bcl
// (c)
// (c) The BioChemical Library (BCL) was originally developed by contributing members of the Meiler Lab @ Vanderbilt University.
// (c)
// (c) T... | ALGO | 0.978469 | 3.171411 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2022-05-21T17:35:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 29,
"forks": 19,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "0bb2b40a... |
f61d8ae9-8a5d-4b05-aa80-5e8a6be81356 | thaakur/CipherSchools_Assignment | Practice Sheet 4/knightTour.cpp | class Solution {
public:
#define POSSIBLE_MOVES 8
int xMoves[8]={2,1,-1,-2,-2,-1,1,2};
int yMoves[8]={1,2,2,1,-1,-2,-2,-1};
bool isSafe(vector<vector<int>> &board, int row, int col,int N)
{
if(row<0 || row>=N || col<0 || col>=N || board[row][col]!=0){
return false;
}
... | ALGO | 0.999685 | 5.359092 | {
"github_metadata": {
"branch": "main",
"commit_count": 191,
"repo_created_at": "2021-02-13T13:09: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": "7ad4500057... |
b330a57f-f9c3-4477-9905-520a14b7562b | kamyu104/LeetCode-Solutions | C++/design-snake-game.cpp | // Time: O(1) per move
// Space: O(s), s is the current length of the snake.
class SnakeGame {
public:
/** Initialize your data structure here.
@param width - screen width
@param height - screen height
@param food - A list of food positions
E.g food = [[1,1], [1,0]] means the firs... | ALGO | 0.999895 | 6.186224 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
3d9f10fa-a9cd-4726-b5e7-cf897e772d33 | heesooyaam/AlgoTemplates | Strings/hash.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define eb emplace_back
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define ss second
#define ff first
#define mp make_pair
#define all(x) (x).begin(),(x)... | ALGO | 0.99981 | 4.665501 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-11-10T13:52: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": "66ae12f191a... |
433070f7-21ec-4acb-8a02-14b217a435da | naeem-hasan/CompetitiveProgramming | Codeforces -A2OJ Ladders/Div 2 B/454B.cpp | // I write these codes in steel, for anything not set in metal cannot be trusted
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
int n;
cin >> n;
int arr[n];
int t = 0;
bool assigned = false;
cin >> arr[0];
for (int i = 1; i < n; i++) {
... | ALGO | 0.999985 | 3.653495 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-11-21T08:31:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40533d2a66... |
2d6145e5-3434-48ee-ba91-e02b0dcc3cb9 | DimitriCHEVALIER/CPC_Answers | 0-1 knapsack.cpp | // complexity : log(n)+(n)+nē
#include <iostream>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false); //useful to accelerate execution
//cout << "nbr iterations" << endl;
int nbrIte;
cin>>nbrIte;
for(int y=0;y<nbrIte;y++)
{
//cout<<"nbr typeObj"<<endl;
int nbrO... | ALGO | 0.999917 | 3.665254 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-01-22T20:04:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d0bf46da9... |
d9667a41-47d8-4bfd-9f49-2e45d925cf9d | gean-dev/icpc-book | online-judge/yosupo/convolution_mod.cpp | #include<bits/stdc++.h>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(),(x).end()
using namespace std;
using ll = long long;
using db = long double;
using vi = vector<int>;
using vl = vector<ll>;
using vd = vector<db>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using pdd = pair<db,db>;
const int INF... | ALGO | 0.999995 | 3.612836 | {
"github_metadata": {
"branch": "main",
"commit_count": 180,
"repo_created_at": "2023-11-01T16:50:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc28fab6f53... |
b9ef8b3f-09c4-4492-b213-b44a5a9bd2d9 | easypeasy944/PCB | Core/ACOAlgorithm.cpp | //
// Created by <NAME> on 20/05/2018.
//
#include <cstdint>
#include <unordered_set>
#include "ACOAlgorithm.h"
#include "Input.h"
#include "vector"
#include "map"
#include "Edge.h"
#include "CrossPoint.h"
#include "set"
#include "Constants.h"
#include "Coordinate3D.h"
#include "Random.h"
#include "unordered_map"
#inc... | ALGO | 0.999821 | 4.723035 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-05-22T05:39: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": "c1cb7efd6e... |
0c833a58-603c-429b-8d53-2e811d84d461 | aresceribilis/NURE-projs | Discrete Math/Boolean fucn value table/Boolean fucn value table.cpp | #include<iostream>
#include<iomanip>
using namespace std;
int main() {
cout << " A B C D !D*C !(!A + B + C)||D !(A * B && !C * D) !(z + y) F = x + g\n";
for (int A = 0; A < 2; ++A) {
for (int B = 0; B < 2; ++B) {
for (int C = 0; C < 2; ++C) {
for (int D = 0; D < 2;... | ALGO | 0.947988 | 3.488971 | {
"github_metadata": {
"branch": "main",
"commit_count": 87,
"repo_created_at": "2021-03-04T20:36:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fba241a3855... |
bdd8dd10-e8d8-4109-944c-6d57b04e37d4 | GIT-heyok/PS | BOJ/Solutions/Graph Theory/Dijkstra's Algorithm/11779.cpp | #include <bits/stdc++.h>
#define FAST \
ios::sync_with_stdio(false); \
cin.tie(nullptr); \
cout.tie(nullptr);
using namespace std;
#define endl '\n'
typedef long long ll;
int INF = 1e9;
int main() {
FAST
int n, m;
cin >> n >> m;
int dist[n+1];
for (int i =... | ALGO | 0.999997 | 4.201788 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2023-01-14T04:32:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "35118b89e12... |
4775af21-41be-497b-89f1-257d79232c8d | m4rcus06/CP | codeforces/Contest/1955E/main.cpp | #include <bits/stdc++.h>
using namespace std;
using lli = int64_t;
//replace with your directory
#ifdef LOCAL
#include <C:/Coding/CP/templates/content/debug/debug.h>
#else
#define debug(...)
#endif
void solve() {
int n; cin >> n;
vector <int> a(n);
for (int i = 0; i < n; ++i) {
char c; cin >> c;
a[i] = c - '... | ALGO | 0.999933 | 4.218803 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2024-09-24T16:21:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c13d283c747... |
629ac2a1-06a5-4b1a-aab4-710b552751af | miraz23/Competetive-Programming | A_One_and_Two.cpp | ///////////////////////////////
// //
// Md.<NAME> //
// //
///////////////////////////////
#include<bits/stdc++.h>
#define in1 cin >> t
#define in2 cin >> n
#define in3 cin >> a[i]
#define in4 cin >> s
#define f flag
#define f1 int flag = 1
#define ff1 flag = 1
... | ALGO | 0.9993 | 3.599822 | {
"github_metadata": {
"branch": "main",
"commit_count": 121,
"repo_created_at": "2024-03-20T18:49:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "55da0adf74... |
c7074ca6-2178-4ed9-9157-42bea7eaa8c0 | ketkimnaik/Algorithms | 1462_Course_Schedule_IV.cpp | Optimized Approach:
class Solution {
public:
vector<bool> checkIfPrerequisite(int n, vector<vector<int>>& prerequisites, vector<vector<int>>& queries) {
vector<vector<int>> adj(n,vector<int>());
vector<int> indegree(n, 0);
if(prerequisites.size() == 0) {
return vector<bool>(quer... | ALGO | 0.99973 | 6.12378 | {
"github_metadata": {
"branch": "master",
"commit_count": 390,
"repo_created_at": "2019-10-21T02:49: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": "a2ec4616... |
5e420d2e-1038-4338-a1d6-a553de1f19c9 | gonzalo-aguero/cpp-course | omegaup/estructuras-de-control-repetitivas/G-Asteriscos 3.cpp | #include <iostream>
using namespace std;
int main() {
int n,m = 1, columns, middle;
cin >> n;
columns = 2*n -1;
middle = (columns-1)/2 + 1;
cout << "columns: " << columns << endl;
cout << "medio: " << middle << endl;
for (size_t i = 0; i < n; i++)
{
for (size_t j = 0; ... | ALGO | 0.999928 | 3.289498 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-09-01T23:27: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": "aa528e1e62bc... |
609b5f59-0ea6-4c74-b21c-ed259cd88815 | yyyeader/ACM | HDU/HDU 2222Keywords Search(AC自动机模板).cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<queue>
#include<algorithm>
using namespace std;
const int N=1e6+5;
const int M=5e5+5;
int idx;
int trie[M][26],fail[M],cnt[M];
char s[N];
int newnode(){
for(int i = 0 ; i < 26 ; i++) {
trie[idx][i] = -1;
}
cnt[idx++] = 0;
return id... | ALGO | 0.999607 | 3.546581 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-05-25T05:55:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "31f67121b6... |
cbf4815e-a6db-4fc2-b71a-73cd9a6aa289 | YoungCIoud/PracticeOfFishAcmer | 2024summer/hdu/7/1010.cpp | #include<bits/stdc++.h>
#define IOS std::ios::sync_with_stdio(false), std::cin.tie(0), std::cout.tie(0)
#define vct std::vector
#define ary std::array
#define str std::string
using i64 = long long;
constexpr i64 Mod = 998244353, Inf = 1e18;
constexpr int N = 1e5, M = 1e9;
void solve()
{
int n = 0, x = 0, k = 0;
... | ALGO | 0.999954 | 5.173729 | {
"github_metadata": {
"branch": "main",
"commit_count": 277,
"repo_created_at": "2024-05-14T13:12: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": "fb3badc70f... |
2897ebd1-dda0-4baa-ae0b-dab79350d15f | Ahnaf-41M/Problem-Solving-in-Online-Judges | Spoj/NGIRL - Namit In Trouble.cpp | #include "bits/stdc++.h"
#define ff first
#define ss second
#define MX 110005
#define pb push_back
#define int long long
#define PII pair<int,int>
#define endl "\n"
#define all(v) v.begin(),v.end()
#define rep(i,a,b) for(int i = a; i <= ... | ALGO | 0.999963 | 4.111714 | {
"github_metadata": {
"branch": "master",
"commit_count": 474,
"repo_created_at": "2020-10-19T12:48:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2f47f4d... |
5e1aacd3-0e0d-42e7-a75b-7c5f48b9d9ab | JPS-Robotics/C-with-controller | src/robot-config.cpp | #include "vex.h"
using namespace vex;
// A global instance of brain used for printing to the V5 Brain screen
brain Brain;
// VEXcode device constructors
motor left_motor_front = motor(PORT8, ratio6_1, false);
motor left_motor_middle = motor(PORT6, ratio6_1, false);
motor left_motor_back = motor(PORT20, ratio6_1, fa... | TOOL | 0.914796 | 4.091276 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-11T18:36:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac1eb693fb788... |
a79b4a6a-8c32-45b4-a473-0d5bf3ff4ed4 | oksuman/openfhe-tutorial | practice2/practice2.cpp | #include "practice2.h"
Ciphertext<lbcrypto::DCRTPoly>
Practice2::computeAverage(const CryptoContext<DCRTPoly> cc,
const Ciphertext<lbcrypto::DCRTPoly> vector) {
/**
* TODO: Compute the average of encrypted vector values
* The result should be a vector where all elements are the ... | ALGO | 0.986451 | 6.078053 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-10-31T08:01:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "575cc0582ac... |
7690bdad-865f-4026-811e-1baa22f891b9 | ShenaoChen/Algorithm | code/acm/cf#806v4D.cpp | #include <iostream>
#include <cstring>
#include <map>
using namespace std;
const int N = 1e5 + 5;
string s[N];
int ans[N];
void solve() {
map<string, bool> mp;
int n;
cin >> n;
memset(ans, 0, sizeof (int) * (n + 1));
for (int i = 0; i < n; i++) {
cin >> s[i];
mp[s[i]] = true;
... | ALGO | 0.999854 | 3.588556 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2021-12-05T12:28: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": "d8a58fe577d... |
7289c069-8928-4e99-9fe4-23052f96ab43 | davisking/dlib | dlib/graph_cuts/find_max_factor_graph_potts.h | // Copyright (C) 2012 <NAME> (<EMAIL>)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_FIND_MAX_FACTOR_GRAPH_PoTTS_Hh_
#define DLIB_FIND_MAX_FACTOR_GRAPH_PoTTS_Hh_
#include "find_max_factor_graph_potts_abstract.h"
#include "../matrix.h"
#include "min_cut.h"
#include "general_po... | ALGO | 0.997091 | 5.096281 | {
"github_metadata": {
"branch": "master",
"commit_count": 8325,
"repo_created_at": "2014-01-29T00:45:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14068,
"forks": 3436,
"issues": 41,
"pull_requests": 5
},
"file_meta": {
"content_id": ... |
93780d5a-05c3-49a8-9567-228f794cf1f5 | junseno0/algo | DP/best_time_of_stock_with_cooldown/best_time_of_stock_with_cooldown.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <string>
using namespace std;
/*
309. Best Time to Buy and Sell Stock with Cooldown
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum pr... | ALGO | 0.999958 | 5.489348 | {
"github_metadata": {
"branch": "master",
"commit_count": 138,
"repo_created_at": "2020-07-10T11:49: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": "78ce9d79... |
2f2c74f9-2480-40f8-b68a-7385d246235f | edwinsun98/Competitive-Programming-Solutions | Codeforces/Educational Codeforces Round #112 (Div. 2)/C. Coin Rows.cpp | #include <bits/stdc++.h>
#define f first
#define s second
#define all(vec) begin(vec), end(vec)
#define pf push_front
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define mk make_pair
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ll,int... | ALGO | 0.999949 | 4.048226 | {
"github_metadata": {
"branch": "main",
"commit_count": 161,
"repo_created_at": "2021-06-18T00:59:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e30de4c991... |
b7895154-bc13-4031-a233-327ac334bf1f | opreaioan/Structuri_de_Date | Tema 3/Problema 09.cpp | /*Problema 9 - Anagrame.
Se consider un sir de cuvinte citite dintr-un fisier.
Scrieti o functie, care sa grupeze anagramele. Se considera
anagrama un cuvânt obtinut prin rearanjarea literelor altui
cuvânt. Folositi structurile de date din stl învatate,
asa încât sa obtineti eficienta cea mai buna. (1.5p)
(punctaj în ... | ALGO | 0.999291 | 4.152343 | {
"github_metadata": {
"branch": "master",
"commit_count": 153,
"repo_created_at": "2023-03-20T17:26:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aefd1390... |
3fd0aaa2-f8ea-4a11-9ce3-41f5c77636c5 | 61758084/calc | main.cpp | #include <iostream>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <cstdlib>
#include <complex>
#include <complex.h>
using namespace std;
stack<char> opt; //操作符栈
stack<double> val; //操作数栈
//求阶乘所用数组
int LargeNumberFactorial[1000] = { 0 };
//定义两个常量表示在数字中的状态
const int IN = 0;
co... | ALGO | 0.999832 | 3.090589 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-02-11T03:35: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": "9bc4eb9500e9... |
bbb4160c-cded-4ef6-88de-165bdae790c9 | KirillSanik/Bimap | node.h | #pragma once
#include <cstdint>
#include <random>
#include <utility>
namespace node_details {
inline std::mt19937_64 rand_generator(time(nullptr));
struct node_base_t {
node_base_t* left = nullptr;
node_base_t* right = nullptr;
node_base_t* father = nullptr;
std::uint64_t priority;
explicit node_base_t() ... | ALGO | 0.979813 | 5.985233 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-02-26T15:04:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30e998c88c63... |
0cdabef5-3962-4104-95a6-311bd09a238a | youhuanli/lis_stream | dynprogram/dynamicprogram.cpp | /*
* dynamicprogram.cpp
*
* Created on: 2016Äê2ÔÂ15ÈÕ
* Author: liyouhuan
*/
#include "dynamicprogram.h"
#include "../util/util.h"
#include "../datastream/datastream.h"
#include "../quadruple/quadruple.h"
// public
dynprogram::dynprogram(int _winsz)
{
this->win_size = _winsz;
this->timestamp = 0;
this->l... | ALGO | 0.993777 | 4.056415 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2016-04-28T13:49:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a2b5a5291... |
5996adfb-dce2-4ba0-a72b-ec2b8e06874f | architnd/cpp | test_lambda.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int x = 100;
auto myFunction = [&x]() {
x = x + 10;
cout << "hi \n" << x << "\n";
};
myFunction();
myFunction();
cout << x << "\n";
vector<int> vec = {20, 40, 30, 10, 11, 52};
for (co... | TOOL | 0.944676 | 3.516735 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-06-22T14:19: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": "28ce3b56d80b... |
4764da73-67e2-4c2d-832a-f2142875e58d | berkekeser/Hacettepe-Notes | Linked List Playground/DeleteNodeNthPosition/main.cpp | #include <iostream>
using namespace std;
struct Node
{
int data;
Node* next;
};
struct Node* head; // global
void Insert(int data, int n); // insert
void Print(); // print all elements in the list
void Delete(int n); // delete node at position n
void Insert(int data, int n)
{
Node *temp1 = new Node();
... | ALGO | 0.999702 | 4.11729 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2021-12-05T09:48: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": "84b079886c6... |
5eadd4b1-2119-4424-af2a-df705756b73c | math4tots-misc/contest | usaco/2.2/runround.cpp | /*
ID: kyjkim1
LANG: C++
TASK: runround
*/
#include <iostream>
#include <fstream>
#include <algorithm>
using namespace std;
typedef long long LL;
bool is_runaround(LL x) {
LL ds[9], d = 0;
bool seen[10];
// find all the digits of x
for (LL i = 0; i < 10; i++)
seen[i] = false;
while (x) {
if (x%10 == 0 ... | ALGO | 0.999957 | 3.446172 | {
"github_metadata": {
"branch": "master",
"commit_count": 129,
"repo_created_at": "2016-02-29T02:45:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8fb32602c... |
45492690-d52a-4d4c-89e1-9a353ac3b86a | Elmyare/OOPlabs | lab2/lab21.cpp | #include <iostream>
#include <time.h>
using namespace std;
#define N 6
int fill_random(int **mat);
int print_matrix(int **mat);
int get_right_diagonals(int **mat, int *arr);
int get_left_diagonals(int **mat, int *arr);
int print_arr(int *arr);
int get_spiral_corner(int **mat, int *arr);
int get_spiral_center(int **ma... | ALGO | 0.999396 | 4.203846 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-12-03T00:35: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": "d4bc97311c72... |
57a49175-4db0-40ca-b190-9b106b21ab4a | ishandutta2007/codeforces-k | krijgertje/normal/331/B2.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <climits>
#include <cassert>
#include <ctime>
#include... | ALGO | 0.999488 | 4.059094 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b76fa2f54426... |
576d7cf2-51d3-4fd2-af1e-b0f4cb702d3a | iRiisH/Reflection-Eraser | edges/interpolation.cpp |
void nearestNeighbourWeightedInterpolation(Mat& img)
{
assert(img.type() == CV_32F);
int m = img.rows, n = img.cols;
vector<Point2i> sparseData;
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
if (img.at<float>(i, j) != 0.)
sparseData.push_back(Point2i(i, j));
}
}
for (int i = 0; i < m;... | ALGO | 0.996861 | 5.316326 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2017-03-16T14:10:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3feda4228... |
a6a9981d-ca26-4752-85d7-0d6b048104a5 | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1245/Standings2/29565503_63999853.cpp | /*mjytxdy!*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define ull unsigned long long
#define ldb long double
#define pb push_back
#define fir first
#define sec second
#define all(x) x.begin(),x.end()
#define pii pair<int,int>
#define pil pair<int,ll>
#define pli pair<ll,int>
... | ALGO | 0.999955 | 3.460503 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-11-22T14:40:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "64a60b78e... |
60e46b1c-68ba-45cb-95e6-05c1203191f9 | mscheutz/diarc | vision/src/main/cpp/stm/util/StmUtilities.cpp | /*
Copyright © Thinking Robots, Inc., Tufts University, and others 2024.
*/
#include <boost/format.hpp>
#include "StmUtilities.hpp"
namespace diarc {
namespace stm {
namespace util {
//log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger("diarc.stm.util.Utilities");
float calculateBoundBoxOver... | TOOL | 0.942056 | 5.998549 | {
"github_metadata": {
"branch": "main",
"commit_count": 510,
"repo_created_at": "2024-02-27T15:16:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b8e5233068... |
fc7081c8-3d5e-4fda-88a8-ee48ce1cc445 | MyCuteGuineaPig/Leetcode | Bit Manipulation/393. UTF-8 Validation.cpp | /*
393. UTF-8 Validation
A character in UTF8 can be from 1 to 4 bytes long, subjected to the following rules:
For 1-byte character, the first bit is a 0, followed by its unicode code.
For n-bytes character, the first n-bits are all one's, the n+1 bit is 0, followed by n-1 bytes with most significant 2 bits being 10.
... | ALGO | 0.999067 | 5.745067 | {
"github_metadata": {
"branch": "master",
"commit_count": 1842,
"repo_created_at": "2018-01-29T23:45:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 116,
"forks": 24,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f23... |
56aff2e6-cc6d-4b74-8aba-6ae4b845e529 | song-df/haizeixwiki | courses_resource/csp/csp_resource/part2/ch12/code/3.XYOJ-7308.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
vector<int> ship[maxn];
int n, t[maxn], k, cnt;
map<int, int> mp; // mp[x] 表示目前国籍为 x 的人数
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
scanf("%d%d", t+i, &k);
for (int j = 0, x; j < k; j++) {
s... | ALGO | 0.999355 | 3.249479 | {
"github_metadata": {
"branch": "master",
"commit_count": 766,
"repo_created_at": "2024-02-25T14:12: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": "0c9c2fed... |
e69042c4-8f31-4e3c-8912-49d35a264ade | ram333n/algorithms_and_complexity_2021_2022 | main.cpp | #include "test_runner.h"
#include "binomial_heap.h"
#include "treap.h"
#include <vector>
#include <algorithm>
using namespace std;
namespace BinomialHeap {
template<typename T>
void HeapSort(vector<T>& to_sort) {
BinomialHeap<T> heap;
size_t current_size = 0;
ASSERT(heap.Empty());
... | TEST | 0.979607 | 5.476303 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2021-10-11T07:26:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b471775f... |
9b2b046d-5395-4722-84d2-ddf9c8b533e2 | meavi44/linkedll-and-stack | avi/singlylinkedlist/practice2.cpp | //delete duplicate elements
// input->1 1 1 2 2 3 3 3
// output->1 2 3
#include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *next = NULL;
Node(int a)
{
val = a;
next = NULL;
}
};
class linkedList
{
public:
Node *head;
linkedList()
{
he... | ALGO | 0.999963 | 4.460989 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-02-04T03:39: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": "9b802287b196... |
d4902d08-4a23-4d77-ba03-24d2e35a1569 | zengguobing/InSAR | Deflat/Deflat.cpp | // Deflat.cpp : 定义 DLL 应用程序的导出函数。
//
#include "stdafx.h"
#include"..\include\Deflat.h"
#include"..\include\FormatConversion.h"
#include<direct.h>
#include<Windows.h>
#include<SensAPI.h>
#include<urlmon.h>
#pragma comment(lib,"URlmon")
#pragma comment(lib, "Sensapi.lib")
#ifdef _DEBUG
#pragma comment(lib, "FormatConver... | ALGO | 0.975585 | 3.563424 | {
"github_metadata": {
"branch": "master",
"commit_count": 165,
"repo_created_at": "2022-06-15T03:25:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 58,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98989d7... |
967cb99b-2455-4e24-ba9d-19601b42b244 | RiccardoParente/TSP_GA | ga_tsp_sequential.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string>
#include <fstream>
#include <math.h>
#include <numeric>
#include <algorithm>
#include <iterator>
#include "utimer.hpp"
#include <chrono>
#include <thread>
#include <vector>
using namespace std;
int tot_cities;
int population_size;
int iterations;
float **dist_m... | ALGO | 0.999943 | 4.709841 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-12-16T16:34: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": "5a86bd15931f... |
aacc4edd-49fe-42ff-9529-dd696c685611 | xxcxu/SchoolCode | P2292.cpp | #pragma region
#include <bits/stdc++.h>
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;
using i128 = __int128_t;
using u32 = uint32_t;
using u64 = uint64_t;
#define ep emplace
#define eb emplace_back
#define all(x) x.begin(), x.end()
FILE *fin, *fout, *ferr;
i32 read() {
i32 t = 0, f = 0;
char ch = f... | ALGO | 0.999982 | 4.465214 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2023-09-20T11:11: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": "0d631a945... |
ac7a1931-4974-47dc-a76c-71c6d2e15c52 | rainingDesert/simple-advance-ultimate-tic-tac-toe | codes/ATTTUI.cpp | #include "TTT.h"
#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
ATTTUI::ATTTUI(Game* game):TTTUI(game){
this->attt = (AdvanceTTT*)(game);
}
//display board
void ATTTUI::displayBoard(){
int row = this->attt->getRow();
int blockRow = this->attt->getPerBlockRow();
int dec = ceil(log10... | ALGO | 0.986218 | 3.558428 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-10-05T20:46:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "22d084623e... |
152a7563-057b-443e-8cde-a4391c846550 | seoi2017/Storage | Luogu/3724.cpp | #include<bits/stdc++.h>
#define M 100000003
#define P 100000009
#define N 103
#define r(x) scanf("%d",&(x));
#define rep(a,b,c) for(int i=(a);i<=(b);i+=(c));
using namespace std;
typedef long long ll;
int n,m,mc,w[N],a[N];
int g[N][N];
int c[N],maxc;
int Q[M],_l,_r;
int head[P],f[M],l[M],t[M],next[M],idx[M],inum;
inlin... | ALGO | 0.999938 | 3.229656 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2017-03-04T10:32:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe16bac52... |
9f3406cb-bd1e-464a-9a9c-22d09a2efe72 | kevindryz/LeetCode-Hot100 | 图论/208.cpp | class Trie {
private:
Trie* nxt[26];
bool flag;
public:
Trie() {
memset(nxt,0,sizeof nxt);
flag=0;
}
void insert(string word) {
Trie* node=this;
for (char c : word)
{
if (!node->nxt[c-'a']) node->nxt[c-'a']=new Trie();
node=node->n... | ALGO | 0.99997 | 5.670138 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-03-07T08:06: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": "2e8b83f1319... |
4ba53706-8a91-4db6-a8c3-c42f299c95bb | ryotaro612/at_c | src/agc003/b.cc | #ifndef ONLINE_JUDGE
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
template <typename T> ostream &operator<<(ostream &os, vector<T> &v) {
os << "[";
string... | ALGO | 0.999979 | 4.278833 | {
"github_metadata": {
"branch": "master",
"commit_count": 2006,
"repo_created_at": "2019-07-01T03:51: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": "fa7205b... |
402dda72-e8fe-4183-a5ca-f1086f154c14 | filipeabelha/gym-solutions | cdf/992c.cpp | #include <bits/stdc++.h>
using namespace std;
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define cl(x, v) memset((x), (v), sizeof(x))
#define db(x) cerr << #x << " == " << x << endl
#define dbs(x) cerr << x << endl
#define _ << ", " <<
#define gcd(x, y) __gcd((x), (y))
typedef long l... | ALGO | 0.999992 | 4.76975 | {
"github_metadata": {
"branch": "master",
"commit_count": 1023,
"repo_created_at": "2017-03-27T00:56: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": "c6694e1... |
01e942d7-7138-4964-a111-5ac72214507e | shmohammadi86/CoDO-mv | matlab/mex_CoDO.cpp | #include <math.h>
#include "mex.h"
void CoDO(int x, int nL, int *L, int n_union, int n, int m_overlap, int m_union, double *p);
int min(int x, int y) {
return (x < y? x:y);
}
int max(int x, int y) {
return (x > y? x:y);
}
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
register i... | ALGO | 0.999321 | 5.237391 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-07-04T01:33: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": "48f74ed16... |
90699c44-ae58-43f4-9907-3ac2cca92c5c | hssong1221/CodingTestPractice | 2차원벡터BFS.cpp | #include <string>
#include <vector>
#include <iostream>
#include <climits>
#include <map>
#include <sstream>
#include <set>
#include <algorithm>
#include <bitset>
#include <deque>
#include <unordered_map>
#include <queue>
//빠른 입출력
/*std::ios_base::sync_with_stdio(false);
std::cin.tie(NULL);*/
using namespace std;
//... | ALGO | 0.999945 | 4.060549 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2016-10-19T07:41:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd0cff5a8... |
c027042a-2206-4d8e-aced-3725badc9226 | ishandutta2007/codeforces-d | dxqwq/normal/1586/A.cpp | // Problem: <NAME>
// Contest: Codeforces - Codeforces Round #749 (Div. 1 + Div. 2, based on Technocup 2022 Elimination Round 1)
// URL: https://codeforces.com/contest/1586/problem/A
// Memory Limit: 256 MB
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
//And in that light,I find deliverance... | ALGO | 0.998857 | 4.438145 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "645ba5ed4fab... |
476fc1ab-fae7-476e-8e7e-1a6dfa0b0415 | bansalnitish/CSN212 | Tutorial - 3/Tutorial-3.cpp | #include<bits/stdc++.h>
using namespace std;
#define pb push_back()
#define mod 1000000007LL
#define ll long long
#define eps 1e-10
#define inf 1e6
#define f first
#define s second
struct seg{
int l, h;
};
struct interval{
seg *s;
int max;
interval *left, *right, *parent;
};
seg *newseg(int l, in... | ALGO | 0.999854 | 4.404908 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-02-16T16:19: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": "7ec3fc08aa... |
67d8c088-5e35-4933-a108-fc6b02750d22 | steph45607/DSA | HW1/Num 2/SLinkedList.cpp | #include <iostream>
#include "SLinkedList.h"
using namespace std;
template <class T>
SLinkedList<T>::SLinkedList() //default constructor
{
first = nullptr;
last = nullptr;
count = 0;
}
//overload the assignment operator
template <class T>
const SLinkedList<T>& SLinkedList<T>::operator=
... | TOOL | 0.987734 | 4.268167 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-03-25T15:33: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": "eecd5ba21c92... |
38cc290b-1053-4c78-b076-dbf9a6cf6d8b | daybreaker42/Problem-Solve | 2025_PS_STUDY/week_1/ai-solution/5618.cpp | #include <bits/stdc++.h>
#define fastio ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
// 최대공약수 계산 - 유클리드 호제법
int getGcd(int a, int b) {
while(b != 0) {
int r = a % b;
a = b;
b = r;
}
return a;
}
// 약수 구하기 최적화 함수
void findDivisors(int n) {
vec... | ALGO | 0.99993 | 5.824834 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2022-03-16T15:17:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "260819f46d4... |
06319040-eb1c-49c2-831d-8029b3bb4d4a | ayush-kumar774/Competitive-Programming | Atcoder/193/B. Play Snuke.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define endl '\n'
struct shops
{
int price ;
int stocks ;
int distance ;
}... | ALGO | 0.999788 | 3.980578 | {
"github_metadata": {
"branch": "main",
"commit_count": 59,
"repo_created_at": "2020-11-18T08:07:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6bc8911be40... |
c0b9c5dd-0550-419f-8952-8a38c3e076ed | devaliraza1/C- | check if a given character is present in a string or not.cpp | #include <iostream>
using namespace std;
int main()
{
int letterCount = 0;
char ch = 'h';
char str[100];
cout << "Enter Your String : ";
gets(str);
for (int i = 0; str[i] != '\0'; i++)
{
if (str[i] == ch)
{
letterCount++;
// cout << "Yes " << letterCou... | ALGO | 0.998881 | 3.085481 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-12-20T10:25:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2d3a5563945... |
e6d35abf-42df-468c-b734-ff393e186312 | leomaurodesenv/contest-codes | contests/uri/uri-1557.cpp | /*
* Problema: Matriz Quadrada III
* https://www.urionlinejudge.com.br/judge/pt/problems/view/1827
*/
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <numeric>
#include <string>
#include <sstream>
#include <iomanip>
#include <locale>
#include <bitset>
#include <map>
#include <vector... | ALGO | 0.999783 | 3.940721 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-03-20T12:38: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": "7b99f8bddc... |
ed5ceaed-f0b3-4897-92a4-835e3e973aa7 | wadekarAtharva/Cpp | loop c++/prob18.cpp | // Write a C++ program to check a enter number is Prime number or not using while & for loop
#include <iostream>
using namespace std;
int main()
{
int num;
cout << "Enter a number to check prime of not:";
cin >> num;
int f = 0, i = 2;
// while loop
// while (i <= num / 2)
// {
// ... | ALGO | 0.999926 | 3.552453 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-08-19T11:33: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": "8765d069be7e... |
89a72760-0a21-48a6-9e84-93d808bb9318 | Jorres/uni-codebase | algo-heritage/linear_data_structures/queue_with_min_operation.cpp | #pragma GCC optimize("Ofast")
#include <iostream>
#include <algorithm>
typedef std::pair<int, int> PII;
template <class T>
struct vector {
int size, capacity;
T* p;
vector() {
}
vector(int _capacity) {
size = 0;
capacity = _capacity;
p = new T[capacity];
}
void copy_previous() {
T* new_mem = new T... | ALGO | 0.999749 | 3.594731 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-12-16T00:58:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bef564a30... |
c18b1b45-050d-4670-8c18-e8e76889bb1c | mairesol/Cpp | Practice/Introduction to Programming/buổi 7/chuoilephai.cpp | #include <iostream>
#include <cstring>
using namespace std;
int max_length(char str[][1000], int row)
{
int max = 0;
for (int i = 0; i <= row; i++)
max = (strlen(str[i]) > max) ? strlen(str[i]) : max;
return max;
}
void middle(char str[][1000], int itsrow, int maxlength)
{
int length = strlen(s... | ALGO | 0.999577 | 3.516168 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2022-03-05T03:08: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": "1d553d7c815... |
8e39b057-9e3d-4a1c-a9af-10a23e258aa9 | Sharpyfile/SISE_2020_1 | SISE_1/Node.cpp | #include "Node.h"
using namespace std;
Node::Node(Node *parent, puzzle puzzleState, int layer, string type)
{
this->parent = parent;
this->currentState = puzzleState;
this->layer = layer;
this->type = type;
if (parent == nullptr)
{
parentFinished = true;
}
else
this->parentFinished = false;
if (type ==... | ALGO | 0.999178 | 4.034681 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-03-15T11:08:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63afd58f75... |
2ef96b72-942a-4e9c-ad2d-c7628934213f | GDieser/Ejercicios-C-1C | 3 - C++ CICLOS FOR/EJ23.cpp | #include <iostream>
using namespace std;
/*Dada una lista de 10 números informar la cantidad de duplas de números impares que se
hayan ingresado consecutivamente.
Ejemplo A: 12, 3, 5, 7, 6, 9, 13, 10, 7, -5.
En esta lista las duplas son: 3:5, 5:7, 9:13, 7:-5 por lo tanto se informará que hay 4
duplas de números impar... | ALGO | 0.996962 | 4.600612 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2024-04-07T15:25: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": "246875a2205... |
ff371bc5-145a-416c-a833-ed5cf81d4008 | fonte-nele/Competitive-Programming | URI Online Judge/uri2397.cpp | /*input
1 1 1
*/
#include <bits/stdc++.h>
using namespace std;
#define f(inicio, fim) for(int i = inicio; i < fim; i++)
#define fr(inicio, fim) for(int j = inicio; j < fim; j++)
#define all(x) x.begin (), x.end ()
#define sz(x) (int) x.size ()
#define pb push_back
#define mk make_pair
#define fi first
#define se secon... | ALGO | 0.999962 | 3.637734 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2019-06-22T18:49:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13cca3009... |
96ae6a66-ce15-4a2f-ba06-7c0c0299d8d2 | hjiang13/LLM4IR | results/Task2_IR_Decompilation/DecompiledResuts_Human_x_164_O2/MetaLLama_Human_x_164_O2_decompiled/test/CPP_151.cpp | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
long double_the_difference(float* data, long size) {
long result = 0;
for (long i = 0; i < size; i++) {
float value = data[i];
float rounded = roundf(value);
float diff = value - rounded;
if (diff < 1e-4 && value > 0) {
... | ALGO | 0.995523 | 4.561267 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-05-21T20:32:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "22a13144326... |
d384681c-2318-4865-b10c-8f7d5394a3f4 | cceryl/Course | CS0501 Data Structure/OJ/OJ1528.cpp | #include <iostream>
const int maxN = 50005;
int N, M;
struct node
{
int leftVacant = 0, rightVacant = 0, maxVacant = 0;
int left = 0, right = 0;
int lazy = 1;
};
node tree[maxN << 2];
void pushup(int n, int left, int right)
{
int mid = (left + right) >> 1;
tree[n].leftVacant = (... | ALGO | 0.999966 | 4.796086 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2025-03-21T16:35: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": "0161870756... |
51fb64ff-8ddc-420e-95ae-6c5b23f6ebb6 | 1-Aastha/Astha-Sharma | Basic Calculator II.cpp | class Solution {
public:
stack<int>s1;//operand stack
stack<char>s2;//operator stack
int precedence(char ch){
if(ch=='+'|| ch=='-')
return 1;
else //if(ch=='*'||ch=='/')
return 2;
//agr parentheses ke sath ques aye toh else return 0
}
int doProc... | ALGO | 0.999983 | 4.876083 | {
"github_metadata": {
"branch": "main",
"commit_count": 111,
"repo_created_at": "2024-07-19T14:13: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": "ea9d07dc40... |
4dccc472-6fe4-4a96-a123-2c32226ec45b | code-fans/books-source | 基础算法/第9章_搜索算法/9.1.4骑士遍历2/src/Warnsdoff/knight2.cpp | //骑士遍历2—Warnsdoff算法,部分数据找不到解,可再优化
#include <bits/stdc++.h>
using namespace std;
int N;
int dx[]= {2,1,-1,-2,-2,-1, 1, 2};
int dy[]= {1,2, 2, 1,-1,-2,-2,-1};
int board[100][100];
int ExitN(int x,int y,int start,int a[])//统计(x,y)的出口数
{
int xx,yy,count=0;
for(int k=0; k<8; k++)
{
xx=x+dx[(start+k)%8];//求出下一个点
... | ALGO | 0.999946 | 3.486506 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-08-24T10:16:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "460ebfe56f92f... |
bddf6b26-d502-41c7-9a03-0a3d7ca906c7 | atomisu0312/bem_Laplace2D | core_matrix.cpp | #include <vector>
#include <random>
#include <iostream>
#include "geometry.h"
#include "core_matrix.h"
#include "general_func.h"
#include "integralGL.h"
using namespace std;
// new added
// called in make_Gmat
// 対角成分に微小値を足す
void avoid_diverge_hack(MatrixXd& M){
int n = M.innerSize();
double eps =1e-10;
for (i... | ALGO | 0.999512 | 4.434559 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2021-02-19T08:02: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": "f163df0a52... |
7535dd16-82d0-41dd-a8d6-78ed2dad74bf | juliaschell/Connect-Four | Project 3/Game.cpp | // Game.cpp
#include "provided.h"
#include "support.h"
#include <queue>
#include <iostream>
using namespace std;
class GameImpl
{
public:
GameImpl(int nColumns, int nLevels, int N, Player* red, Player* black);
bool completed(int& winner) const;
bool takeTurn();
void play();
int checkerAt(int c... | ALGO | 0.925581 | 5.621283 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-04-28T22: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": "c975530b47... |
ca93bd20-e624-4fad-8fc0-bc16a1a3a248 | google-ai-edge/mediapipe | mediapipe/calculators/util/landmarks_refinement_calculator.cc | // Copyright 2021 The MediaPipe Authors.
//
// 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 a... | TOOL | 0.989569 | 7.399921 | {
"github_metadata": {
"branch": "master",
"commit_count": 4767,
"repo_created_at": "2019-06-13T19:16:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 30689,
"forks": 5453,
"issues": 443,
"pull_requests": 149
},
"file_meta": {
"content_id"... |
484c6429-a570-4e21-9905-2e6f1c463bb7 | PixelCoding123/LeetCode-Solutions | 88/88ThreePointer.cpp | /*
QUESTION
You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing
the number of elements in nums1 and nums2 respectively.
Merge nums1 and nums2 into a single array sorted in non-decreasing order.
The final sorted array should not be returned by the fun... | ALGO | 0.99999 | 5.973865 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-01-08T02:03: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": "f8abada64a2a... |
b4dee529-4ff3-498a-a209-7ed998fd43d2 | wszhz20010710/codeProject | heima_cpp/Reference/refer3.cpp | #include <iostream>
using namespace std;
// 引用作为函数参数
// 交换函数
// 1.值传递
void my_swap01(int a, int b)
{
int temp = a;
a = b;
b = temp;
cout << "a = " << a << endl;
cout << "b = " << b << endl;
}
// 2.地址传递
void my_swap02(int *a, int *b)
{
int temp = *a;
*a = *b;
*b = temp;
cout << "a... | ALGO | 0.99484 | 3.931464 | {
"github_metadata": {
"branch": "main",
"commit_count": 99,
"repo_created_at": "2023-10-06T07:55: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": "c21aa41d4f9... |
12566a05-4f09-43e3-be78-a7c73b397046 | zilliztech/BBAnn | scripts/test_different_reader.cpp | // sudo apt-get install libaio-dev
// g++ test_different_reader.cpp -O3 -fopenmp -laio
#include <algorithm>
#include <errno.h>
#include <fcntl.h>
#include <libaio.h>
#include <omp.h>
#include <random>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/sta... | ALGO | 0.94494 | 4.169984 | {
"github_metadata": {
"branch": "master",
"commit_count": 184,
"repo_created_at": "2021-05-27T07:19:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 35,
"forks": 13,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff2d634... |
249305d2-923b-4cb5-afe8-b4467c65ead6 | ishandutta2007/codeforces-r | robezh/normal/1264/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int c[4];
int n;
vector<int> res;
int main() {
for(int i = 0; i < 4; i++) {
cin >> c[i];
n += c[i];
}
res.resize(n, 0);
int odd = c[1] + c[3], even = c[0] + c[2];
if(abs(odd - even) > 1) return cout << "NO" << endl... | ALGO | 0.999989 | 3.527294 | {
"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": "5edc226c0bca... |
1f7ae445-5780-4588-a778-7dc67d987e30 | bliscosque/CPPProblemsVSCode | CourseUdemy_DS_Alg/6-binary_search/4-angry_birds.cpp | //there is a long wire, which contain n bird nests at positions x1, x2,...xN
//B<=N
//2 birds inside same nest, become angry
//assign birds to nest so that minimum distance maximize --- what is largest minimum distance
//N=5 (nests)
//B=3 (birds)
//nests={1,2,4,8,9}
//output=3
//opc1 - brute force
//opc2 - binary se... | ALGO | 0.999994 | 4.811629 | {
"github_metadata": {
"branch": "main",
"commit_count": 297,
"repo_created_at": "2022-02-13T01:21:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df2c14d805... |
592a6013-6d9e-4552-af07-5f6bf6d763c1 | UmangBarbhaya/Competitive_Programming_DSA-_in_CPP | Graph/BFSDFS/WordLadder2.cpp | #include<bits/stdc++.h>
using namespace std;
class WordLadder2
{
public:
vector<vector<string>> findLadders(string beginWord, string endWord, vector<string>& wordList) {
unordered_set<string> wordSet(wordList.begin(),wordList.end());
queue<vector<string>> q;
vector<string> tempVec;
... | ALGO | 0.999963 | 5.311709 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-06-22T18:16: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": "73272b39248... |
2f20d427-d2db-44b2-8116-36aa0e80a9bd | j-nary/my_BOJ | 24891.cpp | //BOJ_24891 단어 마방진 [골드 5]
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int L, N;
bool chk[21];
vector<string> word;
vector<string> ans, real_ans;
bool isMagicSquare() {
int len = ans.size();
if (len < 2) return true;
for(int i = 0; i < len; i++) {
for (int j = 0; j < len; j++) {
... | ALGO | 0.999991 | 4.918863 | {
"github_metadata": {
"branch": "main",
"commit_count": 291,
"repo_created_at": "2022-07-10T14:46: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": "dcfe0f7d8e... |
9d6de2a4-e028-4739-87a3-635b8a8edcee | nahomderese/Competitive-Programing | Contests/CSEC/CSEC Contests -4th-Year/D_Gold_Rush.cpp | #include <iostream>
#include <cmath>
using namespace std;
bool rec(long long n, long long m){
if (n == m){
return true;
}
if (n < m){
return false;
}
if ((n%3 == 0) || (((2*n)%3) == 0)){
if (m == (2 * (n / 3)) || m == (n / 3)){
return true;
}
ret... | ALGO | 0.999918 | 4.616549 | {
"github_metadata": {
"branch": "master",
"commit_count": 588,
"repo_created_at": "2022-02-03T07:10:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd00ce46... |
67c403e0-7c78-44f0-bdb5-d6058921a541 | borisfoko/DijkstraParallel | Implementation/DijkstraAlgorithm/src/dijkstra/openmp.cpp | #include "openmp.h"
using namespace dijkstra;
openmp::openmp(int V): standard(V) {}
openmp::~openmp() {
// Deconstructor code here
}
// A utility function to find the vertex with minimum distance value, from
// the set of vertices not yet included in shortest path tree
void openmp::minDistance(int *dist, bool *sptS... | ALGO | 0.999884 | 4.987641 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-09-06T11:36:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de4678fdcdda... |
654d1364-f40b-4da4-b4ca-85961b270dd3 | qdcampagna/BTODSTARLNUNP_EVTGEN_Model | EvtGenBase/EvtBlattWeisskopf.hh |
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* ... | ALGO | 0.998236 | 5.96587 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2022-03-12T20:42: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": "96678808c27... |
15cdfdb3-2878-43ad-bbb2-c70ffde8adbd | QuBenhao/LeetCode | problems/problems_3162/Solution.cpp | //go:build ignore
#include "cpp/common/Solution.h"
#include <unordered_map>
using namespace std;
using json = nlohmann::json;
class Solution {
public:
int numberOfPairs(vector<int> &nums1, vector<int> &nums2, int k) {
unordered_map<int, int> counter;
for (int num : nums1) {
if (num % k != 0) {
... | ALGO | 0.997756 | 6.250958 | {
"github_metadata": {
"branch": "master",
"commit_count": 3931,
"repo_created_at": "2020-10-26T02:27:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "80cae... |
4ea47745-06c7-4bb3-a1b4-a525f091e266 | samshad/UVa | 10424 - Love Calculator.cpp | /// Name: Md. <NAME>
/// Prob: 10424 - Love Calculator
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <cctype>
#include <string>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <map>
#include <sstream>
#include <bi... | ALGO | 0.999917 | 3.787107 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2016-07-15T14:02: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": "e79066b42... |
f77aefa3-b00f-45c9-be34-45dae7c03b6c | viaicamon/BaoCao_BTL_Bai6 | Tree_BS.cpp | #include<iostream>
#include<iomanip>
#include<string>
#include"Ham_ngoai.cpp"
#include"node.cpp"
#include<fstream>
#ifndef __Tree_BS__cpp__
#define __Tree_BS__cpp__
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
template<class keys,class T>
class Tree_BS{
private:
node<keys,T> *root... | ALGO | 0.998344 | 3.444868 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-11-28T13:57: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": "d298d65392a7... |
5b2265bd-ff44-4ae1-99bf-dc7906535045 | dafer45/TBTK | Templates/UnderDevelopment/SelfConsistentSuperconductivityChebyshevWithRestrictedEnvironment/src/main.cpp | /* Copyright 2016 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writi... | ALGO | 0.99897 | 4.717373 | {
"github_metadata": {
"branch": "master",
"commit_count": 2089,
"repo_created_at": "2016-02-02T20:43:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 101,
"forks": 25,
"issues": 2,
"pull_requests": 3
},
"file_meta": {
"content_id": "938a... |
c9f9fe46-b618-48d6-b973-497e2cd38669 | kitaken55/Atcoder_log | C++/第1章(Atcoder)/関数.cc | //オーバーロード : 引数の数でどちらかの関数かに行く
#include <bits/stdc++.h>
using namespace std;
// 2つの引数のうち最も小さい値を返す
int my_min(int x, int y) {
if (x < y) {
return x;
}
else {
return y;
}
}
// 3つの引数のうち最も小さい値を返す
int my_min(int x, int y, int z) {
if (x < y && x < z) {
return x;
}
else if (y < x && y < z) {
r... | ALGO | 0.999512 | 3.997972 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2021-04-22T14:20: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": "4244128c63b... |
256b2926-a882-4b6b-8ee0-76a2a66f413f | computerphilosopher/BOJ | 01389/1389.cpp11.cpp | #include <stdio.h>
#include <limits.h>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
void bfs(const vector <vector <int> > &graph, vector<int> &dist, int start){
vector <bool> discovered(graph.size());
queue <int> q;
discovered[start] = true;
dist[start] = 0;
q.p... | ALGO | 0.999948 | 3.364014 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-04-01T00:29:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2e20125b9... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.