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
7099ae18-03da-4310-8cec-931e709b2396
sugaliudaykiran/Cpp
gfg_cpp/LRU_Cache_Design.cpp
/* LRU Cache Design Ref :- https://www.geeksforgeeks.org/lru-cache-implementation/ ** Cache is memory which is closly to cpu and takes less access time.. but small in size compare to RAM.. ** LRU is least recent used.. it is by temporay locatate.. ** In this we add new item as most rece...
ALGO
0.999241
5.547031
{ "github_metadata": { "branch": "master", "commit_count": 71, "repo_created_at": "2021-12-09T15:16:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "324544069...
61e639b4-0cbd-4713-bdb0-6e71cb671077
rs2353/team27
Code/Lab 3/lab3_drive_code_new.ino
#include <Servo.h> #define LOG_OUT 1 // use the log output function #define FFT_N 256 // set to 256 point fft #include <FFT.h> // include the library #include <SPI.h> #include "nRF24L01.h" #include "RF24.h" //#include "printf.h" Servo servoL; //instantiate servos Servo servoR; unsigned int sensor_...
ALGO
0.998836
4.636305
{ "github_metadata": { "branch": "master", "commit_count": 578, "repo_created_at": "2018-08-31T16:23:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "15300899...
bd50a813-fb57-4a88-977a-e2d2cc93e879
seongwonjung/WinterVacationAlgorithmStudy
SeongWon/Baekjoon/2798_블랙잭.cpp
#include <iostream> #include <vector> using namespace std; int main(){ int n, m, max_sum = 0; cin >> n >> m; vector<int> cards(n); for(int i = 0; i < n; i++){ cin >> cards[i]; } for(int i = 0; i < n-2; i++){ for(int j = i+1; j < n-1; j++){ for(int k = j+1; k < n; k++)...
ALGO
0.999987
4.643367
{ "github_metadata": { "branch": "main", "commit_count": 377, "repo_created_at": "2024-12-26T07:03: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": "a1112b0942...
22b6b8c4-092a-4f59-8808-1bccb0907f04
i-am-arvinder-singh/CP
SPOJ-(Odd cycle detection algo)-Bipartitie Graph-A bug's Life.cpp
#include<bits/stdc++.h> using namespace std; #define endl "\n" #define int long long #define ff first #define ss second #define fl(i,a,b) for(int i=a; i<b; i++) #define bfl(i,a,b) for(int i=a-1; i>=b; i--) #define pb push_back #define mp ...
ALGO
0.999863
4.500141
{ "github_metadata": { "branch": "master", "commit_count": 113, "repo_created_at": "2020-05-25T21:25:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3d771419...
a066c0dc-bdc2-42e2-8079-8b37bed521c8
shubhamberiwal/Problem-Solving-DSA
Linked List/linkedlist_5.cpp
#include<bits/stdc++.h> 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*a) : val(x), next(a){} }; listnode* reverse(listnode * head){ listnode* newhead= NULL; while(head...
ALGO
0.999977
5.168724
{ "github_metadata": { "branch": "main", "commit_count": 78, "repo_created_at": "2021-09-09T16:10:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0932f2c8838...
6a54365a-286e-4f75-aff6-5873bbb19492
yt5tBdsw/RFSE
src/MakeSCG.cpp
#include "MakeSCG.h" MakeSCG::MakeSCG(const int nOSt, const int numOfSignals) { numOfStates = nOSt; limitOfBranches = min(numOfStates, numOfSignals); matrix.resize(numOfStates, vector<int>(numOfStates, 0)); head = -1; make(); } // For output bool MakeSCG::nextSCG() { ++head; const int size = scgs....
ALGO
0.999302
3.794499
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2016-03-19T03:46: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": "5972dcb79d...
307007ec-37eb-4898-b32c-99a826d5a5cd
EvgeniaKomleva/Contest_2sem
XOR_new/main.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; void build ( int *a, int *t, int v, int tl, int tr ) { if (tl == tr) {t[v] = a[tl];} else { int tm = (tl + tr) / 2; build (a,t, v*2, tl, tm); build (a,t, v*2+1, tm+1, tr ); t[v] = t[v*2] ^ t[v*...
ALGO
0.999978
5.161726
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2018-07-21T15:35:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "96c20c3fc0...
dcc3370e-c317-4d66-99f8-470f4d5cdd58
AleksandraBerezikova/long-arithmetic
main.cpp
#include <iostream> #include "long_int.hpp" int main(int argc, char *argv[]) { if (argc != 3) { std::cout << "Usage: " << argv[0] << " first_number second_number\n"; return 1; } std::string first_number, second_number; first_number = argv[1]; second_number = argv[2]; LongI...
TOOL
0.909004
4.582242
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2023-05-03T12:12: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": "e6f4c15781a7...
13e23df6-4411-4d08-9465-983f4e978475
efm95/Hamming-mixture-model
code/hyperg2.cpp
// [[Rcpp::depends(RcppGSL)]] #include <RcppGSL.h> #include <iostream> #include <gsl/gsl_sf_hyperg.h> #include <cmath> using namespace Rcpp; // [[Rcpp::export]] double norm_const2(const double d ,const double c, const double m,const bool log_scale=false){ double z= (m-1)/m; double alpha= d+c; double beta=1; ...
ALGO
0.999103
4.830905
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2022-11-04T09:56:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5d33b46ed...
2edeef91-bcac-4383-bc71-2f0422c84d72
Realitian/Voxel-Compression
ssvodag/sl-7.8.2-Source/src/sl/primitive_sampler.hpp
//+++HDR+++ //====================================================================== // This file is part of the SL software library. // // Copyright (C) 1993-2014 by <NAME> (<EMAIL>) // Copyright (C) 1996-2014 by CRS4 Visual Computing Group, Pula, Italy // // For more information, visit the CRS4 Visual Computing G...
ALGO
0.90809
6.574112
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2021-12-20T18:49:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f6aeafecd4...
e30a8d28-6115-406b-ba2d-3e1409dc8ae0
LutzGross/esys-escript.github.io
trilinos_source16/packages/rol/src/utils/ROL_Fejer2Quadrature.hpp
// @HEADER // ************************************************************************ // // Rapid Optimization Library (ROL) Package // Copyright (2014) Sandia Corporation // // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive // license for use of this work by or on be...
ALGO
0.977716
6.205044
{ "github_metadata": { "branch": "master", "commit_count": 5724, "repo_created_at": "2020-08-10T02:31:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 34, "forks": 15, "issues": 63, "pull_requests": 0 }, "file_meta": { "content_id": "a645...
82b4d391-5fb9-4857-8922-d7383661cb43
Gidi233/c
algorithm/LeetCode/206.cpp
class Solution { public: ListNode *reverseList(ListNode *head) { if (head == nullptr) return nullptr; if (head->next == nullptr) return head; ListNode *last = head; ListNode *node = head->next; ListNode *next = head->next->next; last->next ...
ALGO
0.999858
5.64426
{ "github_metadata": { "branch": "main", "commit_count": 205, "repo_created_at": "2023-05-16T12:56:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f1d889c374...
a8584753-c7ff-41ee-9458-17901dd9a0a5
TheLifeFruit/WordleSolver
src/FeedbackStrategy.cpp
#include "../include/FeedbackStrategy.h" #include <vector> #include <string> /** * @brief Calculates the feedback for a guess compared to the solution. * @param guess The guessed word. * @param solution The solution word. * @return A vector of Feedback enums for each letter. */ std::vector<Feedback> FeedbackStrat...
ALGO
0.999536
5.966125
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2025-07-14T17:05:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "64dc284847...
fc9d14b3-88b3-4f8b-bafa-387074138f9e
haoel/leetcode
algorithms/cpp/insertDeleteGetRandom/InsertDeleteGetrandomO1DuplicatesAllowed.cpp
// Source : https://leetcode.com/problems/insert-delete-getrandom-o1-duplicates-allowed/ // Author : <NAME> // Date : 2016-08-25 /*************************************************************************************** * * Design a data structure that supports all following operations in average O(1) time. * Note...
ALGO
0.971498
6.340661
{ "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": ...
eeb7f6a2-6cfa-4c21-9c5f-972165f8801a
SZHELTOVS/Duck
Duck/Duck.cpp
#include <iostream> #include <fstream> #include <string> #include <cstdlib> #include <ctime> #include <iomanip> #include <vector> #include <filesystem> using namespace std; // Функция для генерации случайного пароля string generatePassword(int length) { const string CHARACTERS = "abcdefghijklmnopqrstuvwxyzABCDEFG...
TOOL
0.91571
3.69849
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2023-06-23T06:19:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c7a4225db...
c031655f-b28c-4c80-a620-a832af44bccb
nekkomoe/code
codeforces/1131C.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1100; int n, a[N]; int ans[N], top; int main() { scanf("%d", &n); for(int i = 1 ; i <= n ; ++ i) { scanf("%d", &a[i]); } sort(a + 1, a + 1 + n); ans[1] = a[1], ans[2] = a[2]; for(int i = 3 ; i <= n ; ++...
ALGO
0.999998
3.393135
{ "github_metadata": { "branch": "master", "commit_count": 226, "repo_created_at": "2018-02-27T02:33:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "978bc6c...
ff76d1f1-206a-45f5-9f1c-bed0d58fdd8b
stan-dev/math
stan/math/fwd/fun/read_fvar.hpp
#ifndef STAN_MATH_FWD_FUN_READ_FVAR_HPP #define STAN_MATH_FWD_FUN_READ_FVAR_HPP #include <stan/math/fwd/meta.hpp> namespace stan { namespace math { /** * Functor for extracting the values and tangents from a matrix of fvar. * This functor is called using Eigen's NullaryExpr framework. */ template <typename EigFva...
ALGO
0.935955
6.721776
{ "github_metadata": { "branch": "develop", "commit_count": 28933, "repo_created_at": "2015-07-01T18:40:54.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 785, "forks": 195, "issues": 298, "pull_requests": 19 }, "file_meta": { "content_id": ...
35e68766-8d98-4c63-a8a1-2034a3ad3abf
olethrosdc/beliefbox
src/algorithms/ModelBasedRL.cc
// -*- Mode: c++ -*- // copyright (c) 2009 by <NAME> <<EMAIL>> // $Revision$ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it unde...
ALGO
0.989875
5.564887
{ "github_metadata": { "branch": "master", "commit_count": 1611, "repo_created_at": "2015-03-20T15:15:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 5, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "671b7ba...
74428a1a-57c6-4d1b-ab27-08698427bfd8
Code-writter/DSA
BinaryTree/pathSum.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.999977
5.734649
{ "github_metadata": { "branch": "main", "commit_count": 26, "repo_created_at": "2025-07-05T18:24: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": "b6549382596...
d0a50c18-9d21-4542-be85-e56f8ba617e4
ShuhengLi/LeetCode
week1/121.BestTimetoBuyandSellStock.cpp
/*121. Best Time to Buy and Sell Stock Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of the stock), design an algorithm to find the maximum profit. Note that you cannot sell a sto...
ALGO
0.999499
5.778487
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2015-01-07T05:19: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": "dd73c8c1a...
7eba33fc-886e-4579-bff9-3fa18377b15d
sunilsy08/leetcode-submissions
0801-is-graph-bipartite/0801-is-graph-bipartite.cpp
class Solution { public: bool checkbipartiteBFS(vector<vector<int>>& graph) { int n = graph.size(); vector<int>visited(n, -1); for(int i=0; i<n; i++) { if(visited[i] == -1){ int color = 0; queue<pair<int, int>>q; q.push({i,color});...
ALGO
0.999959
6.050518
{ "github_metadata": { "branch": "main", "commit_count": 1200, "repo_created_at": "2021-12-29T16:36: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": "4e544b7be...
133a5556-5532-4efc-b8e1-8a7f805cde4c
SBidaibek/acm
ioi/2018/practice/road_service/sol.cpp
#include <bits/stdc++.h> using namespace std; #define forn(i, x, n) for (int i = int(x); i <= int(n); ++i) #define for1(i, n, x) for (int i = int(n); i >= int(x); --i) #define F first #define S second #define pb push_back typedef long long ll; typedef pair <int, int> pii; typedef vector <int> vi; typedef vector <pii...
ALGO
0.999991
3.804364
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-02-13T16:09:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bbd90002fa...
09cf64c0-0023-4027-a0f3-f29e9be94f39
ronanboiteau/Bomb-Erman
srcs/AI.cpp
#include <algorithm> #include <iostream> #include "AI.hh" #include "Bomb.hh" #include "ABox.hh" #include "Empty.hh" #include "GetRand.hpp" AI::AI(const std::wstring &name, eColor color, Position pos, Map &map, eHeading heading, size_t id, eAILevel level, SoundManager *sound, MeshesLoader *meshesLoader, ImagesLoader *i...
TOOL
0.984601
4.134423
{ "github_metadata": { "branch": "main", "commit_count": 32, "repo_created_at": "2017-09-14T12:33:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d60b8fb8521...
4e455211-d21a-4349-a7ee-f03ac04a40fa
Scakah/IF10C_AWP
SchereSteinPapier/Source.cpp
#include <iostream> // Input-/Output-Stream Bibliothek wird importiert (um z.B. cout zu verwenden) using namespace std; // std = Standard, verkürzt std::cout auf cout // Mainfunktion des Programms "Schere, Stein, Papier" int main() { // Definition und Initialisierung // Variable i_spieler1 wird deklariert und init...
ALGO
0.996894
3.686023
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2019-10-15T17:34:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ecd169d29...
4edcee94-effe-498a-a5f4-8d4d71019a70
dhanush-beep/dsa-lab
lab8/btree.cpp
#include <iostream> #include <queue> using namespace std; class Tree { struct node { char data; struct node* left; struct node* right; node(char val) { data = val; left = right = nullptr; } }; public: node* root; // Root node of the tree ...
ALGO
0.999734
5.498666
{ "github_metadata": { "branch": "main", "commit_count": 55, "repo_created_at": "2025-05-04T15:19: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": "16112b4a891...
d8284660-3a89-4441-81af-5f454cd72cdf
nickbel7/IEEEXtreme14.0-codenames
Linearly Separable Samples/main.cpp
#include <iostream> #include <math.h> #include <iomanip> using namespace std; #define PI 3.14159265 double findAngle(double x1, double y1, double x2, double y2) { double dot = x1*x2 + y1*y2; double det = x1*y2 - y1*x2; double angle = atan2(det, dot); return abs(angle * 180 / PI); } int main() { ...
ALGO
0.999942
3.975588
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2020-09-20T15:17:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5e38d67c8d...
ee8956df-ec86-41f8-a909-ed8fa27524dd
Al-Kom/isformula
lib/pllftree.cpp
// Laboratory work 2 on the discipline LOIS // Completed by student of group 721702 BSUIR Komar <NAME> // CPP-file of library of propositional logic language formula verifier tree // Version 3. Add calculation of truth table and tautology test. // Clean code. Improve readability // #include <cmath> #include <utility> ...
ALGO
0.99468
5.432193
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2020-05-13T14:25: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": "0992cc1c5...
52eed148-d9cb-4dfd-9a5b-7afef8d31efe
jocuevg/Proyecto-CalculoOrbitas
src/AccelHarmonic.cpp
//$Source$ //------------------------------------------------------------------------------ // AccelHarmonic //------------------------------------------------------------------------------ // Proyecto-TTI. // // /**@file AccelHarmonic.cpp * @brief Programacion de operacion AccelHarmonic. * * @author <NAME> <NAME> * @b...
ALGO
0.99703
5.042138
{ "github_metadata": { "branch": "main", "commit_count": 38, "repo_created_at": "2025-03-28T08:17:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "effa00a687c...
33bb79b2-1c98-4c14-81f4-7d388947b477
yusufoner77/tic_tac_toe
Rules.cpp
#include <string> #include <iostream> #include "Rules.hpp" #include "Board.hpp" Rules::Rules(Board *inputted_board) { board = inputted_board; } bool Rules::validate_input(int input) { string current_mark = board->get_mark(input); if (input < 1 || input > (board->get_size() * board->get_size()) || current_...
ALGO
0.952165
4.301363
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2024-02-07T02:38: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": "2cc40b16bcc...
b26dcdd4-7295-49e9-9040-cd7be6765bcb
mejibyte/competitive_programming
UVa/11584 - Partitioning by palindromes/11584.cpp
/* Problem: <NAME> (<EMAIL>) */ using namespace std; #include <algorithm> #include <iostream> #include <iterator> #include <sstream> #include <fstream> #include <numeric> #include <cassert> #include <climits> #include <cstdlib> #include <cstring> #include <string> #include <cstdio> #include <vector> #include <cmat...
ALGO
0.999985
3.657948
{ "github_metadata": { "branch": "master", "commit_count": 355, "repo_created_at": "2011-10-27T01:25:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 196, "forks": 66, "issues": 1, "pull_requests": 2 }, "file_meta": { "content_id": "77388...
0e8dc984-af95-40f0-9673-9d85ff6dc092
siddharth25pandey/CPP-Programming
DP/Minimizing_Coin.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int const ll mod = 1e9 + 7; void solve() { int n, m; cin >> n >> m; vector<int> coin(n); for (int i = 0; i < n; i++) { cin >> coin[i]; } int best = 0; vector<int> target(m + 1, 1e9); target[0] = 0; for (i...
ALGO
0.999968
3.671679
{ "github_metadata": { "branch": "master", "commit_count": 1586, "repo_created_at": "2020-09-30T19:06:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 60, "forks": 227, "issues": 11, "pull_requests": 31 }, "file_meta": { "content_id": "ed...
8224407a-c078-40ec-9491-59095349875e
saul101s/competitive-programming
uva-online-judge/10038-jolly-jumpers/main.cpp
#include<bits/stdc++.h> using namespace std; void solve(); int n; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("my-output.txt", "w", stdout); freopen("error.txt", "w", stderr); #endif while (cin >> n) ...
ALGO
0.999781
3.580116
{ "github_metadata": { "branch": "main", "commit_count": 152, "repo_created_at": "2020-12-27T18:04: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": "a2d0489833...
761efab6-5441-4201-8ab4-9e84093fd46a
Sumanth-NR/CompetitiveProgramming
Platforms/CodeForces/Rounds_0901-0950/Round907_Div2/B_Deja_Vu.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; void solve() { int n, nQ; cin >> n >> nQ; vector<int> a(n), q(nQ); for (auto &x: a) { cin >> x; } for (auto &x: q) { cin >> x; } constexpr int N = 30; array<int, N + 1> val; val.fill(0); fo...
ALGO
0.999757
4.171112
{ "github_metadata": { "branch": "master", "commit_count": 104, "repo_created_at": "2022-04-18T13:29:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7f4957a8...
485a8b78-728c-4b11-b9f4-dab18950c105
ArtemDyrdin/ASD
3rd semester/lab_11/main.cpp
#include <iostream> #include <vector> // Вывести эл-ты std::vector<int> void showElements(std::vector<int>& numbers) { for (int num : numbers) std::cout << num << " "; std::cout << std::endl; } // Быстрая сортировка void quickSort(std::vector<int>& numbers, int left, int right) { // Если индекс ле...
ALGO
0.999987
5.806428
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2023-10-01T21:29: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": "731d0522e7f...
2c8a3f9d-c2e5-4396-9635-9d5ece619835
TechWithRamaa/DataStructures_and_Algorithms
1324-where-will-the-ball-fall/1324-where-will-the-ball-fall.cpp
class Solution { public: vector<int> findBall(const vector<vector<int>>& grid) { const int board = grid[0].size(); vector<int> result(board, 0); for (int j = 0; j < board; j++) result[j] = simulateBallPath(grid, j); return result; } private: int simulateBallPat...
ALGO
0.999937
5.868532
{ "github_metadata": { "branch": "main", "commit_count": 6727, "repo_created_at": "2024-10-25T17:48:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "67961eaee...
7f0fed55-5352-4189-afea-04ce2200c7f8
pyo7410/Study
baek/1068_Tree/1068_Tree.cpp
#include <iostream> #include <vector> #include <queue> using namespace std; vector<int> adj[51]; int n, root, answer, remove_node; bool visit[51]; void bfs(int node) { queue<int> q; q.push(node); visit[node] = true; while (!q.empty()) { int cur_node = q.front(); q.pop(); ...
ALGO
0.999594
4.302092
{ "github_metadata": { "branch": "master", "commit_count": 138, "repo_created_at": "2019-09-04T07:24: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": "c0032439...
526ef8db-3fc9-4e75-b4a6-042460b66844
ismailertuglu14/doubly-linked-list
linked-list/main.cpp
// // main.cpp // linked-list // // Created by <NAME> on 13.11.2022. // #include <iostream> //#include <stdlib.h> using namespace std; struct Node{ int value; Node* next; Node* prev; }; class LinkedList{ private: Node* head; Node* tail; Node* iterate; int length; public: Lin...
ALGO
0.999639
4.363535
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-11-13T18:36:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f85d29b2e03d...
c7eefa21-96f3-4ab0-a591-4ee4bf9009aa
shmundhra/Algorithmic-Programming
CodeForces Codes/1000-A: Codehorses T-shirts.cpp
//https://codeforces.com/contest/1000/problem/A #include <bits/stdc++.h> using namespace std; typedef unsigned long long ul ; typedef long long ll ; typedef pair < int , int > pii ; typedef pair < ll , ll> pll ; typedef pair < ll , pll > edge ; typedef vector < int > vi ; typedef vector < ll > vll ; typedef vect...
ALGO
0.999819
3.272543
{ "github_metadata": { "branch": "master", "commit_count": 69, "repo_created_at": "2018-12-30T12:53:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 16, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "619b7448...
e3cea8b0-94fe-4d12-8193-c202e1546a26
GrahlmanMatthew/Colour-SOFM
pixel.h
#include <math.h> #include <iostream> #include <stdlib.h> using namespace std; // Class Purpose: this class allows for the creation of pixels objects for the map to self-organize in the input-space. class pixel { // Each pixel in the SOFM will have the red, green, and blue colour channels. private: float re...
ALGO
0.957546
4.058547
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-08-26T02:05:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "82dc676779...
9e6051a0-5792-41a6-ad77-1678cf3ca2d2
Yashh2385/cse330
Binomial_Coefficient.cpp
#include <iostream> using namespace std; int binomialCoefficient(int n, int r) { if (r > n) return 0; int dp[r + 1] = {0}; dp[0] = 1; for (int i = 1; i <= n; ++i) { for (int j = min(i, r); j > 0; --j) { dp[j] = dp[j] + dp[j - 1]; } } return dp...
ALGO
0.999891
6.043429
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-12-05T05:29: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": "3710fdf40f87...
5969587e-604a-44c1-90b9-eb60198b193b
Pandor17/cmasmas
7.funciones/ej_comp_ordenamiento.cpp
#include <iostream> using namespace std; //prototipos int pedir_tamano (); void llenar_array (int ixArray[], int iTamano); bool creciente (int ixarray[], int iTamano); int main(){ int iTam = pedir_tamano(); int iarray [iTam]; llenar_array(iarray,iTam); bool comprobar = creciente (iarray,iTam); if...
ALGO
0.998734
4.298644
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-10-01T17:39: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": "2c34659b3b9d...
bc8fb7f7-0332-49c9-8159-f80a85c4cf99
Harinaathgobi/Thin_film_iridescence
src/materials/disney_metal.inl
#include "../microfacet.h" Spectrum eval_op::operator()(const DisneyMetal &bsdf) const { if (dot(vertex.geometric_normal, dir_in) < 0 || dot(vertex.geometric_normal, dir_out) < 0) { // No light below the surface return make_zero_spectrum(); } // Flip the shading frame if it is i...
ALGO
0.912075
6.691033
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2023-03-17T05:41:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "01b8ec2c7058...
7d4b4e22-b9ba-4382-9fee-157aa4e6de18
alexandraback/datacollection
solutions_6377668744314880_0/C++/tensteps/C.cpp
#include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<algorithm> #include<vector> #include<map> #include<cmath> using namespace std; #define Rep(i,n) for (int i=0;i<(n);i++) #define For(i,l,r) for (int i=(l);i<=(r);i++) #define PB push_back #define MP make_pair struct Point { int x,y; ...
ALGO
0.999966
3.80836
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "954142a5c...
30b6507a-6f32-4d65-934f-ef9d6e4bf0f6
google/earthenterprise
earth_enterprise/src/common/khStringUtils.cpp
// Copyright 2017 Google Inc. // Copyright 2020 The Open GEE Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unles...
TOOL
0.925886
4.882164
{ "github_metadata": { "branch": "master", "commit_count": 1779, "repo_created_at": "2017-03-20T21:40:53.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2699, "forks": 891, "issues": 252, "pull_requests": 0 }, "file_meta": { "content_id": "d...
a6b9e105-3f07-4000-a0e3-520332b3bca2
yamate11/compprog
abc/abc386/f/cans2.cc
#include <bits/stdc++.h> #include <cassert> using namespace std; using ll = long long int; using u64 = unsigned long long; using pll = pair<ll, ll>; // #include <atcoder/all> // using namespace atcoder; #define REP(i, a, b) for (ll i = (a); i < (b); i++) #define REPrev(i, a, b) for (ll i = (a); i >= (b); i--) #define A...
ALGO
0.999999
4.819721
{ "github_metadata": { "branch": "main", "commit_count": 219, "repo_created_at": "2021-03-11T06:12:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1a2a9e773c...
909655ba-64d2-4c50-a274-8aeff5e6588f
anshu2305/DSA-PRACTICE-IMP-QUES
210-course-schedule-ii/210-course-schedule-ii.cpp
class Solution { public: vector<int> findOrder(int num, vector<vector<int>>& prerequisites) { vector <int> ans; if(num == 0 ) return ans; queue <int> q; vector <int> indegree(num,0); vector <int> adj[num]; for(int i=0;i<prerequisites.siz...
ALGO
0.999988
6.247997
{ "github_metadata": { "branch": "main", "commit_count": 263, "repo_created_at": "2020-10-17T07:28: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": "fc8c6c37d3...
f2ab7f2a-6c1b-4d55-954d-3683f522aa8b
wzqvip/RP2040-accelerator-dashboard
src/main.cpp
#include <Wire.h> #include <stdint.h> #include <cmath> // 数学库,用于计算平方根等 #include "lgfx_gc9a01.hpp" #include "qmi8658c.hpp" // 加速度计头文件 // 全局变量 static LGFX_GC9A01 display; // 显示屏 static QMI8658C imu; // 加速度计 // 屏幕逻辑网格定义 #define LOGICAL_GRID_SIZE_X 24 // 逻辑网格宽度 #define LOGICAL_GRID_SIZE_Y 24 ...
ALGO
0.997566
5.652968
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2025-01-02T10:57:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3f480f346ff8...
25be0d7d-4167-4b38-8211-0e23f062c700
Ryb7532/AtCoder
submissions/abc087/b.cpp
#include <bits/stdc++.h> using namespace std; using Edge = struct{ int to; int dis; }; vector<Edge> edge[100000]; int x[100000]; bool used[100000]; void dfs(int n, int p, int d) { if (used[n]) return ; x[n] = d; used[n] = true; for (auto &e: edge[n]) { if (e.to == p) continue; dfs(e.to, n...
ALGO
0.999992
4.19371
{ "github_metadata": { "branch": "master", "commit_count": 249, "repo_created_at": "2021-06-27T06:11: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": "08be5089...
de059571-6d8a-4ed0-8423-22ece1b98cd8
babasahebargade09/LOGICAL-PROGRAM-ON-DATA-STRUCTURE
Assignment61.cpp
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // 61.Write a program which add new node in doubly linear linked list at last position. // Function Prototype : int InsertLast( struct node **Head, int no ); // //////////////////////////////...
ALGO
0.947342
4.394676
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2018-02-03T18:47: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": "0d87c7537e...
3631e296-c020-4030-af82-df521733b449
recastnavigation/recastnavigation
DetourCrowd/Include/DetourPathCorridor.h
// // Copyright (c) 2009-2010 <NAME> <EMAIL> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // Permission is granted to anyone to use this software for any purpose, // including c...
TOOL
0.945722
7.085883
{ "github_metadata": { "branch": "main", "commit_count": 869, "repo_created_at": "2013-09-15T18:12:45.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 7159, "forks": 1701, "issues": 89, "pull_requests": 25 }, "file_meta": { "content_id": "300...
315ce85a-d0ba-4887-a059-8f9325c5ceb9
bahadirluleci/Design-Patterns-in-Modern-CPP
chainOfResponsibilityExercise.cpp
/* Chain of Responsibility Coding Exercise You are given a game scenario with classes Goblin and GoblinKing . Please implement the following rules: A goblin has base 1 attack/1 defense (1/1), a goblin king is 3/3. When the Goblin King is in play, every other goblin gets +1 Attack. Goblins get +1 to Defense for every ...
ALGO
0.997041
5.943675
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-03-14T03:07: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": "c20546ce06ba...
ed342f30-990e-4870-8280-a9264522c61e
xl2401/practice
string_array_serialization.cpp
#include<iostream> #include<string> #include<vector> #include<algorithm> using namespace std; string serialize(vector<string> S) { string final = ""; for(int i=0; i<S.size(); i++) { for(int j=0; j<S[i].length(); j++) { if(S[i][j]==',') { S[i].insert(j...
ALGO
0.998386
3.516923
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2014-10-03T14:55: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": "9e1b328490...
e9098a3e-8517-412a-bfdf-e78c6abb436a
Lartsev-Artem/relativistic_solver_hllc
solver_hllc_illum_cuda/solve_module/illum/Illum_part.cpp
#include "../solve_config.h" #if defined ILLUM && defined SOLVE && !defined USE_MPI #include "illum_utils.h" #include "../solve_global_struct.h" #include "../../global_value.h" #include "../../global_def.h" #include "../../file_module/reader_txt.h" static Type CalculateIllumeOnInnerFace(const int num_in_face, cons...
ALGO
0.999586
4.059481
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2022-10-11T16:22:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "be2ecf6af...
0bc1e4fd-f57d-44fc-87e5-e0cbac605f5e
shinnosuke-narita/AtCoderWork
abc/abc260/d/main.cpp
#include <atcoder/all> #include <bits/stdc++.h> using namespace std; // マクロ #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using P = pair<int, int>; int main() { int n, k; cin >> n >> k; vector<int> ans(n, -1); map<int, vector<int>> mp; rep(ni, n) { int p; cin >> p; ...
ALGO
0.99998
4.240922
{ "github_metadata": { "branch": "main", "commit_count": 272, "repo_created_at": "2023-11-09T22:48:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "41d6174d73...
92fd09e0-0c74-4e1e-a301-96207d0e94c6
faijurrahman/pSolving
Mission/2. Mission 50 Div2/7. SRM 647/P3_BuildingTowers.cpp
//C Header #include<tuple> #include<climits> #include<algorithm> #include<vector> #include<string> #include<cstring> #include<iostream> #include <sstream> using namespace std; #define LOOP(i,s,n) for(int i=(s);i<(n);i++) #define loop(i,n) for(int i=0;i<(n);i++) #define MAX(mVal, oVal) (mVal) = max((mVal),(oVal)) #defi...
ALGO
0.999943
4.515557
{ "github_metadata": { "branch": "master", "commit_count": 70, "repo_created_at": "2014-09-03T16:36:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9f32bf3f8...
119a6d57-8bb2-4e18-85a3-9544a06c3cda
kubonits/atcoder
abc/200/220/abc220/f/main.cpp
#include <algorithm> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> #define MOD 1000000007 using namespace std; typedef long long ll; #include <cstring> ll n; vector<ll> g[200001], ans(200001...
ALGO
0.999742
3.923138
{ "github_metadata": { "branch": "master", "commit_count": 48, "repo_created_at": "2018-12-07T13:30: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": "9cb5264cd...
fb3175bf-7c59-4972-9001-69d4ad987fc1
ItaloPinheiro/Algoritmos
Programação Dinâmica/UVa - Wedding Shopping - DP.cpp
#include <stdio.h> #include <stdlib.h> #include <algorithm> #include <string> #define MAX -10^6 using namespace std; int M, C, price[25][25]; int memo[210][25]; int shop(int money, int g){ if(money < 0){ //puts("\nreturning MAX"); return MAX; } if(g == C){ //printf("\n%d == %d\n", g, C); //printf("returni...
ALGO
0.9998
3.030098
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2019-02-19T02:21: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": "47fbc6fcf7...
6786e388-815e-4dda-97fe-6aa58bc1c7df
papyrussolution/OpenPapyrus
Src/OSF/xapian/xapian-core/src/nearpostlist.h
/** @file * @brief Return docs containing terms within a specified window. * * Copyright (C) 2006,2015,2017 <NAME> * Copyright (C) 2009 Lemur Consulting Ltd * * 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 ...
TOOL
0.952844
6.970223
{ "github_metadata": { "branch": "master", "commit_count": 979, "repo_created_at": "2017-01-05T07:15:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 259, "forks": 67, "issues": 10, "pull_requests": 0 }, "file_meta": { "content_id": "6015...
be9585c5-6188-4899-99d7-bfd1d954d01f
RobotLocomotion/drake
systems/analysis/integrator_base.cc
#include "drake/systems/analysis/integrator_base.h" namespace drake { namespace systems { template <class T> IntegratorBase<T>::~IntegratorBase() = default; template <class T> bool IntegratorBase<T>::StepOnceErrorControlledAtMost(const T& h_max) { using std::isnan; using std::min; // Verify that the integrato...
ALGO
0.995664
7.822026
{ "github_metadata": { "branch": "master", "commit_count": 33726, "repo_created_at": "2014-01-26T16:11:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3630, "forks": 1305, "issues": 690, "pull_requests": 46 }, "file_meta": { "content_id":...
adfadf63-0c9f-495f-bb56-673dbbd8063a
Sean0628/competitive_programming
atcoder/abc/abc076/c.cpp
#include <bits/stdc++.h> using namespace std; #include <atcoder/all> using namespace atcoder; #define rep(i, n) for (int i = 0; i < (n); ++i) #define out(arg) cout << (arg) << endl using ll = long long; using P = pair<int, int>; using mint = modint1000000007; void chmax(ll& a, ll b) { a = max(a, b); } void chmin(ll& a,...
ALGO
0.999982
4.341822
{ "github_metadata": { "branch": "main", "commit_count": 750, "repo_created_at": "2022-04-20T07:34: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": "5a9f24caa0...
113e5485-ce1f-4fbb-afda-97fa054534c6
ishandutta2007/codeforces-c
chemthan/normal/1344/D.cpp
#include <bits/stdc++.h> using namespace std; //#pragma GCC optimize("Ofast") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define ms(s, n) memset(s, n, sizeof(s)) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FORd(i, a, b) for (int i = (a) - 1; i >= (b); --i) #define...
ALGO
0.999974
3.641197
{ "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": "0e4dbc5653f1...
f6cbb0e1-e90e-4565-b6a7-3f06105f524c
LittleTimeCc/PAT
PAT (Advanced Level) Practise/1020. Tree Traversals (25).cpp
/* 1020. Tree Traversals (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 <NAME> Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the corresponding binary tree....
ALGO
0.999999
5.349334
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2017-12-11T04:26:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e86614495...
6cf551d5-a8ea-4168-8fd3-cd9bbddb3c0d
Leandro-Pinheiro-Dev/Dev-C-2
Estatistica.cpp
#include <stdio.h> #include <math.h> #include <locale.h> double calcular_probabilidade(double a, double b, double c, double d) { return ((d - c) / (b - a)) * 100.0; } double calcular_media(double a, double b) { return (a + b) / 2.0; } double calcular_desvio_padrao(double a, double b) { return sqrt((pow(b...
ALGO
0.999062
5.658613
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-09-01T23:41: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": "2deeacc00e80...
d86c7260-c0f6-43a5-9395-6c47356f9ca9
Sai-Chakradhar-Mahendrakar/GeeksForGeeks
Difficulty: Medium/Minimum Spanning Tree/minimum-spanning-tree.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class DSU{ vector<int> parent; vector<int> rank; public: DSU(int n){ parent = vector<int>(n,-1); rank = vector<int>(n,1); } int find(int i){ if(parent[i]==-1){ ...
ALGO
0.999962
5.935305
{ "github_metadata": { "branch": "main", "commit_count": 287, "repo_created_at": "2024-07-06T13:39:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bac518d7a7...
4658bb19-e040-4e54-8a43-16aaa5a1761c
nedzadalibegovic/programiranje1
ostalo/4_ispitni_dd_mm_yyyy.cpp
/* Kreirati program koji ce pronaci i ispisati sve brojeve od X do Y (ukljucujuci granicne vrijednosti) koji su djeljivi svim svojim ciframa. Na primjer, broj 36 je djeljiv sa brojevima 3 i 6. (36/6=6 i 36/3=12). Brojeve X i Y unosi korisnik i moraju biti u opsegu od 10 do 6000. Obavezno koristiti bar jednu funkci...
ALGO
0.954691
4.704142
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2018-10-15T20:48:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "846ee15b8...
e310fa0c-0d32-41dc-ae5f-17cab73764f1
zcy05331/code-backup
Codeforces/Codeforces Round #593 (Div. 2)/A.cpp
#include <bits/stdc++.h> #define R register #define ll long long #define sum(a, b, mod) ((a + b) % mod) int calc(int a, int b, int c) { int ans = 0, tmp = 0; tmp = std::min(a, b / 2), ans += tmp * 3, b -= tmp * 2; tmp = std::min(b, c / 2), ans += tmp * 3, c -= tmp * 2; return ans; } int calc1(int a, ...
ALGO
0.99998
4.736333
{ "github_metadata": { "branch": "master", "commit_count": 59, "repo_created_at": "2020-02-19T14:44: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": "4e6f50d3d...
d8327055-0371-4b3d-9c08-fed00740dd5c
VaasviAgarwal/LinearDataStructures
doublylinkedlist.cpp
#include <iostream> using namespace std; class Node { public: Node *prev; Node *next; int val; Node(int info) { prev = NULL; next = NULL; val = info; } }; class DoublyLinkedList { Node *start; public: DoublyLinkedList() { start = NULL; } void addEnd(int val); void addBeginning(int val); void de...
ALGO
0.997559
5.181633
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-01-04T08:43: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": "5b60c525ffff...
1ac94261-011e-49f4-b60d-5b0618e53a2e
ishandutta2007/codeforces-n
nikgaevoy/normal/1710/B.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; mt19937 mt(736); void solve_test(istream &cin = std::cin, ostream &cout = std::cout) { int n, m; cin >> n >> m; vector<pair<int, int>> arr(n); vector<int> xs; xs.reserve(n); for (auto &[x, p]: arr) { ci...
ALGO
0.999937
4.082675
{ "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": "c7082e84e25d...
f048f6e0-833a-4c1a-a451-d4f6fb6f6628
GameFoundry/bsf
Source/Foundation/bsfUtility/ThirdParty/simdpp/detail/insn/i_shift_l.h
/* Copyright (C) 2011-2014 <NAME> <<EMAIL>> 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) */ #ifndef LIBSIMDPP_SIMDPP_DETAIL_INSN_I_SHIFT_L_H #define LIBSIMDPP_SIMDPP_DETAIL_INSN_I_SHIFT_L_H ...
TOOL
0.96023
6.910277
{ "github_metadata": { "branch": "master", "commit_count": 5221, "repo_created_at": "2018-03-15T10:17:21.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1752, "forks": 194, "issues": 99, "pull_requests": 8 }, "file_meta": { "content_id": "7c...
a14578e1-2dd3-4e3b-bb31-e860d9ef9ce5
HiYellowC/ACM
主席树/p2104.cpp
#include <bits/stdc++.h> using namespace std; const int MAXN = 100010; const int MAXM = MAXN * 25; int n, m, q, dex; int a[MAXN], sorted[MAXN], root[MAXN]; int T[MAXM], lson[MAXM], rson[MAXM]; void Init() { dex = 0; sort(sorted + 1, sorted + 1 + n); m = unique(sorted + 1, sorted + 1 + n) - sorted - 1; } int Buil...
ALGO
0.999998
5.206173
{ "github_metadata": { "branch": "master", "commit_count": 27, "repo_created_at": "2015-10-29T04:26:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2c1fa87e7...
fbe4dfb7-e71d-4aad-9389-6ea9dc659128
UniStuttgart-VISUS/implicit-topology
core/include/mmcore/thecam/camera.inl
/* * thecam/camera.inl * * Copyright (C) 2016 TheLib Team (http://www.thelib.org/license) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain ...
ALGO
0.996895
6.735677
{ "github_metadata": { "branch": "master", "commit_count": 7380, "repo_created_at": "2020-09-30T13:36:00.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4c79df05...
92f17de1-a6da-47fe-a4c4-781042ee9ecd
HSUJUILIN/DiffusionReaction
1DDiffusionReaction.cpp
// Edit by Xurl // Fisrt release: Adding class "Region", function "print_array", "ini_r", // "diffusion equation", "reaction equation", "update_data", "write_in_txt". 20210809 16:30 // Second release: Adding function "balloon_equation"; fixing function "diffusion_equation", // "reactio...
ALGO
0.999315
4.281135
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2022-08-11T07:28: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": "398a8d91dad6...
f04b11d9-ff82-4ca9-b3d8-65ae3b010c2c
zealws/Circuit-Simulator
src/CircuitIterator/BFSIterator.cpp
#include "BFSIterator.h" #include "CircuitSimulator.h" #include <iostream> using namespace std; //// //// BFSIterator class //// // Returns whether or not a component occurs in outputList bool BFSIterator::IsOutput(CustomComponent* search) { list<CustomComponent*>::iterator it = outputList.begin(); while(it !...
ALGO
0.983208
3.802217
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2012-02-15T04:59:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1849f5e5e...
9aa1231f-9fdc-4a85-8ba2-ef04535d8047
Sd-Invol/shoka
TheWaySoFar-Training/2015-03-22/G.cpp
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int N = 5e5 + 5; int f[21][N], a[N], b[N], n, m; int fl[N], fr[N], LOG[N]; vector<int> position[N]; pair<int, int> ans; void solve(int l, int r) { int len = r - l + 1; ans = max(ans, make_pair(len, -l)); //printf("%d %d\n", l, r); ...
ALGO
0.999976
3.714825
{ "github_metadata": { "branch": "master", "commit_count": 348, "repo_created_at": "2013-10-04T08:20:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 37, "forks": 11, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "95750b...
91c6903a-3465-41d7-b1cd-01509c6a7f6b
tamasuji/ShootingGame
src/CheckHit.cpp
#include "CheckHit.h" #include <math.h> bool CheckHitCircle(const Circle& objA, const Circle& objB) { int x = objA.x - objB.x; //Xの長さ int y = objA.y - objB.y; //Yの長さ //三平方の定理より、底辺の二乗と高さの二乗を足したものは斜辺の二乗 double length = sqrt(double(x * x) + (y * y)); //objA,objBの距離 bool hit = length <= (objA.r + objB.r); return ...
ALGO
0.987848
5.198475
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-02-17T08:34:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1790910718...
4cd401fe-2825-46fb-b875-ea8c63204627
96Azerus/D3CFR
cpp_src/DeepMCCFR.cpp
#include "DeepMCCFR.hpp" #include "constants.hpp" // <-- ДОБАВЛЕНО #include <stdexcept> #include <iostream> #include <numeric> #include <algorithm> namespace ofc { DeepMCCFR::DeepMCCFR(size_t action_limit, SharedReplayBuffer* buffer, InferenceQueue* queue) : action_limit_(action_limit), replay_buffer_(buffer), i...
ALGO
0.994752
5.557671
{ "github_metadata": { "branch": "main", "commit_count": 288, "repo_created_at": "2025-07-02T19:07:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f7c61d43ea...
0d40c8c5-3d55-46f9-ad37-fb48a9d8eafb
GaoSida/LDAexp
LDA/LightSampler.cpp
#include "LightSampler.h" #include <iostream> using namespace std; LightSampler::LightSampler(Corpus* corpus) : GibbsSampler(corpus) { word_drawers = new AliasDrawer*[corpus->V]; word_drawer_timers = new int[corpus->V]; word_proposal = new double*[corpus->V]; word_proposal_sum = new double[corpus->V]; ...
ALGO
0.946775
4.41929
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2016-05-30T16:22:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c88a26a7c4...
3cc463ed-792b-4d4e-9adb-a55d63712471
kazi031/CodeForces
Contest/online_oop.cpp
#include<iostream> #include<cstring> using namespace std; class Student; class Teacher { char *name; char *dept; public: Teacher(char *p,char* q) { name=new char[strlen(p)+1]; strcpy(name,p); dept=new char[strlen(q)+1]; strcpy(dept,q); cout<<"Constructing "<<name...
TOOL
0.967885
4.354497
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2023-02-17T05:41: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": "89f3f5032d...
d076ad4b-d3fc-41f4-a33e-a541f1ac42e4
Kuro-orzz/Leetcode_sol
0030-substring-with-concatenation-of-all-words/rolling_hash.cpp
class Solution { public: vector<int> findSubstring(string s, vector<string>& words) { long long base = 31; long long mod = 1e9+7; vector<long long> p(s.size()+1); p[0] = 1; for(int i = 1; i <= s.size(); i++) p[i] = p[i-1] * base % mod; vector<int> h(s.size...
ALGO
0.999864
6.128041
{ "github_metadata": { "branch": "main", "commit_count": 1494, "repo_created_at": "2024-03-23T15:03: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": "59a9f6030...
d91e02d2-ece2-4db7-8cf7-cc702cc038fc
qdaicho/Matrix-Calc
main.cpp
#include <iostream> #include "ELEC2110CAA.h" //importing header files and libraries which are not already imported in the header file int main() { //MAIN CONTROL FLOW STRUCTURE WHICH ALSO GOVERNS THE USER INTERFACE/PROGRAM INTERACTION //switches through the user's choice picked through getOperation() switch (ge...
ALGO
0.988975
3.227138
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2021-02-07T22:33:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "16a5864491...
05cb762a-ce29-4d56-b4a2-35908b55a822
evelyh/computer-graphics
ray-tracing/Sphere.cpp
#include "Sphere.h" #include "Ray.h" bool Sphere::intersect( const Ray &ray, const double min_t, double &t, Eigen::Vector3d &n) const { double a = ray.direction.dot(ray.direction); double b = 2 * ray.direction.dot(ray.origin - this->center); double c = (ray.origin - this->center).dot(ray.origin - this->center...
ALGO
0.987869
3.955616
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-12-08T16:05:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ca8b3c1bbcf5...
1abd0a65-27a2-4080-b3b8-1e0996f9e997
JdMDE/ppamlib
src/library/gettd.cpp
/* * * Copyright (C) 2022 <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 3 of the License, or * (at your option) any later version. * * This program i...
ALGO
0.997364
5.413084
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2022-12-31T17:36: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": "546e643af335...
32159e2e-76f3-4486-a751-ad302d87c74e
teetangh/competitive-programming-and-dsa
CodeZen/01 CPP/05 Patterns 2/prog03starPattern.cpp
#include <iostream> using namespace std; int main() { /* Read input as specified in the question. * Print output as specified in the question. */ int n; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n - i; j++) cout << " "; for (int j = 1; j <=...
ALGO
0.999981
4.111817
{ "github_metadata": { "branch": "main", "commit_count": 597, "repo_created_at": "2020-01-11T16:55:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2cce9e942b...
449f1eba-44dd-4ae1-ad53-22d5d7dc7eaf
jchavezautec/cs2013
s12/lab12a/ejercicio4.cpp
#include <iostream> #include <stack> #include <vector> using namespace std; string validar(const vector<stack<int>>& torres) { int discoAnterior = 0; for (const auto& torre : torres) { stack<int> torreCopia = torre; while (!torreCopia.empty()) { int disco = torreCopia.top(); ...
ALGO
0.997844
6.129694
{ "github_metadata": { "branch": "main", "commit_count": 130, "repo_created_at": "2022-08-24T16:14:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 10, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "52b91a7a8...
24eab38a-8aae-4a39-b297-a2987455a280
kypo13/C-Programming
C/B-QHEAP1.cpp
#include<stdio.h> #include<string.h> #include<stdlib.h> #include<ctype.h> //min heap //inputnya dibuat pake String int heap[100001]; int count = 0; int getParentIndex( int index){ return index/2; } int getLeftChildParent ( int index) { return index*2; } int getRightChildParent ( int index) { return index*2+...
ALGO
0.999757
3.374174
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2020-09-29T05:34:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8cc1c26ce...
2ebbd9d9-1af5-41ac-bb73-13e6cebcb0db
oKermorgant/ecn_manip
src/trig_solvers.cpp
#include <ecn_manip/trig_solvers.h> #include <math.h> #include <algorithm> #include <iostream> namespace ecn { template <typename Solution, typename Particular, class Transform> inline void append(std::vector<Solution> &q, const std::vector<Particular> &part, const Transform &tr) { std::transform(part.b...
ALGO
0.999685
4.695646
{ "github_metadata": { "branch": "ros2", "commit_count": 54, "repo_created_at": "2018-07-09T19:12:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7a86014cf4e...
826f7871-133e-4f4a-8089-719eb487fffa
oushuai01/algorithm
LiKou/随想录/hot100/二刷/97_编辑距离.cpp
#include <iostream> #include <vector> #include <math.h> using namespace std; // 2024-04-22 // https://leetcode.cn/problems/edit-distance/solutions/1237735/bian-ji-ju-chi-tu-jie-dp-zui-qing-xi-yi-abfgl int minDistance(string word1, string word2) { int n = word1.size(); int m = word2.size(); word1 = " " + word...
ALGO
0.999909
5.336364
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2024-03-29T08:41: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": "2c3e4c4b352...
33ce582f-ebb5-47f7-ba9a-fdd1424475d3
lukaszgryglicki/my_legacy_stuff
tetra/tetra.cc
#include <complex> #include <iostream> using namespace std; #define C_t complex<long double> #define N_t long #define R_t long double C_t tetra(C_t base, N_t n) { C_t result(base); for (N_t i=1;i<n;i++) result = pow(base, result); return result; } C_t infinite_tetra(C_t base, N_t& nsteps) { C_t result(base)...
ALGO
0.999251
3.682428
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2017-11-26T16:36:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "66b3903adb...
596db7f9-1053-4c54-ba50-b9229961295b
andreastedile/barnes-hut
src/quadtree/node.cpp
#include "node.h" #include <spdlog/spdlog.h> #include <string> // https://en.cppreference.com/w/cpp/utility/variant/visit template <class... Ts> struct overloaded : Ts... { using Ts::operator()...; }; template <class... Ts> overloaded(Ts...) -> overloaded<Ts...>; #include <stdexcept> // invalid_argument, runtime...
ALGO
0.99701
6.913494
{ "github_metadata": { "branch": "master", "commit_count": 211, "repo_created_at": "2022-05-17T20:58:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f3b25c9c...
80ba40cc-c85c-4456-a6d4-bad61d556ece
navaneeth056/CP
CPC ASSIGNMENTS/Assignment-1/merge-intervals.cpp
// Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, // and return an array of the non-overlapping intervals that cover all the intervals in the input. #include<bits/stdc++.h> using namespace std; //int main(){ // vector<vector<int>> intervals = {{1,3},{2,6},{8,10},...
ALGO
0.999947
5.776169
{ "github_metadata": { "branch": "main", "commit_count": 37, "repo_created_at": "2023-10-19T14:27: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": "3ee24889339...
c0396116-7a6e-4cac-b932-b53aa5039960
CrabBucket/Super-Competitive-Competivie-Programming
icpc_2019_2/icpc_2019_2.cpp
#include <iostream> #include <string> #include <algorithm> using namespace std; //removes useless characters string encode(string s){ string tmp = ""; for(char c : s){ if(c >= 'a' && c <= 'z') tmp.push_back( (c-32) ); else if(c >= 'A' && c <= 'Z') tmp.push_back(c); } return tmp; } //populates direct address ...
ALGO
0.999976
4.046884
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2020-06-10T02:35: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": "4c5d3fc4a...
93395b0f-07db-4b0c-8dbc-15b499d1f54b
panic-coursework/cpp
src/proof.cpp
#include <iostream> #include <functional> using std::cin, std::cout, std::endl; // http://www.cs.nott.ac.uk/~psztxa/g53cfr/l05.html/l05.html class True { public: True () = default; template <typename T> True (T t) {} }; class False { public: False () = delete; }; template <typename A, typename B> using Im...
TEST
0.905826
5.853261
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2021-09-16T06:10:06.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d587595449...
a300f2fc-bcfa-468f-8785-6a0df5a4a6ea
RobinStar520/LeetCode
Medium/1438-Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit.cpp
// Given an array of integers nums and an integer limit, return the size of the longest non-empty subarray such that the absolute difference between any two elements of this subarray is less than or equal to limit. // Example 1: // Input: nums = [8,2,4,7], limit = 4 // Output: 2 // Explanation: All subarrays are:...
ALGO
0.999998
6.148293
{ "github_metadata": { "branch": "main", "commit_count": 84, "repo_created_at": "2023-07-22T06:44:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b20e6293435...
75988d17-8ca9-4453-b509-4d3b3511be49
whgusdn321/Competitive-programming
leetcode/PartitiontoKEqualSumSubsets.cpp
class Solution { public: bool f(int i, vector<int> &nums, vector<int> &groups, int target){ bool pos = false; if(i >= nums.size()) return true; for(int j=0; j<groups.size(); j++){ if(pos) break; if(groups[j] + nums[i] <= target){ ...
ALGO
0.99998
5.451104
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2020-09-28T03:51: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": "0f0a6c8dd7...
5aa4e1c0-1e7d-48d0-a5cb-5acf2b7e9034
spcl/probgraph
src/src/other/tc_set_simd.cc
// Copyright (c) 2015, The Regents of the University of California (Regents) // See LICENSE.txt for license details #include <algorithm> #include <cinttypes> #include <iostream> #include <vector> #include <memory> #include "../benchmark.h" #include "../builder.h" #include "../command_line.h" #include "../graph.h" #inc...
ALGO
0.997658
6.293463
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-08-26T23:09:48.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2b77007538ed0...
9fdc58d5-da6e-4325-b3a2-a2dfcfd29a74
Parsifa1/CodeField
Cpp/Alphabet/LinkedList.cpp
#include <bits/stdc++.h> using namespace std; struct node { int data; node* next; }; node* create(int n) { node *head, *tail; //头指针,尾指针 node* t = new node; cin >> t->data, t->next = NULL; head = t, tail = t; for(int i = 1; i < n; i++) { node* p = new node; cin >> p->data...
ALGO
0.999979
4.437974
{ "github_metadata": { "branch": "master", "commit_count": 301, "repo_created_at": "2023-01-30T06:40: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": "6d00f367...
5838fb86-8e5a-4d7b-b582-90fac9f5586e
conggaro/Hoc_OOP_co_Xuyen
code C++ OOP làm trên lớp/Phần 1 Lập trình cơ bản/Chương 1 Biến Kiểu dữ liệu và Các cấu trúc cơ bản/Ví dụ 1 - 1/main.cpp
// Yêu cầu: // 1. nhập vào 3 số thực a, b, c là độ dài 3 cạnh của một tam giác // 2. tính diện tích tam giác đó theo công thức Heron #include <iostream> #include <cmath> using namespace std; int main(){ float a, b, c; // nhập cạnh a cout << "Nhap vao canh a: "; cin >> a; while(a <= 0){ cout << "Nhap vao canh...
ALGO
0.998797
4.035412
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2023-05-25T05:53: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": "098f239b833...
81990a6c-e614-46b3-ac35-b2b1bb4a36c5
ip99202/Algorithm
DFS, BFS/2468_안전 영역.cpp
#include<iostream> #include<queue> #include<algorithm> #include<cstring> using namespace std; queue<pair<int, int>>q; int n, top, l = 0, cnt = 0, k = 0; int arr[100][100]; int visited[100][100]; int dy[4] = { 1,-1,0,0 }; int dx[4] = { 0,0,1,-1 }; int ans = 0; void bfs(int y, int x, int h) { visited[y][x] = 1; q.push(...
ALGO
0.999633
3.515067
{ "github_metadata": { "branch": "master", "commit_count": 536, "repo_created_at": "2019-07-07T13:34: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": "398ba09d...
9a57f285-4132-4876-a235-8523ff6436ba
haakoek/Fys3150
Project3/molecular-dynamics-fys3150-master/integrators/velocityverlet.cpp
#include <integrators/velocityverlet.h> #include <system.h> VelocityVerlet::VelocityVerlet() : m_firstStep(true) // This will set the variable m_firstStep to false when the object is created { } VelocityVerlet::~VelocityVerlet() { } void VelocityVerlet::firstKick(System *system, double dt) { m_firstStep = ...
ALGO
0.995688
5.305309
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2014-08-22T12:38:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1f085cd7d...
af939db2-b8b1-4f45-8a61-b3a744b47935
hankwang0810/c-_project
leb.34/剪刀石頭布.cpp
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <time.h> using namespace std; int getComputer(); string isComputerWin(int computer_consqence,int master_consqence); void print(int consquence); int main() { int input; int master_win_count = 0; int computer_win_count =0; int count = 0;...
ALGO
0.999525
3.172267
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2022-07-06T12:29: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": "93bb7c2dace0...