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
6c422a30-4508-4a22-9e33-265470533755
apetrots/crypto-pals
s1c3.cpp
#include <stdio.h> #include <string> #include <cstring> #include <cassert> #include <cmath> #include <vector> using byte_t = unsigned char; struct byte_array { byte_t *bytes; size_t length; byte_array(size_t _length) { length = _length; bytes = new byte_t[length]; } ~byte_arr...
ALGO
0.999122
3.464333
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2021-08-25T05:23:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "443a3b870294...
6dfd4f57-fe46-4c44-8fad-7fbfb7c8fe10
ojas-thakur-1999/leetcode-questions
path-sum-2/using-pass-by-reference-for-vector.cpp
#include<vector> using namespace std; 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), left(left), right(right)...
ALGO
0.999969
6.305809
{ "github_metadata": { "branch": "master", "commit_count": 124, "repo_created_at": "2022-12-09T14:06:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "373ee990...
89857622-443f-42cd-9faf-32d6f4fb8a8b
ishandutta2007/codeforces-j
jiry_2/normal/607/D.cpp
#include<iostream> #include<cmath> #include<cstring> #include<cstdio> #include<algorithm> using namespace std; const int mo=1e9+7; struct ask{ int pd,where; }q[210000]; struct bian{ int next,point; }b[410000]; int p[210000],len,n,m,w[210000],dfs[210000],r[210000],sign,father[210000],d[210000]; const int N=210000; int...
ALGO
0.999977
3.832647
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T05:42:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "28d5031d41cc...
ab5c92d9-734f-441b-8cf8-02a4e7a07602
JonasPrimbs/movesense-ble-ecg-firmware
MovesenseCoreLib/include/common/filters/simpleFIR.hpp
#pragma once /****************************************************************************** Copyright (c) <NAME> 2016. All rights reserved. ******************************************************************************/ /** @file simpleFIR.hpp */ #include "common/compiler/genDef.h" /** * GCC gives false positive ...
TOOL
0.970902
6.603491
{ "github_metadata": { "branch": "master", "commit_count": 376, "repo_created_at": "2022-08-03T07:09:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f663fb88...
78c28612-08f1-406c-a649-0cbb45b0ed26
wangkuiwu/datastructs_and_algorithm
source/algrightm/sort/insert_sort/cplus/InsertSort.cpp
/** * 直接插入排序:C++ * * @author skywang * @date 2014/03/11 */ #include <iostream> using namespace std; /* * 直接插入排序 * * 参数说明: * a -- 待排序的数组 * n -- 数组的长度 */ void insertSort(int* a, int n) { int i, j, k; for (i = 1; i < n; i++) { //为a[i]在前面的a[0...i-1]有序区间中找一个合适的位置 for (j = i - 1; j >= 0; j--) ...
ALGO
0.999919
4.552046
{ "github_metadata": { "branch": "master", "commit_count": 30, "repo_created_at": "2014-03-24T07:59:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 966, "forks": 751, "issues": 6, "pull_requests": 2 }, "file_meta": { "content_id": "8442b...
b1a2b019-b9d3-4097-9706-8362e4930567
khushigarg1/Problem-Solving-DSA
codeforces_contest/2048C.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const size_t STRING_MAX = 1000000; std::string maxString(size_t length) { return std::string(length, '\xFF'); } ll getXOR(string a, string b, ll num) { ll i = 0; ll count = 0; // bool isequal = (a.length() - num + 1) == b.length(); while (n...
ALGO
0.997563
3.630974
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2023-11-29T07:04:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "323eb690fa6a...
9b9bc2f6-2349-428a-88b8-f3ce12ec97c7
kama1kant/Programming
Programing_Practice_of_DataStructures_and_Algorithms/String/all_combination.cpp
#include<iostream> using namespace std; void generate(char c[], int n, int i); void all_combination_util(char c[], int n, char x[], int pos, int j); void all_combination(char c[], int n); void swap(char *x, char *y); int main() { char c[] = {'a', 'b', 'c', 'd'}; all_combination(c, 4); return 0; } void all_combina...
ALGO
0.999838
3.764267
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2014-01-26T20: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": "256f00dcb0...
7462cfa2-c626-4828-b5c3-51874d1c86a7
asyllh/RESEARCH
ARCHIVE/packing2.cpp
/*--------------/ ALH packing.cpp 12/10/17 /--------------*/ #include <algorithm> #include <cmath> #include <iomanip> #include "packing.h" using namespace std; void swap(int &a, int &b){ int temp = a; a = b; b = temp; } int lowerBound(double totalBoxWidth, int maxStripWidth){ int lBound; lBound =...
ALGO
0.999928
4.316084
{ "github_metadata": { "branch": "master", "commit_count": 502, "repo_created_at": "2017-07-18T16:38:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ab7e214f...
38e173fd-91e0-4051-964b-7803d095c9ee
Maaz-24503/maaz_leetcode
473 Matchsticks to Square/473matchsticks-to-square.cpp
class Solution { private: vector<int> matchsticks; unordered_map<long long, int> memo; int target, n; bool isPossible(int i, int a, int b, int c, int d){ if(i == n){ return a == b && b == c && c == d; } if(a > target || b > target || c > target || d > target) return ...
ALGO
0.999913
5.435482
{ "github_metadata": { "branch": "main", "commit_count": 1339, "repo_created_at": "2025-04-04T12:16: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": "d0a68c8e8...
f0d89863-b8f7-4e12-8c6e-2bcb5cee851c
notprovided64/class-chess-pt3
classes/MoveGenerator.cpp
#include "Board.h" #include <vector> const int directional_offsets[] = {8, -8, -1, 1, 7, -7, 9, -9}; constexpr std::array<int, 8> compute_square_to_edge(int file, int rank) { int num_north = 7 - rank; int num_south = rank; int num_west = file; int num_east = 7 - file; return {num_north, num_south...
ALGO
0.993607
6.338755
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2024-12-11T13:26: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": "aaefb0d34d3...
7a0a8e0a-2e75-4e77-8c08-084bb9f0278f
sugaliudaykiran/Cpp
gfg_cpp/Binary Search Tree/Deletion_in_BST.cpp
/* Deletion in BST :- We Should follow the BST after the deletion.. In this, we discuss how to delete a node from a Binary Search There are three posibilities: 1.Node to be deleted is a leaf node. (In this we can simple to delete, node that has it's next nodes are NULL.. which is a LEAF node.. ...
ALGO
0.999982
3.962228
{ "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": "c14fb6489...
97ff2498-c5e9-4ee9-96f2-d2458dc55a79
jonatakuzi/Card-Games
c++/pokerhandanalyzer.cpp
#include <iostream> #include <vector> #include <algorithm> #include <random> #include <map> #include <string> #include <fstream> #include <sstream> using namespace std; // Card structure representing a playing card struct Card { string rank; // Rank of the card (e.g., "A", "K", "10") char suit; // Suit of t...
ALGO
0.99805
7.047862
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2025-05-25T01:47:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "804433ab3f1...
2ab90030-1702-45e8-b4e6-6606114fe2c7
kssilveira/mara
kaue/cf/87/div2/b.cpp
#include <iostream> #include <cstdio> using namespace std; int main() { int n, m; cin >> n >> m; int tab[11][11] = {{0}}; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { char c; cin >> c; if (c == 'W') { tab[i][j] = 1; } else if (c == 'P') { tab[i][j] = ...
ALGO
0.999912
3.90641
{ "github_metadata": { "branch": "master", "commit_count": 61, "repo_created_at": "2011-09-12T22:23:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8e52f62c8...
5aa1bc40-805c-4925-a406-86ee578da033
arushig100/USACO-Solutions
Others/lcs.cpp
// longest common subsequence #include <iostream> using namespace std; string s1, s2; int length1, length2; // dp[prefix of s1 of length x][prefix of s2 of length y] int dp[1005][1005]; int negInf = -10000000; int main(){ cin >> s1 >> s2; length1 = (int)s1.length(); length2 = (int)s2.length(); //base c...
ALGO
0.999978
4.023802
{ "github_metadata": { "branch": "master", "commit_count": 64, "repo_created_at": "2019-05-05T23:12:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e2e4c45a3...
cb442b88-4a11-4885-90aa-88ff23776b69
Exawind/nalu-wind
include/kernel/ContinuityInflowElemKernel.h
// Copyright 2017 National Technology & Engineering Solutions of Sandia, LLC // (NTESS), National Renewable Energy Laboratory, University of Texas Austin, // Northwest Research Associates. Under the terms of Contract DE-NA0003525 // with NTESS, the U.S. Government retains certain rights in this software. // // This sof...
ALGO
0.986148
5.745984
{ "github_metadata": { "branch": "master", "commit_count": 2492, "repo_created_at": "2018-05-03T15:39:32.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 137, "forks": 93, "issues": 18, "pull_requests": 7 }, "file_meta": { "content_id": "436e...
64441370-f469-42a4-9c4e-cea534fae829
Utkarshp1/Data-Structures-and-Algorithms-Lab
dsa_lab8/main.cpp
#include<iostream> #include<fstream> #include<vector> #include<limits> using namespace std; struct node { node* next; int key; int weight; }; struct vertex { int key; int d; }; void insert(int temp, int v, int w); void dijkstra(int s); void initialize_single_source(int s); int extract_min(); void relax (int x,...
ALGO
0.999917
3.735752
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2020-02-10T10: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": "0f579f4b3c...
60205e01-6e96-49bd-80d2-ba53435c9080
rundun159/th1231
Problem_Solving/200904_2.cpp
//#include <string> //#include <vector> //#include <algorithm> //using namespace std; //typedef struct Node //{ // int n; // vector<int> weak; // vector<int> dist; //}; //typedef struct Temp //{ // int m; // int now_m; // int d_idx; // int start_w_idx; // vector<int> check_weak; // vector<int> d_idx_list; // vector<int...
ALGO
0.999947
4.001398
{ "github_metadata": { "branch": "master", "commit_count": 122, "repo_created_at": "2020-09-29T22:51:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "963293c1...
b9c4f70c-cf07-4475-870c-686702f2e639
DrhF/ACM
Timus/T1160.cpp
#include <iostream> #include <string> #include <vector> #include <cmath> #include <queue> #include <stack> #include <algorithm> #include <map> #include <set> using namespace std; struct edge { int st, en, d; bool operator < (edge a) { return d<a.d; } }; vector <int> color; vector <edge> E; vector <bool> U; int ...
ALGO
0.99997
3.772222
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2014-10-18T14:41:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d457e2ed5a...
031657c5-5a8e-414f-807e-a3163d37bf8d
kdbohne/pt
src/bsdf.h
#pragma once #include "spectrum.h" #include "vector.h" #include "point.h" #include "normal.h" #include "math.h" struct Intersection; enum BxdfType { // NOTE: only handling reflection for now // TODO: transmission // Must be one of the following base types: BSDF_REFLECTION = 0x1, BSDF_TRANSMISS...
ALGO
0.938317
6.533909
{ "github_metadata": { "branch": "master", "commit_count": 69, "repo_created_at": "2019-01-03T06:21: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": "cc0028564...
7fb9ef35-7adb-419d-824e-454bb9955676
yanakidis/logical_analysis_of_data
jsm_binarized.cpp
#include <iostream> #include <vector> #include <utility> #include <set> #include <cmath> #include <algorithm> #include <chrono> #include <fstream> #include <string> #include <boost/dynamic_bitset.hpp> using namespace std; using res_type = set <pair <boost::dynamic_bitset<>, boost::dynamic_bitset<> > >; // оператор вы...
ALGO
0.998868
3.640036
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2022-05-30T11:24:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "956e901a4b2...
3f551efb-139a-45b9-a7cd-d439a4a112c9
ghdcksgml1/Programmers
Lv.2/N개의 최소공배수.cpp
#include <string> #include <vector> #include <algorithm> using namespace std; int solution(vector<int> arr) { int arr_num[16]; int num = 1; int N = arr.size(); // vector는 값을 바꾸기 힘들기 때문에 배열로 복사 for(int i=0;i<arr.size();i++){ arr_num[i] = arr[i]; } // 오름차순 정렬 sort(arr_num,ar...
ALGO
0.999978
5.446177
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2021-07-12T03:35:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a2776bc3623...
fefed5a6-58ce-49b4-9992-4452de7bbdc1
Kitware/VTK
Imaging/Math/vtkImageDivergence.cxx
// SPDX-FileCopyrightText: Copyright (c) <NAME>, <NAME>, <NAME> // SPDX-License-Identifier: BSD-3-Clause #include "vtkImageDivergence.h" #include "vtkDataSetAttributes.h" #include "vtkImageData.h" #include "vtkInformation.h" #include "vtkInformationVector.h" #include "vtkObjectFactory.h" #include "vtkStreamingDemandDr...
ALGO
0.975259
6.943712
{ "github_metadata": { "branch": "master", "commit_count": 94968, "repo_created_at": "2010-04-27T15:12:58.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2910, "forks": 1246, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5...
8080d72a-22d6-4b7c-837b-151368ba67b5
zuzdud/numbers-game-simulator
main.cpp
#include <iostream> #include <vector> #include <cstdlib> // float globalSum = 0.0; std::vector<int> generatePlayerSet(int gamesNumber) { std::vector<int> playerSet; int onesCount = static_cast<int>(gamesNumber * 0.25); int twosCount = static_cast<int>(gamesNumber * 0.5); int threesCount = gamesNumber...
ALGO
0.999319
3.624887
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2025-04-10T10:47: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": "8c1788277ced...
0f15382f-4930-4b75-b685-341ad48db232
alexandraback/datacollection
solutions_5644738749267968_0/C++/dbcooper22/D Deceitful War.cpp
#include <algorithm> #include <iostream> #include <fstream> #include <sstream> #include <string> #include <vector> #include <queue> #include <set> #include <map> #include <cstdio> #include <cstdlib> #include <cctype> #include <cmath> #include <list> #include <cstring> #include <stack> #include <bitset> using namespace...
ALGO
0.999877
3.347105
{ "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": "f837942bd...
33533b4e-0e4f-4cc9-a610-ef4dd2e83e15
VolkRiot/FirstProgrammingEver
Linked_ListBuild.cpp
#include <iostream> #include <stdlib.h> #include <math.h> using namespace std; void InputValues(); void SetAll(string, float, float); void DisplayAll(int); struct Node { Node *Next; string emp_id; float hours; float pay; Node *Previous; }; Node *P; Node *Last = NULL; Node *First = NULL; Node *Middle; Node ...
TOOL
0.965664
3.755845
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2017-04-05T02:52: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": "b5c82b2f17...
58f40e12-7756-4018-9f7e-4707f7fb65da
kalfazed/multi-thread-programming
08_cpm_multi_stage/src/main.cpp
#include "logger.hpp" #include <chrono> #include <thread> #include <mutex> #include <queue> #include <vector> #include <condition_variable> using namespace std; struct Package { int id; string status; }; int global_id = 0; int min_limit = 10; int max_limit = 50; queue<Package> q_; mutex ...
TOOL
0.965324
4.467732
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-02-21T17:14:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 25, "forks": 9, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c2aea79692a...
e38f6947-3a60-42e4-a4a8-aad0850d8d7f
marciojr/PG_Project2
Code/util.cpp
#include "util.h" double produtoEscalar(const dVector u, const dVector v) { double retorno =0; for(int i = 0;i< u.size();i++) retorno+=u[i]*v[i]; return retorno; } dMatrix transpose(dMatrix m){ dMatrix t(m[0].size(), dVector(m.size())); for (int i = 0; i < m.size(); i++){ for( int j = 0; j < m[0].size(); ...
ALGO
0.996915
4.230531
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-01-13T18:53: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": "a660bb4a2a...
10909455-6d61-4856-98ff-d7489201d4df
Schr0Smi1ey/Atcoder
Practice/C/C_Swappable.cpp
#include<bits/stdc++.h> using namespace std; #define fastio ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0); #define endl "\n" #define int long long int #ifdef KARIM #include "DEBUG_TEMPLATE.h" #else #define HERE #define debug(args...) #endif const int MOD = 1e9 + 7; const int INF = 1e18, MINF = -1e18; const in...
ALGO
0.999962
4.04362
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-02-06T04:53:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ca7571d49eef...
0dede3ed-9e3b-4f28-b86b-ad4da0f5bbc1
SoftwareCornwall/m2m-oct-17
space-y/Story 11/Story_11/Story_11.ino
#include <NewPing.h> const int triggerPin = 4; const int echoPin = 5; const int maxDistance = 200; const int triggerPinDown = 13; const int echoPinDown = 17; const int maxDistanceDown = 200; NewPing sonar(triggerPin,echoPin,maxDistance); NewPing sonar2(triggerPinDown, echoPinDown,maxDistanceDown); //declare vari...
TOOL
0.928713
5.19742
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-02-22T20:08:12.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "75fc03f822c...
a1d74b2e-2908-4938-b993-ab67f8051b19
winprn/Summer
Linh tinh/2B.cc
/* ldmm is n00b */ #include <bits/stdc++.h> using namespace std; #define Cerr cerr << "\nTest: " #define endl "\n" #define fi first #define se second #define pb push_back #define IN(a,b) ((a)&(1<<(b))) template<class T> bool mini(T &a, T b) { return a > b ? (a = b, true) : false; } template<class T> bool maxi(T &a,...
ALGO
0.999966
3.568967
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2021-06-09T12:52:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "debbfce9e...
d75a2c48-3dee-46f6-a562-1c498eafeca1
vla5924-practice/computational-methods
02_systems/src/matrix.cpp
#include "matrix.h" Column operator*(const double& left, const Column& right) { size_t size = right.size(); Column tmp(size); tmp = right; for (size_t i = 0; i < size; i++) tmp[i] = tmp[i] * left; return tmp; } Column operator+(const Column &left, const Column &right) { if (left.size() != right.size...
TOOL
0.919815
5.764659
{ "github_metadata": { "branch": "main", "commit_count": 119, "repo_created_at": "2020-11-01T15:10:30.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "745e101601d...
884b66a8-3fbf-41b9-9943-752ecf1a2aa6
oshinoooo/leet_code
problems0215/main.cpp
#include <iostream> #include <vector> #include <ctime> using namespace std; class Solution { public: int findKthLargest(vector<int>& nums, int k) { srand(time(0)); quickSort(nums, 0, nums.size() - 1); return nums[nums.size() - k]; } private: void quickSort(vector<int>& nums, int h...
ALGO
0.999963
5.534041
{ "github_metadata": { "branch": "main", "commit_count": 265, "repo_created_at": "2022-02-16T17:47:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ed48a2faab...
5fb976c0-6665-4b8c-820f-094bb05831ab
sitRyo/templateCpp_atcoder
AtCoder/contest_atcoder/AGC31/proA.cpp
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #include <cstdlib> #include <cmath> #include <map> using namespace std; typedef long long ll; #define INF 10e17 // 4倍しても(4回足しても)long longを溢れない #de...
ALGO
0.999968
3.899353
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2018-07-25T15:35: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": "3306742b8...
fbdb3f82-96eb-43c2-ac8b-81ab9dbee313
Sageness/Example-Code
C++ Code Example/CppExampleProject/CppExampleProject/LinkedList.h
//***************************************************************** // LinkedList.h // HashTable // Created by: <NAME> on August 16th, 2016 //***************************************************************** #ifndef LinkedList_h #define LinkedList_h #include <iostream> #include <string> using namespace std; // Li...
TOOL
0.907915
3.138004
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2019-04-15T20:28:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5c8d827983...
c0ae5155-bd55-4bd6-b8be-1e805601008f
shogun-toolbox/shogun
src/shogun/neuralnets/NeuralRectifiedLinearLayer.cpp
/* * Copyright (c) 2014, Shogun Toolbox Foundation * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list o...
ALGO
0.980042
6.710492
{ "github_metadata": { "branch": "develop", "commit_count": 17589, "repo_created_at": "2011-04-01T10:44:32.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3050, "forks": 1034, "issues": 413, "pull_requests": 10 }, "file_meta": { "content_id"...
803548ff-bff5-4b27-890a-edb585ec17ed
Kanhakhatri065/competitive_programming
UVA/256.cpp
/*** I came, I saw, I conquered. ***/ #include <bits/stdc++.h> using namespace std; typedef long long ll;typedef unsigned long long ull; #define sc(a) cin >> a #define pf(a) cout << a << endl #define forIn(arr, num) for(ll i = 0; i < num; i++) cin >> arr[i]; #define vpnt(ans) for(ll i = 0; i < ans.size(); i++) cout << ...
ALGO
0.999424
3.770786
{ "github_metadata": { "branch": "master", "commit_count": 61, "repo_created_at": "2020-05-12T22:56: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": "c4bad398d...
22063f97-5594-49ea-8793-3fb8f4bce4cc
UCLA-VAST/cs-259-21f
lab2/xilinx.cpp
#include "ap_int.h" //#include <iostream> //using namespace std; const int kNum = 256; const int kKernel = 5; const int kImSize = 224; const int kInImSize = 228; const int kOutImSize = 112; #define weight(i, j, p, q) \ weight[(i) * kNum * kKernel * kKernel + (j) * kKernel * kKernel + \ (p) * kKernel + (q)] #d...
ALGO
0.994853
3.541144
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2021-09-24T21:23:09.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "11c950f6fd...
c32b812a-1b5a-4102-8fd2-df3cc9d68c70
SeanCampbell/WordAnalysis
vxl_src/contrib/rpl/rtvl/examples/rtvl_hello.cxx
/* Copyright 2010 <NAME> Distributed under the Boost Software License, Version 1.0. (See accompanying file rtvl_license_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #include <rtvl/rtvl_tensor.hxx> #include <rtvl/rtvl_vote.hxx> #include <rtvl/rtvl_votee.hxx> #include <rtvl/rtvl_voter.hxx> #includ...
ALGO
0.998299
5.767447
{ "github_metadata": { "branch": "master", "commit_count": 67, "repo_created_at": "2016-02-16T04:49:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "923d0df06...
778f7605-4daf-4900-b17a-74c92ab7cf3e
meliassilva/computersecurityrepo
Cypher_Lab13/cipher02.h
/******************************************************************** * Header: * Rail Fence Cipher ********************************************************************/ #ifndef CIPHER02_H #define CIPHER02_H #include "cipher.h" /******************************************************************** * CLASS ***********...
ALGO
0.998069
5.015016
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2020-12-18T16:48:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9a3fc2a2c929...
a2203b8a-18a9-4849-8f66-81da3eb1872e
NullVerdict/WinGL-Vulkan
WinGL/MatrixHelper.h
#ifndef _MATRIX_HELPER_H_ #define _MATRIX_HELPER_H_ // crt includes #include <cmath> // local includes #include "Matrix.h" #include "Vector.h" namespace MatrixHelper { template < typename T > void DecomposeYawPitchRoll( const Matrix< T > & mat, T * y, T * p, T * r ) { // this function...
ALGO
0.979666
6.320764
{ "github_metadata": { "branch": "master", "commit_count": 348, "repo_created_at": "2022-08-01T22:40: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": "c2460252...
7b0ef9ed-17c1-4730-ad1f-2a60b0b89b7b
D3E0/MyACM
2017杭电新生赛/G.cpp
#include <cstdio> #include <cstring> #include <algorithm> #include <iostream> #include <string> #include <queue> using namespace std; int n; int dir[3][2] = { { 0, 1 }, { 1, 0 }, { 1, 1 } }; int a[100][100]; struct Node { int x; int y; int cnt; }; int BFS(int i, int j) { queue<Node> q; bool vis[100][100]; Node ...
ALGO
0.999718
3.719167
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2018-03-16T06:12: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": "5dea4879e...
9e30dd3f-6af6-4bc2-8c0e-e55d3a745dc6
ishandutta2007/codeforces-m
mip182/normal/1531/C.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define mii map <int, int> #define mll map <ll, ll> #define pii pair <int, int> #define pll pair <ll, ll> #define vi vector <int> #define vd vector <double> #define vll vector <ll> #define fi first #define se second #define si set...
ALGO
0.999765
3.599106
{ "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": "f4189301f115...
422a681e-d3a3-493b-950e-7f8ef97ae53f
HellHBBD/coding
C++/1112Computer_Program_and_Application/homework/HW10_Shape.cpp
#include <cmath> #include <iostream> using namespace std; class Shape { public: virtual ~Shape() {}; virtual double calculateArea() = 0; virtual double calculatePerimeter() = 0; virtual void displayInfo() = 0; virtual void set(double) = 0; virtual void set(double, double) = 0; void construct(); void destru...
ALGO
0.959809
3.920485
{ "github_metadata": { "branch": "master", "commit_count": 368, "repo_created_at": "2023-09-13T18:07: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": "4d6a0173...
93c582b6-94b5-45e1-959f-84572a7fd8f1
thallysurgal/atividade-Lista-de-exerc-cios-Passagem-por-Valor-e-Refer-ncia-e-Recursividade
th7/main.cpp
#include <iostream> using namespace std; int fibonacciRecursivo(int n) { if (n == 0) return 0; if (n == 1) return 1; return fibonacciRecursivo(n - 1) + fibonacciRecursivo(n - 2); } int fibonacciIterativo(int n) { if (n == 0) return 0; if (n == 1) return 1; int a = 0, b = 1, resultado; for...
ALGO
0.99979
5.819061
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-08-26T22:45: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": "7690f10df289...
2d428cdd-332e-4394-ab58-dc688f3f45a2
markpascua680/CS201
Homework 6/Random-Map/random_map.cpp
/* random-map.cpp <NAME> CS 201 04/04/2020 Tests uniform distribution of numbers annd normal distribution of numbers */ #include <iostream> #include <iomanip> #include <stdlib.h> #include <string> #include <map> #include <random> #include <cmath> #include <time.h> void PrintDistribution(const std::map<int...
TEST
0.930006
4.056952
{ "github_metadata": { "branch": "master", "commit_count": 135, "repo_created_at": "2020-01-15T18:29:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c3ab8642...
d862879d-dd15-4826-945f-088a2e74c84b
mukund2000/Data-Structure-Practice
Binary_Tree/CheckTreeBalancedorNot.cpp
#include<bits/stdc++.h> using namespace std; template <typename T> class BinaryTreeNode { public: T data; BinaryTreeNode<T> *left; BinaryTreeNode<T> *right; BinaryTreeNode(T data) { this->data = data; left = NULL; right = NULL; } }; BinaryTreeNode<int> *takeInput() { ...
ALGO
0.999915
4.201361
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2020-11-12T17:27:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fbdcfb28a90...
f6d926c7-0a32-4317-966e-4645c12e8374
yancouto/maratona-sua-mae
Gi/codeforces/560D.cpp
//#include <bits/stdc++.h> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; #define fst first #define snd second typedef pair<int, int> pii; typedef unsigned long long ull; typedef long long ll; typedef long double ld; #define pb push_back #define for_tests(t, tt) int t; scanf("%d", &t); f...
ALGO
0.999994
3.439887
{ "github_metadata": { "branch": "master", "commit_count": 490, "repo_created_at": "2015-06-27T20:54:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "84b59bd3...
8accb0c4-fbbf-4ec7-82e0-bf59fd20f621
ivorymood/ALGORITHM
PROGRAMMERS/LEVEL_02/Q62048.cpp
//https://programmers.co.kr/learn/courses/30/lessons/62048 //멀쩡한 사각형 #include <iostream> using namespace std; /* unit : 가로 세로를 최대공약수로 나눈 수로 이루어진 사각형 대각선이 지나가는 전체 사각형의 수 = 한 unit에서 대각선이 지나가는 사각형의 수 * gcd */ int inline get_cut_cnt_per_unit(int w, int h) { return w + h - 1; } int GCD(int A, int B) { ...
ALGO
0.999876
5.153239
{ "github_metadata": { "branch": "master", "commit_count": 555, "repo_created_at": "2020-04-12T12:22: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": "e5f3fc15...
244e8768-4675-4db4-ad67-e75c0af2b156
olegtsts/contests
contest12/5.cpp
#include <iostream> #include <vector> #include <algorithm> const long long int MODULO = 1000000007; void multiply( std::vector<long long int>& x, std::vector<long long int>& a, std::vector<long long int>& swap, const int size ) { for (int i = 0; i < size; ++i) { for (int k = 0; k < size; +...
ALGO
0.999978
4.141366
{ "github_metadata": { "branch": "master", "commit_count": 183, "repo_created_at": "2017-05-23T21:04: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": "b3a59c94...
dff3cd01-badb-4fff-b00a-2869e82ee877
arielm/chronotext-cross
core/src/chr/math/Utils.cpp
#include "chr/math/Utils.h" namespace chr { namespace math { float boundf(float value, float range) { float bound = fmodf(value, range); return (bound < 0) ? (bound + range) : bound; } int bound(int value, int range) { int bound = value % range; return (bound < 0) ?...
TOOL
0.940413
6.714764
{ "github_metadata": { "branch": "master", "commit_count": 1059, "repo_created_at": "2015-07-14T20:46:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 77, "forks": 13, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "34d9b...
31135b5d-07d3-4ad1-b7f7-698af32e1bf2
kamyu104/LeetCode-Solutions
C++/minimum-number-of-pushes-to-type-word-i.cpp
// Time: O(4) // Space: O(1) // greedy class Solution { public: int minimumPushes(string word) { const auto& ceil_divide = [](int a, int b) { return (a + b - 1) / b; }; int result = 0; const int l = ceil_divide(size(word), (9 - 2 + 1)); for (int i = 0; i < l; +...
ALGO
0.999928
4.88906
{ "github_metadata": { "branch": "master", "commit_count": 19395, "repo_created_at": "2018-10-11T17:38:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4939, "forks": 1616, "issues": 1, "pull_requests": 55 }, "file_meta": { "content_id": ...
0dcd2f3e-6581-4594-8a99-df4da8f3ceba
androids-electric-sheep/advent_of_code_2021
02/part_2.cpp
#include <chrono> #include <fstream> #include <iostream> #include <map> #include <string> #include <thread> enum class Direction { FORWARD, DOWN, UP }; static std::map<std::string, Direction> direction_mapping{ {"forward", Direction::FORWARD}, {"up", Direction::UP}, {"down", Direction::DOWN}}; int main(in...
ALGO
0.921458
5.902674
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-02-20T20:24:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ee526b185c8c...
c49849a6-169c-4848-84ce-f612dcb99823
veahow/OJProblemSolution
ccf-csp/2014/201412-1/main.cpp
#include <cstdio> #include <climits> #include <algorithm> typedef struct { int id; int cnt = 1; }Reader; const int MAXN = 1005; int records[MAXN]; int temp[MAXN]; int ids[MAXN]; Reader readers[MAXN]; using namespace std; int main() { int n, m = 1; scanf("%d", &n); for(int i = 1; i <= n; ++i){ ...
ALGO
0.999978
3.654479
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2017-03-25T06:52: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": "2b2b1df35...
b61d2eda-7be7-4ad6-9c98-7f17ab573ad8
AkiraNomura/OSS-GroupB
puyopuyo.cpp
/////////////////////////////////////////////////////////////////////////////// // ぷよぷよ include "el.h" define MAIN_SCREEN 1 //画面用の関数のプロトタイプ void MainScreen(void); DDOBJ puyo; // ぷよのビットマップ int field[15][8]; // 画面データ int cmb[15][8]; // 結合チェック用 bool elist[30]; // 消すリスト ////////////////////////////////////////...
TOOL
0.910993
4.019334
{ "github_metadata": { "branch": "master", "commit_count": 43, "repo_created_at": "2015-05-22T06:38:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d9c6b0d57...
fbcb43cf-cc6d-4ac7-b7e1-e619ddc0c85d
Ritvik-Sapra/DSA
LinkedList/Cpp/Problem9.cpp
/* Reverse a DLL. */ #include <bits/stdc++.h> using namespace std; struct DLL { int data; DLL *next; DLL *prev; DLL(int x) { data = x; next = NULL; prev = NULL; } }; DLL *reverseDLL(DLL *head) { if ((head == NULL) || (head->next == NULL)) return head; DLL *curr = head; while (curr->...
ALGO
0.999965
5.604791
{ "github_metadata": { "branch": "master", "commit_count": 113, "repo_created_at": "2020-07-10T07:16: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": "08432071...
21d1a240-e55c-4e3d-a404-04d57733313f
Vedanttotla007/Data-Structure-notes
CPP Data Structures/queue_op.cpp
#include<bits/stdc++.h> using namespace std; class Queue{ public: int f , r ; unsigned capacity; int *array; }; int size = 0; Queue* q = new Queue(); bool empty(){ return (size == 0); } bool full(){ return (size == q->capacity); } void CreateQueue(unsigned cap){ q->capacity = ...
ALGO
0.987505
3.662433
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-06-15T10:08: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": "35e43eeeaadb...
1cd6d56a-11e6-4b5e-84e2-1ba8b7a90d74
emmacneil/aoc2021
21-dice/part2.cpp
#include <chrono> #include <iostream> #include <stdint.h> struct node { node() : player1_wins(0), player2_wins(0) {} int64_t player1_wins, player2_wins; }; struct state { state() = default; state(int n) : player((n / 44100) % 2), pos1((n / 4410) % 10), pos2((n / 441) % 10 ), score1((n / 21) % 21), sco...
ALGO
0.999599
3.845774
{ "github_metadata": { "branch": "main", "commit_count": 52, "repo_created_at": "2021-12-02T00:20:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4c352cb8de3...
e6a0690c-e2ad-4b1b-b636-fc53c8b96681
atalantus/Comp-Programming-Archive
LeetCode/Problems/2348.cpp
// Time Complexity: O(n) class Solution { public: long long zeroFilledSubarray(vector<int>& nums) { size_t start = -1; long long s = 0; for (size_t i = 0; i < nums.size(); ++i) { if (nums[i] == 0 && start == -1) { // start of new 0 subarra...
ALGO
0.999833
6.132224
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2022-02-14T16:27:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2b5ef5cb900...
25979583-5f47-4abc-a58c-0cc168a165ef
kanemoda/MNIST-TESTS
FNN_MNIST/src/DenseLayer.cpp
#include "DenseLayer.hpp" #include <cstdlib> #include <sstream> #include <Eigen/Dense> #include <omp.h> DenseLayer::DenseLayer(int input_size, int output_size) : input_size(input_size), output_size(output_size) { weights.resize(output_size, std::vector<double>(input_size)); biases.resize(output_size, 0.0);...
ALGO
0.994208
6.59791
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2025-02-12T22:58: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": "fb849a8f7860...
0700a9d6-1291-45bf-8dfa-b0b0d5006aae
adrelino/mv-lm-icp
src/internal/icp-ceres.cpp
#include "icp-ceres.h" #include <Eigen/Dense> #include <math.h> #include <unordered_map> #include <vector> //#include "Visualize.h" #include <ceres/local_parameterization.h> #include <ceres/autodiff_local_parameterization.h> #include <ceres/types.h> #include <ceres/rotation.h> #include <ceres/ceres.h> #include <ce...
ALGO
0.994373
3.787383
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2015-06-19T17:57:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 239, "forks": 60, "issues": 5, "pull_requests": 1 }, "file_meta": { "content_id": "887b99...
2f9afde8-99f9-4414-9db0-80e4ec9ef69d
AdarshNandanwar/DSA-and-Competitive-Programming
Demux/20.04.19/264.cpp
// https://leetcode.com/problems/ugly-number-ii/ // Method 0 (DP, O(n)): class Solution { public: int nthUglyNumber(int n) { vector<int> v(1,1); int p2, p3, p5, next; p2 = p3 = p5 = 0; // keep 3 pointers to point to next number being multiplied from the previously generated ugly nu...
ALGO
0.999983
5.921813
{ "github_metadata": { "branch": "master", "commit_count": 52, "repo_created_at": "2020-04-05T22:00:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "262bb51b7...
9fcf077a-ce19-4dd1-a0d5-d679006ab9dd
eric-erki/DeepLearning
libnd4j/include/ops/declarable/helpers/cross.h
// // @author <EMAIL> // #include <ops/declarable/helpers/helpers.h> namespace nd4j { namespace ops { namespace helpers { template <typename T> void FORCEINLINE _cross(NDArray<T> *a, NDArray<T> *b, NDArray<T> *o) { auto a0 = a->getScalar(0); auto a1 = a->getScalar(1); auto a2 = a->get...
ALGO
0.925999
7.35223
{ "github_metadata": { "branch": "master", "commit_count": 22563, "repo_created_at": "2018-05-26T13:48: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": "a40260...
64a23ddd-bceb-48c1-b42a-b62eb7f0c26c
geoffgeorgein/CP
1/phone_number'.cpp
#include <bits/stdc++.h> using namespace std; /* * Complete the 'getPhoneNumber' function below. * * The function is expected to return a STRING. * The function accepts STRING s as parameter. */ string getPhoneNumber(string s) { map<string,string>m1; int n=s.length(); m1["one"]="1"; ...
ALGO
0.999746
3.687176
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-09-08T09:05:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cb5a88f7678b...
0a0c749f-13a0-41dc-b483-07dc63faefae
JackBai0914/Competitive-Programming-Codebase
Atcoder_Panasonic/5.cpp
#include <iostream> #include <algorithm> #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <ctime> #include <vector> #include <queue> #include <map> using namespace std; typedef long long ll; int fans = 1e9; const int C = 2000; const int D = C * 2; bool equal (char x, char y) {return x ...
ALGO
0.999903
3.544163
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-04-14T23:11: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": "ea76691ddebc...
9531341a-b4fb-4513-940a-77e24b8a6123
PengJi/Algorithms
skill/lc_560_subarray-sum-equals-k.cpp
/** * 560. 和为 K 的子数组 * https://leetcode-cn.com/problems/subarray-sum-equals-k/ */ class Solution { public: // 前缀和 + 哈希表 // 对原数组求前缀和后,一个和为 k 的子数组即为一对前缀和的差值为 k 的位置。 // 遍历前缀和数组,用 unordered_map 哈希表记录每个前缀和出现的次数。 // 特别地,初始时前缀和为 0 需要被额外记录一次。 // 遍历过程中,对于当前前缀和 tot,累加之前 tot - k 前缀和出现的次数。 int subarrayS...
ALGO
0.999877
6.347914
{ "github_metadata": { "branch": "master", "commit_count": 1239, "repo_created_at": "2020-02-29T08:58: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": "ca3aaf4...
5c7bba61-d726-4b5e-8e26-ed8019389a60
SAHOWI/CarND-Extended-Kalman-Filter-Project
src/tools.cpp
#include <iostream> #include "tools.h" using std::cout; using std::endl; using Eigen::VectorXd; using Eigen::MatrixXd; using std::vector; Tools::Tools() {} Tools::~Tools() {} // V3 = CalculateRMSE( V1, V2) VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations, const vector<...
ALGO
0.997176
5.894288
{ "github_metadata": { "branch": "master", "commit_count": 119, "repo_created_at": "2019-11-26T20:21: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": "56fcb398...
9538e5c5-35ba-4b97-bfea-9acf9ce6d7b7
TALP-UPC/FreeLing
src/libtreeler/treeler/dep/shag/semiring.h
#ifndef TREELER_SEMIRING_H #define TREELER_SEMIRING_H #include <queue> #include <limits> #include <list> #include <string> #include "chart.h" using namespace std; namespace treeler { enum Semiring_t { MAX=0, ADD, LOGADD, HYPER, STRING }; template<Semiring_t S> class Semiring { }; template<> class Se...
ALGO
0.999497
5.964381
{ "github_metadata": { "branch": "master", "commit_count": 565, "repo_created_at": "2016-03-25T15:41:23.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 257, "forks": 98, "issues": 16, "pull_requests": 3 }, "file_meta": { "content_id": "4494f...
75a0c1a3-7f89-46cc-89e4-416b23cd7534
thatianajribeiro/EstruturaDeDadosLab
outros/Lista 9/Lab9 - Carb/ex5/main.cpp
#include <iostream> using namespace std; void descer(int H[],int i, int n){ int j= 2*i+1; // filho esquerdo if(j<=n){ if(j<n){ if(H[j+1]>H[j]){ j++; } cout<<"Checkpoint 1 descer "<<j<<endl; } if(H[i]<H[j]){ int aux = H[i];...
ALGO
0.999979
4.555411
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2019-08-02T01:27: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": "70e5d4914...
18edce50-e2eb-453c-b595-f38dd3707c41
rohithlovescode/LeetCode
679-24-game/24-game.cpp
class Solution { public: vector<char> ops={'+','-','*','/'}; float oper(float a,float b, char op){ if(op=='+'){ return a+b; }else if(op=='-'){ return a-b; }else if(op=='*'){ return a*b; }else if(b!=0){ return a/b; } ...
ALGO
0.996139
5.505463
{ "github_metadata": { "branch": "main", "commit_count": 614, "repo_created_at": "2024-01-22T17:25:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fad7793459...
9ab0b616-49c6-41d9-9e40-f8d902299eaf
amol1211/DSAWithC-CPP
03.SolvingLeetcodeProblems/Heap/ReorganizeString/main.cpp
//767. Reorganize String #include <bits/stdc++.h> using namespace std; //Appraoch 1 : Using priority queue (max heap) class Solution { public: typedef pair<int, char> P; string reorganizeString(string s) { int n = s.length(); vector<int> count(26, 0); // Counting occurrences of each...
ALGO
0.999998
5.929187
{ "github_metadata": { "branch": "main", "commit_count": 894, "repo_created_at": "2023-02-25T03:36: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": "cf891a7cd7...
21597f8f-e45b-4a63-8d97-4cb7fd833917
ShahidAkhtar777/DS-Algo
Recurssion/binarysearch_recurssion.cpp
#include <bits/stdc++.h> using namespace std; // Binary Search using recurssion in a sorted array // Time Complexity: O(logN) // Space Complexity: O(logN) int binary_search(int a[], int st, int e, int n, int num) { int mid = (st + e) / 2; if (st == n || e == -1) return -1; else if (a[mid] == num)...
ALGO
0.999789
5.724568
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2023-01-29T14:36: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": "d79f95cfc...
2ac08ad5-ec2e-4015-9a8d-3cd924c9f712
VitinDenoyr/CompetitiveProgramming
codeforces/2000-478D-RedGreenTowers.cpp
//https://codeforces.com/contest/478/problem/D #include <bits/stdc++.h> using namespace std; #define ll long long #define mod 1000000007 #define MAXN 200005 int main(){ int r,g,h; cin >> r >> g; //Encontrarei h int l = 1, ri = 999; while(l < ri){ int mid = (l+ri+1)/2; if((mid*(mid+1))/2 <= (r+g)){ //existe um...
ALGO
0.999969
3.984016
{ "github_metadata": { "branch": "main", "commit_count": 61, "repo_created_at": "2024-11-30T15:38: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": "742d2de9a97...
bd01b9e4-e565-4da1-b305-05cfd011a229
koreakk/Online-Judge
boj/Level 4/Level 4-1/28474. 피보나치 서로소/Cpp.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; ll phi(ll n) { ll ret = n; for (ll i = 2; i * i <= n; ++i) { if (n % i == 0) { ret -= ret / i; while (n % i == 0) { n /= i; } } } if (n != 1) { ret -= ret / n;...
ALGO
0.999979
4.892425
{ "github_metadata": { "branch": "master", "commit_count": 439, "repo_created_at": "2022-06-25T04:40: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": "77d23534...
4a39e915-4e72-458c-bb4e-812c18cca488
reverg/PS
boj/20183.cpp
#include <iostream> #include <vector> #include <queue> #define ll long long using namespace std; int N, M, A, B; ll C; vector<pair<int, int>> graph[100001]; ll cost_record[100001]; struct Gollmok { int node; ll max_cost; ll payed; bool operator()(Gollmok a, Gollmok b) { if (a.max_cost !=...
ALGO
0.999965
3.924489
{ "github_metadata": { "branch": "main", "commit_count": 91, "repo_created_at": "2021-06-24T14:39: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": "7d329975284...
111452d0-b70c-4206-ab8f-44fd2f613dcc
uwsampa/grappa
applications/nativegraph/bfs/bfs_spmd.cpp
//////////////////////////////////////////////////////////////////////// // Copyright (c) 2010-2015, University of Washington and Battelle // Memorial Institute. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following cond...
ALGO
0.997411
5.305195
{ "github_metadata": { "branch": "master", "commit_count": 3825, "repo_created_at": "2012-06-24T20:46:44.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 158, "forks": 50, "issues": 77, "pull_requests": 18 }, "file_meta": { "content_id": "e67...
f44a6f71-2e74-42dd-9a04-c75e7bbb2bd6
chengxiaohei/WSL-Home
Algorithm/left_cloud/longestSubSeries.cpp
#include <iostream> #include <vector> //数组的最长递增子序列问题 //注意子序列可以不连续,但是需要保持顺序不变 //子数组必须连续顺序不变 //子集可以不连续,可以随意变化顺序 // 普通的动态规划,时间复杂度O(N^2) int longestSubSeries(std::vector<int>& arr){ int length = arr.size(); if(length <= 1) return length; int dp[length] = {1}; //dp[i]表示表示arr[0~i]数组中的最长递增子序列 for(int i=1; i...
ALGO
0.999943
4.716247
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-10-05T06:39: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": "980e4f722752...
7363ac04-0ff9-488a-87e8-660705ad7428
CamillaFiorini/SA_eST
Euler_2x2/all/time_solver.cpp
#include"time_solver.hpp" #include <algorithm> double time_solver::solve (state& st, bool only_state) { bool first_time (true); int cont(0); double t(start_time), dt, dx(this->m.get_Dx()); vector<double> lambda; bool CD_state = st.get_CD_state(); bool CD_sens = st.get_CD_sens(); int N(st.get_size()), D(st...
ALGO
0.99999
3.513623
{ "github_metadata": { "branch": "master", "commit_count": 106, "repo_created_at": "2022-11-17T13:05: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": "222267cc...
07065aa4-dae8-4135-8157-ed6b87ce4f40
dhuamanilu/programacion
1598/1598C_codeforces.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pi; typedef vector<int> vi; #define FOR(i, a, b) for (int i=a; i<(b); i++) #define mp make_pair #define pb push_back #define f first #define se second #define lb lower_bound #define ub upper_bound #...
ALGO
0.999915
3.694854
{ "github_metadata": { "branch": "main", "commit_count": 560, "repo_created_at": "2023-01-02T13:19:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "352b618ec2...
649e2af1-8142-4c30-8bf2-1b60927f1ece
Leehyewon96/Algorithm
백준/Silver/18290. NM과 K (1)/NM과 K (1).cc
#include <iostream> #include <vector> #include <algorithm> #include <memory.h> using namespace std; int arr[11][11]; int ans = -1e4; bool visited[11][11]; pair<int, int> q[11]; int N, M, K; bool Check(int cx, int cy, int cnt) { for (int i = 0; i < cnt; ++i) { if (cx == q[i].first && cy == q[i].second + 1) return ...
ALGO
0.99992
4.252302
{ "github_metadata": { "branch": "main", "commit_count": 252, "repo_created_at": "2022-04-15T21:11: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": "2cc7e2e5b5...
5516ffee-b3a2-4a46-8d52-028713c25b49
CyanogenMod/android_packages_apps_DSPManager
cyanogen-dsp/EffectCompression.cpp
/* * Copyright (C) 2011 The Android Open Source Project * * 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 app...
TOOL
0.958457
6.986003
{ "github_metadata": { "branch": "cm-10.2", "commit_count": 310, "repo_created_at": "2010-08-07T05:53:43.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 86, "forks": 159, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9ce1a...
2c16e003-7ff8-43d6-9345-3db3ab279dc4
Tanmoytkd/programming-projects
Code Chef/codechef - CHEFMOVR/main.cpp
#include<bits/stdc++.h> #define pii pair<int,int> #define mkp make_pair #define fs first #define sc second #define pb push_back #define ppb pop_back() #define pf printf #define pf1(a) printf("%d\n",a) #define hi() printf("hi!\n") #define sf scanf #define sf1(a) scanf("%d",&a) #define sf2(a,b) scanf("%d %d",&a,&b) #defi...
ALGO
0.999733
3.101074
{ "github_metadata": { "branch": "master", "commit_count": 195, "repo_created_at": "2015-09-15T12:04:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2e9a88b6...
c9dc8937-2241-46fb-9778-e1fa1c31c7d0
isfahanUacm/UICPC
2021/UICPC DIV1/Contests/UICPC Round #09 (Div 1)/solutions/Problem F - Financial Planning/financialplanning.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int ll n, m; ll p[100003], c[100003]; bool observe(ll days){ ll s = 0; for (int i = 0; i < n; ++i) { if(s > 1e9) break; s += ((days * p[i] - c[i] < 0) ? 0 : days * p[i] - c[i]); } return s >= m; } int main...
ALGO
0.999983
3.658289
{ "github_metadata": { "branch": "main", "commit_count": 113, "repo_created_at": "2021-09-15T16:29:50.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 8, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7173d994900...
b72197b7-5241-4e15-9683-33a888368ae7
yshagit31/DSA
Trees/Basic/BinaryTressRep.cpp
// You are given an array nodes. It contains 7 integers, which represents the value of nodes of the binary tree in level order traversal. You are also given a root of the tree which has a value equal to nodes[0]. // Your task to construct a binary tree by creating nodes for the remaining 6 nodes. // Example: // Inpu...
ALGO
0.999665
4.923621
{ "github_metadata": { "branch": "master", "commit_count": 258, "repo_created_at": "2024-04-23T19:26: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": "82c55b3e...
a59dc900-6035-40f1-82ef-6c9b4c78bb3c
Abhiman67/CPPCODE
rough.cpp
#include<iostream> using namespace std; // // void bubble(int*arr,int l){ // // for(int i=0;i<l-1;i++) { // // for (int j=0;j<l-1-i;j++){ // // if(arr[j]<arr[j+1]){ // // swap(arr[j],arr[j+1]); // // } // // } // // } // // for (int i=0;i<l;i++){ // ...
ALGO
0.999943
4.934438
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2024-06-18T10:28: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": "7417288f284...
102a8abb-cb4a-4893-9123-dccf46fbc139
stan-dev/math
stan/math/prim/fun/csr_extract_u.hpp
#ifndef STAN_MATH_PRIM_FUN_CSR_EXTRACT_U_HPP #define STAN_MATH_PRIM_FUN_CSR_EXTRACT_U_HPP #include <stan/math/prim/meta.hpp> #include <stan/math/prim/fun/Eigen.hpp> #include <stan/math/prim/fun/to_ref.hpp> #include <vector> #include <numeric> namespace stan { namespace math { /** \addtogroup csr_format * @{ */ /...
TOOL
0.947264
6.649791
{ "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": ...
7ed10bc4-3b74-4c0e-a3ec-4dd23c3fe30d
XiyouLinuxGroup-2018-Summer/TeamC
Code_Zhang-Xiaoxiang/2018_Summer_ACM/week_2/4.cpp
/** * Untitled-1 * > author: PhoenixXC * > email: <EMAIL> * > description: D - 二进制 > 暴力BFS > 初始节点设为1,把节点放入空队列 如果队列非空 每个节点i都和 i*10 和 i*10+1 相关 如果某个节点不满足%n == 0, 此节点出列,把与他相关的节点放入队列 如果满足,输出节点,然后return退出 在队列里面继续寻找 * > created: Wed Aug 01 2018 08:02:27 GMT+...
ALGO
0.999667
3.897853
{ "github_metadata": { "branch": "master", "commit_count": 162, "repo_created_at": "2018-07-17T04:30:53.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bde3c02c2...
a8ee1ff1-245f-40bd-83ae-da34f2368e7c
rinisme00/leetcode_solve
multiply_strings.cpp
/* Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. Note: You must not use any built-in BigInteger library or convert the inputs to integer directly. */ #include <iostream> #include <string> #include <vector> using namespace std...
ALGO
0.999923
5.757526
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2024-12-05T14:48: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": "420e11971e0...
0e65bbe4-70d6-4d62-ae85-bebb1b9e51e2
Naateri/Operativos
trabajo_parcial/Scheduler_NoPipe/pipe_write.cpp
//#include <iostream> #include <stdio.h> #include <time.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include <signal.h> #include <queue> #include <thread> //g++ pipe_write.cpp -o pipe_write -std=c++11 -lpthread std::queue<int> le...
TOOL
0.958599
3.306793
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-07-01T20:09: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": "b01e2f3615...
eca81de6-1a16-4f6c-96bc-b6969171f961
maxkemal/RayTrophi
cpp_file/Camera.cpp
#include "Camera.h" #include <cmath> #include <stdlib.h> #include "Matrix4x4.h" Camera::Camera(Vec3 lookfrom, Vec3 lookat, Vec3 vup, float vfov, float aspect, float aperture, float focus_dist, int blade_count) : lookfrom(lookfrom), lookat(lookat), vup(vup), vfov(vfov), aspect_ratio(aspect), aperture(aperture), ...
TOOL
0.973088
6.423269
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2025-04-13T20:07:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ab5319bbb6f...
2adf7b32-40a2-4620-a76d-775cb54a330a
nvnamsss/leetcode
Binary Tree Zigzag Level Order Traversal/main.cpp
#include <bits/stdc++.h> using namespace std; 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), left(left), right...
ALGO
0.999999
6.018324
{ "github_metadata": { "branch": "master", "commit_count": 31, "repo_created_at": "2020-04-21T13:05:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3f2a19224...
9fcca6e2-4f5b-4327-a95d-782ac3c73b71
ikur6789/character_balance_tumbleweed
tournament.hpp
#include <cstdio> #include <vector> #include <cstdlib> #include <cmath> #include <random> #include <algorithm> #include <numeric> #include <iostream> #include <ctime> #include "character.hpp" #ifndef NUM_TOURNAMENTS #define NUM_TOURNAMENTS 1 #endif /* battle calculations based on FE7 from https://fireemblem.fandom....
ALGO
0.994126
4.039744
{ "github_metadata": { "branch": "master", "commit_count": 54, "repo_created_at": "2019-02-24T02:05: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": "979b6f444...
2e4bc947-0474-4a87-a9d0-b72c30e9fc00
KarthikaVijayanNV/DataStructures-QUEUE
Queue_2/Queue_Use_Stack_App2.cpp
#include<iostream> #include<stack> using namespace std; class queue { stack<int> st1; public: void push(int x) { st1.push(x); } int POPoperation() // compiler will get confusion so name changed { if(st1.empty()) // no elements { cout<<"Queue is ...
ALGO
0.999146
4.207983
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-03-09T07:48: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": "7c986075daab...
24583a6f-5df3-4063-8612-6fb8b9e32075
PaddlePaddle/Paddle
paddle/phi/kernels/funcs/multinomial_functor.h
/* Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. 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 applicable la...
ALGO
0.997823
7.698215
{ "github_metadata": { "branch": "develop", "commit_count": 54743, "repo_created_at": "2016-08-15T06:59:08.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 23037, "forks": 5770, "issues": 1009, "pull_requests": 823 }, "file_meta": { "content_...
1514e2e2-0f8e-46ab-8a7a-348cd5fe60c5
Prasad7599/c-c-programms
11AVL.cpp
/*Implementation of an AVL tree. */ #include<iostream> using namespace std; struct node { int data; node *left,*right; int ht; }; class AVL { node *AVLroot; node *insert1(node *,int);//Recursive counterpart of insert node *Delete1(node *,int);//Recursive counterpart of delete void preorder1(node *); //...
ALGO
0.999938
4.680122
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-07-24T14:38: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": "754bc93fbfc4...
69a6d5bc-62d0-4b21-b314-823c3aa217ad
sk10salman/dynamic-programming
linked_list/middle_leet.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: int count(ListNode *r...
ALGO
0.999938
6.173991
{ "github_metadata": { "branch": "master", "commit_count": 63, "repo_created_at": "2020-03-23T17:06:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a55a6676b...
53d7523d-23d8-4059-a08a-72995cc593fb
alexliu07/CPPCodes
questions/218.cpp
// // Created by <NAME> on 2023/8/18. // #include <bits/stdc++.h> #define N 100005 #define INF 0x7fffffff typedef long long ll; struct data { ll day, cnt; bool operator<(const data &rhs) const { return day < rhs.day; } } lists[105]; int T, n; ll cur, k; bool flag; int main() { std::ios::sy...
ALGO
0.99996
5.400087
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2023-09-24T07:00:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d8810e04f7b5...
5003f453-3458-4bcb-8d50-d7aede24e512
Mu-L/TracerInteractiveUE4Plugins
Engine/Plugins/Experimental/GeometryProcessing/Source/GeometricObjects/Public/Spatial/GeometrySet3.h
// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "BoxTypes.h" #include "RayTypes.h" #include "Polyline3.h" /** * FGeometrySet3 stores a set of 3D Points and Polyline curves, * and supports spatial queries against these sets. * * Since Points and Curves have no area to hit, hit-tests are...
TOOL
0.922379
7.765222
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2020-03-24T02:30:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 16, "forks": 11, "issues": 1, "pull_requests": 1 }, "file_meta": { "content_id": "b627023...
a3bd0959-bbcc-4d0e-b3e3-7b2514eb025f
wishne/dhdaf
math.h
#pragma once namespace math { // pi constants. constexpr float pi = 3.1415926535897932384f; // pi constexpr float pi_2 = pi * 2.f; // pi * 2 __forceinline float Bias(float x, float biasAmt) { float lastExponent = log(biasAmt) * -1.4427f; // (-1.4427 = 1 / log(0.5)) return pow(x, lastExponent);...
TOOL
0.96031
4.19891
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-09-07T23:57:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2f2bad8d3123...
06531f70-1750-4734-b714-79f666b04cab
jiku90/whitesnake-cpp-pclaf
05.SortBySize/05.SortBySize.cpp
// 실습 : 사각형을 크기 순으로 정렬하라. // - 기존의 정렬알고리즘 함수를 사용할 수 있도록 클래스를 수정한다. /* void SWAP(int& x, int& y) { int temp = x; x = y; y = temp; } void QuickSort(int ary[], int n) { if(n<=1) return; int last=0; // 첫번째 요소의 값보다 작은 요소들을 찾아서 // 첫번째 요소의 다음위치부터 차례대로 차곡차곡 쌓는다. for(int i=1; i<n; i++) { if(ary[i] < ary[0]) ...
ALGO
0.999282
5.298988
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2015-12-31T14:30:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "430efa9c98...
41dffe37-ddb7-4304-b6fa-b2d36811ecec
dhwanish-3/Interview-Questions-and-Solutions
Oracle/Test-Q2.cpp
#include <bits/stdc++.h> using namespace std; long dominatingXorPairs(vector<int> arr) { int n = arr.size(); long count = 0; unordered_map<int, int> hash; for (int i = 0; i < n; i++) { hash[arr[i]]++; } for (auto it : hash) { int num = it.first; int freq = it.second; ...
ALGO
0.999981
4.583848
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2023-07-25T08:30:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 1, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "8ba11974705...