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
609bc6d8-5e8d-4b8d-b150-270e8e23366a
miya930/competitive_programming
algorithm/00.AtCoder/01.ARC/ARC140A.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; const int inf = 1001001001; int main() { int n, k; string s; cin >> n >> k >> s; int ans = inf; for (int l = 1; l <= n; ++l) { if (n%l != 0) continue; int now = 0; for (int i = 0; i < l; i++) { ...
ALGO
0.999955
3.828207
{ "github_metadata": { "branch": "main", "commit_count": 114, "repo_created_at": "2021-04-18T01: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": "e7ca61072d...
956db29f-d5c0-4784-ba10-f47bbad68f1a
Yawn-Sean/Daily_CF_Problems
daily_problems/2024/04/0430/personal_submission/cf1817b_WindJ0Y.cpp
#include <bits/stdc++.h> using namespace std; void work() { int n, m; cin >> n >> m; vector<vector<int>> mmp(n); while (m --) { int s, t; cin >> s >> t; s --; t --; mmp[s].push_back(t); mmp[t].push_back(s); } vector<pair<int, int>> lns; function<bool(int)> bf_...
ALGO
0.999855
4.632061
{ "github_metadata": { "branch": "main", "commit_count": 20410, "repo_created_at": "2024-02-26T01:04:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 478, "forks": 302, "issues": 0, "pull_requests": 7 }, "file_meta": { "content_id": "8420...
3cbecfd9-2f91-410b-abaa-0fdc162b2bbf
fcitx/fcitx5
src/lib/fcitx-utils/stringutils.cpp
/* * SPDX-FileCopyrightText: 2015-2017 CSSlayer <<EMAIL>> * * SPDX-License-Identifier: LGPL-2.1-or-later * */ #include "stringutils.h" #include <cassert> #include <climits> #include <cstring> #include <initializer_list> #include <optional> #include <string> #include <string_view> #include <utility> #include <vecto...
TOOL
0.96682
7.16428
{ "github_metadata": { "branch": "master", "commit_count": 2201, "repo_created_at": "2015-08-04T18:26:03.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1914, "forks": 136, "issues": 43, "pull_requests": 4 }, "file_meta": { "content_id": "16...
47068efe-9ac6-4b0f-b57e-280251fa793d
nair-bharat/ds_algorithms
Trees/level_order.cpp
#include<bits/stdc++.h> using namespace std; struct Node { int data; struct Node *left; struct Node *right; Node(int val) { data = val; left = right = NULL; } }; void levelorder(struct Node *node) { if (node->left == NULL) { return; } if (node->right =...
ALGO
0.999986
4.112749
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2020-08-25T02:40: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": "712e06be0...
60c622f2-13ab-485e-815f-ae63bf1a1105
SahilKuchlous/CP
BOI/friends.cpp
#include <iostream> #include <string> using namespace std; int n; string s; string o = ""; bool done = false; void check (string s1, string s2) { bool pre[n]; pre[0] = true; for (int i=0; i<s1.size(); i++) { pre[i+1] = (pre[i] && s1[i] == s2[i]); } bool post[n]; post[s2.size()] = true; for (int i=s2.size()-1; ...
ALGO
0.999956
3.964478
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2021-01-14T07:06:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5dafe265665...
fb7bce30-a534-42b2-b89e-372c7258b673
Kamaleshwaran-Valarmathi/NeetCode
01. Arrays & Hashing/89. Minimum Remove to Make Valid Parentheses.cpp
// Reference: https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/ // Given a string s of '(' , ')' and lowercase English characters. // Your task is to remove the minimum number of parentheses ( '(' or ')', in any positions ) so // that the resulting parentheses string is valid and return ...
ALGO
0.9995
5.993348
{ "github_metadata": { "branch": "main", "commit_count": 316, "repo_created_at": "2024-05-03T01:40: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": "4906fb3163...
7faf7f50-2b76-41bc-baae-036262b179fe
TryfanEvans/Data-Structure-Implementation-practice
breadth_first_search.h
#include "graph_using_an_adjacency_list.h" #include <algorithm> enum State { undiscovered, discovered, processed }; struct Vertex { State state = undiscovered; int parent_label; }; std::vector<Vertex> bfs(Graph<int> graph, int start_label) { std::vector<Vertex> tree; for (int i = 0; i < ...
ALGO
0.970678
5.795697
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2022-12-14T03:10: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": "aaa65c688b3...
a7caf314-3b97-47d0-b594-8791de21838e
funbp6/LeetCode-Record-C-Python-
Squares_of_Sorted_Array.cpp
#include<math.h> class Solution { public: vector<int> sortedSquares(vector<int>& A) { if (A.size() == 1){ A[0] = A[0] * A[0]; return A; } vector<int> ans; int negptr = 0; while(A[negptr] < 0){ negptr++; } int posptr...
ALGO
0.999873
5.502811
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2020-05-12T02:13: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": "7318cf7b8...
4780243a-3031-4701-b28d-6888e3c6a7ea
sailfact/Cryptography
Lab3/test.cpp
#include <iostream> #include <ctime> #include <cstdlib> typedef unsigned long long int u64; u64 extendedGcd(u64 a, u64 b, u64 *x, u64 *y) { if (a == 0) { *x = 0; *y = 1; return b; } u64 tempX, tempY; u64 gcd = extendedGcd(b % a, a, &tempX, &tempY); *x = tempY - (b / a...
ALGO
0.999824
4.735302
{ "github_metadata": { "branch": "master", "commit_count": 65, "repo_created_at": "2018-03-22T08:49: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": "75de29dd0...
823e3a50-68ec-4aed-b1d5-72a5543eef50
vkaushik/algorithms
geeks/hackerearth/monk_in_land_of_pokemons.cpp
/* * code monk hashing challenge */ #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { size_t testCount; cin >> testCount; if(testCount < 1 || testCount > 10) return 0; while(testCount--) { size_t count = 0; size_t n; cin >> n; if(n < 1 || ...
ALGO
0.996362
3.153936
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2015-07-15T07:16:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "52c9294db3...
76879a0d-de54-4ad1-8af0-02d0b56138a8
yogendraD/cslab4
lab4b_Q05.cpp
#include<iostream> using namespace std; float sum_odd(int L, int U) { float sum =0; if(L<=U) sum = L + sum_odd(L+2,U); return sum; } float sum_even(int L, int U) { float sum =0; if(L<=U) sum = L + sum_even(L+2,U); return sum; } int main() { int choice, ll, ul; float sum; cout << "\n...
ALGO
0.999861
4.551876
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-10-06T16:35: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": "0cc3c0f8e3...
0e5c28b5-9ead-4321-88fb-bc6f69270636
Cadiducho/UGR-Sistemas-Concurrentes-Distribuidos
Practica1/fumadores-plantilla.cpp
#include <iostream> #include <cassert> #include <thread> #include <mutex> #include <random> // dispositivos, generadores y distribuciones aleatorias #include <chrono> // duraciones (duration), unidades de tiempo #include "Semaphore.h" using namespace std ; using namespace SEM ; Semaphore semEstanquero = 1; Semaphore...
ALGO
0.975537
4.061705
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-12-19T16:01: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": "65d746a45d...
f569f505-9ad8-4125-8bd2-5582cb33dcb7
micyril/AIWars
GameServer/GameServer/math/math.h
#pragma once #include <math.h> #include <vector> #include <algorithm> #include <sstream> #define EPSILON 1e-9f #include "../../../WebHandler/WebHandler/Serializable.h" struct Point{ float x; float y; Point(){} Point(float x1, float y1) : x(x1) , y(y1) {} float norm(); float sqr_norm(); }; struct Edge{ Poin...
ALGO
0.99158
5.105393
{ "github_metadata": { "branch": "master", "commit_count": 122, "repo_created_at": "2013-10-01T12:43:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "98deaf14...
3f677ad4-b047-4afa-99dc-1cf48ea1a0ca
KrzBan/AoC23
Days/Day09.hpp
#pragma once #include "Common.hpp" namespace Day09 { inline void Part1() { const auto parseNumbers = [](const std::string& line) { std::vector<int32_t> nums; std::stringstream stream{ line }; int32_t num; while (stream >> num) nums.push_back(num); return nums; }; const auto diffs = [](const st...
ALGO
0.99917
6.87185
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2023-11-30T20:51: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": "1eeb64053c5...
571811e3-9220-41c3-8c32-3cea18290223
ssj-gz/Competitive-Programming
hackerrank/string-transmission.cpp
// <NAME> (ssjgz) - 2019-05-12 #define SUBMISSION #ifdef SUBMISSION #define NDEBUG #endif #include <iostream> #include <vector> #include <cassert> using namespace std; const int64_t modulus = 1'000'000'007ULL; class ModNum { public: ModNum(int64_t n = 0) : m_n{n} { } M...
ALGO
0.999965
5.110375
{ "github_metadata": { "branch": "main", "commit_count": 6590, "repo_created_at": "2022-04-27T12:08: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": "6f2272379...
54bc8409-e989-4297-b2fe-6d35f30aa432
hakusama1024/Practice
test.cpp
#include <iostream> #include <string> #include <vector> #include <sstream> using namespace std; vector<int> stack; void pop() { if( !stack.empty() ) stack.pop_back(); if( stack.empty() ) { cout << "EMPTY" << endl; } else { cout << stack.back() << endl; } } void push( int a ) { ...
ALGO
0.991166
4.769609
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2016-01-11T03:32: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": "73336314a5...
09c4aa72-b1d0-4757-bd95-f18060698b6f
jerry7991/Competitive-Programming-Lib
PermutationsII.cpp
#include <bits/stdc++.h> using namespace std; void solve(vector<vector<int>> &pmt, string &str, vector<int> &nums, int i, unordered_set<string> &seen) { if (i == str.size()) { if (!seen.count(str)) { seen.insert(str); pmt.push_back(nums); return; } for (i...
ALGO
0.999995
5.610146
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2020-10-15T07:46:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1c9df45cf...
3afaa7b4-1a90-4e84-9902-b5451c572ac4
Nilesh2000/ErrorFreeCodes
Stack/nextGreatestElementCircularArray.cpp
/* Given a circular array arr[] of N integers such that the last element of the given array is adjacent to the first element of the array, the task is to print the Next Greater Element in this circular array. Elements for which no greater element exist, consider the next greater element as "-1". https://www.youtube.co...
ALGO
0.999974
5.305061
{ "github_metadata": { "branch": "master", "commit_count": 387, "repo_created_at": "2019-02-12T16:28:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4d8aed85...
71613006-598e-42ee-8d48-c115c88c9a76
Avinash-706/DSA-Practice
Searching/binarySearchITERATIVE.cpp
#include <iostream> #include <bits/stdc++.h> #include <iomanip> #include <algorithm> #include <string> #include <string.h> #include <limits> #include <math.h> using namespace std; //IN - 10, 20, 30, 40, 50, 60 //IN - 20 //OUT - 1 int binarySearch(int n, int arr[], int number){ int low = 0, high = n-1; while(l...
ALGO
0.999876
5.530866
{ "github_metadata": { "branch": "main", "commit_count": 537, "repo_created_at": "2025-01-17T13:26:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dfdf6760b2...
b0552c87-64e0-4d06-bde9-f0c526b8f457
ZEUSRPA/CompetitiveProgramming
Training/Uva/11507.cpp
#include <bits/stdc++.h> #define ENDL '\n' #define deb(u) cout << #u " : " << (u) << ENDL; #define deba(alias, u) cout << alias << ": " << (u) << ENDL; #define debp(u, v) cout << u << " : " << v << ENDL; #define pb push_back #define mp make_pair #define F first #define S second #define lli long long #define ld long dou...
ALGO
0.999981
3.943959
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2023-02-17T17:25: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": "2d65a1949664...
28f31cc1-2464-44ee-90dc-0cacc0f60697
BichNgoc7971/baitapTH
Bai3.cpp
//#include<iostream> //using namespace std; //int main() { // int a[10][15], m, n; // int sum = 0; // //a // do { // cout << "Nhap m: "; // cin >> m; // cout << "Nhap n: "; // cin >> n; // if (m > 10 || n > 15) { // cout << "Nhap sai.Vui long nhap lai! " << endl; // } // } while (m > 10 || n > 15); // //b // fo...
ALGO
0.980602
3.104912
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2023-11-02T14:58:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b8947fc638...
4a8ff89e-0376-4335-9731-809ed5cfe733
tupieurods/SportProgramming
CodeforcesArchive/6A/main.cpp
#include <stdio.h> int a[4]; bool canTriangle, canSegment; void ReadData() { scanf("%d %d %d %d", &a[0], &a[1], &a[2], &a[3]); } int steps[4][3] = { {1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2} }; void Solve() { canTriangle = false; canSegment = false; for(int i = 0; i < 4; i++) { int sum = a[st...
ALGO
0.999949
4.101284
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2014-01-10T11:56: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": "5f7a00c6e...
fc612a96-7e3c-4bc5-b0d5-7d3f39a6dcb8
PASSIONLab/terrace
include/TC.h
// This code is part of the project "Ligra: A Lightweight Graph Processing // Framework for Shared Memory", presented at Principles and Practice of // Parallel Programming, 2013. // Copyright (c) 2013 <NAME> and <NAME> // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this softwa...
ALGO
0.991799
5.927736
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2021-03-27T18:54:00.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 28, "forks": 9, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "a31f3e1547a...
a5fb1f11-1a5a-4f47-89a4-31748745ae30
DionysiosB/CodeForces
1000-1099/1059C-SequenceTransformation.cpp
#include <cstdio> const long maxn = 1e6 + 6; long seq[maxn]; long ans[maxn]; long ptr = 0; void solve(long n, long mul){ if(n == 1){ans[ptr++] = mul; return;} if(n == 2){ans[ptr++] = mul; ans[ptr++] = 2 * mul; return;} if(n == 3){ans[ptr++] = mul; ans[ptr++] = mul; ans[ptr++] = 3 * mul; return;} for(long p = 0; ...
ALGO
0.999902
3.503278
{ "github_metadata": { "branch": "master", "commit_count": 4487, "repo_created_at": "2013-06-27T18:15:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 690, "forks": 163, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "47e...
f6ad631f-494d-45fc-a0be-7d8b4116cd42
ekxs0109/Leran
leetcode/278.第一个错误的版本.cpp
// @before-stub-for-debug-begin #include <vector> #include <string> #include "commoncppproblem278.h" using namespace std; // @before-stub-for-debug-end /* * @lc app=leetcode.cn id=278 lang=cpp * * [278] 第一个错误的版本 */ // n = 5 bad = 4 // p=0 q=5 m =2 false // p=3 q=5 m=4 true; // n = 6 bad = 4 // p=0 q=6 m=3 fa...
ALGO
0.999642
6.128866
{ "github_metadata": { "branch": "main", "commit_count": 57, "repo_created_at": "2023-09-21T06:04: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": "02a45b2faa7...
3558f8a4-9065-4def-8549-4ffc2187364e
susilvaalmeida/automatic-video-summarization
vsumm/cpp/vsumm-hyb/Main.cpp
//============================================================================ // Name : vsumm-cpu.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include...
ALGO
0.989711
4.619786
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2014-08-14T19:41:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 4, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "d68097166...
f44ef952-424d-41e8-9642-044aeefe86c6
tbjohns/BlitzL1
src/solver.cpp
#include "solver.h" #include "loss.h" #include "logger.h" #include "timer.h" #include <cstring> #include <stdio.h> #include <iostream> #include <algorithm> #include <limits> #include <random> using std::cout; using std::endl; using std::min; using std::swap; using std::vector; namespace BlitzL1 { const int MAX_BA...
ALGO
0.999777
5.338585
{ "github_metadata": { "branch": "master", "commit_count": 76, "repo_created_at": "2015-02-08T19:08:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 24, "forks": 7, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "dfb3650a...
a630c4ae-81d9-45bf-b531-70cd8747e2a5
dbstjrwnekd/algorithms
programmers_network.cpp
#include <string> #include <vector> #include <queue> using namespace std; void bfs(int n, int num, vector<vector<int>> computers, bool *visited); int solution(int n, vector<vector<int>> computers) { if (n == 1) return 1; int answer = 0; bool visited[n]; fill(&visited[0], &visited[n], false); ...
ALGO
0.999928
5.293533
{ "github_metadata": { "branch": "master", "commit_count": 174, "repo_created_at": "2021-01-02T13:29: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": "443deeb1...
28505d4d-52e7-4591-9690-8dbd43616489
zwvista/PSL
PuzzlesN/Puzzles/NumberChain.cpp
#include "stdafx.h" #include "astar_solver.h" #include "bfs_move_gen.h" #include "solve_puzzle.h" /* iOS Game: NumberChain Summary Connect the numbers in order Description 1. Connect the numbers in order using Sudoku and Hidato mechanics. */ namespace puzzles::NumberChain{ constexpr string_view...
ALGO
0.99934
4.022165
{ "github_metadata": { "branch": "master", "commit_count": 1366, "repo_created_at": "2017-05-01T17:23:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "54bee20...
05650e29-fec7-4f53-a5b1-9ce6aae75cfe
Roboskel-Manipulation/openpose_3D_localization
keypoint_3d_matching/src/keypoint_3d_matching.cpp
#include "keypoint_3d_matching.hpp" // Class definition class Human3D{ private: std::vector<std::vector<int> > neighborhoodOffset; keypoint_3d_matching_msgs::Keypoint3d_list keypoints_v; int neighborhoodFactor; public: Human3D(std::vector<std::vector<int> > neighborhood_v, keypoint_3d_matching_msgs::Ke...
DATA
0.915773
5.922088
{ "github_metadata": { "branch": "main", "commit_count": 206, "repo_created_at": "2021-01-19T11:14:34.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bbc93975195...
3517cb52-1f12-4148-8518-6374c07e26e3
Urbanov/TysiacOnline
server/TysiacServer/engine/players_deck.hpp
#pragma once #include <vector> #include "card.hpp" const int MIN_VALUE = 120; ///< value of full deck /** * @brief class representing player's cards, calculating cards's value and finding available cards given cards on the table */ class PlayersDeck { public: PlayersDeck(); ~PlayersDeck(); std::vector<Card>& get...
ALGO
0.961003
5.212098
{ "github_metadata": { "branch": "master", "commit_count": 243, "repo_created_at": "2017-04-16T19:34: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": "4725c24b...
62606957-698e-449b-8b31-59a27959ec80
DanHomerick/advent-of-code-2020
day-1/code.cpp
#include "code.h" #include <iostream> #include <fstream> using namespace std; unordered_set<int> Sum2020Solver::loadInput(const std::string& path) { unordered_set<int> values; ifstream s; s.open(path); if (!s.is_open()) { cout << "Failed to open file: " << path << endl; exit(1); } ...
ALGO
0.999073
5.378498
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2020-12-28T21:12: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": "c98b86088...
0bbc931b-56ea-4f6f-9606-83ca8d69a3bc
raincross7/code-similarity
codes/train_code/problem215/problem215_269.cpp
#include <bits/stdc++.h> using namespace std; #define int long long using vec_int = vector<int>; using P = pair<int,int>; using T = tuple<int,int,int>; using ll = long long; #define rep(i, n) for(int i = 0; i < (int)(n); i++) int charToInt(char c){ char zero_num = '0'; return (int)c - (int)zero_num; } int com...
ALGO
0.999749
3.953734
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-03-06T05:07: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": "a0b2b7868408...
e687424f-9aa8-4bd6-b6f8-3db87e061a55
RohanDSkaria/AtCoder
C_Loong_Tracking.cpp
#include <bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr); #define endl '\n' #define int long long #define pb push_back #define v vector #define vi v<int> #define bl cout<<endl; #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define deb(.....
ALGO
0.999528
3.73712
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2024-09-21T04:06: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": "39689ca1479...
4b4a661a-a3ab-4bd0-86e9-ea1b11d1320d
9shivansh/CodingProblems
SortAnArray(MergeSort).cpp
class Solution { public: void merge(vector<int>& nums, int low, int mid, int high) { int leftLength = mid-low + 1; int rightLength = high -mid; // high-(mid+1)+1 vector<int> leftList(nums.begin()+low, nums.begin()+mid+1); vector<int> rightList(nums.begin()+mid+1, nums.begin()+high+1)...
ALGO
0.999993
6.180744
{ "github_metadata": { "branch": "master", "commit_count": 107, "repo_created_at": "2020-05-01T05:51: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": "dac05abc...
e8bb509b-0a7e-431a-870f-d6b9d541825d
ttyang/sandbox
sandbox/boost/stat/sum.hpp
// (C) Copyright <NAME> 2004. Permission to copy, use, modify, // sell and distribute this software is granted provided this // copyright notice appears in all copies. This software is provided // "as is" without express or implied warranty, and with no claim as // to its suitability for any purpose. #ifndef BOOST_STA...
ALGO
0.990942
5.784607
{ "github_metadata": { "branch": "trunk", "commit_count": 20907, "repo_created_at": "2013-10-11T03:08:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5bb569c...
62108185-076f-4d0c-acda-c557e2d6799e
lucasb20/CryptaLib
rsa.cpp
#include <iostream> #include <fstream> #include <cstdlib> #include <cstring> #include <cctype> #include <cmath> #include <gmpxx.h> #include "lib/asym.h" void encryptRSA(const char *name, const int first_alp, const unsigned pq, const unsigned e){ std::ifstream fin(name,std::ios::in); if(!(fin.is_open())){ ...
ALGO
0.998531
3.566966
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2023-07-02T01:39: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": "9f98910ea8d...
6b80e587-b870-4bbf-86c1-cac9119a49d4
CGAL/cgal
Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Triangle_3_do_intersect.h
// Copyright (c) 2003 <NAME> (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org) // // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : <NAME> #ifndef CGAL_INTERNAL_INTERSECTIONS_POINT_3_TRIANGLE_3_DO_INTERSECT_H #define CGAL_IN...
ALGO
0.950762
7.355428
{ "github_metadata": { "branch": "master", "commit_count": 113659, "repo_created_at": "2014-10-01T12:22:47.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5443, "forks": 1475, "issues": 511, "pull_requests": 136 }, "file_meta": { "content_id...
a0d24c66-58ad-47ce-bfb0-99ca8820f46e
GaurangRastogi/DAA-Assignments
Lab Assignment 3/3.travelling_salesman_problem.cpp
#include <iostream> #include <vector> #include<climits> using namespace std; int travelling_salesman(int city, int cityMask, int cities, vector<vector<int>> &adj_matrix, vector<vector<int>> &dp) { cityMask &= (~(1 << city)); if (!cityMask) return adj_matrix[city][0]; else if (dp[city][cityMask] ...
ALGO
0.999942
4.543472
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2023-01-15T13:42: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": "b88c8769d558...
4fdfcac5-c2f1-41a8-8dcf-24525d5a6b4f
aakashyap/leetcodeContests
contest_191/leetcode_1465_max_cake_area_after_cuts.cpp
/* 1465. Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts Given a rectangular cake with height h and width w, and two arrays of integers horizontalCuts and verticalCuts where horizontalCuts[i] is the distance from the top of the rectangular cake to the ith horizontal cut and similarly, verticalCuts[...
ALGO
0.999971
5.604318
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2020-05-24T08:12: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": "7bd619bdd3...
72ec1418-3038-4d71-979d-fad5bd0e8c28
samilkorkmaz/LeetCode
0026_RemoveDuplicatesfromSortedArray.cpp
//https://leetcode.com/problems/remove-duplicates-from-sorted-array/ class Solution { public: int removeDuplicatesSlow(vector<int>& nums) { if(nums.size() == 0) return 0; int k = 0; for(size_t i=0; i < nums.size()-1; i++) { bool isDuplicate = false; ...
ALGO
0.999934
5.827328
{ "github_metadata": { "branch": "main", "commit_count": 62, "repo_created_at": "2021-07-16T07:08: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": "8d2a0fd18f3...
c5e7d5d1-0bf3-4ee4-b74e-c1fbbff9c30d
dapin1490/study-note
3 - 1 note/advanced cpp/H_cpp_W5HW5.cpp
#include <iostream> using namespace std; int main() { // 선택 정렬 교안에 있는 숫자 데이터를 1차원 배열에 초기화하여, // 예시처럼 중간 과정이 출력되는 프로그램을 작성하시오. int ar[] = { 7, 4, 11, 9, 2 }; int cnt = 0; cout << "The array before sort\n{ "; for (int i = 0; i < 5 - 1; i++) { cout << ar[i] << ", "; } cout << ar[5 - 1] << " }\n"; f...
ALGO
0.999942
4.903385
{ "github_metadata": { "branch": "main", "commit_count": 188, "repo_created_at": "2022-02-09T04:15:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ba40575ba5...
bf7dc83d-978b-4018-a091-226093854414
danielavalera/FAL
Juez/Practicas/1.A - Contabilidad/source.cpp
// <NAME> // F94 #include <iostream> #include <iomanip> #include <fstream> #include <vector> using namespace std; // función que resuelve el problema bool resolver(vector<int> v) { int suma = 0; for (int i = v.size()-1; i >= 0; i--) //empiezas la suma desde la posición final del vector { if (v[i]...
ALGO
0.999866
4.119873
{ "github_metadata": { "branch": "main", "commit_count": 39, "repo_created_at": "2023-09-23T12:33: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": "736d9a234d5...
6e0d9dec-cf68-4683-b0aa-7e81287c0c13
ryotaro612/at_c
src/abc216/f.cc
#include <bits/stdc++.h> typedef long long ll; using namespace std; #define rep(i, n) for(int i = 0; i < (int)(n); i++) const ll MOD = 998244353ll; const int bound = 5000; // 5000 ll solve(int n, vector<ll> &a, vector<ll> &b) { vector<pair<ll, ll>> ab(n); rep(i, n) ab[i] = {a[i], b[i]}; sort(ab.begin(), a...
ALGO
0.999916
4.875916
{ "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": "0496acc...
874a5296-6a39-48b5-8d64-113b5fa74bd3
koi2000/Thinking_and_Practice_in_Programming
CSP-2/C.cpp
// // Created by csp on 2022/4/12. // #include <bits/stdc++.h> #define ll long long using namespace std; int n, m; int main() { cin >> n >> m; ll w[n]; ll d[m]; for (int i = 0; i < n; i++) { cin >> w[i]; } for (int i = 0; i < m; ++i) { cin >> d[i]; } // 该数组记录每个数上一次出...
ALGO
0.999989
4.118622
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2022-06-02T07:52:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f035102c53...
cd8df7c3-5672-404e-8cde-dadbe452a300
Ryder-Robots/rrobot
src/rrobot/ai/greedyai.cpp
#include <rrobot/ai/greedyai.hpp> using namespace rrobot; /** * TODO: * - some logging is desperately needed. * - c should indicate vector. * - need to round off very small numbers by using a wrapper for cos, and sin */ /* * sp = starting point * c = current vector * dp = detination point * n = vector of tr...
ALGO
0.999633
5.444486
{ "github_metadata": { "branch": "main", "commit_count": 121, "repo_created_at": "2025-03-29T10:10:42.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9a714e855e0...
3fe82a23-5513-4eb9-8047-f17e04a0b602
Nag28endra/Competitive-Programming-using-C--
linkedlist.cpp
#include<bits/stdc++.h> using namespace std; class Node{ public: int data; Node* next; public: Node(int d, Node* n){ data = d; next = n; } public: Node(int d){ data =d; next = nullptr; } }; Node* convertArr2LL(vector<int> arr){ Node* head = ...
ALGO
0.999905
4.560735
{ "github_metadata": { "branch": "main", "commit_count": 74, "repo_created_at": "2024-05-31T11:31: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": "bb2959dc1d7...
d645a7af-ebbf-4a68-bb44-52a7605ff1a0
SadatHossain01/CSE208-DSA-II
Flow/Baseball Elimination.cpp
#include <algorithm> #include <iostream> #include <queue> #include <vector> using namespace std; struct Team { int nodeID; string name; int win, loss, left; }; struct Node { int id; // node id to be used for indexing, // source id 0, sink id is the last node id int team1 = -1, team2 = -1; }; ...
ALGO
0.999926
4.313729
{ "github_metadata": { "branch": "main", "commit_count": 69, "repo_created_at": "2022-05-26T03:30: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": "1e88d8c7af6...
d8ad5b99-d3db-48a6-bdd3-d6d6bdc26bb4
hamzamajeed01/OS-Simulator-project
hashpagetable.cpp
#include<iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/wait.h> using namespace std; #define MAXLINE 80 /* The maximum length command */ #define MAXARGS 20 /* The maximum number of arguments */ // Hash page table entry structure struct ha...
ALGO
0.993194
4.870664
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-06-24T09:25: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": "a01664762eaf...
c49abaa6-e2d5-4589-9278-978dcf9c66bd
thekapilkhandelwal/CrackYourInterviews
sorting/sort.cpp
#include<bits/stdc++.h> using namespace std; void bubble_recursive_sort(int arr[], int n) { if(n == 1) return; else { for(int i=0;i<n-1;i++){ if(arr[i] > arr[i+1]){ swap(arr[i], arr[i+1]); } } bubble_recursive_sort(arr, n-1); } } void m...
ALGO
0.999975
5.551985
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2020-04-20T08:40:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "01f086f4dd...
cfe82455-ed19-431d-9961-259d36cd50f5
swadheen01/CF-Solutions
H_Maximal_AND.cpp
/* *Copyright (c) <NAME> (SIR01) *Created on Sat Feb 08 2025 11:51:55 PM */ #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pie 2*(acos(0.0)) #define yes cout<<"YES\n" #define no cout<<"NO\n" #define pb push_back #define endl "\n" #define lcm(a,b) (a*b)/(__gcd<ll>(a,...
ALGO
0.999806
5.296942
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-04-17T18:41: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": "e7dec7cdbbf2...
e5409f04-9a62-460d-8168-ef796ceffa09
coolyuyuyu/leetcode
algorithm_0000-0999/164-Maximum Gap/main.cpp
class Solution { public: // Time: O(nlogn) int f1(vector<int>& nums) { std::sort(nums.begin(), nums.end()); int ret = 0; for (int i = 0; i + 1 < nums.size(); ++i) { ret = std::max(ret, nums[i + 1] - nums[i]); } return ret; } // Time: O(n), bucket so...
ALGO
0.999972
5.584476
{ "github_metadata": { "branch": "master", "commit_count": 4422, "repo_created_at": "2017-03-26T16:52:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c695c8f...
a60e2ff7-ae72-4d63-81cd-a356d2bfdb2b
kangzr/Algorithm
List/DeleteNode.cc
/* * 删除链表的节点 * * 给定单向链表的头指针和一个要删除的节点的值,定义一个函数删除该节点。 * 返回删除后的链表的头节点。 * * */ /*思路一:找到下一个节点为待删除节点,调整当前节点指向*/ struct ListNode{ int val; ListNode* next; ListNode(int v=0): val(v), next(NULL){} }; class Solution{ public: ListNode* deleteNode(ListNode* head, int val){ if(head->val == val) return head->next;...
ALGO
0.999896
4.130793
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2020-04-30T01:28: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": "bf125b91b...
c8654214-bb67-4fb3-94aa-03fea5aaf088
robotcraft19/robotcraft-pathfinding-stage
src/wall_follower.cpp
/** * @file wall_follower.cpp.cpp * @author your name (<EMAIL>) * @brief * @version 0.1 * @date 2019-08-22 * * @copyright Copyright (c) 2019 * */ #include "wall_follower.h" geometry_msgs::Twist WallFollower::calculateCommand() { // Create message auto msg = geometry_msgs::Twist(); if (!this->robot_sto...
ALGO
0.9954
5.683177
{ "github_metadata": { "branch": "master", "commit_count": 31, "repo_created_at": "2020-03-24T20:46:40.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 1, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "e9be046d40...
bf0a93db-81f5-427c-8755-a56630feebfd
BoGyuPark/VS_BOJ
0402_Log/0402_Log/2382_미생물격리.cpp
#include<iostream> #include<vector> using namespace std; int tc, T, n, m, k; typedef struct info { int r, c, cnt, dir; }; int dx[] = { -1,1,0,0 }; int dy[] = { 0,0,-1,1 }; int TransDirs[] = { 1,0,3,2 }; vector<int> map[100][100]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> T; for (tc = 1; tc <= T;...
ALGO
0.999945
3.760891
{ "github_metadata": { "branch": "master", "commit_count": 129, "repo_created_at": "2019-01-02T14:17: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": "4608972e...
e5b0e20d-4af4-4cc7-9c79-5d9fca5eac31
HuangQiang/SAH
curves/util.cc
#include "util.h" namespace ip { timeval g_start_time; // global param: start time timeval g_end_time; // global param: end time double g_pre_time = 0.0; // global param: pre-processing time (ms) u64 g_memory = 0; // global param: memory usage (bytes) u64 ...
TOOL
0.991472
3.082234
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2022-05-22T06:49:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "200388f60...
c8464194-2861-46d0-b2d9-7af2ebf35a76
mlibovych/Cpp-YellowBelt
week4/print_stats.cpp
#include <iostream> #include <map> #include <vector> #include <set> #include <algorithm> using namespace std; enum class Gender { FEMALE, MALE }; struct Person { int age; // возраст Gender gender; // пол bool is_employed; // имеет ли работу }; template <typename InputIt> int ComputeMedianAge(InputIt ra...
ALGO
0.995054
5.136769
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-12-14T13:13:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1c6b7d35e9...
1229353b-4dae-4d08-8ec5-1e176a70795b
guiviana1/UFRN
ITP/ATIVIDADES/note06.cpp
bool esta_ordenado(int tamanho, int sequencia[]) { //é melhor trabalhar em questões assim com casos em exceção. Se encontrar o false, cabouse ai. sequencia[tamanho]; bool ordem = true; //assume que ta ordenado desde o começo if (tamanho == 1) { return true; } for (int i = 0; i < tamanho - 1; ...
ALGO
0.99689
4.858974
{ "github_metadata": { "branch": "main", "commit_count": 38, "repo_created_at": "2024-05-22T11:59: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": "a88b6505af6...
5f181084-c793-4727-9471-2e9e5a309950
with-pouyax/cpp-learning
learncpp/0.5-01.cpp
/* - Write a program that prompts twice, for t, which is the number to print the table of, and n, which is the number of multiples to print. */ #include<iostream> int main() { int t; int n; std::cout <<"print Table of: "; // print Table of: std::cin >>t; ...
ALGO
0.995247
4.457863
{ "github_metadata": { "branch": "main", "commit_count": 54, "repo_created_at": "2024-12-17T20:39: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": "a8f47a0ffb5...
5ace8c24-7600-437f-9e57-d1dda83a3aab
xiaoyeli/superlu_dist
SRC/CplusplusFactor/anc25d.hpp
#pragma once #include <vector> #include <iostream> #include "superlu_ddefs.h" #include "lu_common.hpp" #ifdef HAVE_CUDA #include "lupanels_GPU.cuh" #endif #include "commWrapper.hpp" struct anc25d_t { MPI_Comm *comms25d; int maxLvl; int *myranks; int *commSizes; MPI_Comm *initComm(gridinfo3d_t *gr...
TOOL
0.90451
4.667346
{ "github_metadata": { "branch": "master", "commit_count": 1484, "repo_created_at": "2016-02-23T20:10:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 206, "forks": 71, "issues": 65, "pull_requests": 7 }, "file_meta": { "content_id": "3f5...
db16cfd1-7d69-4141-8888-94340ff6376b
dbetm/cp-history
Algorithms/Math/Number theory/3_TestPrimalidad/2_Fermat.cpp
#include <bits/stdc++.h> using namespace std; // Resuelve a^n % p, O(log(n)) int binpow(int a, unsigned int n, int p); // Test de primalidad de Fermat bool esPrimo(unsigned int n, int k); int main(int argc, char const *argv[]) { int n; int k = 20; cout << "Escribe el número: "; cin >> n; esPrimo(...
ALGO
0.999488
4.307626
{ "github_metadata": { "branch": "main", "commit_count": 384, "repo_created_at": "2019-01-09T04:13:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1fba33cea4...
0d29d8c0-4986-4034-9b23-afe637cf94d1
ywkim0606/gtsam_planner
cpp/planning/deprecated/ValidVariablesConstraint.cpp
/* * ValidVariablesConstraint.cpp * @brief ValidVariablesConstraint constraint * @date Mar 20, 2022 * @author <NAME> */ #include <gtsam/discrete/DiscreteFactor.h> #include <gtsam/discrete/DiscreteValues.h> #include <gtsam/discrete/DiscreteKey.h> #include <gtsam/discrete/DecisionTreeFactor.h> #include <cpp/plannin...
ALGO
0.967208
7.273057
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2022-02-23T18:49: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": "2efb00f03...
1e968c75-f746-41a8-b32e-39f67c719837
erf-model/ERF
Source/Initialization/ERF_InitTurbPert.cpp
/** * \ERF_InitTurbPert.cpp */ #include <ERF.H> #include <AMReX_MultiFabUtil.H> #include <ERF_TileNoZ.H> #include <ERF_ProbCommon.H> using namespace amrex; void ERF::turbPert_update (const int lev, const Real local_dt) { // Accessing data auto& lev_new = vars_new[lev]; // Create aliases to state data t...
TOOL
0.999264
5.284664
{ "github_metadata": { "branch": "development", "commit_count": 4057, "repo_created_at": "2020-10-21T21:05:22.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 40, "forks": 52, "issues": 1, "pull_requests": 2 }, "file_meta": { "content_id": "1...
a73b13fc-030a-4a3c-86ef-a7b6cf044a3e
thilio/Competitive-Programming
OJ/Codeforces/1381A1 - Prefix Flip (Easy Version).cpp
#include "bits/stdc++.h" using namespace std; #define pb push_back #define mp make_pair #define fst first #define snd second #define fr(i,n) for(int i=0;i<n;i++) #define frr(i,n) for(int i=1;i<=n;i++) #define ms(x,i) memset(x,i,sizeof(x)) #define dbg(x) cout << #x << " = " << x << endl #define all(x) x.begin(),x.en...
ALGO
0.999877
3.841289
{ "github_metadata": { "branch": "master", "commit_count": 272, "repo_created_at": "2020-09-06T03:05:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "871e6eda...
192d1db6-0ea6-4d95-a9d1-b6a1623e3d4e
Priyanshuosdbms/Algos-and-OS
Basics/file3.cpp
#include <bits/stdc++.h> using namespace std; // 2 , 15 => 69,96 // 3 , 0 => -1 -1 // 4 , 24 => 1599 // 4 , 5 => 1112 int reverseDigits(int num) { int rev_num = 0; while (num > 0) { rev_num = rev_num * 10 + num % 10; num = num / 10; } return rev_num; } int constval(int k, int ...
ALGO
0.999886
3.986259
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-12-01T17:23: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": "c092692618e7...
2deb892e-9a94-4cb9-b65c-629bd8ece84a
RuslanSlobodian/HrytsiukRak
11/11-18/main.cpp
// Код програми 11.18. Демонстрація механізму використання вказівників на члени класу (модифікована версія) #include <iostream> #include <cstdlib> using namespace std; class MyClass { public: int number; void sum(int x); }; void MyClass::sum(int x) { number = 0; for (int i = x; i; i--) number += i;...
TOOL
0.925111
4.841795
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2022-08-23T16:54: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": "e593c7e9e50...
9358eba9-1ab5-4441-9fe1-6e71588fc8cf
taewoocode/argocpp
5/5.28/b.cpp
#include <bits/stdc++.h> using namespace std; int n, m; string s; map<string, int> mp; map<int, string> mp2; string a[100004]; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL), cout.tie(NULL); cin >> n >> m; for(int i = 0; i < n; i++){ cin >> s; //Bulbasaur mp[s] = i + 1; // ...
ALGO
0.999932
3.853666
{ "github_metadata": { "branch": "main", "commit_count": 195, "repo_created_at": "2024-03-01T09:28:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d949887941...
e1674035-32be-4259-b734-76c559ce0cb4
Shymox/SDIZO_zad2
SDIZO_zad2/BinaryHeap.cpp
#include "BinaryHeap.h" #include <iostream> #include <fstream> /* Klasa zawierająca Kopiec oraz funkcje potrzebne do jego obsługi */ //funkcja zwraca index rodzica wezla o podanym indexie size_t BinaryHeap::parentIndex(int index) { return (index-1)/2; } //funkcja zwraca index lewego dziecka wezla o podanym indexie s...
ALGO
0.994226
3.529302
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2020-06-05T15:54: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": "75a920106d...
d92c5f43-843d-461e-a7c4-bd2abf20c8ad
jogang0304/algorithms-mipt
Другие задачи/семинар 4/задача10.cpp
#include <iostream> #include <stack> #include <vector> int main() { int n; std::cin >> n; std::vector<std::string> v(n); for (auto& x : v) { std::cin >> x; } std::stack<int> s; for (auto x : v) { int number; bool isNumber = false; if (x != "+" && x != "-" && x != "*" && x != "/") { ...
ALGO
0.999971
4.764671
{ "github_metadata": { "branch": "main", "commit_count": 131, "repo_created_at": "2023-09-23T08:59:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 3 }, "file_meta": { "content_id": "b30d6abcc5...
74a23ef3-a15b-4c30-bf8b-bad242014fac
h2ssh/Vulcan
src/vision/navtexture/image_segment_clusterer.cpp
/* Copyright (C) 2010-2019, The Regents of The University of Michigan. All rights reserved. This software was developed as part of the The Vulcan project in the Intelligent Robotics Lab under the direction of <NAME>, <EMAIL>. Use of this code is governed by an MIT-style License that can be found at "https://github...
ALGO
0.999335
6.50908
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-05-04T00:21:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 12, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "421827606...
94f8f035-cf95-4c9b-bb14-f77d280a01da
kanishkbehl/DSA
array_full_menu.cpp
#include <iostream> using namespace std; int b[100]; int n; int i = 0; void create(int) { int d = 0; for (i = 0; i < n; i++) { cout << "enter the value:" << endl; cin >> d; b[i] = d; } cout << "the array is:" << endl; for (i = 0; i < n; i++) { cout << b[i] <<...
ALGO
0.998789
3.52979
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2022-08-20T13:38: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": "1a4560226a...
121fe13b-6fb3-449c-a19b-0616cdfe782e
BenDavisonPetch/BAMReX
Source/RCM/PseudoRandom.H
#ifndef PseudoRandom_H_ #define PseudoRandom_H_ #include <array> #include <cmath> #include <iostream> //! Implements the van der Corput sequence template <int k1 = 5, int k2 = 3, std::size_t max_size = 32> class PseudoRandom { public: PseudoRandom() : n(0) , m(0) , a({ 0 }) , A(...
ALGO
0.990346
4.968421
{ "github_metadata": { "branch": "main", "commit_count": 230, "repo_created_at": "2024-04-04T14:10: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": "c87e49cb84...
057b708a-6ed0-4c98-aadc-d9bf73e29cd6
ROCm/OpenFOAM_HMM
src/meshTools/AMIInterpolation/triangle2D/triangle2D.H
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
ALGO
0.988118
5.926916
{ "github_metadata": { "branch": "suyash/hmm", "commit_count": 25733, "repo_created_at": "2022-10-27T12:31:36.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 25, "forks": 4, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "d2...
4f20cd4b-1298-4701-8218-441e08a54299
lindirod/L.EIC-DA-2223
Proj_2/src/shipping_tsp.h
/** * @file shipping_tsp.h * @brief Code for solving the Traveling Salesman Problem (TSP) for shipping routes using the Triangular Approximation Algorithm for the shipping toy graph - 4.2. */ #ifndef SHIPPING_TSP_H #define SHIPPING_TSP_H #include <iostream> #include <vector> #include <limits> #include "csv.h" /** ...
ALGO
0.999664
6.919465
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-12-26T21:50: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": "c242c8efce7d...
e2a91f74-3ec4-4ee7-ad49-0024aa71b1cf
AaronCui/ShortCodingExercises
cityCables/cityCables.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int blocks; int cities; cin >> blocks; // cout << blocks; for (int i = 0; i < blocks; ...
ALGO
0.999844
3.929214
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2015-02-02T10:42: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": "4b3b4639b...
6a4c5f0d-77f7-4bf2-9508-ad642164a74c
Ayush8165/leetcode_solutions
718. Maximum Length of Repeated Subarray/solution.cpp
#include <bits/stdc++.h> using namespace std; int findLength(vector<int> &nums1, vector<int> &nums2) { int n = nums1.size(); int m = nums2.size(); int dp[n + 1][m + 1]; memset(dp, 0, sizeof(dp)); int len = 0; for (int i = 1; i < n + 1; i++) { for (int j = 1; j < m + 1; j++) ...
ALGO
0.999992
4.513533
{ "github_metadata": { "branch": "master", "commit_count": 100, "repo_created_at": "2023-07-27T02:39: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": "6bb8f0cc...
f83470f4-b1ba-44d1-a13c-549c82a133a0
paudyalprabhat7/Github
Source codes/DEMDemo_ContactChain_sinusoidal.cpp
#include <core/ApiVersion.h> #include <core/utils/ThreadManager.h> #include <DEM/API.h> #include <DEM/HostSideHelpers.hpp> #include <DEM/utils/Samplers.hpp> #include <cstdio> #include <chrono> #include <filesystem> #include <random> using namespace deme; using namespace std::filesystem; /* stuff to do after this: -...
ALGO
0.970497
5.247948
{ "github_metadata": { "branch": "main", "commit_count": 63, "repo_created_at": "2024-02-16T03:02: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": "81f11ed6067...
e3a56571-c0b3-45c5-9f1e-dc57fc2594d8
ishandutta2007/codeforces-g
gabrielwu/normal/1375/F.cpp
#include <bits/stdc++.h> using namespace std; #define forn(i, n) for(int i=0; i<(n); i++) #define readVec(v) forn(i, v.size()){cin >> v[i];} #define printArr(arr, n) forn(i, n){if (i) cout << " "; cout << arr[i];} cout << endl; #define pb push_back #define mp make_pair #define MOD 1000000007 #define f first #define s ...
ALGO
0.999934
3.684277
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:55: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": "38a195f6782e...
26b413a2-6573-4ad0-b850-fd2c32f77c35
Code18Aryan/LEETCODE-QUESTIONS
TREES/100. Sum of nodes on the longest path.cpp
/* class Node { public: int data; Node *left; Node *right; Node(int x) { data = x; left = NULL; right = NULL; } }; */ class Solution { public: pair<int,int> solve(Node* root){ if(root == NULL) return {0,0}; pair<int,int> left = s...
ALGO
0.999988
5.242316
{ "github_metadata": { "branch": "main", "commit_count": 185, "repo_created_at": "2025-01-03T14:22:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "679513dd1f...
392b23fe-9205-4302-a7ec-b8a50bc404c9
tiankonguse/ACM
manger/模板总结/New/划分树模板.cpp
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; typedef long long LL; const int MaxL=100005,MaxN=100005+35005*3; struct Node{int t,x,y,z;}q[MaxN]; int n; int tree[20][MaxL],num[20][MaxL],sorted[MaxL]; void build(int dep,int L,int H) { if(L==H) return ; int mid=(L+H)/2,same=0; ...
ALGO
0.999529
3.1161
{ "github_metadata": { "branch": "master", "commit_count": 185, "repo_created_at": "2013-03-25T04:04:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 69, "forks": 40, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "43179b...
3d1a03b5-aa6f-4ac8-b7e3-0a7716241591
hacch141/Coding-Practice
GFG/Array/03.Hard/01.Pascal's-Triangle.cpp
// Pascal's Triangle vector<vector<int>> pascalTriangle(int N) { // Write your code here. if(N == 1) return {{1}}; vector<vector<int>> ans(N); for(int i=0; i<N; i++) { ans[i].resize(i+1); ans[i][0] = 1; ans[i][i] = 1; for(int j=1; j<i; j++) { ans[i][j] = ans...
ALGO
0.999996
5.771894
{ "github_metadata": { "branch": "main", "commit_count": 2278, "repo_created_at": "2022-06-25T10:16: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": "e39da407d...
e17e4f85-1899-4458-a7d5-74a344539aba
Chandrabhushan-mishra01/DSApractice
day02.cpp
#include<bits/stdc++.h> using namespace std; // notes--> // 1)stable ---> relative order between equal elements will be maintained eg.b,i,m // 2)unstable -> do not eg. s,q, // 3) bubble--> adjecent // 4)selection---> select smaller // 5) insertion----> insert at correct posi [sorted | unsorted] // void bubbleSort(...
ALGO
0.999969
3.264746
{ "github_metadata": { "branch": "main", "commit_count": 122, "repo_created_at": "2024-11-09T21:52: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": "9cbdc6fde4...
85e707b9-10cf-4cad-878f-9c99fd82402a
stan-dev/math
stan/math/prim/fun/trigamma.hpp
#ifndef STAN_MATH_PRIM_FUN_TRIGAMMA_HPP #define STAN_MATH_PRIM_FUN_TRIGAMMA_HPP #include <stan/math/prim/meta.hpp> #include <stan/math/prim/fun/constants.hpp> #include <stan/math/prim/fun/floor.hpp> #include <stan/math/prim/fun/inv.hpp> #include <stan/math/prim/fun/inv_square.hpp> #include <stan/math/prim/fun/sin.hpp>...
ALGO
0.996028
7.221642
{ "github_metadata": { "branch": "develop", "commit_count": 28933, "repo_created_at": "2015-07-01T18:40:54.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 785, "forks": 195, "issues": 298, "pull_requests": 19 }, "file_meta": { "content_id": ...
87b0d1b4-6ba4-497e-8bd7-06ee5e5b1bd7
OpenSees/OpenSees
SRC/material/uniaxial/limitState/limitCurve/RotationShearCurve.h
/* ****************************************************************** ** ** OpenSees - Open System for Earthquake Engineering Simulation ** ** Pacific Earthquake Engineering Research Center ** ** ** ** ...
TOOL
0.91127
6.61189
{ "github_metadata": { "branch": "master", "commit_count": 8721, "repo_created_at": "2018-09-12T00:49:34.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 667, "forks": 719, "issues": 42, "pull_requests": 23 }, "file_meta": { "content_id": "90...
c3a620be-8363-4e68-89ce-f58e0a318967
UtkarshSaxenautk/C-backup
4/02/linear search.cpp
#include <iostream> #include <cmath> using namespace std ; int linearsearch(int list[] , int key , int size ) { for(int i = 0 ; i < size ; i++) { if(list[i] == key) return i ; } return -1 ; } int main() { int x ; cout << " Size of array " ; cin>> x ; int utk[x] ; ...
ALGO
0.996711
4.033823
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2022-03-16T07:55:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3e8ff8ab1a...
0f70231b-ee2b-45e1-a299-349d2c5ece1c
Huuuuu123/openharmony-ffrt
src/queue/queue_strategy.h
/* * Copyright (c) 2023 Huawei Device Co., Ltd. * 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 ...
ALGO
0.940225
6.35418
{ "github_metadata": { "branch": "OpenHarmony_debug_20240926", "commit_count": 1342, "repo_created_at": "2025-05-30T09:51:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "c...
7c5a362f-fae4-4a70-b106-fcb4e75551c2
chartshorn/CSC-5
Hmwk/Assignment_1/Gaddis_9thEd_Chap2_Prob10_Mpg/main.cpp
/* * File: main.cpp * Author: <NAME> * Created on June 22, 2022, 2005 * Purpose: Calculate mpg of a car */ //System Libraries #include <iostream> using namespace std; //User Libraries //Global Constants //Function Prototypes //Execution Begins Here int main(int argc, char** argv) { //Initialize the Ran...
TOOL
0.965128
4.223268
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2022-07-19T03:23: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": "8614247cb2f...
f1223a44-8ee1-44f1-8ccb-7ff7e0517948
akash19jain/COMPETITIVE-PROGRAMMING
codejam/2020/ROUND1A/PATTERN_MATCHING.cpp
/* AUTHOR: <NAME> * EMAIL: <EMAIL> * ID: akash19jain * DATE: 12-04-2020 15:34:40 */ #include<algorithm> #include <bits/stdc++.h> using namespace std; #include<stdio.h> #include<math.h> #include<string.h> #include<stdlib.h> #include<stdbool.h> #include<ctype.h> #define SC1(x) scanf("%lld",&x...
ALGO
0.99997
3.416585
{ "github_metadata": { "branch": "master", "commit_count": 441, "repo_created_at": "2019-03-01T16:29:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a522c985...
aa9259ec-bf2b-48c3-9d5a-52417fe120a1
avinashsastry/justcode
DoA_Code/problems.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "nodeList.h" #define MAX_PROBS // Function solve() int solve(nodeList* problems, node* problem, node* prevProblem, int k) { if (!problems) return 0; if (!problem) return 1; node* prev = prevProblem; node* next = problem->nextNode; if (prev) ...
ALGO
0.999844
3.929469
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2012-05-17T13:58:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7e29a7f1be...
a31fafa8-374c-4df8-9874-db12a5e2b28f
ishandutta2007/codeforces-b
barichek/normal/724/A.cpp
#include <bits/stdc++.h> #define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define files(name) freopen(name".in","r",stdin); freopen(name".out","w",stdout); #define all(a) a.begin(),a.end() #define elif else if #define mp make_pair #define pb push_back #define fir first #define sec second using name...
ALGO
0.999992
3.767889
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-04-11T01:05:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "18df5d1eacdd...
d30868d5-69a3-4680-9994-8df260c3fa5b
thecodingwizard/competitive-programming
POI/POI06-Postman.cpp
/* UNTESTED CODE, 99% SURE IT DOESNT WORK */ //#pragma GCC optimize ("O3") //#pragma GCC target ("sse4") #include <bits/stdc++.h> #include <utility> using namespace std; template<class T> using min_heap = priority_queue<T, vector<T>, greater<T>>; #define FOR(i, a, b) for (int i=a; i<(b); i++) #define F0R(i, a) fo...
ALGO
0.999702
4.238874
{ "github_metadata": { "branch": "master", "commit_count": 946, "repo_created_at": "2018-11-29T17:03:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 83, "forks": 22, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6fb021...
d2cd5ffb-b390-4c6e-86ab-ce4d635df631
zacharysgoldberg/data-structures-and-algorithms
c++/twoPointers/sumOfThree.cpp
#include <iostream> #include <vector> #include <algorithm> using std::cout; using std::endl; bool findSumOfThree(std::vector<int>& nums, int target) { std::sort(nums.begin(), nums.end()); for (int i = 0; i < nums.size(); i++) { int low = i + 1, high = nums.size() - 1; while (low < high) { ...
ALGO
0.999257
5.983262
{ "github_metadata": { "branch": "main", "commit_count": 77, "repo_created_at": "2022-09-08T20:40: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": "ff3f1690b2b...
0f27bdf4-6280-4c0a-b228-07fc715c6db0
Deep-ika-Saini/Algorithms
Course 1 - Programming assignment 3.cpp
//This programming assignment has been implemented on VS Express 2015 #include <iostream> #include <fstream> using namespace std; int comp1 = 0; int comp2 = 0; int comp3 = 0; int partition(int A[], int l, int r, int pivot, int *comp) { *comp += (r - l); int p = A[pivot]; int i = l + 1; for (int j = i; j <= r; j...
ALGO
0.999949
5.085694
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2017-05-28T19:34: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": "0081eaae88...
6179056d-402d-4150-9e90-0f6fad899e57
sribhargav1345/Striver-SDE
Arrays/CountInversions.cpp
lass Solution { public: // Function to count inversions in the array. int merge(int low,int mid,int high,vector<int>& arr){ int i = low; int j = mid + 1; vector<int> temp; int ct = 0; int cnt = 0; while(i <= mid && j <= high) { ...
ALGO
0.999981
5.769748
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2024-12-11T09:32: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": "87359945a685...
d0e0713e-7f76-43d4-a33a-63da0d3e6d33
xnzaa/DataStructure-Algorithm
TravelTree/tree.h
/* 树的类定义 */ #ifndef __TREE_H #define __TREE_H #include<iostream> #include<stack> #include<queue> //template <typename T1,typename T2> template <typename T1> class tree_node { private: public: T1 data; tree_node * lchild; tree_node * rchild; tree_node() { lchild=NULL; rchild=NULL; } tree_node(T1 d) { ...
ALGO
0.995621
3.321765
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2016-06-28T06:34: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": "481892be9...
11046755-40bd-4bf9-8e9b-001b0658efce
bagac/hackkerrank_Cplus
04. sap_xep/insertion_sort.cpp
// Cho mảng số nguyên A[] có N phần tử, hãy in ra các bước của thuật toán sắp xếp chèn // Input Format // Dòng đầu tiên là số nguyên dương N. Dòng thứ 2 là N phần tử trong mảng, các phần tử viết cách nhau một dấu cách. // Constraints // 1<=N<=10^3; 0<=A[i]<=10^9 // Output Format // In ra các bước của thuật toán s...
ALGO
0.999979
5.051106
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2022-04-04T02:45: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": "bf758fe21...
0a2ad2db-b055-41de-827d-2b551f24a334
rezamokaram/solutions-to-uva-online-judge-problems
10327/10327.cpp
#include <iostream> #include <string> #include <cmath> #include <vector> #include <iomanip> #include <algorithm> using namespace std; typedef long long unsigned int ll; int main() { int n; while (cin >> n) { int arr[1000];// s[1000]; for (size_t i = 0; i < n; i++) { cin >> arr[i]; //s[i] = arr[i]; } ...
ALGO
0.99986
3.840078
{ "github_metadata": { "branch": "master", "commit_count": 552, "repo_created_at": "2020-03-18T05: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": "0e846bc4...
e75cfb9f-b29b-4c6c-b093-8a0d74e99032
hmcs10/CP-dump
A_Arrival_of_the_General.cpp
#include <bits/stdc++.h> #define ll long long #define ld long double using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll n; cin >> n; int a[n]; int max = INT_MIN, min = INT_MAX; int maxind, minind; for (int i = 0; i < n; i++) { cin >> a[i];...
ALGO
0.999963
4.113803
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2021-09-26T20:52: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": "252fdbca13dd...
b62747e7-913f-402a-b662-0dd8fd5eaaae
imwack/leetcode
Linked List/445. Add Two Numbers II.cpp
/** Input: (7 -> 2 -> 4 -> 3) + (5 -> 6 -> 4) Output: 7 -> 8 -> 0 -> 7 * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) { st...
ALGO
0.999998
5.915675
{ "github_metadata": { "branch": "master", "commit_count": 46, "repo_created_at": "2017-02-17T05:51: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": "3469f12fd...
4985001e-b3c5-4d85-b28f-8c3c3581e780
heavenMOJANG/ICPC
programmes_C_Cpp/Codeforces/CF2005/C.cpp
#pragma GCC optimize(1) #pragma GCC optimize(2) #pragma GCC optimize(3,"Ofast","inline") #include<bits/stdc++.h> #define int long long using namespace std; constexpr int INF = 0x7fffffff; map<char, int> id{{'n', 1}, {'a', 2}, {'r', 3}, {'e', 4}, {'k', 5}}, vis{{'n', 1}, {'a', 2}, {'r', 3}, {'e', 4}, {'k', 5}}; void sol...
ALGO
0.999783
4.655551
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2025-01-19T07:27:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b15d5d1485f...