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
bab081c6-03db-4514-8b2f-53abc65bfd65
harshal-14/CPP_revision
collision_detection.cpp
#include <vector> #include <cmath> // for sqrt struct Circle { double x, y; double radius; }; bool circlesIntersect(const Circle& c1, const Circle& c2) { double dx = c1.x - c2.x; double dy = c1.y - c2.y; double distance = std::sqrt(dx*dx + dy*dy); return distance < c1.radius + c2.radius; ...
ALGO
0.99995
6.319752
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2025-03-07T23:14: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": "718aa39bee64...
08e3ea25-9544-482d-adf5-8faf6100cba8
cs102-spring-2024/code-from-class
class36/dollars.cpp
#include <iostream> using namespace std; class Dollars { private: int _dollars; int _cents; public: Dollars(int dollars, int cents); Dollars operator+(const Dollars & other) const; Dollars operator*(const int & factor) const; int get_dollars() const {return _dollars;} int get_cents() con...
ALGO
0.981907
5.292936
{ "github_metadata": { "branch": "main", "commit_count": 45, "repo_created_at": "2024-01-17T21:08:39.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3806c8edbbb2...
cce4242d-8090-4c98-b9da-e5a68bd41ddc
harsh4677/Daily_DSA
BinarySearch/Bs_ON_1D/CountOccurence.cpp
#include<bits/stdc++.h> using namespace std; int First(vector<int>& arr, int target) { int n = arr.size(); int start = 0, end = n - 1; int first = -1; // Binary search loop while (start <= end) { int mid = start + (end - start) / 2; if (arr[mid] == target) { first = mid...
ALGO
0.999923
6.142844
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2024-09-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": "9e6a72fa90b...
fc670d3b-615b-4d52-9dae-0330d63fc09e
mastojun/ProblemSolving
algospot/tictactoe/tictactoe.cpp
#include <cstdio> #include <iostream> #include <string> using namespace std; int C; char board[3][4]; char cache[20000]; int getStatus() { int result = 0; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { result *= 3; result += board[i][j] == '.' ? 0 : board[i][j] == 'x' ? 1 : 2; }...
ALGO
0.999977
4.578819
{ "github_metadata": { "branch": "master", "commit_count": 214, "repo_created_at": "2013-05-10T13:47:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9b005797...
1829b415-cdaa-47b7-8937-a80b99b29df7
MarielaLo/Proyecto
DFT.cpp
#include <complex> #include <iostream> #include <valarray> #include <time.h> #include<fstream> using namespace std; int n = 0; //se utilizo complex typedef complex<double> Complex; typedef valarray<Complex> CArray; double funcion(double); template <class TI> void obtener_datos(TI data[]) { for (int i = 0;...
ALGO
0.980162
3.539991
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2021-01-21T14:09:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "41f98089a70d...
a20d90cb-c755-4ecc-87fd-503d5e22ff7d
petvas1/Numerical_Methods_cpp
B11 Minimization/main.cpp
#include <iostream> #include <cmath> #include <fstream> #define pi M_PI using namespace std; int main() { double x0, xt, x1, x2, error, N; x0 = 0.2; xt = 23.6; error = 1e-11; N = 100; auto f = [](double x) { return pow( sin(pi*x), 2 ); }; ofstream fout; fout.open("dat...
ALGO
0.999987
4.119743
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2025-04-02T14:29: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": "0f9f3995592...
3f7c1280-874a-427a-b9db-5cbc9e416d0b
peng00bo00/laser-SLAM
assignments/HW7/OccupanyMappingProject/src/occupany_mapping/src/occupany_mapping.cpp
#include "occupany_mapping.h" #include "nav_msgs/GetMap.h" #include "sensor_msgs/PointCloud.h" #include "sensor_msgs/PointCloud2.h" #include "geometry_msgs/Point32.h" #define occupancy_mapping "occupancy_mapping" #define count "count" #define TSDF "tsdf" /** * Increments all the grid cells from (x0, y0) to (x1, y1);...
ALGO
0.951138
4.476093
{ "github_metadata": { "branch": "main", "commit_count": 81, "repo_created_at": "2020-11-27T08:05:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "baec5afcd0f...
ee991e99-7366-4d78-950d-cd7eb43b3d96
unmeshvrije/leetcode
leetcode/SerializeandDeserializeBinaryTreeNew.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Codec { private: /** 0 1 2 3 4 5 6 7 8 a b c d , e f , g */ vector<string> tokenize(string& s...
ALGO
0.999183
5.964074
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2016-05-21T00:15: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": "69e0aa141e...
0f00cb9d-faee-4a45-a040-3e6892c91c9e
harshitverma209/Data-Structures-Algorithms-CPlusPlus-
BST/BST Search.cpp
#include<iostream> using namespace std; class Node{ public: int key; Node * left; Node * right; Node(int key){ this->key = key; left = NULL; right = NULL; } }; //BST Creation Node * insert(Node * root, int e){ if(root == NULL){ root = new Node(e); } if...
ALGO
0.999987
4.909814
{ "github_metadata": { "branch": "main", "commit_count": 43, "repo_created_at": "2021-08-07T12:58: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": "07e9a5941d9...
233eb67a-6c9b-43ce-9505-c8f1d734dadd
skoved/AlgorithmsProject
kmp.cpp
#include "kmp.h" #include <vector> #include <string> #include <iostream> #include <fstream> using namespace std; int* createTable(string pattern){//create backtracking table if(pattern.size() == 0) return NULL; int* table = new int[pattern.size()]; int j = 0; table[0] = 0; bool flag = fa...
ALGO
0.997778
4.103312
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2016-12-05T01:28: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": "77d81e56b...
16c40138-cee8-4c67-ba15-f89de527f3d8
bini59/ps
백준/Gold/2014. 소수의 곱/소수의 곱.cc
//쓸거같은 STL 목록 #include <iostream> #include <vector> #include <queue> //#include <stack> //#include <cmath> //#include <algorithm> //#include <string> using namespace std; /* scanf, printf 쓰기. cout 을 쓸때는 꼭 endl 말고 \n 쓰기. 아니면 밑에꺼 꼭 쓰기, 시간 개걸림. */ /* 범위 때문에 문제 안풀릴때는, index 0은 무시하고 1부터 시작해보기.. 은근 저거때문에 화날때가 많은거같음...
ALGO
0.999951
3.09319
{ "github_metadata": { "branch": "main", "commit_count": 463, "repo_created_at": "2023-03-18T16:20: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": "317fd72e3d...
68a51ab6-381b-461f-a18c-5140e7f2e1bc
rapidsai/cudf
cpp/include/cudf/reduction/detail/segmented_reduction_functions.hpp
/* * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * 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...
TOOL
0.996596
7.594564
{ "github_metadata": { "branch": "branch-25.08", "commit_count": 41228, "repo_created_at": "2017-05-07T03:43:37.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 9049, "forks": 958, "issues": 999, "pull_requests": 95 }, "file_meta": { "content...
82614389-bbb6-4ef2-b81e-c314f6bf4658
morshedulmunna/URI-Problem-Solve
uri1021.cpp
#include <bits/stdc++.h> using namespace std; int main() { // uncomment if you want to use cin cout for input output ( don't mix with scanf, printf ). ios_base::sync_with_stdio(false); cin.tie(NULL); cout << fixed << setprecision(2); double n, d[] = {100.0, 50.0, 20.0, 10.0, 5.0, 2.0, 1.0, 0.5, 0....
ALGO
0.999415
3.733402
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2021-06-09T14:30: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": "40a930521916...
060d21b6-67cd-4ff7-8e8b-5b90821feea1
mehedi37/CP-Solutions
CodeForces/GNU C++20 (64)/1692B | All Distinct/160586925.cpp
#include<bits/stdc++.h> #define ff first #define ss second #define nn '\n' #define mod 1000000007 #define read(_a, _n) for (int i = 0; i < _n; i++) cin >> _a[i]; #define show(_a) for (auto &val : _a) cout << val << " "; #define mx(_a) *max_element(_a.begin(), _a.end()) using namespace std; #define ll long long #define ...
ALGO
0.999516
4.064276
{ "github_metadata": { "branch": "main", "commit_count": 298, "repo_created_at": "2022-07-07T14:31: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": "e0c50dfe99...
dbd728fd-9c55-4bca-881c-6e91c6207db1
Kicamon/Algorithm
atc/abc/292/C.cpp
/* [[ ⣇⣿⠘⣿⣿⣿⡿⡿⣟⣟⢟⢟⢝⠵⡝⣿⡿⢂⣼⣿⣷⣌⠩⡫⡻⣝⠹⢿⣿⣷ ]], [[ ⡆⣿⣆⠱⣝⡵⣝⢅⠙⣿⢕⢕⢕⢕⢝⣥⢒⠅⣿⣿⣿⡿⣳⣌⠪⡪⣡⢑⢝⣇ ]], [[ ⡆⣿⣿⣦⠹⣳⣳⣕⢅⠈⢗⢕⢕⢕⢕⢕⢈⢆⠟⠋⠉⠁⠉⠉⠁⠈⠼⢐⢕⢽ ]], [[ ⡗⢰⣶⣶⣦⣝⢝⢕⢕⠅⡆⢕⢕⢕⢕⢕⣴⠏⣠⡶⠛⡉⡉⡛⢶⣦⡀⠐⣕⢕ ]], [[ ⡝⡄⢻⢟⣿⣿⣷⣕⣕⣅⣿⣔⣕⣵⣵⣿⣿⢠⣿⢠⣮⡈⣌⠨⠅⠹⣷⡀⢱⢕ ]], [[ ⡝⡵⠟⠈⢀⣀⣀⡀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣼⣿⢈⡋⠴⢿⡟⣡⡇⣿⡇⡀⢕ ]], [[ ⡝⠁⣠⣾⠟⡉⡉⡉⠻⣦⣻⣿⣿⣿⣿⣿⣿⣿⣿⣧⠸⣿⣦⣥⣿⡇⡿⣰⢗⢄ ]], [[ ⠁⢰⣿⡏⣴⣌⠈⣌⠡⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣬⣉⣉⣁⣄⢖⢕⢕⢕ ]], [[ ⡀⢻⣿⡇⢙⠁⠴⢿⡟⣡...
ALGO
0.999696
5.652298
{ "github_metadata": { "branch": "main", "commit_count": 129, "repo_created_at": "2023-02-25T11:14:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "aa1f0f7ce4...
c3517d03-00cb-4326-8f9b-ff99b7692a43
didip/mcrouter-util
fpm/src/mcrouter/mcrouter/ServiceInfo.cpp
/* * Copyright (c) 2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #include "Se...
WEB
0.9384
7.731487
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2015-06-24T23:25:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 5, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "581437e787...
52122e89-a03d-4414-83ed-75b3147ed8e9
mahbub-hasan-abid/CP-Solutions
1594C-Make Them Equal.cpp
//8may2023(11:43PM) //9may2023(11:40AM) //9may2023(1:57PM) #include<bits/stdc++.h> using namespace std; typedef long long ll; //Definition Section //-------------------------------------------------------------- #define fl(i,x,y) for( i=x; i<y; i++) #define flc(i,x,y,z) for(int i=x; i<y; i+=z) #define nl cout<<en...
ALGO
0.999661
3.513149
{ "github_metadata": { "branch": "main", "commit_count": 147, "repo_created_at": "2023-05-20T19:56:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2b9d9539cd...
ce32655c-0c59-4449-a707-f45a881657c1
SymbianSource/oss.FCL.sf.mw.accesssec
eapol/eapol_framework/eapol_common/am/common/bloom_algorithm/eap_am_bloom_algorithm.cpp
/* * Copyright (c) 2001-2006 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" * which accompanies this distribution, and is available * at the URL "http://www.eclipse.or...
ALGO
0.970596
6.147262
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2016-10-14T18:32:52.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "11e8e4d66e...
d35fdf29-9d77-453e-996d-b77c93588a17
botworx/botworx-cpp-legacy
src/bwsteer/OpenSteerVec3.cpp
/*Botworx VR - A Virtual Reality Framework Copyright (C) 2005 <NAME>. See BotworxVR_License.txt for details. */ #include "stdafx.h" #include <bwsteer/Vec3.h> // ---------------------------------------------------------------------------- // // // OpenSteer -- Steering Behaviors for Autonomous Characters // // Copyri...
TOOL
0.923073
5.095931
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-02-02T00:35:57.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0890df5e9d5...
220bce22-af1d-4f19-b2e6-fddbe4c7898a
ishandutta2007/codeforces-i
ivan100sic/normal/213/A.cpp
// Retired? #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long unsigned long ull; typedef double long ld; int n; int c[205]; basic_string<int> dep[205]; bool solved[205]; int solve(int c0) { memset(solved, 0, sizeof solved); int cc = 0, t = 0; while (cc < n) { bool found = false; ...
ALGO
0.999597
3.339334
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T05:39: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": "9915a848911a...
bfca918f-707a-4475-9d0f-a9b99d1c4338
kazunetakahashi/atcoder
201411_201509/1102_CR_A/main3.cpp
#include <string> #include <iostream> #include <cstdio> #include <cstdlib> #include <random> #include <fstream> #include <algorithm> #ifdef _MSC_VER #include <Windows.h> #else #include <unistd.h> #endif using namespace std; string query(string url) { #ifdef _MSC_VER // Windowsは同梱のcurl.exeを適当なフォルダに配置してcurlコマンドを使える...
TOOL
0.913586
3.169443
{ "github_metadata": { "branch": "master", "commit_count": 5889, "repo_created_at": "2014-11-15T16:16:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "289c91f...
1edbfd03-bcf7-4369-af32-b19c9a0faf49
RobotLocomotion/drake
geometry/proximity/posed_half_space.h
#pragma once #include <limits> #include "drake/common/drake_copyable.h" #include "drake/common/drake_throw.h" #include "drake/common/eigen_types.h" #include "drake/geometry/proximity/mesh_traits.h" #include "drake/geometry/proximity/plane.h" namespace drake { namespace geometry { namespace internal { /* The definit...
ALGO
0.987686
7.474283
{ "github_metadata": { "branch": "master", "commit_count": 33726, "repo_created_at": "2014-01-26T16:11:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3630, "forks": 1305, "issues": 690, "pull_requests": 46 }, "file_meta": { "content_id":...
1d7f00a9-f599-4dff-9a45-cbb67a0debf3
em3ly/axon_training
CF-Upsolving v001/Solutions/jorgedftrl/X/main.cpp
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; #define endl n using ull = unsigned long int; using ll = long long; template <class Key, class Val> using hmap = gp_hash_table<Key, Val>; int main() { ios_base::sync_with_stdio(false); cin.ti...
ALGO
0.999989
3.260007
{ "github_metadata": { "branch": "master", "commit_count": 134, "repo_created_at": "2019-04-30T16:00:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "adbc3a51...
05c3335a-7e09-4e7b-b4bf-4020bcb13a6c
Aniumbott/CSES-Problem-Set-Solutions
Searching and Sorting/Reading Books.cpp
#include <bits/stdc++.h> // Keywords #define ll long long int #define ull unsigned long long int #define vi vector<int> #define vll vector<ll> #define vip vector<pair<int, int>> #define all(x) (x).begin(), (x).end() #define PI 3.1415926535897932384626433832 #define um unordered_map #define dbg(x) cout << #x << " = " <<...
ALGO
0.99995
4.721342
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2024-07-08T10:28: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": "60aa09287d...
4e75877e-40db-48f8-bcb8-850383db094f
miinii14/USBPortConfiguration
main.cpp
#include <chrono> #include <iostream> #include <windows.h> #include <setupapi.h> #include <hidsdi.h> #include <vector> #include <cstdlib> #define BUFFER_LENGTH 64 HANDLE hidDeviceObject = INVALID_HANDLE_VALUE; bool loadHidLibrary(HMODULE& hHidLib, GUID& classGuid); bool getUSBDevices(HDEVINFO& deviceInfoSet, GUID& cl...
TOOL
0.92779
5.959186
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-03-04T19:05:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9fa5423c8890...
f81ab715-39f5-4db7-8895-8e225ec1bfdc
electro-smith/DaisySP
Source/Effects/sampleratereducer.cpp
#include "dsp.h" #include "sampleratereducer.h" #include <math.h> using namespace daisysp; void SampleRateReducer::Init() { frequency_ = .2f; phase_ = 0.0f; sample_ = 0.0f; next_sample_ = 0.0f; previous_sample_ = 0.0f; } float SampleRateReducer::Process(float in) { ...
ALGO
0.979084
4.975708
{ "github_metadata": { "branch": "master", "commit_count": 584, "repo_created_at": "2020-03-05T17:30:27.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1003, "forks": 162, "issues": 19, "pull_requests": 8 }, "file_meta": { "content_id": "778...
5eff358f-9244-4983-ae77-86db25df3534
ryancoleman/lotsofcoresbook2code
Pearls2_Chapter15/ref_codes/lu/tiled_hstreams/lu_tile_hstreams.cpp
/* FILE LICENSE TAG: SAMPLE */ #include <stdio.h> #include <mkl.h> #include <math.h> #ifndef WIN32 #include <sys/time.h> #endif #include <omp.h> #include <stdlib.h> #include <cmath> #include <string.h> #include <hStreams_source.h> #include <hStreams_app_api.h> #include <intel-coi/common/COIMacros_common.h> #include <om...
ALGO
0.99693
3.667198
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2015-08-31T00:21:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 38, "forks": 24, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "38c8a18...
465e587f-104e-49d5-a991-8ce11d29efae
abiles/systemProject
DeadLock/DeadLock/DeadLock.cpp
// DeadLock.cpp : 콘솔 응용 프로그램에 대한 진입점을 정의합니다. // #include "stdafx.h" #include <Windows.h> #include <process.h> #define NUM_PLAYER 3 struct Player { int m_PlyaerId; int m_HP; CRITICAL_SECTION m_Lock; }; Player GameData[NUM_PLAYER]; void Attack(Player* from, Player* to) { //Attack 총 횟수를 알아보기 위해서 static int atta...
ALGO
0.946814
4.063896
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2014-08-04T10: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": "ddf2e987d2...
f8689c86-6360-418b-bba2-6b2d710eb6c5
tamle7422/data_structures
c++/lower_triangular_matrix_cplusplus.cpp
/* Another lower triangular matrix implementation in c++ */ #include <iostream> using namespace std; class LTMatrix { private: int n; int *A; public: LTMatrix(int n) { this->n = n; A = new int [n * (n + 1) / 2]; } ~LTMatrix() { delete[] A; } void Display(bool row =...
ALGO
0.99973
5.75727
{ "github_metadata": { "branch": "main", "commit_count": 275, "repo_created_at": "2021-04-29T22:26:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "545e007261...
d45e312c-dc32-4fa1-8269-47d89b3f0d88
pawanjenu/compitative-programming
new_format/cses/Sorting and Searching/Subarray Sums 1/solution.cpp
#include <bits/stdc++.h> using namespace std; #define lli long long int #define ll long long #define li long int #define ld long double #define vi vector<int> #define vs vector<string> #define vll vector<long long> #define vl vector<long> #define vlli vector<long long int> #define pii pair<int, int> #define plli pair<...
ALGO
0.999972
3.963468
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2020-04-22T15:09: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": "fa81acc8a...
e3b3a5d5-c298-4d18-8574-80309d0316e0
sajal-jayanto/Algorithm_ACM_problems
UVA.C - CPP/481 - What Goes Up.cpp
#define _CRT_SECURE_NO_WARNINGS #include <cstdio> #include <cmath> #include <cstring> #include <ctime> #include <cstdlib> #include <algorithm> #include <string> #include <map> #include <stack> #include <queue> #include <set> #include <list> #define MAX 100000 #define MAX_INT 2000000000 using namespace std; int binary_...
ALGO
0.999996
3.270959
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2017-08-03T19:21:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2514d5c86...
9b78495a-4e03-4b11-85f2-ce512fd8960b
Sneha-jais/LeetCode_Solutions
Easy_Level/144.BinaryTreePreorderTraversal.cpp
/* Leetcode link: https://leetcode.com/problems/binary-tree-preorder-traversal/ Given the root of a binary tree, return the preorder traversal of its nodes' values. Input: root = [1,null,2,3] Output: [1,2,3] Input: root = [] Output: [] */ /** * Definition for a binary tree node. * struct TreeNode { * int val;...
ALGO
0.999983
6.605859
{ "github_metadata": { "branch": "main", "commit_count": 294, "repo_created_at": "2022-10-11T19:13: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": "2d0532715a...
7219e691-cd9d-4b44-ac2d-fd8f6ca0cf9c
alanwj/mines-solver
mines/solver/local.cpp
#include "mines/solver/local.h" #include <cstddef> #include <queue> #include <tuple> #include <vector> #include "mines/compat/make_unique.h" #include "mines/game/grid.h" namespace mines { namespace solver { namespace local { namespace { class LocalSolver : public Solver { public: LocalSolver(const Game& game) :...
ALGO
0.999354
7.039983
{ "github_metadata": { "branch": "master", "commit_count": 53, "repo_created_at": "2017-07-11T06:33:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d1aa7e4b3...
3741acc6-96bc-4843-b1e4-867425253f9c
ruofeidu/DuAlgorithm
Cpp/BinaryTreeMisc.h
#pragma once #include "common.h" class BinaryTreeMisc { // 101. Symmetric Tree E] // Given a binary tree, check whether it is a mirror of itself (ie, symmetric // around its center). bool isSymmetric(TreeNode* root) { if (root == nullptr) return true; stack<TreeNode*> s; s.push(root->left); s.p...
ALGO
0.998563
6.333506
{ "github_metadata": { "branch": "master", "commit_count": 63, "repo_created_at": "2018-05-09T23:01:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 13, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5cd1e12b...
8f0da3ae-4a60-4b94-91c8-07491dcd07f1
TheMaRauDer28/Prisoner-of-azkaban
Sage's Birthday.cpp
// Easy Version Solution #include<bits/stdc++.h> #define fast ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);srand(time(NULL)); #define vec vector<ll> #define pb push_back #define mp make_pair #define sz size() #define ff first #define ss second #define yes cout<<"YES"<<"\n" #define no cout<<"NO"<<"\n" #de...
ALGO
0.999957
3.546838
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2021-10-27T09:18:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "56ee56b25e4...
62f6d82b-b37d-49db-932c-512ade5d7703
knix98/dsa-questions
CN CP/Bit Manipulation/mock_challenge_3.cpp
/* Ninja And The Task Ninja has been assigned one task by his teacher; as he is a lazy student, he doesn't want to solve it. You are Ninja's best friend, and he asked you to solve the below task assigned to him. Given an integer 'X' your task is to count the number of integer values 'Y' such that ('X' ^ 'Y') > 'X' and...
ALGO
0.999744
5.482792
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2024-08-03T11:50: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": "ddd738c7745...
65f053f0-8291-4328-bbb6-8060ffe03873
swkhitorie/gpm
src/lib/sensor_calibration/compass_calibrator.cpp
#include "compass_calibrator.h" #include "mavlink_vehicle.h" using namespace calibration; /* simple 16 bit random number generator */ static uint16_t get_random16(void) { static uint32_t m_z = 1234; static uint32_t m_w = 76542; m_z = 36969 * (m_z & 0xFFFFu) + (m_z >> 16); m_w = 18000 * (m_w & 0xFFFF...
ALGO
0.901883
4.766558
{ "github_metadata": { "branch": "main", "commit_count": 92, "repo_created_at": "2024-10-19T09:50:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bb7a55f8de2...
232b7189-c526-4a2f-8e30-c4bce85cc084
aglezg/cya-2223
cya-p11-greedy/src/coinCollection.cc
/** * ULL - Escuela Superior de Ingeniería y Tecnología * Grado en Ingeniería Informática - Curso 2 * * Asignatura: Computabilidad y Algoritmia * * @brief Práctica #11: Algoritmos Voraces (Greedy). Cambio de monedas * @author <NAME> * @date 22/12/2022 * * Este archivo contiene el desarrollo de los métodos de la clase ...
ALGO
0.998603
5.613671
{ "github_metadata": { "branch": "main", "commit_count": 101, "repo_created_at": "2022-09-27T16:59:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "315e9a0f9e...
ae5fa7a1-1e4e-48eb-8195-2b8c037db43a
timram/trsp_project
main.cpp
#include <mpi.h> #include <stdlib.h> #include <iostream> #include <fstream> #include <cstdlib> #include <sys/time.h> #include <unistd.h> using namespace std; #define ROOT 0 long originalLen; int rank; int processesNum; int *srcData; long totalTimeInMs; int* generateArray() { int *arr = new int[originalLen]; ...
ALGO
0.999977
4.608285
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-06-03T19:14: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": "45a3ae4204...
46cbf0d7-5bd2-4f1b-bf7e-e62ff75d84a9
M0stafaKhaled/Leetcode
0922-possible-bipartition/0922-possible-bipartition.cpp
class Solution { public: bool dfs(vector<vector<int>> &graph, vector<int>& vist, int i, int color) { vist[i] = color; for (auto e : graph[i]) { if (vist[e] == vist[i]) return false; if (vist[e] == -1) { if (!dfs(graph, vist, e, color ^ 1)) ...
ALGO
0.999927
5.676213
{ "github_metadata": { "branch": "main", "commit_count": 487, "repo_created_at": "2025-06-30T02:44:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "15a62da9b7...
c08436b6-e697-47f1-b959-bebedacc291c
ishandutta2007/codeforces-a
antoine/normal/1004/F.cpp
#include <iostream> #include <algorithm> #include <cstring> #include <string> #include <vector> #include <set> #include <map> #include <queue> #include <cmath> #include <stack> #include <iomanip> #include <functional> #include <array> #include <memory> #include <bitset> #include <unordered_set> #include <unordered_map>...
ALGO
0.999711
4.760898
{ "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": "68f4144cc34b...
ddd4f5fc-e7ae-44c5-8d95-4821c1a7f3a4
TheKiteRunner24/gpgpu-sim
src/gpgpu-sim/warp_scheduler.cc
#include "shader.h" #include "shader_trace.h" #include "../../libcuda/gpgpu_context.h" #define MAX(a, b) (((a) > (b)) ? (a) : (b)) #define MIN(a, b) (((a) < (b)) ? (a) : (b)) shd_warp_t &scheduler_unit::warp(int i) { return *((*m_warp)[i]); } /** * A general function to order things in a Loose Round Robin way. The...
ALGO
0.988472
6.011759
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-11-28T09:19: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": "80f92110c274...
16774c1c-ad50-44c2-a11b-53f3f9964e49
kevinandresforero/ejercisiosguia
alturaInterceptoBarrasEnCilindro (1).cpp
#include <iostream> #include <math.h> using namespace std; int main(){ //Declaracion de variables double base, x; double varilla1, cateto1, pendiente1, y1; double varilla2, cateto2, pendiente2; //Solicitud de datos cout<<"Ingrese la longitud de la base: "; cin>>base;//asigna a base el valor ingresado por tec...
ALGO
0.997642
3.552997
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-08-09T12:43:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c1917debb1...
9fb00a4a-15f2-42b0-99c2-718edef28f9c
utdotk/battle
aoj/2740.cpp
#include <iostream> using namespace std; class Tree { public: Tree(Tree *parent) { num = -1; this->parent = parent; child[0] = child[1] = NULL; cnt = 0; } ~Tree() { for (int i = 0; i < cnt; i++) { delete child[i]; } } // debug void print() { if (num != -1) { if (...
ALGO
0.996578
4.265654
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-07-01T03:37: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": "5386e5d855...
780a956a-8c6f-4fde-aa19-1bc9072b670a
Superm4n97/competetive-programming
Codeforces vol 01/1195C.cpp
#include <bits/stdc++.h> #define pb push_back #define ll long long int #define scd(a) scanf("%d",&a) #define mp(a,b) make_pair(a,b) #define scl(w) scanf("%I64d",&w) #define scdd(a,b) scanf("%d %d",&a,&b) #define srt(a) sort(a.begin(),a.end()) #define rs...
ALGO
0.999988
3.202325
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2021-12-16T18:34: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": "b15f2cdaab...
e13cd778-7aa8-41b7-9372-d14421e5afd2
darkhader/LTU15
20201/data-structure-and-algorithm/lietkehoanvi.cpp
#include <iostream> using namespace std; void lietke(int n) { int x[n]; for (int i = 0; i < n; i++) { x[i] = i + 1; } int count = 0; while (true) { count++; for (int i = 0; i < n; i++) { printf("%d ", x[i]); } cout << " count: " << count << endl; int key = n - 1; // ...
ALGO
0.999983
3.804568
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2020-12-19T15:40: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": "fd1dad492...
13657ee2-579a-436e-bc38-e4fd003b5f4d
Gecode/gecode
gecode/flatzinc/branch.cpp
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */ /* * Main authors: * <NAME> <<EMAIL>> * * Copyright: * <NAME>, 2017 * * This file is part of Gecode, the generic constraint * development environment: * http://www.gecode.org * * Permission is hereby granted, free of charge, t...
ALGO
0.932911
6.47865
{ "github_metadata": { "branch": "master", "commit_count": 5620, "repo_created_at": "2015-11-06T07:33:39.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 309, "forks": 77, "issues": 40, "pull_requests": 9 }, "file_meta": { "content_id": "3566...
1933ea74-601b-452b-ae70-f44fa28d0ddc
ImenAlSamarai/SSTDEV
corsikaSimulationTools/src/getHeight.cpp
/*! \file getHeight.cpp \brief calculate height [m] from atmospheric thickness [g/cm2] using Bernloehrs routines and cherenkf routine <NAME> */ #include <cmath> #include <iostream> #include <stdlib.h> #include "atmo.h" #include "fileopen.h" using namespace std; double yds( double g ); int main( int...
TOOL
0.95326
4.365577
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-07-27T08:29: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": "eded6a45fb...
eabbc504-56da-4c07-919b-019e0c61834c
ThomasTend/BondVaR
BondPortfolioVaR.cpp
#include <iostream> #include <cmath> #include <numeric> #include <math.h> #include <string> #include <vector> #include <fstream> #include <sstream> #include <iterator> using namespace std; /* INPUT. As in examples 1 & 2 in A Primer on Bond Portfolio Value at Risk - Smith, i.e. Bond data and correlation matr...
DATA
0.99349
5.713701
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-09-01T10:42: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": "c607e360b0f0...
3265e21a-c869-4451-9b1e-230c5e4c8d08
EntelectChallenge/2019-Worms
starter-bots/cplusplus/cppbot/cppbot.cpp
#include <iostream> #include "./rapidjson/document.h" #include <fstream> #include <string> #include <sstream> #include <vector> #include <functional> #include <cmath> #include <random> static std::string dirt = "DIRT"; static std::string air = "AIR"; static std::string space = "DEEP_SPACE"; struct POINT { int x; ...
TOOL
0.996298
3.978183
{ "github_metadata": { "branch": "develop", "commit_count": 505, "repo_created_at": "2019-04-05T10:26:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 33, "forks": 12, "issues": 5, "pull_requests": 7 }, "file_meta": { "content_id": "3d249...
57eef65c-a2cc-4671-a057-75eda31451f2
rajdeepchatterjee187/LeetCode
173-binary-search-tree-iterator/173-binary-search-tree-iterator.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.99992
6.350816
{ "github_metadata": { "branch": "main", "commit_count": 420, "repo_created_at": "2022-06-20T06:15: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": "a177ffcbea...
54e9967d-629d-47e6-9567-3238ae6a7f27
NaimSS/algoritmos
Biblioteca/Graph/BridgeTree.cpp
// Refer to https://codeforces.com/contest/659/problem/E // O((N+M)*alpha) // Reference: https://codeforces.com/blog/entry/18294 // Arestas bidirecionais!! // n,m devem ser globais const int N = ;//maxN const int M = ;//maxM vector<int> t[N]; // bridge tree; vector<int> g[N]; int U[M],V[M],vis[N],arr[N],dsu[N]; bool i...
ALGO
0.999943
4.360962
{ "github_metadata": { "branch": "main", "commit_count": 54, "repo_created_at": "2021-07-20T13:41: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": "856120ecb7f...
c937e491-c509-48a2-8714-0619e28088d1
lewismunene020/Cpp-Projects
calculator.cpp
#include<iostream> #include<stdio.h> #include<cstring> #include<string> using namespace std; double add(double num1 , double num2 ){ return num1+num2; } double subtract(double num1 , double num2 ){ return num1-num2; } double multiply(double num1 , double num2 ){ return num1 * num2; } double divide(...
ALGO
0.998407
3.448385
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2022-09-21T19:21:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "170e73a68d...
157d7a6a-1071-4d40-a195-d49f00b321fb
mosta7il/Competitive-programming
codeforces/CF334-Div2-C.cpp
#include<set> #include<map> #include<list> #include<iomanip> #include<cmath> #include<string> #include<vector> #include<queue> #include<stack> #include<complex> #include<sstream> #include<iostream> #include<fstream> #include<algorithm> #include<numeric> #include<utility> #include<functional> #include<stdio.h> #include<...
ALGO
0.99999
3.18519
{ "github_metadata": { "branch": "master", "commit_count": 519, "repo_created_at": "2017-08-15T22:37:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bfd09a30...
d2f9da01-db60-47c9-b835-95c93b4a6af1
imeplusplus/ps-competitive-programming
2024/semana7/hw7/F.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e3+5; int m[N][N]; int ps[N+1][N+1]; int main(){ cin.tie(NULL); ios_base::sync_with_stdio(false); int n,q; cin >> n >> q; for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ char c; cin >> c; if(c=='*') ...
ALGO
0.999854
4.570728
{ "github_metadata": { "branch": "main", "commit_count": 217, "repo_created_at": "2022-03-14T19:38:53.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f2bd1362ec4...
895860e8-8dea-4a67-a832-0da1274bbf3b
sahityasahil/leetcode-cpp-dsa
2237-longest-palindrome-by-concatenating-two-letter-words/2237-longest-palindrome-by-concatenating-two-letter-words.cpp
class Solution { public: int longestPalindrome(vector<string>& words) { unordered_map<string, int> m; for (auto e : words) m[e]++; // storing the freq in hashmap int cnt=0, alreadyPalindrome=0; for (auto& [e, freq] : m) { string s = e; // if reverse of e...
ALGO
0.99999
5.998687
{ "github_metadata": { "branch": "main", "commit_count": 313, "repo_created_at": "2025-06-11T05:24:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "38fb6bdd9a...
08df5904-5f68-469e-b987-36ab694c4dde
nikhil1699/Coding-Interview
Competetive Coding Course/Dynamic Programming/Atcoder Educational DP Contest/w.cpp
// Problem W - Educational Dynamic Programming Contest - AtCoder #include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 2*1e5 + 10; vector<int> adiciona[MAXN],retira[MAXN]; ll seg[4*MAXN],lazy[4*MAXN],dp[MAXN],valor[MAXN]; int N,M,ini[MAXN],fim[MAXN]; void propagate(int pos,int left,i...
ALGO
0.999937
4.231112
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2019-12-08T19:00:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5a0d0dcb28...
c0ba70e6-dbb4-4d32-8b7d-e6c72115e0e4
riveridea/g20
tree/path_traversal/preorder_traversal/solution.cpp
/* Given a binary tree, return the preorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [1,2,3]. Note: Recursive solution is trivial, could you do it iteratively? */ /** * Definition for a binary tree node. */ struct TreeNode { int val; T...
ALGO
0.999999
6.217804
{ "github_metadata": { "branch": "master", "commit_count": 185, "repo_created_at": "2017-06-27T18:27: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": "d0cc5ba7...
7777639e-e3ed-4af9-adf2-8b7c1842cee7
Shawn5961/src
schoolwork/fall2013/datastruct/eoce/ll_oop_reimp/testing/listtest.cc
#include <stdio.h> #include "list.h" int main() { int input, option, i; bool listExists = false; List *myList = new List(); Node *gottenNode; do { printf("Please choose an option\n"); printf("1: Build list\n"); printf("2: Insert to list\n"); printf("3: Append to list\n"); printf("4: Get node from lis...
TOOL
0.963356
3.969867
{ "github_metadata": { "branch": "master", "commit_count": 144, "repo_created_at": "2013-03-27T00:22: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": "1ae7bfcc...
14764a31-5c2e-414e-9faa-1bcadede8f7d
cleanshafay/parallelprocessing
laplace_solver/openCL/laplace_main.cpp
#include <iostream> #include <fstream> #include <sstream> #include <vector> #include <chrono> #include <iomanip> #include <cmath> #include <CL/cl.h> using namespace std; class Grid { private: vector<vector<float>> data; size_t width, height; public: Grid(size_t h, size_t w, float initialValue = 0.0f) : ...
ALGO
0.994004
6.393605
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2025-05-10T18:43:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "04dd70418c3...
81ab0845-5eb9-46a2-9dfc-6b8ca744dcf9
andresvrl/Competitive_Programming
Graphs/10330 - Power Transmission/10330 - Power Transmission.cpp
#include <algorithm> #include <iostream> #include <vector> #include <queue> #include <string> #include <string.h> using namespace std; typedef vector<int> vi; const int MAX_V = 210; const int INF = 1000000000; int res[MAX_V][MAX_V], source, target; vi p, vis; vector<vi> AdjList; int maxflow(){ int mf = 0; while (...
ALGO
0.999641
3.754528
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2015-08-08T01:29: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": "530c7f988...
4b13d0d6-2775-4418-80b9-c298b093edd4
Shukl-amber/CP-Files
CPP/CP(CPP)/lottery.cpp
#include <bits/stdc++.h> using namespace std; int main(void) { int tc; cin >> tc; while (tc--) { long long size; long long num = 0, it = 0; long long upper, lower; cin >> size; size += 2; long long arr[size]; arr[0] = 0; arr[size - 1] = 100...
ALGO
0.999789
3.353744
{ "github_metadata": { "branch": "main", "commit_count": 44, "repo_created_at": "2025-03-06T17:22: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": "339de0ac086...
e9cc13a3-1289-40fa-be18-9869fd948be7
xiaoyuyang0901/Apollo-code-with-node
modules/drivers/lidar/robosense/decoder/decoder_bp.hpp
/****************************************************************************** * Copyright 2020 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.92896
6.255393
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2022-01-28T17:56:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 78, "forks": 48, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "e4fa4ce4...
bf922dc9-d317-4811-b6cd-fcb4ed8c7e18
FerFrassia/algo2tp3
driver-test-cpp/rodri_dcnet.cpp
#include "TiposSimples.h" #include "aed2/TiposBasicos.h" #include "aed2/Conj.h" #include "aed2/Arreglo.h" #include "aed2/Vector.h" #include "aed2/Lista.h" #include "dicc_trie.h" #include "DiccRapido.h" #include "red.h" #include "dcnet.h" using namespace aed2; /*Este Struct solamente se utiliza en la funcion "Avanz...
ALGO
0.959377
3.861599
{ "github_metadata": { "branch": "master", "commit_count": 70, "repo_created_at": "2015-06-25T00:06: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": "846a69e0d...
27eefc55-7990-4a68-9cc0-2e39cc4f5c48
114-l-l-255/OI_codes
Bashu(code)/1372.cpp
#include <cstdio> #include <stack> #define N 1005 #define inf 0x7fffffff using namespace std; struct Node { int val, pos; }; int n, m, ans = -inf; int h[N], l[N], r[N]; int a[N][N]; int main() { scanf("%d %d", &n, &m); for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) { char c[3]; scanf("%s", c); ...
ALGO
0.999797
3.342857
{ "github_metadata": { "branch": "main", "commit_count": 49, "repo_created_at": "2021-01-06T12:04:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "431e3497b47...
7ebd5c58-2be0-4483-aeaf-317e3cccb13d
MartinaColombo/Laboratorio_di_Simulazione_Numerica
Esercitazione_01/1.1/main.cpp
//Esercizio 1.1 //Stima del valor medio di r, della sua deviazione standard e del chi quadro #include <iostream> #include <fstream> #include <string> #include <vector> #include <cmath> #include <algorithm> #include <numeric> #include "random.h" using namespace std; int main (){ Random rnd; int seed[4]; ...
ALGO
0.997118
3.495032
{ "github_metadata": { "branch": "main", "commit_count": 81, "repo_created_at": "2022-01-16T13:57:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "71173d91af3...
4fb39b04-f0c3-441f-a864-2275154f0e08
CorvetteCole/CS315
project-1-trains/DoublyLinkedList.h
// // Created by coleg on 2/15/21. // #ifndef PROJECT_1_TRAINS_DOUBLYLINKEDLIST_H #define PROJECT_1_TRAINS_DOUBLYLINKEDLIST_H using namespace std; template<typename T> struct Node { Node *previous = nullptr; Node *next = nullptr; T data; }; template<class T> class DoublyLinkedList { public: DoublyL...
ALGO
0.960767
5.899386
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2021-02-15T17:36: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": "247064ef44df...
f9b18832-520d-4abd-9ddf-49d6fd096bb7
bsa0322/BaekJoon-Algorithm
backtracking/13460.cpp
#include <iostream> #include <queue> #include <map> using namespace std; typedef pair<int, int> pi; typedef pair<pi, pi> ppi; int n, m; int boardStringIdx(int &r, int &c) { return (r * m) + c; } // pos = {-1, -1} 구슬에 빠진 상태 !! string movingOneBead(int &direc, string &board, pi &pos, bool is_red) { int dr[4] ...
ALGO
0.999949
4.396669
{ "github_metadata": { "branch": "main", "commit_count": 362, "repo_created_at": "2021-02-04T21:41: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": "7decd7ba13...
276f8032-66bd-478c-b506-99cf16ca0712
fs820/HGS_O
rotation.cpp
//--------------------------------------- // //回転による移動処理[rotation.cpp] //Author <NAME> // //--------------------------------------- #include "rotation.h" //------------------------------ // sin,cos回転処理 //------------------------------ D3DXVECTOR3 RotationofShaft(D3DXVECTOR3& Outpos, const D3DXVECTOR3& Inpos, const D3D...
ALGO
0.983407
4.075452
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2025-03-25T23: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": "a7718ba04a9...
998d45b0-5abd-4daa-9f38-089f2a5a7e8d
chenjunkai2018/Photoshop_algorithm
opencv/Kaleidoscope_Filter.cpp
/* generate the circle transform */ #include "PS_Algorithm.h" #include <time.h> using namespace std; using namespace cv; #define pi 3.1415926 float Triangle(float x); int main() { string Img_name("4.jpg"); Mat Img; Img=imread(Img_name); Mat Img_out(Img.size(), CV_8UC3); int width=Img.cols; ...
ALGO
0.998948
4.214914
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2018-10-29T13:57:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 98, "forks": 29, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d81d803...
318851b0-b368-4630-90ee-d22105802f42
Karthiikeyan/CodeForces
Aug 28/A_Directional_Increase.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1100000; int a[N], n; int main() { int T; cin >> T; while (T--) { cin >> n; long long sum = 0; for (int i = 1; i <= n; i++) cin >> a[i], sum += a[i]; if (sum != 0) { cout << "No" <...
ALGO
0.99982
3.930896
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-08-14T08:44: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": "74051d1aed47...
9fa00c62-9cd5-470f-b3dc-a15683b08a97
keltoncmcgrath/DemoDudes
ControllerDesign/CLTF/Lab12_PID_TrajectoryFollowing/Lab12_PID_TrajectoryFollowing.ino
#include <DualTB9051FTGMotorShieldUnoMega.h> #include <Encoder.h> DualTB9051FTGMotorShieldUnoMega myMotorDriver; Encoder myEncoder1(19, 18); Encoder myEncoder2(20, 21); double GearRatio = 70; double EncoderCountsPerRev = 64; unsigned long t_ms = 0; double theta1, omega1, omega1_des, omega1f = 0; double theta1_old = ...
ALGO
0.984896
4.713011
{ "github_metadata": { "branch": "main", "commit_count": 119, "repo_created_at": "2024-01-31T19:54: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": "9ca45cc189...
d05ae2b8-4983-45fa-bca5-8f2acfb819f4
JunhoYoon95/Sor
main.cpp
#include <iostream> #include <algorithm> using namespace std; int main() { int first[] = {9,2,5,1,6,7,3,8,4,0}; int size = 10; cout << "기존의 배열 : " << endl; for(int i = 0; i < size; i++) { cout << first[i] << " "; } cout << endl; cout << "\n정렬 후의 배열 : " << endl;...
ALGO
0.999875
4.587067
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2019-11-27T21:47: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": "1fd0028af4...
5a00977e-d002-4ab7-9602-a0953749110e
KaushikSamba/advent-of-code-2021
day-3/power_consumption_calculator.hpp
#include <array> #include <bitset> #include <functional> #include <vector> namespace day_3 { class PowerConsumptionCalculator { public: using ReportLine = std::vector<bool>; using Report = std::vector<ReportLine>; using Rate = std::vector<bool>; PowerConsumptionCalculator(); PowerConsumpt...
ALGO
0.986157
6.678099
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2021-12-06T13:59: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": "b6f96072b...
65d154d5-190a-48eb-9c75-3b361bfc3307
achmadrzm/data_structure_and_algorithms
w1/linkedlist.cpp
#include <iostream> using namespace std; struct node { int data; // data dari node struct node *next; // alamat node selanjutnya }; node *head = NULL, *tail= NULL; //membuat head dan tail void print(){ // Membuat fungsi print int index = 0; //Mendeklarasikan int index untukk indexing node *temp = hea...
ALGO
0.999382
3.927356
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-12-25T02:50: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": "9b0251705ae4...
64293a1e-804b-4e1a-9300-7abcc171f80b
WhoCaresAboutNameOrFame/Algo2
binaryCounter.cpp
#include <iostream> #include <vector> using namespace std; void increment(int A[], int k) { int i = 0; for (int j = k-1; j > -1; j--) { cout << A[j]; } while (i < k && A[i] == 1){ A[i] = 0; i += 1; } if (i < k) { A[i] = 1; } // for (int j = k-1; j > -1; j...
ALGO
0.99992
4.103204
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2024-05-08T03:53:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "aca922058ac1...
5d54415d-7ccf-4ca5-9c40-5e2e9791f811
atharva1554/Leetcode-question-solution-
Difficulty: Medium/Two numbers with odd occurrences/two-numbers-with-odd-occurrences.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: vector<long long int> twoOddNum(long long int Arr[], long long int N) { // code here long long int x=0; ...
ALGO
0.999948
5.220985
{ "github_metadata": { "branch": "main", "commit_count": 2929, "repo_created_at": "2024-05-26T16:07:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b5212c4cd...
1d058a1b-bc26-49ee-83c4-b4456cabea60
eriser/libflexdsp
dsp++/src/flt_biquad.cpp
#include <dsp++/flt/biquad_design.h> #include <dsp++/const.h> #include <stdexcept> #include <cmath> void dsp::biquad::design(double b[], double a[], biquad::enum_class_ref(type) type, double norm_freq, const double* gain_db, const double* q, const double* bw, const double* s) { if (norm_freq < 0. || norm_freq > 0.5) ...
ALGO
0.985069
4.799797
{ "github_metadata": { "branch": "master", "commit_count": 264, "repo_created_at": "2015-03-13T08:34:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "1097d969...
774760e9-2863-4070-8e78-da0751ad049e
Yuulis/AtCoderSolution_old
AtCoder/Others/CODE-FESTIVAL/2016/qual-B/B.cpp
#include <bits/stdc++.h> #include <unordered_set> using namespace std; using Graph = vector<vector<int>>; // template<class T>bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; // } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b < a) { a // = b; return 1; } return 0; } typedef long long ...
ALGO
0.99995
3.682866
{ "github_metadata": { "branch": "main", "commit_count": 445, "repo_created_at": "2021-08-19T01:43:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "cb660b9fd0...
fb24120f-307e-49e6-be7d-4b16d82d1a0c
AkifAzwad/cp_repo
academy/E. BNP - Bear and Numbers which are Primes.cpp
#include "bits/stdc++.h" using namespace std; /////////data types///////// using ll = long long; /////////constants///////// //const int mod = 1e9 + 7; const int N = 1e7 + 9; int hi = 0; int num[N]; int f[N]; //////////methods////////// void sieve() { int n = N; vector<bool> is_prime(n + 1, true); is_prime[0]...
ALGO
0.999974
4.729897
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-01-03T15:14: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": "9111ee971cab...
fda8dc3e-b5c1-4db7-919a-6ce9a7b549a7
isquicha/exercicios-logica-c
exercicios/034.cpp
/* Faça um programa que calcule as raízes de uma equação do segundo grau, na forma ax² + bx + c. O programa deverá pedir os valores de a, b e c e fazer as consistências, informando ao usuário nas seguintes situações: Se o usuário informar o valor de A igual a zero, a equação não é do segundo grau e o prog...
ALGO
0.988576
3.977323
{ "github_metadata": { "branch": "main", "commit_count": 112, "repo_created_at": "2020-11-03T03:10:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 124, "forks": 32, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "77cd63a...
2fc8594a-de34-4542-a257-453be931d23b
JanaSabuj/Leetcode-solutions
Premium/Inorder Successor of a BST.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ typedef struct TreeNode node; class Solution { public: /* * @param root: The root of the BST. * @param p: You ...
ALGO
0.99999
5.799846
{ "github_metadata": { "branch": "master", "commit_count": 780, "repo_created_at": "2019-01-13T14:59:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 13, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "539dfa5...
b6d4e0bc-5500-4f98-af30-4fa4dea1b522
darrylteo/cp4-solutions
4 Graph/5. Special graphs/b. DP, Counting Paths in DAG, Easier/10544 - Numbering the Paths.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ll> vll; // idea: use adj2 to find how many paths starting from [i] // if we skip [i], we skipped pathCnt[i] paths so far // btw the normal adj would give us no. of paths ending at [...
ALGO
0.999933
4.140406
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-07-03T16:45:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ee0efb214c8f...
1c74af77-f802-42cf-8dff-0fb93b370cce
Mafia2404/MySirG-DSA
Assignment 14/Assignment 14/q1.cpp
#include <iostream> using namespace std; class Node { public: int item; Node *left; Node *right; }; class BST { private: Node *root; public: BST(); bool isEmpty(); void insertNode(int); void preorder(Node*); void inorder(Node*); void postorder(Node*); Node* deleteNode(Node*,...
ALGO
0.999851
4.22155
{ "github_metadata": { "branch": "main", "commit_count": 31, "repo_created_at": "2024-01-12T03:50: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": "c798fff50dc...
680bbdfb-9eb2-4889-86f8-b2537a5122ad
obsolescenceL/obsolescenceL
Leetcode/Ac_349.cpp
/************************************************************************* File Name: 349.cpp ID: obsoles1 PROG: LANG: C++ Mail: <EMAIL> Created Time: Sun 08 Jan 2017 11:23:41 AM EST ************************************************************************/ #include<iostream> #include<a...
ALGO
0.999992
4.330604
{ "github_metadata": { "branch": "master", "commit_count": 751, "repo_created_at": "2014-12-29T07:41:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ff285827...
435ba70b-7d03-44aa-9a2b-7e36b4f11c9a
KhoiBui16/28Tech_Code_Online
Data structure algorithm/Source Code DSA Contest/ThamLam/Bai04_ChiaTap.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1e9 + 7; int main() { int n , k ; cin >> n >> k; int a[n]; for(int i = 0 ; i < n ;i++) { cin >> a[i]; } if(k > n / 2) { sort(a , a + n , greater<int>()); ll sum1 = 0 , sum2 = 0; ...
ALGO
0.999997
4.408888
{ "github_metadata": { "branch": "main", "commit_count": 104, "repo_created_at": "2024-01-13T13:33:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cfac477dc1...
0f8ec01c-228b-48a9-9630-ea63dc35b14d
AMReX-Codes/amrex
Src/Base/AMReX_DistributionMapping.H
#ifndef BL_DISTRIBUTIONMAPPING_H #define BL_DISTRIBUTIONMAPPING_H #include <AMReX_Config.H> #include <AMReX.H> #include <AMReX_Array.H> #include <AMReX_Vector.H> #include <AMReX_Box.H> #include <AMReX_REAL.H> #include <AMReX_ParallelDescriptor.H> #include <map> #include <limits> #include <memory> #include <cstddef> #...
ALGO
0.995368
5.445622
{ "github_metadata": { "branch": "development", "commit_count": 27456, "repo_created_at": "2017-04-28T19:37:00.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 637, "forks": 407, "issues": 21, "pull_requests": 19 }, "file_meta": { "content_id...
3cb846f6-dd92-4175-b711-b43898e74c01
princekrmishra/DSA-Problem
Searching and Sorting/lastoccurence.cpp
#include<iostream> using namespace std; int findLastOccurence(int arr[], int n, int target){ int start = 0; int end = n - 1; int mid = start/2 + end/2; int ans = -1; while(start <= end){ if(arr[mid] == target){ ans = mid; start = mid+1; //right m jao ...
ALGO
0.999733
4.667305
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2024-08-02T19:13: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": "b160385a1ab...
b59f10e1-cdd4-42d5-aa07-1f4f04aa49c0
202030481266/CP-Templates-and-Solutions
lc medium/2063. 所有子字符串中的元音.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; const int mod = 1e9 + 7; const int inf = 0x3f3f3f3f; const ll llinf = 0x3f3f3f3f3f3f3f3f; class Solution { public: long long countVowels(string word) { int n = word.size(); long long ans = 0; fo...
ALGO
0.99981
5.298083
{ "github_metadata": { "branch": "main", "commit_count": 606, "repo_created_at": "2023-01-27T08:36: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": "f19d4c8249...
fca19e19-6a2f-4186-a80f-4bec9fd47818
fazlerahmanejazi/Competitive-Programming
Codechef/SNCK1A19/CARDMGK.cpp
#include <bits/stdc++.h> using namespace std ; #define inf 0x3f3f3f3f #define INF 1000111000111000111LL #define mod 1000000007 #define pi acos(-1.0) #define eps 1e-8 #define endl '\n' #define mp make_pair #define mt make_tuple #define pb push_back #define fi first #define se second #define all(cc) (cc).begin(),(cc).en...
ALGO
0.999972
4.027446
{ "github_metadata": { "branch": "master", "commit_count": 102, "repo_created_at": "2018-01-12T00:39:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 6 }, "file_meta": { "content_id": "f86c5a76...
d469d698-2004-440b-be7d-ce277ad286b0
CQCL/tket
tket/include/tket/Circuit/ConjugationBox.hpp
// Copyright Quantinuum // // 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 or agreed to in writin...
ALGO
0.95792
7.090184
{ "github_metadata": { "branch": "main", "commit_count": 1453, "repo_created_at": "2021-09-13T12:46:23.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 282, "forks": 51, "issues": 73, "pull_requests": 3 }, "file_meta": { "content_id": "f74b0d...
70b1e280-6135-4422-91bb-d66a2dbb63d1
rashidsayyed/practice-folder-backup
c/DSA-in-cpp/sorting-arrays/selectionsort.cpp
#include <iostream> using namespace std; int main() { cout << "Enter the size of an array: " << endl; int n; cin >> n; int array[n]; cout << "Enter the elements of an array: " << endl; for (int i = 0; i < n; i++) { cin >> array[i]; } for (int i = 0; i < n - 1; i++) { ...
ALGO
0.999826
4.748512
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-06-11T01:31: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": "f354a44ef076...
5f52b014-aaeb-48dc-a978-0e87b14874f9
gokulmaran/SDE
DSA/20) Greedy/Scheduling problems/MinimumPlatforms.cpp
#include <iostream> #include <algorithm> using namespace std; //link: https://www.geeksforgeeks.org/problems/minimum-platforms-1587115620/1 class Solution { public: // Function to find the minimum number of platforms required at the // railway station such that no train waits. int findPlatform(int arr[], i...
ALGO
0.999941
6.017783
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2024-08-05T16:30: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": "4b81f318dd41...
97723d3e-7b1f-4a1e-8d5b-8ad6a84690dc
Saavrm26/mycppprogs
gfg/optmizedunboundedknapsack.cpp
// { Driver Code Starts // Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ //datatype snippets typedef long long ll; //stl snippets typedef vector<int> vi; typedef vector<long long> vll; typedef vector<pair<int,int>> vpii; typedef vector...
ALGO
0.99998
4.669652
{ "github_metadata": { "branch": "main", "commit_count": 78, "repo_created_at": "2022-03-05T14:31: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": "18dba88aefd...
41494b2f-4bbb-41d9-8569-d447c4065063
rom-k/topcoder
source/DivideAndShift.cpp
#include <stdio.h> #include <time.h> #include <vector> #include <list> #include <set> #include <string> #include <iostream> #include <fstream> #include <algorithm> #include <sstream> #include <queue> #include <map> #include <iomanip> #include <cmath> #include <stack> #include <numeric> #include <iterator> #include <cst...
ALGO
0.999987
4.503506
{ "github_metadata": { "branch": "master", "commit_count": 97, "repo_created_at": "2012-05-12T04:25:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "71bc46b36...
d01738ab-fcb2-4ac2-8752-28347699543e
nguyentranngocty/CPP
Source code/Set_Map/phanturiengbiet.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; int cnt[1000001] = {0}; int main(){ freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); //DEM PHAN PHOI DUOC SAP XEP // int n, min_val = INT_MAX, max_val = IN...
ALGO
0.99997
4.220151
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-12-13T02:35: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": "994bb360ec7e...
2b846290-3e51-46b0-aa89-451093ec1125
Yawn-Sean/Daily_CF_Problems
daily_problems/2024/05/0503/personal_submission/cf1146d_rui_er.cpp
const ll N = 3e5 + 5; ll m, a, b, vis[N]; ll dfs(ll u, ll L) { if(vis[u]) return 0; ll ans = 1; vis[u] = 1; if(u + a <= L) ans += dfs(u + a, L); if(u - b >= 0) ans += dfs(u - b, L); return ans; } int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> m >> a >> b...
ALGO
0.999887
3.515529
{ "github_metadata": { "branch": "main", "commit_count": 20410, "repo_created_at": "2024-02-26T01:04:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 478, "forks": 302, "issues": 0, "pull_requests": 7 }, "file_meta": { "content_id": "b7eb...
18ba3634-5f49-4b1f-9dec-adff749d3c8d
niklasrb/MaPra18
A05b/include/alg.h
#include "unit.h" #include <algorithm> void Dijkstra(const DistanceGraph& g, GraphVisualizer& v, VertexT start, std::vector<CostT>& kostenZumStart) { kostenZumStart.clear(); // Initialisiere kostenZumStart kostenZumStart.resize(g.numVertices(), infty); kostenZumStart.at(start) = 0; v.ResetStates(); ...
ALGO
0.998805
4.635481
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2018-04-16T15:07:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c463e073f...
e56b9f09-65f9-4ec2-a8bd-ad75feee65cd
HalidOdat/libgui
examples/Calculator/eval.cpp
#include <iostream> #include <sstream> #include <stack> #include <queue> #include <string> #include <cctype> #include <cmath> #include <stdexcept> static bool isOperator(char c) { return c == '+' || c == '-' || c == '*' || c == '/' || c == '^'; } static bool isParenthesis(char c) { return c == '(' || c == ')'...
ALGO
0.997643
5.906973
{ "github_metadata": { "branch": "main", "commit_count": 48, "repo_created_at": "2024-02-18T20:39:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "97f0b6dccfe...
889750c1-b595-4c18-833f-aacdf3399ae1
Yashika118/CPP-FOLDER
TREES/BINARY_TREES/B_T_2.cpp
#include <iostream> #include <queue> using namespace std; class node { public: int data; node *left; node *right; node(int d) { data = d; left = NULL; right = NULL; } }; node *buildtree() { int data; cin >> data; // 8 if (data == -1) { return NUL...
ALGO
0.999945
4.610643
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2024-08-18T12:02: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": "bbd44dba09...