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
9b179d6a-8003-4194-829f-c310fa67599b
Shbhom/labCode
OOPS_lab/q3_olab3.cpp
//Write a program in C++ to justify the use of default arguments that computes the // simple interest with default rate of interest as 8.5%. #include<iostream> using namespace std; double calcInt(double p, double t, double = 8.5); int main() { double p, t, r, interest; char ans; cout << "Enter principal amoun...
TOOL
0.916863
4.817886
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2022-08-07T04:39:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b62a9f032ae...
6d854d00-b93b-4f76-ba47-9055533ef2a8
tarundecipher/CompetitiveProgramming
C_Long_Jumps.cpp
#include <bits/stdc++.h> #define ll long long int using namespace std; // ll memo[200007]; // ll clc(ll a[], ll k, ll n, bool cond) // { // if (k >= n) // { // return 0; // } // if (memo[k] != 0) // { // return memo[k]; // } // ll a1 = 0; // ll a2 = 0; // if (cond =...
ALGO
0.999974
4.039217
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2021-04-18T05:28:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d9c8224e1259...
3d55ee01-1988-4190-a0d8-b688d1b795ca
kuujhin/24DS-SWEA
0326/minimum_dijkstra.cpp
#include <iostream> #include <vector> #define INFS 987654321 using namespace std; int dijkstra(int start, int N, vector<vector<int>> &map, vector<int> &supply) { vector<int> dist(N + 1, INFS); vector<bool> visited(N + 1, false); for (int i = 1; i <= N; ++i) dist[i] = map[start][i]; while (1...
ALGO
0.999815
4.282232
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2024-03-04T22:51: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": "08c234bf506...
5a569719-982a-4cfd-890b-59a7a015bca6
jailsonevora/leetcode-problem-set
Tree/897.IncreasingOrderSearchTree.cpp
#include<iostream> #include<stack> #include<queue> #include "Util\Include\BuildTreeFromPreOrderArray.h" using namespace std; class Solution { TreeNode* newroot, *curr; void inorder(TreeNode* root, TreeNode*& newNode){ if(!root) return; inorder(root->left, newNode);...
ALGO
0.999992
5.706844
{ "github_metadata": { "branch": "main", "commit_count": 3146, "repo_created_at": "2021-06-04T17:48: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": "437680eaa...
4e1ef742-e3be-475a-b2c9-33e4d0256e9a
rjenez/W266-final-project
data/programming-homework-dataset-plagiarism-detection/src/B2016/Z4/Z1/student4736.cpp
/B 2016/2017, Zadaća 4, Zadatak 1 //Napomena: testovi ce biti dostupni dan pred rok! #include <iostream> #include <utility> #include <cmath> #include <memory> #include <vector> #include <algorithm> using namespace std; typedef std::pair <double, double> Tacka; class Trougao{ Tacka t1, t2, t3; static double u...
ALGO
0.981919
5.249269
{ "github_metadata": { "branch": "main", "commit_count": 125, "repo_created_at": "2022-02-09T00:45:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4100f56f30...
05917720-8807-4f81-9c83-a8c366f4894a
yinglongyhy/scau-code
scau-2/date-structure/8578-顺序表的倒置/a.cpp
#include<stdio.h> #include<malloc.h> #define OK 1 #define ERROR 0 #define LIST_INIT_SIZE 100 #define LISTINCREMENT 10 #define ElemType int typedef int Status; typedef struct { int *elem; int length; int listsize; }SqList; Status InitList_Sq(SqList &L) { // 算法2.3 // 构造一个空的线性表L。 L.elem = (ElemType *)m...
ALGO
0.999942
3.820104
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2018-06-20T13:25: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": "0f71344c5...
2251de69-1bdd-4d2c-a94b-96b122d0ff39
tenick/cp
AdventOfCode/2024/6/6.2.optimized_attempt.cpp
#include <iomanip> #include <iostream> #include <vector> #include <string> #include <cstring> #include <algorithm> #include <numeric> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <cmath> #include <stack> #include <queue> using namespace std; #include <ext/pb_ds/assoc_contai...
ALGO
0.999955
4.212623
{ "github_metadata": { "branch": "master", "commit_count": 104, "repo_created_at": "2024-10-10T14:34:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cd5ba56a...
bded42d8-bc87-4a53-9090-559ab3d32a55
MehediAlamgir/LightOJ-Solved-Code
1133 - Array Simulation.cpp
#include<bits/stdc++.h> using namespace std; /*======================================= Macro Start====================================================*/ #define input freopen("in.txt","r",stdin) #define output freopen("out.txt","w",stdout) #define min3(a,b,c) min(a,min(b,c)) #define max3(a,b,c) max(a,max(b,c)) #def...
ALGO
0.99979
4.04169
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2015-04-25T21:16:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "81861ad261...
25464a26-41af-41cc-88ad-4a855587973f
ishandutta2007/codeforces-l
lebossle/normal/1003/E.cpp
#include <bits/stdc++.h> using namespace std; // This code uses the bossle/cp library // Available at https://github.com/bossle/cp // #pragma STDC FENV_ACCESS OFF // #pragma STDC FP_CONTRACT ON // #pragma STDC CX_LIMITED_RANGE ON // #pragma GCC optimize "O3" namespace cp_base { auto init = ( ios::sync_with_stdio(...
ALGO
0.999938
4.005305
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:17: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": "435e6b90e4bc...
5eb48b7a-a7ba-4d99-90d3-9e7735c5e954
borglab/gtsam
examples/SFMExample_bal_COLAMD_METIS.cpp
/* ---------------------------------------------------------------------------- * GTSAM Copyright 2010, Georgia Tech Research Corporation, * Atlanta, Georgia 30332-0415 * All Rights Reserved * Authors: <NAME>, et al. (see THANKS for the full author list) * See LICENSE for the license information * ------------...
ALGO
0.978696
6.312951
{ "github_metadata": { "branch": "develop", "commit_count": 19360, "repo_created_at": "2017-03-27T17:12:06.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3002, "forks": 845, "issues": 99, "pull_requests": 25 }, "file_meta": { "content_id": ...
293a1eca-6288-468a-991c-39d5a5fb9b7c
greenfox-zerda-sparta/Oszvaldb
week6/day4_vectors/7/t07.cpp
#include <iostream> #include <string> #include <vector> using namespace std; void fill_vector(vector <int>& new_v) { for(unsigned int i = 0; i < new_v.size(); i++) { new_v[i] = rand() % 11; } } void print_vector(vector <int>& new_v) { for(unsigned int i = 0; i < new_v.size(); i++) { cout << new_v[i] << "|"; ...
ALGO
0.950404
4.491057
{ "github_metadata": { "branch": "master", "commit_count": 39, "repo_created_at": "2016-10-19T11:40:10.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c0669b2d62...
4fc2e100-b8f3-426f-9a11-ffd71571b530
Pursottam6003/DSA_Practice
crack_your_internship/Day35/partition_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) {} * }; */ // https://leetcode.com/problems/partition-list/su...
ALGO
0.999983
5.640707
{ "github_metadata": { "branch": "main", "commit_count": 119, "repo_created_at": "2022-12-18T04:44:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "126315800d...
06de5b7b-c914-41ba-88b9-84bd66784dbc
ashuvictor/Leetcode-Solutions
Recursion And BackTracking/Nqueens 2.cpp
The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other. Given an integer n, return the number of distinct solutions to the n-queens puzzle. Input: n = 4 Output: 2 Explanation: There are two distinct solutions to the 4-queens puzzle as shown. clas...
ALGO
0.999973
6.354187
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2022-06-13T15:25: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": "a088ea7b0...
e431e7b8-eff1-4fd0-ab6f-d94e5db10963
JeffersonLab/chroma
lib/update/molecdyn/predictor/mre_initcg_extrap_predictor.cc
#include "chromabase.h" #include "meas/inline/io/named_objmap.h" #include "update/molecdyn/predictor/mre_initcg_extrap_predictor.h" #include "meas/eig/gramschm.h" #include "meas/eig/gramschm_array.h" #include "update/molecdyn/predictor/lu_solve.h" #include "actions/ferm/invert/containers.h" #include "meas/eig/sn_jacob....
ALGO
0.981767
5.843608
{ "github_metadata": { "branch": "master", "commit_count": 12973, "repo_created_at": "2013-08-13T18:20:39.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 65, "forks": 55, "issues": 1, "pull_requests": 12 }, "file_meta": { "content_id": "2a75...
88023b0e-60b9-4892-80d0-f4d22cb2e8e2
Taohid0/Contest-programming-problems-and-graph
bfs (akash)/main.cpp
#include<bits/stdc++.h> using namespace std; vector<int>allch[100]; int adi_node,ses_node,bad_jasse; void bfs(int nodes,int source) { queue<int >Qu; Qu.push(source); int Visited[100]={0}; int level[100]={0}; //int parent[100]={0}; Visited[source]=1; level[source]=0; while(!Qu.empty(...
ALGO
0.999843
3.671537
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-10-28T10:56:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "686dd44664...
07950aed-a192-4476-935b-6e6d96a36417
AnnyQiao/RM-ursawork
src/control/turret/algorithms/turret_gravity_compensation.hpp
/* * Copyright (c) 2020-2021 Advanced Robotics at the University of Washington <<EMAIL>> * * This file is part of aruw-mcb. * * aruw-mcb 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 3 ...
ALGO
0.970326
6.437478
{ "github_metadata": { "branch": "servo--main", "commit_count": 16, "repo_created_at": "2023-06-29T11:07: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": "36aa...
251944cb-0f6f-4d44-85cd-00bfb093fc7e
abdoaligomaa/c-course-Mostafa-Saad
8-stl/medium/3-reverseNumUsingStack.cpp
#include <iostream> using namespace std; #include <stack> int reverse_num(int number) { if (number == 0) return 0; // init stack to store digits stack<int> s; // divide the number into digits and put it into stack while (number) { s.push(number % 10); number /= 10; ...
ALGO
0.999184
4.195876
{ "github_metadata": { "branch": "main", "commit_count": 73, "repo_created_at": "2022-04-19T13:33: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": "16fca9cbb90...
f8306feb-40e6-4c50-b825-ada72329f7ca
hybridNeo/Flint
src/page_rank.cpp
// /* // * Page Rank for the Distributed Graph Processing System // * // * each node has a server which receives input // * // */ #include <fstream> #include <iostream> #include <vector> #include "page_rank_vertex.hpp" #include "sava.hpp" #include <mutex> #include <boost/thread.hpp> #include <boost/algorithm/str...
ALGO
0.999345
4.203679
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-07-31T22:09: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": "c6712cd5a3...
86ab0b0e-921b-47a7-9b6a-ea03103e2d74
millerk22/SLM_code
MBO_core/greedy_cleanup.cpp
#include<algorithm> #include<iostream> #include<fstream> #include<sstream> #include<tuple> #include<vector> using namespace std; struct sparse{ vector<unsigned int> i; vector<tuple<unsigned int,double>> j; }; vector<vector<double>> parse_mat(string name, int thread, unsigned int N) { ifstream mystream(name+"_"...
ALGO
0.999663
3.242551
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2018-07-13T22:37: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": "3acfaeed45...
057ba673-4f1d-4846-89ff-d2f5d3d21499
ashutosh0964/leetocde-solutions
Bipartite Graph - GFG/bipartite-graph.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: bool help(int V,int col,int color[], vector<int> adj[]) { color[V]=col; for(auto it:adj[V]){ if(color[it]==-1){ if(!help(it,!col,color,adj)){ ...
ALGO
0.999884
5.967484
{ "github_metadata": { "branch": "main", "commit_count": 89, "repo_created_at": "2022-10-19T08:39:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5ea64705681...
f8723c36-b00f-4320-a1a0-785d294a0608
camil0palacios/Competitive-programming
solutions/vjudge/cp training/C - Subsequence Hate/solution.cpp
#include <bits/stdc++.h> #define endl '\n' using namespace std; int p[1010]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; while(t--) { string s; cin >> s; int n = s.size(); for(int i = 1; i <= n; i++) { p[i] = p[i - 1] + (s[...
ALGO
0.999977
4.124824
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2018-10-30T16:26: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": "1ab9b3310...
9fa3ade9-f73a-47c6-b475-580337be9248
Argonne-National-Laboratory/PIPS
PIPS-NLP/Core/StochLinearAlgebra/StochVector.h
/* PIPS-IPM * * Author: <NAME> * * (C) 2012 Argonne National Laboratory. See Copyright Notification. */ /* 2015. Modified by <NAME> for NLP*/ #ifndef STOCHVECTOR_H #define STOCHVECTOR_H #include "mpi.h" #include "...
ALGO
0.97482
3.480691
{ "github_metadata": { "branch": "master", "commit_count": 916, "repo_created_at": "2015-10-12T17:32:12.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 77, "forks": 20, "issues": 8, "pull_requests": 4 }, "file_meta": { "content_id": "85656a1...
d7975cb9-a950-4ed5-949b-fe739c4ec3ab
lnxfsf/Cplusplus-files
1/3.cc
//Projektovati klasu sa elementarnim operacijama nad tačkama u ravni (računanje //udaljenosti zadate tačke od koordinatnog početka, rastojanja dvije tačke). U glavnom //programu unijeti podatke za dvije tačke a dati na izlazu koordinate tačke koja je na većem //rastojanju od koordinatnog početka i rastojanje te dvije t...
ALGO
0.996594
4.560989
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-08-31T19:10: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": "8b6361f8fa9f...
85b9fbd3-ff6d-4e33-a92c-c4e6c783931e
liddiard/interview-practice
amazon/full_house.cpp
// An optimal algorithm to check whether a hand of cards was a full house (in Poker) or not. #include <string> #include <iostream> using namespace std; struct Card { int rank; string suit; }; bool full_house(Card hand[5]) { int first_rank = hand[0].rank; int second_rank = -1; int first_rank_co...
ALGO
0.998887
5.035088
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2017-03-26T23:39: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": "06974e9ff2...
1578bb7a-f0ea-45fd-969f-87e0d18b5549
Sunny-Goswami/coding-practice
Leetcode/Strings/Easy/ConsistentStrings.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; class Solution { public: int countConsistentStrings(string allowed, vector<string>& words) { int alpha[26] = {}, res = 0; for (auto ch: allowed) alpha[ch - 'a']++; for(auto &word: words){ ...
ALGO
0.999712
5.196936
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2021-06-07T06:09: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": "8c909e29997...
0d22a194-59de-415d-939f-0b8c36f1c89a
suraj-iitb/algorithm-identification
BERT/Data_Dump/Insertion/C++/Code/insertion4767109.cpp
//挿入アルゴリズム #include<iostream> #include<vector> using namespace std; int main(){ int n; cin >> n; vector<int>A(n); for(int i = 0; i < n; i++){ cin >> A[i]; } //とりあえず表示 for(int i = 0; i < n; i++){ cout << A[i]; if(i!=n-1){ cout << " "; ...
ALGO
0.999979
4.862954
{ "github_metadata": { "branch": "main", "commit_count": 229, "repo_created_at": "2020-05-24T06:21:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 2, "pull_requests": 10 }, "file_meta": { "content_id": "07c231342...
5ed94fbd-b7ab-4b1e-8ff3-ad1438d180a5
devilwolfcsu/opencv-tutorial
image-processing/templateMatching/src/templateMatching.cpp
#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <iostream> #include <stdio.h> using namespace std; using namespace cv; Mat img; Mat templ; Mat result; const char* image_window = "Source Image"; const char* result_window = "Result window"; int match...
ALGO
0.98729
5.950279
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2016-04-13T14:15: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": "711a91101...
70173c6c-2a53-4d90-b5f3-32d2926df881
nitinb/Codes
leetcode/permutation.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: std::vector<std::vector<int> > permute(std::vector<int> &num); }; void print_vector(std::vector<int> gray_codes){ std::vector<int>::iterator it; for(it = gray_codes.begin(); it != gray_codes.end(); it++){ std::cout << *i...
ALGO
0.99991
5.247868
{ "github_metadata": { "branch": "master", "commit_count": 141, "repo_created_at": "2011-05-13T14:32:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a1efc206...
d584ce40-35eb-4f22-a8d9-071972da7e5a
san018/DataStructures
LinkedList/ReverseDLL.cpp
/* QUESTION: - Hackerrank Solution You’re given the pointer to the head node of a doubly linked list. Reverse the order of the nodes in the list. The head node might be NULL to indicate that the list is empty. Input Format You have to complete the Node* Reverse(Node* head) method which takes one argument - the head ...
ALGO
0.999815
5.058642
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2017-07-16T12:41:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2f3eaaa60...
aa0b2e93-a0f3-4eae-9b2f-32a76b7901ec
abhishek0508/cp-algo
BinarySearch/goc1.cpp
// [4,3,3] , 5 // 3.14*4*4 = 50 // 1,1,1,2,2,3 => 3.14+3.14+3.14+12+12+27.13 // while l + 1e-5 <= r: // x = (l + r) / 2 // if possible(x): // l = x // else: // r = x // #include<bits/stdc++.h> using namespace std; int count(double mid, vector<double> arr, int gues...
ALGO
0.999935
3.951158
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2020-09-16T12:21: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": "fbafb86ef...
248a741f-ba5f-4263-9131-31e9189c1529
ansh-d23/Leet-Code
0662-maximum-width-of-binary-tree/0662-maximum-width-of-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.99951
5.408499
{ "github_metadata": { "branch": "main", "commit_count": 1047, "repo_created_at": "2023-11-16T04:46: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": "69f361528...
72092d51-a929-4dee-b852-baeff99b25de
yuji0710/cpp-lep
demo.cpp
#include <iostream> using namespace std; int main() { cout << "how many data you want to enter :- "; int n; cin >> n; int a[n]; cout << "get all data :: \n "; for (int i = 0; i < n; i++) { cout << "enter data :- "; cin >> a[i]; } cout << "\n print all data \n"; f...
ALGO
0.999466
4.063914
{ "github_metadata": { "branch": "main", "commit_count": 60, "repo_created_at": "2023-12-22T14:52: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": "1e738170d67...
086152bc-f42b-4bb9-8362-c3e92637c006
selfboot/LeetCode
Tree/235_LowestCommonAncestorOfBinarySearchTree.cpp
/* * @Author: <EMAIL> * @Last Modified time: 2016-09-20 19:37:23 */ /** * 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: // Easy to understand ...
ALGO
0.999997
6.441097
{ "github_metadata": { "branch": "master", "commit_count": 174, "repo_created_at": "2015-09-14T06:47:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1123, "forks": 318, "issues": 2, "pull_requests": 1 }, "file_meta": { "content_id": "9c9...
19ee649b-0018-42c7-96d0-990c08269e56
madesjardins/Obq_Shaders
src/ldpk/tde4_ldp_radial_decentered_deg_4_cylindric.h
// This file is part of the Lens Distortion Plugin Kit // Software is provided "as is" - no warranties implied. // (C) 2011,2012,2013,2014 - Science-D-Visions. Current version: 1.8.1 #ifndef tde4_ldp_radial_decentered_deg_4_cylindric_sdv #define tde4_ldp_radial_decentered_deg_4_cylindric_sdv #include <ldpk/ldpk_ldp_...
TOOL
0.985694
6.346502
{ "github_metadata": { "branch": "master", "commit_count": 164, "repo_created_at": "2013-03-19T19:47:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 53, "forks": 9, "issues": 5, "pull_requests": 0 }, "file_meta": { "content_id": "67603a0...
25a8fee7-4326-4f3e-877a-9cd3095aec11
dickynovanto1103/CP
Online Judges/CodeChef/Contest/March Challenge 2018 (Div 1)/chefAndEasyProblem.cpp
#include <bits/stdc++.h> using namespace std; #define inf 1000000000 #define unvisited -1 #define visited 1 #define eps 1e-9 #define mp make_pair #define pb push_back #define pi acos(-1.0) #define uint64 unsigned long long typedef long long ll; typedef vector<int> vi; typedef pair<int,int> ii; typedef vector<ii> vii; ...
ALGO
0.999977
4.322336
{ "github_metadata": { "branch": "master", "commit_count": 212, "repo_created_at": "2018-08-22T06:40: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": "03e8b7a4...
0db17943-5dcc-4456-b256-9b99fca8eb95
ydb-platform/ydb
yt/yt/core/concurrency/action_queue.h
#pragma once #include "public.h" #include <yt/yt/core/actions/callback.h> #include <yt/yt/core/logging/public.h> #include <yt/yt/library/profiling/public.h> #include <yt/yt/library/profiling/tag.h> #include <library/cpp/yt/memory/public.h> namespace NYT::NConcurrency { ///////////////////////////////////////////...
TOOL
0.904764
6.604342
{ "github_metadata": { "branch": "main", "commit_count": 35208, "repo_created_at": "2022-02-07T14:52:36.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4512, "forks": 701, "issues": 2263, "pull_requests": 682 }, "file_meta": { "content_id": ...
6dbdfee7-b208-48e6-a782-cce08902efc6
sean-gilliam/codingame
easy/descent/descent.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; /** * Auto-generated code below aims at helping you parse * the standard input according to the problem statement. **/ int main() { int heights[8]; const int N = sizeof(heights) / sizeof(int); // gam...
ALGO
0.999698
3.599797
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2016-07-13T00:23: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": "45360c6fe7...
c6b64d36-857c-41cf-a42b-7908d97e1336
szmer/aburatan
src/path.cpp
// [path.cpp] // (C) Copyright 2000-2002 <NAME> /* 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 option) any later version. * * This program i...
TOOL
0.933758
4.962176
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2017-02-12T20:46:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "73835a6e47...
7f05e41f-d670-4f25-92ff-7d1900a7c58e
Jawadyyy/DSA_CPP
Queues/Queue_Array_Operations.cpp
#include <iostream> using namespace std; class Queue { private: int ray[5]; int front; int back; public: Queue() { front = -1; back = -1; } void enqueue(int x) { if (back == 4) { cout << "Queue overflow" << endl; return; ...
ALGO
0.998727
4.577205
{ "github_metadata": { "branch": "main", "commit_count": 49, "repo_created_at": "2024-08-17T17:01: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": "879890ab420...
4bc17c11-46ea-4573-9cdb-d73627c824ba
SDeLaCruz22/SMT-game-project
2nd Recode (C++)/Map.cpp
/* Since I don't know how else to implement this this will be in ASCII... Cave Village ..-_---_---_---_--+ ..| | | | | | | | | ..| | ..| _ _ _ _| +-| | | | | | | | | |A | +-| _ | | | |E| | | | | | | +-| | |W |M...
TOOL
0.936093
3.367714
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2020-11-26T21:12:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f99ae9d7114f...
02ef33c8-5ae4-49da-9b7d-3b8d56200402
susantabiswas/InterviewPrep
Hashing/Check_Array_Subset.cpp
//given two arrays ,check whether arr2 is a subset of arr1 or not /* 1.can be done using binary search also by sorting the arrays and looking for elements of arr2 in arr1,but it won't handle the case when the arr2 has duplicates 2. using hash */ #include<iostream> #include<vector> #include<map> using namespace s...
ALGO
0.999235
5.743079
{ "github_metadata": { "branch": "master", "commit_count": 42, "repo_created_at": "2018-01-29T17:14:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 32, "forks": 13, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2f71d54...
bfa7153a-a8cd-425a-a8af-537c1e998609
SooinPark1019/PS
백준/Silver/32601. Grocery Greed/Grocery Greed.cc
#include <ext/rope> #include <bits/stdc++.h> #define _USE_MATH_DEFINES //#pragma GCC optimize ("O3") //#pragma GCC optimize ("Ofast") //#pragma GCC optimize ("unroll-loops") #define pii pair<int,int> #define pll pair<ll,ll> #define PB push_back #define fi first #define se second #define all(v) (v).begin(), (v).end() #d...
ALGO
0.999591
3.758666
{ "github_metadata": { "branch": "main", "commit_count": 483, "repo_created_at": "2024-09-01T15:38:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "21482f5a36...
7c9bf786-bfe4-44cc-b278-1ec2063b017d
giann589/Project-C
Programming Project 12.7.cpp
#include <cstdlib> #include <ctime> #include <iostream> using namespace std; /** Merges two adjacent ranges in an array. @param a the array with the elements to merge @param from the start of the first range @param mid the end of the first range @param to the end of the second range */ void merge(int a[...
ALGO
0.999883
5.803473
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-07-12T00:28:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "aace358c127f...
5741efbe-4791-4591-81f2-88fcbe940ea7
skyqinsc/CppPrime
ch17/ex17.11.12.13/main.cpp
/*************************************************************************** * @file main.cpp * @author Alan.W * @date 6 Mar 2014 * @remark This code is for the exercises from C++ Primer 5th Edition * @note ***************************************************************************/ //! ...
ALGO
0.935666
3.708779
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2015-11-03T11:45:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "da36124d3e...
4d9951a1-cf2b-47ef-8da3-3ddb242cda7c
sayeed1999/leetcode-solutions
516-longest-palindromic-subsequence/516-longest-palindromic-subsequence.cpp
class Solution { public: string reverse(string s) { string r = ""; for(int i=0; s[i]; i++) r = s[i] + r; return r; } int longestPalindromeSubseq(string s) { // cbbd // 0000 //d00001 //b00111 //b00122 //c01122 // longest p...
ALGO
0.999987
5.548119
{ "github_metadata": { "branch": "main", "commit_count": 94, "repo_created_at": "2022-05-06T10:05:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "006fc9f186f...
3c2a8d9c-4820-4536-b984-1781d8dd6089
ArifRexa/DSA-and-Algorithm
c program and data structure/prac.cpp
/* WAP that takes n integer numbers, and counts the number of inversions in the array using divide and conquer algorithm in O(nlogn). Two elements a[i] and a[j] form an inversion if i < j and a[i] > a[j]. Sample input Sample output 4 6 1 3 2 4 6 5 6 7 8 0 1 8 In sample 1, the inversions are Index (0,1) -> (6,1) b...
ALGO
0.999898
3.907405
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2023-03-23T08:33: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": "c8d3a9957697...
d12aada5-cf84-4145-9df0-02e1adcaa377
supertuxkart/stk-code
lib/irrlicht/include/irrMath.h
// Copyright (C) 2002-2012 <NAME> // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h #ifndef __IRR_MATH_H_INCLUDED__ #define __IRR_MATH_H_INCLUDED__ #include "IrrCompileConfig.h" #include "irrTypes.h" #include <math.h> #include <float.h> #inclu...
TOOL
0.942929
3.71064
{ "github_metadata": { "branch": "master", "commit_count": 23677, "repo_created_at": "2014-01-15T00:28:54.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4811, "forks": 1110, "issues": 463, "pull_requests": 8 }, "file_meta": { "content_id": ...
d7c5e109-9167-49b8-a744-627181e13b43
akhikolla/testpackages
fuzzedpackages/Rfast/src/partial_sort.cpp
//Author: <NAME> #include <RcppArmadillo.h> #include <R.h> #include <Rinternals.h> #include <algorithm> using namespace Rcpp; using namespace std; using std::greater; using std::sort; using std::nth_element; IntegerVector partial_sort_index(NumericVector x,const int n,const bool descend){ IntegerVector ind=seq(1,...
ALGO
0.99998
6.950147
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2021-01-15T17:42:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b4a3b77193...
be519a04-fefb-45ec-8aa0-ab527848de3c
HISKP-LQCD/LapH_EigSys
include/navigation.h
#include <cstdlib> #include <cmath> #include "par_io.h" #ifndef _NAVIGATION_H_ #define _NAVIGATION_H_ //This Class handles the navigation on each timeslice. Two persistent 2d-arrays are //allocated with the number of 3d points on the lattice. These lookup tables are 3dimensional, //one holds the indices in the upward...
TOOL
0.995032
4.984805
{ "github_metadata": { "branch": "master", "commit_count": 77, "repo_created_at": "2014-08-13T13:18:29.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 2, "issues": 3, "pull_requests": 1 }, "file_meta": { "content_id": "deb7b5df94...
d502ed34-56e9-4f20-b29b-78d09ffd8103
compfire/data_structures
GraphTraversal.cpp
// // Created by danza on 26.10.2016. // #include "GraphTraversal.h" #include <bits/stdc++.h> GraphTraversal::GraphTraversal(int vertices) {} int GraphTraversal::dijkstra_shortest_path_length(vector<vector<pair<int, int>>> &in_graph, int from, int to) { vector<Node> graph(in_graph.size()); bool explored_all ...
ALGO
0.999676
5.185743
{ "github_metadata": { "branch": "dano", "commit_count": 36, "repo_created_at": "2016-09-22T17:53:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e078ae9ba29e...
2663588d-c8f3-4130-b09e-c14f6882570c
Starbow-Break/Problem-Solving
백준/Platinum/18437. 회사 문화 5/회사 문화 5.cc
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <stack> #include <queue> #include <deque> #include <cmath> #define MAX_N 100'000 using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef pair<double, double> dd; struct node { int value, lazy; }; node segT...
ALGO
0.999745
4.69739
{ "github_metadata": { "branch": "main", "commit_count": 1435, "repo_created_at": "2022-11-10T13:00: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": "b65ca483f...
097e6f2c-4d7d-4536-88b4-b5ba7b594a2b
npnkhoi/Competitive-programming
LQDTraining/180713/FASTFOOD.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,n) for (int i = 0; i < n; ++ i) #define FOR(i,a,b) for (int i = a; i <= b; ++ i) #define FORD(i,b,a) for (int i = b; i >= a; -- i) #define debug(x) cerr << #x << ": " << x << "\n" #de...
ALGO
0.999711
3.307014
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2020-04-01T03:31:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e8a302f3a...
94c407d6-bafc-4673-9b7f-45aa647d9f19
rmartinsanta/ac-SFMRFLP
src_c/src/main.cpp
/* * File: Algorithm.cpp * Author: <NAME> */ #include <iostream> #include "algorithm/Algorithm.h" // Global data and random engines bool parallel_enabled = false; Data data; vector<Tengine> vengine; void LoadProperties(const string &pathProperties); void LoadInstance(const string &pathInstance); int main(int...
ALGO
0.999345
5.643981
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2023-03-27T13:26:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1bc7142bc07...
0896ea10-2d55-45f8-b2f2-295cb59be302
GauravJha-Git/CPP
gfg/Matrix/40.cpp
// Problem: Search in a Sorted Matrix // Difficulty: Medium // Given: A strictly sorted 2D matrix mat[][] of size n x m and a number x. // In a strictly sorted matrix: // Each row is sorted in strictly increasing order. // The first element of the ith row (i ≠ 0) is greater than the last element of the (i-1)th row. ...
ALGO
0.999884
6.426056
{ "github_metadata": { "branch": "main", "commit_count": 112, "repo_created_at": "2025-03-18T20:19:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "146a6a0d58...
d4eaf46c-8a79-4863-85ea-1490ec17fbe7
RakshaFauzdar/leetcode_problems
Number of Provinces - GFG/number-of-provinces.cpp
// { Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function Template for C++ class Solution { public: void dfs(int i,vector<bool>&vis,unordered_map<int,vector<int>>&adj) { vis[i]=true; for(auto it:adj[i]) { if(!vis[it]) {...
ALGO
0.999928
6.093204
{ "github_metadata": { "branch": "main", "commit_count": 1684, "repo_created_at": "2022-01-30T13:53:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a05f05229...
2c57351a-ac9b-4583-9f96-a2c285bb8143
UIUC-ChenLab/Chrysalis-HLS
HLS_Bug_Dataset/Vitis_Libraries/zstdLz77DivideStream/Source_Code/zstdLz77DivideStream.cpp
void zstdLz77DivideStream(hls::stream<IntVectorStream_dt<32, 1> >& inStream, hls::stream<IntVectorStream_dt<8, 1> >& litStream, hls::stream<DSVectorStream_dt<Sequence_dt<MAX_FREQ_DWIDTH>, 1> >& seqStream, hls::stream<IntVectorStream_dt<MAX_FR...
ALGO
0.989274
3.681546
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2023-11-02T21:24:04.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 14, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "da85666b6c7...
2eafaab2-fd3b-44a5-9c08-446c7fe89886
tpvt99/gfg-algs
Chapter10.Matrix/SearchColumnAndRowWise/SearchColumnAndRowWise.cpp
// SearchColumnAndRowWise.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> void searchElement(int** matrix, int row, int col, int element); int main() { int** matrix; int row = 4; int col = 4; matrix = new int* [row]; for (int i = 0; i...
ALGO
0.998653
4.877902
{ "github_metadata": { "branch": "master", "commit_count": 234, "repo_created_at": "2020-05-09T04:27:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fdd54f48...
efce7302-fb74-4a30-8ba0-36ccc97ca066
Debopriyasaha/CS-142-LAB-2
lab3_qs2.cpp
#include<iostream> using namespace std; class Node{ public: //Data int data; //Pointer to next Node Node* next; //Constructor that makes ptr to NULL Node(){ next = NULL; } }; //The class of circular linked list class CLL{ public: //Constructing head and tail Node* head; CLL(){ head = NULL; } //In...
ALGO
0.999867
5.285245
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2019-01-12T16:10: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": "d9626e79f1...
33bad04e-e1d5-4c6d-8309-16775e643d28
jholmen/Uintah-sc19
src-rmcrt/CCA/Components/Examples/Poisson1.cc
/* * The MIT License * * Copyright (c) 1997-2018 The University of Utah * * 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 * right...
ALGO
0.994048
5.935973
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2021-04-19T23:29: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": "5ce8c08c7...
1ee5c6be-1b51-4d2d-8db9-5f9f6f7a5cf2
RJ-Mitra/Programming101_CPP
maxSumOfLabelValues.cpp
/* Two arrays are given -> labels and values. Each index of labels has an integer number as the category and the corresponding index of the values array has the value for that label. E.g. labels = 1,2,2,3,1 values = 7,9,2,5,6 where the values under label one are 7 and 6. Also given are max_limit (limit of usage of...
ALGO
0.999985
5.476921
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2020-06-28T13:55:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ec523d9e81...
942a5fa1-51b9-4787-a1bb-0b361f748c4d
Pawlo77/IT-Olympiad
data_structures/arrays/examples/missing.cpp
/* missing number in an array given array of size n - 1 with numbers from range 1 to n (each one exacly once). Find the missing number */ // solution 1 - requires additional space int MissingNumber(vector<int>& arr, int n) { vector<bool> present(n, 0); for (int i = 0; i < n - 1; i++) present[arr...
ALGO
0.999738
4.839634
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2021-08-29T12:37: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": "05c54b5934...
e54ef0b2-d7f0-4bef-9bbd-beb531484311
abhiXsliet/DSA-Busted-A-Complete-CPP-DSA-Series
Lecture 131 DP Day-30/bestTimeToBuyAndSellStock-II.cpp
//https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/ #include<bits/stdc++.h> using namespace std; class Solution { //Time Complexity => O(2^n); //Space Complexity => O(n) -> space of recursive call stack int solveRec(vector<int>& prices, int start, int end, int flag) { //base case ...
ALGO
0.999919
5.535967
{ "github_metadata": { "branch": "main", "commit_count": 140, "repo_created_at": "2023-06-20T19:09:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 9, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "784e0fd87b...
456c5c50-3365-48b2-b4b7-9003a876d23b
youshu3008/LeetCode_C_Plus_Plus
234#S#palindrome-linked-list.cpp
#include <iostream> #include <vector> #include <unordered_map> #include <algorithm> using namespace std; 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) {} }; cl...
ALGO
0.999957
5.509531
{ "github_metadata": { "branch": "main", "commit_count": 57, "repo_created_at": "2024-02-05T17:39: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": "92d39ae513c...
89d9ee9f-62f3-42b0-af5a-3b2a2b79b497
Aishwarya7902/DAILY-LEETCODE-CHALLENGE
DECEMBER/18th dec__739. Daily Temperatures Medium.cpp
PROBLEM:https://leetcode.com/problems/daily-temperatures/description/ VIDEO:https://www.youtube.com/watch?v=ZhZEmGv-sOY /* brute force tc:O(n^2) sc:o(1) */ class Solution { public: vector<int> dailyTemperatures(vector<int>& temperatures) { //initialize a vector to store the ans vector<int>ans; //r...
ALGO
0.999894
6.008167
{ "github_metadata": { "branch": "main", "commit_count": 461, "repo_created_at": "2022-10-01T09:50:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a5a8dec64c...
2f3fc46b-3f01-48f3-b5e8-e0c134e1c34d
ishandutta2007/codeforces-nonalphabetic
0wuming0/normal/1557/E.cpp
#include"bits/stdc++.h" using namespace std; int pos[10][10]; void add(int &x,int &y,int X,int Y,multimap<int,pair<int,int> >&mp,int val) { if(X>=1&&X<=8&&Y>=1&&Y<=8&&(x!=X||y!=Y)&&(x==X||y==Y||x+y==X+Y||x-y==X-Y)) { mp.insert(make_pair(val,make_pair(X,Y))); } } void solve() { for(int i=1;i<=8;i...
ALGO
0.999755
3.964206
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:49:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8cd2cac1da3d...
29118990-2dac-4311-a49d-90a844571eef
adityarev/online-judge
TLX/COMPFEST 11 - Final CPC Junior/C.cpp
#include <algorithm> #include <cstdio> #include <functional> #include <vector> #define gc(x) getchar_unlocked(x) #define pc(x) putchar_unlocked(x) #define endline pc('\n') struct FastIO { int getnumb() { int c = gc(); int val = 0; for (; c < 48 || c > 57; c = gc()); for (; c > 47 && c < 58; c = gc()) ...
ALGO
0.999973
3.688109
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2020-03-19T17:08: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": "8145ee367...
c5cb50ae-5df3-45b7-843d-aed91a062b2d
TheSaw/topcoder
Aaagmnrs.h
#ifndef TOPCODER_AAAGMNRS_H_ #define TOPCODER_AAAGMNRS_H_ #include <algorithm> #include <string> #include <vector> class Aaagmnrs { public: std::vector <std::string> anagrams(std::vector <std::string> phrases); private: bool isAnagram(std::string s1, std::string s2); void removeSpaces(std::string &s); };...
ALGO
0.998434
4.453833
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2016-01-05T09:07: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": "37a2ab945...
8d1fb24a-97dd-48e9-a15c-9e1503a2f304
samjwu/OpenKattis
A Different Problem/different.cpp
#include <algorithm> #include <iostream> #include <string> #include <vector> int main() { std::string a, b; while (std::cin >> a >> b) { int n = a.length(); int m = b.length(); if (m > n || (m == n && b > a)) { std::swap(a, b); std::swap(m, n); } ...
ALGO
0.99999
5.579665
{ "github_metadata": { "branch": "master", "commit_count": 601, "repo_created_at": "2020-10-10T05:07:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "25520b87...
43c8603f-efe9-4608-83db-be1cf8554ab6
liyiji/LeetCode
060_Validate_Binary_Search_Tree.cpp
/* * Validate Binary Search Tree * Total Accepted: 12943 Total Submissions: 50908 * * 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 subt...
ALGO
0.999978
5.948691
{ "github_metadata": { "branch": "master", "commit_count": 226, "repo_created_at": "2014-06-02T13:12: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": "c5948474...
b3d2daa9-cec4-4b8d-ba39-87798dcc6275
mbfilho/icpc
codeforces/B - Sereja and Tree.cpp
#include <cstdio> #include <cstring> #include <algorithm> #include <vector> #include <list> #include <cmath> using namespace std; #define fr(i,a,b) for(int i = a; i < b; ++i) #define rep(i, n) fr(i,0,n) #define pb push_back typedef pair<int,int> pii; #define mp make_pair struct S{ int l, r, x; }; vector<S> tree[8000]...
ALGO
0.999629
3.550075
{ "github_metadata": { "branch": "master", "commit_count": 835, "repo_created_at": "2016-02-27T01:54: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": "7a918f9b...
6b1901a2-8fa1-45e2-98be-86d263f740c2
EPCCed/gpu-directives
advanced_topics/interop/rocm/matrix_matrix/rocm_omp.cpp
// Try to compute the matrix product C = A * B // B : N x M matrix // A : K x N matrix // C : K x M matrix #include <random> #include <iostream> #include <omp.h> #include <rocblas/rocblas.h> void set_random_matrix(double * A, size_t N, size_t M,std::mt19937 &rd) { std::uniform_real_distribution<double> dist(0, 1...
ALGO
0.999184
5.240408
{ "github_metadata": { "branch": "master", "commit_count": 119, "repo_created_at": "2024-06-26T15:45:04.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 4, "issues": 14, "pull_requests": 0 }, "file_meta": { "content_id": "087771f8...
ff0b0a6c-7368-46a1-82ee-849c8f1481d6
greatjourney/AOJ
priority_queue/priority_queue.cc
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for(int i = 0; i < n; i++) #define REPR(i, n) for(int i = n; i >= 0; i--) #define FOR(i, m, n) for(int i = m; i < n; i++) #define ANS(ans) cout << ans << endl #define FLG(flg) if(flg) cout << "Yes" << endl; else cout << "No" << endl; #define YES cout << "...
ALGO
0.998998
3.881188
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2019-10-08T07:14: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": "a2088a3735...
b15027f5-3afa-46fb-aff5-9f085dc68740
DANDROZAVR/uj-first-year
Methods_of_programming/S/main.cpp
#include <iostream> #include <stack> #include <vector> #include <random> std::mt19937 gen(123); class Solver { public: int n, k; std::vector <int> arr; void median(int &x1, int &x2, int &x3, int &x4, int &x5) { bool changed = true; while(changed) { changed = false; if (x1 > x2) { ...
ALGO
0.999959
5.181291
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2021-07-19T08:08:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "340a7ee0a2...
c567fbd6-e925-428b-8ea7-8a66ae541a00
p-adic/Mathematics
Combinatorial/ZetaTransform/MahlerTransform/a_Body.hpp
// c:/Users/user/Documents/Programming/Mathematics/Combinatorial/ZetaTransform/MahlerTransform/a_Body.hpp #pragma once #include "a.hpp" template <int N_max> inline MahlerTransform<N_max>::MahlerTransform( const int& p ) : m_p( p ) , m_fact() , m_fact_inv() , m_inv() { static_assert( 0 < N_max ); assert( N_max ...
ALGO
0.997808
5.03373
{ "github_metadata": { "branch": "master", "commit_count": 2368, "repo_created_at": "2019-12-14T13:17:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "88b4189...
7aa83354-3620-4589-b532-b099621b97db
ADSWT518/PAV-assignments
assignment1/hw1p2.cpp
#include <chrono> #include <cmath> #include <cstring> #include <iostream> using namespace std; const int arraySize = 10000000; int ConstantFolding(int param) { char arr[10000]; int a = 0x107; int b = a * sizeof(arr); int c = sqrt(2.0); return a * param + (a + 0x15 / c + strlen("Hello") * b - 0x37...
ALGO
0.981094
3.378815
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2022-06-23T13:00:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "84ce478fcc4d...
0f5dcf29-a61c-4e17-b1fe-8bea1f880170
mfem/mfem
fem/tevaluator.hpp
// Copyright (c) 2010-2025, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // // This file is part of the MFEM library. For more information and source code // availability visit ht...
ALGO
0.913617
6.744422
{ "github_metadata": { "branch": "master", "commit_count": 24273, "repo_created_at": "2015-06-11T21:42:21.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1934, "forks": 544, "issues": 96, "pull_requests": 189 }, "file_meta": { "content_id": ...
40ae1095-9d6c-48f4-84c7-9011d5d61027
riemannsBeard/cppns
src/nonlin1d.cpp
#include "nonlin1d.h" using namespace std; void nonlin1d() { int nx = 41; double dx = 2/(double (nx)-1); int nt = 20; double dt = .025; Eigen::ArrayXd u(nx); u.setOnes(nx); // Set ones everywhere u.block(.5/dx,0,1/dx+1-.5/dx,1) = Eigen::ArrayXd::Constant(1/dx+1-.5/dx,1,2); // Starting conditions E...
ALGO
0.999582
4.46037
{ "github_metadata": { "branch": "master", "commit_count": 52, "repo_created_at": "2016-05-25T10:54:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "156ff2a3c...
f4d7c8e8-1715-40ca-96fc-9d12fd6236c0
20sw084/Cpp-Projects
Tic_Tac_Toe.Cpp
// Tic Tac Toe Game in C++ //Made By: <NAME> //Roll No: 20SW084 #include<graphics.h> #include<iostream> #include<stdlib.h> using namespace std; char square[10] = {'o','1','2','3','4','5','6','7','8','9'}; //For Position of Elements //at which game play...
ALGO
0.996378
3.925149
{ "github_metadata": { "branch": "main", "commit_count": 56, "repo_created_at": "2021-06-09T19:21: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": "98215c2fda5...
5a0201b6-77d4-4f51-a31b-c184d4031bb1
darrentimotius/datStruct
exercise/quiz2TI20/minHeap.cpp
#include <stdio.h> #include <string.h> #define MAX 1000 struct Node { char taskName[35]; int urgencyScore; }; Node heap[MAX]; int heap_size = 0; void swap(Node* a, Node* b) { Node temp = *a; *a = *b; *b = temp; } int parent(int i) { return (i - 1) / 2; } int leftChild(int i) { return 2...
ALGO
0.999957
5.028928
{ "github_metadata": { "branch": "main", "commit_count": 63, "repo_created_at": "2025-01-06T01:43:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f55e2aaca1c...
3205105e-d060-422e-861c-a72410a88125
TajwarSaiyeed/problem-solving-codechef-leetcode-codechef
27-6-2024/A. Vasya the Hipster.cpp
/* Author: <NAME> Date: 2024-06-27 22:41:23 File: A. Vasya the Hipster.cpp */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; template <typename T> using pbds = tree<T, null_type, less<T>, rb_tree_tag, tr...
ALGO
0.999957
5.219112
{ "github_metadata": { "branch": "main", "commit_count": 337, "repo_created_at": "2024-03-11T01:27: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": "e4925b744a...
19dde6cc-e344-4cd5-8664-df690882bc06
ofelt/klondikebattle
patsolve/clocksolver.cpp
/* * 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 option) any later version. * * This progra...
ALGO
0.997028
4.797373
{ "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": "d87c5e6fe4...
83a6cf4f-4c1e-4b16-a3ca-151e61c2a5db
OxDuke/Bilevel-Planner
third_party/mosek/9.0/tools/examples/fusion/cxx/portfolio_1_basic.cc
/* File : portfolio_1_basic.cc Copyright : Copyright (c) MOSEK ApS, Denmark. All rights reserved. Description : Implements a basic portfolio optimization model. */ #include <iostream> #include <fstream> #include <iomanip> #include <string> #include "monty.h" #include "fusion.h" using namespace mosek::fusi...
ALGO
0.999491
6.161516
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2019-05-07T18:14:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 39, "forks": 10, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "1edda4d...
73847daf-e6ad-4d0b-bb73-2c4cfddcdf99
5763666/Oqueue
Oqueue/main.cpp
#include <stdio.h> #include <stdlib.h> #define MAX_QUEUE_SIZE 5 typedef int element; typedef struct { element data[MAX_QUEUE_SIZE]; int front, rear; } QueueType; void error(char* message) { fprintf(stderr, "%s\n", message); exit(1); //[juht] } void init_queue(QueueType* q) { q->front = q->rear = 0; } int is_em...
ALGO
0.998247
3.846265
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2023-05-03T14:39: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": "a6e01dcb9b...
292d4f9e-447e-4663-8948-1af81e97954c
ciahciach/FMSearch
main.cpp
#include <iostream> #include <fstream> #include <math.h> #include <iomanip> #include <windows.h> #include <time.h> using namespace std; int iloscStacji() { int ilosc_stacji=0; string line; ifstream plik2("fm.txt"); if(plik2.good()==false){return 0;} while (getline(plik2,line)) { ilosc_sta...
ALGO
0.995474
3.142197
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2019-04-14T07:58: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": "55fb8b98fe...
49e7691e-9afd-485b-b5ce-db97d10e8dff
yashmwani/Shortest-Path-Timing
gates.cpp
#include <iostream> #include <limits> #include <queue> #include <set> #include <vector> #include <map> std::map<std::string, std::vector<std::pair<std::string, int>>> createAdjacencyList(const std::map<std::pair<std::string, std::string>, int>& weightedEdges) { std::map<std::string, std::vector<std::pair<std::stri...
ALGO
0.999966
6.134148
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2025-03-25T15: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": "93507d826e...
5ad90f9f-5872-4510-b335-578ad5748aef
alpeshjamgade/algorithms
dp/A.01knapsack/d.count-subsets-with-given-sum.cpp
#include <bits/stdc++.h> #define ll long long #define ld long double #define fi first #define se second #define pi 3.1415926535 #define mod1 1000000007 #define mod2 1000000009 #define mp make_pair #define no_of_digits(n) floor(log10(n)) + 1 #define lcm(a, b) (a/__gcd(a,b)*b) #define sdebug(n) cout << "\n' n = " << n <...
ALGO
0.999776
3.575076
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2020-06-20T00:40:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "20f654b3c6...
e69fa761-9d28-446c-b791-afbd9af0410d
Agma-Schwa/Prescriptivism
src/Shared/TCP.cc
#include <Shared/TCP.hh> #include <base/Base.hh> #include <cerrno> #include <cstring> #include <functional> #include <memory> #include <print> #include <span> #include <vector> // ============================================================================= // Linux // ==============================================...
TOOL
0.900621
4.515083
{ "github_metadata": { "branch": "master", "commit_count": 274, "repo_created_at": "2024-10-30T21:51:48.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 2, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "867e29b2b...
4e4a3ce3-9482-42b3-9361-1087ca9527ed
PowerNeverEnds/BaekjoonOnlineJudge_Cpp
16000~16999/16953_A → B.cpp
#include <iostream> #include <vector> #include <queue> typedef long long ll; #define MAX ((int)1e9+7) using namespace std; struct MyStruct { ll n; int c; }; void push(queue<MyStruct>& q, vector<MyStruct>& visited, MyStruct st, bool bOper, ll oper) { if (bOper == true) { visited.push_back(MyStruct({ oper,st.c...
ALGO
0.999961
3.653429
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2020-12-25T01:47: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": "729f7223e5...
19781cab-e80d-4cfb-9ed3-a97350a55e85
wakatakerutmt/atcoder
ABC160/D/main.cpp
#include <bits/stdc++.h> using namespace std; //using ll long long; //#define int long long; #define rep(i,n) for (int i = 0; i< (n); ++i) const int INF = 1001001001; // 最短経路問題のアルゴリズム Nを頂点数 Mを辺数 N<=M として考える 使う場面 // BFS : O(N+M) = O(M)      : 辺のコストが全部1 // ダイクストラ : O(N+MlogM) =...
ALGO
0.999967
4.821564
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2020-03-28T11:19: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": "e4742472d...
1295419e-d4ff-4a16-b94b-7053456821d5
rootlyt/KeamananKomputerAlgoritma
KKA_Aziz_ColumnarTransposition/KKA_Aziz_ColumnarTransposition.ino
int i,j,k,x,y,z; //deklarasi variable integer String keyword = ""; //deklarasi variable string String plaintext = ""; //deklarasi variable string void logiProses(){ //deklarasi method //Fungsi dibawah ini untuk menyusun tabel dari keyword int x; //deklarasi variable integer int y = keyword.length(); //deklara...
ALGO
0.99993
3.394722
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2020-10-19T19:34:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f49559dd6b1e...
d37283f3-e9c3-4cb4-ad5f-6ffaae9784c7
ybora/EE312
Project7/Project7.h
#ifndef PROJECT7_H #define PROJECT7_H #include "String.h" #include "Parse.h" #include <iostream> #include <vector> #include <map> using namespace std; /* * [NAME] operate * [Brief] performs a mathematical operation on the given operands * [Returns] int: the result of the operation * [IN] String op: the operator ...
ALGO
0.989469
5.191476
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2017-12-01T08:28: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": "5a5fb1b47...
452f6663-ba7a-41d9-b180-c7dcd8236df7
vishnu0179/Competitive
CodingPlatform/Codeforces/Flowers.cpp
// https://codeforces.com/problemset/problem/474/D #include <bits/stdc++.h> #define mod 1000000007 using namespace std; typedef long long ll; int pre[100001]; int dp[100001]; int k; int getAns(int n) { if(n==0) return 1; if(dp[n] != -1) return dp[n]; // For white int ans = 0; if(n...
ALGO
0.999936
4.646312
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2020-11-02T11:11: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": "a48625e5b...
fbca5e7c-f592-416e-836b-e82f3611a196
BSchotanes/AuroraFlux
AuroraFlux/Source/Collision/Physics.cpp
/*********************************************** * Filename: Physics.h * Date: 11/20/2012 * Mod. Date: 11/29/2012 * Mod. Initials: AQ * Author: <NAME> * Purpose: This is a basic helper class that * does more complicated math functions * that don't deal with collsion directly ***************...
TOOL
0.965778
3.505305
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-10-04T22:55: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": "4367ae361e...
104d348b-6372-48d4-9c6b-38706e4ffd71
prateekstark/Coding
Projects/Coding/Facebook Interview/coloringBlock.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; string ltrim(const string &); string rtrim(const string &); vector<string> split(const string &); int findMinIndex(vector<int> v){ int index = 0; for(int i=0;i<v.size();i++){ if(v[index] > v[i]){ index = i; } } ...
ALGO
0.999015
3.751463
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-09-12T08:06: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": "4b9832a70c...
8c81bb7c-fb28-499d-b378-ed1da9281d63
tancredegorand/Prog-algo2
TP1/exo6.cpp
#include <iostream> using namespace std; struct Noeud{ int donnee; Noeud* suivant; }; struct Liste{ Noeud* premier; }; struct DynaTableau{ int* donnees; int nombre_val; int capacite; }; void initialise(Liste* liste) { liste->premier = nullptr; } bool est_vide(const Liste* l...
TOOL
0.966962
3.60963
{ "github_metadata": { "branch": "master", "commit_count": 71, "repo_created_at": "2023-02-10T07:45: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": "aa866a7fa...
ec34fac6-63c0-4aeb-95b4-ee83d6c484af
nekphung/demo
NHOM4/B1.cpp
#include <iostream> struct Node { int data; Node* next; Node(int val) : data(val), next(nullptr) {} }; // Hoanvi2node function void Hoanvi2node(Node*& head, Node*& p, Node*& q) { if (p == head) { head = q; } else { Node* prev = head; while (prev->next != p) { ...
ALGO
0.999998
5.67376
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2025-03-29T11:54: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": "12d2799d8b...
5db2a81c-55fb-42d8-9eda-c4b97265970b
RaedAbdelkefi/Problem-Solving
C. Watchmen.cpp
#include <iostream> #include <bits/stdc++.h> #define ll long long using namespace std; bool compare(pair<ll,ll> p1,pair<ll,ll>p2) { return p1.second < p2.second; } ll fact(ll n) { if (n==0) return 1; return n*fact(n-1); } ll combunational(ll n) { return n*(n-1)/2 ; } int main() { ios::...
ALGO
0.999771
3.845937
{ "github_metadata": { "branch": "main", "commit_count": 38, "repo_created_at": "2023-10-05T15:52: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": "2d82df01ea7...
3290dcf2-46c1-4d86-9040-d7033d7f9913
Istahak/CFsolution
D_Ones_and_Twos.cpp
#include <bits/stdc++.h> #define ll long long int using namespace std; #ifndef ONLINE_JUDGE #include "debug.h" #endif template <class T> class BIT { public: int n; vector<T> f; BIT(int n) : n(n) { f.resize(n + 1, (T)0); } BIT(const vector<T> &a) { // O(n) n = a.size(); ...
ALGO
0.999909
4.299442
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2023-07-20T14:03:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "ac3a80cb50...
ee39a081-1346-4fd3-b0af-9836373f18d6
dipta007/Competitive-Programming
Toph/uap intra 2018/B.cpp
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iostream> #include <iomanip> #include <iterator> #include <list> #include <map> #include <numeric> #include <queue> #includ...
ALGO
0.999173
3.435367
{ "github_metadata": { "branch": "master", "commit_count": 78, "repo_created_at": "2016-03-27T22:30:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9c5b8e602...
11d6044b-1760-4643-b6c6-563f5f091834
AMIRIOX/MyLuoguRepo
contest/CFE#173-div2/C.cpp
#include <algorithm> #include <bits/stdc++.h> using namespace std; using ll = long long; void solve() { int n, p = 1; cin >> n; vector<ll> a(n + 1, 0); vector<ll> pre(n + 1, 0); for (int i = 1; i <= n; i++) { cin >> a[i]; if (abs(a[i]) - 1) p = i; pre[i] = pre[i ...
ALGO
0.999961
4.585845
{ "github_metadata": { "branch": "master", "commit_count": 458, "repo_created_at": "2020-07-11T06:47:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "faf7f0d8...