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
a0dbf662-e985-4f50-af4d-49bf9bf018b1
funprograming/leetcode-most-interv
leetcode160. Intersection of Two Linked Lists.cpp
/* leetcode160. Intersection of Two Linked Lists Write a program to find the node at which the intersection of two singly linked lists begins. */ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution ...
ALGO
0.999958
5.741654
{ "github_metadata": { "branch": "master", "commit_count": 42, "repo_created_at": "2018-10-07T12:46: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": "a367516f7...
18e8f2c3-dd83-43ee-9933-8d207eea3789
dhiloshan/Competitive-Programming
Ad-Hoc/Waterloo-Vera-and-LCS-2017-P2(Raw).cpp
// Waterloo 2017 Winter B - Vera and LCS (DMOJ): https://dmoj.ca/problem/waterloo2017wb // RAW CODE - https://dmoj.ca/src/6875741 #include <bits/stdc++.h> using namespace std; const int MM = 2002; int N, K, freq[MM]; char a[MM], b[MM]; int main(){ cin >> N >> K; for(int i = 0; i < N; i++){ cin >> a[i]; ...
ALGO
0.999964
3.264483
{ "github_metadata": { "branch": "main", "commit_count": 469, "repo_created_at": "2024-04-21T01:26: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": "14243b5a64...
42afe877-2c50-43c4-a572-34109c58e5b5
ishandutta2007/codeforces-k
kuroni/normal/1651/C.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while (t--) { int n; cin >> n; vector<int> a(n), b(n); for (int i = 0; i < n; i++) { cin >> a[i]; } for (int i = 0; i < n; ...
ALGO
0.999971
4.603001
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:06:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8981ededb399...
4fe61c64-28de-4d4e-96d6-b7fa4ed8c4c7
Anshuman115/CP-DS
C_BUCKET.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; long long x; cin >> n >> x; long long s[n]; long long r[n]; for (int i = 0; i < n; i++) { /* code */ cin >> s[i] >> r[i]; ...
ALGO
0.999969
3.754116
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2021-08-29T12:01: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": "86cf2ab0e2...
3cc665cc-11cd-45cb-a405-084d880625e3
owenduffy/NanoVNA-App
tfft.h
// (c) OneOfEleven 2020 // // This code can be used on terms of WTFPL Version 2 (http://www.wtfpl.net) #ifndef tfftH #define tfftH #include "types.h" //#include <fastmath.h> enum t_fft_window : int { FFT_WINDOW_NONE = 0, FFT_WINDOW_RECTANGLE, FFT_WINDOW_TRIANGLE, FFT_WINDOW_BARTLETT, FFT_WINDOW_HANN, FFT_WIN...
ALGO
0.987368
6.002766
{ "github_metadata": { "branch": "main", "commit_count": 67, "repo_created_at": "2022-02-10T03:04:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 48, "forks": 16, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "bac7b55a6...
25eb8c06-77ac-434f-81d5-fae060b6b2a6
toandovn/CIS5_45277
Assigment567/Gaddis_8thEd_chap7_prob2_RainFallStatistic/main.cpp
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: main.cpp * Author: Toan * * Created on July 25, 2016, 5:55 PM */ #include <iostream> //Input/Output Library #incl...
TOOL
0.993813
3.935379
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2016-07-21T00:14: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": "43716b370...
03f3220e-3970-46ef-869b-e1f1b6c4b3e3
MaoxianCk/C-HomeWork
FirstTimeOJ/5.cpp
#include <iostream> using namespace std; int main() { int a, b, c, d, x, y; int ansA, ansB, sum; int lastAnsA; cin >> a >> b >> c >> d >> x >> y; sum = 0; //暴力列举第一种怪物的数量 for (ansA = 1; ansA < x; ansA++) { //如果当前的合法解已经有2个,就表示多解,可以直接结束判断 if (sum == 2) { ...
ALGO
0.99989
3.39902
{ "github_metadata": { "branch": "master", "commit_count": 39, "repo_created_at": "2018-11-21T06:32:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6e64e51ea...
488d7d02-6057-404d-88ed-e519d9fdb3da
takeoverjp/leetcode
1668.maximum-repeating-substring.cpp
/* * @lc app=leetcode id=1668 lang=cpp * * [1668] Maximum Repeating Substring */ #include <bits/stdc++.h> #include "lassert/lassert.h" using namespace std; // @lc code=start class Solution { public: int maxRepeating(string sequence, string word) { int ret = 0; int len = sequence.length(); int wlen...
ALGO
0.999758
6.093305
{ "github_metadata": { "branch": "master", "commit_count": 837, "repo_created_at": "2020-10-30T15:34:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0a79c5b8...
fca1a58f-0aad-43c3-8168-e67fe4b1eb39
opentoonz/opentoonz
toonz/sources/toonzlib/tdistort.cpp
#include <memory> #include <array> #include "toonz/tdistort.h" #include "traster.h" #include "trastercm.h" #include "tgeometry.h" #include "tpixelutils.h" #include <QList> //**************************************************************************************** // Local namespace stuff //*************************...
ALGO
0.975537
6.062068
{ "github_metadata": { "branch": "master", "commit_count": 4450, "repo_created_at": "2016-03-18T17:55:48.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4880, "forks": 563, "issues": 736, "pull_requests": 12 }, "file_meta": { "content_id": "...
ac047a34-faf2-41b7-8f9d-d9098c106d8f
vibhkat/CrackingTheCode
Chapter2.h
#ifndef CHAPTER2_H #define CHAPTER2_H #include<string> #include<iostream> #include<algorithm> #include<sstream> #include<vector> template<class T> class ForwardList; template<class T> struct Node; template<class T> void intersection(ForwardList<T>&,ForwardList<T>& ); template<class T> std::ostream& operator<<(std::ostr...
TOOL
0.982008
3.145667
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2016-05-14T08:26: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": "4a99bb26f7...
c1304fef-ebd1-4d32-9f4d-d372a954ff92
ashpool37/codeforces-cxx20
problems/474b-worms/main.cpp
// Problem: 474B. Worms // Problem statement: https://codeforces.com/problemset/problem/474/B?locale=en // Solution author: <NAME> (https://codeforces.com/profile/Ashpool) // Solution license: the Unlicense (Public Domain) // More solutions: https://github.com/ashpool37/codeforces-cxx20 /* #region templates */ #inclu...
ALGO
0.999565
4.976833
{ "github_metadata": { "branch": "master", "commit_count": 341, "repo_created_at": "2024-06-22T15:46:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "78e2252b...
973d4c10-5c6a-497c-9f7c-d5cd040ea5ca
mohit701473/cpp
DSA Questions/Topic - 6 Stack and Queue/Stack/Que299_designAStackOperationOnMiddleElement.cpp
#include<iostream> #include<limits.h> using namespace std ; // T.C. = O(1) for push, pop, getMid and deleteMid poeration in the following stack // s.c. = O(N) bcz linked list take space class stack{ class Node{ public: int data ; Node* next ; Node* prev ; Node(int d){ ...
ALGO
0.999735
4.601045
{ "github_metadata": { "branch": "main", "commit_count": 226, "repo_created_at": "2023-02-16T18:42: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": "68cf3bab60...
3f4f9672-a092-47a1-8b44-bcec2eb05c74
djgns0174/Algorithm-Study
hojin/6_week/1477_휴게소 세우기.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { int n, m, l; cin >> n >> m >> l; int rest[n+2]; rest[0] = 0; for (int i=1; i<n+1; i++) cin >> rest[i]; rest[n+1] = l; sort(rest, rest+n+2); int start = 1; int end = l; int ans = l...
ALGO
0.999993
3.472773
{ "github_metadata": { "branch": "main", "commit_count": 171, "repo_created_at": "2025-03-12T07:17:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2032109057...
9afb41f8-ab3d-4f70-a95a-592327358a21
E3SM-Project/E3SM
components/mpas-ocean/src/analysis_members/rpn_calc_inc/binary_op_1d_2d_first_1.inc
type (rpn_stack_value_type), dimension(MAX_STACK_SIZE), intent(inout) :: stack integer, intent(inout) :: stack_pointer type (field2DReal), pointer :: temp, temp_iter type (field2DReal), pointer :: top_iter type (field1DReal), pointer :: second_iter real (kind=RKIND), dimension(:,:), pointer :: top real (k...
ALGO
0.995582
3.376605
{ "github_metadata": { "branch": "master", "commit_count": 64504, "repo_created_at": "2014-07-03T19:04:08.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 381, "forks": 425, "issues": 535, "pull_requests": 54 }, "file_meta": { "content_id": "...
79f6090e-21f2-49d8-826c-195dde8d9156
siconos/siconos
externals/numeric_bindings/libs/numeric/bindings/atlas/ublas_matr22.cc
// BLAS level 2 //#define BOOST_NO_FUNCTION_TEMPLATE_ORDERING #include <iostream> #include <boost/numeric/bindings/blas/level1.hpp> #include <boost/numeric/bindings/blas/level2.hpp> #include <boost/numeric/bindings/ublas/vector.hpp> #include <boost/numeric/bindings/ublas/matrix.hpp> #include <boost/numeric/bindings/...
ALGO
0.992064
4.232144
{ "github_metadata": { "branch": "master", "commit_count": 9767, "repo_created_at": "2015-06-19T07:55:53.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 178, "forks": 32, "issues": 11, "pull_requests": 1 }, "file_meta": { "content_id": "93a4...
9b46386a-57d8-4177-af2b-c526eaad42a2
cebherrera/Proyecto-de-mate
raiz.cpp
#include "header.hpp" #include <math.h> #include <iostream> using namespace std; Prob1::Prob1() { contadorb = 0; contadorm = 0; error = 0.01; x1b = 0; x2b = 2; x1m = 0; x2m = 2; raizb = 0; raizm = 0; }; bool Prob1::comprobarRaiz(float x1, float x2) { if (fun(x1)*fun(x2) < 0) { return true; ...
ALGO
0.999009
3.634535
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2020-11-15T20:48:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2cf0009e749...
ceda8619-7fe4-44be-9e38-0bd0b9609372
MMuusskkaann/DSA
c++ segment trees/queries_range.cpp
#include<iostream> #include<vector> using namespace std; class SegmentTree{ vector<int> tree; int n; void buildTree(vector<int> &arr, int start, int end, int node) { if (start == end) { tree[node] = arr[start]; return; } int mid = start + (end - start) / 2; ...
ALGO
0.999898
5.534998
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-12-25T15:58: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": "9b398c386f26...
c76b0056-bc2b-4790-bdf1-b1acbd2c3028
UserUnauthorized/OI-Codes
Luogu/P4390.cpp
//HZ - 51.7 //Luogu - P4390 #include<bits/stdc++.h> namespace DEBUG { template<typename T> inline void _debug(const char *format, T t) { std::cerr << format << '=' << t << std::endl; } template<class First, class... Rest> inline void _debug(const char *format, First first, Rest... rest) { ...
ALGO
0.999859
4.365907
{ "github_metadata": { "branch": "main", "commit_count": 673, "repo_created_at": "2022-08-30T03:06:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1ad7d97810...
5cd0c43a-45b1-44ba-bc0c-5fc80fd0c17d
hshi/AFQMCLAB
common/tensorHao/include/tensor_2d_bl_cpu.h
#ifndef TENSOR_2D_BL_CPU_H #define TENSOR_2D_BL_CPU_H #include <vector> #include "tensor_core.h" #include "tensor_hao_ref.h" #include "tensor_hao.h" #include "tensor_element_wise.h" #include "tensor_2d_common_fun.h" namespace tensor_hao { /*************************************/ /*Matrix Multiply C=alpha*A.B+beta*C...
TOOL
0.95619
4.698047
{ "github_metadata": { "branch": "master", "commit_count": 261, "repo_created_at": "2018-10-25T16:43:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "97c45c84...
6635266e-52ed-4f3a-95b8-c2134ac0b119
zukun/rcc
vxl/vxl-1.13.0/contrib/brl/bseg/brec/brec_fg_pair_density.cxx
//: // \file // \brief brec recognition utilities // // \author <NAME> (<EMAIL>) // \date March0 01, 2008 // // \verbatim // Modifications // <none yet> // \endverbatim #include "brec_fg_pair_density.h" #include <vcl_cmath.h> #include <vnl/vnl_math.h> #include <vnl/vnl_erf.h> double brec_fg_pair_density::operator(...
ALGO
0.998706
5.81846
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2013-02-21T15:10:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 14, "forks": 16, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9bf6431...
297379bf-3c75-4f92-b54f-7fc13fe7034f
charmedlabs/pixy
misc/gcc/video/src/conncomp.cpp
// // begin license header // // This file is part of Pixy CMUcam5 or "Pixy" for short // // All Pixy source code is provided under the terms of the // GNU General Public License v2 (http://www.gnu.org/licenses/gpl-2.0.html). // Those wishing to use Pixy source code, software and/or // technologies under different lice...
TOOL
0.900706
5.890353
{ "github_metadata": { "branch": "master", "commit_count": 498, "repo_created_at": "2013-09-24T15:54:10.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 340, "forks": 242, "issues": 10, "pull_requests": 7 }, "file_meta": { "content_id": "eb0c...
0648d2d9-fe8b-4e93-baed-ea6ef04b347f
shivanshsanoria1/LeetcodeSolutions
CPP [1-500]/64.minimum_path_sum [1].cpp
class Solution { public: int solve(vector<vector<int>>& grid, vector<vector<int>>& dp, int i, int j){ int m=grid.size(), n=grid[0].size(); if(i >= m || j >= n) // index out of bounds return INT_MAX; if(dp[i][j] != -1) // result found in dp return dp[i][j]; if(...
ALGO
0.999995
6.193407
{ "github_metadata": { "branch": "main", "commit_count": 196, "repo_created_at": "2024-02-21T17:59: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": "568fc151af...
37f00497-2799-4249-b9cb-b0edbed4d99e
Max00358/2A_Hashing_VirtualMemory
chainImpl.cpp
#include <iostream> #include <cmath> #include "hashTable.hpp" using namespace std; process::~process(){ } chaining::~chaining(){//causes memory leaks? Node *p_temp = *p_table; Node *p_head = *p_table; for(int i = 0; i < get_size(); i++){ p_temp = p_table[i]; p_head = p_table[i]; whi...
ALGO
0.998421
3.395148
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-02-16T00:29: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": "226243028f41...
985baf6f-bb03-491f-a69d-062ae76ffd18
Dj-Polyester/Useful
usefulfunc.cpp
#include <iostream> #include "usefulfunc.hpp" /****************************************************************************************************** * Accepts a stack of integers as a parameter and that * * collapses it by replacing each successive pair of integers with the sum of the pair. ...
ALGO
0.999744
5.544947
{ "github_metadata": { "branch": "master", "commit_count": 73, "repo_created_at": "2019-06-18T13:03: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": "cc34c41ef...
5971bc60-9b32-4e11-9432-f08530c0b9e5
degurii/BOJ
category/math/2997_네번째 수.cpp
/* 문제 상근이는 등차수열을 이루는 정수 4개를 골랐다. 이것은 상근이가 고른 수 4개를 정렬했을 때, 인접한 쌍의 차이가 일정하다는 것을 의미한다. 그 다음 이렇게 고른 숫자 4개를 노래로 만들어서 외우고 다닌다. 어느날, 상근이는 자신이 고른 4개 숫자 중 1개를 까먹었다. 상근이가 고른 네 개의 숫자 중 세 개가 주어졌을 때, 네번째 숫자를 구하는 프로그램을 작성하시오. 입력 첫째 줄에 상근이가 고른 네 개의 숫자 중 세 개가 주어진다. 이 숫자는 크기 순이 아닐 수도 있고, -100보다 크거나 같고, 100보다 작거나 같은 정수이다. 출력 첫째 줄에 네...
ALGO
0.999827
4.128168
{ "github_metadata": { "branch": "master", "commit_count": 281, "repo_created_at": "2017-11-22T21:34:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "c138adfa...
2d8aec58-2bc3-4f6e-8bf7-bda56f840771
CatTailzz/cppTemplate
template/segmentTree.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; // -------------------------线段树------------------------------------ static constexpr int MX = 4e5 + 5; int sum[MX]; bool lazy[MX]; // 初始化线段树, o,l,r = 1, 1, n void build(vector<int> &a, int o, int l, int r) { if (l == r) { // 维护sum ...
ALGO
0.999802
4.110256
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2023-09-05T02:42: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": "78a970b1eb...
eefc56c7-37e1-41bf-bd2d-95115c4bfa6d
sdziho/cpp-projects
T10/Z5/main.cpp
/* TP 16/17 (Tutorijal 10, Zadatak 4) Autotestove pisala <NAME>. Za sva pitanja, sugestije i primjedbe poslati mail na: <EMAIL> Vrsit ce se provjera na prepisivanje tutorijala (na kraju semestra) */ #include <iostream> #include <cmath> #include <iomanip> #define PI 4*atan(1) void PostaviNormalizirano (int &...
TOOL
0.941883
3.890536
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-10-19T18:43: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": "a42f1e6b7d...
8dfe217e-105d-4371-a1cd-8c7f4f6d416e
tony9402/ps-library
src/cpp/basic/range_fenwick_tree.cpp
/* * Problem for Testing Template : https://www.acmicpc.net/problem/10999 * Test : Accepted * Last Updated : 2023.04.01 03:19 PM (KST) */ template<typename T> struct FenwickRU{ // Fenwick Range Update vector<T> tree, add, mul, input; int siz; FenwickRU(){ } FenwickRU(int N) { setSize(N); } voi...
ALGO
0.997938
4.084761
{ "github_metadata": { "branch": "main", "commit_count": 62, "repo_created_at": "2023-03-30T12:02:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "987d3632f72...
75e01e3f-22d9-4b3f-a85f-fd68e9ed2bfb
mindspore-ai/mindspore
mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_adam_cpu_kernel.cc
/** * Copyright 2020-2022 Huawei Technologies Co., Ltd * * 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 * * Unless required by applicabl...
TOOL
0.993757
7.201119
{ "github_metadata": { "branch": "master", "commit_count": 83896, "repo_created_at": "2020-02-11T08:43:48.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4559, "forks": 740, "issues": 181, "pull_requests": 20 }, "file_meta": { "content_id": ...
52c34b77-a8b6-4bca-9117-5e74a04ebc2c
nefuxulinlin/leetcode
leetcode_451.cpp
// 451. Sort Characters By Frequency // https://leetcode.com/problems/sort-characters-by-frequency/#/description #include <string> #include <iostream> #include <map> #include <set> #include <vector> #include <algorithm> using std::string; using std::map; using std::set; using std::vector; class Solution { public: ...
ALGO
0.999996
5.88231
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2016-11-20T15:15: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": "7d75c1744b...
921601b2-4e12-475b-97d1-55dd75aaed08
sujanrupu/Love_Babbar_Supreme_Assignments
Heap/Is Binary Tree Heap.cpp
class Solution { public: int getLength(Node *root) { if(!root) return 0; return 1+getLength(root->left)+getLength(root->right); } bool isCompleteTree(Node* root) { if(!root) return false; int length = getLength(root); queue<Node*>q; q.push(root); ...
ALGO
0.999276
5.556563
{ "github_metadata": { "branch": "main", "commit_count": 130, "repo_created_at": "2024-06-26T16:22:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "895850f96a...
cda92eab-b2a4-44e3-9171-8fe1dfb44122
oldtimerza/TinyRendererView
TinyRenderer/geometry.cpp
#include <stdio.h> #include <vector> #include "buffer.h" #include "geometry.h" #include "texture.h" void line(Vec2f v0, Vec2f v1, Buffer &buffer, Color color) { int x0 = v0.x; int x1 = v1.x; int y0 = v0.y; int y1 = v1.y; bool steep = false; //Transpose the line when working with "steep" lines ...
ALGO
0.981946
5.117572
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2020-07-18T13:54:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7ab634fd8...
ebe9213d-13e0-414a-b8a2-6c4b05270922
Yawn-Sean/Daily_CF_Problems
daily_problems/2024/08/0828/personal_submission/cf1019c_Bonelight.cpp
#include <bits/stdc++.h> using namespace std; #define int long long // #define endl '\n' #define pii pair<int, int> void solve() { int n; cin >> n; ///// auto q = [&](int x){ cout << "? " << x << endl << endl; int r1; cin >> r1; cout << "? " << x + n / 2 << endl << endl; int r...
ALGO
0.999744
3.229052
{ "github_metadata": { "branch": "main", "commit_count": 20410, "repo_created_at": "2024-02-26T01:04:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 478, "forks": 302, "issues": 0, "pull_requests": 7 }, "file_meta": { "content_id": "494a...
e73eaa04-315a-4962-9d13-01eabd38f382
Mehedi-Hassan/Competitive-Programming
codeforces/1343/B.cpp
#include<bits/stdc++.h> #define ll long long #define pii pair<int, int> #define f first #define s second #define sf(a) scanf("%d", &a) #define sfl(a) scanf("%lld", &a) #define pf(a) printf("%d ", a) #define pfl(a) printf("%lld\n", a) #define Case(a) printf("Case %d: ", a) #define FASTIO ios_base::s...
ALGO
0.999918
3.453711
{ "github_metadata": { "branch": "master", "commit_count": 940, "repo_created_at": "2020-12-28T08:00: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": "120b682b...
2d7a43ec-241b-4b7f-bcfe-0ecb308989ad
PointCloudLibrary/pcl
recognition/src/cg/hough_3d.cpp
/* * Software License Agreement (BSD License) * * Point Cloud Library (PCL) - www.pointclouds.org * Copyright (c) 2010-2012, <NAME>, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions ...
ALGO
0.994864
6.336366
{ "github_metadata": { "branch": "master", "commit_count": 14566, "repo_created_at": "2013-02-12T16:40:25.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 10495, "forks": 4656, "issues": 432, "pull_requests": 147 }, "file_meta": { "content_id...
c6e2bd6c-ee1d-4d14-92f2-78c090d153be
npbuckley/CUDAOceanSimulation
ocean.cpp
#include "ocean.h" int log_2_N = (int)log2(N); //vertex vertices[N * N]; vertex* vertices; // Correctness //complex htildeM[N * N]; complex* htildeM; // FFT //complex Dx_Dz[N * N]; complex* Dx_Dz; //complex Dy[N * N]; complex* Dy; butterfly* butterflyMatrix; //complex PingPong[N * N]; complex* PingPong; float ocea...
ALGO
0.999341
3.97762
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-05-09T03:11:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d6d815eb852d...
20ef26f6-5f82-425b-9ad0-70e05c25368b
todimstar/Github-moblie-code
exercise/LeetCode/440周赛/MyQ2_优先队列实现最小堆加二分函数.cpp
//time: 2025.03.10 9:48 https://leetcode.cn/contest/weekly-contest-440/problems/choose-k-elements-with-maximum-sum/submissions/608340784/ #include <vector> #include <queue> //堆一般都被封装成优先队列,cpp是priority_queue<int,(vector<int>),(less<int>/greater<int>))//最大最小堆 #include <algorithm>// Java是PriorityQueu...
ALGO
0.999991
5.482518
{ "github_metadata": { "branch": "master", "commit_count": 121, "repo_created_at": "2024-06-08T03:01: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": "2f70226e...
f3661fa9-0caa-4b59-b15c-653a91c4be4f
thierry-sousbie/DisPerSE
src/delaunay/boxPartition.hxx
/* # Copyright (C) 2009-2013 <NAME> # University of Tokyo / CNRS, 2009 # # This file is part of porject DisPerSE # # Author : <NAME> # Contact : <EMAIL> # # Licenses : This file is 'dual-licensed', you have to choose one # of the two licenses below to apply. # ...
ALGO
0.991658
5.623018
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2015-09-22T00:45:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 44, "forks": 24, "issues": 11, "pull_requests": 0 }, "file_meta": { "content_id": "5564f5...
934db358-9c5e-4a7e-bdbc-b330f32c91aa
hexu1985/demo_code
cpp_lang/cpp_template/apply/sampel_apply.cpp
// ------------- UTILITY--------------- template<int...> struct index_tuple{}; template<int I, typename IndexTuple, typename... Types> struct make_indexes_impl; template<int I, int... Indexes, typename T, typename ... Types> struct make_indexes_impl<I, index_tuple<Indexes...>, T, Types...> { typedef typenam...
TOOL
0.964997
6.229066
{ "github_metadata": { "branch": "master", "commit_count": 940, "repo_created_at": "2017-07-18T10:07:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 5, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "ad9e63e6...
0f646089-9ec7-4b8c-94eb-d99ba713fe8c
fox-flex/sortingAlgorithmsComparison
sortingAlgos.cpp
//#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; using namespace std::chrono; #define all(x) (x).begin(),(x).end() #define forn(i, n) for (int i=0; i<n;++ i) #define forlr(i, l, r) for (int i=l; i<=r; ++i) #define forrl(i, r, l) for (int i=r; i>=l; --i) typedef long long ll; typedef vector<...
ALGO
0.998295
4.580437
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-10-06T08:07:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "79750136daf7...
eaf25bd5-9a7b-45ec-9bdb-8f2ea5752a1d
yoloeww/Basic-Code-Library
2021.7.24.链表4.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> struct student { char name[20]; float math; }; struct node { struct student data; struct node *next; }; struct node* create() { struct node *head = (struct node*)malloc(sizeof(struct node)); head->next = NULL; return head; } //创建结点 s...
ALGO
0.999884
3.585855
{ "github_metadata": { "branch": "main", "commit_count": 250, "repo_created_at": "2021-02-22T13:32: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": "54f9952c26...
ab985600-8d67-45cc-84e0-d023a6496536
JWHennessey/how2sketch
igl/lu_lagrange.cpp
// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2013 <NAME> <<EMAIL>> // // This Source Code Form is subject to the terms of the Mozilla Public License // v. 2.0. If a copy of the MPL was not distributed with this file, You can // obtain one at http://mozilla.org/MPL/2....
ALGO
0.999261
6.096975
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2017-03-14T16:24:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 38, "forks": 10, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "80f335d2...
7da3c2a5-0196-46a0-924d-05dab4348278
Arihant416/dsa-daily
arrays/leaders_in_an_array.cpp
/* Author : <NAME> github:https://github.com/Arihant416 linkedin : https://www.linkedin.com/in/arihant416 */ #include <bits/stdc++.h> using namespace std; #define ll long long int #define ull unsigned ll #define PB push_back #define MP make_pair #define flash ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie...
ALGO
0.999979
4.519757
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2022-08-07T09:57: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": "53b3bded5...
edb1054d-a809-42b2-9200-aa512da47962
Souma-cpp/Cpp-Journey
L59_to_L70/Stack/valid_parenthesis.cpp
#include<iostream> #include<string> #include<stack> using namespace std ; bool balance(string str){ stack<char>s ; //{[()]} for(int i = 0 ; i < str.length() ; i++){ char ch = str[i] ; //either ch is an opening or a closing bracket if(ch == '(' || ch == '{' || ch == '['){ s...
ALGO
0.996908
5.626408
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-06-14T08:05: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": "60fe53d82886...
6f911737-1e00-462b-ad32-94cd55fc8694
nianovela16/Praktikum-Struktur-Data-Semester-2
MODUL 8/unguided1.cpp
//<NAME> ( 2311102057 ) #include <iostream> using namespace std; void selectionSort(string &huruf, int n) { int i, j, min057; for (i = 0; i < n - 1; i++) { min057 = i; for (j = i + 1; j < n; j++) if (huruf[j] < huruf[min057]) min057 = j; char temp = huruf...
ALGO
0.999937
4.888158
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2024-03-10T14:10: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": "ae6720d402f...
ba00f761-d93d-43a3-aeec-6976cd6fd58d
lucasbivar/competitive-programming
competitions/OBI-Brazilian_Olympiad_in_Informatics/PHASE_3/OBI_2019/etiquetas.cpp
//30/100 points #include <iostream> #include <vector> #include <queue> using namespace std; struct sets{ int i, f; long long s; }; struct comp{ bool operator()(sets const& c1, sets const& c2){ return c1.s > c2.s; } }; int main(){ cin.tie(NULL); cout.tie(NULL); //ios::sync_with_std...
ALGO
0.999979
3.314947
{ "github_metadata": { "branch": "master", "commit_count": 95, "repo_created_at": "2020-08-13T00:30: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": "fc586cef6...
eead9bb0-5b25-46db-ad72-1b61b81d2c8e
liuyubobobo/Play-Leetcode
LC/LCP021/cpp-LCP021/main.cpp
/// Source : https://leetcode-cn.com/problems/Za25hA/ /// Author : liuyubobobo /// Time : 2021-02-06 #include <iostream> #include <vector> #include <unordered_set> #include <queue> using namespace std; /// Loop finding and BFS /// Time Complexity: O(n) /// Space Complexity: O(n) class Solution { public: int ...
ALGO
0.999942
5.457386
{ "github_metadata": { "branch": "master", "commit_count": 2592, "repo_created_at": "2016-12-01T17:08:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2732, "forks": 718, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "b3...
0af66396-652a-4c43-9471-1360ca689b0e
SKY-LEO/OAiP2_7
OAiP2_7/Source.cpp
/* * Линейная интерполяция */ #include <iostream> #include <conio.h> using namespace std; const double A = 1.; const double B = 4.; const int M = 11; const int N = 12; void createTable(double a, int m, double h, double* arr); void calculateApprox(double a, int n, double h_approx, int m, double*& arr, double* arr_ap...
ALGO
0.999338
4.404593
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2022-05-03T15:59:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1d17b9f581...
18c43727-49e3-4e07-9b4f-3ef6e216799e
yu3mars/proconVSCodeGcc
atcoder/others/keyence/2019/d.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using pii = pair<int, int>; #define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i) #define all(x) (x).begin(),(x).end() #define m0(x) memset(x,0,sizeof(x)) int dx4[4] = {1,0,-1,0}, dy4[4] = {0,1,0,-1}; int main(){ in...
ALGO
0.999997
4.292971
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2018-10-03T10:17: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": "22847c048...
3b29044f-3f38-4277-9d0b-12efc3549861
cran/glmmLasso
src/RcppExports.cpp
// Generated by using Rcpp::compileAttributes() -> do not edit by hand // Generator token: <PASSWORD> #include <RcppEigen.h> #include <Rcpp.h> using namespace Rcpp; #ifdef RCPP_USE_GLOBAL_ROSTREAM Rcpp::Rostream<true>& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get(); ...
ALGO
0.985135
6.310771
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2014-03-13T04:52:57.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 8, "forks": 7, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "07b2ab3f73...
de087e9d-9cbe-465a-adb1-89b736244f45
wrf-model/WRF
var/da/da_gpseph/da_mdl_ref_to_eph.inc
SUBROUTINE da_mdl_ref_to_eph (gps_rays, ref_mean_h, model_eph) !--------------------------------------------------------------------------------------- ! Purpose: calculate model excess phase ! (Chen et al., 2009, doi:10.3319/TAO.2007.11.29.01(F3C)) ! It is called by da_get_innov_vector_gpseph. !-...
ALGO
0.993387
4.630788
{ "github_metadata": { "branch": "master", "commit_count": 6746, "repo_created_at": "2016-08-16T20:39:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1417, "forks": 765, "issues": 161, "pull_requests": 21 }, "file_meta": { "content_id": "...
6123235c-eca0-4f71-a8d7-6406320f9ce7
yosupo06/library-checker-problems
polynomial/log_of_formal_power_series_sparse/sol/correct.cpp
#include <iostream> #include <vector> #include <cassert> #include <cstdint> using namespace std; using u32 = unsigned int; using ll = long long; template <u32 mod> struct modint { static constexpr bool is_modint = true; u32 val; constexpr modint(const ll val = 0) noexcept : val(val >= 0 ? val % mod : (mo...
ALGO
0.999932
4.35408
{ "github_metadata": { "branch": "master", "commit_count": 3115, "repo_created_at": "2019-05-30T20:49:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 589, "forks": 137, "issues": 98, "pull_requests": 3 }, "file_meta": { "content_id": "35...
fe13924f-67a8-45ce-9378-d1ace55a9ffa
MariaChrysafis/CompetitiveProgramming
CEOI/2012/job_scheduling.cpp
/* * 8 2 12 1 2 4 2 1 3 5 6 2 3 6 4 */ #include <iostream> #include <vector> #include <algorithm> #include <cassert> #include <cmath> #include <iomanip> #include <map> #include <queue> using namespace std; int N, D, M; vector<vector<int>> myMap; vector<int> days; pair<bool, vector<vector<int>>> valid (int machines)...
ALGO
0.999974
3.549057
{ "github_metadata": { "branch": "main", "commit_count": 2959, "repo_created_at": "2020-11-28T04:57:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "5315c1940...
dc8fcda6-9b0a-42c0-8071-9bfdee9822ed
Yash-YC/Source-Code-Plagiarism-Detection
gcj/gcj/188266/spencer/168107/0/extracted/multibase.cpp
#include <stdio.h> #include <iostream> #include <sstream> #include <ext/hash_set> #include <vector> using namespace std; using namespace __gnu_cxx; #define REP(i,n) for(int i=0;i<n;i++) #define FOR(i,a,b) for(int i=a;i<=b;i++) #define FOREACH(it,c) for(__typeof(c.begin())it=c.begin();it!=c.end();it++) typedef vector<in...
ALGO
0.998984
3.558396
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2021-08-24T05:46:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "17b34bdfb52...
c3ef973f-da2f-47e4-a7da-ebb6da2ae68e
Arnab-31/DSA-Problem-Series
Graph/Shoartest Path in DAG(M#).cpp
#include<iostream> #include<algorithm> #include<vector> #include<unordered_map> #include <stack> #define INT_MAX 10000 #define ll long long int using namespace std; class Solution{ public: void topoSort(int v, vector<pair<int,int>>adj[], stack<int>&st, int vis[]){ vis[v] = 1; for(auto i: adj[v]){ if(vis[i.fir...
ALGO
0.999984
4.567861
{ "github_metadata": { "branch": "main", "commit_count": 221, "repo_created_at": "2020-11-09T22:59:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "26e24660c5...
97e1268e-2edc-4cc9-a690-68b34d415457
ShubaDuba/hometasks
First semester/HW3-1/HW3-1/Source.cpp
#include <stdio.h> #include <locale.h> void insertSort(int a[], int left, int right)//сортировка вставками { for (int i = left + 1; i < right + 1; ++i) { int tmp = a[i]; int j = i - 1; while (j >= 1 && a[j] > tmp) { a[j + 1] = a[j]; j = j - 1; } a[j + 1] = tmp; } } void superQuickSort(int a[], in...
ALGO
0.999921
3.853254
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2013-02-20T17:20: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": "198396d69...
d780d8c1-5a14-40b1-ab9b-58c4c80e3245
sanjeetboora/Launchpad_29Dec2019
Lecture35/fib.cpp
#include <iostream> using namespace std; int fibRec(int n) { if (n == 0 || n == 1) { return n; } int nthFibonacci = fibRec(n - 1) + fibRec(n - 2); return nthFibonacci; } //memoization int fibTopDownDP(int n, int* memo) { if (n == 0 || n == 1) { memo[n] = n; return memo[n]; } // if nth fib is already cal...
ALGO
0.999986
4.476296
{ "github_metadata": { "branch": "master", "commit_count": 48, "repo_created_at": "2019-12-30T07:17:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 10, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "3ad1ac12...
e0689126-3077-42cd-adef-0e94adfee6d4
5ei74R0/Library
Graph/MinimumSpanningTree_Kruskal.cpp
#include <bits/stdc++.h> /* GRAPH_TEMPLATE ===========================================*/ template<typename T> struct Edge { int_fast32_t to; // 辺の行き先 T cost; // 辺の重み Edge(int_fast32_t t, T w): to(t), cost(w) {} }; template<typename T = int_fast32_t> using W_Graph = std::vector<std::vector<Edge<T>>>; /...
ALGO
0.999886
4.269854
{ "github_metadata": { "branch": "master", "commit_count": 65, "repo_created_at": "2020-02-20T07:33:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9b095bc8f...
79a92126-3fbd-4d30-b866-297ef043d3cc
blackeye18/Curves-Lsh-Hypercube-Clustering
Clustering/examples/main_clustering.cpp
#include <iostream> #include <cstring> #include <vector> #include <cctype> #include <fstream> #include <sstream> #include <random> #include <chrono> #include <map> #include <cassert> #include <queue> #include <bitset> #include <algorithm> using namespace std; using namespace std::chrono; #include "classes_and_defin...
ALGO
0.991767
3.709626
{ "github_metadata": { "branch": "master", "commit_count": 75, "repo_created_at": "2021-11-30T22:46:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2fdcf39d5...
3261fa0a-9c27-4866-b0a5-71bbecee8e75
janerque/final_ads
Final/e.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 10; int used[N],n, y[N], x[N]; void dfs(int v, int m){ used[v] = 1; for(int i = 0; i < n; ++i){ if(used[i] || abs(x[i] - x[v]) + abs(y[i] - y[v]) > m) continue; else dfs(i, m); } } int main(){ ...
ALGO
0.999981
4.707095
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-12-22T08:54: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": "b28de6628d...
9efc99a5-6aae-4efb-8f68-d2f28fb4347c
dannguyenmessi1705/Cpp
Queue1-SDT.cpp
/*Huyền có một cái điện thoại, màn hình điện thoại của Huyền chỉ hiển thị được tối đa k tin nhắn. Màn hình của Huyền hiện thị như sau: Không hiện thị 2 tin nhắn của cùng một số điện thoại (SĐT) trên cùng một khung hình, nếu SĐT a gửi tin nhắn đến mà trên màn hình đã có tin nhắn của SĐT a thì màn hình không thay đổi gì...
ALGO
0.999987
3.791923
{ "github_metadata": { "branch": "master", "commit_count": 167, "repo_created_at": "2022-08-20T13:52: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": "92529b35...
de3e1fb1-b7ec-4edd-a1ca-9d08b84b3f5b
yutarchery/GitCoder
PAST/PAST15/F.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> Pii; typedef pair<int, ll> Pil; typedef pair<ll, ll> Pll; typedef pair<ll, int> Pli; typedef vector<vector<ll>> Mat; #define fi first #define se second const ll MOD = 1e9 + 7; const ll MOD2 = 998244353; c...
ALGO
0.999995
4.48625
{ "github_metadata": { "branch": "main", "commit_count": 1429, "repo_created_at": "2021-04-20T14:39: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": "96787158a...
3667e669-355a-47aa-bb1e-33f492e90940
repalash/Open-Shaders
Engines/G3D/DeepGBuffer/DepthOfField/DepthOfField_blur.pix
// -*- c++ -*- /** \file VVDoF_blur.pix Computes the near field blur. This is included by both the horizontal (first) and vertical (second) passes. The shader produces two outputs: * blurResult A buffer that is the scene blurred with a spatially varying kernel kernel that attempts to make the point-spre...
ALGO
0.997501
6.733078
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2021-02-03T19:52:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 137, "forks": 15, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ce2d060...
95703ee9-41a9-419c-8a3c-8b95dc26eedd
sidereumare/coding_test_note
baekjoon/1780.cpp
#include <bits/stdc++.h> using namespace std; int paper[3000][3000]; int cnt[3] = {0,0,0}; void calc(int sx, int sy, int size){ int start = paper[sy][sx]; bool isOneColor = true; for(int i =sy; i<sy+size; i++){ for(int j = sx; j<sx+size; j++){ if(paper[i][j]!=start){ isOn...
ALGO
0.999822
4.667737
{ "github_metadata": { "branch": "main", "commit_count": 42, "repo_created_at": "2022-01-14T06:14: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": "2d73891615b...
7200ec51-a679-43bd-b5af-ac11540192da
Xiatelly/cpp_lessons
game5/game5/main.cpp
// Include libraries #include <cstdio> #include <cstdlib> #include <ctime> #include <Windows.h> #include <conio.h> #include <cctype> #include <cstring> #include "consoleColor.h" #include "level.h" #include "weaponType.h" #include "unitType.h" #include "unitData.h" //////////////////////////////////////////// // Con...
TOOL
0.916358
4.024937
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2024-02-11T22:42:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "940f9d57ef4...
d8b8c9d4-a23f-4106-9d4f-5032acf0cafa
YanLi26/leetcode
206. Reverse Linked List.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* reverseList(ListNode* head) { if(!head) return head; //pre is a ListNode which point to the first element ...
ALGO
0.9998
5.636382
{ "github_metadata": { "branch": "master", "commit_count": 147, "repo_created_at": "2016-10-26T00:36:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "42d9242b...
963b8c25-b5d1-4909-9a93-6676ded3d0eb
vijayjoshi16/DSA-AND-COMPETITIVE-PROGRAMMING
00.Array/13.CountPairsWithGivenSum.cpp
#include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function template for C++ class Solution{ public: int getPairsCount(int a[], int n, int k) { // code here unordered_map<int,int> m; for(int i=0;i<n;i++) m[a[i]]++; int tctr=0; for(int ...
ALGO
0.999794
6.08672
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2020-09-10T12:33:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f71e18316...
47784bde-0d7a-4ccb-9030-e824b44f53e9
lazygupta/Coding-Problems
Sliding Window/239.SlidingWindowMaximum.cpp
// So, The prblm states that you are given with an array of +ve and -ve numbers // You just have to store all the maximum elements of all the subarrays of size k in an seperate array //As we all know by seeing subarrays questions we can do it using Sliding Window Algorithm // O(n+k) , where n is the size of the array ...
ALGO
0.999986
5.697981
{ "github_metadata": { "branch": "master", "commit_count": 285, "repo_created_at": "2023-07-04T17:48: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": "89d69e50...
7c979ac0-cf4c-432d-8953-e5d2d51d2f07
zyadhany/LeetCode_DailyChallenge
2023/10- October/06- Integer Break.cpp
// Time O(1), memory O(1) class Solution { public: int integerBreak(int n) { if (n <= 3) return (n - 1); int k = n / 3, r = n % 3; if (r == 1) return (pow(3, k - 1) * 4); return (pow(3, k) * pow(2, r / 2)); } }; // Dp solution -> Time O(nlog(n)), memory O(n) class Solution { ...
ALGO
0.999997
5.711182
{ "github_metadata": { "branch": "main", "commit_count": 66, "repo_created_at": "2023-09-02T17:18:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "acee969f6a7...
ac365f0f-058b-49b7-ad9a-6b6a57c7e52f
DionysiosB/CodeForces
0600-0699/658A-BearAndReverseRadewoosh.cpp
#include <iostream> #include <vector> long actualPoints(long points, long time, long c){ return (points >= (c * time)) ? (points - c * time) : 0; } int main(){ long n, c; std::cin >> n >> c; std::vector<long> scores(n); std::vector<long> minutes(n); for(int p = 0; p < n; p++){std::cin >> score...
ALGO
0.999991
4.014137
{ "github_metadata": { "branch": "master", "commit_count": 4487, "repo_created_at": "2013-06-27T18:15:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 690, "forks": 163, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "631...
810d212d-a885-42f1-b6cb-196d49c4f9ef
LevinJ/Pedestrian-Detection-Project
src/stereo_matching/qingxiong_yang/qx_post_processing.cpp
#include "qx_basic.hpp" #include "qx_post_processing.hpp" namespace { ///*bilateral filtering*/ unsigned char euro_dist_rgb_max(const unsigned char *a,const unsigned char *b) { unsigned char x,y,z; x=abs(a[0]-b[0]); y=abs(a[1]-b[1]); z=abs(a[2]-b[2]); return(max(max(...
ALGO
0.996449
5.46089
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2015-01-10T23:27:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 23, "forks": 21, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "fe27d81...
ee888da6-62a6-4e33-8d32-595a39aab6b5
LuciusKyle/LeetCode
0954_Array_of_Doubled_Pairs/0954.cc
#include <limits.h> #include <unordered_map> #include <vector> using std::vector; class Solution { public: bool canReorderDoubled(const vector<int>& arr) { int max_positive_val = INT_MIN, min_positive_val = INT_MAX, zero_counter = 0, closest_negative_val = -100000, furtherest_negatie_val = 0; std::unorde...
ALGO
0.999537
5.551924
{ "github_metadata": { "branch": "master", "commit_count": 727, "repo_created_at": "2018-04-11T07:43: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": "b8905773...
50233021-edbc-4679-8203-6d85ba3e3897
ishandutta2007/codeforces-m
marckess/normal/1644/A.cpp
// Powered by CP Editor (https://cpeditor.org) #include <bits/stdc++.h> #define endl '\n' #define fi first #define se second #define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k)) #define forn(i,n) for (int i = 0; i < int(n); i++) #define forr(i,a,b) for (int i = int(a); i <= int(b); i++) #define all(v) v.begin(), v.end() #...
ALGO
0.999799
4.862669
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-06-06T01:03: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": "924f54ec3353...
bbedcea4-2780-464e-a1b9-f19f9d360a3e
Mr-Second/The-sword-refers-to-offer
47.cpp
/* https://leetcode-cn.com/problems/shu-zi-xu-lie-zhong-mou-yi-wei-de-shu-zi-lcof/ */ #include <string> #include <iostream> #include <cmath> using namespace std; class Solution { public: int findNthDigit(int n) { if(n < 0) return -1; long long level = 1; int targetNum = -1; ...
ALGO
0.999778
4.652608
{ "github_metadata": { "branch": "master", "commit_count": 91, "repo_created_at": "2020-07-23T07:00:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "54094dc20...
c8cc3ce4-aa36-4ece-882d-c4b4f51ae6e5
anurag-111/Daily-Code-Submissions
Medium/Count Inversions/count-inversions.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution{ public: // arr[]: Input Array // N : Size of the Array arr[] // Function to count inversions in the array. long long merge(long long arr[], long long temp[], long long low, long long mid, long...
ALGO
0.999821
5.682506
{ "github_metadata": { "branch": "main", "commit_count": 888, "repo_created_at": "2023-02-01T18:01: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": "d703c41725...
b802f5e9-1d32-4369-9b35-f8aa726239b9
JesseZ332623/CPP_Core_Guidelines_Analysis
src/Forwarding/forwarding.cpp
#include <utility> #include <iostream> /** * @brief 使用 std::forward 对用户传入的参数进行完美转发(即保持左值的左值性,以及右值的右值性) * * @tparam Type~TypeN 使用形参包,可以将 n 个数据打包。 * * @param typeN 用户传入的 n 个数据的右值引用,都会通过形参包打包。 * * @return 将形参包中的数据全部解包,转发到某个类型的构建函数中,构造出一个临时对象,最后通过移动语义返回。 */ template <typename Type, typename ... TypeN> Type ...
TOOL
0.957311
5.730748
{ "github_metadata": { "branch": "master", "commit_count": 111, "repo_created_at": "2024-01-09T08:50:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9092da8a...
861e2dfc-7399-4982-806c-66cd8a957f42
prateek27/Coding-Problems
Linked Lists/8. K Reverse in a linked list.cpp
#include<iostream> #include<stack> using namespace std ; struct node{ int data; struct node*next; }; //-----------------------------------------New Node struct node*newNode(int data){ struct node*temp = new struct node; temp->data = data; temp->next = NULL; return temp; } //-------------------------------------------...
ALGO
0.999977
4.677778
{ "github_metadata": { "branch": "master", "commit_count": 59, "repo_created_at": "2014-12-11T11:27:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 103, "forks": 91, "issues": 0, "pull_requests": 8 }, "file_meta": { "content_id": "f68d32...
e95240b8-9c03-4ea2-a83b-46f764a7c3ff
BrandonDSommerfeld/Problem-Solving
Code/problem18.cpp
#include <iostream> #include <string> #include <utility> #include <vector> #include "math_unsigned.cpp" int main () { //Given this triangle, finds path from top to bottom with greatest sum std::string nums{"75 " "95 64 " "17 47 82 " "18 35 87 10 " "20 04 82 47 65 " "19 01 23 75 03 34 " "88 02 77 73 07 63 67 " ...
ALGO
0.999627
4.528831
{ "github_metadata": { "branch": "main", "commit_count": 86, "repo_created_at": "2020-10-25T22:46: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": "d1c29f88dd7...
daa4c588-b730-4c74-bf78-51dd7655bd4e
Shikhar-S/Analysis-of-Competitive-Codebase
Data/Contest1236/all/29089177_62810976.cpp
// IN THE NAME OF ALLAH. #include <bits/stdc++.h> using namespace std; #define int long long #define F first #define S second #define pb push_back const int N = 1000 * 100 + 100; set<int> row[N], col[N], rrow[N], rcol[N]; bool checkRow(int x1, int y1, int x2, int y2){ for(int i = x1; i < x2; i++){ for(int j = y1;...
ALGO
0.999996
4.44465
{ "github_metadata": { "branch": "master", "commit_count": 74, "repo_created_at": "2019-11-22T14:40: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": "f18645aad...
6963752c-d5ab-4cf4-8df6-d3103e0d90b7
LidaGuo1999/Coding_Solution
Leetcode/c++/21-合并两个有序链表.cpp
/* 将两个升序链表合并为一个新的升序链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 */ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ // 一个使用链表的归并排序中的“合并”步骤而已。人工构造一个头节点,其next指针指向返回链表的第一个节点即可。 // 8ms, 80.16%; 7.3MB, 100%; class Solution { ...
ALGO
0.999957
5.71608
{ "github_metadata": { "branch": "master", "commit_count": 57, "repo_created_at": "2020-01-03T14:03: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": "a756031bb...
ca21d643-f8c5-4923-a132-24cc8b312050
Bing-Raymond/C-programming
6_11/Source.cpp
// 函数指针实例 #include <iostream> using namespace std; // 一个函数 void print_stuff(float data_to_ignore); void print_message(float list_this_data); void print_float(float data_to_print); // 一个函数指针,声明一个函数时,也要说明函数的 // 返回值 和 形式参数 列表。 void(*function_pointer)(float); // 对比一下。 void function2(float a, float b); // 形参列表要列出来。 void(*fu...
TOOL
0.917034
4.392208
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-02-02T13:11: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": "a3b49dbeca5a...
34211e7c-682a-42a2-acda-5ebf785c7a87
FranzEricSchneider/image_stitching
a_star.cpp
#include "a_star.h" #include "random_points.h" void AStar::generateStartEndPoints() { int numOuterPoints = static_cast<int>(m_convexHull.size()); int halfOuterPoints = numOuterPoints / 2; m_startIdxConvex = randomNumber(halfOuterPoints); m_endIdxConvex = m_startIdxConvex + halfOuterPoints; m_start...
ALGO
0.996199
4.298212
{ "github_metadata": { "branch": "master", "commit_count": 30, "repo_created_at": "2016-01-26T03:13:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dea9a5e2f...
edae75e4-e9b3-428b-9ac2-232c0e1c7b43
WayneWei228/Algorithm
AdventOfCode/2018/Solution/08.cpp
#include <cstdio> #include <functional> #include <vector> using namespace std; struct Solution { vector<int> Input; int Position; // static 修饰函数 // 表示此函数不需要传入 this // 也不能访问成员变量 // 相当于定义在struct之外 // ❌ // Student s; // s.xx() // ✅ // Student::xx() static int Method0(const...
ALGO
0.999906
3.538664
{ "github_metadata": { "branch": "main", "commit_count": 91, "repo_created_at": "2022-08-08T06:28:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "98fd7a82b8e...
b942ffa3-9479-4bfe-b0d9-f8c064a928ba
rasauq1122/100PS-per-one-month
2022.04/19D.cpp
#include <bits/stdc++.h> #define INF ((1LL<<31)-1) #define LINF ((1LL<<61)-1) #define MOD 1000000007 #define MOD2 998244353 #define TC() int CASE_N;cin>>CASE_N;for(int CASE_I=1;CASE_I<=CASE_N;CASE_I++) #define FIX(a) cout<<fixed;cout.precision(a); #define rep(i,j,k) for(int i=(j);i<(k);i++) #define repe(i,j,k) for(i...
ALGO
0.99986
4.367128
{ "github_metadata": { "branch": "master", "commit_count": 145, "repo_created_at": "2022-04-01T08:51: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": "55c4b5d7...
693e1df9-995d-4533-8433-741e00faa4b4
almoskov/robomaze
misc/ino/arraysensor/mazenav.cpp
// MazeNavigation.cpp - Implementations for MazeExplorer methods #include "mazenav.h" // Replace these stubs with your actual motor control and sensor logic #include <Arduino.h> #include <AFMotor.h> #include <QTRSensors.h> // === Motor Setup === // AF_DCMotor motor1(1, MOTOR12_1KHZ); AF_DCMotor motor2(2, MOTOR12_1KHZ...
ALGO
0.989426
6.175392
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2025-03-22T10:53: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": "ce9671a7d70...
61ce7e39-ff51-4050-bbec-ad2a50c900d3
TomorrowIppo/ROKA_BOJ
Just/BOJ_16566.cpp
#include <bits/stdc++.h> #define MAX 4000001 using namespace std; int N, M, K; int parent[MAX]; vector<int> my_deck; int find_root(int x) { if(x == parent[x]) return x; return parent[x] = find_root(parent[x]); } void merge(int x, int y) { x = find_root(x); y = find_root(y); // 큰 값을 부모로 if(x...
ALGO
0.999993
4.204986
{ "github_metadata": { "branch": "main", "commit_count": 180, "repo_created_at": "2024-01-25T12:57: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": "080c1016a5...
10193784-b952-458f-8359-39c71a53af4f
AbigailWilliams1/Leetcode-Daily
exercise/1619.cpp
/* 1619. 删除某些元素后的数组均值 难度:简单 给你一个整数数组 arr ,请你删除最小 5% 的数字和最大 5% 的数字后,剩余数字的平均值。 与 标准答案 误差在 10-5 的结果都被视为正确结果。 链接:https://leetcode.cn/problems/mean-of-array-after-removing-some-elements/ 执行用时:4 ms, 在所有 C++ 提交中击败了94.02% 的用户 内存消耗:9.5 MB, 在所有 C++ 提交中击败了5.65% 的用户 通过测试用例:50 / 50 */ #include<bits/stdc++.h> using na...
ALGO
0.999736
5.45158
{ "github_metadata": { "branch": "main", "commit_count": 47, "repo_created_at": "2022-09-22T15:57: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": "19f65be4c53...
aaf23a82-a28d-4742-ab0f-724ffc28e6b6
ADVRHumanoids/ct
ct_core/include/external/cppad/cg/model/model_c_source_gen_for1.hpp
#ifndef CPPAD_CG_MODEL_C_SOURCE_GEN_FOR1_INCLUDED #define CPPAD_CG_MODEL_C_SOURCE_GEN_FOR1_INCLUDED /* -------------------------------------------------------------------------- * CppADCodeGen: C++ Algorithmic Differentiation with Source Code Generation: * Copyright (C) 2012 Ciengis * * CppADCodeGen is distrib...
TOOL
0.988671
6.09244
{ "github_metadata": { "branch": "discrete_DMS", "commit_count": 1447, "repo_created_at": "2018-09-24T08:42:32.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "06...
cb56ba82-4833-4c76-ab7d-370317caff2b
Mazul99/CompetitiveProgrammig-repo
CODEFORCES/IMPLEMENTATION/A_Eugeny_Array.cpp
//A. Eugeny and Array // https://codeforces.com/contest/302/problem/A #include<bits/stdc++.h> #define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define endl '\n' #define fi first #define se second #define all(x) x.begin(),x.end() #define PB(x,y,z) x.push_back({y,z}) using namespace std; typedef p...
ALGO
0.999957
3.285293
{ "github_metadata": { "branch": "main", "commit_count": 265, "repo_created_at": "2022-01-19T06:40: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": "3966212121...
c51ec91f-f85f-4ce3-907e-25df548f3a31
BlitW0/cp-codes
codechef/C00K0F.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while(t--) { int n; cin >> n; bool a = 0, b = 0, c = 0, d = 0, e = 0; for(int i = 0; i < n; i++) { string s; cin >> s; if(!a && s == "cakewalk") a = 1; if(!b && s == "simple") b = 1; if(!c && s == "easy") c = 1; ...
ALGO
0.999663
3.987506
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-09-01T18:08:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7891c4719f...
8cdf7f68-82b5-43cb-b283-23357ec0ab8c
drynor/CP-Templates
Data Structures/SparseTable.cpp
struct min_st{ int n; vector< int > lg; vector< vector< int > > st; void init(vector< int > &arr){ n = (int)arr.size(); lg.resize(n + 1 , 0); lg[1] = 0; for(int i = 2;i <= n;i++){ lg[i] = lg[i - 1]; if(i == (1 << (lg[i] + 1))) lg[i]...
ALGO
0.999996
4.490699
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2025-07-12T10:55: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": "b7444689862...
b3bb7539-7e58-45bf-9efd-bc56128985db
jonatas57/adventofcode
2023/01/cpp/01.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<bool> vb; typedef pair<int, int> ii; const int INF = 0x3f3f3f3f; const ll INFLL = 0x3f3f3f3f3f3f3f3fll; #define each(x, s) for(auto& x : s) #define loop(x) for(int i = 0;i < x;i...
ALGO
0.999252
4.56233
{ "github_metadata": { "branch": "main", "commit_count": 118, "repo_created_at": "2021-12-02T00:38: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": "0083517dc0...
571eeb5f-05cb-4682-85db-8ce91b2d7a70
meiyoumingzile/ICPC_AlgorithmTemplete
ICPC_AlgorithmTemplete/数论组合数学/组合数学的数列计数问题/菲波那切Fibonacci数列/题目/P1306.cpp
#include<bits/stdc++.h> //#include<windows.h> using namespace std; #define ll long long #define inf 1e-5 const int INF=1<<30; const int MAX=1000000; const int mod=1e8; ll gcd(ll a,ll b){ return b?gcd(b,a%b):a; } struct M{ int m,n; ll **mat; void init(int n,int m){ this->n=n; this->m=m;...
ALGO
0.999996
3.608916
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2018-11-29T13:30:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "499003aaa...
14e05d1f-ce63-4b37-9ddf-68587454b2f8
NiksBrn/Brownian_motion
src/Render.cpp
#include "Render.h" // Отрисовка тел void drawBodies() { for (const auto& body : bodies) { glBegin(GL_TRIANGLE_FAN); glColor3f(body.r, body.g, body.b); // Красный цвет glVertex2f(body.x, body.y); // Центр круга for (int i = 0; i <= 360; i += 10) { double angle = i * 3.14159f / 180.0f; ...
ALGO
0.986713
4.406167
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2025-03-18T12:40: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": "4a7492212bb...
ef778080-5789-4b1c-9c73-e24a3d98b8d1
JihoonJang/grad
FibonacciHeap/FibonacciHeap.cpp
/** * @file FibonacciHeap.cpp * @author jhjang * @brief * @version 0.1 * @date 2021-01-19 * * @copyright Copyright (c) 2021 * */ #include "./FibonacciHeap.h" #include <vector> #include "./debug.h" namespace fib { template <typename ValType> void Node<ValType>::insertChild(Node<ValType> *child) { assert(th...
ALGO
0.999491
4.087636
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2020-09-15T00:17: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": "d6256a1c3...
50bb0504-4d6d-43e9-a305-4da9cd3fd4dd
atubo/online-judge
luogu/P4770.cpp
// https://www.luogu.com.cn/problem/P4770 // [NOI2018]你的名字 #include <bits/stdc++.h> using namespace std; // Note graph node is 0-indexed class Graph { public: struct Edge { int next, to; }; vector<int> head; int eidx; int N, M; Edge *E; Graph(int N_, int M_):N(N_), M(M_) { head.resize(N); ...
ALGO
0.999975
4.855872
{ "github_metadata": { "branch": "master", "commit_count": 2295, "repo_created_at": "2013-10-03T04:23:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c26fbdb...
a7151a1e-ebe2-4418-81a7-1a564bdbd18f
NVIDIA/cccl
libcudacxx/include/cuda/std/__algorithm/equal.h
//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // SPDX-FileCopyrightText: Copyrigh...
ALGO
0.998937
7.264574
{ "github_metadata": { "branch": "main", "commit_count": 11478, "repo_created_at": "2020-09-17T18:58:41.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1794, "forks": 242, "issues": 1001, "pull_requests": 158 }, "file_meta": { "content_id": ...
4fbe03ac-75ac-417d-8803-00c13781ab5c
li779/SPGrid_exp
vdbnano_exp/main.cpp
#include "vdb_nano.h" #include "Timer.h" #include <math.h> #include "Laplacian.h" #include "SPGridOperator.h" // #define XDIM 512 // #define YDIM 512 // #define ZDIM 512 // #define LIMIT 0.001 using namespace vdb; enum MyFlags : uint32_t { uExistsFlag = 0x00000001, LuExistsFlag = 0x00000002 }; using VDBTree...
ALGO
0.997337
5.200564
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2020-07-21T06:48:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a291c1106c...
36112eb4-25b5-42a5-81fa-3e40fc160577
shivangisehgal/ds-algo
STRIVER/13-TREES/14-top-View-of-BT.cpp
//not on LC //basically, we have to return first node of each vertical //we can use a map<vertical, node value> //and use any traversal to traverse the tree. I prefer level //In case, vertical is not present, add to map. //TC: O(N) + O(N) //SC: O(N) vector<int> getTopView(TreeNode<int> *root) { // Write your cod...
ALGO
0.999938
5.352359
{ "github_metadata": { "branch": "main", "commit_count": 453, "repo_created_at": "2022-07-18T10:30:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "32b6b26545...
19367343-5fd1-47b0-83d5-7c6039ff7ca3
77maxikov/georis
src/constraints/ConstrL2LOrtho.cpp
#include "ConstrL2LOrtho.h" #include <cmath> #include <stdexcept> #include <iostream> double georis::ConstrL2LOrtho::error()const{ double a1x = *l12x->pval - *l11x->pval; double a1y = *l12y->pval - *l11y->pval; double a2x = *l22x->pval - *l21x->pval; double a2y = *l22y->pval - *l21y->pval; /* if ( ...
ALGO
0.975379
5.247556
{ "github_metadata": { "branch": "master", "commit_count": 46, "repo_created_at": "2020-02-20T20:10:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4b8d8946d...