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
ce8dc21d-57d1-4d0b-bd2b-6c6b4f86f4e4
RobinSchmidt/RS-MET
Libraries/RobsJuceModules/rapt/Spectral/SinusoidalModel.cpp
template<class T> bool rsInstantaneousSineParams<T>::isValid() const { return rsIsFiniteNonNegativeNumber(freq) && rsIsFiniteNonNegativeNumber(gain) && phase >= -PI && phase <= PI; } //================================================================================================= template<class T> void...
ALGO
0.951913
5.773928
{ "github_metadata": { "branch": "work", "commit_count": 12452, "repo_created_at": "2016-10-25T07:53:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 61, "forks": 6, "issues": 77, "pull_requests": 0 }, "file_meta": { "content_id": "bc7d60...
5b117419-a32d-45f7-970e-b50e9a467376
dpbutter/test1
core/algorithms/substitute.cc
#include <sstream> #include "Cleanup.hh" #include "Functional.hh" #include "algorithms/substitute.hh" #include "properties/Indices.hh" #define DBG_MACRO_NO_WARNING #define DBG_MACRO_DISABLE #include "dbg.h" //#define DEBUG 1 using namespace cadabra; substitute::Rules substitute::replacement_rules = substitute::Ru...
TOOL
0.926468
6.551964
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2025-04-01T23:36: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": "1f8d05fc886b...
3b70b096-255b-4636-b875-34026ea64827
AIT124/oopcg
2d.cpp
/* Name : Puja Roll No : 7243 Assignment : 3 Problem Statement : Implement 2D transformation - translation, rotation and scaling. Using mouse event. */ #include <iostream> #include <math.h> #include <GL/glut.h> #include <vector> #include <utility> #include <climits> #include <algorithm> using namespace std;...
ALGO
0.992482
4.656836
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-01-02T18:51: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": "c2e6350c155b...
4fe3e282-d0dd-4e1e-8b0e-e1cde3cc0d80
KrutikaPatil/dev
leetcode/addTwoNumbers/addTwo.hpp
#include <stdio.h> // Definition for singly-linked list. struct ListNode { int val; ListNode *next; ListNode() : val(0), next(nullptr) {} ListNode(int x) : val(x), next(nullptr) {} ListNode(int x, ListNode *next) : val(x), next(next) {} }; void print(ListNode* lst){ ListNode* iter = lst; w...
ALGO
0.999611
5.785351
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2020-05-06T06:56: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": "8da9c7f11...
fda9a613-3557-4c1c-a409-bcd5e2333da7
GersonCavalheiro/OpenMPSnapshot
May2023/RepCPP/142529789/lab1.cpp
#include <iostream> #include <fstream> #include <math.h> #include <iomanip> #include <float.h> #include <cstdlib> #include <string.h> #include <stdlib.h> #include <sstream> #include <omp.h> using namespace std; double **mult_LU(int n, double **lu); double error(int n, double **a, double **pr); double **LU_omp(doub...
ALGO
0.999816
3.408849
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2024-08-19T17:35:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e367c6b49c...
95403920-ab77-4061-abe3-9c2e105890f0
yashkundu/cp
CodeForces/960Div2/A.cpp
/** * author: lazyhash(yashkundu) * created: 20 Jul, 2024 | 20:12:11 **/ #include <iostream> #include <vector> #include <random> #include <chrono> using namespace std; typedef long long ll; typedef long double ld; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int n; vector<int> a; i...
ALGO
0.9999
5.189737
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2023-01-01T05:45: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": "e0e89aa51...
44e3fbd2-8610-48d0-a875-a1eac2289a4c
CangshuXianren/VS2
src/nodefollow/src/pid2.cpp
/************************************************ @jyf 功能包 : string_ws 功能 : AOA跟随TOF避障 进度 : 实现一个安装了anchor的小车跟踪一个自由tag并使用TOF避障 *************************************************/ #include "nodefollow/myGoal.h" #include "nodefollow/node_pid.h" #define PI 3.141592 #define TOLERANCE 0.01 // Distance from the target dista...
TOOL
0.975957
4.421996
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2021-09-28T02:16: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": "01622a17de8...
d92b4493-4fb8-428d-9f77-6639bf20bc01
Ishaan-Singhal1/DS-LAB-2K22-CO-219
Expt57_postorderFromPreorder.cpp
#include<iostream> #include<climits> #include <vector> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int value) : val(value), left(NULL), right(NULL) {} }; TreeNode *buildTreeFromPreorder(vector<int> &preorder, int &index, int maxValue) { if (index >= p...
ALGO
0.999996
5.502686
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-10-29T11:19: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": "be64156a93a4...
81cdb285-dc62-425b-b609-9056c1721e32
castano/nvidia-mesh-tools
src/nvmath/Frustum.cpp
// This code is in the public domain -- <EMAIL> #include "Frustum.h" #include "Box.h" #include "Matrix.h" namespace nv { Frustum::Frustum(float fovy, float aspect, float near, float far) { // Define a frustum looking along the -ve z axis. planes[NEAR] = Plane(Vector3(0,0,1), near); planes[FAR] = Plane(Vector...
ALGO
0.983816
6.021389
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2016-04-11T21:06:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 4, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "1a2a6abb...
60d260c4-07ea-442a-9fbd-ddac8a655845
RahulScripted/LeetCode-Problems
Top 100 Liked/Misc/_56_MergeIntervals.cpp
// Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input. #include <iostream> #include <vector> #include <algorithm> using namespace std; class Solution { public: vector<...
ALGO
0.999997
6.243457
{ "github_metadata": { "branch": "main", "commit_count": 151, "repo_created_at": "2024-09-24T14:55: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": "e97925d3ce...
5ff69531-e8a2-47f7-a2c7-00f40eaf1bfc
dhschall/LLBP
main.cc
/* MIT License * * Copyright (c) 2024 <NAME> and EASE lab * * 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,...
ALGO
0.991492
6.899335
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2024-07-30T14:15:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 26, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b737b6d1d4...
9aee3f8a-0f13-461a-83a9-1db36a579669
ishandutta2007/codeforces-s
square1001/normal/932/E.cpp
#ifndef ___CLASS_MODINT #define ___CLASS_MODINT #include <cstdint> template<std::uint32_t mod> class modint { private: std::uint32_t n; public: modint() : n(0) {}; modint(std::uint64_t n_) : n(n_ % mod) {}; bool operator==(const modint& m) const { return n == m.n; } bool operator!=(const modint& m) const { retur...
ALGO
0.99989
4.457271
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:07: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": "b5f7d3376a7c...
b84108b3-2dca-4479-a89b-5786b4f12901
cmd05/stroustrup-ppp-solutions
chap26/ex03.cpp
#include <iostream> template<typename In, typename T, typename Compare = std::less<>> std::pair<In, bool> binary_search(In begin, In end, const T& val, Compare comp = Compare{}) { if(begin >= end) return {end, false}; // exit empty sequence In middle = begin + (end - begin) / 2; if(*middle ==...
ALGO
0.999982
5.442659
{ "github_metadata": { "branch": "master", "commit_count": 177, "repo_created_at": "2024-06-08T11:52:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "72b56c0a...
c61a803b-3da2-4aeb-9e1a-945676bd5307
Teo48/APD
Teme/Tema3/text_processor.cpp
#include <bits/stdc++.h> #include <fstream> #include <unistd.h> #include <mpi.h> #include "text_processor.h" std::vector<std::vector<std::string>> paragraphs(MASTER_THREADS, std::vector<std::string>()); std::vector<std::vector<std::string>> paragraphs_to_process(MASTER_THREADS, std::vector<std::string>()); std::vecto...
TOOL
0.990964
4.672997
{ "github_metadata": { "branch": "main", "commit_count": 42, "repo_created_at": "2020-10-02T19:27: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": "1d2808a7ad0...
ba3d60b5-bba5-4796-bf63-79f68c9d28d6
satake0916/AtCoder
editorial90/005_2.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, a, n) for (int i = a; i < n; i++) #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() const ll MOD = 1e9+7; const int MAX_N = 33; struct Matrix{ int sz; ll x[MAX_N][MAX_N]; }; Matrix multiply(Matrix A, ...
ALGO
0.999959
3.802325
{ "github_metadata": { "branch": "master", "commit_count": 429, "repo_created_at": "2019-04-14T12:45:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6bba6ea5...
ae433047-9bd9-4336-be9c-ffabde2e3b90
jaguar-paw33/CODE_AAI
6.Data Structures/9.Hash Map/4.pair_sum_to_0.cpp
/* Given a random integer array A of size N. Find and print the count of pair of elements in the array which sum up to 0. Note: Array A can contain duplicate elements as well. Input format: The first line of input contains an integer, that denotes the value of the size of the array. Let us denote it with the symbol ...
ALGO
0.999969
5.282145
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2021-03-24T18:23: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": "75f85eab6...
edbe584c-7655-4598-a940-4b44fd155542
ishandutta2007/codeforces-g
geniucos/normal/477/C.cpp
#include<cstdio> #include<vector> #include<cstring> #include<cmath> #include<cstdlib> #include<ctime> #include<map> #include<set> #include<queue> #include<algorithm> using namespace std; int N, M, dp[2015][2015], last[2015], prec[2015][256]; char S[2015], T[2015]; int main() { //freopen ("input", "r", stdin); //freo...
ALGO
0.999982
3.009173
{ "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": "8a53599748ac...
d1ba750b-5956-4c89-a4c8-1ebdef44f63a
silvagal/paa
lista2/dfs.cpp
#include <iostream> #include <vector> typedef std::vector<std::vector<int>> matrix; void printMatrix(matrix& m){ int n = m.size(); for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { std::cout << m[i][j] << " "; } std::cout << std::endl; } } void nextNode(int u...
ALGO
0.999956
5.027816
{ "github_metadata": { "branch": "main", "commit_count": 37, "repo_created_at": "2021-03-11T14:19: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": "46410565343...
13a85992-868a-49f1-b57b-0072fd9f1dd6
TheFrenchLeaf/Bundler
src/Bundle.cpp
/* * Copyright (c) 2008-2010 <NAME> (snavely (at) cs.cornell.edu) * and the University of Washington * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the Lice...
ALGO
0.996893
4.216606
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2011-03-09T15:35:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 165, "forks": 98, "issues": 5, "pull_requests": 3 }, "file_meta": { "content_id": "bc0db33...
8d573ead-e080-47d1-afb3-418b13b6968e
ibsson/Program
BKJN/그리디 알고리즘/20250128_bkjn_1202(보석 도둑).cpp
#include <iostream> #include <vector> #include <queue> #include <algorithm> using namespace std; int N, K, M, V, C; vector <pair<int, int>> v; priority_queue <int, vector <int>, greater <int>> pq; priority_queue <pair<int, int>> jewel; bool compare(pair<int, int> a, pair<int, int> b) { return a.second < b.second; } ...
ALGO
0.999939
3.904325
{ "github_metadata": { "branch": "main", "commit_count": 1692, "repo_created_at": "2022-02-17T03:03:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "32dcce555...
a671cf5c-d437-4812-ac00-db0f1e9a378c
andy-lee-cat/catsDaily
250213.cpp
// 1352B 1200 #include<iostream> #include<algorithm> #include<vector> using namespace std; void solve() { long long n; int k; cin >> n >> k; if (n % 2 == 1 && k % 2 == 0) { cout << "NO\n"; return; } if (n % 2 == 1) { if (n - k < 0) { cout << "NO\n"; ...
ALGO
0.999975
3.959285
{ "github_metadata": { "branch": "master", "commit_count": 258, "repo_created_at": "2024-11-27T12:26: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": "93792bc2...
75fe8044-408a-462a-aa8d-15ddcc39718a
LojinHany/data-structure-assignment-1
problem 2/problem2.cpp
#include <iostream> #include <string> #include<fstream> using namespace std; int checkHighestORder(int a,int b){ if(a<b){ return b; } return a; } int checkLowestORder(int a,int b){ if(a>b){ return b; } return a; } void printPolynomial(int* COoffeint, int Order) { bool firstT...
ALGO
0.997693
4.360609
{ "github_metadata": { "branch": "main", "commit_count": 36, "repo_created_at": "2025-03-26T15:57: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": "5398c92e882...
1b29a2d2-8a11-432e-81ec-89b6323e3129
nikhil980/gfgcoding
Difficulty: Easy/Rotate Array/rotate-array.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution{ public: //Function to rotate an array by d elements in counter-clockwise direction. void rotateArr(int arr[], int d, int n) { vector<int>ans; for(int b=0;b<n;b++) { ...
ALGO
0.999902
6.11938
{ "github_metadata": { "branch": "main", "commit_count": 1049, "repo_created_at": "2024-08-15T14:43:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c6b0ae5e4...
e421a3ef-1c42-4262-b10b-346cc58575ae
Dy1anT/PAT-Notes
A1149b.cpp
#include <unordered_map> #include <vector> #include <iostream> #include <string> using namespace std; int main() { unordered_map<string, vector<string>> mp; int n, m, c; string a, b; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> a >> b; mp[a].push_back(b); mp[b].push_b...
ALGO
0.999914
4.1592
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2018-12-25T03:46: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": "b78df3c1c...
158ef7e1-0fd0-4bb7-a845-45c902e84efc
DEVECLOVER/LeetCodeFighting_CPP
LeetCode101-200/129.求根到叶子节点数字之和.cpp
/* * @lc app=leetcode.cn id=129 lang=cpp * * [129] 求根到叶子节点数字之和 */ // @lc code=start /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: //[AC] 这个...
ALGO
0.999937
5.674455
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2020-07-20T14:28:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "52e0855094...
c4089f7e-3d2f-4647-b115-48524a32c390
Antxnszn/Bioinspirados
PSO.cpp
#include <bits/stdc++.h> #define b1 0.7 #define b2 1.2 #define a 0.8 #define fitnessFunction(x, y) (x * x + y * y + (25*(sin(x) + sin(y)))) using namespace std; struct Particula { float x; float y; float vx; float vy; float pbest_x, pbest_y; float pbest_fitness; float fitness; float v...
ALGO
0.999998
5.508031
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2024-09-25T14:41:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9cd9638e7d0a...
79946f82-a2f9-4a92-8958-4e7144dbfb27
ML-UCV/ML-CodeBert-DistinctSolutions
Raw Dataset/dmin/djikstra/train/03e348fe-02b7-11ec-a230-2cf05d84bfc2.cpp
#include <bits/stdc++.h> using namespace std ; const int NR = 1505 ; const long double oo = 100000 ; const double ER = 0.000000001; ifstream in ("dmin.in") ; ofstream out ("dmin.out") ; vector < pair < int , long double > > v [ NR ] ; vector < int > way ( NR , 0 ) ; vector < long double > d ( NR , oo ) ; int ...
ALGO
0.999833
3.372853
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-03-06T17:44:46.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7132f716047d9...
a1e439db-ab96-4be4-b37a-704f34c9e515
icthrm/Markerauto2.0
Markerauto2/src/detector/GaussFit.cpp
#include"GaussFit.h" cv::Mat Gauss_A(cv::Mat loc){ int i; cv::Mat A(4,4,CV_32FC1,cv::Scalar(0)); for(i=0;i<loc.rows;i++){ A.at<float>(0,0)+=(loc.at<float>(i,0)*loc.at<float>(i,0)+loc.at<float>(i,1)*loc.at<float>(i,1))*(loc.at<float>(i,0)*loc.at<float>(i,0)+loc.at<float>(i,1)*loc.at<float>(i,1)); ...
ALGO
0.99976
4.425085
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2023-12-28T03:05:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "78616ec45c9...
b50377cb-7a5b-43d9-9d15-2db15eafcfb7
varungupta04/ccprac
0068-text-justification/0068-text-justification.cpp
class Solution { public: vector<string> fullJustify(vector<string>& words, int maxWidth) { vector<string>res; int curr = 0, oglen = 0; vector<string>aux; //stores the words for the current row for(string s : words) { int l = s.length(); // chec...
ALGO
0.999973
6.074257
{ "github_metadata": { "branch": "main", "commit_count": 375, "repo_created_at": "2023-03-20T19:22:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bd43a98b83...
2208036a-ab08-4cf8-9f62-f7afdcc063c7
mdpabel/CPP
09. algorithm-stl/01. binary_search.cpp
// regex_match example #include <iostream> #include <string> #include <regex> using namespace std; int main() { int arr[] = {10, 20, 30, 30, 30, 30, 40, 50, 60}; int n = sizeof(arr) / sizeof(arr[0]); int key; cin >> key; bool present = binary_search(arr, arr + n, key); if (present) { ...
ALGO
0.999784
5.283659
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2020-10-23T05:53:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e7b295e60e6...
39a27653-311a-461d-8edb-690302be5801
shivanksingh01/Data-Structure
array/09-find-missing-number.cpp
// Find the missing number in an array // Given an array of n-1 distinct integers in the range of 1 to n, // find the missing number in it in linear time. // Input : {1, 2, 4, 6, 3, 7, 8} // Output : 5 #include<bits/stdc++.h> using namespace std; // Approach-1 (Using formula - sum of first n natural number ) // ...
ALGO
0.999902
4.783213
{ "github_metadata": { "branch": "main", "commit_count": 86, "repo_created_at": "2021-08-16T15:15:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1284f05f227...
6de08e27-10d4-43f3-ab2a-17a34e29beff
jainamandelhi/Competitive-programming-questions
Codeforces Beta Round #4 (Div. 2 Only)/D. Mysterious Present.cpp
#include<bits/stdc++.h> #define pb push_back #define mp make_pair #define ll long long #define mod 998244353 using namespace std; ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); } int main() { ios_base:: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ll n,w,h; scan...
ALGO
0.999977
3.667159
{ "github_metadata": { "branch": "master", "commit_count": 865, "repo_created_at": "2018-06-16T12:32: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": "c7310804...
ec9ea154-b0d6-4f74-981a-92f6661478ca
em-rosePetals/mscd-file-format
convertOut.cpp
/* * morseOut.cpp * * Created on: Apr 30, 2022 * Author: emily */ #include <vector> #include <unordered_map> #include <functional> #include <string> #include <cctype> #include "morse.hpp" /** * appends a dot to the specified vector */ void dot(std::vector<bool>& vec) { // adds a 0, then a 1 vec.push_ba...
TOOL
0.983143
5.57062
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2022-05-19T22:18: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": "3224ef1c3aad...
be0316b5-f101-4c01-8245-f8eb10df29c3
ishandutta2007/codeforces-t
teapotd/normal/1156/B.cpp
#define _USE_MATH_DEFINES #include<bits/stdc++.h>////////////////////////////////////////// #define deb(...)///////////////////////////////////////////////// #define DBP(...)///////////////////////////////////////////////// #ifdef LOC/////////////////////////////////////////////////////// #include"debuglib.h"//////////...
ALGO
1
4.621179
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:27:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d0d31255a14c...
b594d13e-7920-49e3-8a46-f7be7a603c9e
Andriana008/thingsOnCpp
1 year/dz_class/dz_class/main.cpp
/*28. Визначити тип для представлення товару в магазині. Товар характеризується: унікальним кодом, ціною за одиницю товару, кількістю товару в магазині. В класі крім необхідних методів визначити конструктор за замовчуванням та конструктори з параметрами, функції введення, виведення. а) Ввести дані про 12 товарів. В...
TOOL
0.963227
3.91178
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-01-12T15:40:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "474a5a9b40...
fd0fb1c8-4d88-4704-9286-4496709b9165
Yashmehul/cpp-codes
max_sum_in_subarray.cpp
/* FIND THE MAXIMUM SUM OF AN SUBARAY THAT IS PRESENT IN AN ARRAY.... #include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int arr[n]; for(int i=0;i<n;i++){ cin>>arr[i]; } int curr_sum[n]; curr_sum[0]=arr[0]; for(int i=1;i<n;i++){ curr_sum[i]=curr_sum...
ALGO
0.99995
4.091969
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2023-05-31T08:56:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8f89e82dbd0...
74e4d2c7-a5e4-460e-9f09-f3f84a6c0348
JCBenR/CoinGame
magicDay/magicDay/main.cpp
// // main.cpp // magicDay // // Created by <NAME> on 8/27/20. // Copyright © 2020 <NAME>. All rights reserved. // #include <iostream> #include <string> using namespace std; int main(int argc, const char * argv[]) { //get date in numeraric format string enteredDate; cout<<"Enter a date in numeric for...
ALGO
0.900836
4.239236
{ "github_metadata": { "branch": "master", "commit_count": 52, "repo_created_at": "2020-09-22T17:23: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": "c402da306...
183a3670-5a53-4f1a-9098-23dec4d745df
bjzhang1991/LeetCodeVS
LeetCode/LeetCode/Medium_098.h
/* Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node's key. The right subtree of a node contains only nodes with keys greater than the node's key. Both the left and right subtrees mu...
ALGO
0.999966
5.079771
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2016-09-03T01:34: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": "267dfe482b...
11cda3be-9982-412f-8ea2-cc7f14bf2d95
Witalia008/competitions
Random/ITstarz/prb/28.cpp
#include <iostream> #include <vector> #include <stdio.h> #include <cstdlib> #include <limits.h> #include <algorithm> #include <iterator> using namespace std; void bucket_sort(vector<int> &arr) { if (arr.size() < 30) { sort(arr.begin(), arr.end()); return; } vector<vector<int>> buckets;...
ALGO
0.999822
4.545938
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2021-03-31T16:10: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": "69359ac167f...
d54ea191-36f5-452f-ad96-ed71ec639e6a
hongu-ku/mbed
main.cpp
#include "mbed.h" #define ZERO 0b0000000 #define n0 0b0111111 #define n1 0b0000110 #define n2 0b1011011 #define n3 0b1001111 #define n4 0b1100110 #define n5 0b1101101 #define n6 0b1111101 #define n7 0b0100111 #define n8 0b1111111 #define n9 0b1101111 void show(int n, int ms); Serial pc(USBTX, USBRX); BusOut leds(dp...
TOOL
0.921865
4.580983
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2017-12-12T14:46: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": "4b46c73a7e...
e7347aec-981a-4927-a5f2-88c78a62177a
statgen/topmed_variant_calling
king/KinshipX.cpp
#include "KinshipX.h" void KinshipX::Setup(Family & f) { allPairs.Dimension(f.count, f.count); for (int i = 0; i < f.founders; i++) { bool isMale = f.ped[f.path[i]].sex == SEX_MALE; for (int j = 0; j < f.founders; j++) allPairs[i][j] = 0.0; allPairs[i][i] = isMale ? 1.0 : 0.5...
ALGO
0.982777
3.888157
{ "github_metadata": { "branch": "master", "commit_count": 95, "repo_created_at": "2018-06-13T04:18:02.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 24, "forks": 3, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "d43f21d4f...
e17d6a7c-ccc1-4aa4-98a6-ad1f7d3f1747
Jebearssica/LeetCode
Unknown/58.最后一个单词的长度.cpp
/* * @lc app=leetcode.cn id=58 lang=cpp * * [58] 最后一个单词的长度 * * https://leetcode-cn.com/problems/length-of-last-word/description/ * * algorithms * Easy (35.61%) * Likes: 357 * Dislikes: 0 * Total Accepted: 227.6K * Total Submissions: 628.8K * Testcase Example: '"Hello World"' * * 给你一个字符串 s,由若干单词组成,...
ALGO
0.999469
5.960803
{ "github_metadata": { "branch": "master", "commit_count": 313, "repo_created_at": "2020-09-28T10:11:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b106f99c...
4aa69992-7165-4c82-b16e-38535b4cf20f
mayank971chauhan/gfgCodeCheatSheet
Sorting/q5_insertionSort.cpp
#include <iostream> using namespace std; void insertionSort(int n, int arr[]){ for (int i = 1; i < n; ++i) { int j = i -1; int key = arr[i]; while(j >=0 && arr[j] > key){ // swap arr[j+1] = arr[j]; //earlier was swapping with i whcihc was not...
ALGO
0.999929
5.631637
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2019-10-07T10:09:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1d516a7d3...
10d210d8-ce9b-4236-8034-2725e7b365f5
201411167/algorithm
ACMICPC/simulation/17144.cpp
#include <iostream> #include <queue> #include <algorithm> using namespace std; unsigned r, c, t; int map[51][51]; struct DUST { int x, y; int amount; int spread[4]; }; int dir[4][2] = { {-1,0},{0,-1},{1,0},{0,1} }; int ux, uy, dx, dy; void input() { cin >> r >> c >> t; for (int i = 0; i < r; i++) { for (int j ...
ALGO
0.999955
4.345544
{ "github_metadata": { "branch": "master", "commit_count": 128, "repo_created_at": "2018-06-12T06:04:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b4906725...
bd3e2eaa-45c9-4724-877c-231ab1e4f0d9
Parmanandsatyam/All-star-coding-sol
acsl2018_2019/xv_i5_problem8.cpp
#include <bits/stdc++.h> #define pii pair<int,int> #define x first #define y second #define pb push_back using namespace std; typedef long long ll; const char en='\n'; const int MOD=1000000007; const int N=300010; int n; #define double long double bool jedn(double a,double b) { return ((a<1 && b<1 && abs(a-b)<1e-8)...
ALGO
0.999757
3.300695
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-01-03T18:11: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": "aa59d4527874...
44702039-c9a7-4548-90ed-d54186be5359
ishandutta2007/codeforces-j
jklepec/normal/602/A.cpp
#include <bits/stdc++.h> #define iter(i) set< i >::iterator #define FOR( i, a, b ) for( int i = a; i < b; i++ ) #define REP( i, a ) for( int i = 0; i < a; i++ ) using namespace std; typedef long long llint; typedef pair< int, int > point; const int MaxN = 100100, MOD = 1e9 + 7, B = 3137; llint n, b; llint x, y; ll...
ALGO
0.999679
3.303702
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T05:42:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "64d9dac49637...
5ffb2c91-4f35-42fa-a0a3-1e73cb726e5a
star-bnl/star-sw
StRoot/StFtpcDriftMapMaker/StFtpcMagboltz1.cc
// $Id: StFtpcMagboltz1.cc,v 1.2 2003/09/02 17:58:15 perev Exp $ // // $Log: StFtpcMagboltz1.cc,v $ // Revision 1.2 2003/09/02 17:58:15 perev // gcc 3.2 updates + WarnOff // // Revision 1.1 2000/12/20 08:44:02 jcs // Replace pam/ftpc/fmg with maker // #include "StFtpcMagboltz1.hh" #include <math.h> #include <stdi...
ALGO
0.998685
3.845
{ "github_metadata": { "branch": "main", "commit_count": 38269, "repo_created_at": "2020-11-12T22:30:30.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 29, "forks": 66, "issues": 9, "pull_requests": 29 }, "file_meta": { "content_id": "ca1257...
e11d6b95-5ae5-4f9b-9244-47d2006a0bb3
Return-name/100_Days_of_GFG_Problems
Solutions/D113_10_01_Add_1_to_Number_Linked_List.cpp
// { Driver Code Starts //Initial template for C++ #include <bits/stdc++.h> using namespace std; struct Node { int data; struct Node* next; Node(int x){ data = x; next = NULL; } }; void printList(Node* node) { while (node != NULL) { cout << node->data; n...
ALGO
0.99986
6.125731
{ "github_metadata": { "branch": "main", "commit_count": 138, "repo_created_at": "2021-09-20T02:24: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": "fa75bc16d1...
a0654380-fd60-4434-a5e1-8ddfd5485f59
AbhishekChauhan9036/Newton-School-July-Batch
Dec Assignment/Maths_Prime/IsThisPrime.cpp
#include<bits/stdc++.h> #pragma GCC optimize "03" using namespace std; #define Abhishek main #define int long long int #define ld long double #define pi pair<int, int> #define pb push_back #define fi first #define se second #define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0) #ifndef LOCAL #define endl '\n'...
ALGO
0.999996
4.985849
{ "github_metadata": { "branch": "master", "commit_count": 74, "repo_created_at": "2022-07-23T17:06:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 20, "forks": 18, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4e6ea34...
597cc543-a59a-4173-b640-10fde5312600
purvasingh96/My-Leetcode-Solutions
108-convert-sorted-array-to-binary-search-tree/108-convert-sorted-array-to-binary-search-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999992
6.613366
{ "github_metadata": { "branch": "main", "commit_count": 5768, "repo_created_at": "2021-12-24T13:59:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "83f93ceda...
52b9c710-acc6-4091-abc6-dfbafa2329b6
MrinmoiHossain/Uri-Solution
C++/uri1048.cpp
#include <bits/stdc++.h> #define read() freopen("input.txt", "r", stdin) #define write() freopen("output.txt", "w", stdout) using namespace std; int main(void) { double a; cin >> a; int p; if(a >= 0 and a <= 400.00) p = 15; else if(a >= 400.01 and a <= 800.00) p = 12; else if(a...
ALGO
0.987525
3.395351
{ "github_metadata": { "branch": "master", "commit_count": 80, "repo_created_at": "2017-06-09T08:41:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b2e5bc5ff...
e266d6ac-fdde-4c54-afb6-b791b3f7bd8b
tinhngovnptho/Code
CP/Code THCS/HSG9/HoaBinh2223/TOWER.cpp
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a), _b = (b); i <= _b; ++i) #define FORD(i, b, a) for (int i = (b), _a = (a); i >= _a; --i) #define FORA(it, v) for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); ++it) #define ALL(v) (v).begin(), (v).end() #define fi first #d...
ALGO
0.999954
4.143603
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2024-10-13T07:51:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "28a28a01054...
aab5a08f-1b2a-46f2-9dac-67568d37182a
prnv7703/cpu-scheduler
CPU_scheduler.cpp
#include<iostream> #include<algorithm> #include <string> #include<iomanip> #include <map> #include<vector> #include <cmath> #include <fstream> #include<set> #include<stack> #include<queue> #include <list> #include<cstring> #include<unordered_set> #include<unordered_map> #include<utility> #include<memory> using namespa...
ALGO
0.999883
4.21944
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-06-21T12:49:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b8fcd9662099...
e62f9251-f8c3-4719-933e-5b40a87c0ceb
hojoon0205/Problem-Solving
Competition/Codeforces/Rounds/1385/f.cpp
#include<bits/stdc++.h> using namespace std; typedef pair<int,int> pii; vector<int> graph[200010]; int main() { int tt, T; scanf("%d", &T); for(tt=1; tt<=T; ++tt){ int n, k; scanf("%d%d", &n, &k); for(int i=1; i<=n; ++i) graph[i].clear(); for(int i=1; i<n; ++i){ ...
ALGO
0.999962
3.857994
{ "github_metadata": { "branch": "master", "commit_count": 74, "repo_created_at": "2020-04-19T12:37:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7529de93c...
a8e20277-c225-432c-b00c-13d96a08a988
HMBL98/Competitive-Programming-Problems
Graphs/panoramas.cpp
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; vector<vi> grafo; vi objetivos,visitado,padre; int v,s; int main(){ cin >> v >> s; int tmp; grafo.assign(v+1,vi()); visitado.assign(v+1,-1); padre.assign(v+1,-1); for(int i = 0; i < s; i++) cin >> tmp, objetivos.push_back(tmp); for(int i = ...
ALGO
0.998126
3.711377
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2018-07-18T19:07: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": "5b17f311db...
3701ca09-a285-4922-99ad-4ebc2f94336a
nouhelion/REGEX
Part_A/2bAL.cpp
// regex of having at least 2 'b' in a chaine is // => (a|b)* b (a|b)* b (a|b)* // Write a program for this automaton that gives // the number of 'b' in the string. #include <cstring> #include <iostream> #include <stdlib.h> using namespace std; void twobAT(string chaine) { int i = 0, b = 0, state = 0; while (...
ALGO
0.993554
3.572717
{ "github_metadata": { "branch": "main", "commit_count": 85, "repo_created_at": "2022-01-11T19:54: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": "2e6eb18b3d3...
5d1a852a-35f0-4ad8-910d-1c04313f93b5
FioreriaAlessandrino/algotester
hroshi.cpp
#include <stdio.h> int main(void) { int Returned = 0; int money; scanf("%d", &money); while (money < 0) { scanf("%d", &money); } while (money > 0) { if ((money - 500) >= 0) { money = money - 500; Returned++; } else if ((money - 200) >= 0) { money = money - 200; Retu...
ALGO
0.999701
3.643859
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2019-03-17T19:06:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e2f32af7f3...
0b0383ef-109d-4985-971c-98cfad5cb502
mealsOrder/SW
project/graph/graph_final.cpp
#include <iostream> #include <vector> #include <tuple> #include <algorithm> // std::sort #include <unordered_map> #include <unordered_set> #include <queue> using namespace std; class Graph { private: int numVertices; // 정점의 개수 vector<tuple<int, int, int>> edges; // 간선 정보 {출발 노드, 도착 노드, 가중치} vector<int> par...
ALGO
0.999574
5.788065
{ "github_metadata": { "branch": "main", "commit_count": 135, "repo_created_at": "2024-05-02T11:58:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "21594d6a9a...
f47d932f-86a9-4e5c-b22c-4d2dfb5bc134
798253405/NMF-FPGA-accelerator-with-logarithmic-approximation
C_Vivado/vivado_hls/logarithmic/compute_u.cpp
// // Created by yz on 10.05.21. #include <stdio.h> #include <stdlib.h> #include <math.h> #include <iostream> #include <fstream> #include "compute_u.h" using namespace std; #define mrow_test 1//process 1 image at one time. If the HW resource is infinity, can be 10,000 or higher //The PU can store weights in a scalable ...
ALGO
0.999449
3.368199
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2021-05-18T08:28: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": "9ba24e82046...
d74be1bd-9a4d-4165-b36e-c0b09df752c0
seesealonely/leetcode
binary-search/497.RandomPointinNon-overlappingRectangles.cc
/* You are given an array of non-overlapping axis-aligned rectangles rects where rects[i] = [ai, bi, xi, yi] indicates that (ai, bi) is the bottom-left corner point of the ith rectangle and (xi, yi) is the top-right corner point of the ith rectangle. Design an algorithm to pick a random integer point inside the spac...
ALGO
0.999256
5.825354
{ "github_metadata": { "branch": "master", "commit_count": 1478, "repo_created_at": "2020-04-30T13:14: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": "b115723...
a73ca347-50a2-4f9f-9677-235f7f938108
erajayky/CrackYourPlacement
graphs/minimumSpanningTree.cpp
class Solution { public: int find(int x, vector<int>&par){ if(x==par[x]){ return x; } return par[x]=find(par[x], par); } void Union(int x, int y, vector<int>&par, vector<int>&rank){ int par_x=find(x, par); int par_y=find(y, par); if(p...
ALGO
0.999933
5.285133
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2024-07-15T12:28: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": "2a0cf3a2f...
04737649-1ea8-45f2-9dbf-1c74816ef04e
iSumitYadav/DS-Algo
Trees/LCASingleTraversal_AssumeBothKeysPresent.cpp
#include<bits/stdc++.h> using namespace std; struct node{ int d; node *lt = NULL, *rt = NULL; }; node *newNode(int key){ node *t = new node; t->d = key; return t; } node *lca(node *r, int n1, int n2){ if(!r) return NULL; if(r->d == n1 || r->d == n2) return r; node *left_lca = lca(r->lt, n1, n2); node...
ALGO
0.999984
4.938364
{ "github_metadata": { "branch": "master", "commit_count": 115, "repo_created_at": "2017-12-05T16:31: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": "25f0c7dc...
53ad3c0d-8f6b-4bcf-aeb0-e9c5aefa2fdb
F15javi/Computer-Graphics
Ejercicio2/ComputergrafikUebung02/Uebung2/main.cpp
// Sample code for Übung 2 #include "vec.h" #include "mat.h" #include <iostream> // might be you have to swith to // #include "glut.h" depending on your GLUT installation #include "Uebung2/Uebung2/glut.h" //////////////////////////////////////////////////////////// // // system relevant global variables // int g_Win...
ALGO
0.978149
4.699915
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-11-21T13:01: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": "999a60a43b0c...
9d44fa77-bdcd-43f2-aebb-e948a53c68eb
appleseedhq/appleseed
src/appleseed/renderer/modeling/bsdf/microfacetbrdfwrapper.h
// // This source file is part of appleseed. // Visit https://appleseedhq.net/ for additional information and resources. // // This software is released under the MIT license. // // Copyright (c) 2020 <NAME>, The appleseedhq Organization // // Permission is hereby granted, free of charge, to any person obtaining a cop...
ALGO
0.939604
7.786904
{ "github_metadata": { "branch": "master", "commit_count": 11152, "repo_created_at": "2010-07-02T16:33:51.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2238, "forks": 337, "issues": 423, "pull_requests": 35 }, "file_meta": { "content_id": ...
fc363708-93b6-40da-94df-9f686465f2f5
Pritam723/DSA_CPP
Lecture 44 - 53/Remove Duplicates from Sorted LL Leetcode 83.cpp
// https://www.codingninjas.com/codestudio/problems/unique-sorted-list_2420283?leftPanelTab=1 // https://leetcode.com/problems/remove-duplicates-from-sorted-list/ #include "LinkedListCode.cpp" #include<iostream> using namespace std; Node * uniqueSortedList(Node * head) { // Write your code here. if(head == NU...
ALGO
0.999981
5.322273
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2022-09-27T17:04: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": "9abc84d605...
2128d494-018c-4c75-88eb-aba0dbd2e3cb
YuxiKou/leetcode-3
LinkedListCycleII.cc
/* Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can you solve it without using extra space? */ #include <iostream> struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; class Solution { public: ListNode *detect...
ALGO
0.999906
5.99868
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2014-07-26T23:22: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": "ef2e508f7...
7830dd34-da1a-4f13-8020-3761b1290796
ankit485803/MyAdvDSA_PathwayToCP
Days/D12_TechClub_IITP/twoSum.cpp
// https://www.hackerrank.com/algorage-iitp //qno 4 https://www.hackerrank.com/contests/algorage-iitp/challenges/pair-sums #include <bits/stdc++.h> using namespace std; string ltrim(const string &); string rtrim(const string &); vector<string> split(const string &); /* * Complete the 'largestValue' functio...
ALGO
0.999983
5.186379
{ "github_metadata": { "branch": "main", "commit_count": 95, "repo_created_at": "2024-10-01T09:13:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "96b05ad6575...
250143bb-2f03-445f-b955-e71dcfd2184a
Gabyyi/DSA
BigHW1/Exercise 3 - Stack/exercise3.cpp
#include<iostream> #include<fstream> #include "mystack.h" #include<string.h> #include<string> ifstream fin("input.txt"); ofstream fout("output.txt"); char expression[100]=""; bool error=true; // int k=0; using namespace std; struct Pair{ char variable; int value; }; class Calculator{ private: Stack<char> ex...
ALGO
0.999116
3.512611
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-07-29T11:41: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": "6f05dbf2f165...
4b5095e2-54b9-47d1-b417-b52e1a4d826d
srzmldl/ACM-ICPC
graphTheory/shortestPath/uva10537.cpp
#include <bits/stdc++.h> #define REPP(i, a, b) for (int i = (int) (a); i <= (int) (b); ++i) #define REP(i, n) for(int i = 0; i < (int) (n); ++i) #define MAXN 300 #define MAXM 10000 #define mem(a) memset(a, 0, sizeof(a)) #define LL long long using namespace std; typedef int arrayN[MAXN], arrayM[MAXM]; LL d[MAXN]; int...
ALGO
0.999961
3.509806
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2015-09-22T11:59:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "37dfdbe95...
afac09e1-7185-4a61-b6ba-d2464ea5f512
2646jx/RhombusEnd2End
Rhombus/Rhombus/ring_op.h
#ifndef RHOMBUS_RING_OP_H #define RHOMBUS_RING_OP_H #include <vector> #include <random> #include <algorithm> #include <iostream> namespace antchain{ // generate random vector, all elements are in [-2^(bits-1), 2^(bits-1)) // the type T should be int8_t, int16_t, int32_t or int64_t. template <typename T, ...
TOOL
0.976137
5.431398
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2025-06-24T14:49:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a29021cdda1b...
3d012591-ffe9-471e-a44b-de0970af3a51
iamrudhresh/GeeksforGeeks
Hard/Vertex Cover/vertex-cover.cpp
//{ Driver Code Starts //Initial Template for C++ #include<bits/stdc++.h> using namespace std; // } Driver Code Ends //User function Template for C++ #include <vector> #include <utility> using namespace std; class Solution { private: vector<vector<int>> adj; bool isPossible(int n, int m, int mid) { ...
ALGO
0.999978
6.193453
{ "github_metadata": { "branch": "main", "commit_count": 880, "repo_created_at": "2023-06-20T15:38:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c37c55d99a...
19e08dd5-f546-44f3-9f7e-24a2825316e8
Noly1990/vscode-leetcode
24.两两交换链表中的节点.cpp
/* * @lc app=leetcode.cn id=24 lang=cpp * * [24] 两两交换链表中的节点 * * https://leetcode-cn.com/problems/swap-nodes-in-pairs/description/ * * algorithms * Medium (59.04%) * Total Accepted: 19.3K * Total Submissions: 32.7K * Testcase Example: '[1,2,3,4]' * * 给定一个链表,两两交换其中相邻的节点,并返回交换后的链表。 * * 你不能只是单纯的改变节点内部的值...
ALGO
0.999989
6.067958
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-04-20T12:04: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": "74359c5edd...
4fa76892-8bd1-4f5a-8d59-e454841b4e50
sayakbanerjee1999/Coding-Notes
C++/GraphsCPP/word_ladder.cpp
class Solution { public: int ladderLength(string start, string end, vector<string>& wordList) { queue<string> q; q.push(start); int wordSize = start.length(); unordered_set<string> word; for(int i = 0; i < wordList.size(); i++) word.insert(wordList[i]); ...
ALGO
0.99998
5.460351
{ "github_metadata": { "branch": "master", "commit_count": 436, "repo_created_at": "2021-05-21T06:54:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 78, "forks": 16, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "32ff15...
e0c3ea97-28f1-4ab0-a2dc-1653555240fe
lam3082004/Algorithm
HackerRank/C++/Geometric sequence/l.cpp
#include <iostream> #include <iomanip> #include <cmath> double s(double r) { double result = 0; double x = 1; // r^0 is always 0 for (int k = 1; k <= 5000; k++) { #ifdef SLOW result += (900 - 3 * k) * pow(r, k - 1); #else result += (900 - 3 * k) * x; x *= r; #endif } ret...
ALGO
0.999847
4.135009
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2021-10-07T13:09:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d42492d852...
e4626881-9242-4d04-bbd3-36650d373dba
alfaaz0786/CLI
16.KNN/knn.cpp
//TITLE: K NEAREST NEIGHBOUR IMPLEMENTATION #include <iostream> #include <math.h> #include <algorithm> using namespace std; struct Point { int val; // Group of point double x, y; // Co-ordinate of point double distance; // Distance from test point }; // Used to sort an array of points by increas...
ALGO
0.999988
6.367009
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-10-26T12: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": "522cf74ebe...
9c1e576c-10a8-44ae-a6e1-193d0682e323
smilechild7/algorithm
swExpertAcademy/1206/1206.cpp
#include <iostream> #include <algorithm> using namespace std; class Buildings { public: int b1=0; int b2=0; int b3=0; int b4=0; int b5=0; void Move(int b6){ b1 = b2; b2 = b3; b3 = b4; b4 = b5; b5 = b6; ...
ALGO
0.999379
3.678825
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2025-01-07T17: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": "368e9e2182b0...
82b05302-7fe2-4ffe-9918-804191493f78
SCahmedmohamed/Competitive-Programming
Codeforces GYM/ICPC Assiut University Community/Contest #2/A. Timon and Pumbaa.cpp
// By <NAME> .Mar/15/2023 22:51 #include <bits/stdc++.h> using namespace std; #define ll long long #define TC int t;cin>>t;while(t--) #define endl '\n' #define el '\n' #define F first #define S second #define One_Piece_3mk ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); const int N = 1e4 + 5 , inf = 1e9 + 7 , NEG...
ALGO
0.999938
3.588433
{ "github_metadata": { "branch": "main", "commit_count": 296, "repo_created_at": "2021-11-21T13:11: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": "1a3ca8abab...
d81e938d-bf74-4064-9c11-d601fb198887
ramchipy/LC_samples
two_sum/two_sum.cpp
#include <unordered_map> #include <span> #include <utility> #include <vector> #include <boost/format.hpp> #include <iostream> #include "../utility/vectors.hpp" std::pair<int, int> two_sums_brute_force(std::span<int> v, int target) { for(int i=0; i<v.size(); i++) { for(int j=i+1; j<v.size(); j++) ...
ALGO
0.999724
6.114558
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2022-12-24T07:52: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": "d01b42c5b1c...
e0eb289a-5a5e-49f1-b99e-4f3376187ad3
dhs347/Dream
Personal_Training/fb/概率dp/bzoj2337.cpp
#include<bits/stdc++.h> using namespace std; #define fi first #define se second #define mp make_pair #define pb push_back #define rep(i, a, b) for(int i=(a); i<(b); i++) #define per(i, a, b) for(int i=(b)-1; i>=(a); i--) #define sz(a) (int)a.size() #define de(a) cout << #a << " = " << a << endl #define dd(a) cout << #a...
ALGO
0.999895
3.933424
{ "github_metadata": { "branch": "master", "commit_count": 1232, "repo_created_at": "2019-09-26T15:21:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 16, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "249146...
2f03b0bc-28b6-4480-84b1-b2a2990f826c
rosalogia/competitive-programming
cf-pset/C++/taxi.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, rollingSum = 0, taxiCount = 0; bool full = false; cin >> n; int s[n]; for (int i = 0; i < n; i++) { cin >> s[i]; } for (int i = 0; i < n; i++) { if (s[i] == 2) for (int j = 0; j < n; j++) ...
ALGO
0.999843
4.167235
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2020-11-03T09:05:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e9a28e075fdf...
bb1f127c-9d81-4e49-94b8-096e2f4ae767
krishukr/cpp-code
src/LG/lg-P2216.cpp
#include <climits> #include <cstdio> #include <iostream> #include <queue> constexpr int MAX_N = 1050; int mp[MAX_N][MAX_N]; int mx[MAX_N][MAX_N], nx[MAX_N][MAX_N]; int my[MAX_N][MAX_N], ny[MAX_N][MAX_N]; template <typename T> T read(); template <typename T> void read(T& t); template <typename T, typename... Args> ...
ALGO
0.99971
3.669194
{ "github_metadata": { "branch": "master", "commit_count": 193, "repo_created_at": "2021-01-19T08:15:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e1f016d6...
e65be237-ba79-438a-8812-535c491387c4
abhisehekkumr/tree
platform.cpp
#include<iostream> #include<algorithm> using namespace std; struct train{ int a; int d; }; bool compare(train t1, train t2){ if(t1.a < t2.a) return true; if(t1.a > t2.a) return false; return t1.d < t2.d; } int main(){ int t = 1; //cin >> t; while(t--){ ...
ALGO
0.999987
3.403401
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2019-07-20T13:03: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": "2abf97b682...
33daaa9a-e026-48c3-8e86-97109bd55ea5
doctorjdk/S.Vogel-CSCI20-Fall2016
lab6/copyrightadded.cpp
# include <iostream> # include <string> using namespace std; void Copyright() { char star = '*'; cout << " " << star << endl; cout << " " << star << " S " << star << endl; cout << " " << star << " V " << star << endl; cout << "Copyright <NAME> 2016" << endl; ...
ALGO
0.990932
3.487682
{ "github_metadata": { "branch": "master", "commit_count": 40, "repo_created_at": "2016-08-22T17:34: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": "38f3e64a3...
b7ca46a1-6564-468e-acf8-6194e1bfb3e8
MadMaxINDIAN/u19cs019_sem6
Principles_of_programming_language/lab4/q3.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; class Polar { public: double radius; double angle; Polar(double r, double a) { radius = r; angle = a; } Polar operator+(Polar p) { double x1 = radius*cos(angle); ...
ALGO
0.992183
4.719742
{ "github_metadata": { "branch": "main", "commit_count": 36, "repo_created_at": "2022-01-03T21:22: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": "0ff3dd315f9...
bf5b653d-19fe-48ca-891c-f9ca31a8f8f1
ASAG-ISCAS/BdryReach
tests/linear_example1.cpp
/* * @Author: <NAME> * @Date: 2021-11-11 17:24:27 * @LastEditTime: 2021-12-30 22:41:19 * @LastEditors: Please set LastEditors * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @FilePath: /Solver/test.cpp */ #include <dynamics/NonlinearSys.h> #include...
ALGO
0.940881
4.105455
{ "github_metadata": { "branch": "main", "commit_count": 94, "repo_created_at": "2024-04-01T11:37:51.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1b4b6e7a459b...
356eab88-4fe1-4051-bd75-b0df030d8956
chenjiasheng/leetcode_practice
users/xiewufeng/685. 冗余连接 II.cpp
#define N 1010 class UnionFind { public: vector<int> parents; UnionFind(int size) { parents.resize(size); for (int i = 1; i < size; i++) { parents[i] = i; } } int find(int idx) { if (parents[idx] != idx) { parents[idx] = find(parents[idx]); ...
ALGO
0.99998
5.450997
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2021-09-06T14:08:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dfa869fc0e3c...
d55decd5-68ff-407e-ad35-d4e79d0090d0
szmlb/cpp-lmpc
src/CppLmpc.cpp
#include "CppLmpc.hpp" using namespace Eigen; namespace CppLmpc{ CppLmpc::CppLmpc(double sampling_time, const MatrixXd& Ac, const MatrixXd& Bc, const MatrixXd& Cc, const MatrixXd& Dc, int Hp, int Hu, int Hw) : sampling_time_(sampling_time), Ac_(Ac), Bc_(Bc), Cc_(Cc), Dc_(Dc), Hp_(Hp), ...
ALGO
0.998621
5.87263
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2022-08-27T11:15: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": "11bd90447feb...
78e08594-43c4-4925-a886-41cd171a59a0
yizhang0301/Programming-Techniques-YIZhang
Assignments/A17/112.cpp
//<NAME> //cmps 4883 //2021/11/23 #include <iostream> using namespace std; int n; bool check; char x; void D(int sum,int &root) { cin >> x; bool sign = false; int num = 0; int L = 1; int R = 1; if(x == '-') { sign = true; cin >> x; } while( x >= '0' && x <= '9') { num = num*10 + (x - '0'); root =...
ALGO
0.998089
3.743376
{ "github_metadata": { "branch": "main", "commit_count": 94, "repo_created_at": "2021-08-25T20:45:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "80e46e838de...
4f22be88-4e38-4aad-b548-14c759823331
rmshimomura/Compilers
Listas/Lista_5/Ex_2/ex2.cpp
#include "compiler.hpp" int main () { Compiler::State q1("q1", "normal", ""); Compiler::State q2("q2", "final", "ID"); Compiler::State q3("q3", "final", "IF"); Compiler::State q4("q4", "final", "ID"); Compiler::State q5("q5", "final", "error"); Compiler::State q6("q6", "final", "REAL"); Co...
ALGO
0.948138
3.4137
{ "github_metadata": { "branch": "master", "commit_count": 166, "repo_created_at": "2022-08-23T00:59:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5e09f3b7...
ac754530-70af-45ef-8ae6-e1932dc2430d
Fedbxy/competitive-programming
programming.in.th/toi14_space_1.cpp
#include <bits/stdc++.h> using namespace std; using pii = pair<int,int>; int di[] = {0,0,1,-1}; int dj[] = {-1,1,0,0}; int main() { cin.tie(nullptr)->sync_with_stdio(false); int n,m;cin>>m>>n; char a[n][m]; bool flag[n][m];memset(flag, false, sizeof(flag)); for(int i=0;i<n;i++) for(int j=0;j<m;j+...
ALGO
0.999889
3.704253
{ "github_metadata": { "branch": "main", "commit_count": 81, "repo_created_at": "2023-10-10T16:20:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "aeaa6b18976...
ea454697-97ad-432f-9986-f2e6081f44fa
madhav-bits/Coding_Practice
leetLowComAncestorOfBST.cpp
/* * //**************************************************235. Lowest Common Ancestor of a Binary Search Tree.******************************************* Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia: “The lowest c...
ALGO
0.999995
6.860223
{ "github_metadata": { "branch": "master", "commit_count": 1813, "repo_created_at": "2017-10-08T23:36:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7eba535...
3374d916-e3f6-4129-b481-77fa20e8d8bb
aadi005/CSES_SOLUTIONS
DynamicProgramming/MoneySums.cpp
#include <iostream> #include <vector> using namespace std; const int maxX = 1e5; int main() { int n; cin >> n; vector<bool> dp(maxX + 1, false); dp[0] = true; for (int i = 0; i < n; i++) { int x; cin >> x; for (int j = maxX - x; j >= 0; j--) { if ...
ALGO
0.999991
3.747984
{ "github_metadata": { "branch": "main", "commit_count": 26, "repo_created_at": "2025-07-10T05:31:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "134d618fd46...
da28215c-1b7d-45b6-bf1a-ed2c279baf7b
aksamota/geeksforgeeks_practice
queues/first_negative_in_window.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t, n, k; int a[100005]; cin >> t; while (t--) { cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; cin >> k; vector<int> ans; queue<int> q; // Insert first k elements into the queue ...
ALGO
0.999913
4.727689
{ "github_metadata": { "branch": "master", "commit_count": 183, "repo_created_at": "2020-04-12T05:45: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": "9026190f...
f38c8b76-7aa3-4aad-99a3-bbaae4219c29
oddquark/flux512
src/encrypt.cpp
/* * encrypt.cpp * * Created on: Feb 16, 2016 * Author: <NAME> */ #include "flux.h" #include "sha512/sha512.h" #include <string.h> #include <fstream> using std::string; union { char myByte[4]; long myLong; } checksum; void encrypt_block(char *in, char *out, vector<Sbox> &sArray, vector<Pbox> &pAr...
TOOL
0.908743
4.600483
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2016-03-25T00:08: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": "696fc5a55...
e602845f-654b-4f44-8bda-413c92eedb65
DStrelak/xmipp
libraries/reconstruction/ctf_correct_wiener2d.cpp
/*************************************************************************** * Authors: AUTHOR_NAME (<EMAIL>) * * * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public Lice...
ALGO
0.915196
5.802881
{ "github_metadata": { "branch": "master", "commit_count": 123, "repo_created_at": "2018-08-16T12:29:46.000Z", "is_fork": true, "is_org_owned": false, "forked_from": "I2PC/xmipp", "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e...
bf58635b-becf-4ab9-8a94-a9a3e46fa8d7
FiaDot/coding-test-cpp17
bakjoon/queue/deque_cmd2.cpp
// // Created by <NAME> on 2023/03/24. // // 덱 : https://www.acmicpc.net/problem/10866 /* 정수를 저장하는 덱(Deque)를 구현한 다음, 입력으로 주어지는 명령을 처리하는 프로그램을 작성하시오. 명령은 총 여덟 가지이다. push_front X: 정수 X를 덱의 앞에 넣는다. push_back X: 정수 X를 덱의 뒤에 넣는다. pop_front: 덱의 가장 앞에 있는 수를 빼고, 그 수를 출력한다. 만약, 덱에 들어있는 정수가 없는 경우에는 -1을 출력한다. pop_back: 덱의 가장 ...
ALGO
0.996049
4.719725
{ "github_metadata": { "branch": "develop", "commit_count": 75, "repo_created_at": "2023-03-21T03:59: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": "1b743f8e...
69fb8787-bdde-4852-9d30-436d6493c2e0
smuhammadkahaf/RSA_in_CPP
OOP__CEP/crypto_ED.cpp
#include <iostream> #include <string> #include <time.h> #include <sstream> #include "crypto.h" using namespace std; //logical member functions //for encryption unsigned int crypto::encrypt_char(unsigned int i)//encrypting character { unsigned long long exp = E;//ensuring data member value not change unsigned long ...
TOOL
0.983788
3.735962
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2024-11-28T14:05:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "775f27620c...
887beeeb-1633-451b-aa3e-a49b4594b409
szaboeman/adventOfCode2017cpp
day10_2/main.cpp
#include <iostream> #include <vector> #include <sstream> #include <iomanip> using namespace std; void kiir(vector<int> list) { for (int i=0; i<list.size(); i++) { cout<<list[i]<<" "; } cout<<endl; } int main() { vector<int> list; int maxBlock=256; for (int i=0; i<maxBlock; i++) { ...
ALGO
0.999788
3.82479
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2017-12-23T20:43: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": "e380aa791...
8b78348e-cc5c-41b3-8ed5-be8b0e34f3b3
JoeyDeVries/LearnOpenGL
includes/glm/ext/scalar_common.hpp
/// @ref ext_scalar_common /// @file glm/ext/scalar_common.hpp /// /// @defgroup ext_scalar_common GLM_EXT_scalar_common /// @ingroup ext /// /// Exposes min and max functions for 3 to 4 scalar parameters. /// /// Include <glm/ext/scalar_common.hpp> to use the features of this extension. /// /// @see core_func_common /...
TOOL
0.940401
5.864261
{ "github_metadata": { "branch": "master", "commit_count": 607, "repo_created_at": "2015-03-23T14:21:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11780, "forks": 2881, "issues": 139, "pull_requests": 25 }, "file_meta": { "content_id":...
16faf87e-624b-41dc-9fe0-eebbb75f4c32
zdtango/cp
cf/dif1/insomnia_cure.cpp
#include <iostream> using namespace std; #define D_MAX 100000 bool dragon[D_MAX + 1]; int main() { int k, l, m, n, d; cin >> k >> l >> m >> n >> d; int a, b, c, e; a = b = c = e = 0; while( a <= d || b <= d || c <= d || e <= d ) { if(a <= d) dragon[a] = true; if(b...
ALGO
0.999531
3.199958
{ "github_metadata": { "branch": "main", "commit_count": 39, "repo_created_at": "2022-12-23T21:40: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": "19646cc40e4...