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
8e4cce62-bfc4-40bf-9f29-48c753da46d3
sakshampandit/DSA
1220-count-vowels-permutation/1220-count-vowels-permutation.cpp
class Solution { public: const long long mod = 1e9 + 7; int n; vector<vector<int>> dp;// (length, ends with jth vowel) int f(int i, int j) { if (i == n) return 1; if (dp[i][j] != -1) return dp[i][j]; long long ans = 0; switch (j) { case 0: ans=(ans + f(i+1, ...
ALGO
0.999926
5.070222
{ "github_metadata": { "branch": "main", "commit_count": 1029, "repo_created_at": "2022-12-23T12:43:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2d6c4b18d...
5f24acfa-4613-42b2-9edd-c239efe4101b
AppledoreM/OI
PastFiles/Codeforces/Contest2019/Codeforces574_Div2/E.cpp
#include <bits/stdc++.h> using namespace std; constexpr int maxn = 3005; typedef long long ll; int n,m,a,b; ll g,x,y,z; ll que[maxn]; ll matrix[maxn][maxn], row_mn[maxn][maxn], matrix_mn[maxn][maxn]; int main(){ cin>>n>>m>>a>>b>>g>>x>>y>>z; for(int i = 1; i <= n; i++){ for(int j = 1; j <= m; j++){ ...
ALGO
0.999882
3.582324
{ "github_metadata": { "branch": "master", "commit_count": 175, "repo_created_at": "2018-08-02T09:00:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "55a1cd2c...
d1685522-3f71-4e49-8315-a1bf3e012c0c
alexandraback/datacollection
solutions_1485488_0/C++/tdmorgan/R1B2012B.cpp
#include <list> #include <string.h> #include <algorithm> #include <cmath> #include <iostream> #include <ext/hash_map> #include <stdint.h> #include <ctime> #include <queue> #include <sstream> #include <sys/time.h> #include <fstream> #include <vector> using namespace std; typedef pair<int,int> PII; typedef vector<PII> ...
ALGO
0.99828
3.242238
{ "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": "90771a37e...
cf860580-7843-404f-a3fc-ee57c87dfa37
jrk/gradient-halide
src/ApplySplit.cpp
#include "ApplySplit.h" #include "Simplify.h" #include "Substitute.h" namespace Halide { namespace Internal { using std::map; using std::string; using std::vector; vector<ApplySplitResult> apply_split(const Split &split, bool is_update, string prefix, map<string, Expr> &dim_exten...
ALGO
0.995635
7.370149
{ "github_metadata": { "branch": "master", "commit_count": 31073, "repo_created_at": "2017-08-13T18:34:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 102, "forks": 17, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "954...
dd20d5e4-0b08-4333-8d12-2fd87cf0cc73
cffff-kong/Single-Cam-Structurd-Light-Scanner
scanner/SSLReconstruction.cpp
#include "SSLReconstruction.h" SSLReconstruction::SSLReconstruction(int ps_num, int img_width, int img_height, int T1, int T2, int T3) { this->m_ps_num = ps_num; this->m_width = img_width; this->m_height = img_height; this->m_frequency = new int [3] {T1, T2, T3}; m_T13 = T1 - T3; m_T23 = T2 - T3; m_T123 = m_T13...
DATA
0.977682
3.50837
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2025-01-10T14:30:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1c3fc3e8ed...
69b38353-75b4-45f9-86bc-d7579129b58b
GYPpro/ACM
1_Contests/CF948.2/C_Nikita_and_LCM.cpp
#include <iostream> #include <stdlib.h> #include <math.h> #include <algorithm> #include <string> #include <string.h> #include <vector> #include <queue> // #define map unordered_map // #define set unordered_set #include <map> #include <set> // #pragma GCC optimize(2) #define int long long #define FI for(int i = 0;i <...
ALGO
0.999884
4.609435
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2023-10-29T07:31:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bc75193c99d...
f6411b3d-94e1-43cd-a147-eeb2805f8bf6
cms-sw/cmssw
L1Trigger/L1TMuonBarrel/src/L1TMuonBarrelKalmanSectorProcessor.cc
#include "L1Trigger/L1TMuonBarrel/interface/L1TMuonBarrelKalmanSectorProcessor.h" L1TMuonBarrelKalmanSectorProcessor::L1TMuonBarrelKalmanSectorProcessor(const edm::ParameterSet& iConfig, int sector) : verbose_(iConfig.getParameter<int>("verbose")), sector_(sector) { std::vector<int> wheels = iConfig.getParameter...
ALGO
0.992007
5.851964
{ "github_metadata": { "branch": "master", "commit_count": 251237, "repo_created_at": "2013-06-26T14:09:07.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1144, "forks": 4480, "issues": 947, "pull_requests": 108 }, "file_meta": { "content_id...
f9711224-61eb-4ca7-8dc5-633d3c3ecadd
YoungM1racle/ELEC_CAR
lab_06_logic.ino
/* ELEC1100 Your Lab#06 & Project Template To program the car tracking the white line on a dark mat Group No. (number of your project box): Group Member 1 (name & SID): Group Member 2 (name & SID): */ // assign meaningful names to those pins that will be used int regular_speed = 140; const int pinL_Senso...
ALGO
0.977656
4.998854
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2025-04-21T08:49:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0c385da631fc...
0ed1e82b-82c2-460c-8c32-3190f37e992c
Adamya-Kumar/Sorting
Q2-Recursive.cpp
/* GIVEN AN ALREADY SORTED ARRAY OF POSITIVE INTEGER, DESIGN A BINARY ALGORITHM AND IMPLEMENT IT USING A PROBLEM AND TO FIND WHETHER A KEY ELEMENT IS PRESENT IN ARRAY OR NOT. ALSO FIND THE NUMBEROF TOTAL COMPARISON FOR EACH INPUT CASE. */ //RECURSIVE #include<iostream> using namespace std; void binary_search(int arr...
ALGO
0.999783
4.949549
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2022-10-19T22:41: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": "f80ea1d07b...
410f690e-62e0-4271-a1a6-afc357d1c189
hitcm/cartographer
cartographer/mapping_3d/sparse_pose_graph/optimization_problem.h
/* * Copyright 2016 The Cartographer Authors * * 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 law...
ALGO
0.993338
4.310717
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2016-10-08T03:04:21.000Z", "is_fork": true, "is_org_owned": false, "forked_from": "cartographer-project/cartographer", "stars": 34, "forks": 27, "issues": 0, "pull_requests": 0 }, "file_meta"...
c77ef22c-1845-48d3-9958-0384070b00c6
rayenbbs/CP4_Competitive_Programming_Book_Problems
UVA/DS/2D Array/UVA_11360.cpp
#include <bits/stdc++.h> using namespace std; #define LSOne(S) ((S) & -(S)) #define ll long long #define pii pair<int, int> #define pll pair<long long, long long> #define vi vector<int> #define vii vector<vi> #define vll vector<long long> #define mii map<int, int> #define si set<int> #define sc set<char> #define umap...
ALGO
0.999707
6.139485
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2024-05-10T13:47: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": "785e5fce88...
c9b9ffd2-3774-4c56-b19a-c20ae3762653
aidenbenner/competitive-programming
problems/ccc/ccc_10_j4.cc
#include <iostream> #include <algorithm> #include <string> #include <cstdio> #include <vector> #include <set> #include <map> #include <unordered_map> #define INF 1e9 #define EPS 1e-13 #define pb push_back using namespace std; typedef vector<vector<pair<int,int>>> Adjlist; typedef unsigned long long ull; typedef lo...
ALGO
0.999954
3.257881
{ "github_metadata": { "branch": "master", "commit_count": 65, "repo_created_at": "2016-11-05T00:39: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": "bb0640b4a...
2b72a0c3-ac86-4c9f-b74d-478b5f46356e
amsraman/Competitive_Programming
15-295/F21/Contest 13/D.cpp
#include <bits/stdc++.h> typedef long long ll; #define f first #define s second using namespace std; const int mod = 1e9 + 7; int n, k, fact[200001], ifact[200001], ans; pair<int, int> segs[200000]; vector<int> bounds, sp, ep; int mul(int x, int y) { return (1LL * x * y) % mod; } int exp(int x, int y) { in...
ALGO
0.999941
4.46295
{ "github_metadata": { "branch": "master", "commit_count": 413, "repo_created_at": "2019-03-04T14:45:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c0785191...
02b46262-cb75-491d-81db-c4f784209988
kkafar/algo
algorytmy/sortowanie/merge-sort-1.cpp
/* MERGE SORT WERSJA 1 Sortowanie przez scalanie O(n * logn) */ #include <iostream> #include <time.h> using namespace std; void error(const string& s) { cout << s << "\n"; } /* ALGORYTM REALIZUJĄCY SCALANIE DWÓCH ZBIORÓW */ /// ================================================ // operujemy na podzbiorach sorto...
ALGO
0.999961
5.17727
{ "github_metadata": { "branch": "master", "commit_count": 517, "repo_created_at": "2019-07-03T12:20:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1d04c7f2...
1d8d477d-8a20-4728-b67a-f22741b50e65
wangyurzee7/THUPC2019
day1/furniture/saffah/std.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define f(x, y, z) for(int x = (y); x <= (z); ++x) #define g(x, y, z) for(int x = (y); x < (z); ++x) #define h(x, y, z) for(int x = (y); x >= (z); --x) const int P = 998244353; int s[20][1000007]; struct Matrix { int a[20][20]; }; Matrix operator...
ALGO
0.999932
4.053244
{ "github_metadata": { "branch": "master", "commit_count": 209, "repo_created_at": "2019-03-18T12:59:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 61, "forks": 18, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "bf09c1...
66a9422f-7065-4913-b94f-c3f7a4cf5207
yashraj-code/Practice_C
Tree_binaryTree/Binary_Tree/3_BT_input_binarytree.cpp
/* We will take input and ask everytime about left, right, when user does not want to have child (-1) is expected there. 1 / \ 2 3 / \ / \ -1 -1 -1 -1 input would be -> 1 2 -1 -1 3 -1 -1 */ #include<stdio.h> #include<iostream> #include "B...
ALGO
0.999742
3.945839
{ "github_metadata": { "branch": "main", "commit_count": 179, "repo_created_at": "2023-01-31T12:40: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": "6867268ade...
19867332-aaa5-4fea-870a-99865c6bdade
edwardwang618/Luogu-ACWing-CodeForces
ACWing/99. 激光炸弹/main.cc
#include <iostream> using namespace std; const int N = 5010; int g[N][N]; int m, n; int main() { int N, r; scanf("%d%d", &N, &r); r = min(r, 5001); n = m = r; for (int i = 0, x, y, w; i < N; i++) { scanf("%d%d%d", &x, &y, &w); x++, y++; g[x][y] += w; n = max(n, x), m = max(m, y); } for ...
ALGO
0.999841
3.579602
{ "github_metadata": { "branch": "master", "commit_count": 756, "repo_created_at": "2021-02-03T18:10: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": "78b790d4...
00403593-d1e2-454e-b4d4-c749925d5e9c
ApolloAuto/apollo
modules/perception/common/algorithm/i_lib/core/i_blas.h
/****************************************************************************** * Copyright 2018 The Apollo 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 ...
TOOL
0.934763
6.291937
{ "github_metadata": { "branch": "master", "commit_count": 19341, "repo_created_at": "2017-07-04T19:03:31.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 25847, "forks": 9793, "issues": 895, "pull_requests": 104 }, "file_meta": { "content_id...
fe8a4b3e-374f-4f81-a3f6-5ebf30978d15
vigente/gerardus
cpp/src/third-party/scipoptsuite-3.0.2/scip-3.0.2/src/cppad/local/comp_op.hpp
/* $Id: comp_op.hpp 1986 2011-06-18 20:33:17Z bradbell $ */ # ifndef CPPAD_COMP_OP_INCLUDED # define CPPAD_COMP_OP_INCLUDED /* -------------------------------------------------------------------------- CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-11 <NAME> CppAD is distributed under multiple licenses. T...
ALGO
0.903957
7.341508
{ "github_metadata": { "branch": "master", "commit_count": 3429, "repo_created_at": "2015-04-07T14:27:55.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 223, "forks": 74, "issues": 5, "pull_requests": 1 }, "file_meta": { "content_id": "620e7...
9ef4a263-899a-4869-9b91-661a14fd2c0c
Witalia008/competitions
E-Olymp/Summer Programming School 2012 #7 (Benelux Algorithm Programming Contest Finals)/H.cpp
#include <stdio.h> #include <cstdlib> #include <iostream> #include <set> #include <algorithm> #include <vector> #include <string> #include <memory.h> #include <map> #define _USE_MATH_DEFINES #include <math.h> #include <list> #include <fstream> #include <time.h> #include <iomanip> #include <queue> #include <stack> using...
ALGO
0.99992
3.371053
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2021-03-31T16:10: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": "ea98e9445e2...
6d2c0931-120e-448c-b5c4-dad4b05668fb
ChenYangyao/project-leetcode-solution
cpp/problem160.cpp
#include <mystd.h> using namespace MYSTD; using namespace std; // Definition for singly-linked list. struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; /** * Solution 1: by reversing one of the list, and counting * the nodes of lists before and after reversing, and then...
ALGO
0.999901
5.137543
{ "github_metadata": { "branch": "master", "commit_count": 527, "repo_created_at": "2018-10-03T07:41:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "693db996...
35fe77d8-89fb-41b2-8f6e-79b04e8d5e9d
mounteverfresh/Lab4
VectorDriver.h
/* File: VectorDriver.cpp * Athr: <NAME> * Date: October 16, 2002 * * Desc: provides the basic framework and examples for an introduction to * the STL::vector, iterators, and the algorithms facilities. * * Edited by: <NAME> * Date: October 15, 2018 (the future) * Lab04 * */ typedef unsigned long ulong;...
ALGO
0.996411
5.427805
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2018-10-16T04:29: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": "120bc3a00f...
7a3e1341-baee-4c79-b74a-082527586204
KMU-CGLab/Algorithm
Programmers/150001-200000/169199_sonny.cpp
// 169199 : 리코쳇 로봇 Lv2, BFS #include <string> #include <vector> #include <queue> #include <iostream> using namespace std; int deltaX[4] = {0, -1, 0, 1}; int deltaY[4] = {-1, 0, 1, 0}; int solution(vector<string> board) { int answer = -1; int endX = board[0].length(); int endY = board.size(); vector...
ALGO
0.999651
4.564384
{ "github_metadata": { "branch": "main", "commit_count": 220, "repo_created_at": "2022-07-06T10:36:43.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3b1d748d70a...
787afb3b-1174-4433-b0d5-81beeeb4316c
blender/blender
extern/Eigen3/Eigen/src/Core/arch/AVX512/MathFunctions.h
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2016 <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...
ALGO
0.997587
7.018153
{ "github_metadata": { "branch": "main", "commit_count": 152123, "repo_created_at": "2019-10-09T12:47:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 15670, "forks": 2395, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9...
80ee1d8e-b355-461f-a289-5c0e7dccf15c
BHAVISHAYA/GFG-Question-Solution
Prefix match with other strings - GFG/prefix-match-with-other-strings.cpp
//{ Driver Code Starts //Initial template for C++ #include<bits/stdc++.h> using namespace std; // } Driver Code Ends //User function Template for C++ class Solution{ public: int klengthpref(string arr[], int n, int k, string str){ if(k > str.size()) return 0; while(str.size() != k) { ...
ALGO
0.998747
5.610322
{ "github_metadata": { "branch": "main", "commit_count": 604, "repo_created_at": "2023-04-01T05:10: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": "09da54fe9c...
d4c269d5-cebd-4ac1-8a59-313905513577
Kawser-nerd/CLCDSA
Source Codes/CodeJamData/10/01/10.cpp
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <utility> #include <string> #include <fstream> #include <map> #include <set> #include <queue> #include <memory.h> using namespace std; typedef vector<int> VI; typedef pair<int, int> PI; typedef vector<PI> VPI; #define FOR(i,a,n) fo...
ALGO
0.999316
4.111495
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2019-09-30T05:38:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 22, "forks": 8, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "d85f64c1...
9dfd349d-a7a8-4295-9a11-c5efdf7e81e1
ishandutta2007/codeforces-a
anz/normal/1474/D.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; ll gcd(ll a, ll b) { for (; b; a %= b, swap(a, b)); return a; } const ll INF = 1e18; int n; ll a[200001]; ll psum[200001]; ll min0[200001]; ll min1[200001]; ll pmin[200001]; int main() { ios...
ALGO
0.999866
3.979274
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-11T00:51:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1914394f5534...
e1797ce5-b500-44bb-ac2a-94c69f0ea489
arash16/prayers
UVA/vol-113/11360.cpp
/* >>~~ UVa Online Judge ACM Problem Solution ~~<< ID: 11360 Name: Have Fun with Matrices Problem: https://onlinejudge.org/external/113/11360.pdf Language: C++ Author: <NAME> Email: <EMAIL> */ #include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0);cin.tie(0); ...
ALGO
0.999658
4.419162
{ "github_metadata": { "branch": "master", "commit_count": 386, "repo_created_at": "2017-04-27T11:21:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e9ac9753...
0c8af4ea-e045-448d-86af-b69e077e9e5f
tlxucheng/mylinux
App/leetcode/leetcode/MyStack/MyStack.cpp
#include <iostream> #include <queue> class MyStack { public: /** Initialize your data structure here. */ MyStack() { } /** Push element x onto stack. */ void push(int x) { q.push(x); } /** Removes the element on top of the stack and returns that element. */ in...
ALGO
0.986304
5.178201
{ "github_metadata": { "branch": "master", "commit_count": 324, "repo_created_at": "2019-08-03T14:31: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": "89c24c6a...
da38902f-9d8c-4908-93a7-25238ed8459a
Badir-av/Tarea-1-Algoco
Tarea1/Ejecutar_Algoritmo.cpp
#include <iostream> #include <fstream> #include <sstream> #include <vector> #include <chrono> #include <cstdlib> #include "Quicksort.h" #include "Mergesort.h" #include "Selectsort.h" #include "C++sort.h" using namespace std; vector<int> leerNumerosDesdeArchivo(const string& nombreArchivo) { vector<int> numeros; ...
ALGO
0.999357
5.352971
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2024-09-11T02:54:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "45b3e9872bf...
43eda68d-8857-47c6-9710-c744e5ff0105
amirelkased/ProblemSolvingTraining
CodeForces/435A_Queue_on_bus_stop.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define F first #define S second #define el '\n' #define RateForNow_NEWBIE_1044_357 ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); const double PI = 3.14159265358979...
ALGO
0.999978
3.555883
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2021-12-06T13:55:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "adbae1262478...
52acd498-31bb-413f-8c88-3302cf5b77b1
sharc-lab/FPGA_ECE8893
2022_Spring/Final_Projects/FLAT-acceleration/source_code/HLS/flat.cpp
#include "flat.h" #include <iostream> #include <limits> #include "hls_math.h" void FlatDataflow( data_t query[576][64][16][64], data_t key[576][64][16][64], data_t value[576][64][16][64], data_t bias[64][16][64][64], data_t attention_out[576][64][16][64]) // MEM_TYPE query[576][64][16], /...
ALGO
0.997252
4.51364
{ "github_metadata": { "branch": "main", "commit_count": 218, "repo_created_at": "2022-01-25T19:25:54.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 36, "forks": 37, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bb7d4be0d...
e70c0137-df42-4344-aedf-58dba898d4fc
braully/graph-problems-tool
c-projects/graph-check-chordability/main.cpp
#include <iostream> #include <set> #include <vector> #include <map> #include <algorithm> #include <stdio.h> #include <stdlib.h> // Structures // ord(i) has the number of vertex i in the ordenation // vert(i) has the vertex of number i in the ordenation typedef struct order_alpha { std::vector<int> ord; std::vector<...
ALGO
0.999417
3.938919
{ "github_metadata": { "branch": "master", "commit_count": 386, "repo_created_at": "2018-07-16T14:18:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e7ee2d0d...
ebe723fd-e1ca-42fa-abf7-49c201824bd0
underscoreanuj/Codes
codingame/Easy/power_of_thor_ep_1.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; /** * Auto-generated code below aims at helping you parse * the standard input according to the problem statement. * --- * Hint: You can use the debug stream to print initialTX and initialTY, if Thor seems not follo...
ALGO
0.999968
4.157976
{ "github_metadata": { "branch": "master", "commit_count": 715, "repo_created_at": "2020-01-03T04:02: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": "d421a281...
9d1cfe95-6eb5-47d9-a7da-283f318d0d6b
foorhad/Basic_Algorithm
week 2 Graph Algorithm/MOD 7 Bellmanford and Floyd Warshall algorithm/bellman_ford.cpp
#include <bits/stdc++.h> #define fast() ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0) using namespace std; class Edge { public: int u, v, c; Edge(int u, int v, int c) { this->u = u; this->v = v; this->c = c; } }; int main() { fast(); int nodes, edge; cin >> no...
ALGO
0.999988
4.356392
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2024-09-28T19:21:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f051fd94cf5...
45ad528f-7766-4bfb-b609-63391b527a12
rameshreddy011/CSA-5148-cryptography-
13. Hill Cipher(Plaintext Attack)/Hill Cipher(Plaintext Attack).cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MATRIX_SIZE 3 void getKeyMatrix(int keyMatrix[MATRIX_SIZE][MATRIX_SIZE], char key[]) { int k = 0; for (int i = 0; i < MATRIX_SIZE; i++) { for (int j = 0; j < MATRIX_SIZE; j++) { keyMatrix[i][j] = (key[k]) % 65; ...
ALGO
0.999959
3.958665
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-06-21T07:26: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": "c616952605e2...
29acb9b9-4997-4f5a-8303-fdc9f2340f62
RobertChienShiba/Cpp-Practice
hw4/HW04CR10741071.cpp
// ====================== // Programmer: 簡睿閎 // Date: 20231031 // File: HW04CR10741071.cpp // Description: Write a C++ program that determines student grades at the end of the semester. // ====================== #include <iostream> using namespace std; // 函式宣告,用於冒泡排序和交換學生資料的指標 void bubbleSort(int**); void swap(int**, ...
ALGO
0.999673
5.036159
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-12-24T13:01: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": "ae1fabc2146b...
04d4d7cb-4bb0-4f00-a535-d67708a145fd
thecodingwizard/competitive-programming
GoogleCodeJam/2020/Round 1A/C.cpp
//#pragma GCC optimize ("O3") //#pragma GCC target ("sse4") #include <bits/stdc++.h> using namespace std; template<class T> using min_heap = priority_queue<T, vector<T>, greater<T>>; #define FOR(i, a, b) for (int i=a; i<(b); i++) #define F0R(i, a) for (int i=0; i<(a); i++) #define F0R1(i, a) for (int i=1; i<=(a); i...
ALGO
0.999649
4.124918
{ "github_metadata": { "branch": "master", "commit_count": 946, "repo_created_at": "2018-11-29T17:03:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 83, "forks": 22, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a11571...
12e0c5a3-9ddf-43d5-9fee-0e2a63247c3f
AnkushJadhav/NSE-ISB-CodeSprint
Q1_CrossOver/Answer1.cpp
#include <iostream> #include <iomanip> #include <math.h> #define LT 300 #define ST 60 #define PRECISION 2 using namespace std; class Price{ public: int value; Price* nextP; }; class SharePool{ public: Price* head = NULL; Price* tail = NULL; Price* stTail = NULL; ...
ALGO
0.999647
3.221471
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2017-03-25T19:43: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": "41efd28d0f...
f8a494f9-37aa-44fe-be6c-2f53016a2726
embedded-mas/embedded-mas-applications
collision-avoiding-vehicle/car4wheels/arduino/4wheels/4wheels.ino
#include<Embedded_Protocol_2.h> #include<ArduinoJson.h> #include<NewPing.h> #include<AFMotor.h> Communication communication; //DEFININDO VARIÁVEIS DO SENSOR #define TRIGGER_PIN_1 A1 #define ECHO_PIN_1 A0 #define TRIGGER_PIN_2 A3 #define ECHO_PIN_2 A5 #define MAX_DISTANCE 200 int leitura = 1; int sensor_state = 5; in...
TOOL
0.927335
4.688828
{ "github_metadata": { "branch": "main", "commit_count": 38, "repo_created_at": "2024-07-03T12:23:07.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "44595e6e246f...
385adb64-01fb-4917-810e-f8eba6e0dfe2
woohyunjng/Coding-Practice
CP/Codeforce/Round 989/C.cpp
#include <bits/stdc++.h> #define int long long #define MAX 1100 #define MOD 1000000007 #define INF 0x7f7f7f7f7f7f7f7f #define endl '\n' using namespace std; typedef pair<int, int> pr; typedef array<int, 3> tp; int subst(int A, int B, int N) { return A * (N + 3) + B; } pr to_pair(int K, int N) { return {K / (N + 3), ...
ALGO
0.99965
4.525348
{ "github_metadata": { "branch": "main", "commit_count": 485, "repo_created_at": "2022-06-04T14:40:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "78ccaea04d...
d5b01ff3-e134-4ba4-abfe-86f15c80196d
Pratik-Ninawe/LeetCode-DSA
3618-find-the-original-typed-string-ii/3618-find-the-original-typed-string-ii.cpp
class Solution { public: const int MOD = 1e9 + 7; int possibleStringCount(string word, int k) { if (word.empty()) return 0; vector<int> groups; int count = 1; for (int i = 1; i < word.size(); i++) { if (word[i] == word[i - 1]) count++; e...
ALGO
0.999987
5.749024
{ "github_metadata": { "branch": "main", "commit_count": 1213, "repo_created_at": "2025-05-17T09:44:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5004f57da...
69bf22e1-dd23-4d29-b5b5-b0f53b690b94
suyi-92/UESTC
2330.cpp
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e3; int a[MAXN + 7], b[MAXN + 7]; int n; struct celeste { int diff; int p; } c[MAXN + 7]; bool Compare(celeste t1, celeste t2) { return t1.diff < t2.diff; } int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d", ...
ALGO
0.99999
3.488303
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-06-21T15:58: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": "dec641c1e2...
bd06201d-b3e3-4fda-a31c-5bdbefe8a11a
6Yolo6/Pro2
Pro2/源.cpp
//#include<iostream> // //using namespace std; // //int height[100005], father[100005]; // //void init(int n) { // for (int i = 0; i < n; i++) { // father[i] = i; // height[i] = 1; // } //} // //int findRoot(int x) { // while (father[x] != x) { // x = father[x]; // } // return x; //} // // //int uniteGp(int x, int y...
ALGO
0.999548
3.783926
{ "github_metadata": { "branch": "cpp", "commit_count": 5, "repo_created_at": "2023-03-04T08:00: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": "c37082ad2599f...
c77ccc3b-c120-4961-826b-984f22022d9e
OsrHu/algorithm
pat/2021-计院考研复试上机/7-3_Preorder_Traversal.cpp
#include<iostream> #include<cstring> #include<algorithm> #include<unordered_map> #include<vector> using namespace std; unordered_map<int, int> l, r, pos; unordered_map<int, int> inorder, postorder; vector<int>ans; int build(int il,int ir, int pl, int pr) { int root = postorder[pr]; int k = pos[root]; ...
ALGO
0.999987
3.836796
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-03-15T08:57: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": "6a332e5e9409...
618cd89b-0e9a-4754-bc4f-38df8eea8383
Holmes1204/CruzerDog
main_controller/include/Convex_MPC/ConvexMPC.h
#ifndef _CONVEX_MPC_ #define _CONVEX_MPC_ #include <osqp/osqp.h> #include <ros/ros.h> #include <OsqpEigen/OsqpEigen.h> #include <eigen_types.h> #include <defination.h> #include <FSM/FSM_data.h> using namespace quad; class FSM_data; class ConvexMPC { public: /*! Weight Matrix*/ Eigen::Matrix<double, MPC_STATE...
ALGO
0.998472
5.355667
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2023-08-13T08:31: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": "a3757969ab7...
56e7eb96-7e27-4c07-a6f9-d3b696587f1b
bhosalepranil16/DSA-Solutions
1302-deepest-leaves-sum/1302-deepest-leaves-sum.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999974
5.918659
{ "github_metadata": { "branch": "main", "commit_count": 808, "repo_created_at": "2022-01-10T05:49:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4771a6d966...
620ac9db-e131-4708-b9a0-828fcfda2853
summerdaway/MOST_gamma
final-v12/bign.h
#ifndef __BIGN_H__ #define __BIGN_H__ #include <stdio.h> #include <stdlib.h> #include <iostream> #include <string> #include <cstring> #include <cstdio> using namespace std; #define BASE_10 10 // const int maxn = 200; // const int prime1 = 49157; // // const int prime2 = 98317; // const int HASH_LEN = 18; /...
ALGO
0.970686
3.51477
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2022-02-20T15:39:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "cf2788abfb...
638d56b4-85ff-49f4-affb-403f23984df5
maoxiezhao/NeptuneEngine
modules/math/geometry.cpp
#include "geometry.h" #include "vMath_impl.hpp" namespace VulkanTest { bool Ray::Intersects(const AABB& b) const { return b.Intersects(*this); } AABB AABB::CreateFromHalfWidth(const F32x3& center, const F32x3& halfwidth) { return AABB( F32x3(center.x - halfwidth.x, center.y - halfwidth.y, center.z - halfw...
ALGO
0.982705
6.954618
{ "github_metadata": { "branch": "main", "commit_count": 320, "repo_created_at": "2021-08-09T10:26:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8b771ec9e5...
e3bb25af-737c-4a3e-9acc-357cb4db3a80
raghavshulka/DSA
Arrays/findduplicateatlast.cpp
#include <iostream> using namespace std; // o to n-1 array at last duplicate hai/.. int findDuplicateElement(int arr[], int n) { int element = 0; int ans; for (int i = 0; i < n - 1; i++) { element = element ^ arr[i]; }; cout << element << endl; for (int i = 0; i < n; i++) { ...
ALGO
0.99988
4.945121
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2024-06-20T15:59: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": "cc4e48ca2a1...
31905289-4691-4db8-9e85-b3979920fd12
HabibaBaraka/codeForces
Important Exam.cpp
#include<vector> #include <iostream> #include<unordered_map> #include<algorithm> #include<cmath> #include<stack> #include<map> #include <unordered_set> #include<numeric> #include<string> #include<queue> #include<set> #define Y "YES" #define O "NO" #define el cout<<endl; #define ll long long #define ld long double using...
ALGO
0.999757
4.375081
{ "github_metadata": { "branch": "master", "commit_count": 272, "repo_created_at": "2025-03-17T07:45: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": "8df9a8c6...
fa67f4c3-80d9-4ed2-b54a-085760349e9b
hclspring/user-event-code
src/compute_cost_to_screen.cc
#include <cstring> #include "Process.h" using namespace std; int main(const int argc, const char** argv) { enum AlgoType {CLIQUE, CUT}; if(argc < 7){ cerr << "Usage: " << argv[0] << " INPUT_FILE ASSIGNMENT_FILE ALPHA BETA GAMMA TYPE" << endl; cerr << " Note: TYPE have two possible values: cut, or clique." << e...
ALGO
0.997759
4.124906
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2016-04-16T14:21:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "3b189c444...
e1b66598-36af-4f81-9724-9a768e86e7f3
little-big-h/AdvancedDB17CW2
Implementation.cpp
#include "Implementation.hpp" //////////////////// Nested Loop Joins //////////////////// std::vector<std::string> getQualifyingBusinessesIDsVector(Businesses const& b, float latMin, float latMax, float longMin, float longMax) { std::vector<std::string> quali...
ALGO
0.97202
4.134739
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2017-11-03T12:05:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6110503f95...
edb6e2fb-9718-4dd2-bdd9-a73bdcc8ecc8
pingchungchang/CP
cses1194.cpp
#include <bits/stdc++.h> using namespace std; typedef struct node{ int x; int y; int t; node(int a,int b,int c){ x = a; y = b; t = c; } }node; int main(){ int n,m; cin>>n>>m; vector<vector<char>> goneto(n,vector<char>(m,'o')); vector<pair<int,int>> dir = {{0,1},{1,0},{-1,0},{0,-1}}; pair<int,int> start...
ALGO
0.999962
4.049567
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-04-25T01:19:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1f93e78117a6...
0548b96a-05e6-4231-92b0-ba2d19fe0779
elissandro13/Problems-Solved
URI/2854.cpp
#include <bits/stdc++.h> using namespace std; int p,r; bool checar[1000]; map <string,int> pessoas; vector <int> lista[1000]; void dfs(int x){ for (int i = 0; i < (int)lista[x].size(); i++) { int indiv = lista[x][i]; if(!checar[indiv]){ checar[indiv] = true; dfs(indiv)...
ALGO
0.99966
3.957722
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2019-07-31T00:49:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "432f781c6...
c8ef44e7-1f12-429f-890c-7016043f62b4
sourceinsight/leetcode
cpp/Swap_Nodes_in_Pairs.cc
/* Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Your algorithm should use only constant space. You may not modify the values in the list, only nodes itself can be changed. */ /** * Definition for singly-linked list. ...
ALGO
0.999998
6.332828
{ "github_metadata": { "branch": "master", "commit_count": 143, "repo_created_at": "2014-12-16T02:53:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "690051f2...
9b01d16c-a75f-43fa-afed-9dddce4c85ef
Noctis-Xu/CIS_5511_Programming_Techniques
countNumber.cpp
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <math.h> using namespace std; int A_length = 0; //the length of an array int counter = 0; int randomSeed = time(0); int binarySearch_last(const int* A, const int key, int low, int high) { //return the max index of the element to be...
ALGO
0.998747
3.647898
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2020-09-24T15:19:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bec3becc8...
359a9333-33e3-483a-a633-62aa24490375
VivekChoudhary15/DSA-Questions
Binary Tree/bottomView.cpp
#include <iostream> #include <vector> #include <map> #include <queue> using namespace std; class Node { public: int data; Node* left; Node* right; Node(int value) { this->data = value; this->left = NULL; this->right = NULL; } }; class Solution { public: vector<int> bo...
ALGO
0.999997
6.557838
{ "github_metadata": { "branch": "main", "commit_count": 116, "repo_created_at": "2024-06-05T04:54: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": "a8393bbdb3...
81ddef6f-4794-4549-9585-8e27b62da2ba
brupadhyay/dynamic-programming
DP46 - Longest Bitonic Subseqeunce/bitonic.cpp
#include <bits/stdc++.h> using namespace std; /** * Bitonic means Increasing then decreasing * or strictly increasing or strictly decreasing * TC - O(N x N) x 2 * SC - O(N) x 2 */ int longestBitonicSubsequence(vector<int>& arr, int n) { vector<int> dp1(n, 1); vector<int> dp2(n, 1); for(int i = 0; i < n; i++){ ...
ALGO
0.999975
5.45966
{ "github_metadata": { "branch": "main", "commit_count": 61, "repo_created_at": "2023-08-26T14:16: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": "762a1fc18b8...
2270f8a6-6959-4816-a3b0-2741a3fde9c6
langqinren/leetcode
ContainerWithMostWater/ContainerWithMostWater.cpp
/* Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a container, such that the container contains the most water. Note: You m...
ALGO
0.999964
6.423405
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2013-05-15T02:35: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": "ba1c592575...
7fe4771c-77f1-4f06-b4c9-a45f14ea165b
usiksan/SaliCAD
src/import/nurbs/NurbsConvexHull.cpp
#include "NurbsConvexHull.h" #include <math.h> #define AbsTOL 1e-7 NurbsConvexHull::NurbsConvexHull(const QList< QList<QVector3D> > &vertex) { for( const auto &list : vertex ) { for( const auto &p : list ) { mArray.append( p ); } } int count = mArray.count(); // find four points that ma...
ALGO
0.996528
4.904108
{ "github_metadata": { "branch": "master", "commit_count": 979, "repo_created_at": "2018-02-23T08:02:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "2557d6bb...
80f27a35-cf64-4c39-9298-fe718c5b894e
singhsanket143/CppCompetitiveRepository
Dp_Lectures/Part2/Session/partition_equal_subset_sum.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: vector<vector<int> > dp; bool f(vector<int> &arr, int i, int k) { if(k == 0) return true; if(i == arr.size()) return false; if(dp[i][k] != -1) return dp[i][k]; if(arr[i] <= k) { // we...
ALGO
0.999853
5.089466
{ "github_metadata": { "branch": "master", "commit_count": 304, "repo_created_at": "2018-06-26T07:06:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 348, "forks": 160, "issues": 1, "pull_requests": 4 }, "file_meta": { "content_id": "f996...
d877a1df-7555-40de-bc1f-be4fd74dac7d
twe747474/P3
router.h
// // Created by <NAME> on 11/9/17. // #include <sys/socket.h> #include <vector> #include <map> #include "sharedFunctions.h" #ifndef P3_ROUTER_H #define P3_ROUTER_H void * createRouter(void *); struct neighbor { int address; //src int port; //dest int cost; int socket; neighbor(int s, ...
TOOL
0.956199
3.985318
{ "github_metadata": { "branch": "master", "commit_count": 79, "repo_created_at": "2017-11-14T20:28:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1973ecd37...
e7ba1217-f967-4e71-a174-31c5e92f4f95
RosinaGeorgieva/IntroductionToProgramming2020
week11/Solutions/task7.cpp
#include <iostream> #include <cstring> //exponential int fib(int n) { if (n < 0) { std::cout << "We only work with positive n!" << std::endl; return -1; } if (n <= 1) { return n; } return fib(n - 1) + fib(n - 2); } int fib1Util(int fn_1, int fn, int n, int x) { ...
ALGO
0.999889
4.818796
{ "github_metadata": { "branch": "main", "commit_count": 116, "repo_created_at": "2021-07-23T21:22:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ded07ffeb2...
7b812a25-e82b-44f7-9a2b-79cde152977d
TudorPirauI/ProgramareOrientataPeObiect
Probleme_fisa/11/11/multime.cpp
#include "multime.h" multime::multime() { n = 0; vector = nullptr; } multime::multime(int nr) { int val; n = nr; vector = new int[nr]; for (int i = 0; i < nr; i++) { std::cout << "Introduceti valoarea " << i + 1 << ":"; std::cin >> val; vector[i] = val; } } void multime::operator+=(int elem) { this->n...
TOOL
0.963097
4.327929
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-03-13T10:46: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": "33def17e32f0...
e607a74e-e6eb-4477-8615-534db909a546
idleyui/leetcode
solution/0007_Reverse_Integer.cpp
#include "alg.h" int reverse(int x) { string num = to_string(x); num = x < 0 ? num.substr(1, num.size() - 1) : num; int length = num.size(); for (int i = 0; i < length / 2; i++) swap(num[i], num[length - 1 - i]); try { return x < 0 ? (0 - stoi(num)) : stoi(num); } catch (const out_of_...
ALGO
0.999813
4.037235
{ "github_metadata": { "branch": "master", "commit_count": 190, "repo_created_at": "2018-08-02T08:05: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": "c2635593...
62392193-5cc5-45e0-a0e4-d1873a1deca1
J-JunChen/HDOJ
2036.cpp
// S△OAB = (x0 × y0 + x0 × y1 - x1 × y0 - x1 × y1 - x0 × y0 + x1 × y1) ÷ 2 // = (x0 × y1 - x1 × y0) ÷ 2 //多边形:S = 0.5 * ( (x0*y1-x1*y0) + (x1*y2-x2*y1) + ... + (xn*y0-x0*yn) ) #include <iostream> #include <iomanip> using namespace std; int main() { int n, x[3], y[3]; double sum; while (cin >> n)...
ALGO
0.999607
4.405295
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-04-04T14:14: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": "8c626bf2b5...
6efd9cce-0648-4249-bd92-900e86c74a09
GauravKanwat/CPP-LeetCode
BinarySearch/ceilTheFloor.cpp
#include<iostream> using namespace std; pair<int, int> getFloorAndCeil(vector<int> &a, int n, int x) { // Write your code here. int start = 0, end = n-1; while(start <= end) { int mid = (start + end) / 2; if(a[mid] == x) { return make_pair(a[mid], a[mid]); } if(a[mi...
ALGO
0.999982
5.020003
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2023-05-05T09:37: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": "8b5feeed3b9...
9adb1136-5958-4aa8-a7f7-1e08155466d7
Bhardwajvansh/cpp
2Darray.cpp
// #include<iostream> // using namespace std; // int main(){ // int arr[3][4]; // for(int i=0;i<3;i++){ // for(int j=0;j<4;j++){ // cin>>arr[i][j]; // } // } // for(int i=0;i<3;i++){ // for(int j=0;j<4;j++){ // cout<<arr[i][j]<<" "; // } // ...
ALGO
0.999777
3.950887
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-02-22T10:30: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": "e58bfcc9a2e5...
02e7d0e3-3ed8-4f4e-9e0f-80d88111f2f1
Janeshsinghania/DSA-with-Cpp
Binary_tree_general/Question9.cpp
#include<bits/stdc++.h> using namespace std; class Node{ public: int data; Node* left; Node* right; Node(int val){ data = val; left = NULL; right = NULL; } }; bool hasPath(Node* root, int targetSum){ if(root==NULL){ return false; } if(root->left==NUL...
ALGO
0.999756
5.335378
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-05-29T17:39: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": "b662ba0109e3...
c0c06ad9-566b-4961-b973-a86baf48fb89
nayuta1019/AtCoder
ABC/ABC131-140/ABC137/D/D.cpp
/* ABC137 2019/08/12/ 解説AC */ #define _USE_MATH_DEFINE #include <bits/stdc++.h> using namespace std; // repetition #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) for (int i = 0; i < (int)(n); i++) // container util #define all(x) (x).begin(), (x).end() // debug #define dump(x) cerr << #x << ...
ALGO
0.999922
3.483814
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2021-02-16T07:17: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": "7700b8c37d...
157a3bd3-94fc-4314-9616-d5dd2dd3717b
kamyu104/LeetCode-Solutions
C++/partition-to-k-equal-sum-subsets.cpp
// Time: O(n*2^n) // Space: O(2^n) // Memoization solution. class Solution { public: bool canPartitionKSubsets(vector<int>& nums, int k) { auto sum = accumulate(nums.begin(), nums.end(), 0); if (sum % k != 0 || *max_element(nums.begin(), nums.end()) > sum / k) { return false; }...
ALGO
0.999937
6.458892
{ "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": ...
be7042c4-5f38-411b-bbdb-b33f8b17afd5
Lornatang/opencv201907
include/dlcv_ocr.hpp
/** * Copyright 2019 DayHR 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 ...
TOOL
0.904852
5.915232
{ "github_metadata": { "branch": "master", "commit_count": 27, "repo_created_at": "2019-08-01T12:55:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2f486dcd5...
ddb789f7-d849-4e3a-bcda-dacc631cc4f5
Ahmed-Amamou/CP
Codeforces/Practice/C_Trip_to_the_Olympiad.cpp
// Author: <NAME> #include <bits/stdc++.h> #define ll long long #define endl "\n" #define F first #define double long double #define S second #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0) using namespace std; #define debug(x) co...
ALGO
0.999959
3.853161
{ "github_metadata": { "branch": "master", "commit_count": 72, "repo_created_at": "2023-12-28T18:53: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": "8202f044b...
a57a9a39-d6b5-4118-99db-45f66840ffb7
singh-yashwant/project-euler-100
problem18.cpp
#include<iostream> #include<vector> #include<set> #include<string> #include<bits/stdc++.h> #include<map> #include "timer.h" using namespace std; int find_answer(int i, int j, vector < vector < int > > &data, vector < vector < int > > &ans){ if(ans[i][j] != -1) return ans[i][j]; if(i == 14){ ans[i][j] = data[i]...
ALGO
0.999906
4.022512
{ "github_metadata": { "branch": "master", "commit_count": 50, "repo_created_at": "2020-01-04T14:30: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": "32beeff35...
27826b66-4432-4357-bd0f-d9e96fe237ec
Mathmedina27/TeoProMM
Matrices/CartasMatriz.c++
/** * @file CartasMatriz.c++ * @author your name (<EMAIL>) * @brief * @version 0.1 * @date 2024-07-06 * * @copyright Copyright (c) 2024 * */ #include <iostream> #include <stdlib.h> #include <ctime> using namespace std; struct CartasMatriz{ int num[13]; }Corazones, Picas, Brillos, Treboles; int fajo[...
ALGO
0.99529
5.562145
{ "github_metadata": { "branch": "main", "commit_count": 26, "repo_created_at": "2024-05-21T17:39:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "92ba19e8025...
099f10fe-bac7-4245-8c98-190c2031ff9d
alexandraback/datacollection
solutions_2458486_0/C++/zhymaoiing/Snamy.cpp
#include <cstdio> #include <cmath> #include <cstring> #include <string> #include <iostream> #include <algorithm> using namespace std; void redirectIO(bool changeIn, bool changeOut) { string fileName; if (changeIn || changeOut) { cin >> fileName; } if (changeIn) { string input = fileName + ".in"; freope...
ALGO
0.999859
3.936317
{ "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": "e679cb3ec...
57da2426-bf81-49e3-ab94-1cbdb2b0aecb
ishandutta2007/codeforces-s
sonechko/normal/676/A.cpp
#include<bits/stdc++.h> using namespace std; const long long MOD = 1e9+7; const int N = 100001; const int N6 = 1000001; const int M = 10; const string st2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; const string s1 = "abcdefghijklmnopqrstuvwxyz"; #define mod % MOD #define filesio(x) freopen(x ".in", "r", stdin); freopen(x ".out"...
ALGO
0.998934
3.350138
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:07: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": "c1ec827e272a...
d4cb0205-6f0e-4b31-a2e0-c25d5b8e1d14
ishandutta2007/codeforces-t
tabr/normal/1638/D.cpp
#include <bits/stdc++.h> using namespace std; #ifdef tabr #include "library/debug.cpp" #else #define debug(...) #endif int main() { ios::sync_with_stdio(false); cin.tie(0); int h, w; cin >> h >> w; vector<vector<int>> c(h, vector<int>(w)); for (int i = 0; i < h; i++) { for (int j = 0; j...
ALGO
0.999748
3.364014
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:27: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": "28d00c75b09f...
03753fdf-8e24-4205-ae54-4a6c04102841
ThreeSR/LeetCode
LC947_Most Stones Removed with Same Row or Column_Disjoint Set.cpp
class DisjointSet { // 并查集模板 public: int father[20005]; void init(int n) { for (int i = 0; i < n; i++) father[i] = i; } int find(int x) { return x == father[x] ? x : father[x] = find(father[x]); } void union2(int x, int y) { int rootX = find(x); int rootY = find(...
ALGO
0.999887
4.666873
{ "github_metadata": { "branch": "main", "commit_count": 869, "repo_created_at": "2020-10-04T14:49:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 84, "forks": 7, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "231a130a8...
ffb6134b-7132-4302-8bf7-80de14cb65fe
Kashif-Ahmad-1/100-days-Code-Challenge
Day 5/ArrangingCoins.cpp
/* 441. Arranging Coins Easy 1213 846 Add to List Share You have n coins and you want to build a staircase with these coins. The staircase consists of k rows where the ith row has exactly i coins. The last row of the staircase may be incomplete. Given the integer n, return the number of complete rows of the stair...
ALGO
0.999965
5.877907
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2021-10-24T07:49: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": "ab688abb1611...
8350f3d1-b0a5-4e3e-a502-12cf1fc65808
hyunhw/Publication
Fractal analysis/multiframestats.cpp
////////////////////////////////////////////////////////////////////////////// // // // multiframestats.cpp ------------> S_MSD_%d.dat , avgdiam.dat // // ^ // // ...
DATA
0.916025
3.59445
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2016-06-20T15:27: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": "d7633f3b6...
6640523e-ce27-477c-b3ff-50b9ffba9588
xqgao23/algorithm
38_longest_up_subseq/5_mouse.cpp
/** * Description: * 给出n只老鼠的数据,分别是它们的体重和速度。 * 为了证明越重的老鼠速度越慢,我们要找出一组数据,由若干个老鼠组成,保证老鼠的体重依次增加而速度依次减小。 * 问最多能找出多少只老鼠? * * Input: * 第一行,一个整数n,表示老鼠的个数 * 接下来n行,每行两个正整数wi,vi,分别表示老鼠的体重和速度 * * Output: * 输出一个整数,最多能找出的老鼠个数 * * Hints: * 1≤n≤1000;1≤wi,vi≤10000; * */ /** * Samples: * 1): * input: 9 6008 ...
ALGO
0.999961
4.430791
{ "github_metadata": { "branch": "main", "commit_count": 75, "repo_created_at": "2024-03-03T16: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": "1a27a122e31...
a975ce26-fdf0-4789-a104-a3dfd938eb6e
Eng-Gamal-megahed/Problem_Solving
Journey in Safed's Mysteries.cpp
// "ولا تقولن لشيء إني فاعل ذلك غدا" // "إلا أن يشاء الله واذكر ربك إذا نسيت وقل عسى أن يهديني ربي لأقرب من هذا رشدا" // LINK : https://codeforces.com/group/Rilx5irOux/contest/538517/problem/J #include <bits/stdc++.h> #define ll long long #define nl '\n' #define sp ' ' #define all(a) a.begin(),a.end() #define allr(a) ...
ALGO
0.999924
4.069649
{ "github_metadata": { "branch": "main", "commit_count": 73, "repo_created_at": "2024-02-24T00:07: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": "32b199768c4...
38f9de91-9e16-45cc-8f5d-2a55c1886ce0
jokj624/PS
1000-5000/2339.cpp
//BOJ 2339 석판 자르기 //아니 왜 안되지 ?? #include <iostream> #include <vector> using namespace std; int arr[25][25]; int N; long long int recur(int direction,int sx,int sy,int ex,int ey){ int boseok = 0, bad = 0; long long int ans = 0; vector<pair<int, int> > v; for(int i = sx; i<ex; i++){ for(int j=sy; j<ey; j++){ if(...
ALGO
0.99983
3.977082
{ "github_metadata": { "branch": "master", "commit_count": 144, "repo_created_at": "2020-07-28T06:54:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "81e4a508...
a3e22f3b-55a2-4aa6-a3e4-0d26f2fe1e56
dmpe/Semester2and5-Examples
src-semester5/Synchronisation/win/prodcons_eventsync_only/W32_pc_event.cpp
/* E.Ammann */ /* Demo program 'w32_pc_event.exe' for the Win32 API. */ /* Application is the producer-consumer problem with */ /* n producers and 1 consumer. */ /* Hier: <NAME> gegen Ringpuffer Overflow und */ /* Underflow per Event-...
ALGO
0.994822
5.408048
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2013-01-17T17:51:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "33b00a304...
eca1fe79-0cc5-40a6-b875-2ea4da1836dc
Jinchenyuan/LeetCode
src/397.IntegerReplacement.cpp
#include <iostream> #include <vector> #include <limits.h> using namespace std; class Solution { private: int integerDivide(long n){ int num = 0; while(n > 1 && n % 2 == 0){ n = n / 2; num++; } if (n == 1) return num; if (n % 2 == 1){ ...
ALGO
0.999706
4.637546
{ "github_metadata": { "branch": "master", "commit_count": 132, "repo_created_at": "2019-05-12T06:06:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2c1e8a81...
bea56e0c-a999-487b-9f90-6d170e4d61ec
jcarraror/Queues-and-Stacks
FilaEncadeada.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <conio.h> struct Node { int num; Node* prox; }; typedef struct Node node; // função para inserir um número (nó) na lista void insereFim(node *LISTA, int numero) { node *novo = (node *) malloc(sizeof(node)); novo->num = numero; novo->prox = NUL...
ALGO
0.996822
4.040276
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2020-11-14T21:16: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": "0f7ff1147c14...
ab7ba9d9-40d5-4c9b-ba1a-b60225b091b3
sumit-raghukant-soni/Leetcode_Solutions
23-merge-k-sorted-lists/merge-k-sorted-lists.cpp
class Solution { public: void merge2List(ListNode* &a, ListNode* b) { ListNode *tmp = new ListNode(-1), *tail = tmp; while (a || b) { int v1 = a ? a->val : INT_MAX, v2 = b ? b->val : INT_MAX; if (v1 < v2) { // cout << v1 << endl; tail->next = ...
ALGO
0.999833
5.931073
{ "github_metadata": { "branch": "main", "commit_count": 3622, "repo_created_at": "2023-08-17T22:13:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "35ab4cdc1...
39d12919-5b2a-46df-8c2e-435d4d391ddd
shibainudaifuku/Competitive-Programming
ABC/302/c.cpp
/* 問題文 英小文字からなる長さM の文字列N 個S1,S2,…,SN が与えられます。ここで、Si は互いに異なります。 これらを並び替えた文字列の列T1,T2,…,TN であって、以下の条件を満たすものが存在するか判定してください。 ・1≤i≤N−1 を満たす全ての整数i に対して、Ti を1 文字だけ別の英小文字に変えてTi+1 にすることが出来る。 制約 2 ≤ N ≤ 8 1 ≤ M ≤ 5 Si は英小文字からなる長さM の文字列である。(1≤i≤N) Si は互いに異なる。 */ #include <iostream> #include <vector> #include <algorithm> usin...
ALGO
0.999996
5.512796
{ "github_metadata": { "branch": "main", "commit_count": 621, "repo_created_at": "2023-01-26T06:28: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": "f0f9e558ae...
8a8110da-52fe-411a-9c08-0578ca3394f9
c-deguzman/UVa-Solutions
624 - CD.cpp
#include <iostream> #include <cstdio> using namespace std; int n, m; int cds[25]; int best; int best_mask; void try_all(int ind, int len, int bitmask){ if (len > n){ return; } if (len <= n && len > best){ best = len; best_mask = bitmask; } for (int i=ind; i < m; i++){ ...
ALGO
0.99996
3.149433
{ "github_metadata": { "branch": "master", "commit_count": 177, "repo_created_at": "2017-07-07T22:54: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": "5fd0bf41...
e7238928-d35f-472c-a3f9-fd22c97c6836
maku693/daily-snippets
2018/2018050701.cpp
#include <algorithm> #include <array> #include <cstddef> #include <iostream> #include <string> #include <utility> #include <vector> enum class token_type { paren_open, paren_close, literal_number, symbol, }; std::ostream &operator<<(std::ostream &os, const token_type &type) noexcept { switch (type) { case...
ALGO
0.972346
6.294701
{ "github_metadata": { "branch": "master", "commit_count": 443, "repo_created_at": "2017-04-06T00:50:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9add2fac...
74c4202f-f907-4b67-9f11-68f832d707ad
xiaohuanlin/Algorithms
Leetcode/797. All Paths From Source to Target.cpp
#include <vector> #include <stack> #include <iostream> #include <tuple> #include <assert.h> #include <algorithm> using namespace std; // Given a directed acyclic graph (DAG) of n nodes labeled from 0 to n - 1, find all possible paths from node 0 to node n - 1 and return them in any order. // The graph is given as fol...
ALGO
0.99998
6.686382
{ "github_metadata": { "branch": "master", "commit_count": 1423, "repo_created_at": "2018-04-29T12:03:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "69e8c12...
5c92f054-519d-4a4d-b57c-034030c5bc14
dchenhe/NJU-data-structure-oj
oj_4/小蓝鲸整理书本.cpp
#include<string> #include<iostream> #include<stdio.h> using namespace std; int main() { string input; getline(cin, input); int* stack = new int[input.size()]; int record[26] = { 0 }; int visit[26] = { 0 }; for (int i = 0; i < input.size(); i++) { record[input[i] - 'a']++; stack[i] = 0; } int index = -1;...
ALGO
0.999979
3.393352
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-04-07T14:16:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fd6c42fe81d4...
135f4b96-c09d-4e8b-bd14-2b844efcc9b9
bistendope/Cours_M1
semestre1/prog_para/TD1/Shift/shifttableau.cpp
#include <mpi.h> #include <stdio.h> #include <stdlib.h> using namespace std; void shift_circulaire_tab(int n, int* in, int* out) { int pid, nprocs; MPI_Comm_rank(MPI_COMM_WORLD, &pid ); MPI_Comm_size (MPI_COMM_WORLD, &nprocs ); MPI_Status status; int pid_envoi = (pid+1)%nprocs; int pid_recu = ((pid-1...
ALGO
0.99899
4.263968
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2017-10-16T18:58: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": "3adb488d4...
6666257b-fa29-4456-a231-c218ab2becb6
tiankonguse/leetcode-solutions
problemset-new/010/01007-minimum-domino-rotations-for-equal-row/minimum-domino-rotations-for-equal-row-smp.cpp
/************************************************************************* > File Name: minimum-domino-rotations-for-equal-row.cpp > Author: tiankonguse > Mail: <EMAIL> > Created Time: Sun Mar 10 09:57:47 2019 > desc: 1007. Minimum Domino Rotations For Equal Row ************************************...
ALGO
0.999963
4.873571
{ "github_metadata": { "branch": "master", "commit_count": 1037, "repo_created_at": "2015-04-11T09:31:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 81, "forks": 26, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "ae271...
6258ba55-54b0-4f71-95db-62dd50a2fa6c
Dup4/PTA
PAT-Basic-Level/1059-C语言竞赛/solution.cpp
#include <bits/stdc++.h> using namespace std; int isPrime(int x) { int flag; int n; if (x <= 1) flag = 0; else if (x == 2) flag = 1; else if (x == 3) flag = 1; else if (x % 2 == 0) flag = 0; else { for (n = 3; n <= (x - 1); n += 2) { if (x ...
ALGO
0.999954
3.675877
{ "github_metadata": { "branch": "main", "commit_count": 58, "repo_created_at": "2020-08-11T04:25:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1c060f5910f...
ec1d01e5-1232-408b-bcfb-0ed25857098d
abdur-rafi/Codeforces-practice
598 C.cpp
#include <iostream> #include <string> using namespace std; const int MAX = 1010; int main() { int n, m, d; cin >> n >> m >> d; int platform[MAX]; int sum[MAX]; for (int i = 0; i < m; ++i) cin >> platform[i]; for (int i = 0; i < MAX; ++i) sum[i] = 0; for (int i = 0; i < m; ++i) { sum[i + 1] = sum[i] + platform[i...
ALGO
0.999996
3.107039
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2021-04-07T17:27: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": "3b3f36c40d...
76a191ff-9f1c-4ce8-912d-3099bfc9366c
nidhigaonkar/TippingPoint
drivetrain.cpp
#include "main.h" using namespace okapi; Motor rightFront(rightFrontPort, false, AbstractMotor::gearset::blue, AbstractMotor::encoderUnits::degrees); Motor rightBack(rightBackPort, false, AbstractMotor::gearset::blue, AbstractMotor::encoderUnits::degrees); Motor leftFront(leftFrontPort, true, AbstractMotor::gearset::...
TOOL
0.997938
4.391819
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-11-01T23:45:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "55c2f7e8af2c...
af375b95-51dd-4a72-8761-8de0fe843ca1
brianchowlab/BcLOV4-FEM
FELICITY/Code_Generation/Matrix_Assembly/Unit_Test/Dim_1/Assembly_Code_AutoGen/Basis_Functions/Data_Type_Vector_P1_phi_restricted_to_Sigma.cc
/* ============================================================================================ This class contains data about a given FE function space, and methods for computing transformations of the local basis functions. This code references the header files: matrix_vector_defn.h matrix_vector_ops...
TOOL
0.904381
6.774599
{ "github_metadata": { "branch": "main", "commit_count": 111, "repo_created_at": "2020-12-03T21:11:23.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4104f817d6c...