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
383ee012-5c82-4512-a0ab-75db058df72a
bioyoshoo/atcoder
Boot-camp/Hard-lap2/27.cpp
#include <bits/stdc++.h> using namespace std; using Graph = vector<vector<int>>; vector<int> ans; vector<int> X; void DFS(const Graph &G, int v, int p = -1) { if (p == -1) ans[v] = X[v]; else ans[v] = ans[p] + X[v]; for (auto next_v: G[v]) { if (next_v == p) continue; DFS(G, next_v, v); ...
ALGO
0.999982
4.981627
{ "github_metadata": { "branch": "master", "commit_count": 176, "repo_created_at": "2022-02-22T06:01:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a9eaaead...
5cef5292-8e0c-4955-ac9b-2038019b9239
sksanket165/DYPCOE
SECO2425C073 (3rd Sem)/CG/Practical4.cpp
#include <iostream> #include <graphics.h> #include <conio.h> void drawCircle(int x, int y, int rad) { circle(75 + x, 75 + y, rad); } void drawCross(int x, int y) { line(50 + x, 50 + y, 100 + x, 100 + y); line(100 + x, 50 + y, 50 + x, 100 + y); } void drawBoard() { line(150, 0, 150, 400); line(300...
ALGO
0.998368
6.856826
{ "github_metadata": { "branch": "main", "commit_count": 85, "repo_created_at": "2024-12-21T12:04: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": "6e878e7f798...
7fb4495c-c16e-447e-bc7a-57e52516fcf5
TahshinSharon/Usefull-Algorithm_Solved-Code
Fenwicktree/Fenwicktree.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define md 1000007 int a[md + 1]; int arr[md + 1]; ll n; struct Fenwicktree { ll query(ll idx) { ll sum = 0; while (idx > 0) { sum += a[idx]; idx -= (idx & -idx); } return sum; } void update(ll idx, ll v...
ALGO
0.999926
4.117144
{ "github_metadata": { "branch": "main", "commit_count": 83, "repo_created_at": "2021-03-06T17:52:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a2562f772fa...
09711f8f-132a-4345-802f-6fe08cacb2f0
VladimirSuvorov/corners-devils-and-heroes
src/Controllers/AIPlayer/AI/DescisionMaking/AlternativeSelector.hpp
#pragma once #include <vector> #include "../../../../Models/GameRules.hpp" #include "../Pathfinding/BoardGraph.hpp" #include "../AIPawnProxy.hpp" #include "../AIPawnActionAlternative.hpp" inline float_t Distance(board_cell from, board_cell to) {//TODO: SqrDistance return (~(int16_t(to.x()) - int16_t(from.x())) + (~(...
ALGO
0.995027
4.597609
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2022-05-03T20:38: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": "304577f19f...
7912acc1-b6ab-4dc1-928b-1296b8986414
wawzysys/Algorithm
2024bishi/8.28华子/1.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; template <typename T> vector<T> input() { vector<T> a; T s; while (cin >> s) { a.push_back(s); if (cin.get() != ' ') break; } return a; } void solve() { vector<int> nums = input<int>()...
ALGO
0.999988
4.583461
{ "github_metadata": { "branch": "main", "commit_count": 63, "repo_created_at": "2024-01-18T07:02:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "226eb17adc2...
d5cef24b-d4fc-47f6-85fa-523afc3032a3
savinbog/KR_PR_3_SAVIN
Project67/MyForm.cpp
#include "MyForm.h" #include "SPAVKA.h" #include<vector> #include<fstream> #include <numeric> #include<string> #include<algorithm> #include<cmath> // Пространства имен необходимых для интерфейса using namespace System; using namespace System::Windows::Forms; // Векторы для хранения значений X и Y std::vector<doubl...
ALGO
0.98546
3.254226
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-01-16T23:25: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": "2a5bacb94112...
fff37e60-7244-42f8-ac94-9b90e9c5f3e6
chaoswong1981/osgModeling
src/osgModeling/Utilities.cpp
/* -*-c++-*- osgModeling - Copyright (C) 2008 <NAME> <<EMAIL>> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version...
TOOL
0.995629
4.609581
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2013-12-04T03:14:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 28, "forks": 14, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "88443de6...
5dcb70d6-801a-4034-ab9d-6b47a1334dfb
DawnteaStudio/TIL
coding-test/Baekjoon/26000/26975.cpp
#include <iostream> #include <vector> #include <map> #define fast ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); using namespace std; long long cnt, res; int main() { fast; int n, res_v; cin >> n; long long tmp; vector<pair<long long, long long> > vec; map<long long, long long> t...
ALGO
0.999983
3.711407
{ "github_metadata": { "branch": "main", "commit_count": 1633, "repo_created_at": "2023-04-27T15:22: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": "085190f36...
566b53fc-9c67-48b2-ac1c-c5d977341b2c
bizkut/warz-client
External/NaturalMotion/morpheme/SDK/core/include/morpheme/Nodes/mrNodeBlendN.h
// Copyright (c) 2010 NaturalMotion. All Rights Reserved. // Not to be copied, adapted, modified, used, distributed, sold, // licensed or commercially exploited in any manner without the // written consent of NaturalMotion. // // All non public elements of this software are the confidential // information of NaturalMo...
ALGO
0.985895
6.811339
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2015-12-20T14:48:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 20, "forks": 17, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "7dddf0ed...
8868882f-6435-496b-a901-83a669a0ae4c
bensapp/Stretchable-Models-for-Motion-Parsing
cps/thirdparty/ncut_multiscale_1_5/mex_neighborW.cpp
//function W = mex_neighborW(p,q,connectivity); // connectivity = 4|8 // <NAME>, 04-Aug-2008 20:46:38 -- DO NOT DISTRIBUTE # include "math.h" # include "mex.h" void computeW_4(mwIndex *ir, mwIndex *jc, int p,int q) { int i,j,k; k = 0; int ind_j = 0; for (j=0;j<q;j++) for (i=0;i<p;i++) { ...
ALGO
0.996878
3.710737
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2011-10-05T03:45:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 14, "forks": 13, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ed94872...
252def88-8496-4207-b5d3-2d2d2add756c
ferraiuj/Visual-Studio-2015
HelloWorld/HelloWorld/Source.cpp
#include <iostream> #include <string> #include <list> using namespace std; int main() { string rom; int list[20]; //list[0] = 'x'; int value= 0; //int I = 1; //int V = 5; //int X = 10; // int L = 50; //int C = 100; //int D = 500; //int M = 1000; int i; int entValue; //char* b = &rom[1]; //int ja; /...
ALGO
0.99845
3.599052
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-08-08T11:57: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": "085ffd1b14...
c7f7741f-86cf-40c6-aeeb-3412f908fbfa
marcinwol/mwimagefinder
ext/filesignature.h
#ifndef FILESIGNATURE_H #define FILESIGNATURE_H #include <iostream> #include <fstream> #include <set> #include <vector> #include <sstream> #include <iomanip> #include <string.h> #include <errno.h> #define IMAGE_ENUM(DO) \ DO(UNKOWN) \ DO(ASCII) \ DO(BMP) \ DO(CHM) \ DO(DB) \ DO(DIB) \ DO...
TOOL
0.933159
5.658011
{ "github_metadata": { "branch": "master", "commit_count": 165, "repo_created_at": "2015-02-05T09:32:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "173ae587...
ea1b62b5-4def-4154-ba80-4a928e39d6ba
ishandutta2007/codeforces-d
deemo/normal/271/B.cpp
#include<iostream> #include<cmath> #include<algorithm> #include<set> using namespace std; typedef long long ll; const int MAX = 3e5; const int MAXN = 500 + 30; int n, m; int c[MAXN][MAXN]; bool p[MAX + 20]; set<int> st; int main(){ ios::sync_with_stdio(false); cin.tie(0); for (int i = 2; i < MAX; i++){ if (!p...
ALGO
0.999938
3.594272
{ "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": "d4839814aead...
ce166e1a-8b97-487c-a06d-cb2a4c45d51c
ishandutta2007/codeforces-o
okwedook/normal/964/B.cpp
#pragma GCC optimize("O3","unroll-loops") #define FILES freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout) #define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define FIXED cout << fixed << setprecision(20) #define pb push_back #define pf pop_front #define popb pop_back #define popf pop...
ALGO
0.99967
3.589729
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:45: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": "9ad28121aea9...
186be6fc-3b1b-46c8-8d1f-f29dd5ebe570
arpit353/DSA-Codes
String/11. Find all Possible Palindromic Substrings in a String.cpp
#include <iostream> #include <unordered_set> using namespace std; // expand in both directions of low and high to find all palindromes void expand(string str, int low, int high, auto &set) { // run till str[low.high] is a palindrome while (low >= 0 && high < str.length() && str[low] == str[high]) { // push a...
ALGO
0.999844
6.057344
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2018-01-01T04:30:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fc00dc594d...
f449b9bf-9608-42b6-b00f-53bf222bb735
mr-programming/HW10
bintreenode.h
#pragma once // Name: <NAME> // Date: 4-26-21 // Description: Binary tree node #include <iostream> using namespace std; template <class T> class Binary_Tree_Node { private: T data_field; Binary_Tree_Node* left_field; Binary_Tree_Node* right_field; public: //constructor Binary_Tree_Node(const T& initData = T(), ...
ALGO
0.996913
4.653796
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2021-05-04T19:40:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a6ae035db...
9072f559-47fd-45e1-bf64-a24fa5506ea7
tcbrindle/NanoRange
include/nanorange/algorithm/minmax_element.hpp
// nanorange/algorithm/minmax_element.hpp // // Copyright (c) 2018 <NAME> (<EMAIL> at gmail dot com) // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // Uses code from CMCSTL2 // Copyright <NAME> 2015 #ifndef NANOR...
ALGO
0.998408
7.481486
{ "github_metadata": { "branch": "master", "commit_count": 772, "repo_created_at": "2017-10-09T17:40:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 364, "forks": 28, "issues": 10, "pull_requests": 8 }, "file_meta": { "content_id": "ac94...
22338d8f-a97c-4be8-8b02-67f6d7c509eb
nhneptune/LapTrinhNangCao---INT2215
BT01/b26.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; int arr[n]; for (int i = 0; i < n; i++){ cin >> arr[i]; } int max = arr[0]; int min = arr[0]; for (int i = 0; i < n; i++){ if (arr[i] > max){ max = arr[i]; } if (arr[i] <...
ALGO
0.999606
3.896549
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2023-02-22T09:07: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": "25d2780a3f9...
06ddff6d-9a14-4e11-ae40-99b11892f03c
mkltaneja/Leetcode
1770. Maximum Score from Performing Multiplication Operations.cpp
// APPROACH 1 (Memoization) int dfs(int i, int k, int n, int m, vector<int> &nums, vector<int> &mult, vector<vector<int>> &dp) { if (k == m) return 0; if (dp[i][k] != -1) return dp[i][k]; int j = (n - 1) - (k - i); return dp[i][k] = max(nums[i] * mult[k] + dfs(i + 1, k + 1, n, m, nums...
ALGO
0.99999
5.995864
{ "github_metadata": { "branch": "master", "commit_count": 2991, "repo_created_at": "2020-04-15T14:34: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": "18b5236...
28ab48be-7270-4990-8997-d48316a54336
ishandutta2007/codeforces-o
olphe/normal/1368/B.cpp
#include "iostream" #include "climits" #include "list" #include "queue" #include "stack" #include "set" #include "functional" #include "algorithm" #include "string" #include "map" #include "unordered_map" #include "unordered_set" #include "iomanip" #include "cmath" #include "random" #include "bitset" #include "cstdio" ...
ALGO
0.999868
3.852533
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:45: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": "93929eeec415...
7469402b-d04f-47ab-a89d-9d0170605499
dilshan-n-wickramarachchi/OutdoorGPSRobot
Final_Code.ino
#include <compass.h> #include "Ublox.h" #define SERIAL_BAUD 9600 #define GPS_BAUD 9600 #define N_FLOATS 2 #include <Wire.h> #include "compass.h" //GPS Ublox M8_Gps; float gpsArray[N_FLOATS] = {0, 0}; // Latitude - Longitude //Motor Drive //Front wheels const int f_pwm1_L = 11 ; //initializing pin 6 as pwm4 11 ...
ALGO
0.947908
4.545608
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-12-07T17:06: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": "9d3acd911b...
98b014b3-a2be-4aa0-b10b-cc93f70b5426
dnr2/maratona
Livearchive ACM ICPC/4868 - Palindrometer.cpp
//https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2869 //#tag string //#tag construction construcao //#sol try all posible cases, as you can see the addition in the worst case wont be greater than 100000 because //the right side will "overflow" and become zero, an...
ALGO
0.999764
3.456542
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2013-08-18T19:15:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 22, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "037b2639...
d9d20096-1879-40b2-b45f-a1da5b121791
kunidesuyo/competitive-programming
ABC/251~300/259/B.cpp
#include <bits/stdc++.h> #include <cmath> #define all(x) (x).begin(),(x).end() using ll = long long; const ll INF = 1LL<<60; const int inf = INT_MAX / 2; using namespace std; int main() { double a, b, d; cin >> a >> b >> d; if(a == 0 && b == 0) { cout << 0 << " " << 0 << endl; return 0; } double r...
ALGO
0.999752
4.3663
{ "github_metadata": { "branch": "master", "commit_count": 332, "repo_created_at": "2021-05-23T09:30: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": "4879e24f...
55dc80bc-b143-4fa4-8b4e-7e86ed5f0fdd
AfsharaTasnimShoptorshi/DSA
04_Linked_List_Basics/InsertLinkedList.cpp
#include <iostream> using namespace std; // Node structure struct Node { int data; Node* next; }; // Function to create a new node Node* createNode(int data) { Node* newNode = new Node(); // Allocate memory for new node newNode->data = data; // Assign data to the node newNode->next = null...
ALGO
0.999568
6.475358
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-07-10T12:53: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": "a6b866773bc6...
74b69d25-ba47-41a3-8725-e115685eb22f
Kid-Chang/algorithm-learn
03_lecture_0x03/workbook/boj2577.cpp
#include <iostream> #include <vector> #include <bits/stdc++.h> #include <stdlib.h> using namespace std; // 숫자의 개수 // 조건 // 자연수 A, B, C가 주어질 때 A × B × C를 계산한 결과에 0부터 9까지 각각의 숫자가 몇 번씩 쓰였는지를 구하라 // 입력 // 첫째 줄에 A, 둘째 줄에 B, 셋째 줄에 C가 주어진다. A, B, C는 모두 100보다 크거나 같고, 1,000보다 작은 자연수이다. // 출력 // 첫째 줄에는 결과에 0 이 몇 번 쓰였는지 출...
ALGO
0.999531
4.448744
{ "github_metadata": { "branch": "main", "commit_count": 180, "repo_created_at": "2023-07-17T10:16: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": "e72588c35b...
0bcd3a5b-06ac-4f45-911c-24accd0bab8f
hs5530hs/EGSfM
ext/openMVG/software/SfM/main_ComputeStructureFromKnownPoses.cpp
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library. // Copyright (c) 2015 <NAME>. // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. #include...
TOOL
0.964814
6.783132
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-05-19T03:48:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 18, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0f497664d...
b124f03e-43d5-408e-9428-0f291aae88a8
ishandutta2007/codeforces-i
intothenight/normal/1338/A.cpp
#include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> #include<ext/rope> using namespace std; using namespace chrono; using namespace __gnu_pbds; using namespace __gnu_cxx; mt19937 rng(high_resolution_clock::now().time_since_epoch().count()); mt19937_64 rngll(high_resolutio...
ALGO
0.999433
4.437272
{ "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": "d14c27adc3f1...
aa556002-ed28-4440-8882-7ead74b70744
liuyihao18/LeetCode
LeetCode/15_三数之和.cpp
// 15_三数之和.cpp #include "custom.h" ustd class Solution { public: vector<vector<int>> threeSum(vector<int>& nums) { size_t n = nums.size(); sort(nums.begin(), nums.end()); vector<vector<int>> ans; for (size_t i = 0; i + 2 < n; i++) { if (i > 0 && nums[i] == nums[i - 1]) {...
ALGO
0.99998
5.837042
{ "github_metadata": { "branch": "master", "commit_count": 849, "repo_created_at": "2021-09-17T08:40:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4dc75933...
e18fea2b-bf57-48f7-a988-533db3cd53d8
techiehere08/practice
practice/CSES/SS/brute.cpp
#include <bits/stdc++.h> using namespace std; template<typename T> struct Z_p{ using Type = typename decay<decltype(T::value)>::type; static vector<Type> mod_inv; constexpr Z_p(): value(){ } template<typename U> Z_p(const U &x){ value = normalize(x); } template<typename U> static Type normalize(const U &x)...
ALGO
0.999971
4.905721
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2020-11-06T16:37: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": "19fb152979e6...
bba874d2-76ee-4f53-9676-329292d8625c
itish-agarwal/CP-submissions
CodeChef/C++17/ITGUY44/40866880.cpp
#include <bits/stdc++.h> using namespace std; ostream& operator << (ostream& stream, const vector<int>& v) { for(int x : v) { stream << x << " "; } return stream; } //ostream& operator << (ostream& stream, const int *a) { //for(int i = 0; i < n; i++) { //stream << *(a + i) << " "; //} //return ...
ALGO
0.999868
4.395837
{ "github_metadata": { "branch": "main", "commit_count": 2847, "repo_created_at": "2022-06-04T09:47: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": "70aac29d9...
d9201215-6f74-4b4a-b155-961bc0ad45ba
optimusProgrammator/Learning-Cplusplus
prime_or_not.cpp
#include <map> #include <set> #include <list> #include <cmath> #include <ctime> #include <deque> #include <queue> #include <stack> #include <string> #include <bitset> #include <cstdio> #include <limits> #include <vector> #include <climits> #include <cstring> #include <cstdlib> #include <fstream> #include <numeric> #inc...
ALGO
0.999394
4.291579
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2024-10-02T17:37: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": "393df0ef65c...
f386e133-2e89-45e7-9b49-e5239183305c
kei1107/algorithm
problems/yukicoder/No0102.cpp
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int INF = 1e9; const ll LINF = 1e18; template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; } template<c...
ALGO
0.999196
3.770386
{ "github_metadata": { "branch": "master", "commit_count": 488, "repo_created_at": "2017-10-06T09:12:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8486f411...
b1a97385-8b84-4a5e-8f0c-a7c855837007
DenialRiver1434/USACO-Study
2-CF/1555B.cpp
#include <bits/stdc++.h> using namespace std; const int NO_WORK = 1e9; void testcase () { int W, H; cin >> W >> H; // the room int x1, x2, y1, y2; cin >> x1 >> y1 >> x2 >> y2; // the first table int w, h; cin >> w >> h; // the second table int moveright, moveleft, moveup, movedown; if ((w + x2 - ...
ALGO
0.999894
4.148295
{ "github_metadata": { "branch": "main", "commit_count": 276, "repo_created_at": "2021-12-13T00:32:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "54c0f8e2f7...
0daea146-b103-4062-b9b4-a7ead80fd84c
thyagostall/competitive
lib/sum_segment_tree.cpp
#include <vector> #include <limits> #include <algorithm> class SumSegmentTree { public: SumSegmentTree(std::vector<int> &input): size(input.size()) { this->current = 0; this->input = input; low.assign(4 * size, 0); high.assign(4 * size, 0); sumv.assign(4 * size,...
ALGO
0.999353
6.783758
{ "github_metadata": { "branch": "master", "commit_count": 182, "repo_created_at": "2017-02-13T04:14: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": "e04d7003...
f76732b8-18a7-42bd-a891-96f049290c9b
ApurvSardana/LeetCode
133-Clone-Graph.cpp
/* // Definition for a Node. class Node { public: int val; vector<Node*> neighbors; Node() { val = 0; neighbors = vector<Node*>(); } Node(int _val) { val = _val; neighbors = vector<Node*>(); } Node(int _val, vector<Node*> _neighbors) { val = _val; ...
ALGO
0.999983
6.150916
{ "github_metadata": { "branch": "main", "commit_count": 664, "repo_created_at": "2024-09-22T14:09: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": "99eaba192a...
4d47cb93-8dc4-4b8c-b4f2-63dd015671c4
msahni825/data-structures-algorithms
LinkedList/LL1.cpp
/*Write code to remove duplicates from an unsorted linked list.*/ #include<iostream> #include<bits/stdc++.h> using namespace std; struct Node{ int data; Node *next; }; /*1 2 3 1 2 2*/ void printList(Node *head){ Node *ptr=head; while(ptr!=NULL){ cout<<ptr->data<<" "; ptr=ptr->next; } cout<<endl; } /*FOLLOW U...
ALGO
0.999925
4.789859
{ "github_metadata": { "branch": "master", "commit_count": 374, "repo_created_at": "2021-03-22T12:24:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "93d49cd3...
11c84bad-84c7-44d2-b393-eb38df5f5077
ishandutta2007/codeforces-k
krk/normal/1437/C.cpp
#include <bits/stdc++.h> using namespace std; const int Maxn = 205; const int Maxm = 505; const int Inf = 1000000000; int q; int n; int t[Maxn]; int dp[Maxn][Maxm]; int main() { scanf("%d", &q); while (q--) { scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d", &t[i]); ...
ALGO
0.999952
3.822229
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:06:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c27ee123e1fd...
1ebcd3c7-2972-4b9c-b5a1-137945a94269
shivamkasat/Placement_Preparation_GFG
validIpAddress.cpp
#include <bits/stdc++.h> using namespace std; bool isValid(string ip) { int n = ip.length(); int i = 0; int j = 0; while (i < n) { int j = i; int num = 0; while (j < n && ip[j] != '.') { num = num * 10 + (ip[j] - '0'); j++; } if (num < 0 || num > 255) { return false; ...
ALGO
0.997014
4.299226
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2019-12-07T11:11: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": "de7b6836c...
2752ddfa-13a0-49a5-8ca2-b51947775df1
vavraj/BinaryBattles
DP/longestIncreasingSub.cpp
#include<iostream> using namespace std; // recursion class Solution { public: int solve(int n,int a[],int currIndex,int prevIndex){ if(currIndex==n) return 0; int take=0; if(prevIndex==-1 || a[prevIndex]<a[currIndex]) take=1...
ALGO
0.999986
5.149756
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2023-08-01T16:12: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": "53da42e57d4...
88febd71-f9ed-457c-bc0b-cc57544ff74e
SuguruChhaya/Competitive-Programming
C++/usaco guide/milkpails.cpp
#include <iostream> #include <deque> #include <vector> using namespace std; int main(){ freopen("pails.in", "r", stdin); freopen("pails.out", "w", stdout); //*How many can fit type thing huh? //*Really, the order doesn't matter. //*We could either add more to the current or move on to the next o...
ALGO
0.99996
3.140538
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2021-03-26T22:15: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": "7b19a5bfdabd...
964d998f-f5ca-4fe1-9413-a68ae17c8917
Coloquinte/PlaceRoute
src/place_global/net_model.cpp
#include "place_global/net_model.hpp" #include <eigen3/Eigen/Dense> #include <eigen3/Eigen/IterativeLinearSolvers> #include <eigen3/Eigen/Sparse> #include <limits> namespace coloquinte { NetModel::Parameters::Parameters() { netModel = NetModelOption::BoundToBound; approximationDistance = 10.0; penaltyCutoffDist...
ALGO
0.999459
6.572909
{ "github_metadata": { "branch": "main", "commit_count": 389, "repo_created_at": "2021-12-30T17:03:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 14, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d0b762f9b...
b95ad544-840c-4358-bd6b-bc3201fc65e1
wsyunine/ACM
2025/001/P10505.cpp
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <mutex> #include <queue> #include <set> #include <stack> #include <thread> #include <vector> using namespace ...
ALGO
0.999969
3.431422
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2025-01-13T06:58:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "19bfdd0fb...
c78ef38b-b5d1-4de1-b360-2f40dbd5dc33
h114mx001/Competitive-Coding
Library/bigNum.h
#include <bits/stdc++.h> using namespace std; //addBigNum string addBigNum(string a, string b){ int sum, carry = 0; string c = ""; int digit; while (a.length() < b.length()) a = '0' + a; while (a.length() > b.length()) b = '0' + b; for (int i = a.length() - 1; i >= 0; i--){ sum = a[i] - ...
ALGO
0.999735
4.042298
{ "github_metadata": { "branch": "master", "commit_count": 54, "repo_created_at": "2020-08-24T16:25: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": "446f31a15...
9e1937db-855d-49b0-8ab9-a4bf3b8a9a19
sy117/Useful-Algorithms
Data Structures/Disjoint Set/DSUWithMergeBySize.cpp
#include <bits/stdc++.h> using namespace std; /* For merge and findParent method Time Complexity:- O(logN) O(4 * aplha) with path compression Space Complexity:- O(N) */ class DisjointSet { private: vector<int> parent; vector<int> size; public: DisjointSet(int n) { ...
ALGO
0.999935
5.372126
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2018-01-17T05:16:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "23ec16226...
a649dc6b-3bf3-4539-a68b-3e72b6fcc769
friedeggs01/Applied-Algorithms
Day13/3.cpp
#include <bits/stdc++.h> using namespace std; const int MAXN = 10005; vector<int> graph[MAXN]; int matchR[MAXN]; bool visited[MAXN]; bool dfs(int task) { visited[task] = true; for (int i = 0; i < graph[task].size(); i++) { int staff = graph[task][i]; if (matchR[staff] == -1 || (!visited[matc...
ALGO
0.999985
4.66408
{ "github_metadata": { "branch": "main", "commit_count": 90, "repo_created_at": "2023-09-20T08:00:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e6b7e471e54...
b8a27c52-4e49-488d-902f-b17d807bc2cd
kas1e/Odyssey
odyssey-r155188-1.23/BAL/Network/WebCore/WK/BCMIMESniffingWK.cpp
/* Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) an...
TOOL
0.93568
5.511549
{ "github_metadata": { "branch": "master", "commit_count": 66, "repo_created_at": "2020-02-28T17:48:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 8, "issues": 18, "pull_requests": 4 }, "file_meta": { "content_id": "3c38a35e...
cd0efb31-6ded-4626-81e4-4a0d22e9e185
tkmrqq/LabsCPP
codewars.cpp
#include <iostream> #include <sstream> #include <vector> #include <algorithm> bool is_isogram(std::string str) { for (char &i : str) { i = (char)tolower(i); } for (size_t i = 0; i < str.size() - 1; ++i) { for (size_t j = i + 1; j < str.size(); ++j) { if (str[i] == str[j]) return false; ...
ALGO
0.999787
4.620821
{ "github_metadata": { "branch": "main", "commit_count": 26, "repo_created_at": "2023-09-08T11:16:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b59ed089997...
e3396b38-9ba2-4745-842a-c35638fe032d
joseph-amirth/cp-library
trees/dynamic_path_query/general.hpp
#pragma once #include "../../algebra/concepts.hpp" #include "../../range_query/concepts.hpp" #include "../heavy_light_decomposition.hpp" #include "dynamic_path_query.hpp" #include <iterator> namespace trees { template <typename Graph, range_query::RangeQuery Rq> requires(!algebra::Commutative<typename Rq::groupo...
ALGO
0.998551
6.961272
{ "github_metadata": { "branch": "master", "commit_count": 127, "repo_created_at": "2021-01-21T12:55:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a264a548...
fb92c09e-81e6-4c01-850b-40754b120a87
daman94/Coding-Problems
Trees/Binary Trees/22-Build Tree from preorder inorder.cpp
// // main.cpp // Array // // Created by <NAME> on 09/06/15. // Copyright (c) 2015 <NAME>. All rights reserved. // #include <iostream> #include <queue> using namespace std; struct BTNode { int data; struct BTNode* left; struct BTNode* right; }; struct BTNode* newNode(int data) { struct BTNode* ne...
ALGO
0.999631
4.835948
{ "github_metadata": { "branch": "master", "commit_count": 108, "repo_created_at": "2015-02-05T14:27: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": "c4c9b329...
f80aefe5-993f-4e96-a25a-05a974db0b1b
strengthen/LeetCode
C++/55.cpp
__________________________________________________________________________________________________ 4ms class Solution { public: bool canJump(vector<int>& nums) { int maxind=0,n=nums.size(); for(int i=0;i<n;i++){ //int&& currJump=i+nums[i]; if(maxind<i)break; maxin...
ALGO
0.999993
5.729729
{ "github_metadata": { "branch": "master", "commit_count": 518, "repo_created_at": "2018-11-03T06:47:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 883, "forks": 297, "issues": 19, "pull_requests": 0 }, "file_meta": { "content_id": "e30...
7ed44e5b-617e-4dc0-97f0-8a6d7b360d09
NK-Nikunj/Kokkos-Resilient-Spaces
applications/resilient/ABFT3D.cpp
#include <Kokkos_Core.hpp> #include <iostream> #include <resilient_spaces/resilient_spaces.hpp> #include <boost/program_options.hpp> #define PI 3.1415926535897932384 typedef int int_t; //#include "Tile3D.h" KOKKOS_FUNCTION double left_flux(double left, double self, double cfl) { return -cfl * left + cfl * self...
ALGO
0.974963
5.439931
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2021-07-12T07:53: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": "d3e25aff2448...
715d7e8f-0832-43c6-81c3-e9f6d17af932
gahogg/Leetcode-Solutions
Jump Game II - Leetcode 45/Jump Game II - Leetcode 45.cpp
// Brute Force #include <vector> #include <algorithm> #include <climits> class Solution { public: int jump(std::vector<int>& nums) { int n = nums.size(); int smallest = INT_MAX; backtrack(0, 0, nums, n, smallest); return smallest; } private: void backtrack(int i, int jumps...
ALGO
0.999999
6.173066
{ "github_metadata": { "branch": "main", "commit_count": 241, "repo_created_at": "2024-05-01T13:41:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 750, "forks": 180, "issues": 6, "pull_requests": 14 }, "file_meta": { "content_id": "0059a...
3213d729-61ff-49a4-861e-1055822ad1c0
arjunnprashar/PracticeQuestions
DS/STACK/Stack_pop.cpp
#include<stdio.h> #include<stdlib.h> struct stack{ int size; int top; int *array; }; void Traversal(struct stack *stonk){ system("cls"); printf("The stack is -\n"); for (int i = 0; i <= stonk -> top; i++) { printf("%d\n", stonk -> array[i]); } printf("\n"); } struct s...
ALGO
0.998183
4.030285
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2023-01-23T05:07: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": "f7cb7e8d5a...
78b700cc-7909-4341-9f72-918e4f1dca2f
loal123/CP
tlx/TLX_Latihan_1_PJJ_OSN_Informatika_2024/D_Pedang.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define pii pair<int, int> #define pll pair<ll, ll> #define vi vector<int> #define vl vector<ll> #define fi first #define se second #define pb push_back #define mp make_pair #define all(v) v.begin(), v.end() #define SZ(x) ((int)...
ALGO
0.999974
4.096037
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2023-12-23T13:34:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e46f727c404...
2f55af36-046c-4db0-87e5-0072f482ce4b
nakevin96/Algorithm_assignment
Merge.cpp
// 2015005169_ÃÖÀ±¼®_11802 #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> void mergeD(int* numPtr, int p, int r, int nk); void merge(int* numPtr, int p, int q, int r, int nk); int main() { int i; int numOfKeys; scanf("%d", &numOfKeys); int* numPtr = (int*)malloc(sizeof(int) * numOfKeys); ...
ALGO
0.999997
4.559059
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2022-06-24T12:36: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": "d545f85d77...
2d05fece-9315-47ac-a085-59a3534a6682
X-688/Arduino_Lab
car1.ino
//2、跟着最近的东西的小车 //始终朝着离自己最近的东西前进,舵机控制超声波模块左右摇摆,选取距离最近的角度,调整左右各2个轮子角度并前进,其中,调参可以自动进行 #include<Servo.h> #include "Microduino_MotorPlus.h" #include <Microduino_Ultrasonic.h> Ultrasonic Ultrasonic1(ULTRASONIC_ADDR_1);//将超声波实例化 uint16_t Distance; int turntime = 100; int beta = 100; int dis_min =1000;//初始值1000mm,即1m,即最大测距距...
ALGO
0.960849
4.469838
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-04-22T08:25:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bb0e011e3bb5...
e1990c22-6ef6-4ad4-8dad-7405a8609c8f
JIGI1011/CS201_PROJECT
Naive.cpp
// Implementation of Construction of Suffix Tree using Naive Approach // Time complexity: O(n^2) // Space complexity: O(n^2) // Recommended size of input string: n <= 10^4 // C++ Libraries #include <cstdlib> #include <iostream> #include <vector> #include <cstring> #include <fstream> #include <chrono> ...
ALGO
0.975709
4.34723
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2024-10-31T19:50:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bba22a8e455...
3e331d5d-11be-4b43-a6dd-a6258e87b3a2
superhobbit/leetCode
13_Roman_to_Integer.cpp
Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 答案again。。 int romanToInt(string s) { int sum = 0; if (s.find("IV") != -1) sum -= 2; if (s.find("IX") != -1) sum -= 2; if (s.find("XL") != -1) sum -= 20; if (s.find("XC") != -1) sum -= 20; ...
ALGO
0.999252
4.606728
{ "github_metadata": { "branch": "master", "commit_count": 81, "repo_created_at": "2017-09-10T18:26:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "807a14cb2...
98fe83bb-2a13-4e42-b0de-4258336de06a
ElAdriel21/Frogger
Frogger/Frogger.cpp
#include<iostream> #include<conio.h> #include<windows.h> #include "vehiculo.h" #include "automovil.h" #include "camioneta.h" #include "camion.h" void gotoxy(int x, int y) { COORD coord; coord.X = x; coord.Y = y; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord); } class Rana { private:...
ALGO
0.988655
4.099891
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2024-02-11T20:15: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": "8070d1cc0...
dd542e3c-7fb8-4812-b285-b54c356753e0
arbruijn/d3editmod
linux/lnxlib.cpp
#include <string.h> #include <stdarg.h> #include <stdio.h> int stricmp(const char *a, const char *b) { return strcasecmp(a, b); } int strnicmp(const char *a, const char *b, int n) { return strncasecmp(a, b, n); } void ddio_InternalKeyClose() {} void ddio_CopyFileTime(char*, char const*) {} void ddio_SplitPath(...
TOOL
0.919945
4.651799
{ "github_metadata": { "branch": "master", "commit_count": 40, "repo_created_at": "2022-07-07T22:04: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": "06741ea39...
d22f12e1-c193-439a-a202-121b69eaea59
j-nary/my_BOJ
1920.cpp
#include <iostream> #include <algorithm> using namespace std; int BinarySearch(int *a, const int x, const int left, const int right) { if (left <= right) { int middle = (left + right) / 2; if (x < a[middle]) return BinarySearch(a, x, left, middle-1); else if (x > a[middle]) ...
ALGO
0.999985
4.094301
{ "github_metadata": { "branch": "main", "commit_count": 291, "repo_created_at": "2022-07-10T14:46: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": "3e288fb193...
3d5fb88a-f713-4a8f-9484-07ac156658b7
tranvandat05032002/C-C-DoThi
docfilekiemtra/contest2_3h30/dslkdonVF.cpp
#include<bits/stdc++.h> using namespace std; struct Node{ string name; int price; Node* next; }; typedef struct Node* node; node makeNode(string name, int price){ node tmp = new Node(); tmp -> name = name; tmp -> price = price; tmp -> next = nullptr; return tmp; } int size(node a){ int count = 0; while(a != n...
ALGO
0.990472
3.825017
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-03-12T20:44: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": "822d2d852271...
5a068b08-afbf-4ba3-9b75-fd6668fe1258
encrypted-def/basic-algo-lecture
0x13/solutions/3151.cpp
// Authored by : SciEm // Co-authored by : - // http://boj.kr/b830d64c3ecd434ba3e554cc709dba3e #include <bits/stdc++.h> using namespace std; int n; int a[10002]; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); long long ans = 0; for ...
ALGO
0.99992
3.998414
{ "github_metadata": { "branch": "master", "commit_count": 1862, "repo_created_at": "2020-02-19T10:47:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2560, "forks": 601, "issues": 1, "pull_requests": 4 }, "file_meta": { "content_id": "b4...
145bd0c4-866f-4ba6-9d8d-3ac59ba937ad
Alex7Li/ProgrammingContests
Codeforces/E_PermutationForces_II.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for(int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; ll MOD = 998244353; int main() { int n_tests; cin >> n_tests; for(int cur_te...
ALGO
0.999632
5.197355
{ "github_metadata": { "branch": "master", "commit_count": 84, "repo_created_at": "2017-08-14T19:06:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5b31eb27c...
a12427e0-5526-4665-9656-3409199d9c08
shubhamnegi9/My-GFG-Solutions
Difficulty: Easy/Number of occurrence/number-of-occurrence.cpp
class Solution { public: // Brute Force Approach // T.C. = O(n) // S.C. = O(1) int countFreq1(vector<int>& arr, int target) { int count = 0; for(int& ele: arr) { if(ele == target) count++; } return count; } int findLowerBound(vec...
ALGO
0.999949
6.278407
{ "github_metadata": { "branch": "main", "commit_count": 286, "repo_created_at": "2023-12-17T11:45: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": "2c7821b3b0...
35707e90-8fb7-44c6-a4cd-acd90a825073
pafin10/CompetitiveProgrammingExercises
year_2_contests/codeforces_974/4Reconstruction.cpp
#include <iostream> #include <vector> #include <string> #include <sstream> #include <fstream> #include <string> #include <algorithm> #include <cmath> #include <map> #include <bitset> #include <numeric> #include <set> #include <queue> #include <unordered_map> #include <cassert> #include <array> using namespace std; #d...
ALGO
0.999836
3.923206
{ "github_metadata": { "branch": "main", "commit_count": 31, "repo_created_at": "2023-09-09T12:04: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": "fcb603a2f37...
8fa470b0-9cde-4234-a919-a7d4932cda4e
JaydeepGodbole/cses
palindrome_reorder.cpp
#include<bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int c[26] = {0}; for(auto &ch : s) { c[ch - 'A']++; } char oddoneout = 'a'; bool one_odd = false; for(int i = 0; i < 26; i++) { if(c[i]%2 == 1) { if(!o...
ALGO
0.999998
3.722167
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2021-07-16T15:43: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": "6f9819820d...
805d4ba1-56a5-4187-834a-0ce93eb94ba8
ggutierrez/cprelmaster
bdddomain/rel-impl.hh
#ifndef __CPREL_BDDDOMAIN_REL_IMPL_HH__ #define __CPREL_BDDDOMAIN_REL_IMPL_HH__ #include <bdddomain/manager.hh> #include <bdddomain/tuple.hh> #include <bdddomain/exception.hh> #include <bdddomain/perm-descriptor.hh> #include <bdddomain/bdd.hh> namespace MPG { namespace VarImpl { /** * \defgroup DomRepr Doma...
TOOL
0.954998
7.462811
{ "github_metadata": { "branch": "master", "commit_count": 335, "repo_created_at": "2011-06-16T18:57:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ba3f2984...
39951236-6b4a-4340-9aed-6b393ec6daae
WhyKash01/codeForces
B_Square_or_Not.cpp
#include <bits/stdc++.h> #define ll long long #define LCM(a, b) (a) * ((b) / std::__gcd(a, b)); using namespace std; ll M = 1000000007; bool isPrime(int n) { if (n <= 1) return false; for (int i = 2; i <= sqrt(n); i++) if (n % i == 0) return false; return true; } bool isPerfec...
ALGO
0.999953
4.118892
{ "github_metadata": { "branch": "main", "commit_count": 29, "repo_created_at": "2024-07-26T18:12: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": "fcc5cb877c3...
549120bd-fcd1-4b5f-a1b9-1fb3e7292297
Felipe-gsilva/notes
Cs/6° Semestre/Prog-Comp/aula-2-prog-dinamica.cpp
#include <iostream> #include <vector> int fib_memo(int k, std::vector<int> &memo) { if (k <= 1) return k; if (memo[k] != -1) return memo[k]; memo[k] = fib_memo(k - 1, memo) + fib_memo(k - 2, memo); return memo[k]; } int fib_tabo(int k) { std::vector<int> dp(k + 1); dp[0] = 0; dp[1] = 1; for...
ALGO
0.999952
4.555336
{ "github_metadata": { "branch": "main", "commit_count": 280, "repo_created_at": "2024-08-12T22:32: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": "6d5cb0bfed...
f30425b9-bcf2-42ae-84d0-8a7d6e5a1516
Yaro2709/AlgoProblems
3/1526A.cpp
#include <iostream> #include <algorithm> using namespace std; int main() { long long int t; cin >> t; while (t--) { int n; cin >> n; long long int *arr = new long long int[2 * n]; for (int i = 0; i < 2 * n; i++) { cin >> arr[i]; } sort(arr, ...
ALGO
0.999016
3.345899
{ "github_metadata": { "branch": "main", "commit_count": 2022, "repo_created_at": "2023-03-01T19:46:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "957abd159...
81215862-42d1-44d1-8f66-f933caf8daa3
Rjj1512/LeetCode-Problems
138_CopyListRandomPointer.cpp
class Solution { public: Node* copyRandomList(Node* head) { Node* copy_head = nullptr, *copy_tail = nullptr; Node *nextptr = nullptr; // Add the copy nodes after the original nodes Node* temp = head; while(temp) { Node* node = new Node(temp->val); ...
ALGO
0.999595
5.413389
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2020-05-06T10:28: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": "e1c36745b6...
281a4693-00e3-4fd0-a268-d17af5b1ca04
Kim-DongGeun/Probelm-Solving
백준/180907/2178.cpp
#include <iostream> #include <queue> using namespace std; int map[102][102]; int check[102][102] = { 0 }; int dx[4] = { 1,0,-1,0 }; int dy[4] = { 0,1,0,-1 }; int main() { int R, C, num = 1; scanf("%d %d", &R, &C); for (int i = 1; i <= R; i++) { for (int j = 1; j <= C; j++) { scanf("%1d", &map[i][j]); ...
ALGO
0.99982
3.98657
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2020-12-23T09:46: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": "9c5431e5b...
144aea95-8d16-49e1-97fb-f915350f2884
TheBabu/USACO-Train-Problems
Chapter 1/Section 1.4/wormhole/wormhole.cpp
/* ID: ten.to.1 TASK: wormhole LANG: C++ */ //Implementation by <NAME> //(Learn how to do these fluently!) #include <iostream> #include <fstream> //Global variables will always be set to 0 //Indexing of 1 //N == number of wormhole locations int N, X[13], Y[13], partner[13], next_to_right[13]; //Start at a pos, tele...
ALGO
0.999951
4.259586
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2019-07-09T22:12:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ec161da37...
41010836-aaa1-4341-9696-c3d441ffa6fa
commaai/openpilot
common/util.cc
#include "common/util.h" #include <sys/ioctl.h> #include <sys/stat.h> #include <sys/resource.h> #include <cassert> #include <cerrno> #include <cstring> #include <dirent.h> #include <fstream> #include <iomanip> #include <random> #include <sstream> #ifdef __linux__ #include <sys/prctl.h> #include <sys/syscall.h> #ifnd...
TOOL
0.937406
6.55214
{ "github_metadata": { "branch": "master", "commit_count": 15511, "repo_created_at": "2016-11-24T01:33:30.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 55411, "forks": 9948, "issues": 129, "pull_requests": 30 }, "file_meta": { "content_id"...
2ffc6181-1a61-4e69-86d9-4519f23a1de7
samiqss/Data-Structures
csci260/Lab2notcloned/unionfindQU.cpp
// // unionfind.cpp // Stubs provided by: <NAME> // Implementation provided by: [<NAME>] // Date: September 2017 // // This unionfind class implements disjoint sets as an array of integers // The implmentation is the classic "Quick-Find" implementation, // wherein the name of the set containing each element is stored ...
ALGO
0.990883
3.942477
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-05-03T08:49: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": "83dcb9ad49...
613a07f4-af5f-4b10-9845-7da82629dc43
MakarandNsd/MissionRnD-C-Strings2-Worksheet
src/getFrequencyofWord.cpp
/* Problem : Return the Count of how many times the word occurred in given string in two ways Way1: Not using Recursion Way2:Using Recursion [Optional] Input : "Hello HelloAgain HelloAGAINAGAIN commonItsHelloagain","Hello" Output : 4 Note: Dont modify original str or word,Just return count ,Spaces can also be part o...
ALGO
0.999325
4.765107
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2016-03-22T15:31:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b10174288...
d0e3ea40-c421-4dc0-8b19-ac36e1f20a03
BeliaevAndrey/GB_CPP_arrays_pointers
lesson007/task02/task02.cpp
/* Задача 2 Что нужно сделать: Кролик сидит на нулевой ступеньке большой лестницы. Он может прыгать на одну или более ступенек вверх, но не далее чем на k. Кролик хочет допрыгать до n-й ступеньки, но может сделать это большим количеством способов. Напишите рекурсивную функцию, которая принимает число n типа int и числ...
ALGO
0.999791
5.040957
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2024-03-12T06:39: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": "17a5d9953...
905f04c7-4bc2-44d1-9ec8-60bc4e7a157c
uecken/Arduino-PE4302
Control_PE4302.ino
//double maxVoltage = 3.3; //double voltResolution = 255; //double High_octet = 0.7 * 255 * (3.3/5.0); //double Low_octet = 0.3 * 255 * (3.3/5); int i = 0; void setup() { // put your setup code here, to run once: Serial.begin(115200); for(i = 0; i <=13 ; i++) { pinMode(i, OUTPUT); // 出力に設定 } ...
TOOL
0.921762
4.585763
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2019-11-20T15:08: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": "efe784d65...
e2e9cdf0-54ec-41f0-98cd-0b9ebf09ea06
hfutwangyu/SPP-2.26.2017
Denoising/Algorithms/BilateralNormalFilteringForMeshDenoising.cpp
#include "BilateralNormalFilteringForMeshDenoising.h" BilateralNormalFilteringForMeshDenoising::BilateralNormalFilteringForMeshDenoising(DataManager *_data_manager, ParameterSet *_parameter_set) : MeshDenoisingBase(_data_manager, _parameter_set) { initParameters(); } void BilateralNormalFilteringForMeshDenois...
ALGO
0.998548
5.762449
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2017-02-26T03:50:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f04e2d915...
f41afb17-190a-4924-8c90-2ab2c37c6f94
Meverlk/Coursework2024
Server/InvertedIndex/InvertedIndex.h
// // Created by Meverlk on 12.12.2024. // #ifndef INVERTEDINDEX_H #define INVERTEDINDEX_H #include <unordered_set> #include <thread> #include "ThreadSafeHashTable.h" #include "Database/Database.h" class InvertedIndex { private: ThreadSafeHashTable<std::string, std::unordered_set<int>> index; Database& doc...
ALGO
0.920508
5.77933
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2024-10-23T14:54:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fb989411bee...
dcbbafd2-336c-40fd-9302-cc9f8dfdb4fc
redevilsss/leetcode
151-200/174 地下城游戏.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; //174 地下城游戏 //这道题用动态规划来解决 /* 一些恶魔抓住了公主(P)并将她关在了地下城的右下角。地下城是由 M x N 个房间组成的二维网格。我们英勇的骑士(K)最初被安置在左上角的房间里,他必须穿过地下城并通过对抗恶魔来拯救公主。 骑士的初始健康点数为一个正整数。如果他的健康点数在某一时刻降至 0 或以下,他会立即死亡。 有些房间由恶魔守卫,因此骑士在进入这些房间时会失去健康点数(若房间里的值为负整数,则表示骑士将损失健康点数);其他房间要么是空的(房间里的值为...
ALGO
0.999911
4.629889
{ "github_metadata": { "branch": "master", "commit_count": 31, "repo_created_at": "2019-04-02T15:15:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "208c69fc9...
b4573146-dd36-46fe-af5e-67ce24ad3a37
marlilj/CppBootcamp
Day13/shape.cpp
#include"shape.h" bool Shape::operator==(const Shape &s2) { bool returnVal = false; if (this->a == s2.a && this->p == s2.p) { returnVal = true; } return returnVal; } bool Shape::operator<=(const Shape &s2) { bool returnVal = false; if (this->a < s2.a || (this->a == s2.a && this->p == s...
TOOL
0.949013
4.012865
{ "github_metadata": { "branch": "main", "commit_count": 31, "repo_created_at": "2021-10-13T11:33:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "df5157306f9...
5cae77c6-b5d7-42cb-a472-42c07605d7ed
sanketkkeni/PODEM-Algorithm-implementation
Gate and Circuit class/main.cc
// ESE-549 Project 3 Reference Solution // <NAME> /** @file */ // For you to do: // Part 1: // - Write the getObjective() function // - Write the updateDFrontier() function // - Write the backtrace() function // - Write the podemRecursion() function // Then your basic PODEM implementation should be fini...
ALGO
0.992723
4.272073
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2017-10-29T02:42:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "340451eed...
e6e90ee1-bfc5-4498-85db-0dd19c02b321
donbasta/competitive-programming
submissions/online-judges/cf/2000/855C.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; const int N = 1e5; const int X = 10; const int MOD = 1e9 + 7; int n, m, k, x; vector<int> adj[N + 1]; int dp[N + 1][X + 1][3] //node, banyak highest, state root void dfs(int v, int p) { for(auto c : adj[v]) { if(c == p)...
ALGO
0.99997
4.893761
{ "github_metadata": { "branch": "master", "commit_count": 175, "repo_created_at": "2018-10-17T04:26:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "41dfe271...
88f50749-1a71-47e2-8aa1-d3d298470bb1
Dyablo-HPC/Dyablo
core/src/hyperbolic/policy/HyperbolicPolicy_GLMMHD.h
#pragma once #include "states/State_Ops.h" #include "HyperbolicPolicy_base.h" #include "HyperbolicPolicy_Slope.h" #include "HyperbolicPolicy_BoundaryConditions.h" namespace dyablo{ /** * @brief Structure holding conservative MHD variables * * @note Important here : p denotes the gas pressure and not the total pr...
ALGO
0.984071
4.85572
{ "github_metadata": { "branch": "dev", "commit_count": 2006, "repo_created_at": "2024-06-18T09:19:53.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 27, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f88a720307...
c9c54ceb-904e-4d98-9471-08231eb0efbe
tongmon/fundamental-practice
Problem Solving/Beakjoon Algo Judge/Greedy/Beakjoon_2875.cpp
#include <iostream> #include <cstring> #include <queue> #include <vector> #include <cmath> #include <algorithm> using namespace std; /* https://www.acmicpc.net/problem/2875 그냥 생각없이 풀어재끼기에는 쉬운 문제다. 일단 나는 확정적인 팀을 만들고 거기서 인턴쉽에 가는 사람을 빼는데 한 팀씩 날려가면서 뺀다. 이게 방법 1이다. N번의 복잡도로 풀린다. 다른 사람의 풀이는 보니 1번의 연산으로 끝나는 방법이 있었다! 일단 여학생을 ...
ALGO
0.999979
4.081169
{ "github_metadata": { "branch": "master", "commit_count": 1036, "repo_created_at": "2020-07-26T10:43:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7bdf971...
53a1e1ce-d670-42ef-8d41-b0b7193e6843
Nyatl/acm-archive
perm 2009/day4/e.cpp
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <iostream> #include <cstdlib> #include <cstdio> #include <cmath> #include <algorithm> #include <vector> #include <string> #include <queue> #include <deque> #include <set> #include <tuple> #include <map> #include <ctime> #include <memory> #include <memo...
ALGO
0.999968
3.295874
{ "github_metadata": { "branch": "master", "commit_count": 125, "repo_created_at": "2017-10-09T20:13: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": "1665ea9f...
ecf4b332-8ef6-4686-b900-4f03f2349114
gvansh123/LeetCode
437-path-sum-iii/path-sum-iii.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.999969
4.88515
{ "github_metadata": { "branch": "main", "commit_count": 896, "repo_created_at": "2023-09-18T16:20: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": "b0f67f0e7a...
1aefa730-57d9-4d97-a3a3-b172ce1f4957
hchothani/cp
A_Forked.cpp
#include "bits/stdc++.h" #define ll long long #define uint unsigned int #define vi vector<int> #define srt(v) sort(v.begin(),v.end()) //sort #define revsrt(v) sort(v.begin(), v.end(), greater<int>()) #define mxe(v) *max_element(v.begin(), v.end()) //find max element in vector #define mne(v) *min_element(v.begin(), v.en...
ALGO
0.999805
4.600855
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2025-04-19T18:34:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "93c4511910...
2359abe6-da55-4c96-a1af-47c511955cf9
DHEERAJHARODE/Hacktoberfest2024-Open-source-
GREEDY/EASY/Fact Digit Sum - EASY.cpp
/* Fact Digit Sum Easy Accuracy: 59.03% Submissions: 797 Points: 2 A(X) for positive integer X is the sum of factorials of its digits. For example, A(154) = 1! + 5! + 4!= 145. Given a number N, find the minimum number X such that A(X) = N. Example 1: Input: N = 40321 Output: 18 Explanation: A(18)=1!+ 8! =40321 ...
ALGO
0.999896
5.4466
{ "github_metadata": { "branch": "main", "commit_count": 945, "repo_created_at": "2020-10-03T04:58:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 473, "forks": 3840, "issues": 177, "pull_requests": 1367 }, "file_meta": { "content_id": "...
fee15ef6-2bdb-4ad5-96df-ccd0458d1c9f
dwates23/CS472Wates
Assign1/AdjMatrixGraph.hpp
#ifndef ADJMATRIXGRAPH_HPP #define ADJMATRIXGRAPH_HPP #include <iostream> #include <vector> #include <list> #include <stack> #include <map> #include <queue> #include <algorithm> #include <functional> #include <ctime> #include "Graph.hpp" using namespace std; template <class N> class AdjMatrixGraph : public Graph<N> {...
ALGO
0.995136
6.752827
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2024-01-17T00:10: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": "e98e1659186...
19367756-e6ed-4f69-9049-113e4c29931c
ishandutta2007/codeforces-m
maroonrk/normal/827/F.cpp
#include <bits/stdc++.h> using namespace std; using ll=long long; //#define int ll #define rng(i,a,b) for(int i=int(a);i<int(b);i++) #define rep(i,b) rng(i,0,b) #define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--) #define per(i,b) gnr(i,0,b) #define pb push_back #define eb emplace_back #define a first #define b secon...
ALGO
0.999681
3.703216
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-06-06T01:03:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e620e4a3154d...
4ddbd9af-8061-4f17-84ba-b449ad79d141
walkccc/LeetCode
solutions/1345. Jump Game IV/1345.cpp
class Solution { public: int minJumps(vector<int>& arr) { const int n = arr.size(); // {a: indices} unordered_map<int, vector<int>> graph; queue<int> q{{0}}; vector<bool> seen(n); seen[0] = true; for (int i = 0; i < n; ++i) graph[arr[i]].push_back(i); for (int step = 0; !q.emp...
ALGO
0.99999
5.901734
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2019-02-23T15:46:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1254, "forks": 437, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e0a50fb...
ac8214a7-791d-4524-9f1b-76542f02e676
conao3/coder
contests/atcoder/abc168/abc168_a/main.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <utility> #include <tuple> #include <cstdint> #include <cstdio> #include <map> #include <queue> #include <set> #include <stack> #include <deque> #include <unordered_map> #include <unordered_set> #include <bitset> #include <cctype> us...
ALGO
0.999244
3.444556
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2020-05-11T14:16: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": "22569c539e...
66235856-035f-4407-84d9-f8a0445b3f62
FrenaldyH/Competitive-Programing
CSES/Graph Algorithms/ShortestRoutesI.cpp
#include <bits/stdc++.h> using namespace std; //Shortcut #define fn(i, r, l) for(i = r - 1; i >= l; i--) #define fp(i, l, r) for(i = l; i < r; i++) #define ms(x, y) memset(x, y, sizeof(x)) #define all(x) x.begin(), x.end() #define sc second #define fr first #define el '\n' using dd = double; using ll = long long; usi...
ALGO
0.999981
3.740622
{ "github_metadata": { "branch": "main", "commit_count": 92, "repo_created_at": "2025-04-14T16:57: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": "2329b67160f...
d739d45b-147d-4a16-8e16-a953cf1aec2e
kasa021/atcoder-archives
tessoku-book/tessoku_book_ei_35153418_AC.cpp
/* * Author: kAsA02 * Submission URL: https://atcoder.jp/contests/tessoku-book/submissions/35153418 * Submitted at: 2022-09-25 04:43:03 * Problem URL: https://atcoder.jp/contests/tessoku-book/tasks/tessoku_book_ei * Result: AC * Execution Time: 88 ms */ #include <bits/stdc++.h> #include <cmath> #if __has_inclu...
ALGO
0.999994
4.505339
{ "github_metadata": { "branch": "main", "commit_count": 2004, "repo_created_at": "2023-01-16T08:01:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "8d14b5dcd...
4913d934-38f3-46fa-be81-1697f3957026
Skanda-Bharadwaj/RVPD_WACV25_Release
Header/visual_word.h
#ifndef VISUAL_WORD_H #define VISUAL_WORD_H #include <general_include.h> #include <hierarchical_cluster.h> #include <functions.h> class visualWords { public: float Gscore; float score; float linearityScore; float crossRatioScore; float scaleScore; float angleScore; cv::Vec4f line_para; ...
ALGO
0.963298
4.498483
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-12-01T00:08:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b8a3693b262b...
f6cdb884-c3b2-4e4e-9865-2262e7302158
sahilt65/Codeforces-Solutions
1907D.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long void solve(){ int n; cin>>n; vector<vector<ll> > v(n, vector<ll>(2)); for(int i = 0; i<n; i++) cin>>v[i][0]>>v[i][1]; ll l = 0, h = 1e9, leftK = 0, rightK = 0, k = 0, f = 0; while(l < h) { k = l +(h - l)/2; // k is mid...
ALGO
0.999935
4.474223
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2024-06-16T05:43: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": "03418d0d858...
9abe0403-d41b-4bab-9def-f44da67b013c
Leogendra/Licence-Informatique-Master-IASD
S4/Algo HLIN401/TP/TP6/Dijkstra.cpp
#include <iostream> #include <cmath> #include "Dijkstra.h" using namespace std; coord* sommetsAleatoires(int n, int l, int h) { coord *sommets = new coord[n]; for (int i = 0; i < n; i++) { sommets[i] = {(rand()%(l-19)) + 10, (rand()%(h-19)) + 10}; } return sommets; } float distance(coord* sommets, int i, int ...
ALGO
0.999332
3.069484
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2023-01-23T21:55: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": "c9991cede11b...