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
d8f0bb85-6ba3-4dbe-ae71-26edded8b32b
karansingh21202/sp
ss/OS/Scheduling/round_robin.cpp
#include <iostream> #include <queue> #include <vector> using namespace std; struct Process { int id; int burstTime; int remainingTime; }; int main() { int n, timeQuantum; cout << "Enter the number of processes: "; cin >> n; cout << "Enter the time quantum: "; cin >> timeQuantum; ...
ALGO
0.999978
5.290796
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-10-27T02:28: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": "497f13be4e06...
0f4c9720-cdc4-46ad-8917-9cbbfc55eee6
Vigneshwari1/IPMP2123
week1/sorting/merge.cpp
/** * 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) {} * }; */ class Solution { public: ListNode* mergeTwoLis...
ALGO
0.999956
5.852352
{ "github_metadata": { "branch": "main", "commit_count": 87, "repo_created_at": "2023-02-04T17:40: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": "cdc2fd51e4a...
baecc739-51d5-46b7-9db1-093dfda3fcde
amritansh22/Data-Structures-and-Algorithms-in-cpp
Trees/B-tree.cpp
#include<iostream> using namespace std; class Node { public: int *key; int t; Node **C; int n; bool leaf; Node(int tg, bool leafg) { t = tg; leaf = leafg; key = new int [2*t - 1]; C = new Node * [2*t]; n = 0; } void insertNonFull(int k) { int i = ...
ALGO
0.999977
4.348605
{ "github_metadata": { "branch": "master", "commit_count": 555, "repo_created_at": "2019-09-17T12:42:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 382, "forks": 342, "issues": 14, "pull_requests": 86 }, "file_meta": { "content_id": "53...
e7a18b65-9a65-478d-9822-fe9bc0fea272
2XXJH/STRINGCOUNTER
cpp1st.cpp
#include <iostream> #include <vector> #include <algorithm> // for std::max_element int main() { // 1. Ask user for string std::string input; std::cout << "Enter a string: "; std::getline(std::cin, input); // Convert input to uppercase for (char &c : input) { c = toupper(c); } ...
ALGO
0.999763
6.414192
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-10-10T20:27: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": "20fed9dd0fa9...
148b143b-9852-4610-8501-30d346ccc947
thedevmustafa/Data-Structures-and-Algorithms
Lab 7/task2.cpp
//Implementing binary search. #include "iostream" using namespace std; int length; //Global variable for length because length is same for all functions here. //Function for generating random sorted array. void getsortedarray(int array[]) { srand(time(0)); for (int i = 0; i < length; i++) array[i] =...
ALGO
0.999228
5.120971
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2023-11-07T14:10: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": "fa55b101201...
6059d759-8f06-456d-8ad4-2784adcf03f4
wisdomleck/CP-code
classic problems and leetcode/add_Two_numbers.cpp
/** * 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) {} * }; */ class Solution { public: ListNode* addTwoNumbe...
ALGO
0.999979
6.356647
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-05-16T15:59: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": "62239284e3...
e39e0015-b45e-424b-a9af-e45b85b24898
Cryptic3488/Wolf-Tracker-Simulation
WolfTracker.cpp
//================================================================================== // Written by <NAME> // February 18th, 2024 // WolfTracker.cpp // This program will not prompt the user for input as the intention is that this // program will primarily be tested using .txt files. *Precondition for File: The // must ...
ALGO
0.998024
4.125138
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-03-03T04:04: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": "4d99c561b2ad...
a1213372-0605-4963-87b9-fc7bdd583dda
jose-lp/docker-ie0521
p/mpgt/Dominant.h
#ifndef DOMINANT_HPP #define DOMINANT_HPP #include <stdio.h> #include <opencv2/opencv.hpp> #include <queue> using namespace std; using namespace cv; typedef struct t_color_node { cv::Mat mean; // The mean of this node cv::Mat cov; uchar classid; // The class ID t_color_...
ALGO
0.998665
4.639172
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2019-11-08T21:22: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": "3441746f5...
d824079a-6459-45ae-bd2d-d90a27affb80
Ujjwal120/MyC-
CodeAgon2019_Euler_Tour_DFS_Order.cpp
#include<bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define inout freopen("1.txt", "r", stdin); freopen("output.txt", "w", stdout); #define pb push_back #define vi vector<int> const int maxn = 1e5; vi adj[maxn+1]; int parent[maxn+1], lvl[maxn+1], n, roo...
ALGO
0.99992
3.803373
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-01-02T14:14: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": "5242e07a541f...
89489640-7b47-4a00-8290-e671c6dd11de
ofelt/klondikebattle
patsolve/memory.cpp
/* * Copyright (C) 1998-2002 <NAME> <<EMAIL>> * Copyright (C) 2006-2009 <NAME> <<EMAIL>> * * 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 License, or (at your ...
TOOL
0.985688
6.404289
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2018-12-05T16:05: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": "10726e7a39...
7db51a9f-03cb-4c20-97af-3512fbb8b28b
Gautam-J/cp-problems
src/trailingZeros.cpp
/* CSES */ /* Time limit: 1.00 s Memory limit: 512 MB Your task is to calculate the number of trailing zeros in the factorial n!. For example, 20!=2432902008176640000 and it has 4 trailing zeros. Input The only input line has an integer n. Output Print the number of trailing zeros in n!. Constraints 1 \le n \le 10^9...
ALGO
0.999837
5.897411
{ "github_metadata": { "branch": "main", "commit_count": 277, "repo_created_at": "2021-07-25T08:32:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d42dd09c38...
7f37e3c2-c46a-45d1-a065-9724ea80fd1c
vsvipul/CompetitiveCoding
CodeChef/GADD.cpp
#include <bits/stdc++.h> #define vi vector <int> #define mii map <int,int> #define pb push_back #define mp make_pair #define ll long long #define vll vector <ll> #define vi vector <int> #define ii pair<int,int> #define all(a) (a).begin(),(a).end() #define FI cin.tie(NULL);ios_base::sync_with_stdio(false) #define T int...
ALGO
0.999989
4.372591
{ "github_metadata": { "branch": "master", "commit_count": 558, "repo_created_at": "2016-11-09T18:02:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b4302e83...
72639fd9-1a5b-4599-9cdf-fef299f15cc7
ngophuc/RigidTransformAcd3D
cgal/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h
// Copyright (c) 2015,2016 GeometryFactory // All rights reserved. // // This file is part of CGAL (www.cgal.org). // 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 3 of the License, or (at your option) any la...
ALGO
0.998336
6.219152
{ "github_metadata": { "branch": "master", "commit_count": 78, "repo_created_at": "2016-03-23T16:44: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": "7e4d2b5d3...
dcf399a1-cded-4489-a7cf-b9e1b8d738ee
Meghal2103/Data_Structure
10)Tree/stack.h
#include <stdio.h> #include <stdlib.h> #include <D:\Data_Structure\10)Tree\queue.h> class Stack { private: class node *top; public: Stack() { top = NULL; } int isEmpty() { if(top == NULL) { // printf("Stack Emp...
ALGO
0.996662
3.517648
{ "github_metadata": { "branch": "master", "commit_count": 64, "repo_created_at": "2023-05-27T19:29: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": "17bc97d24...
aa634aad-5eb0-4dcc-b90a-ba90f072cd69
baifffboy/Lab6Aisd
include/RedBlackTree.h
#pragma once //1. Каждая вершина является либо красной, либо черной и имеет двух потомков //2. Корень дерева является черным //3. Каждый лист не содержит данные и является черным //4. У каждой вершины оба потомка черные //5. Любой путь до потомков-листьев от любой вершины содержит одинаковое число черных вершин #incl...
ALGO
0.996818
4.818608
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2025-06-07T21:47: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": "6ea8d6d07e4b...
69a7701c-2f34-48d9-9685-d00205f263f1
Giantpizzahead/comp-programming
Other/VTHS/2018/pharmacy.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; const int MAXN = 100005; const ll INF = 1e18; int N, T, numO, numR; struct Point { int d, k; bool inStore; }; Point P[MAXN]; ll finishTime[10]; queue<Point> remote; void solve() { cin >> N >> T; for (int i = 0; i < N; i++) { ...
ALGO
0.999708
3.381071
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2020-04-04T04:04:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "feaeb469c...
c126eb0c-e13c-4271-8ad2-43bf9c3f2560
ishandutta2007/codeforces-c
ce_wa_tle/normal/1440/E.cpp
// C++ includes used for precompiling -*- C++ -*- // Copyright (C) 2003-2014 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library 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 So...
ALGO
0.999703
4.960376
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:17: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": "cb31ca0abf4d...
d8b8c2b8-4344-40a5-938e-3d1329b2c1be
veqcc/atcoder
atcoder/2020_8_2/f.cpp
#include <functional> #include <algorithm> #include <iostream> #include <iomanip> #include <cstring> #include <string> #include <vector> #include <random> #include <bitset> #include <queue> #include <cmath> #include <stack> #include <set> #include <map> typedef long long ll; using namespace std; const ll MOD = 10000000...
ALGO
0.999982
4.957945
{ "github_metadata": { "branch": "master", "commit_count": 832, "repo_created_at": "2018-06-09T04:36:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "36bfcd79...
3fa9e739-8e13-415b-b74c-a731e927b37c
Laceprndpm/ACM
src/cf/round/r1015d1+d2/E_ans.cpp
#include <bits/stdc++.h> using namespace std; const int maxn = 5050; const int mod = 1000000007; int n, a[maxn], fac[maxn], C[maxn][maxn], b[maxn], d[maxn][maxn]; bool vis[maxn]; void solve() { cin >> n; for (int i = 0; i <= n; ++i) { vis[i] = 0; for (int j = 0; j <= n; ++j) { d...
ALGO
0.999948
4.070412
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2025-01-27T06:41: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": "6e3e1b91547...
b3d27e0d-307e-4df3-8a17-3103b96815df
DevFalconsz/Atividades
Respostas Período 2/Ten Activities/question_ten.cpp
//<NAME> #include <stdio.h> int matriz_A[2][5], matriz_B[2][5], matriz_C[2][5]; int main() { printf("Digite os números para compor a matriz A.\n"); for (int i = 0; i < 2; i ++){ for (int j = 0; j < 5; j++){ printf("Elemento [%d][%d]: ", i+1, j+1); scanf("%d", &matriz_A[i][j]);...
ALGO
0.989379
4.439019
{ "github_metadata": { "branch": "main", "commit_count": 35, "repo_created_at": "2023-04-11T16:13:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f93edc56425...
e825fc59-816f-4ec7-bdd3-a710958cb447
GagandeepCodes/Cpp_files
DSA/Tree/Question_Tree/Minimum_Depth.cpp
#include <bits/stdc++.h> using namespace std; /** * 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...
ALGO
0.999905
5.135996
{ "github_metadata": { "branch": "master", "commit_count": 86, "repo_created_at": "2022-06-19T18:42:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "297081a20...
c6ddfcdc-0c58-4bb1-88e1-873d8e110be5
liyue4096/MyScotty3D_new
src/scene/material.cpp
#include "material.h" #include "../util/rand.h" namespace Materials { Vec3 reflect(Vec3 dir) { // A3T5 Materials - reflect helper // Return direction to incoming light that would be // reflected out in direction dir from surface // with normal (0,1,0) Vec3 ret = -dir + 2 * dot(Vec3(0.f, 1.f, 0.f), dir) ...
ALGO
0.92212
6.819181
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-04-05T16:07: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": "f846e923afac...
8d0a15cc-33ba-41e8-9f9c-9766e0470b3d
Jeeya201/LeetCode_Solutions
0234-palindrome-linked-list/0234-palindrome-linked-list.cpp
/** * 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) {} * }; */ // Solved on my own: // Intuition: // 1. Make the...
ALGO
0.999627
5.755651
{ "github_metadata": { "branch": "main", "commit_count": 278, "repo_created_at": "2023-09-30T18:00:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9bd599eafc...
b8d4bdbc-ceec-41cf-a0fa-d53be5173676
morris821028/UVa
volume005/539 - The Settlers of Catan.cpp
#include <stdio.h> #include <string.h> int n, m, ans; int map[30][30]; void dfs(int nd, int l) { if(l > ans) ans = l; int i; for(i = 0; i < n; i++) { if(map[nd][i]) { map[nd][i] = 0; map[i][nd] = 0; dfs(i, l+1); map[nd][i] = 1; map[...
ALGO
0.999964
3.634364
{ "github_metadata": { "branch": "master", "commit_count": 1197, "repo_created_at": "2013-06-14T12:34:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 571, "forks": 269, "issues": 1, "pull_requests": 1 }, "file_meta": { "content_id": "831...
ab91244b-1d00-4654-b917-09402180f545
Dhoven23/LidarAngle
TeensyCode/TeensyCode.ino
/* Here are my globals.*/ float rot_X, // angle about X rot_Y, // angle about Y distance; int rad = 30; void setup() { Serial.begin(9600); delay(100); } void loop() { /* call LidarAngle(int points[3], float rad) * where points is the distance reading of each sensor. * if the...
ALGO
0.983772
4.308643
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-02-04T21:50: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": "0f14678f4ad0...
1f92a29b-c28c-4499-911c-a46d1804cbee
OpenPTrack/open_ptrack
bayes/include/open_ptrack/bayes/matSup.hpp
#ifndef _BAYES_FILTER_MATRIX_SUPPORT #define _BAYES_FILTER_MATRIX_SUPPORT /* * Bayes++ the Bayesian Filtering Library * Copyright (c) 2002 <NAME> * See accompanying Bayes++.htm for terms and conditions of use. * * $Id: matSup.hpp 634 2010-08-15 16:39:44Z mistevens $ */ /* * Matrix support functions for filter ...
TOOL
0.994617
7.046666
{ "github_metadata": { "branch": "master", "commit_count": 303, "repo_created_at": "2013-12-06T19:18:58.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 321, "forks": 108, "issues": 44, "pull_requests": 2 }, "file_meta": { "content_id": "83bd...
b8931c93-2dcc-40a9-8ac8-a7f51c3d8c76
undefined2001/CPP
fractional_knapsack.cpp
#include <iostream> #include <vector> struct Node { int item; int weight; int value; // Node(int i, int w, int v) // { // item = i; // weight = w; // value = v; // } friend std::ostream &operator<<(std::ostream &out, Node &n) { out << "Item: " << n.item...
ALGO
0.999892
4.505583
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2022-11-27T10:01: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": "63571e0d95...
bcd41e4d-e491-4492-b8dd-46fcf2a435e3
kavehazizian/Sample-Codes
C++_smaple/C++_Cplex_DARP/main_CPLEX.cpp
#include <iostream> #include <sstream> #include <iomanip> #include <fstream> #include <string> #include <vector> #include <armadillo> #include <algorithm> #include <sys/ioctl.h> #include <stdio.h> #include <unistd.h> #include <cmath> #include <limits> #include <time.h> #include </media/kaveh/DATA/Installed_cplex_linux/...
ALGO
0.999586
3.510362
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2020-11-18T13:20:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "306df2eb4...
f5dea6a2-1edd-4b30-ac35-fdd425ad1431
Asevenx174/CP-source-code-
02_OJ_solution/Cf contest/841 div2/b.cpp
#include<bits/stdc++.h> #define pb push_back #define mp make_pair #define pf printf #define ff first #define ss second #define sef second.first #define ses second.second #define PI 3.14159265 /// tan inverse = atan(value)*(180/PI) #define ms(a,b) memset(a, b, sizeof(a)) #define lp(i,a,b)...
ALGO
0.999804
4.041403
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-05-12T16:42: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": "fca639f00895...
f46f45a0-06f8-4a53-aeca-20bdc0f17235
IRSHIT033/6companies30days
Adobe/Pots_of_Gold_Game.cpp
// { Driver Code Starts //Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: int sol(vector<int>& nums,vector<vector<int>>&dp,int s,int e) { if(s>e)return dp[s][e]=0; if(s==e)return dp[s][e]=nums[s]; if(dp[s][e]!=...
ALGO
0.999789
5.504805
{ "github_metadata": { "branch": "main", "commit_count": 112, "repo_created_at": "2022-01-02T05:32:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "68eb854565...
5f08dd2a-0a57-468a-beee-a247fa9eb995
meriadec/N-puzzle
src/main.cpp
#include <npuzzle.hpp> #include <sstream> #include <stdlib.h> #include <time.h> #include <Parser.class.hpp> #include <Puzzle.class.hpp> #include <Utils.class.hpp> int main (int ac, char **av) { srand(time(NULL)); if (ac < 2) { std::cerr << "Usage: ./npuzzle [-f file] [-s size] [-i iterations] [-h <manhattan|...
ALGO
0.987439
5.37691
{ "github_metadata": { "branch": "master", "commit_count": 80, "repo_created_at": "2015-04-06T10:46:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7451ec4ca...
46488c80-bf68-4685-bd49-ba23b959dd0a
ksaveljev/UVa-online-judge
11466.cpp
#include <iostream> #include <cmath> #include <vector> #include <algorithm> using namespace std; int MAX_N = 10000000; int main(void) { int *lp = new int[MAX_N]; vector<int> primes; long long input; fill(lp, lp + MAX_N, 0); for (int i = 2; i < MAX_N; i++) { if (lp[i] == 0) { lp[i] = i; p...
ALGO
0.999974
3.928719
{ "github_metadata": { "branch": "master", "commit_count": 788, "repo_created_at": "2011-04-04T11:43:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 106, "forks": 69, "issues": 0, "pull_requests": 4 }, "file_meta": { "content_id": "06fd5...
eb8556af-087b-41f5-9366-5cf4b2e76f56
DanGrigorenko/Traning
программы/schet.cpp
#include<iostream> using namespace std; int main() { int count1 = 0; int count2 = 0; bool player; bool flag = true; while(flag) { cout << "Счёт: " << count1 << " : " << count2 << endl; cin >> player; if (player == true) { count1++; } else { ...
ALGO
0.999796
3.264239
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2022-01-23T14:40: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": "d9cb334f6...
50bc40bb-b84c-4c8a-b015-25ffe8591e1f
dschur13/pro_8
p8.h
/////////////////////////////////////////////////////////////// // I UNDERSTAND THAT COPYING PROGRAMS FROM OTHERS WILL BE DEALT // WITH DISCIPLINARY RULES OF CCNY. // STUDENT NAME: <NAME> // LOGIN_NAME: ee259 // EE259 SECTION (DAY/EVE): Day /////////////////////////////////////////////////////////////// // //THIS IS SA...
ALGO
0.983581
3.927955
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2025-05-06T17:16: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": "1386ce028e57...
d125eaab-b008-4cd0-9beb-d880ff3bbb41
AtharvaPanegai/DSA-Aman
LinkedList/AppendKNodes/program.cpp
// append last k nodes of linkedlist to the start of linkedlist #include "bits/stdc++.h" using namespace std; class node { public: int data; node *next; // constructor node(int val) { data = val; next = NULL; } }; int lengthOfLL(node *&head) { int count = 0; node *tem...
ALGO
0.999767
4.050701
{ "github_metadata": { "branch": "master", "commit_count": 65, "repo_created_at": "2022-06-04T06:04: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": "a6da39ffe...
9ad4a9b6-b49d-4ea9-b432-d5a8f60f319f
AbdullaKhan01/LeetCode_Codes
1130. Minimum Cost Tree From Leaf Values.cpp
class Solution { public: int solve(vector<int>& arr,map<pair<int,int>,int> &mp,int left,int right){ if(left == right) return 0; int ans = INT_MAX; for(int i=left;i<right;i++){ ans = min(ans,mp[{left,i}]*mp[{i+1,right}] + solve(arr,mp,left,i) + solve(arr,mp,i+1,right))...
ALGO
0.999978
4.906502
{ "github_metadata": { "branch": "main", "commit_count": 55, "repo_created_at": "2023-08-27T18: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": "1bedf930f7f...
9faf2a8d-948c-43c6-97a9-95eee306c0c9
MrNightMera/Motors-test-
SSDif_else.ino
const int topMid = A0; const int topRight = 11; const int topLeft = A2; const int midRight = 10; const int midLeft = 2; const int btmRight = 9; const int btmLeft = 3; const int btmMid = 5; int counter = 0; void setup(){ pinMode(topMid, OUTPUT); pinMode(topRight, OUTPUT); pinMode(topLeft, OUTPUT); pinMode(m...
ALGO
0.993236
4.380209
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2016-12-02T15:18: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": "754c7cafbe...
9f0a38f2-9ba9-45de-8f88-4d70c7a3fcf2
ashtanyuk/gkernel2d
tests/perf/bench_pipeline.cpp
#include "benchmark/benchmark.h" #include "gkernel/objects.hpp" #include "gkernel/intersection.hpp" #include "gkernel/converter.hpp" #include "gkernel/area_analyzer.hpp" #include <iostream> #include <vector> #include <numeric> #include <math.h> #include <unordered_map> #include <unordered_set> #include <algorithm> #inc...
TEST
0.969868
5.719034
{ "github_metadata": { "branch": "main", "commit_count": 37, "repo_created_at": "2022-12-19T05:54: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": "0fc27179351...
320297b2-474f-4e2c-bba8-4650cdbd62a2
ishandutta2007/codeforces-k
krk/normal/785/D.cpp
#include <cstdio> #include <iostream> #include <vector> #include <set> #include <map> #include <cmath> #include <string> #include <cstring> #include <sstream> #include <algorithm> using namespace std; typedef long long ll; const int Maxn = 500005; const int mod = 1000000007; int fac[Maxn], inv[Maxn]; char str[Maxn];...
ALGO
0.999916
4.006862
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:06:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "37aaf8d274b2...
689f4c95-a14c-439b-8203-1e43e2702f6e
Aniket0304/tushar
function.cpp
#include<iostream> using namespace std; int power (){ int a,b; cin>> a>> b; int ans=1; for(int i=1; i<=b; i++){ ans =ans*a; } cout<< ans <<endl; return ans; } bool isEven(){ // one of the example of verifying a number is odd without using modulus. Ye sirf true value pe chalega. ...
ALGO
0.999958
4.472879
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2024-01-19T15:24: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": "137bdf9a1eda...
e16057ef-c784-4b5b-87cd-4fce5a8dfd53
n31t/algo
lab8/B4.cpp
#include <iostream> #include <vector> #include <climits> #include <algorithm> using namespace std; int binarySearch(const vector<int>& arr, int target) { int low = 0; int high = arr.size() - 1; while (low <= high) { int mid = low + (high - low) / 2; if (arr[mid] == target) { r...
ALGO
0.999946
4.793052
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2024-01-29T14:19: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": "0ee5e39f14...
207a5f5c-8e03-4247-b4db-c557014f4918
mediassumani/Notebook
C++/ArrayList/source.h
//THIS IS THE HEADER FILE //Abstract functions will be implemented in sortedList and unsortedList clss class List { public: //public members bool isEmpty()const; // this function checks if the list is empty //postcondition : true is returned if the array is empty and false is returned if t...
TOOL
0.985479
3.333247
{ "github_metadata": { "branch": "master", "commit_count": 94, "repo_created_at": "2018-08-28T18:36:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "be61d3082...
8ef7b429-ab25-4c60-97c2-a0fbfeb03658
StiliyanDr/Graph-Store
Graph Store/Graph Store/Priority Queue/PriorityQueue.h
#ifndef __PRIORITY_QUEUE_HEADER_INCLUDED__ #define __PRIORITY_QUEUE_HEADER_INCLUDED__ #include <vector> #include <type_traits> #include "PriorityQueueHandle.h" class Less { public: template <class T> bool operator()(const T& lhs, const T& rhs) const noexcept(noexcept(lhs < rhs)) { return lhs < rhs; } }; class...
ALGO
0.991169
7.455477
{ "github_metadata": { "branch": "master", "commit_count": 689, "repo_created_at": "2018-03-01T22:11:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fab3d80d...
397758e5-44a7-4748-8b53-9e0f91ac9bef
LucaSiviero/HPC
exercises/parallel_pi.cpp
#include <iostream> #include <omp.h> #include <chrono> using namespace std; int threads, iterations; double calculatePi_with_partial_sums_padding(unsigned long int n); double calculatePi_with_reduction(unsigned long int n); double calculatePi_with_partial_sums_no_padding(unsigned long int n); double calculatePi_with...
ALGO
0.999921
5.884631
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2022-03-10T17:55: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": "d7c875f1199...
b91a2baf-805f-40b7-a153-579527464454
Aritra0101/LeetCode
637-average-of-levels-in-binary-tree/average-of-levels-in-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.999903
6.466433
{ "github_metadata": { "branch": "main", "commit_count": 775, "repo_created_at": "2023-08-31T18: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": "a08b8c48f4...
54d63908-8a71-4c6f-9fb7-5ff01e6f4ed8
Kevinjchang98/LeetCode
19-remove-nth-node-from-end-of-list/19-remove-nth-node-from-end-of-list.cpp
/** * 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) {} * }; */ class Solution { public: ListNode* removeNthFr...
ALGO
0.999993
6.053473
{ "github_metadata": { "branch": "main", "commit_count": 534, "repo_created_at": "2022-08-05T00:30:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "96d557f835...
9ece9995-e4cb-4640-b1cb-7eb8e18b61e8
MostafaAshraf98/Problem-Solving
Current Problem/19. Remove Nth Node From End of List.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<int> vi; #define sf(n) scanf("%d", &n) #define sff(n, m) scanf("%d%d", &n, &m) #define sfl(n) scanf("%I64d", &n) #define sffl(n, m) scanf("%I64d%I64d", &n, &m) #define sfs(s) scanf("%...
ALGO
0.999986
3.941202
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2021-08-27T15:54: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": "293d36705...
d9bc5840-bbfe-47f2-bf33-9a8e172f64d6
MinQuan-kun/Training
Upcoder/Lập trình nâng cao/1.Quá tải toán tử/Tam giác/TGIAC.cpp
#include<bits/stdc++.h> using namespace std; struct TD { int x, y; double doDai(TD other) { return sqrt(pow(other.x - x, 2) + pow(other.y - y, 2)); } }; istream & operator >> (istream & in, TD & a) { in >> a.x >> a.y; return in; } ostream & operator << (ostream & out, TD a) { out << "("...
ALGO
0.996641
4.018962
{ "github_metadata": { "branch": "main", "commit_count": 472, "repo_created_at": "2024-09-26T11:42:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5f5ab4888c...
02c024af-64db-4644-9c2e-10623518ff62
windystrife/UnrealEngine_NVIDIAGameWorks
Engine/Source/ThirdParty/PhysX/PhysX_3.4/Source/GeomUtils/src/mesh/GuBV4_SphereOverlap.cpp
// This code contains NVIDIA Confidential Information and is disclosed to you // under a form of NVIDIA software license agreement provided separately to you. // // Notice // NVIDIA Corporation and its licensors retain all intellectual property and // proprietary rights in and to this software and related documentation...
ALGO
0.987424
7.13857
{ "github_metadata": { "branch": "4.18-GameWorks", "commit_count": 14, "repo_created_at": "2018-03-06T15:44:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 284, "forks": 176, "issues": 4, "pull_requests": 2 }, "file_meta": { "content_id"...
7132adad-ce24-4353-a46e-7437fc830f78
spin-spin-ryo/contest-practice
solved/ABC293/E.cpp
#include <iostream> #include <vector> #include <tuple> #include <string> #include <algorithm> #include <stack> #include <utility> #include <queue> #include <map> #include <iomanip> #include <cmath> #include <set> #include <list> #include <deque> using namespace std; using ll = long long; #define mod 998244353 #define ...
ALGO
0.999965
4.806177
{ "github_metadata": { "branch": "main", "commit_count": 48, "repo_created_at": "2023-04-27T11:45: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": "ecf252942ce...
c6649fd6-42de-4fd5-a5c4-c4b64bb5be9e
JustYonnn/Praktikum-GKV-B1
Pertemuan 4/Tugas Pertemuan 4/main.cpp
#include <GL/glut.h> static int shoulder = 0, elbow = 0; static int pinky = 0, ring_finger = 0, middle_finger = 0, index_finger = 0, thumb = 0; void init(void) { glClearColor(0.0, 0.0, 0.0, 0.0); glShadeModel(GL_FLAT); } void drawFinger(float x, float y, float z, int rotation, int segments, float tiltX, floa...
ALGO
0.926039
5.048764
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2025-03-17T01:08: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": "8fb8c901be9...
6d000ef2-2ce4-42d3-882c-c69134b59f82
abhi-glitchhg/leetcode_prep
218-the-skyline-problem/218-the-skyline-problem.cpp
class Solution { public: vector<vector<int>> getSkyline(vector<vector<int>>& build) { priority_queue<pair<int,int>> q; int i = 1; int curr = build[0][2]; int start = build[0][0]; int end = build[0][1]; vector<vector<int>> ans; while(i<build.size()){ ...
ALGO
0.99988
5.623513
{ "github_metadata": { "branch": "main", "commit_count": 848, "repo_created_at": "2022-08-06T06:30:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c99e88428c...
ae8f2acc-7d34-4dc3-a8f4-7c48c72d35e2
AleksParatoonka/Netology05_HW06
N05_HW06_Task01/N05_HW06_Task01.cpp
// N05_HW06_Task01.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> #include "math_functions.h" int main() { setlocale(LC_ALL, "Russian"); int x, y, z; std::cout << "Введите первое число : " ; std::cin >> x; std::cout << "Введите втор...
ALGO
0.982094
3.920265
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-01-23T16:51: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": "bd4dff747499...
49ae3fb4-28ea-4b75-9d30-80ec751ea23b
imulan/procon
topcoder/SRM/SRM 653/CountryGroupHard.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr) #define all(x) (x).begin(),(x).end() #define pb push_back #define fi first #define se second class CountryGroupHard { ...
ALGO
0.999774
4.764861
{ "github_metadata": { "branch": "master", "commit_count": 2571, "repo_created_at": "2015-11-25T03:18:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 1, "issues": 27, "pull_requests": 0 }, "file_meta": { "content_id": "d58abc...
e334fb15-3987-4f3b-bd09-661738b5c95f
ishandutta2007/codeforces-g
generic_placeholder_name/normal/1156/D.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/trie_policy.hpp> #include <ext/rope> #pragma GCC optimize("Ofast") #pragma GCC optimization("unroll-loops, no-stack-protector") #pragma GCC target("avx,avx2,fma") using namespace std; using namespace __gnu_pbds; using namespace __gn...
ALGO
0.999729
4.521413
{ "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": "5c86221d485c...
b573f610-5ab5-4bf9-95d2-fe2848cc8beb
arifSDE/Algorithm
Module 19/sub_set_sum_top_bottom.cpp
#include <bits/stdc++.h> using namespace std; int dp[1005][1005]; bool subSet(int s,int a[],int n) { if(n==0) { if(s==0)return true; else return false; } if(dp[n][s]!=-1)return dp[n][s]; if(a[n-1]<=s) { bool op1=subSet(n-1,a,s-a[n-1]); bool op2=subSet(n-1,a,s); ...
ALGO
0.999975
3.791818
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-03-13T13:05: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": "73e7c6cd7087...
58134fb6-b7e0-44c6-980f-31ef3602841e
haoel/leetcode
algorithms/cpp/greatestCommonDivisorOfStrings/GreatestCommonDivisorOfStrings.cpp
// Source : https://leetcode.com/problems/greatest-common-divisor-of-strings/ // Author : <NAME> // Date : 2020-07-19 /***************************************************************************************************** * * For strings S and T, we say "T divides S" if and only if S = T + ... + T (T concatenated...
ALGO
0.999804
6.845387
{ "github_metadata": { "branch": "master", "commit_count": 788, "repo_created_at": "2014-10-20T03:22:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 17857, "forks": 4931, "issues": 26, "pull_requests": 28 }, "file_meta": { "content_id": ...
989a2494-45a8-4b0a-8e9f-30f71fb5b79d
farnazkohankhaki/CPP-Codes-Archive
Programming Class/Hating numbers.cpp
#include <iostream> #include <algorithm> #define ll long long using namespace std; const int MAXN = 10000 + 1000; ll n, a[MAXN], d[MAXN], cnt, ans[MAXN]; bool hate (ll y, ll x) { while (y % 2 == 0 && y > x) { y /= 2; if (y == x) return true; } return false; } int main() { cin >> n; for (int i = 0; i <...
ALGO
0.99999
3.660546
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2018-12-28T22:25: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": "a512012a6...
ddb9e4c4-5064-46de-8ac4-08a6ef609e48
nfrechette/rtm
tools/bench/sources/bench_vector_dot3.cpp
//////////////////////////////////////////////////////////////////////////////// // The MIT License (MIT) // // Copyright (c) 2023 <NAME> & Realtime Math contributors // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"...
TEST
0.910944
7.110274
{ "github_metadata": { "branch": "develop", "commit_count": 984, "repo_created_at": "2018-11-01T02:17:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 766, "forks": 48, "issues": 14, "pull_requests": 0 }, "file_meta": { "content_id": "799...
9bc3db05-20a4-4441-8025-da1f1772704c
kamyu104/LeetCode-Solutions
C++/queens-that-can-attack-the-king.cpp
// Time: O(1) // Space: O(1) class Solution { private: template <typename T> struct PairHash { size_t operator()(const pair<T, T>& p) const { size_t seed = 0; seed ^= std::hash<T>{}(p.first) + 0x9e3779b9 + (seed<<6) + (seed>>2); seed ^= std::hash<T>{}(p.second) + 0...
ALGO
0.999984
5.79607
{ "github_metadata": { "branch": "master", "commit_count": 19395, "repo_created_at": "2018-10-11T17:38:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4939, "forks": 1616, "issues": 1, "pull_requests": 55 }, "file_meta": { "content_id": ...
9c11a065-3588-4c57-955a-40a037cd7e9a
Mandeep-Singh18/DSA-Questions
Arrays/Majority Element (Boyer-Moore Voting Algorithm).cpp
int majorityElement(vector<int>& nums) { // Step 1: Initialize variables int count = 0; // To keep track of the frequency of the current candidate int ele; // To store the current candidate for the majority element // Step 2: Find the candidate for majority element for(int i = 0; i < nums.s...
ALGO
0.999999
6.434624
{ "github_metadata": { "branch": "main", "commit_count": 93, "repo_created_at": "2024-09-16T09:23: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": "c11a257dd9e...
8bea523d-a5b1-424d-b751-5e5b3d9b2137
HeneyGoyani/DSA
Project8/task1.cpp
#include <iostream> using namespace std; class Node { public: int data; Node* next; Node(int n) { data = n; next = nullptr; } }; class List { private: Node* head; public: List() { head = nullptr; } void append(int n) { Node* newNode = new Node(n);...
ALGO
0.999036
5.40846
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2024-12-14T12:25: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": "2df3a81f36c...
461d95f6-c74b-417b-9ef3-cb7450f5a47e
GandharvJain/Algorithms_Lab
MinSpanTree/KruskalMinSpanTree.cpp
#include <bits/stdc++.h> using namespace std; typedef long long int ll; class DisjointSetForest { vector<ll> parent; vector<ll> rank; public: DisjointSetForest(ll n) { parent.resize(n); rank.resize(n); for (ll i = 0; i < n; ++i) { parent[i] = i; rank[i] = 0; } } ll findSet(ll node) { if (node !=...
ALGO
0.999963
4.843776
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2022-03-08T13:18: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": "68b59609c...
833cecc8-2fad-4a49-8193-b64768471c30
FazeelUsmani/Scaler-Academy
Contests/07 Contest/1 powerArray.cpp
#include<bits/stdc++.h> using namespace std; int powerArrays (vector<int> &A, int n){ int nge[n], pge[n]; stack<int> s; s.push(0); for (int i = 1; i < n; ++i){ while (!s.empty() && A[s.top()]/2 < A[i]){ nge[ s.top() ] = i; s.pop(); } s.push(i); } ...
ALGO
0.999807
4.332966
{ "github_metadata": { "branch": "master", "commit_count": 795, "repo_created_at": "2020-01-28T18:13:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 252, "forks": 172, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5836...
80813e4f-f97e-4681-b69d-30aa6718abef
shivaamm/Coding-Practice
Searching & Sorting/number_of_pairs.cpp
class Solution{ public: // X[], Y[]: input arrau // M, N: size of arrays X[] and Y[] respectively //Function to count number of pairs such that x^y is greater than y^x. long long countPairs(int X[], int Y[], int m, int n) { vector<int> suffix(1005); long long total_pairs = 0;...
ALGO
0.999977
4.723722
{ "github_metadata": { "branch": "master", "commit_count": 1091, "repo_created_at": "2020-07-27T16:47:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 41, "forks": 11, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "93e77...
d44ce844-97d0-4558-a50d-4dea2eaf9628
PerfectPan/Algorithm-Competition
ACWing/4616.cpp
#include <algorithm> #include <iostream> #include <cstdio> #include <vector> #include <string> #include <cstring> #include <map> #include <set> #define MP make_pair #define PB emplace_back using namespace std; typedef long long ll; template<typename T> inline T read(T&x){ x=0;int f=0;char ch=getchar(); while (c...
ALGO
0.999859
3.556644
{ "github_metadata": { "branch": "master", "commit_count": 316, "repo_created_at": "2018-03-01T15:32: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": "71c89db1...
ea023be7-483a-41c1-a774-11b2821a1ef1
andy-lee-cat/catsDaily
250215.cpp
// 1989C 1400 #include<iostream> #include<algorithm> #include<vector> using namespace std; void solve() { int n; cin >> n; vector<int> a(n), b(n); for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) cin >> b[i]; // 1 1 // -1 -1 int m1 = 0, m2 = 0; in...
ALGO
0.999997
3.651524
{ "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": "cef4e6ad...
a15adb93-0484-4ed6-8b17-1153b4f7c77f
mayank0rastogi/CP
450dsa/Sorting/Product array puzzle.cpp
// Given an array nums[] of size n, construct a Product Array P (of same size n) such that P[i] is equal to the product of all the elements of nums except nums[i]. // Example 1: // Input: // n = 5 // nums[] = {10, 3, 5, 6, 2} // Output: // 180 600 360 300 900 // Explanation: // For i=0, P[i] = 3*5*6*2 = 180. // F...
ALGO
0.999947
6.372191
{ "github_metadata": { "branch": "master", "commit_count": 740, "repo_created_at": "2020-03-01T08:39: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": "ad018fb4...
b4fd0bd7-3fde-4aef-b69b-38283ca59ee1
KSH-code/Problem-Solving
1244.cpp
#include <iostream> using namespace std; int main(){ int N; cin >> N; bool arr[N+1]; for (int i=1;i<=N;i++) cin >> arr[i]; int T; cin >> T; while (T--) { int g, n; cin >> g >> n; if (g==1) { for (int i = n; i <= N; i += n) arr[i] = !arr[i]; } else { arr[n] = !arr[n]; in...
ALGO
0.999855
3.712598
{ "github_metadata": { "branch": "master", "commit_count": 117, "repo_created_at": "2020-07-13T16:12:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6a555289...
f1ec9bd6-a5c0-4ae0-a1b6-39435b1a669b
ADITYA-0208/Leetcode-er
2948-make-lexicographically-smallest-array-by-swapping-elements/2948-make-lexicographically-smallest-array-by-swapping-elements.cpp
class Solution { public: int find_set(int v, vector<int>& parent) { if (v == parent[v]) return v; return parent[v] = find_set(parent[v], parent); // Path compression } void union_sets(int a, int b, vector<int>& parent) { int rootA = find_set(a, parent); int rootB...
ALGO
0.999999
6.049809
{ "github_metadata": { "branch": "main", "commit_count": 598, "repo_created_at": "2024-12-31T11:35: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": "be2e655532...
3ddddb3d-1c66-4880-b284-c6c6f9f3f9b4
yjp20/codeforces-solutions
320/b/b.cpp
// youngjinp20 // 2020 08 #include <bits/stdc++.h> #define by(x) [](const auto& a, const auto& b) { return a.x < b.x; } #define byr(x) [](const auto& a, const auto& b) { return a.x > b.x; } #define smax(a, b) ((a) < (b) ? ((a)=(b), true) : false) #define smin(a, b) ((a) > (b) ? ((a)=(b), true) : false) #define imie(.....
ALGO
0.999949
4.6498
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2022-02-14T19:55: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": "208d149c79...
29222f08-87b4-46c3-a559-94a47fe1a80c
jgreer013/Data_Structures
L1/caesar.cpp
/* caesar.cpp <NAME> August 26th, 2015 */ #include <iostream> #include <string> #include <fstream> #include <stdlib.h> #include <stdio.h> #include "unistd.h" using namespace std; void displayHelp() { cout << "Parameters: -r <int> [optional]\n" << endl; cout << "-r <int> Amount of Rotation, positive o...
TOOL
0.995918
4.659744
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2016-04-28T21:06: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": "054d9cdd3...
406daf14-8142-4226-a691-b55944759a32
ishandutta2007/codeforces-n
neal/normal/1060/F.cpp
#include <algorithm> #include <cassert> #include <iostream> #include <vector> using namespace std; int N; vector<vector<double>> choose; vector<vector<int>> adj; void precompute() { choose.resize(N + 1); for (int i = 0; i <= N; i++) { choose[i].resize(i + 1); choose[i][0] = 1; for (i...
ALGO
0.999706
4.459458
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:35: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": "0abcc98986b7...
554e32a0-509e-4bd1-86e5-4735e7ec22f0
kyyyyyyyyyyyyyy/praktikumc--Sms1
second/prkatikum1.cpp
#include <iostream> #include <conio.h> main () { int k, l, m, n, o, p, q, r; std::cout << "masukan nilai ke-1 = "; std::cin >> k; std::cout << "masukan nilai ke-2 = "; std::cin >> l; std::cout << "masukan nilai ke-3 = "; std::cin >> m; o = (k + l) * m < 100; p = k * l * m > 100; ...
ALGO
0.998009
3.198399
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2024-10-28T03:47: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": "65ce963dca74...
68cd78ac-1b29-4d79-8df9-1cceddc7ac92
ChayanMallick13/DSA-LOVE-BABBAR
Additionals/Rabin_Karp_Algo.cpp
class Solution { public: vector<int> search(string pattern, string text) { // code here. vector<int> ans; int bigPrime = 10007; int pHash = 0; int tHash = 0; int base = 26; int expo = 1; for(int i = 1;i<pattern.length();i++){ expo = (expo...
ALGO
0.999971
5.799035
{ "github_metadata": { "branch": "main", "commit_count": 160, "repo_created_at": "2024-05-30T13:25:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3450c9f3d6...
34692bde-3494-4062-9cf3-feb695a77ee8
Amit5001/Teensy_FC
DIY_FC/src/01Filter/EkfClass.h
#ifndef EKF_H #define EKF_H #include "Var_types.h" #include "eigen.h" #include <Eigen/LU> /* Extended Kalman Filter (EKF) for Attitude Estimation This is a proper EKF implementation using: - Quaternions as state vector (4D) - Nonlinear state transition model - Nonlinear measurement model - Proper Jacobian matrices...
ALGO
0.997222
7.028589
{ "github_metadata": { "branch": "main", "commit_count": 49, "repo_created_at": "2024-09-25T18:39:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "08408ae7cdf...
41f5375e-f397-4861-8ec7-24a16877d339
abysmalocean/LeetCode
problem_2/home/liangxu/GT/LeetCode/problem_2/20.valid-parentheses.cpp
/* * @lc app=leetcode id=20 lang=cpp * * [20] Valid Parentheses */ // @lc code=start class Solution { public: bool isValid(string s) { const int len = s.length(); if (len == 0) return true; stack<char> st; st.push(s[0]); for (int i = 1; i < len; ++i) { ...
ALGO
0.996918
6.859968
{ "github_metadata": { "branch": "master", "commit_count": 56, "repo_created_at": "2019-11-19T03:58: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": "3171d2a84...
962c44c9-9b97-4be2-a78c-2efb0cb6deb8
wizleysw/backjoon
16959/solve.cpp
// https://www.acmicpc.net/problem/16959 // 체스판 여행 1 // Written in C++ langs // 2020. 12. 09. // Wizley #include <iostream> #include <algorithm> #include <vector> #include <string.h> #include <map> #include <set> #include <queue> using namespace std; int MAP[11][11]; int VISITED[11][11][101][3]; pair<int,int> START;...
ALGO
0.999969
4.019162
{ "github_metadata": { "branch": "master", "commit_count": 506, "repo_created_at": "2019-12-28T07:51: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": "6c2aefdb...
45000dbb-c413-4263-8bd1-66b0864b17ac
ericdunipace/causalOT
src/deprecated/lp_norm_barycenter.cpp
#include "causalOT_types.h" matrix weighted_mean_output(const matrix & Y, const matrix & gamma) { return( Y.transpose() * gamma ); } vector lp_norm_p(const ColXpr & Z, const matrix & Y, double p) { return((Y.rowwise() - Z.transpose()).array(...
ALGO
0.999759
5.462699
{ "github_metadata": { "branch": "master", "commit_count": 526, "repo_created_at": "2019-12-29T07:11:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "798302e3...
0b0d423f-5d65-4fbf-bb4a-2cfa214dde7f
alranel/Boost-Geometry-Utils
src/voronoi2perl.h
#ifndef bgu_voronoi2perl_h_ #define bgu_voronoi2perl_h_ #include <cstdio> #include <map> #include <cmath> using namespace boost::polygon; typedef medial_axis<double> VD; typedef segment_data<int> bp_segment; static const unsigned int EXTERNAL_COLOR = (unsigned int) 1; static const unsigned int IS_LEAF = (uns...
ALGO
0.998432
5.585411
{ "github_metadata": { "branch": "master", "commit_count": 75, "repo_created_at": "2012-04-08T18:34:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 5, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "cd70adf9a...
56610efd-3a5d-43b8-a6f7-e4ec844a4f19
zwondd/Algorithm
jongmanbook/8_DP/wildcard.cpp
#include <iostream> #include <string> using namespace std; bool match(const string& w, const string& s) { int pos=0; while( pos<s.size() && pos<w.size() && (w[pos] == '?' || w[pos] == s[pos] ) ) { ++pos; } if ( pos == w.size() ) { return pos==s.size(); } if ( w[pos] == '*' )...
ALGO
0.999073
3.752043
{ "github_metadata": { "branch": "master", "commit_count": 185, "repo_created_at": "2018-12-11T13:31: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": "7a18d3f7...
baa85f14-a177-44a6-9672-b8cd924dcbb9
kidkych/IntroToCPPWorkshop_OTEngSoc
reforestation.cpp
#include <iostream> //input output library #include <tgmath.h> //math library using namespace std; /** * Engineering problem solving with c++ - Chapter 4 Question 29 & 30 * * @param num_acres_total (int) Total amount of forestable land. * @param acres_left (int) Number of uncut acres. * @para...
ALGO
0.988954
5.515235
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-02-26T22:03:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0052109c743f...
4ea8b476-1191-4219-926b-cb9b51f9cc75
jmkjohns/Euler_cpp
012.cpp
#include <iostream> #include <cstdint> uint64_t current = 1; void next(); int countDivisors( uint64_t number ); int * buildPrimeList( int number ); uint64_t primeProducts( int number ); int main( int argc, char *argv[] ) { /* uint64_t lowerLimit = primeProducts( divisorLimit ); while (current < lowerLimit) { n...
ALGO
0.999525
4.832332
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2017-09-19T13:26: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": "f98e8f73e...
72776660-6883-4d18-994a-6cbf7c74e490
notabhishek/Competitive-Programming
Dynamic Programming/LeetCode/Different Ways to Add Parentheses.cpp
class Solution { public: vector<vector<vector<int>>> dp; bool isop(char c) { return c =='+' || c=='-' || c=='*'; } void merge(int i , int j , int k, char op){ for(auto &x : dp[i][k-1]) { for(auto &y : dp[k+1][j]) { if(op == '+') dp[i][j].pu...
ALGO
0.999986
4.939379
{ "github_metadata": { "branch": "main", "commit_count": 852, "repo_created_at": "2020-10-21T22:39:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 32, "forks": 10, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7eff0937...
9155fce2-caf8-4931-a436-c5f0cc60cfe5
Samuel-fps/AAED
P1/ej4.cpp
/* EJERCICIO 4 Escriba un programa que genere 10 000 000 de números pseudoaleatorios de precisión doble en el intervalo [0, 1] e imprima la media de los valores y = 4·√(1 − x^2) correspondientes a cada número x. Emplee la función del ejercicio anterior. */ #include <cstdlib> #include <iostream> #include <c...
ALGO
0.999643
4.349132
{ "github_metadata": { "branch": "main", "commit_count": 49, "repo_created_at": "2023-08-02T08:25:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "99600118e41...
9f3897ce-0316-445b-99c1-8745b9ecfca9
hieu-ln/IT81-14
CodeC5/MinhNhat_C5_Bai4.cpp
// chuong 5- bai 4 #include<stdio.h> #include<iostream> #include<fstream> using namespace std; #define MAX 20 int A[MAX][MAX]; int n; char vertex[MAX]; struct Node { int info; Node *link; }; Node * sp; Node *front, *rear; //stack void initS() { sp = NULL; } int isEmptyS() { if (sp == NULL) return 1; return 0; ...
ALGO
0.999154
3.513796
{ "github_metadata": { "branch": "master", "commit_count": 95, "repo_created_at": "2019-06-26T10:06:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4018b11cd...
a43af90a-eeef-4e52-ab10-0524af5df3b9
maksym0797/advent_of_code_cpp_2022
advent_of_code_2022_cpp/day_four/day_four.cpp
// // day_four.cpp // advent_of_code_2022_cpp // // Created by <NAME> on 04.12.2022. // #include "day_four.hpp" #include <vector> #include <set> #include <string> #include <iostream> #include <map> #include <iterator> #include <algorithm> #include <sstream> using namespace std; vector<string> get_splited_strings_...
ALGO
0.96921
4.587002
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2022-12-01T12:26: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": "38ff959cd...
726d492b-d8fc-4b9a-a6db-cd7009b33e0c
evangidion/LeetCode-Solutions
20_valid_parantheses.cpp
/* Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be closed in the correct order. Every close bracket has a corresponding open bracket ...
ALGO
0.995232
6.059017
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2024-02-07T14:19: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": "a1893034276...
3aa21bdd-28ca-425b-8f64-afc4921d5aa5
MatteoAlbi/UWBdrone_estimation
EKF/C++/EKF.cpp
#include "EKF.hpp" EKF::EKF(uint N){ if(N < 1) throw invalid_argument("The number of states must be at least 1"); this->N = N; this->X = Matrix(N,1); this->P = Matrix(N,N); } EKF::EKF(uint N, Matrix x, Matrix p){ if(N < 1) throw invalid_argument("The number of states must be at least 1"); ...
ALGO
0.914003
5.768706
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2022-09-29T17:00:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 2, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "b7610c331ee...
72e71bd4-798b-498f-b6fe-512238b9ff42
kisscool-fr/php_botan
Botan-1.8.11/src/engine/def_engine/lookup_hash.cpp
/* * Hash Algorithms Lookup * (C) 1999-2007 <NAME> * * Distributed under the terms of the Botan license */ #include <botan/def_eng.h> #include <botan/scan_name.h> #include <botan/algo_factory.h> #include <memory> #if defined(BOTAN_HAS_ADLER32) #include <botan/adler32.h> #endif #if defined(BOTAN_HAS_CRC24) #inclu...
ALGO
0.966731
6.937097
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2011-07-13T10:05:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "20f910be3...
fb5d1d7d-1060-408a-9cfd-9b2ee71fcacf
xXxSpicyBoiiixXx/OCaml-Work
OTAWA/ex-computation/include/otawa/dfa/XIterativeDFA.h
/* * $Id$ * Copyright (c) 2006 IRIT-UPS * * XIterativeDFA class interface. */ #ifndef OTAWA_DFA_XITERATIVEDFA_H #define OTAWA_DFA_XITERATIVEDFA_H #include <elm/assert.h> namespace otawa { namespace dfa { // XIterativeDFA class template <class V> class XIterativeDFA { V& visit; int size; typename V::domain_t ...
ALGO
0.998135
7.159864
{ "github_metadata": { "branch": "main", "commit_count": 33, "repo_created_at": "2021-02-01T20:26: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": "26b8ffea924...
9a04c857-d27a-4b60-894f-c044b9305278
Xushi8/Code
2024/July/2023niuke3/d2.cpp
#include <bits/stdc++.h> using namespace std; #define int long long const int N = 2010; const int inf = 0x3f3f3f3f3f3f3f3f; int n; int a[N][N]; int op(int f, int num) { int cnt = 0; int b[N][N]; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) b[i][j] = a[i][j]; } ...
ALGO
0.999978
3.788455
{ "github_metadata": { "branch": "main", "commit_count": 690, "repo_created_at": "2022-12-29T08:34: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": "64cecd9119...
1870300d-4d08-4f29-95c5-35e15ad1e0c9
IEEEMOSTAFA/Algo-week-08-Knapsack
Algo-week-08-Module-25-03-Subset-Sum-Code.cpp
/* -state: fun(n,target) -> returns 1 if it is possible to create a subset from numbers 1 to n and from the sum "target" -recarance : fun(n,target) -> fun(n-1, target) OR fun(n-1, target -nums[n]) if target >= nums[n] -base_case: fun(0,target) -> 1 if target...
ALGO
0.999989
4.369968
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-08-05T10:32: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": "4efee3a5b699...
16ed136b-99d1-4706-959b-6830527dd456
dhruvrajsinh-7/CP-SERIES
recursive/constructquadtree.cpp
#include <bits/stdc++.h> using namespace std; class Node { public: bool val; bool isLeaf; Node *topLeft; Node *topRight; Node *bottomLeft; Node *bottomRight; Node() { val = false; isLeaf = false; topLeft = NULL; topRight = NULL; bottomLeft = NULL;...
ALGO
0.999971
4.465502
{ "github_metadata": { "branch": "main", "commit_count": 211, "repo_created_at": "2022-09-22T16:52:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "a77aec07eb...
f5664e92-22a1-4f50-b3eb-b140c53607da
PrincetonUniversity/athena
src/nr_radiation/integrators/rad_integrators.cpp
//====================================================================================== // Athena++ astrophysical MHD code // Copyright (C) 2014 <NAME> <<EMAIL>> // // This program is free software: you can redistribute and/or modify it under the terms // of the GNU General Public License (GPL) as published by the Fr...
ALGO
0.996679
5.102275
{ "github_metadata": { "branch": "main", "commit_count": 5233, "repo_created_at": "2014-05-02T16:11:56.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 270, "forks": 152, "issues": 24, "pull_requests": 4 }, "file_meta": { "content_id": "204e9...
9b462cac-a904-4fcf-b16b-4127cc37e1a6
STEllAR-GROUP/hpx
libs/core/algorithms/include/hpx/parallel/container_algorithms/generate.hpp
// Copyright (c) 2014 <NAME> // Copyright (c) 2014-2023 <NAME> // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) /// \file parallel/container_algorithms/generate.hpp /// \p...
ALGO
0.997724
7.436205
{ "github_metadata": { "branch": "master", "commit_count": 29939, "repo_created_at": "2012-05-26T15:02:39.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2693, "forks": 480, "issues": 124, "pull_requests": 43 }, "file_meta": { "content_id": ...
a80e3e23-0950-4c5a-92bb-acc9dbaee545
Ethan7144/Daily_Coding
design/Logger Rate Limiter/logger.cpp
class Logger { unordered_map<string, int> lastPrinted; public: bool shouldPrintMessage(int timestamp, string message){ if(lastPrinted.count(message) && timestamp - lastPrinted[message] < 10) return false; lastPrinted[message] = timestamp; return true; } } // Now th...
ALGO
0.919512
5.80994
{ "github_metadata": { "branch": "main", "commit_count": 240, "repo_created_at": "2023-10-24T23:31: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": "fa885fde29...
a32db1d9-788c-408f-8155-53d049cece06
spmallick/learnopencv
Hough-Transform/hough_lines.cpp
#include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/opencv.hpp> #include <stdio.h> #include <iostream> using namespace cv; using namespace std; // variables to store images Mat dst, cimg, gray, img, edges; int initThresh; const int maxThresh = 1000; double th1,th2; // create a ...
TOOL
0.915034
4.41597
{ "github_metadata": { "branch": "master", "commit_count": 2579, "repo_created_at": "2015-02-17T08:00:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 22057, "forks": 11720, "issues": 229, "pull_requests": 48 }, "file_meta": { "content_id...
dac4edb7-edf5-45d5-ad57-3c5236c60c48
DGPvvs/AlternativePocker
AlternativePocker/Deal.cpp
#include <iostream> #include "Deal.h" #include "GlobalConstants.h" #include "GamePlay.h" bool DealStart(Player*, Deal*); void DealPlay(Player*, Deal*); void DeterminingWinner(Player*, Deal*); int CalcHalf(int pot) { int half = pot / 2; if ((half % 10) == 5) { half += 5; } return half; } void DisplayPlayer(P...
ALGO
0.967808
3.45887
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2025-01-08T17:14: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": "44eb8f3dd...
e3f4724d-0f47-4d61-aa3b-a04d58666c2b
CSXV/AlgorithmsAndProblemSolving
ProgrammingAdvices/07/07_26.cpp
#include <cctype> #include <iostream> #include <string> using namespace std; // Read an string, then print it in all upper case, and all lower case. void signature() { cout << "\n┏┓╻┏━╸╻ ╻┏━╸┏━┓ ┏━┓┏━╸╺┳╸╺┳╸╻ ┏━╸" "\n┃┗┫┣╸ ┃┏┛┣╸ ┣┳┛ ┗━┓┣╸ ┃ ┃ ┃ ┣╸ " "\n╹ ╹┗━╸┗┛ ┗━╸╹┗╸ ┗━┛┗━╸ ╹ ╹ ┗━╸┗━╸...
ALGO
0.908583
4.456627
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2024-12-20T17:07: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": "2dba2b7cd78...