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
1c23f4dc-3491-40da-b5e7-b8146684887c
fahimfarhan/coding-creed-origins
Codes/other-ojs/toph/16DecContest/N.cpp
/* Author : <NAME> (@fahimfarhan) */ /* May the CodeForces be with you! */ #include <iostream> // #include <sstream> // #include <cstdio> // #include <cmath> // #include <cstring> // #include <cctype> // #include <string> #include <vector> // #include <list> // #include <set> // #include <map> // #include <queue> // #...
ALGO
0.999956
4.229227
{ "github_metadata": { "branch": "dev", "commit_count": 421, "repo_created_at": "2018-01-30T13:10:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e3749044f23...
c3ae9ca4-328f-4554-af67-a4ac6b2c46d0
avishayAv/CPP-Competitive-Programming
icpc_5822.cpp
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #include <numeric> using namespace std; typedef ...
ALGO
0.99989
3.636176
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-08-13T18:39:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a99ed269d1...
9ee07c28-0b34-40cd-90e8-0ebeda31f420
Ismail-Mahmoud/Competitive-Programming
Problems/LeetCode/920.Number-of-Music-Playlists.cpp
// https://leetcode.com/problems/number-of-music-playlists/ class Solution { int mem[101][101]; static const int MOD = 1e9 + 7; int fact[101]; public: int numMusicPlaylists(int n, int goal, int k) { fact[0] = 1; for(int i = 1; i <= n; ++i) { fact[i] = 1LL * i * fact[i - 1] %...
ALGO
0.999968
5.583735
{ "github_metadata": { "branch": "master", "commit_count": 112, "repo_created_at": "2020-04-16T23:58: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": "c93d28d8...
d09f9e6b-0b05-4981-b939-ffacd9141713
HIVDiversity/MotifBinner2
src/trimFront.cpp
#include <Rcpp.h> #include <vector> #include <stdexcept> #include <iostream> #include <iomanip> #include <map> #include <utility> #include <time.h> #include <queue> // [[Rcpp::plugins("cpp11")]] using namespace Rcpp; struct dynMatEntry { int origin_i; int origin_j; int Fscore; }; struct alignResult { std::s...
ALGO
0.997043
4.544888
{ "github_metadata": { "branch": "master", "commit_count": 224, "repo_created_at": "2018-08-14T09:20:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 1, "issues": 8, "pull_requests": 0 }, "file_meta": { "content_id": "09cabbc75...
b36738da-23ba-44c8-9998-21d362c9f549
RIzmaylov/SKILLBOX_Cpp
3. User Data Entry. String/Task_03.cpp
#include <iostream> /* На бамбуковой плантации завелись гусеницы. Они спят днём и едят бамбук ночью. Бамбук генно-модифицированный, растёт только при свете дня, зато очень быстро — по 50 сантиметров ежедневно! Гусеницы съедают 20 сантиметров бамбука каждую ночь. Бамбуковые саженцы при посадке утром имеют высоту один...
ALGO
0.998994
4.916021
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2024-07-08T05:46: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": "951b4f859b4...
74a7ae99-c5c2-4ad9-a8e9-7d025e3d9ae8
ishandutta2007/codeforces-nonalphabetic
300iq/normal/954/G.cpp
#include <cmath> #include <iostream> #include <vector> #include <algorithm> #include <string> #include <set> #include <map> #include <list> #include <time.h> #include <math.h> #include <random> #include <deque> #include <queue> #include <cassert> #include <unordered_map> #include <iomanip> #include <bitset> using name...
ALGO
0.999964
3.708917
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:49: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": "7e8e10469034...
0ab3b697-6a98-441c-beea-1ed22a3743a3
LostKnowledge33/practice
프로그래머스/unrated/169199. 리코쳇 로봇/리코쳇 로봇.cpp
#include <string> #include <vector> #include <queue> using namespace std; #define INT_MAX 2147483647 int dx[4] = { 1, -1, 0, 0 }; int dy[4] = { 0, 0, 1, -1 }; int solution(vector<string> board) { vector<vector<int>> visit(100, vector<int>(100, INT_MAX)); int x = 0, y = 0; for(int i = 0; ...
ALGO
0.998937
4.641739
{ "github_metadata": { "branch": "main", "commit_count": 64, "repo_created_at": "2021-05-31T06:58: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": "fb03aeeb45e...
6323e3b1-c3db-40d7-846d-41916f28edfc
chakitg/cp_solutions
leetcode-potd/440. K-th Smallest in Lexicographical Order.cpp
Given two integers n and k, return the kth lexicographically smallest integer in the range [1, n]. Example 1: Input: n = 13, k = 2 Output: 10 Explanation: The lexicographical order is [1, 10, 11, 12, 13, 2, 3, 4, 5, 6, 7, 8, 9], so the second smallest number is 10. Example 2: Input: n = 1, k = 1 Output: 1 Cons...
ALGO
0.999717
5.900517
{ "github_metadata": { "branch": "main", "commit_count": 1305, "repo_created_at": "2021-10-25T06:12:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c29d3db3e...
db2be7aa-b35d-41fe-889f-3445a68bd5c1
lonelam/SolveSet
hiho1049.cpp
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; const int inf = 0x3f3f3f3f; const int maxn = 100000; char preorder[maxn], inorder[maxn], postorder[maxn]; int p; void dfs(int prebegin, int preend, int inbegin, int inend) { if (prebegin >= preend) ...
ALGO
0.99999
4.617145
{ "github_metadata": { "branch": "master", "commit_count": 276, "repo_created_at": "2016-07-09T12:38:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fab09025...
005226c2-2425-4e00-89ff-9af45dd15562
jinxuan-owyong/kattis
cpp/medium/shortestpath4.cpp
// Single source shortest path, safe path #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<int> vi; const int INF = 1e9; vector<vii> AL; int main(void) { ios_base::sync_with_stdio(false); cin.tie(NULL); int TC; cin ...
ALGO
0.999981
4.928627
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-07-27T16:51: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": "c0b5ea3339d2...
d002aead-9505-4ce7-a15c-91030d4f4a33
dkajtoch/StrangeAttractor
attractor.hpp
#ifndef _ATTRACTOR_HPP_ #define _ATTRACTOR_HPP_ #include <vector> #include <array> #include <map> #include <cmath> #include <chrono> #include <algorithm> #include <fstream> #include <iostream> #include <string> #include <cstdint> class Attractor { public: // leaves domain boundary to default Attractor(int wi...
ALGO
0.999312
5.843239
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2018-08-04T20:16:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ff6a7dd10...
1ae93631-e22f-4b2b-9744-d2ac070df5c5
Dikiy-Yozhik/Cryptography
Enigma/main.cpp
#include "EnigmaMachine.h" #include <iostream> #include <algorithm> void showMenu() { std::cout << "\n=== ENIGMA MENU ===" << std::endl; std::cout << "1. Setup Enigma" << std::endl; std::cout << "2. Encrypt/Decrypt text" << std::endl; std::cout << "3. Exit" << std::endl; std::cout << "Choose option...
TOOL
0.914948
5.547642
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2025-03-01T10:56: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": "eec2146fa888...
3512b344-c053-42cf-b580-995ea2543409
tu-rbo/omip
shape_reconstruction/include/vcglib/vcg/math/gen_normal.h
/**************************************************************************** * VCGLib o o * * Visual and Computer Graphics Library o o * * _ O _ * * Copyri...
ALGO
0.980736
4.601053
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2016-11-03T13:24:12.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 29, "forks": 10, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "6f23ba7d...
822dbec7-409a-4ebe-9740-90d9fcc9191a
clgusdl2/Alcorithm-study
Seongsu_Eom/Week0/BOJ_비밀번호 발음하기_4659.cpp
#include <iostream> #include <vector> #include <tuple> #include <unordered_set> using namespace std; int main() { string a; unordered_set<char> b = { 'a', 'e', 'i', 'o', 'u' }; while (1) { cin >> a; if (a == "end") { break; } int check1 = 0; int check2...
ALGO
0.972696
4.28816
{ "github_metadata": { "branch": "main", "commit_count": 83, "repo_created_at": "2024-07-09T14:38:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 7, "pull_requests": 0 }, "file_meta": { "content_id": "6ad23271406...
3a5e1956-a74c-4be7-a999-ad46795792f1
dtcxzyw/OI-Source
Source/DP/3594G.cpp
#include <algorithm> #include <cstdio> typedef long long Int64; Int64 read() { Int64 res = 0; int c; do c = getchar(); while(c < '0' || c > '9'); while('0' <= c && c <= '9') { res = res * 10 + c - '0'; c = getchar(); } return res; } const int size = 2000005; const Int...
ALGO
0.999956
3.611641
{ "github_metadata": { "branch": "master", "commit_count": 288, "repo_created_at": "2018-07-11T09:33:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 57, "forks": 14, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a733a3...
f529fcb5-67b9-4ea5-a3e5-e8e34634b479
RiccardoRevalor/ParallelTriangleCounting
parallel_edge_it_openmp/parallel_edge_it_openmp.cpp
#include <iostream> #include <vector> #include <iomanip> // Per una stampa più ordinata #include <map> #include <algorithm> #include <set> #include <unordered_set> #include <chrono> #include <fstream> #include <omp.h> //OPEN MP #include "../utils/utils.h" #include "../utils/matrixMath.h" #define DEBUG 0 using namesp...
ALGO
0.999863
6.017745
{ "github_metadata": { "branch": "main", "commit_count": 41, "repo_created_at": "2025-07-11T08:38: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": "97ebafba5f3...
59e75c4a-aec2-4c02-b6b7-4dd9c3d875f2
CGAL/cgal
Boolean_set_operations_2/examples/Boolean_set_operations_2/set_union.cpp
/*! \file set_union.cpp * Computing the union of a set of circles. */ #include <CGAL/Exact_predicates_exact_constructions_kernel.h> #include <CGAL/Gps_circle_segment_traits_2.h> #include <CGAL/Boolean_set_operations_2.h> #include <CGAL/Lazy_exact_nt.h> #include <list> #include <cstdlib> #include <cmath> #include <c...
ALGO
0.995563
6.067027
{ "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...
d024efbe-be8c-4c72-bdfe-376c1fe8b537
Panchenko2000/Panchenko
lab7.cpp
#include <iostream> #include <stdlib.h> using namespace std; long double fact(int k){ if (k == 0) return 1; else return k * fact(k - 1); } void task_1(double Subject, double Const1, double Const2, double Const3){ double dResult = Const1 * pow(Subject, 2) + Const2 * Subject + Const3; cout << dResult << endl; } v...
ALGO
0.997681
3.570103
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2020-04-03T08:54: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": "35e4da30fe...
765fca85-155c-431c-93e6-80c1396ab51d
anandsagar00/Data-Structure-and-Algorithm
zig_zag_tree.cpp
/* Problem Statement: ZigZag tree Problem Level: HARD Problem Description: Given a binary tree, print the zig zag order i.e print level 1 from left to right, level 2 from right to left and so on. This means odd levels should get printed from left to right and even level right to left. Input format : Elements in level o...
ALGO
0.999995
4.662515
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2022-04-18T13:49:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4f84f3d21e24...
bd005ece-7df9-4188-8ab5-c9c6c6c9ec97
fmidev/rack
src/andre/ShipOp.h
/* MIT License Copyright (c) 2017 FMI Open Development / <NAME>, <EMAIL> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy...
TOOL
0.933345
6.439088
{ "github_metadata": { "branch": "main", "commit_count": 1284, "repo_created_at": "2016-10-03T07:26:29.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 38, "forks": 6, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "892889a04...
bf15db0d-f485-401d-bb76-9d42036cff18
senyuzilgaz/LeetCode
98-validate-binary-search-tree/98-validate-binary-search-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999959
6.238142
{ "github_metadata": { "branch": "main", "commit_count": 686, "repo_created_at": "2021-12-30T18:12: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": "5816cacf56...
fc9eeb77-9988-4577-9d11-02e19359662e
alekhutson/Computational-Physics-Assignments
Homework1/Problem2/Problem2.cpp
#include <iostream> #include <vector> #include <string> #include<cmath> #include <fstream> using namespace std; int main(){ int x=1; //initializes x for(int i=0;i<1000;i++){ // iteratively multiplies by two int m=x; x=x*2; if(m != x/2){ cout << m; //prints the larges...
ALGO
0.998537
3.214023
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2020-12-07T01:27: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": "704adb598539...
7e75711d-7125-4768-a2be-ccac63a0a8bb
bobyanggg/leetcode_cpp
01_array/851.loud_and_rich/sol.cpp
#include <iostream> #include <vector> #include <string> using namespace std; class Solution { public: vector<int> loudAndRich(vector<vector<int>> &richer, vector<int> &quiet) { vector<vector<int>> myvec(quiet.size(), vector<int>()); for (int i = 0; i < richer.size(); i++) { ...
ALGO
0.999997
5.636433
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2022-07-04T08:23:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d287a9dd0ced...
e488cf94-a090-4613-bfab-6d92c25ce86a
Taj88/Codeforces
B_Decode_String.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define forn(i, n) for (int i = 0; i < n; i++) int main() { ios::sync_with_stdio(false); cin.tie(0); int v; cin >> v; while (v--) { int n,t; cin >> n; string s, ans=""; cin >> s; for (int i...
ALGO
0.999603
3.773932
{ "github_metadata": { "branch": "master", "commit_count": 67, "repo_created_at": "2022-03-28T14:40: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": "1b7436dfb...
8b674e8d-8ca3-4332-9b21-776d299ef555
FabioHy/Jeofton-exercise
lista jeofton/q8.cpp
#include<stdio.h> #include<stdlib.h> /*Faca um programa que apresenta a seguinte saída, perguntando ao usuário o número máximo (no exemplo, 9). Este número deve ser sempre ímpar. 1 2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 3 4 5 6 7 4 5 6 5 */ int main () { int num,...
ALGO
0.998705
3.334657
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-10-07T21:19: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": "08733b605e33...
69b2890f-f408-40d4-ac18-77dfb4248a64
robdoesweb/PowerballSimulator
main.cpp
// File Name: A6russellr.cpp // Written by: <NAME> // Description: Final Project, PowerBall. Generates 5 random numbers between 1 and 59 and 1 PowerBall between // 1 and 35. Asks user to pick same format of numbers and matches based on the rules of the PowerBall lottery // game. // Challenges: Generating Random Numbe...
ALGO
0.984631
3.440997
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2014-07-15T19:07:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "24482ff3d5...
5b42d4e5-fad7-4f59-b57e-d581f5a1d34d
blackhole6/algorithm-code
个人自用资料/ACM/最大最小表示法/Hidden Password.cpp
//最小表示法模版 #include<iostream> #include<cstring> #include<algorithm> #include<cstdio> using namespace std; const int maxn=1e6+5; typedef long long ll; char str[maxn]; int Next[maxn]; void getNext( char T[],int len) { int i = 0, j = -1; Next[0] = -1; while(i < len) { if(j == -1 || T[i] == T[j]) ...
ALGO
0.999943
3.213688
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2020-11-20T09:40: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": "6f707238df6b...
dcf94109-5092-4ea7-8a65-c795f865f0f2
Server-Monks-7/Machobane-Farming-Simulation-
Machobane farming System C++.cpp
#include <iostream> using namespace std; void WinterCropManagement(int wheat,int peas,int potatoes){ for(int i = 0; i<wheat; i++) { cout << "*"; } cout << endl; for(int i = 0; i<peas; i++) { cout << "%"; } cout << endl; for...
TOOL
0.991431
4.966184
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-11-27T20:03:45.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e833d9d99bbfc...
23cd56d0-13e9-4669-96c2-9ce2b23d5425
dhruveshpatel25/DSA
15-Heaps/074-Heap Basic/Min-Heap.cpp
#include<iostream> using namespace std; void heapify(int arr[],int size,int index){ int smallest=index; int leftindex=2*index; int rightindex=2*index+1; //check if the left index in inside the count and then compare with smallest value //if it is smaller then swap if(leftindex<size && arr[smal...
ALGO
0.999915
4.366415
{ "github_metadata": { "branch": "main", "commit_count": 77, "repo_created_at": "2024-10-15T17:28: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": "0e49fdc8881...
8d7a1547-1b82-4ebd-96d2-162e9d618101
osudrl/atrias
software/atrias_controllers/asc_hip_boom_kinematics/include/asc_hip_boom_kinematics/ASCHipBoomKinematics.hpp
#ifndef ASC_HIP_BOOM_KINEMATICS_HPP #define ASC_HIP_BOOM_KINEMATICS_HPP /** * @file ASC_HIP_BOOM_KINEMATICS.hpp * @author <NAME> * @brief This implements hip/boom kinematic relationships. */ // The include for the controller class #include <atrias_control_lib/AtriasController.hpp> // And for the logging hel...
TOOL
0.929063
3.868291
{ "github_metadata": { "branch": "master", "commit_count": 2583, "repo_created_at": "2013-01-10T04:20:31.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 15, "forks": 10, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1ec5d0...
2aa5b69f-29a5-4dc5-85fc-47bd3a256f49
Skivap/Computer-Graphic-NTHU-CS550700
HW2/HW2/shared.cpp
#include "shared.hpp" /* Variable */ GLFWwindow* window; std::pair<double, double> mouseCursor; const float MAX_FPS = 1.0f / 60.0f; const int SCREEN_HEIGHT = 800; const int SCREEN_WIDTH = 800; bool onFocus = false; /* Vertex Shader */ const char* vertexShaderSource = R"( #version 450 core layout (location = 0) in v...
TOOL
0.952136
4.15076
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-12-26T17:31:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "740f54f7ab9c...
8e5a27ef-31ad-46eb-b2b5-473abf97b947
kanghuiseon/algorithmStudy
Rare1_Greedy/juny/1202_보석도둑.cpp
#include <stdio.h> #include <iostream> #include <queue> #include <vector> #include <algorithm> using namespace std; int main() { int N, K; cin >> N >> K; vector< pair<int,int> > jewel; vector<int> bag; int a, b; for(int n = 0; n < N; n++) { cin >> a >> b; jewel.push_back(make...
ALGO
0.999967
4.237097
{ "github_metadata": { "branch": "master", "commit_count": 73, "repo_created_at": "2021-06-26T02:48:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2744539c1...
dcb4299d-fb07-4281-b114-6f5c5ef0e3b7
SRR23/DSA
Two_Pointers_Method/MergeTwoSortedArrays.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n, m; cin >> n >> m; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } int b[m]; for (int i = 0; i < m; i++) { cin >> b[i]...
ALGO
0.999994
3.267644
{ "github_metadata": { "branch": "main", "commit_count": 163, "repo_created_at": "2023-01-28T09:35: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": "5288dd9abc...
d14257e2-4311-4aa5-98c8-2e7fde4b266e
ehdbs28/Algorithm
PROGRAMMERS/BestPlaylist.cpp
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <map> #include <queue> using namespace std; struct song{ int play; int idx; bool operator()(song a, song b){ if(a.play == b.play){ return a.idx > b.idx; } return a.play < b.play; ...
ALGO
0.999942
5.166277
{ "github_metadata": { "branch": "main", "commit_count": 561, "repo_created_at": "2022-09-03T17:27: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": "02e03330a3...
1cdc75f3-a706-4aa1-aa0e-9ae6108caa3a
vrancurel/dcss
src/main.cpp
/* * Copyright 2017-2018 the DCSS authors * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the followi...
TOOL
0.914308
7.080453
{ "github_metadata": { "branch": "master", "commit_count": 169, "repo_created_at": "2017-03-13T18:56:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 3, "issues": 7, "pull_requests": 1 }, "file_meta": { "content_id": "b35b3093...
76da33df-d968-4531-b932-1d39b8bfbdd5
Kyaki101/Competitive-Programming
cses/mathematics/exponentiationII.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; template <typename Key, typename Value> using ordered_map = tree<Key, Value, less<Key>, rb_tree_tag, tree_order_statistics_node_update>; template <typename T> using ord...
ALGO
0.999713
4.502356
{ "github_metadata": { "branch": "main", "commit_count": 242, "repo_created_at": "2023-12-19T16:25: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": "2e05ca7675...
432b40db-d87b-4eb9-acf9-0317058f2c7a
jacktrip/jacktrip
externals/Simple-FFT/include/simple_fft/fft.h
/** * Copyright (c) 2013-2020 <NAME> * * This file is a part of Simple-FFT project and is distributed under the terms * of MIT license: https://opensource.org/licenses/MIT */ #ifndef __SIMPLE_FFT__FFT_H__ #define __SIMPLE_FFT__FFT_H__ #include <cstddef> using std::size_t; /// The public API namespace simple_ff...
ALGO
0.974961
7.007654
{ "github_metadata": { "branch": "main", "commit_count": 4408, "repo_created_at": "2015-03-14T01:04:13.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 933, "forks": 109, "issues": 37, "pull_requests": 4 }, "file_meta": { "content_id": "57c91...
11a0b357-7f52-4912-938b-127c55831f66
MojoAlpha/CSES-Problemset
Sorting and Searching/Towers.cpp
#include <bits/stdc++.h> #define ll long long #define N 100005 #define M 10000007 #define O 1000000009 #define vll vector<long long> #define vl vector<long> #define dis(n) cout << n << endl #define fo(i, N) for (int i = 0; i < N; ++i) #define fos(i, b, N) for (int i = b; i < N; ++i) #define forr(i, N) for (i = N; i >= ...
ALGO
0.999898
3.870383
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2020-06-24T06:20:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 21, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "df1059ac...
6de9c62e-a621-45f1-97e4-e9175dfd4363
shhriiii/aassgmnt-4
assgmnt 4/q5.cpp
#include <iostream> #include <cmath> int main() { // Declare variables int firstTerm = 3; // First term of the GP int commonRatio = 4; // Common ratio of the GP int n; // Number of terms in the GP // Prompt the user to enter the number of terms std::cout << "Enter the number of terms: "; s...
ALGO
0.94541
5.021008
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-05-13T17:44: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": "11b750de9689...
f21bbde3-5ced-4e8b-83c7-03559effe53b
krushnabembade/dsapractical4
Practical_03.cpp
// // Created by NIHAAL on 3/19/2022. // #include <iostream> using namespace std; struct Bstnode { int data{}; Bstnode *left = nullptr; Bstnode *right = nullptr; }; class Btree { int n; int x; public: bool flag = false; Bstnode *root; Btree() { root = nullptr; } Bst...
ALGO
0.99992
4.730653
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-05-22T06:52: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": "4680ce9bf848...
8dd82e52-d09e-4f65-923d-f8859485c897
NDT080506/HocLapTrinh
THCS2/thuchanh2/thuchanhbai12.cpp
#include <stdio.h> #include <math.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #define fo(i,n) for(int i = 0; i < (n); i++) #define min(a,b) ((a < b)? a : b) #define max(a,b) ((a > b)? a : b) #define MAX_N 100000 typedef long long ll; typedef struct{ int ten[16]; char ngay[3]; char thang[3]; char...
ALGO
0.999404
3.192446
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2025-05-17T09:34: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": "65549ab1f03...
af6cc877-7c03-4e4e-a581-61125a6ee194
yz1019117968/FSE-24-UniTrans
cleaned_data/transcoder_evaluation_gfg/cpp/DISTRIBUTING_M_ITEMS_CIRCLE_SIZE_N_STARTING_K_TH_POSITION.cpp
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // #include <iostream> #include <cstdlib> #include <string> #include <vector> #include <fstream> #include <iomanip> #include...
ALGO
0.999813
5.598944
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-04-06T11:00:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 20, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c978699d48f...
5619af98-f107-4fbd-ad53-4f7d0679ac84
gogojjh/M-LOAM
mloam_loop/include/mloam_loop/factor/lidar_map_plane_norm_factor.hpp
/******************************************************* * Copyright (C) 2020, RAM-LAB, Hong Kong University of Science and Technology * * This file is part of M-LOAM (https://ram-lab.com/file/jjiao/m-loam). * If you use this code, please cite the respective publications as * listed on the above websites. * * Li...
ALGO
0.997919
6.741879
{ "github_metadata": { "branch": "mloam_gf", "commit_count": 451, "repo_created_at": "2020-10-28T08:29:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 491, "forks": 92, "issues": 10, "pull_requests": 0 }, "file_meta": { "content_id": "6f...
7d4aabe0-e87a-42c0-ae10-1adcb0188687
deep-in-apeirophobia/CompetetiveProgramingCodes
CF/587D.cpp
#include <bits/stdc++.h> using namespace std; const int MaxN = 5e4 + 6.66; const int Max = MaxN * 8; struct Edge { int b, e, c, t; }; Edge edges[MaxN]; vector<int> eds[Max]; vector<int> revs[Max]; bool mark[Max]; int scc[Max]; int prv[MaxN]; vector<int> topo; map<int, int> prv_col[MaxN]; int ans[Max]; istream& oper...
ALGO
0.999996
3.617427
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2019-12-17T13:48:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bd3580bc4a...
79a61c4b-cdbf-4b52-ba13-f039e4b433e8
HammoucheSonia/Exolegend
src/utils.cpp
#include "vector2.h" #include "Warrior.hpp" #include "utils.h" #include <sys/time.h> bool detectOutside(Warrior *gladiator, unsigned long start_time) { unsigned long end_time; MazeSquare near = gladiator->getNearestSquare(); int i = near.i; int j = near.j; end_time = millis(); float tim...
ALGO
0.943402
4.153827
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-03-31T18:03:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cbcab4c19ce8...
d8484b4b-5f5e-46b6-8c8a-18fb7a1938bd
mmatrosov/FKN2020
kr1/problems/F/shortest_student_solution.cpp
#include <algorithm> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; int main() { size_t m, n; cin >> m >> n; vector<string> strings(m); for (size_t i = 0; i < m; i++) { cin >> strings[i]; } map<string, size_t> cnt; for (size_t i = n - 1; i < m; i++) { ...
ALGO
0.999967
3.862123
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2020-09-24T17:37: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": "c981e7852...
9aa6b40f-bb13-43f1-a621-12f9399ffedf
NatLarina/Labs_coding
Lab_1_code.cpp
#include <iostream> #include <string> // Структура для элемента списка struct ListNode { std::string str; int num; double dbl; ListNode* next; ListNode* prev; ListNode(const std::string& s, int n, double d) : str(s), num(n), dbl(d), next(nullptr), prev(nullptr) {} }; // Структура для списка s...
TOOL
0.974365
5.851075
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2024-05-21T08:27: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": "e1c3293a645...
25f787cf-fb4b-4e08-bd23-cb0e67712e37
Abhibhab/Abhibhab_Leetcode
110-balanced-binary-tree/110-balanced-binary-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999923
6.156339
{ "github_metadata": { "branch": "main", "commit_count": 598, "repo_created_at": "2022-08-07T21:05: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": "a4d6c94b78...
2147ca23-86ad-486c-abe1-be7cf9f11d92
Andwerpz/Competitive-Programming-Practice
- cpp -/enemyisweak.cpp
#include <bits/stdc++.h> typedef long long ll; using namespace std; //Codeforces - 61E //first, compress the strengths of the soldiers into a range from 0 - (n - 1) //use two segment trees. One to keep track of occurrences of numbers, //and one to keep track of for each person, how many people they are greater than...
ALGO
0.99997
3.970285
{ "github_metadata": { "branch": "main", "commit_count": 339, "repo_created_at": "2021-02-26T19:38: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": "2609e39210...
8c3fd583-0e83-4fdc-b53f-c62472ee6cd2
cginternals/glbinding
source/tools/glinfo/main.cpp
#include <iostream> #include <map> #include <set> #include <vector> #include <algorithm> #include <GLFW/glfw3.h> #include <glbinding/AbstractFunction.h> #include <glbinding/Version.h> #include <glbinding/glbinding.h> #include <glbinding/gl/gl.h> #include <glbinding-aux/Meta.h> #include <glbinding-aux/ContextInfo.h...
TOOL
0.909509
5.885859
{ "github_metadata": { "branch": "master", "commit_count": 1569, "repo_created_at": "2014-05-03T15:10:44.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 855, "forks": 95, "issues": 20, "pull_requests": 4 }, "file_meta": { "content_id": "ced2...
038558bf-b0ee-4ecb-8b6c-d47a853364b7
qpalzmm22/BOJ_Solutions
9527.cpp
#include <iostream> #include <vector> #define ull unsigned long long /* * 3-10 * 11 2 * 100 1 * 101 2 * 110 2 * 111 3 * 1000 1 * 1001 2 * 1010 2 * 1011 3 * 1100 2 * 1101 3 * 1110 3 * 1111 4 * => 15 * Divide and conquer gogo */ ull A, B; int map16[16]; using namespace std; ull dp[10000]; // n is fr...
ALGO
0.999694
4.065583
{ "github_metadata": { "branch": "main", "commit_count": 33, "repo_created_at": "2021-08-07T10:50: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": "24f1f94e8c4...
394535d2-18a8-48c5-bcf2-3d8966550102
ogoe/waves2Foam
src/waves2FoamProcessing/preProcessing/setWaveProperties/irregular/waveSpectra/phases/focusingPhase/focusingPhase.H
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright held by original author \\/ M anipulation | ------------------...
ALGO
0.9974
5.591153
{ "github_metadata": { "branch": "master", "commit_count": 277, "repo_created_at": "2012-02-20T17:41:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 47, "forks": 45, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "515a42...
23b0cd77-1b53-4319-ae0c-5640287bb7b2
tedrobotbuilder/PolyPE2
PEtwo4/BullDozerTwo.ino
// BullDozer Two // ##################### BullDozerTwo ############################################ // find pipe, push while not falling off table //boolean g_leftEdgeSensor=false; //boolean g_rightEdgeSensor=false; //boolean g_centerEdgeSensor=false; //boolean g_EdgeSensor=false; void BullDozerTwo(boolean p_seekR...
ALGO
0.961685
5.217728
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2016-12-15T17:44: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": "d2ddd78ec2...
cdb3e069-60ad-4d5c-8cd2-aa58551aee9f
tiwason/practice
Trees/LCA/maxDiffNodes.cpp
#include <iostream> #include <climits> using namespace std; struct Node { int data; Node* left; Node* right; }; Node* getNewTreeNode(int data) { Node* newNode = new Node(); newNode->data = data; newNode->left = NULL; newNode->right = NULL; return newNode; } bool isLeafNode(Node* nod...
ALGO
0.99995
5.215467
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2020-11-25T05:26:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "96a257fe4d...
6c931d9a-ddda-4923-9993-2b6ac601ad5d
papaboo/smalldacrt
Plane.h
#ifndef _SMALL_PLANE_H_ #define _SMALL_PLANE_H_ #include "Vector.h" #include <string> #include <iostream> /** * The plane is defined the the plane equation Ax + By + Cz + D = 0. The normal * of the plane is given by [A, B, C] and the distance is D. The normal is * assumed to be normalized on construction, so the ...
TOOL
0.921362
6.557435
{ "github_metadata": { "branch": "master", "commit_count": 130, "repo_created_at": "2011-12-20T20:46:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "502c68e0...
2a40865b-8228-40a9-ba5f-61f56bf5256f
saimeghana-y/Data-Stuctures
List/list_deletion.cpp
#include <bits/stdc++.h> using namespace std; struct Node { int data; Node *next; }; void push(Node** head_ref, int new_data) { struct Node* new_node = new Node; new_node->data = new_data; new_node->next = (*head_ref); (*head_ref) = new_node; } void deleteNode(Node **head_ref, int key) { ...
ALGO
0.999572
4.365654
{ "github_metadata": { "branch": "master", "commit_count": 43, "repo_created_at": "2020-06-14T10:14: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": "d03627b19...
3fdb2227-1f53-4831-87eb-c6db89e46e5c
MuktadulIslam/SPL
SPL/header files/matrix.h
#include<bits/stdc++.h> using namespace std; int * input_matrix_from_file(char *fileName, int *row, int *column); int * input_matrix_from_console(int *row, int *column); int * matrix_memory_optimization(int * matrix, int row, int column); void print_matrix(int *matrix, int row, int column); int * matrix_addition(int ...
ALGO
0.980802
3.421367
{ "github_metadata": { "branch": "main", "commit_count": 26, "repo_created_at": "2022-02-18T08:53: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": "d8f0f6920fe...
26a7b62a-0a00-42f3-9e3b-2548b5468337
HungLe210/TrainingSort
Eight Point Sets.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; const int MAX = 1e6 + 5; struct Point { int x, y; bool operator<(const Point& another) { return (x < another.x || (x == another.x && y < another.y)); } }; bool fre_x[MAX], fre_y[MAX]; int main() { int x, y; vector<int> X, Y; vector<P...
ALGO
0.999381
3.820467
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-11-18T01:45: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": "c2e456dfcccc...
c8edbb2c-e98a-4cc6-a7e4-eb2651613bc5
underscoreanuj/Codes
codingame/Medium/skynet_revolution_episode_1.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <unordered_set> #include <queue> #include <list> using namespace std; /** * Auto-generated code below aims at helping you parse * the standard input according to the problem statement. **/ int N; // the total number of nodes in ...
ALGO
0.99999
4.796631
{ "github_metadata": { "branch": "master", "commit_count": 715, "repo_created_at": "2020-01-03T04:02: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": "dec2c9cc...
b2aac3a4-fb48-4642-9986-eaea23f9d7bd
sallop/Master
etc/workspace/FBM/d20111218/FBM.cc
#include "FBM.hh" void pvec(Pattern v, std::ostream& os = std::cout) { using namespace std; for (size_t i=0; i<v.size(); i++) os << setprecision(8) << SETW << v[i] << " "; os << "\n"; } inline double trace(Layer& W) { using namespace boost::numeric::ublas; size_t D = W.size1(); matrix_vector_range<Lay...
ALGO
0.998964
3.664797
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2012-12-24T02:09: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": "d51174bb83...
b203cd13-f45b-4966-8680-9b53a5b1883a
2745518585/code
P6868.cpp
#include<cstdio> #include<algorithm> #include<queue> using namespace std; const int N=200001; int n,q1,q2,b[N][2],c1[N],c2[N],d[N],fa[N],g[N],g1[N],g2[N]; bool h[N]; struct str { int x,y,t; }a[N]; struct tree { int l,r,s; }T[N<<2]; int find(int x) { if(fa[x]==x) return x; return fa[x]=find(fa[x]); } voi...
ALGO
0.999995
3.953495
{ "github_metadata": { "branch": "master", "commit_count": 46, "repo_created_at": "2023-11-16T07:38: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": "9713dad90...
75bcaebf-4cab-48f0-bc68-0bf6c9c625b5
JefferyHus/starter-kit
exercices/solutions/src/Array Manipulation/rotate_array.cpp
#include<iostream> void rotateLeftArray(int arr[], int n, int k) { int temp[k]; for(int i = 0; i < k; i++) { temp[i] = arr[i]; } for(int i = k; i < n; i++) { arr[i - k] = arr[i]; } for(int i = 0; i < k; i++) { arr[n - k + i] = temp[i]; } } void rotateRightArray(int arr[], int n, int k) { ...
ALGO
0.99997
5.843591
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2021-11-12T22:28:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 18, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2a444ac4bf6...
cfa2b184-349d-42ed-8652-06e1a9456286
ajinkya04-byte/Dsa-Codes
BFS tree.cpp
#include <iostream> #include <cstdlib> using namespace std; struct queue { int size; int front; int back; int* arr; }; // Enqueue function void enqueue(struct queue* ptr, int data) { if (ptr->back == ptr->size - 1) { cout << "Queue is full" << endl; } else { ptr->back++; ...
ALGO
0.999983
6.307695
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2025-01-11T13:16: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": "79e88599cff2...
b30edc00-b408-4511-8146-27a61f15effc
lantimilan/topcoder
CODEFORCE/prob102E.cpp
// ========================================================= // // Filename: prob102E.cpp // // Description: // // Version: 1.0 // Created: 09/16/2011 12:53:28 PM // Revision: none // Compiler: g++ // // Author: <NAME> (lyan), <EMAIL> // Company: U of Calif...
ALGO
0.999782
3.96575
{ "github_metadata": { "branch": "master", "commit_count": 493, "repo_created_at": "2012-07-16T05:16: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": "47ab3294...
bc97040d-6700-4d51-9763-4332820c2022
ishandutta2007/codeforces-o
origenes/normal/1467/E.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define FOR(i, a, b) for (int (i) = (a); (i) <= (b); (i)++) #define ROF(i, a, b) for (int (i) = (a); (i) >= (b); (i)--) #define REP(i, n) FOR(i, 0, (n)-1) #define sqr(x) ((x) * (x)) #define all(x) (x).begin(), (x).end() #de...
ALGO
0.998733
4.072164
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:45: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": "4fe12e9b0da9...
707072a7-4ec4-49ea-89e5-e64237559c5e
minhhuy24072002/LeetCode
minimum-swaps-to-make-sequences-increasing/minimum-swaps-to-make-sequences-increasing.cpp
class Solution { public: int minSwap(vector<int>& a, vector<int>& b) { int n=a.size(); int dp0, dp1, new_dp0, new_dp1; // for (int i = 0; i < n; i++){ // for (int j = 0; j < n; j++){ // dp[i][j] = 100001; // } // } dp0=0; ...
ALGO
0.99997
4.977032
{ "github_metadata": { "branch": "main", "commit_count": 405, "repo_created_at": "2021-12-07T00:32: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": "a7a1850e0d...
ca6bcdd4-822f-4f0d-8a87-3708e65cb991
fatemehkarimi/uvaSolutions
uva-10113.cpp
//uva 10113 //Exchange Rates #include <iostream> #include <algorithm> #include <string> #include <vector> #include <map> using namespace std; int gcd(int a, int b); pair <bool, pair <int, int> > DFS(map < string, map <string, pair <int, int> > > & relations , string & start, string & end); pair <bool, pair <int, ...
ALGO
0.999945
4.080558
{ "github_metadata": { "branch": "master", "commit_count": 213, "repo_created_at": "2018-05-30T07:42:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "50fee7f6...
034c2336-c73f-448b-896d-108a81caf445
AldoEZ/CPCFI
prope7G-prefixSum/1697B.cpp
#include <bits/stdc++.h> using namespace std; #define fastIO() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() #define pb push_back #define sz(a) int(a.size()) #define F first #define S second typedef long long ll; typedef vector<int...
ALGO
0.999874
4.266577
{ "github_metadata": { "branch": "main", "commit_count": 48, "repo_created_at": "2024-12-12T06:41: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": "6dd06ba3a60...
5c8be973-3447-412a-a4f6-b0436d52fdbb
199911/acm
template/ds/splay.cpp
#include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <ctime> #include <cctype> #include <algorithm> #include <utility> #include <numeric> #include <functional> #include <utility> #include <list> #include <set> #include <queue> #include <stack> #include <iostream> #include <iomanip> #include...
ALGO
0.999883
3.755537
{ "github_metadata": { "branch": "master", "commit_count": 94, "repo_created_at": "2013-09-12T14:42: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": "bd26f5cb4...
850a9603-7fa1-4b9b-977a-3fe9c570ee1e
Student9876/dsa
Graph/alien_dictionary.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define f(i,m,n) for(ll i=m;i<n;i++) #define fi(i,m,n) for(ll i=m;i>=n;i--) #define fa(i,j) for(auto i:j) #define nl cout<<endl; #define ump(a,b) unordered_map<a,b> #define omp(a,b) map<a,b> const int MOD = 1e9+7; ll power(ll x, ll y){ll res = 1;while(y...
ALGO
0.999992
4.919822
{ "github_metadata": { "branch": "main", "commit_count": 137, "repo_created_at": "2024-02-15T05:29:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b3566ba45e...
9e43425d-19ac-4c72-b201-49559ee10aaf
wanren13/Leet_Practice
search_matrix.h
#pragma once #include "allhead.h" namespace search_matrix { void printMatrix(const vector<vector<int>>& m) { for (vector<int> v : m) { for (int i : v) { cout << i << " "; } cout << endl; } } void generateMatrix(vector<vector<int>>& m, int size) { if (size == 0) return; srand((int)time(0)); ...
ALGO
0.976775
4.095003
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2017-01-23T07:49: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": "63a6a11f72...
9698c735-96b1-4338-afca-0eb856fdec86
NguyenQuyDai/C-plus-plus
7_5.cpp
#include <iostream> #include <fstream> using namespace std; struct thongtin { string TEN; int NXB, SL, GIA; }; void docfile (thongtin sach[], int &n, ifstream &finp) { finp.open("BOOK.INP.txt"); if (finp.fail()) { cout << "Mo file khong thanh cong"; } finp >> n; for (int i = 0; i < n; i++) { finp.ignore();...
TOOL
0.967061
3.445493
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-03-29T01:07: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": "95af7d86f147...
2a2da0c1-0967-4d30-b423-0bf7501ef6ca
AhmedAbdelshakour1/algorithms-library
Computational_Geometry_lines_distances.cpp
int dcomp(double a, double b){ return fabs(a - b) <= eps ? 0 : a < b ? 1 : -1; } // check is 3 points on the same line? bool isCollinear (point a, point b, point c) { //cp = cross product return fabs(cp(b - a, c - a)) < EPS; } // Ray a-b bool isPointOnRay (point a, point b, point c) { if (!isCollinear(a...
ALGO
0.999861
4.129143
{ "github_metadata": { "branch": "main", "commit_count": 58, "repo_created_at": "2021-12-06T15:16:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9e6909d8f07...
8d2848ca-9763-4ad9-8630-10e0ab3a9ee7
ky100499/ky100499_BOJ
probs/15972(2).cpp
#include <bits/stdc++.h> using namespace std; using ti = tuple<int, int, int>; int W[1002][1002]; vector<ti> G[1002][1002]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); freopen("input.txt", "r", stdin); int N, M, L; cin >> N >> M >> L; for (int i = 1; i <= N; i++) for (int j =...
ALGO
0.999917
4.088755
{ "github_metadata": { "branch": "main", "commit_count": 439, "repo_created_at": "2024-02-28T11:42:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3ddfd7f1be...
da091760-3794-42d2-bcf2-b6a230f9541f
avc9/WnCC_DSA
Lecture1/linkedlist.cpp
#include<iostream> using namespace std; struct node{ int val; node* next; }; class linkedlist{ node* head; public: linkedlist(){ head=nullptr; } void print(){ node* n=head; while(n!=nullptr){ cout<<n->val<<" "; n=n->next; } cou...
ALGO
0.999542
4.303665
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2021-06-14T04: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": "f7e0dd2f6ce...
9cff831a-044f-433d-8dc8-3f72f653ee2e
thanwin84/Dynamic-Programming
selling stocks/cpp solution/best time to buy and sell stock.cpp
// Naive algorithm: If I wanna sell at ith day, that means I need to buy the chapest stock from 0 to i - 1th day. // This will make sure that we get the maximum profit //-----Optimized approach---------- // Keep track of min price at each index // maxprofit at each index = current profit - min price class Solution { ...
ALGO
0.999973
5.959311
{ "github_metadata": { "branch": "main", "commit_count": 326, "repo_created_at": "2021-06-09T15:43: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": "c2893bc74e...
e9bab3c1-5ab7-4cbb-8875-f2b74752ff54
linyos/GreekForGeeks-Practice
Hash/Basic/60. PrintAllDistinctElement.cpp
#include <iostream> #include <string> #include <vector> #include<queue> #include <array> #include <unordered_map> #include <map> #include <set> #include <unordered_set> #include <stack> using namespace std; // Method 1 void printDistinct(int arr[], int n) { for (int i = 0; i < n; i++) { int j; for ( j = 0; j <...
ALGO
0.998838
4.300601
{ "github_metadata": { "branch": "main", "commit_count": 246, "repo_created_at": "2021-08-02T15:27: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": "bc6a704917...
37aec897-95ce-400e-8562-af06a7b5a9ef
JulienFleuret/QIRT2016
smooth.cpp
/*M/////////////////////////////////////////////////////////////////////////////////////// // // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, install, // copy or use the software. // // // Li...
ALGO
0.969868
3.880723
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2016-12-02T21:31: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": "5725676b02...
5ceb57fb-11dd-41ed-87fa-c676372b7a4e
halovvv/LabWork3
LabWork3/LabWork3.cpp
#include <iostream> #include <cstdlib> #include <strstream> using namespace std; class Vector { private: int size; int* arr = 0; int max, min; public: Vector(int s) : size(s) { arr = new int[size]; } ~Vector() { delete[] arr; } void setsize(int newsize) { arr = new ...
ALGO
0.991743
3.229127
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-10-08T16:32:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0de53d2207...
d1cbcb23-e7ce-4de3-b62e-03dcd340ff67
rtrius/Bullet-FLUIDS
bullet-2.81-rev2613/src/BulletFluids/CollisionDispatch_temp/btSphereCapsuleCollisionAlgorithm.h
/* Bullet-FLUIDS Copyright (c) 2012 <NAME> This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applicat...
ALGO
0.991358
7.601019
{ "github_metadata": { "branch": "master", "commit_count": 134, "repo_created_at": "2012-05-21T06:33:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 40, "forks": 7, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "77670d5...
01dd01fa-c16e-4de7-8abf-44f8753eb516
juliomassignan/SiemensQuestionary_JulioMassignan
Question#2/main.cpp
/****************************************************************************** Techincal Assessment - Siemens Job Interview Author: <NAME> Date: 12th May 2021 Code and solution for question #2 *******************************************************************************/ #include <iostream> using namespace std; ...
CONFIG
0.994936
3.756674
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2021-05-11T19:05: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": "0d7f20e1991...
974a8795-51ef-4308-8c0c-fb934f6b0344
kykuruzk/sem2-lab4
Menu.h
#pragma once #include <iostream> #include <limits> #include <sstream> #include "Set.h" #include "student.h" using namespace std; class Menu { private: BinaryTree<Student>& tree; Student student; Student student2; public: explicit Menu(BinaryTree<Student>& tree) : tree(tree) {} void run() { int choice; do { ...
TOOL
0.963942
4.062917
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-06-29T21:18: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": "6a30dd4b6200...
cb9409c6-6f6c-4bcb-b672-b64544da84b7
ishandutta2007/codeforces-f
fedoseev.timofey/normal/1039/D.cpp
#include <iostream> #include <algorithm> #include <vector> #include <set> #include <map> #include <stack> #include <queue> #include <deque> #include <ctime> #include <random> #include <cmath> #include <bitset> #include <iomanip> #include <list> #include <unordered_set> #include <unordered_map> #include <cassert> using...
ALGO
0.999875
4.359951
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:43:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "79aae26a1d0b...
c58d99b8-6e50-4316-9021-4fb5077eba43
AkshatRauthan/Decode-DSA-2.0-With-Cpp
63. Graphs 02/Leetcode1034_ColouringBorder.cpp
#include "iostream" #include "vector" using namespace std; vector<vector<bool>> visited; bool helper(vector<vector<int>>& v, int i, int j, int color, int initial) { if (i < 0 || j < 0 || i >= v.size() || j >= v[0].size() || visited[i][j]) return false; if (v[i][j] != initial) return true; if (i == 0 || j =...
ALGO
0.999814
5.198406
{ "github_metadata": { "branch": "main", "commit_count": 45, "repo_created_at": "2024-01-04T16:33:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ee5ed5b1d93...
2ab82488-7e81-41a7-9ec1-4174ac26afa4
aajjbb/contest-files
Codeforces/ValeraAndFruits.cpp
#include <bits/stdc++.h> template<typename T> T gcd(T a, T b) { if(!b) return a; return gcd(b, a % b); } template<typename T> T lcm(T a, T b) { return a * b / gcd(a, b); } template<typename T> void chmin(T& a, T b) { a = (a > b) ? b : a; } template<typename T> void chmax(T& a, T b) { a = (a < b) ? b : a; ...
ALGO
0.999913
4.011476
{ "github_metadata": { "branch": "master", "commit_count": 892, "repo_created_at": "2016-03-02T13:05:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "87e60ca1...
aef39e8f-0970-49bb-a23a-9d11da71525f
AnandDev006/CPlusPlusCodes
max subarray sum/main.cpp
#include <iostream> #include <vector> #include <set> using namespace std ; int main() { vector<int> v ; set<int> presum ; int n , m ; int x ; int maxim = 0 , sum = 0 ; cin >> n >> m ; presum.insert( 0 ) ; for( int i = 0 ; i < n ; ++i ){ cin >> x ; sum = ( sum + x ) % ...
ALGO
0.999991
3.813393
{ "github_metadata": { "branch": "master", "commit_count": 88, "repo_created_at": "2017-12-20T16:03: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": "802af5b35...
5a043ac3-ce2e-4de6-85a1-385b71bb94ac
Strong10mede/C_C--
Div2/892/q1.cpp
#include<bits/stdc++.h> #define ll long long int #define SORT(a) sort(a.begin(), a.end()) #define FOR(a,b, n) for (ll a = b; a < n;a++) #define vi vector<ll> #define vii vector<vector<ll>> #define pii pair<ll,ll> using namespace std; void sol(){ ll n; cin>>n; vi a(n); vi b, c; FOR(i,0,n){ ci...
ALGO
0.999901
3.493141
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2023-08-21T10:23: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": "4eeaaa4c284...
3fb352e5-6a02-466a-84f8-a06c75a86ff8
eaniconer/adventofcode-2024
day-06/part-1.cpp
#include "file_reader.hpp" #include "plane/object.hpp" #include <iostream> #include <unordered_set> #include <cassert> namespace { using world::plane::OrientedObject; using world::plane::Direction; using world::plane::Vec2i; OrientedObject<> findGuard(const std::vector<std::string>& field) { for (size_t i = 0; i...
ALGO
0.999708
6.196645
{ "github_metadata": { "branch": "main", "commit_count": 39, "repo_created_at": "2024-12-01T15:24: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": "23148c82500...
b841c0ac-fb48-4f2d-bfae-489a29c6df2f
surenvithanage/Stimulator
Thread safe app/Stimulator/cluster/src/Args.h
#ifndef ARGS_H #define ARGS_H #include <stdlib.h> #include <getopt.h> /** * Represents CLI arguments passed to the application. */ struct Args { /** * Whether any arguments were parsed. */ bool isParsed = false; /** * Whether any errors occured during argument parsing. */ bool hasError = false; /** ...
TOOL
0.907815
7.016619
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2020-10-25T13:29:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f6ad3c1da95e...
1b71b592-6c6d-4768-bff1-9705d4a288a8
Mengsen-W/algorithm
cpp/890_find_and_replace_pattern/find_and_replace_pattern.cpp
/* * @Date: 2022-06-12 10:50:48 * @Author: <NAME> * @LastEditors: <NAME> * @LastEditTime: 2022-06-12 11:15:07 * @FilePath: /algorithm/890_find_and_replace_pattern/find_and_replace_pattern.cpp */ #include <cassert> #include <string> #include <unordered_map> #include <vector> using namespace std; class Solution ...
ALGO
0.999967
6.101331
{ "github_metadata": { "branch": "main", "commit_count": 1562, "repo_created_at": "2021-01-17T11:54: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": "255dcc8ed...
6c858c52-94bd-4c45-b37a-1bec3b5784ef
sangam151/DSA-Solutions
PROBLEMS ON ARRAY/problem34_mtd4.cpp
#include<bits/stdc++.h> using namespace std; vector<int> findMissingRepeatingNumbers(vector<int> a ) { long long n=a.size(); int xr=0; for(int i=0;i<n;i++) { xr=xr^a[i]; xr=xr^(i+1); } int bitno=0; while(1) { if((xr &(1<<bitno))!=0) { break; ...
ALGO
0.999899
3.916264
{ "github_metadata": { "branch": "main", "commit_count": 110, "repo_created_at": "2024-12-26T17:34: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": "5d87ba034a...
1c274aed-5ae9-49a2-8904-711c19655a3f
walter298/Advent-of-Code
2023/day8.cpp
#include "day8.h" using Children = std::pair<std::string, std::string>; struct Network { std::string directions; std::vector<std::string> beginningNodes; std::unordered_map<std::string, Children> map; }; int stepCPart2(Network& network) { int ret = 0; auto goInDirection = [&network](auto memp) { for (auto& ...
ALGO
0.999703
5.985131
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2021-12-03T02:10:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ac62046a974...
3606ab22-7387-470e-952a-4337185c66ae
stefanseefeld/openvsip
src/vsip/impl/solver/toepsol.hpp
// // Copyright (c) 2005 CodeSourcery // Copyright (c) 2013 <NAME> // All rights reserved. // // This file is part of OpenVSIP. It is made available under the // license contained in the accompanying LICENSE.BSD file. #ifndef vsip_impl_solver_toepsol_hpp_ #define vsip_impl_solver_toepsol_hpp_ #include <algorithm> #in...
ALGO
0.999435
6.15919
{ "github_metadata": { "branch": "master", "commit_count": 72, "repo_created_at": "2013-04-29T01:07:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 14, "forks": 7, "issues": 1, "pull_requests": 1 }, "file_meta": { "content_id": "111f1dde...
04042b63-8bca-4dfc-9751-34896f84b208
yamate11/compprog
zAsa/y2024/0422/6/cans.cc
#include <bits/stdc++.h> #include <cassert> using namespace std; using ll = long long int; using u64 = unsigned long long; using pll = pair<ll, ll>; // #include <atcoder/all> // using namespace atcoder; #define REP(i, a, b) for (ll i = (a); i < (b); i++) #define REPrev(i, a, b) for (ll i = (a); i >= (b); i--) #define A...
ALGO
0.999994
4.22595
{ "github_metadata": { "branch": "main", "commit_count": 219, "repo_created_at": "2021-03-11T06:12: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": "32020c0080...
d10a26ac-383d-46b5-87fa-262a8a73f5bc
zaidkhokhawala/Wd_react
c languge/array3.cpp
<<<<<<< HEAD #include <stdio.h> main() { int a[4], sum = 0; int i, j, temp; for (i = 0; i < 4; i++) { printf("Enter number: "); scanf("%d", &a[i]); sum += a[i]; } for (i = 0; i < 4; i++) { for (j = i + 1; j < 4; j++) { if (a[i] < a[j]) { ...
ALGO
0.999951
3.60197
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2025-03-05T22:09: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": "8bab07a6b7...
a9530e8e-aae9-4f26-a7cb-5b0934cab382
nbatho/Cautruc_dulieu_giaithuat
DSAKT110 - Nha khong ke nhau.cpp
#include <bits/stdc++.h> using namespace std; /* với i > 2 nếu dãy chứa a[i - 2] độ dài lớn nhất có thể là dp[i-2] + a[i] nếu dp[i-1] dương nếu ko chứa thì chỉ có độ dài là dp[i-1] */ void solve() { int n; cin >> n; int a[n+5] ={0}; int dp[n + 5] = {0}; for (int i = 1 ;i <= n;i++) { ...
ALGO
0.999685
4.127017
{ "github_metadata": { "branch": "main", "commit_count": 302, "repo_created_at": "2024-08-11T14:12:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "efd5f9b0d4...
c84da109-7562-4f8c-b236-7bd228e14bd3
cms-sw/cmssw
RecoEgamma/EgammaPhotonAlgos/src/EnergyUncertaintyPhotonSpecific.cc
#include "RecoEgamma/EgammaPhotonAlgos/interface/EnergyUncertaintyPhotonSpecific.h" #include <iostream> EnergyUncertaintyPhotonSpecific::EnergyUncertaintyPhotonSpecific(const edm::ParameterSet& config) {} EnergyUncertaintyPhotonSpecific::~EnergyUncertaintyPhotonSpecific() {} void EnergyUncertaintyPhotonSpecific::in...
TOOL
0.911806
6.840313
{ "github_metadata": { "branch": "master", "commit_count": 251237, "repo_created_at": "2013-06-26T14:09:07.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1144, "forks": 4480, "issues": 947, "pull_requests": 108 }, "file_meta": { "content_id...
c2a952cf-920b-47f1-93f7-9fc99ae19ade
o-zhongchong/leetcode
Leetcode/211.cpp
struct TrieNode { int isExist; struct TrieNode* next[26]; TrieNode():isExist(0) { for(int i=0; i<26; ++i) { next[i] = nullptr; } } ~TrieNode() { for(int i=0; i<26; ++i) { if(next[i] != nullptr) { dele...
ALGO
0.999662
5.463588
{ "github_metadata": { "branch": "master", "commit_count": 737, "repo_created_at": "2019-06-30T09:56: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": "42b3445d...
f9a32d99-0e3e-49a4-b6c7-9e7b0758ab60
ArielAvshalom/cuny-ttp-algo-summer-2022-seminar
assignment_solutions/mergeIntervals/lc252/lc252.cpp
// Problem Statement # // Given an array of intervals representing ‘N’ appointments, find out if a person can attend all the appointments. using namespace std; #include <algorithm> #include <iostream> #include <vector> class Interval { public: int start; int end; Interval(int start, int end) { this->sta...
ALGO
0.999984
6.0865
{ "github_metadata": { "branch": "main", "commit_count": 616, "repo_created_at": "2022-06-01T00:44:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 17, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "cff33f951...
e3bbe3a6-e5d8-4c59-84f8-7a62ddcaf2f8
gsp26/IB
Arrays/first-missing-integer.cpp
/* Given an unsorted integer array, find the first missing positive integer. Example: Given [1,2,0] return 3, [3,4,-1,1] return 2, [-8, -7, -6] returns 1 Your algorithm should run in O(n) time and use constant space. */ int Solution::firstMissingPositive(vector<int> &A) { // Do not write main() function. ...
ALGO
0.999844
4.387112
{ "github_metadata": { "branch": "master", "commit_count": 113, "repo_created_at": "2017-04-29T21:58: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": "d2f689d1...