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
582d2d7a-da79-4dc9-8d73-6b063ef834cb
MDSP777/UVa-Consolidated
src/cpp/12299.cpp
#include<bits/stdc++.h> int terms[100100]; int st[400100]; int shifts[1000]; int n; using namespace std; void build(int p, int l, int r) { if(l==r) st[p] = terms[l]; else { int mid = (l+r)/2; build(p<<1, l, mid); build((p<<1)+1, mid+1, r); st[p] = min(st[p<<1], st[(p<<1)+1]); } } void update(int p, int l...
ALGO
0.999859
3.913654
{ "github_metadata": { "branch": "main", "commit_count": 169, "repo_created_at": "2023-03-17T12:06: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": "f1adc78578...
d8f52743-8af2-432c-b293-2b45d77145c2
koteshb25/RSA
3decryption_phase.cpp
#include <iostream> #include <fstream> #include <cryptopp/integer.h> #include <cryptopp/files.h> #include <cryptopp/osrng.h> using namespace std; using namespace CryptoPP; // Decryption Phase void DecryptionPhase(const string& ciphertextFilePath, const string& plaintextFilePath) { // Load private key (d, n) from ...
TOOL
0.958092
5.197558
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-10-04T08:24: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": "7c1000e19dea...
2cf3aa3b-fcac-4f78-963b-07cb87fc2c3f
ishandutta2007/codeforces-s
summitwei/normal/1209/C.cpp
#pragma GCC optimize ("O3") #pragma GCC target ("sse4") #include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef vector<long long> vll; typedef vector<pair<int, int> > vpii; typedef pair<int, int> pii; typedef long long ll; typedef pair<ll, ll> pll; typedef pair<double, double> pdd; #define INF 10...
ALGO
0.999758
4.21365
{ "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": "793ede546e78...
2d60b649-32e7-4be4-a605-a99735580c24
Templet-language/cpp11runtime
samples/pipeline/pipeline.cpp
/*$TET$pipeline$!cpp-copyright!*/ /*--------------------------------------------------------------------------*/ /* Copyright 2010-2015 <NAME> */ /* */ /* Licensed under the Apache License, Version 2.0 (the "L...
ALGO
0.999423
4.86273
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2015-08-21T19:15:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "519e5a2c03...
9aa5925e-1f55-4952-a830-96203d1ecb5c
trzeciak20p/consoleCalculator
calculate.cpp
#include <cstdio> #include <math.h> #include <string> void planeEquation(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3){ fprintf(stderr, "\tlane = A*%f + B*%f + C*%f + D = 0\r\n", 1,2,3); } void planeEquation(double a, double b, double c, double x0, double y0, ...
ALGO
0.977129
4.31607
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2023-03-29T20:39: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": "c1d0407dd6...
599eda5b-8733-4b33-8517-06ae1bc398a2
Mindjolt2406/Competitive-Programming
Standard Algorithms/SuffixArray/LongestCommonSubstring.cpp
#include<bits/stdc++.h> #define mt make_tuple #define mp make_pair #define pu push_back #define INF 1000000001 #define MOD 1000000007 #define EPS 1e-6 #define ll long long int #define ld long double #define fi first #define se second #define all(v) v.begin(),v.end() #define pr(v) { for(int i=0;i<v.size();i++) { v[i]==I...
ALGO
0.999974
3.738615
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2018-11-15T05:50:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "17f8e394e...
8cb4b06a-0216-4c3f-ab2c-485652d0eeea
juli000/Lopez-cop3330-ch05-ex07
Lopez-cop3330-ch05-ex07.cpp
/* * UCF COP3330 Fall 2021 Assignment 5 Solution * Copyright 2021 <NAME> */ #include "std_lib_facilities.h" int main() { float a; float b; float c; float x1; float x2; float d; cout << "Enter your numbers for a, b, and c seperated by a space: "; cin >> a >> b >> c; d = b * b; ...
ALGO
0.999224
4.503611
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-11-29T08:42: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": "b4a75c475309...
2cac11be-7a20-4630-bba2-c2d1de9af979
rose-compiler/rose
src/util/graphs/TransAnalysis.h
/* <NAME>: this file defines the interface for an transitive path analysis algorithm published by <NAME> Kennedy in PLDI00 */ #ifndef TRANSITIVE_ANALYSIS #define TRANSITIVE_ANALYSIS #include <GraphAccess.h> /* struct T { T& operator = (const T &that) { return *this; } private: T() {} }; */ /* TransInfoOP ...
ALGO
0.993677
6.469814
{ "github_metadata": { "branch": "weekly", "commit_count": 23355, "repo_created_at": "2015-04-24T20:54:59.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 644, "forks": 136, "issues": 59, "pull_requests": 0 }, "file_meta": { "content_id": "34...
76dd465d-a886-494d-b305-52be47fac853
kushuaiming/leetcode
tree/path_sum/124_binary_tree_maximum_path_sum.cc
#include <climits> #include <iostream> #include "tree_node.h" // 2024/01/14: 不看答案自己实现. int res = INT_MIN; int MaxPathSumUseRoot(TreeNode* root) { if (root == nullptr) { return 0; } int left = MaxPathSumUseRoot(root->left); int right = MaxPathSumUseRoot(root->right); res = std::max(res, ...
ALGO
0.99997
5.341027
{ "github_metadata": { "branch": "master", "commit_count": 362, "repo_created_at": "2023-03-23T15:13:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ebb6a975...
6213a15b-18f9-440c-86a5-d2975adda091
opencv/opencv
modules/dnn/src/layers/cpu_kernels/fast_norm.cpp
// This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. #include "../../precomp.hpp" #include "fast_norm.hpp" namespace cv { namespace dnn { void fastNorm(const Mat &input, Mat &o...
ALGO
0.982203
7.339165
{ "github_metadata": { "branch": "4.x", "commit_count": 35401, "repo_created_at": "2012-07-19T09:40:17.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 83079, "forks": 56217, "issues": 2595, "pull_requests": 138 }, "file_meta": { "content_id"...
bca6b283-cef8-458a-9352-eb89a3dc0792
arminbiere/cadical
src/reduce.cpp
#include "internal.hpp" namespace CaDiCaL { /*------------------------------------------------------------------------*/ // Once in a while we reduce, e.g., we remove learned clauses which are // supposed to be less useful in the future. This is done in increasing // intervals, which has the effect of allowing more...
ALGO
0.998706
7.355769
{ "github_metadata": { "branch": "master", "commit_count": 1885, "repo_created_at": "2016-08-17T11:32:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 468, "forks": 152, "issues": 16, "pull_requests": 5 }, "file_meta": { "content_id": "38...
f271784d-fe5a-497e-8e4d-fdef18a22f7f
awyd234/xuetangx_algorithm_camp
practice_1_3_1_equation/main.cpp
// // main.cpp // practice_1_3_1_equation // // Created by Admin on 2020/5/14. // #include <iostream> #include <vector> using namespace std; #define MAX_SIZE 300005 const int SZ = 1 << 20; struct fastio{ //fast io char inbuf[SZ]; char outbuf[SZ]; fastio(){ setvbuf(stdin,inbuf,_IOFBF,SZ); ...
ALGO
0.999987
5.161585
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2020-05-20T20:28: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": "42a13ca5ef...
f1c4f466-1e7a-4e1f-b618-a90ed27a0044
rickors560/LeetCode
FindDuplicateFileInSystem.cpp
#include <bits/stdc++.h> using namespace std; class Solution { vector<string> split(string str, char delimiter) { vector<string> result; stringstream stream(str); string item; while (getline(stream, item, delimiter)) { if (item.length() > 0) ...
ALGO
0.981108
4.695096
{ "github_metadata": { "branch": "main", "commit_count": 205, "repo_created_at": "2021-11-24T19:02:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3ef8c4ded5...
83998550-cb80-41b9-90a8-fd16d2913fbc
mkut/aoj
Volume11/1140/c++.cpp
#include <iostream> #include <algorithm> #include <map> #include <vector> using namespace std; inline int state(int g, int y, int x) { return g * 900 + y * 30 + x; } inline int _g(int s) { return s / 900; } inline int _y(int s) { return s % 900 / 30; } inline int _x(int s) { return s % 30; } int main() { int w, ...
ALGO
0.999905
3.30917
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2011-08-19T22:56: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": "598bd13aa...
08bfb56f-49e7-4c37-8b82-f15dee6677e3
Farid4hmed/BLIND-75
Linked List/removeNthFromEnd.cpp
//Intuition - Calculate the position from front by counting number of nodes in the list //Front Position = No of Nodes - Back Position + 1 class Solution { public: ListNode* removeNthFromEnd(ListNode* head, int n) { int countNodes = 0; ListNode* curr = head; //count the nu...
ALGO
0.999988
6.124676
{ "github_metadata": { "branch": "main", "commit_count": 79, "repo_created_at": "2022-09-12T06:18: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": "be4965602de...
c9422e32-354c-4fda-a7c6-a4bd7c525c8e
x-junkang/algorithm
chapter 1/bottomUpSort.cpp
#include <cstdio> #include <vector> using namespace std; //合并一个数组中两段有序序列,p为第一个序列起点的检索,q为第一个序列的终点检索,r为第二个序列的终点检索 void merge(vector<int> &A, int p, int q, int r) { int s = p, t = q + 1; vector<int> B; while (s <= q && t <= r) { if (A[s] <= A[t]) { B.push_back(A[s]); ...
ALGO
0.999992
4.661805
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2019-08-26T11: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": "1ccc8756a...
3662f38c-9766-4a9d-9855-e113e681310f
mittalprince/Data-Structures-and-Algorithm
CodeForces/Global-9/Neighbour-Grid.cpp
// https://codeforces.com/contest/1375/problem/B #include<iostream> #include<vector> using namespace std; typedef long long ll; #define ip(arr, n) for(int i=0; i<n; i++) cin>>arr[i]; #define ip1(arr, n) for(int i=1; i<=n; i++) cin>>arr[i]; #define op(arr, n) for(int i=0; i<n; i++) cout<<arr[i]<<" "; #define fstIO ios_b...
ALGO
0.999767
3.830045
{ "github_metadata": { "branch": "master", "commit_count": 516, "repo_created_at": "2020-07-28T16:36:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 5 }, "file_meta": { "content_id": "2ebbcc40...
ce734bb5-df48-4035-8650-bdfb309b5534
wuyuhang05/OI-Code
codeforces/1213/C.cpp
/* * Author: RainAir * Time: 2019-09-08 08:37:49 */ #include <algorithm> #include <iostream> #include <cstring> #include <climits> #include <cstdlib> #include <cstdio> #include <bitset> #include <vector> #include <cmath> #include <ctime> #include <queue> #include <stack> #include <map> #include <set> #define fi fir...
ALGO
0.999589
3.62826
{ "github_metadata": { "branch": "master", "commit_count": 1220, "repo_created_at": "2020-12-21T00:51: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": "82c1cc3...
db55bcae-a78f-4205-b80f-c8a3555e1101
maivyash/DSA_CODE
DSA9.cpp
#include <iostream> #include <map> #include <vector> #include <algorithm> class AVLTreeDictionary { private: struct TreeNode { std::string key; std::string value; TreeNode* left; TreeNode* right; int height; TreeNode(std::string k, std::string v) : key(k), value(v),...
ALGO
0.999855
6.086
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-05-02T08:15:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "336b8468bb57...
185cf007-ec77-40a9-9e8f-c6079808123d
als982001/baekjoon-solve
백준/Gold/1202. 보석 도둑/보석 도둑.cc
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <queue> #include <map> #include <memory.h> #include <deque> #include <cmath> #include <stack> #include <cstring> #include <typeinfo> using namespace std; #define MAX 300011 long long jewNum, bagNum; priority_queue<long long> chosen;...
ALGO
0.999967
3.842356
{ "github_metadata": { "branch": "main", "commit_count": 517, "repo_created_at": "2023-02-03T01:14: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": "b88ecca815...
0becdc10-5ef9-41ed-92c7-ccc2bd76a87d
vihanga02/DSA-Labs
week10/inclass/MST.cpp
#include <iostream> using namespace std; #define size 6 int getTHeMinimumEdge(int key[size],bool visited[size]){ int min = __INT_MAX__; int minIndex; for (int i = 0; i < size; i++){ if (!visited[i] && key[i] < min){ minIndex = i; min = key[i]; } } return mi...
ALGO
0.999933
4.555529
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2024-02-18T07:01: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": "fa75f75a250...
46d2393d-a5d7-42c9-84c8-2d620a153224
B0R0koko/SoQ_CPP_Linear_Interpolation
LinearInterpolation.cpp
#include <vector> #include <iostream> #include <algorithm> #include "LinearInterpolation.hpp" struct Point { double x; double y; int idx; }; bool checkGreater(const Point &point_1, const Point &point_2) { return point_1.x < point_2.x; } void sortPoints(std::vector<double> &x, std::vector<double> &y...
ALGO
0.999966
5.87227
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-05-25T20:06:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "48d53ca38946...
ea1d2788-a766-4c5b-b8d2-a94146a1c464
tobson/vf-pic-cpp
src/main.cpp
// // test.cpp // vf-pic // // Created by <NAME> on 1/27/13. // Copyright (c) 2013 <NAME>. All rights reserved. // #include <array> #include <chrono> #include <cstdio> #include <fstream> #include <iomanip> #include <iostream> #include <random> #include <stack> #include <thread> #include <vector> #include "barrier...
ALGO
0.994731
3.838549
{ "github_metadata": { "branch": "master", "commit_count": 409, "repo_created_at": "2013-03-15T23:00:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "de6423ac...
9aab8e44-0ca9-4786-a05d-5be37e68afd5
vilifo/SuffixArray
suffixArray.h
#include <vector> #include <iostream> #include <map> #include <unordered_map> #include <algorithm> #include <map> #include <unordered_map> #ifdef DEBUG #include "printFunctions.h" #endif #ifndef SUFFIX_ARRAY_H #define SUFFIX_ARRAY_H const char SENTINEL = '\7'; // Defining sentinel as ASCII Bell to be smaller than any ...
ALGO
0.999651
5.127881
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2023-12-11T20:09: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": "230e7d1808c7...
8931ceea-49b5-42f3-9008-628439d7404b
martintrojer/symbolic-execution
llvm-2.6/lib/CodeGen/PBQP/Heuristics/Briggs.h
//===-- Briggs.h --- Briggs Heuristic for PBQP -----------------*- C++ --*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
ALGO
0.998778
6.89821
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2011-11-10T08:38:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 24, "forks": 9, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5caa2c120...
512d754d-7406-49ea-964e-d3c37a9e7bb5
nekomoon404/leetcode-note
LeetCode/lc78子集/main.cc
#include <functional> #include <iostream> #include "../vector_print.h" // 从选哪个的角度: void dfs(int i, int n, const std::vector<int>& nums, std::vector<int>& path, std::vector<std::vector<int>>& ans) { ans.emplace_back(path); if (i == n) return; // 可以不加这行判断, for循环中限制了j < n, 不会无限递归下去 for (int j = i; j < n; ++j) { ...
ALGO
0.999917
5.953911
{ "github_metadata": { "branch": "master", "commit_count": 68, "repo_created_at": "2021-09-04T14:36:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "945c14395...
76df1ace-1bbb-4c4a-8718-e0004f2d4317
shacklettbp/bps-nav
simulator/external/habitat-sim-geodesic/habitat_sim_geodesic/csrc/eigen/doc/examples/TutorialInplaceLU.cpp
#include <iostream> struct init { init() { std::cout << "[" << "init" << "]" << std::endl; } }; init init_obj; // [init] #include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { MatrixXd A(2,2); A << 2, -1, 1, 3; cout << "Here is the input matrix A before decompositi...
ALGO
0.999636
4.757822
{ "github_metadata": { "branch": "master", "commit_count": 117, "repo_created_at": "2021-03-08T08:11:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 35, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fe4d438...
4c886bd1-29bf-42e7-ac38-a7ddeb47d261
wpilibsuite/allwpilib
wpimath/src/main/native/include/frc/controller/ArmFeedforward.h
// Copyright (c) FIRST and other WPILib contributors. // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. #pragma once #include <cstdlib> #include <wpi/MathExtras.h> #include <wpi/SymbolExports.h> #include "units/angle.h" #...
ALGO
0.998082
7.274335
{ "github_metadata": { "branch": "main", "commit_count": 7447, "repo_created_at": "2014-09-30T20:51:33.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1185, "forks": 658, "issues": 433, "pull_requests": 134 }, "file_meta": { "content_id": "5...
c43271bc-1270-4c27-8baf-b53224ee7e7e
24Shreyaskumar/Cracking-the-Coding-Interview
Rough/nearest1.cpp
#include <bits/stdc++.h> using namespace std; void Solve(int n, int m, vector<vector<int>>& mat) { queue<pair<pair<int, int>, int>> q; vector<vector<int>> dirs = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}}, ans(n, vector<int>(m, -1)); for (int i= 0; i < n; i++) { for (int j = 0; j < m; j++) { i...
ALGO
0.99997
5.274029
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2024-01-14T04: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": "73a09612513...
701cbe59-7282-4bf6-9c94-9db4d34b5abb
sa-phystech/C-2-sem
Sort/Bubble.cpp
#include <iostream> int main() { int N; int x; std::cin >> N; int* array = new int[N]; for (int i = 0; i < N; i++) { array[i] = 1 + rand() % 100; } for (int i = 0; i < N; i++) { std::cout << array[i] << ' '; } std::cout << std::endl; for (int i = 0; i < N...
ALGO
0.999206
4.259677
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2021-02-01T09:56:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "de4b77686f4...
17a69361-c14e-4ddc-bdb8-ed14cbd6f1a0
haoel/leetcode
algorithms/cpp/minStack/minStack.cpp
// Source : https://oj.leetcode.com/problems/min-stack/ // Author : <NAME> // Date : 2014-11-16 /********************************************************************************** * * Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. * * push(x) -- Push element x on...
ALGO
0.999225
5.374092
{ "github_metadata": { "branch": "master", "commit_count": 788, "repo_created_at": "2014-10-20T03:22:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 17857, "forks": 4931, "issues": 26, "pull_requests": 28 }, "file_meta": { "content_id": ...
68d24af5-bf62-476a-aa79-41a7374ee750
vinay-narayana/MissionRnD-C-Arrays2-Worksheet
src/mergeSortedArrays.cpp
/* OVERVIEW: You are given 2 bank statements that are ordered by date - Write a function that produces a single merged statement ordered by dates. E.g.: Input: A[3] = { { 10, "09-10-2003", "First" }, { 20, "19-10-2004", "Second" }, { 30, "03-03-2005", "Third" } }; B[2] = { { 10, "09-10-2003", "First" }, { 220, "18-01-2...
ALGO
0.988597
4.987301
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2016-01-06T08:14:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "695cb9b4b1...
0ea01721-b2e4-4c7d-b03b-b0a7932b9c49
ishandutta2007/codeforces-g
gary2005/normal/1332/E.cpp
/* AuThOr GaRyMr */ #include<bits/stdc++.h> #define rb(a,b,c) for(int a=b;a<=c;++a) #define rl(a,b,c) for(int a=b;a>=c;--a) #define LL long long #define IT iterator #define PB push_back #define II(a,b) make_pair(a,b) #define FIR first #define SEC second #define FREO freopen("check.out","w",stdout) #define rep(a,b) for(...
ALGO
0.999852
3.509699
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:55: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": "a43cf9506dcf...
2db93d16-4942-4c76-bba0-8dac6bd60709
jsl0149/BaekJoon
DP/1463/1463.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int devide(int); vector <int> dp (1000001, 0); int main() { int N; cin >> N; dp[2] = 1; dp[3] = 1; dp[4] = 2; for (int i = 5; i <= N; i++) { if (i % 2 != 0 && i % 3 != 0) dp[i] = dp[i - 1] + 1; else if (i % 2 == 0 && ...
ALGO
0.999908
3.872596
{ "github_metadata": { "branch": "master", "commit_count": 221, "repo_created_at": "2021-02-11T10:53:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "42fb3fd4...
d21ae6f6-ffb8-49d4-9387-73b4a0dd2b3f
badouralix/adventofcode-2018
day-02/part-2/jules.cpp
#include <string> #include <iostream> #include <sstream> #include <vector> using namespace std; string common(string s1, string s2) { // We consider those two strings to be of the same size string sameChars; for(int i = 0; i < s1.length(); i++){ if(s1[i] == s2[i]) { sameChars += s1[i]; ...
ALGO
0.999736
3.673131
{ "github_metadata": { "branch": "master", "commit_count": 629, "repo_created_at": "2018-11-30T23:33:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 29, "forks": 6, "issues": 3, "pull_requests": 2 }, "file_meta": { "content_id": "d88cc04...
bca1ebe9-7866-4b69-bb18-e0ea5b5cab6f
iliyian/CompetitiveProgramming
luogu.com.cn/P1055/main.cc
// 不确定对不对,反正AC了,但是_WIP没删,我直接删掉了 #include <iostream> #include <string> using namespace std; int main() { string isbn; cin >> isbn; int len = isbn.size(), sum = 0, count = 1; for (int i = 0; i < len-2; i++) { char c = isbn[i]; if (c != '-') { // cout << "sum=" << sum << endl; sum += (isbn[i]...
ALGO
0.999853
3.123924
{ "github_metadata": { "branch": "main", "commit_count": 354, "repo_created_at": "2024-04-21T10:50: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": "d8995aa3d4...
fa3697e6-4539-447a-a411-b1e5fca6ffbd
majesticfish/USACO-Training-Pages-Solutions
camelot.cpp
/* ID: seanyu11 LANG: C++ PROB: camelot */ #include <stdio.h> #include <queue> #include <string.h> #include <iostream> #include <queue> #include <cmath> using namespace std; typedef pair<int,int> ii; int r,c, row, n = 0, kr[8] = {2,2,1,1,-1,-1,-2,-2}, kc[8] = {1,-1,2,-2,2,-2,1,-1}, knightCosts[30][26], minKingCost = 2...
ALGO
0.999837
3.569213
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2015-06-15T00:02:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "91d900313d...
c02cefe2-1966-4bc2-9f18-8e3f8db96d7b
ManiruzzamanAkash/URI-Online-Judge-All-Problems-Solution
URI_1048.cpp
#include <iostream> #include <iomanip> using namespace std; int main() { float n, tmp, per; cin >> n; if(n <= 400){ per = 15; tmp = n + ((n * per) / 100); }else if(n > 400 && n <= 800){ per = 12; tmp = n + ((n * per) / 100); }else if(n > 800 && n <= 1200){ per = 10; tmp = n + ((n * per) / 100); }...
ALGO
0.997788
3.436258
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2016-03-11T12:32:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 51, "forks": 29, "issues": 0, "pull_requests": 5 }, "file_meta": { "content_id": "00f61fe...
8ddb5013-bfa3-4c66-af7c-e6ad777812ef
ideahitme/contest
hackerearth/amazon/eq_numbers/code.cpp
#include <set> #include <algorithm> #include <iomanip> #include <iostream> using namespace std; typedef long long ll; typedef pair<int,int> pii; int main(int argc, char const *argv[]) { int t; cin >> t; for(int i = 0; i < t; i++){ ll n,x,y,z; cin >> n >> x >> y >> z; set<int> f = {2,3,5,7}; bool omg = tru...
ALGO
0.999533
3.700769
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2017-11-08T15:52:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5327a329c...
57a13337-205f-4489-bfb5-bfedacc9dfbf
alexandraback/datacollection
solutions_1485488_1/C++/RiaD/b.cpp
#include <stdio.h> #include <queue> #include <algorithm> using namespace std; struct s { int x,y; }; s temp; int incx[4]={0,1,0,-1}; int incy[4]={1,0,-1,0}; int ce[103][103],f[103][103]; double st[103][103]; class cmp { public: bool operator()(const s& a,const s& b) { return st[a.x][a.y]>st...
ALGO
0.999529
3.409861
{ "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": "f7faa113b...
009b3a9b-935c-48f9-bf4f-d27810582fe2
Henry1132004/PythonProgramming
DSA03003.cpp
#include<bits/stdc++.h> using ll = long long; using namespace std; int n, ok, a[10001], k; void sinh(){ int i = k; while(i >= 1 && a[i] == n - k + i){ --i; } if(i == 0){ cout << k << endl; } else{ ++a[i]; for(int j = i + 1; j <= k; j...
ALGO
0.999973
3.262656
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2024-06-02T07:10: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": "2bd7793926...
bdb539f8-9375-40b4-a339-cea8ddd13a41
attadeep28/DSA-PRACTICE
DP/Longest Increasing Subseq/LIS.cpp
#include <bits/stdc++.h> using namespace std; int LIS(int ind, int prev, vector<int> &arr, int n, vector<vector<int>> &dp) { if (ind == n) return 0; if (dp[ind][prev + 1] != -1) return dp[ind][prev + 1]; // Not Take int notTake = 0 + LIS(ind + 1, prev, arr, n, dp); // Take int t...
ALGO
0.999885
5.128379
{ "github_metadata": { "branch": "main", "commit_count": 42, "repo_created_at": "2022-08-02T14:51: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": "aafee3cbc9c...
afb9c931-c135-45c4-afd8-745c0c3d7e85
Aryanlanghanoja/NBS_2025
29-06-2025/Aryan_Langhanoja/sherlock_gcd.cpp
#include <bits/stdc++.h> using namespace std; string ltrim(const string &); string rtrim(const string &); vector<string> split(const string &); int GCD(int a, int b) { if (b == 0) { return a; } return GCD(b, a % b); } /* * Complete the 'solve' function below. * * The function is expected...
ALGO
0.999454
5.320464
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2025-06-03T05:24: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": "ac5794471eb...
c7818e5b-478e-4b06-afe3-b3837f78a3b0
manya706/DSA-Codebase
Difficulty: Medium/Prerequisite Tasks/prerequisite-tasks.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: bool isPossible(int N,int P, vector<pair<int, int> >& prerequisites) { // Code here // creating directed graph vector<int> adj[N]; for(auto i: prerequisites){ adj[i.first].pu...
ALGO
0.999883
6.531395
{ "github_metadata": { "branch": "main", "commit_count": 1300, "repo_created_at": "2023-04-21T17:00:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3f82c829b...
4131647c-be02-4b4f-b831-923b8755c9a9
Birdson/face_verification_demo
src/config_reader.h
#pragma once #define CONFIG_PATH "config.ini" #include <string> typedef struct { int device; int width; int height; bool enable_virtual_device; std::string virtual_device_path; } WebCamConfig; typedef struct { bool enable_video_test; std::string video_test_path; bool enable_image_test; std::string...
CONFIG
0.940682
4.244979
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2017-01-23T06:42:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "9058c0f8a...
e4a7cc37-774c-4e94-95ca-d86fafcd42f7
AsadpourMohammad/Quera-Exercises
Quera - 3rd batch/SadeTar.cpp
#include <iostream> #include <iomanip> using namespace std; float a, b, c ,d; float Sum, Average, Product, MAX, MIN; float SumCheck(); float AverageCheck(); float ProductCheck(); float MAXCheck(); float MINCheck(); int main() { setprecision(6); cin >> a >> b >> c >> d; SumCheck(); AverageCheck()...
ALGO
0.999083
3.601354
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-08-22T07:45: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": "afcce0e4aec2...
abf2aa00-186c-4933-89e2-a6e21b3a63f6
awietek/xdiag
xdiag/basis/tj_distributed/basis_np.cpp
// SPDX-FileCopyrightText: 2025 <NAME> <<EMAIL>> // // SPDX-License-Identifier: Apache-2.0 #include "basis_np.hpp" #include <xdiag/combinatorics/binomial.hpp> #include <xdiag/combinatorics/combinations.hpp> #include <xdiag/parallel/mpi/allreduce.hpp> namespace xdiag::basis::tj_distributed { template <typename bit_t...
ALGO
0.998947
6.713871
{ "github_metadata": { "branch": "main", "commit_count": 641, "repo_created_at": "2019-02-06T14:55:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 47, "forks": 12, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "f58dd43d...
bf6a63d1-b375-4672-a276-582561ef626c
RuilinLi/myglmnet
inst/include/glmnetMatrix.h
#ifndef GLMNET_MATRIX #define GLMNET_MATRIX #include <stdint.h> class MatrixGlmnet { public: // Compute the inner product of X[,j] and v virtual double dot_product(int j, const double* v, double vsum=0) = 0; // Compute the inner product of X[,j]^2 and v // A bit bulky here, also compute X[, j] * v ...
ALGO
0.998651
6.422035
{ "github_metadata": { "branch": "main", "commit_count": 48, "repo_created_at": "2020-10-30T20:38: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": "c358b478922...
6e412621-0475-424c-a053-d7754b26ad2a
studian/Codingtest_HW
Codingtest_HW/해커어스/Moc/Easy_Optimal_gems_s1.cpp
#include <bits/stdc++.h> using namespace std; #define MAX 21 #define mod 1000000007 int dp[MAX][MAX][MAX][MAX][4]; int solve(int a, int b, int c, int d, int prev) { if (dp[a][b][c][d][prev] != -1) return dp[a][b][c][d][prev]; else if (a == 0 && b == 0 && c == 0 && d == 0) { dp[a][b][c][d][prev] = 1; return dp[...
ALGO
0.999886
4.842256
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2021-01-10T11:52:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d2f60680b...
d80555d0-3ee6-4e3c-b6ad-6e51ef6b12ad
kejpmdt/backpack
Static/Workspace/CODES/Problems/Luogu/_P3385.cpp
#include <iostream> #include <cstdio> #include <cstring> #define MAXN 2005 #define MAXM 6005 using namespace std; int fst[MAXN], nt[MAXM]; int to[MAXM]; int v[MAXM]; int dis[MAXN], length[MAXN]; void addline(int a, int b, int c, int &i) { ++i; to[i] = b; nt[i] = fst[a]; fst[a] = i; v[i] = c; if (c > ...
ALGO
0.999904
4.065166
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-11-06T05:30: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": "4de5af11d10b...
6610d4ac-4dba-4f81-854e-a3933e65efb6
AliceSchaw/CPPexercise
Longest Valid Parentheses.cpp
//error:()(()情形,会输出错误结果4 /* class Solution { public: int longestValidParentheses(string s) { stack<char> res; int count=0,maxl=0; for(int i=0;i<s.size();i++){ //特殊情形:()(),()(() if(s[i]=='('){ res.push(s[i]); } if(s[...
ALGO
0.999323
4.763204
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2017-06-13T03:55:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a3b19d5fe...
15c95546-a2f0-4f8c-a27f-5a5bb7b7df36
GopherTeen/OJ_Code
Problems/Codeforces/1201-1300/1272/C_Yet_Another_Broken_Keyboard.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; void solve() { int n, k; string s; cin >> n >> k >> s; bool exist[26] {}; char c; while (k--) { cin >> c; exist[c - 'a'] = 1; } ll ans = 0; for (int i = 0; i < n; ++i) { int k = i; ...
ALGO
0.999825
4.06037
{ "github_metadata": { "branch": "master", "commit_count": 57, "repo_created_at": "2024-11-01T07:27: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": "c04652fb9...
483c27b8-d9de-45de-8980-f7cb16d8ef6f
Yeamin-Talukder/LightOJ
1035 - Intelligent Factorial Factorization.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" void make_prime(vector<bool> &seive,vector<ll> &prime) { seive[0] = 1; seive[1] = 1; ll size = seive.size(); for (ll i = 2; i*i < size; i++) { if(seive[i] == 0) { for (ll j = i*i; j...
ALGO
0.999047
4.441847
{ "github_metadata": { "branch": "main", "commit_count": 64, "repo_created_at": "2025-05-07T20:53:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0d2b6808aa8...
0e7da8fd-a20f-405a-975e-98c54a333d4d
lobhasap/sp
SP/Vineet_CPP/assignment3.cpp
#include <iostream> #include <string> #include <vector> #include <map> #include <fstream> #include <iomanip> #include <algorithm> using namespace std; struct Literal { string value; int address; }; vector<pair<string, int>> symbol_table; vector<Literal> literal_table; vector<int> pool_table; vector<pair<int,...
ALGO
0.999397
4.403589
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2024-11-25T16:02: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": "1e32dd02bc9a...
c4dcdcc5-5800-4633-9597-48a367fa33ca
RC416/DSGE-models
Extra content/C++ implementation using C-style base arrays/2 - Stochastric Growth/main.cpp
/* Stochastic Growth Model implemented in c++. Steps: 1 - Define utility parameters, grids, and parameter struct. 2 - Perform value function iteration. 3 - Display results, save results to file, clean up. Relies on Solve_Value_Function and helper functions in custom_funcions file. */ #include "custom_functions.h"...
ALGO
0.999754
6.582267
{ "github_metadata": { "branch": "main", "commit_count": 93, "repo_created_at": "2021-01-04T22:43:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 13, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3762ad31d7...
ff36792c-c8bc-401c-81a9-b2e801a86609
ngovietbach/ThuatToanUngDung
cuoiki/query.cpp
#include<bits/stdc++.h> using namespace std; char stk1[20]; char stk2[20]; int number_transactions = 0 ; int total_money_transaction = 0 ; string type; map <string , int > toltal_money_from; map <string,int> inspect_cycle; set <string > list_sorted_accounts ; string facc, tacc, time_point , atm ; int money; int total;...
ALGO
0.979827
3.588104
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-03-26T20:41: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": "aca4e9ff636e...
620ebee4-2a5a-4e36-9cdb-3ef9a67a6d30
ishandutta2007/codeforces-a
antoine/normal/507/E.cpp
#include <iostream> #include <algorithm> #include <cstring> #include <tuple> #include <string> #include <vector> #include <queue> #include <unordered_map> int n, m; std::unordered_map<long long, bool> edges; std::vector<std::pair<int, bool>> adj[100001]; int ancestor[100001]; std::pair<int, int> dist[100001] = { { 0, ...
ALGO
0.99996
3.75139
{ "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": "d8224fca353e...
8f269537-301f-4a5e-aab7-2052cdfbeabd
skletz/cplus-trecvid
libs/opencv-pctsig/cvpctsig/src/similarity.hpp
/* * PCT Signatures is an implementation of feature signatures. * It was implemented with the focus to contribute to the * OpenCV's extra modules library. This module is a preliminary * version which was received in 2015. * * @author <NAME>, <NAME>, <NAME> * @repository https://github.com/GregorKovalcik/opencv_contrib ...
ALGO
0.989169
6.405542
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2017-05-31T06:41:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3298a12e9...
7e2c4189-d5c0-4a80-82cd-5126e291da7c
Nonbangkok/Competitive_Programming
POSN/Camp1_65/Day07_02_Array2D_Matrix_same.cpp
/* FILE: cpp */ /* LANG: C++ COMPILER: LINUX */ #include <bits/stdc++.h> #define coutf(n, m) cout << fixed << setprecision(n) << m << endl #define forr(i, a, n) for (int i = a; i < n; i++) #define macos ios::sync_with_stdio(0);cin.tie(0) #define endll "\n" #define space " " typedef long long ll; using namespace std; in...
ALGO
0.999564
3.410229
{ "github_metadata": { "branch": "main", "commit_count": 98, "repo_created_at": "2024-11-23T11:55: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": "90fcadba5cb...
05794d4a-a3bc-47c4-9af5-3c9239da1aaf
yz1019117968/FSE-24-UniTrans
cleaned_data/transcoder_evaluation_gfg/cpp/FIND_MINIMUM_NUMBER_OF_COINS_THAT_MAKE_A_CHANGE_1.cpp
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // #include <iostream> #include <cstdlib> #include <string> #include <vector> #include <fstream> #include <iomanip> #include...
ALGO
0.999626
5.535532
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-04-06T11:00:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 20, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3bc78d3359d...
2a378a19-4966-4b1b-b670-d507a641963f
1998factorial/comp4128
problems/wk6/C.cpp
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <queue> #include <string.h> using namespace std; typedef long long ll; const int maxn = 1500; const ll INF = 1ll << 55; int N , M , X; vector<pair<int , ll>> p[maxn]; /* binary search the weight that each bear can carry build the gr...
ALGO
0.99952
4.06648
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2019-10-28T11:42: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": "db84344ff...
32002424-b78f-4741-993f-13e59e942823
somasekharreddyps/class-2
7.cpp
#include <stdio.h> int main() { int n1, n2, i, j, k; printf("Enter the size of the first array: "); scanf("%d", &n1); int arr1[n1]; printf("Enter the first array elements in ascending order:\n"); for(i=0; i<n1; i++) { scanf("%d", &arr1[i]); } printf("Enter the size of the second...
ALGO
0.999983
4.13681
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-04-12T07:38: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": "1c19bf5af684...
65295911-3005-47d0-8837-b452b17c25cd
riddhikt/basic_engineering_programs
C++/Data Structures/Polynomial.cpp
#include<iostream> #include<cmath> using namespace std; class node //node class { int exp; int coef; node *next; friend class Poly; }; class Poly //Polynomial class { node *head; public: Poly(); void Create(); void Create(node *); void Display(); void Display(node *); void Add(nod...
ALGO
0.999367
4.345859
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2019-10-26T05:44:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6e684048a...
026b524c-edf8-4fa9-adb3-53aa160eb18f
NogueiraMerlot/BullCowGame
BullCowGame/main.cpp
// main.cpp: Define o ponto de entrada para a aplicação de console. // #include "stdafx.h" #include <iostream> #include <string> #include "FBullCowGame.h" using FText = std::string; using int32 = int; //prototypes void PrintIntro(); void PlayGame(); FText GetValidGuess(); FText PrintGameSummary(); bool AskToPlayAgai...
TOOL
0.927049
3.968901
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2017-08-29T10:29:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2a1cf00d42...
cf674aaa-6f6d-43ce-9f95-1b0ec0ce7deb
ekzhang/library
maxflow2.cpp
// maxflow2.cpp // <NAME>; Aug. 7, 2017 #include <bits/stdc++.h> using namespace std; /* Maximum-Flow solver using Dinic's Blocking Flow Algorithm. * Time Complexity: * - O(V^2 E) for general graphs, but in practice ~O(E^1.5) * - O(V^(1/2) E) for bipartite matching * - O(min(V^(2/3), E^(1/2)) E) for unit ca...
ALGO
0.999062
6.348254
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2018-07-03T05:51:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 67, "forks": 9, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "dc31d327...
07e3a595-f9bb-468c-a0d3-b0e364c74561
unjambonakap/prog_contest
codeforces/129/d.cpp
#include <vector> #include <list> #include <map> #include <set> #include <deque> #include <queue> #include <stack> #include <algorithm> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <cstdlib> #include <string> #include <cstring> #include <cstdio> #include <cmath> #include <cstdli...
ALGO
0.999913
3.612998
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2018-08-16T18:21:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cc86193705...
a5342ecf-85ca-4129-8c8b-86b2eb85a99b
SakibulMowla/competitive-programming-solutions
Root/CF/Div1-B Zuma.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define clr(a) (a.clear()) #define sz(x) (int)x.size() #define mem(a,b) memset(a, b, sizeof(a)) #define Unique(store) store.resize(unique(store.begin(),store.end())-store.begin()) #define pb push_back #define FAST ios_base::sync_with_stdio(0);cin.ti...
ALGO
0.999961
3.837982
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2020-05-24T23:22:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2e09587c0...
0572fa65-2fe6-42f6-ac0c-90427eaef70c
lichto2005/lic-5
maze.h
// Sample solution for project #5 #include <iostream> #include <limits.h> #include <list> #include <fstream> #include <queue> #include <vector> #include <stack> #include <boost/graph/adjacency_list.hpp> #include "d_except.h" #include "d_matrix.h" #define LargeValue 99999999 using namespace std; using namespace boo...
ALGO
0.999879
4.26246
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2016-11-16T03:03:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5fa63247fd...
cc79fe00-60db-4dbf-b6ac-213fb8c5d641
HangKeon/BaekJoon
BaekJoon/BaekJoon/2548(대표 자연수2) - 정올 2009 초등 1번.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { int n; //자연수의 개수 int a; //입력하는 값 int sum = 2e9; //가장 작은 차이의 합 int temp = 0; //차이의 합을 임시 저장 int ans; //sum에 저장되는 v의 값 int arr[20001]; //arr[n] : 0~n번지까지의 v의 합을 저장 vector<int> v; //...
ALGO
0.999985
3.853511
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2020-12-27T07:37: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": "dad37fbe8...
2be2ff8c-0269-4728-ac0c-1a8b127e5384
Qiti0/codeforces
c++/C. Minimizing the Sum.cpp
#include <bits/stdc++.h> using namespace std; const int mod = 1e9+7; const double pi = acos(-1.0); const int N = 2e5 + 10; typedef long long ll; typedef pair<int,int> pii; inline int lowbit(int x) {return x & (- x);} void solve() { int n,k;cin >> n >> k; vector <ll> a(n); vector<vector<ll> > dp(n + 1, ve...
ALGO
0.999928
4.449975
{ "github_metadata": { "branch": "codeforces", "commit_count": 8, "repo_created_at": "2024-07-24T02:13:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6be2d7...
e4b10943-0b00-4c49-b5a6-f15d4675f1a7
atatomir/work
_infoarena/---.Reg/main.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <vector> #include <algorithm> #include <cmath> #include <bitset> using namespace std; #define mp make_pair #define pb push_back #define ll long long #define maxN 2000011 #define maxVal 500011 #define bucket 1000000 int t, ti; int n, k, i, dead; ll A,...
ALGO
0.999949
3.062082
{ "github_metadata": { "branch": "master", "commit_count": 302, "repo_created_at": "2015-03-29T18:54: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": "9c4a6e18...
d5639435-4855-4b0a-a453-e772ad3f479b
CUNGVANTHANG/C-plus-plus
C++ Theory/Sorting/Noi_cac_so_thanh_so_nguyen_lon_nhat.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; bool compare(string arr1, string arr2){ return (arr1 + arr2) > (arr2 + arr1); } void largestDigit(vector<int> &arr){ // Lưu dữ liệu sang vector strs vector<string> strs; int n = arr.size(); for(int ...
ALGO
0.99994
5.522142
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2023-04-12T16:39: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": "add758a6b04...
b6fb6d6b-7811-4974-89c8-44d3f1c66d6d
AmritNeupane1/Knapsack_Analysis
knapsack_greedy.cpp
// C/C++ program to solve fractional Knapsack Problem #include <bits/stdc++.h> using namespace std; // Structure for an item which stores weight and // corresponding value of Item struct Item { int weight; int value; }; // Comparison function to sort Item according to val/weight // ratio bool cmp(struct Item a, st...
ALGO
0.999991
4.934596
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2022-07-01T11:25: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": "542ca40d6a49...
4d236f30-c283-4bad-a8fa-583f770e0775
Fallest/ProgramacionDAM
Bloque 1 - C/Ejercicios Resueltos/BLOQUE 1/UD04/1 - VECTORES/60 - Inserción en un vector.cpp
#include <stdio.h> #include <stdlib.h> #include <time.h> #define TAM 10 #define MAXIMO 100 void rellena_vector (int v[]) { int i; srand((unsigned)time(NULL)); for (i=0; i<TAM; i++) v[i] = rand() % (MAXIMO+1); } void imprime_vector (int v[]) { int i; for (i=0; i<TAM; i++) printf(" %d", v[i]); } void le...
ALGO
0.996011
4.092674
{ "github_metadata": { "branch": "main", "commit_count": 29, "repo_created_at": "2021-04-20T09:46:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c061eb81242...
d8ccbedf-2ebc-4802-a5ba-5da8ca9bb0aa
qkrwlsgh1011/Data-Structure
자료구조 퀴즈 cpp/problem1-4.cpp
#include <iostream> #include <string> using namespace std; int main() { int many; cin >> many; for (int i = 0; i < many; i++) { int arr[100] = { 0 }; int arraysize; int sumK = 0; int sumJ = 0; int sumC = 0; int avgK = 0; int avgJ = 0; int avgC = 0; int countK = 0; int countJ = 0; int countC = ...
ALGO
0.999375
3.907413
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2023-03-28T15:30: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": "212c5c3505...
afbedf7b-8047-48d0-863b-f034529d1fb6
nathitoyo/DevC
Quatro_Operacoes_Basicas.cpp
// Programa em C++ para cacular as Quatro Operações Aritméticas Básicas dado dois valores inteiros fornecidos pelo usuário. // Código comentado por: <NAME> // Usa os códigos do Dev C++ #include<stdio.h> // função principal int main() { // as variaveis "valor1" e "valor2" são do tipo "int", ou seja, são numeros inte...
ALGO
0.978355
4.101667
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-01-09T20:26: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": "ea366de0a47c...
6c61cffd-2fdf-4db4-a457-fddaa956f807
roger-sato/compro
com_pro/ABC/021/C.cpp
#define _CRT_SECURE_NO_WARNINGS #include <string> #include <vector> #include <algorithm> #include <numeric> #include <set> #include <map> #include <queue> #include <iostream> #include <sstream> #include <cstdio> #include <cmath> #include <ctime> #include <cstring> #include <cctype> #include <cassert> #include <limits> ...
ALGO
0.99993
3.690529
{ "github_metadata": { "branch": "master", "commit_count": 195, "repo_created_at": "2015-11-24T06:50: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": "18176242...
01009653-ed47-4456-990e-c479e46a427e
IdaKyosuke/dx3d_team
Collision.cpp
#include "Collision.h" #include "Vector2.h" #include "Transform.h" #include "BoxCollider2D.h" #include "CircleCollider2D.h" #include <cmath> using std::abs; using std::powf; bool Collision::Check( const Transform& transform1, const BoxCollider2D* box1, const Transform& transform2, const BoxCollider2D* box2) { // 各矩...
ALGO
0.980178
5.289223
{ "github_metadata": { "branch": "main", "commit_count": 184, "repo_created_at": "2025-03-26T01:24: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": "335a8fac3d...
eba7ca92-7419-4222-9b8e-a5ccd2269c77
Freakqency/Competitive-Programming
GFG/bitmagic/swp_odd_even.cpp
#include <bits/stdc++.h> using namespace std; unsigned int swapBits(unsigned int n) { string bin = bitset<32>(n).to_string(); int len = bin.length(); for (int i = 0; i < len; i++) { if (i % 2 == 0) { char temp = bin[i]; bin[i] = bin[i + 1]; bin[i + 1] = temp; ...
ALGO
0.999881
4.008448
{ "github_metadata": { "branch": "master", "commit_count": 42, "repo_created_at": "2020-12-30T15:58: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": "b18cd4642...
03173258-476a-47bd-bbca-fe170ba2bde2
sagar1024/not-mycppjourney
CP/Codeforces/4. Problems rated 1100+/12. Sort the array.cpp
// B. Sort the Array // time limit per test1 second // memory limit per test256 megabytes // inputstandard input // outputstandard output // Being a programmer, you like arrays a lot. For your birthday, your friends have given you an array a consisting of n distinct integers. Unfortunately, the size of a is too small...
ALGO
0.999992
3.924831
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2024-06-27T10:02: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": "acc66fca9d...
414f1f42-9c4d-402e-afd5-4d3596aad578
jonathanirvings/icpc-jakarta-2017
guess/alt-solution.cpp
// Second solution by <NAME> #include <bits/stdc++.h> using namespace std; int main() { long long N; int K; string S; cin >> N >> K; cin >> S; vector<long long> answer; if (S[S.size() - 1] == '=') { if (N < S.size()) { answer = {-1}; } else { long long now_length = 1; vector<lo...
ALGO
0.999992
3.626379
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2017-11-16T13:30:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 27, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9ee2ae635...
5cf399b6-a5aa-49aa-8e52-fad4cb7fe19d
MustafaHaider53/Data-Structure-AC-series
binaryExponeciation.cpp
#include<iostream> using namespace std; int main() { int x = 5; // number int n = 8; // power int ans = 1; if(n < 0){ // if power is negative x = 1 / x; n = -(n); } if( n == 0){ ans = 1; } if( x == 1){ ans = 1; } while (n > 0){ if...
ALGO
0.999995
4.82923
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2024-09-04T05:00: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": "db55dfb65f0...
421a28d6-4eb7-4690-852a-ee49d3ecafa6
liuyubobobo/Play-Leetcode
0501-1000/0652-Find-Duplicate-Subtrees/cpp-0652/main.cpp
/// Source : https://leetcode.com/problems/find-duplicate-subtrees/description/ /// Author : liuyubobobo /// Time : 2018-10-05 #include <iostream> #include <vector> #include <unordered_map> using namespace std; /// Serializae Binary Tree /// Time Complexity: O(n^2) /// Space Complexity: O(n^2) /// Definition for...
ALGO
0.99973
5.948459
{ "github_metadata": { "branch": "master", "commit_count": 2592, "repo_created_at": "2016-12-01T17:08:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2732, "forks": 718, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "38...
73616278-dced-4807-922e-e9557cc72032
taypi/uri
playing_with_sets.cpp
#include <bits/stdc++.h> #include <iostream> #include <stdio.h> #define ler freopen("in.txt", "r", stdin) using namespace std; int main() { // ler; bitset<60> result, set[10000], a; a[0] = 1; int n, nSets, nNum, num, nOp, op, s1, s2; cin >> n; for(int i = 0; i < n; i++){ cin >> nSets; for(int j...
ALGO
0.992236
4.293972
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-09-25T13:59: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": "4f5c4c5c65...
23566cce-0a68-4307-9c52-2adf1bd01355
Peilin-Yang/leetcode
c++/combinations.cpp
#include <vector> #include <iostream> #include <algorithm> using namespace std; void print_v(vector<int>& r) { for (int i = 0; i != r.size(); i++) { cout << r[i] << ","; } cout << endl; } class Solution { public: void helper(vector<int> s, int k, vector<vector<int> >& r, vector<int>& rr, int start) {...
ALGO
0.999964
5.584229
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2015-11-12T19:40: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": "dbfa9b3f28...
c1fe2881-1ccd-4134-b65e-26739935993c
GrigoriyPA/OlympAlgorithms
data_structures/SegmentTree.h
namespace alg::data_struct { // vvv ------SegmentTreeNode------ vvv // ----------------------------------- // Other Node classes must derive from SegmentTreeNode and override all functions, that they use struct SegmentTreeNode { SegmentTreeNode() { } template <typename T> // ...
ALGO
0.99995
7.092039
{ "github_metadata": { "branch": "master", "commit_count": 46, "repo_created_at": "2022-12-22T17:58: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": "eda28669f...
9712f636-93d6-4a8d-901e-f1002b9349e7
hardiktechnoplanet/C-plus-plus-STL
C_C++_Codes/895. Maximum Frequency Stack.cpp
/*push(int x): map the element (x) with frequency HashMap and update the maxfreq variable ( i.e. holds the maximum frequency till now ). setMap maintains a stack which contains all the elements with same frequency. pop(): First get the maxfreq element from setMap and then decrement the frequency of the popped element. ...
ALGO
0.999622
5.9504
{ "github_metadata": { "branch": "master", "commit_count": 192, "repo_created_at": "2018-02-21T05:51: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": "ec891711...
1051e09e-709e-4b2d-af79-febd87464760
raincross7/code-similarity
codes/train_code/problem300/problem300_496.cpp
#include <bits/stdc++.h> #define M_PI 3.14159265358979323846 // pi using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<ll> VI; typedef pair<ll, ll> P; typedef tuple<ll, ll, ll> t3; typedef tuple<ll, ll, ll, ll> t4; typedef tuple<ll, ll, ll, ll, ll> t5; #define rep(a,n) f...
ALGO
0.999946
3.903194
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-03-06T05:07: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": "b05f8fbcc0a2...
6df97b31-dbe7-4306-a9ff-3edbdb58e0ef
ask-t/CS301_Algorithm
Heapsort/main copy.cpp
#include <bits/stdc++.h> #include "../Header/Employee.h" using namespace std; int comparisons = 0; int heapSize; vector<Employee *> employees; void getEmployees(ifstream &ifs, vector<Employee *> &employees) { string size; getline(ifs, size); struct { string name, id, age, job, year; } employee; for (int i = ...
ALGO
0.989475
4.652618
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-05-02T09: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": "ea18b054805e...
0b03b85e-4721-47c4-92bb-c4e2615b8ae8
raincross7/code-similarity
codes/train_code/problem103/problem103_487.cpp
#include<iostream> #include<iomanip> #include<vector> #include<map> #include<set> #include<stack> #include<queue> #include<string> #include<utility> #include<numeric> #include<algorithm> #include<cmath> #include<climits> using namespace std; using ll = long long; class Stream{ public: Stream(){ } //配列以外の...
ALGO
0.999973
3.847102
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-03-06T05:07: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": "00cf1243edbe...
02a747d8-a843-4e16-9b75-7bde4540cd97
salmanfarooq05/MFirstprogram
Lab 12 Array.cpp
#include<iostream> using namespace std; int main() //{ // int maxk[5]; // for (int i = 0; i < 5; i++) // { // cout << "Enter the number: "; // cin >> maxk[i]; // } // for (int j = 0; j < 5; j++) // { // cout << maxk[j]<<" "; // } // return 0; //} //Task 3 //{ // int sum = 0; // int maxk[5]; // for (int i = 0; i < ...
ALGO
0.999305
3.674847
{ "github_metadata": { "branch": "main", "commit_count": 29, "repo_created_at": "2024-10-17T05:20:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8ac030f49b5...
d0d8b13e-e28c-4ea6-a6e8-f44eb842b45f
sohaibsyed95/COMSC-210
Lab 16/Lab 16a/LAB 16a Write A Function For Shortest Route/GraphShortest.cpp
// LAB 16a: Write A Function For Shortest Route // Programmer: <NAME> // Editor(s) used: Code::Blocks // Compiler(s) used: mingw32-g++ #include <fstream> #include <iostream> #include <list> #include <algorithm> #include <queue> #include <stack> #include <string> #include <vector> #include <utility> using namespace std...
ALGO
0.998749
4.650887
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2016-05-16T04:07:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d63e4e24f9...
4d42cb5a-8a64-41a1-838a-afdb379d7dc0
dae-hany/c-Practice
STL_ vector.cpp
#include <iostream> #include <vector> // 벡터 사용을 위해 필요 using namespace std; // 1. vec.push_back(값) : 벡터의 맨 뒤에 값 추가 // 2. vec.size() : 현재 벡터에 존재하는 원소의 개수 // 3. vec.capacity() : 현재 벡터의 용량(수용할 수 있는 원소의 개수) // 4. vec.pop_back() : 벡터의 맨 뒷 값 제거 // 5. vec.back() : 벡터의 맨 뒷 값 접근 // 6. vec.empty() : 벡터가 비어있다면 1, 아니면 0 ...
ALGO
0.98228
4.910659
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2024-12-18T13:55:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "42e9a2389...
a5a87e8b-859c-499f-a7a1-96456ba8130c
ishandutta2007/codeforces-d
dreamoon_love_aa/normal/1517/E.cpp
#pragma GCC optimize("Ofast,no-stack-protector") /*{{{*/ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<algorithm> #include<string> #include<iostream> #include<sstream> #include<set> #include<map> #include<queue> #include<bitset> #include<vector> #include<limits.h> #include<assert.h> #def...
ALGO
0.999441
4.152912
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:31: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": "00aaca974c48...
6f09d358-a476-473f-adbb-3efac58d641f
linzhenan/coding
LeetCode/224.cpp
class Solution { public: bool isDigital(char ch) { if ('0' <= ch && ch <= '9') return true; else return false; } int calculate(string s) { int res = 0; int sign = 0; stack<int> stk; stack<int> stksign; for (int i = 0; i < s.size...
ALGO
0.999934
4.804593
{ "github_metadata": { "branch": "master", "commit_count": 134, "repo_created_at": "2015-09-12T16:05:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d479eabd...
fe2c2314-0259-4f57-b4dc-b8c5ac8e78d6
narikbi/LeetCode
source/54.cpp
// // 54.cpp // LeetCode // // Created by Narikbi on 21.04.17. // Copyright © 2017 app.leetcode.kz. All rights reserved. // #include <stdio.h> #include <iostream> #include <vector> #include <string> #include <algorithm> #include <deque> #include <queue> #include <set> #include <map> #include <stack> #include <cmat...
ALGO
0.999989
6.401052
{ "github_metadata": { "branch": "master", "commit_count": 59, "repo_created_at": "2017-02-21T18:42:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "108a2eb6a...
1db6339f-63d4-4ba1-ab72-9bdcbcdb3df7
ayman-eltemsahi/problem-solving
cpp/leetcode/problems/matchsticks-to-square.cpp
#include <algorithm> #include <cassert> #include <cctype> #include <iostream> #include <sstream> #include <vector> typedef long long int ll; #define FORN(i, n) for (int i = 0; i < (n); i++) #define FORN1(i, n) for (int i = 1; i < (n); i++) #define LOG(a) std::cout << (a) << "\n" #define LOG2(a, b) std::cout << (a) << ...
ALGO
0.998742
5.120819
{ "github_metadata": { "branch": "master", "commit_count": 218, "repo_created_at": "2019-01-08T09:17:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "8a4e7660...
38790035-ce3f-4199-9709-bd6ded819cf1
vanessaquan/CS32-SPRING2018-UCLA
HW3/maze.cpp
// // main.cpp // maze // // Created by <NAME> on 5/5/18. // bool pathExists(char maze[][10], int sr, int sc, int er, int ec) { // If the start location is equal to the ending location, then we've int currR = sr; int currC = sc; maze[currR][currC] = '@'; if (currR == er && currC == ec) { ...
ALGO
0.973694
3.726473
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2018-06-10T06:58:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a3ef9ea1e...
7e5d42f4-ef74-4136-a9ce-bfe8122f8c2b
YooJaeJun/PracticeProjects
DataStructure/DataStructure/04_Tree/Tree.h
#pragma once #include <stdio.h> #include <iostream> #include <stack> #include <queue> using namespace std; template<typename T> class Tree { public: struct Node; public: void AddChild(Node* parent, Node* child) { if (parent->leftChild == NULL) { parent->leftChild = child; return; } Node* node = par...
ALGO
0.977232
4.170719
{ "github_metadata": { "branch": "main", "commit_count": 486, "repo_created_at": "2022-05-03T15:24: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": "9f6aab2f0d...
10718ed1-e17b-458e-aca6-312f51fc0599
oguzdemir/AgentApp
AgentApp/Agent.h
#pragma once /* * AgentApp - Simulation app * * Agent class header file * Every agent holds its X and Y positions, X and Y velocities. * Static variables are used for computations,same for every agent. * process function make the agent move in given time interval. * findbin function determines the current bin of age...
ALGO
0.983991
5.133487
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2015-12-03T17:45:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5ea2469073...