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
fdcb8cab-f84d-4be8-be3b-ffff03da5463
labulaka6/Leetcode
Algorithm&Mathematics/simple/69.cpp
static const auto _ = [](){ ios::sync_with_stdio(false); cin.tie(nullptr); return nullptr; }(); // 内置函数 class Solution { public: int mySqrt(int x) { return sqrt(x); } }; // 二分法 class Solution { public: int mySqrt(int x) { // 注:在中间过程计算平方的时候可能出现溢出,所以用long long。 long lon...
ALGO
0.999965
4.985202
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2020-04-08T04:45: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": "73a82ae23...
2fabdd0e-cb27-4c84-9562-58cfc4953907
ishandutta2007/codeforces-a
amnesiac_dusk/normal/634/E.cpp
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/rope> using namespace __gnu_pbds; using namespace __gnu_cxx; #ifndef rd #define trace(...) #define endl '\n' #endif #define pb push_back #define fi firs...
ALGO
0.999799
4.125505
{ "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": "65a9261fe0bb...
cec7c8b6-7c7c-429e-a862-7caa9301170f
Sonukum226/Data-Structure-And-Algorithm-Binary-Tree-
a(properties of Binary tree).cpp
1) The maximum number of nodes at level ‘l’ of a binary tree is 2l. Here level is number of nodes on path from root to the node (including root and node). Level of root is 0. This can be proved by induction. For root, l = 0, number of nodes = 20 = 1 Assume that maximum number of nodes on level ‘l’ is 2l Since in Binary...
ALGO
0.999918
7.372685
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-01-01T05: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": "6cb5c06cf7e2...
9e5e5296-9e05-4d95-98f9-b06ae28a894a
Garryb057/-Data-Structures-Assignment-1
main.cpp
//Name: <NAME> //Email: <EMAIL> #include <iostream> #include "function.h" using namespace std; int main() { //initialize array int arr[200] = {0}; string fileName; //Get the file name from the user and call the function readFile with the given fileName cout << "Enter file name: "; cin >> fileName; readFile(f...
TOOL
0.982438
4.36148
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2023-06-16T21:28: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": "9bb7469c53...
be548725-3036-499b-92cd-a1f968bc8a36
ccutjiangxiong/MY-learningcode
Test/B_Find_the_Permutation.cpp
#include <bits/stdc++.h> #define int long long #define ld long double #define rep(i, a, b) for (int i = (a); i <= (b); i++) #define rem(i, a, b) for (int i = (a); i >= (b); i--) #define vi vector<int> #define pb emplace_back #define me(a, x) memset(a, x, sizeof(a)) const int N = 2e6 + 5, mod = 1e9 + 7, inf = 1e18 + 3; ...
ALGO
0.999889
4.061501
{ "github_metadata": { "branch": "main", "commit_count": 47, "repo_created_at": "2025-03-07T10:48:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6f9d3602166...
2250b8fd-a81f-43be-8c16-e6260c6dae7d
Hunterhuan/Leetcode
695. Max Area of Island.cpp
class Solution { public: int maxAreaOfIsland(vector<vector<int>>& grid) { int maxArea = 0; int area = 0; vector<pair<int,int>> visited; //if no element if (grid.size() == 0 ) return 0; //if only one element for (int i = 0 ; i < gr...
ALGO
0.99994
6.230114
{ "github_metadata": { "branch": "master", "commit_count": 96, "repo_created_at": "2019-03-21T11:37:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9e5337514...
b1ef9d2e-6d05-4aff-bb2c-ac82213021e0
bitsai/book-exercises
Accelerated C++/chapter07/7-9.cpp
#include <cmath> #include <cstdlib> #include <iostream> #include <stdexcept> #include <limits.h> using namespace std; #define MY_RAND_MAX 32767 int nrand(int n) { if (n <= 0) throw domain_error("Argument to nrand is out of range"); int r; if (n <= MY_RAND_MAX) { const int bucket_size ...
ALGO
0.996495
3.464163
{ "github_metadata": { "branch": "master", "commit_count": 224, "repo_created_at": "2010-08-24T01:45:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 431, "forks": 265, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e509...
4b3d6bc1-bf93-435e-8a3e-1df5e1a18b6b
sihcpro/Olympic
dem_so_cach_xep_4_mau.cpp
#include <iostream> #include <vector> #include <string> using namespace std; long long mu2(long n) { long long m= 1; for(int i= 1; i <= n; i++) { m= m<< 1; m%= 10007; } return m%10007; } long long giaiThua( long i, long n ) { long long m=1; for(; i <= n; i++ ) { ...
ALGO
0.999906
3.741199
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2018-08-13T08:26: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": "e8eff247a0...
e35e51b9-ac29-49a9-92c9-fa9cbf681624
frooms/stira
stira/imagetools/imagegenerator/FractalGenerator.h
/*********************************************************************************** * Copyright (C) 2009 by <NAME> * * * * Terms and conditions for using this software in any form are prov...
ALGO
0.941314
5.665826
{ "github_metadata": { "branch": "master", "commit_count": 292, "repo_created_at": "2015-04-27T19:28:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ca91e64...
a744f20b-2605-4c7a-8cf0-f576da08c79a
durumi99/baekjoon
10816.cpp
#include <iostream> #include <algorithm> using namespace std; int lower_binary(int*arr,int target,int size) { int mid, start, end; start = 0, end = size - 1; while (end > start){ mid = (start + end) / 2; if (arr[mid] >= target) end = mid; else start = mid + 1; } ...
ALGO
0.999982
4.33031
{ "github_metadata": { "branch": "master", "commit_count": 689, "repo_created_at": "2020-12-12T04:43: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": "8f4d3562...
d9545006-0288-45f7-84e5-597f15dfdfd5
armabon/UE4_CGAL
ThirdParty/CGAL/includes/CGAL/Polygon_mesh_processing/orientation.h
// Copyright (c) 2013 GeometryFactory (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org). // You can redistribute it and/or modify it under the terms of the GNU // General Public License as published by the Free Software Foundation, // either version 3 of the License, or (at your option) a...
ALGO
0.996128
7.226297
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2016-11-22T20:39:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 32, "forks": 11, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "d33baa6...
82dda1d9-1518-485f-9810-2962078d35e8
Vlad1000nn/MyGit
University/2 sem/OOP (C++)/Pract4_Nevskiy(KMBO-07-22).cpp
#include <iostream> #include <string> #include <cstring> using namespace std; constexpr char vowels[]{ "AaEeIiUuYyOo" }; //Все гласные bool isVowel(char c) //Проверка на гласную { for (int i = 0; i < 12; i++) { if (c == vowels[i]) return true; } return false; } //Реализуем класс строка с помощью C-styl...
TOOL
0.941746
3.454874
{ "github_metadata": { "branch": "main", "commit_count": 201, "repo_created_at": "2022-11-10T16:53: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": "cdab89d054...
a7ca37e0-441f-4844-abf6-ad57b4e4a7c5
sahilmadaan048/Striver-From-Scratch
4, Binary Search/2. BS on answers/7. kth missing positive number/main2.cpp
#include <bits/stdc++.h> using namespace std; int missingK(vector < int > vec, int n, int k) { int low = 0, high = n - 1; while (low <= high) { int mid = (low + high) / 2; int missing = vec[mid] - (mid + 1); if (missing < k) { low = mid + 1; } else { ...
ALGO
0.999871
4.57113
{ "github_metadata": { "branch": "main", "commit_count": 167, "repo_created_at": "2025-03-17T19:04: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": "f1a25ce9ea...
42550bae-d311-487e-be72-3cc6c3810555
swarajkumarsingh/DSA-ALGO
patterns/questions/pattern24.cpp
#include <iostream> using namespace std; //! Love Baber video number 4 //! Pattern // 1 // 121 // 12321 // 1234321 //? 1st Circle is the space //? 2nd cirlce // 1 // 12 // 123 // 1234 //? 3rd circle // // 1 // 21 // 321 int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { ...
ALGO
0.999996
4.730108
{ "github_metadata": { "branch": "master", "commit_count": 216, "repo_created_at": "2023-04-17T10:14:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b36c46e1...
78e4f621-6bc9-48d5-8e8e-8df2fe0ff6f1
IdanZimi/MinSpaningTreeAlgo
MinSpanTreeAlgo/Graph.h
#pragma once #include "definitions.h" #include "LinkedList.h" #include "MinHeap.h" typedef struct { int v1; int v2; int weight; }Edge; class Graph { private: bool allocated = false; int numOfVertices; int numOfEdges; vector<LinkedList*> arrOfAdjacencyLists; vector<Edge*> edgesArr; int partition(vector<Edge*>...
ALGO
0.995679
3.538832
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2022-06-28T11:33: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": "caeab65351...
5b7cc7ae-822c-4401-93ae-1c57a6ecac4a
bitwiseworks/qtwebengine-chromium-os2
chromium/third_party/perfetto/src/trace_processor/trace_sorter.cc
/* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
ALGO
0.992972
6.014597
{ "github_metadata": { "branch": "master", "commit_count": 160, "repo_created_at": "2019-11-06T19:49:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 9, "forks": 2, "issues": 16, "pull_requests": 20 }, "file_meta": { "content_id": "c197d8a...
75d98321-17d4-4817-9ff0-5d43b76cd005
blackout-yash/Striver
Graph/32_Dijkstras_Algorithm_Priority_Queue.cpp
// Implementing Dijkstra Algorithm // Link - https://practice.geeksforgeeks.org/problems/implementing-dijkstra-set-1-adjacency-matrix/1 class Solution { public: vector <int> dijkstra(int V, vector<vector<int>> adj[], int S) { priority_queue <pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq; ...
ALGO
0.999973
5.935124
{ "github_metadata": { "branch": "main", "commit_count": 261, "repo_created_at": "2022-07-19T08:09: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": "81f155a42f...
dbc9bb95-b998-4d79-a8e8-cf54f7de6389
nikolaevaaa/tsisa05
main.cpp
#include <iostream> #include <random> #include <ctime> #include <vector> #include <algorithm> const double a = 0.0; const double b = 3.0; const double c = -1.0; const double d = 3.0; const size_t N = 10; const double A = 3.0; const double step = (double)((b - a) / (N - 1)); struct Point { double x; double y; ...
ALGO
0.99966
5.073998
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2020-12-15T18:20: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": "e0766968bdd8...
8cf86ffb-066f-43e8-96c3-b1e85a3f9c31
raresdolga/Problems_Algh-Data_Structures
C++/sums/main.cpp
#include <iostream> using namespace std; int set1[] = {1,2,3}; int count1(int n){ int c =0; if(n == 0) return 0; if( n < 0) return -1; int p; for(int i = 0; i < 3; i++){ p = count1(n - set1[i]); if(p == 0) c += 1; else if(p > 0) ...
ALGO
0.999927
3.851616
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2017-07-16T13:50: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": "96f803eff...
33c28a46-9f58-4096-8628-1b6741227452
adrian-budau/work
Caribbean Online Judge/2348 - Inbox Storage Capacity/main.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { int T; cin >> T; while (T--) { int N, C; cin >> N >> C; vector< pair<int, int> > events; for (int i = 0; i < N; ++i) { int a, b, c; cin >> a >> b >> c; eve...
ALGO
0.999652
4.17076
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2013-04-27T22:47:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7f0323f47...
552d3a52-d46c-49db-b25b-1910dd409d68
trilinos/Trilinos
packages/belos/src/BelosFixedPointIter.hpp
// @HEADER // ***************************************************************************** // Belos: Block Linear Solvers Package // // Copyright 2004-2016 NTESS and the Belos contributors. // SPDX-License-Identifier: BSD-3-Clause // *********************************************************************...
ALGO
0.998659
7.205482
{ "github_metadata": { "branch": "master", "commit_count": 104031, "repo_created_at": "2015-11-16T19:39:16.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1299, "forks": 593, "issues": 263, "pull_requests": 61 }, "file_meta": { "content_id":...
40911905-26c5-4711-8871-917510a1c311
imulan/procon
codeforces/gym/Samara_XI/d.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define all(x) (x).begin(),(x).end() #define pb push_back #define fi first #define se second // (行き先,容量,逆辺) struct edge{ int to,cap,rev; }; const int MAX_V = 303; // TODO:initialize const int F_INF =...
ALGO
0.999993
3.939099
{ "github_metadata": { "branch": "master", "commit_count": 2571, "repo_created_at": "2015-11-25T03:18:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 1, "issues": 27, "pull_requests": 0 }, "file_meta": { "content_id": "2175b8...
51df68a0-6e84-4140-b71b-69e5c5238f2d
madmaps/SpaceGame
matrix.h
class matrix { public: //constructors matrix(const int& rows=4,const int& cols=4):m_rows(rows),m_cols(cols){m_matrix.assign(rows*cols,0);} matrix(const int& rows,const int& cols,const double info[]); //destructor ~matrix(){} //operator overloading matrix operator*(matrix& rhs); matrix operator+(matrix& rhs); m...
ALGO
0.925976
4.173159
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2016-05-20T19:07:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7bfa6211dc...
dd901e4d-5a7f-436c-befd-8f0cd5033da1
sssvip/LeetCode_lxw
LeetCode_CPP/num009/num009_generic.cpp
// File: num009_generic.cpp // Author: lxw // Date: 2015-05-23 /* Num 009: Palindrome Number Source: https://leetcode.com/problems/palindrome-number/ Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers be palindromes? (ie, -1) If you are thinking of converting...
ALGO
0.999629
6.065921
{ "github_metadata": { "branch": "master", "commit_count": 474, "repo_created_at": "2017-09-26T08:22: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": "cde6bfba...
18eca628-eaef-41d6-bafd-66864993252e
niravatgit/Moveit_Igus_RL_DP5
rl_dp_5/rl_dp_5_pcl/src/DoN_pcl.cpp
#include <ros/ros.h> #include <string> #include <iostream> #include <sensor_msgs/PointCloud2.h> #include <pcl_ros/point_cloud.h> #include <pcl/point_types.h> #include <pcl/features/normal_3d.h> #include <pcl/features/normal_3d_omp.h> #include <pcl/features/don.h> #include <pcl/segmentation/sac_segmentation.h> #incl...
DATA
0.928908
6.357528
{ "github_metadata": { "branch": "main", "commit_count": 353, "repo_created_at": "2023-04-13T05:19:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cea5a61328...
468411d7-543b-44ca-89ab-dd557c36f5b5
rewyekha/Data-Structure-using-CPP
Binary Search Trees.cpp
#include<iostream.h> // for input-output #include<conio.h> // for console input-output) enum boolean { false=0,true=1}; // Defines an enum boolean with false and true values for representing boolean conditions. /* 1. Node Structure and BST Class Definition: node structure defines a binary tree node with an integ...
ALGO
0.999927
5.95118
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-06-23T16:32: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": "50fc61d4904c...
d7bbb1c1-8b61-43c6-b97c-24fb7e389175
tomasdecamino/ArduinoStuff
ArtScience_RobustLearn/ArtScience_RobustLearn.ino
//<NAME> //www.funcostarica.org // learns to recognize a set of notes // choose notes you want ro recognize, and then have CP to turn //green. Then choose notes you don't wnat and train to turn red... #include <Adafruit_CircuitPlayground.h> #include "Perceptron.h" #define BINS 32 // The number of FFT freq...
ALGO
0.979907
5.280902
{ "github_metadata": { "branch": "master", "commit_count": 57, "repo_created_at": "2017-01-25T20:56:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 30, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "30e5e0c3...
cfde6dab-46b9-4577-a87c-c3405a7700eb
WaliDev/WALi-OpenNWA
AddOns/Domains/ThirdParty/buddy-2.4/examples/queen/queen.cxx
/************************************************************************** BDD demonstration of the N-Queen chess problem. ----------------------------------------------- The BDD variables correspond to a NxN chess board like: 0 N 2N .. N*N-N 1 N+1 2N+1 .. N*N-N+1 2 N+2 ...
ALGO
0.9999
5.820076
{ "github_metadata": { "branch": "master", "commit_count": 2130, "repo_created_at": "2012-11-13T21:30:53.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 18, "forks": 14, "issues": 2, "pull_requests": 2 }, "file_meta": { "content_id": "8a8356...
e5886ffe-a4cb-4eeb-a960-87934d2c4cac
pritmanvar/DSA-with-CPP
Binary Search Tree/Brothers From Different Root.cpp
/* Problem Link : https://practice.geeksforgeeks.org/problems/brothers-from-different-root/1# Structure of the Node of the BST is as struct Node { int data; struct Node *left; struct Node *right; Node(int val) { data = val; left = right = NUL...
ALGO
0.999978
5.586238
{ "github_metadata": { "branch": "main", "commit_count": 648, "repo_created_at": "2021-05-22T09:01:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 15, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "83539c6b0...
375e291f-0152-4c43-a891-32c91499248d
arnabs542/lintcode-1
lintcode-0859.h
#ifndef __LINTCODE_0859__ #define __LINTCODE_0859__ #include "data-types.h" /*@859. Max Stack Design a max stack that supports push, pop, top, peekMax and popMax. push(x) -- Push element x onto stack. pop() -- Remove the element on top of the stack and return it. top() -- Get the element on the top. ...
ALGO
0.998945
5.536666
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2021-01-21T12:38: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": "82dbcd3764...
111f7d90-7831-4a66-bda5-f1623bafd709
ESHAN-tech/DATA-STRUCTURE-
02binarysearch/binaryrev2.cpp/moutainarr.cpp
#include <iostream> #include <algorithm> using namespace std; int moutainarr(int arr[] , int n){ int s = 0 ; int e = n-1 ; int mid = s+ (e-s)/2; while(s < e ){ // checking for increasing line .. if (arr[mid] < arr[mid +1]){ s = mid +1 ; } // for decreasing ...
ALGO
0.999977
4.676678
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-08-18T08:16: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": "20ea52e6b5c0...
a30d11a0-b1bd-4f0a-8f94-94ed63213db6
kkerrigan/GDP-AnimationProject
KrisBryEngine/cApproachBehaviour.cpp
/** * @file cApproachBehaviour.cpp * @author <NAME> <<EMAIL>> * @version 1.0 * * @section DESCRIPTION * * Implementation of the cApproachBehaviour.cpp. */ #include <iostream> #include "cApproachBehaviour.h" #include "Common.h" #include "cRigidBodyComponent.h" cApproachBehaviour::cApproachBehaviour(cEntity* ...
ALGO
0.990563
6.293459
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2022-01-23T15:10: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": "3e81cba953...
0f47ec1b-8d52-4481-a6c6-2780e75aad8f
TheTimeBug/Simple-single-channel-queue-problem-in-C-
Single channel Queue.cpp
#include<bits/stdc++.h> using namespace std; int consumer; int interArrivalTime[99]; //data for inter arrival time int serviceTime[99]; //Consumer Service time int arrivalTime[99]; //Arrival time on clock int begainTime[99]; //store begin time int endTime[99]; ...
ALGO
0.997794
3.227635
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2021-03-22T07:23:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a3b0319c2ef0...
b90e9816-ba40-432c-bc0c-f2bec3954f82
ishandutta2007/codeforces-u
u.m.r/normal/1060/B.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> PII; const int MAXN = 1e6 + 10; const int MM = 1e9 + 7; ll pw(ll p, ll q){ ll ret = 1; for (; q; q >>= 1){ if (q & 1) ret = ret * p % MM; p = p * p % MM; } return ret; } char s[100...
ALGO
0.999837
3.962538
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:31: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": "29c442c27669...
e9121d1b-9c9a-4237-befa-345a205ac8b5
duckhee/opencv_study
chapter7/ex7-12/ex7_12.cpp
#include "opencv2/opencv.hpp" using namespace cv; using namespace std; void ChangeSignOddPositionInXY(Mat &m); void GaussianHighpassFilteringH(Mat F, double D0); int main() { Mat srcImage = imread("../lena.jpg", IMREAD_GRAYSCALE); if(srcImage.empty()) { return -1; } Mat fImage; srcIm...
ALGO
0.995008
4.480515
{ "github_metadata": { "branch": "master", "commit_count": 209, "repo_created_at": "2018-10-31T04:57:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "73452b5f...
801d7501-3f5e-4f18-ad89-ea0eae970418
IshaRawat7/DSA
painters_partititon_problem.cpp
/*Painters Partition Problem*/ /*n- Length of n different boards , m-painters available A painter paints 1 unit of board in 1 unit of time and each painter will paint consecutive boards. Find the minimum time that will be required to paint all the boards. */ /*Example: boards = [10,20,30,40] painters(m) = 2 possible Pa...
ALGO
0.999952
6.287572
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-09-22T06:23: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": "c95379b6a34c...
9a6edd76-9187-45a8-84c1-210aa1732b88
JOSPAUL2233/leetcode-Solved-Questions
0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divamazon-divdiv-classcompanytagscontainer-tagoccurence4-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-1...
class Solution { public: vector<int> majorityElement(vector<int>& nums){ int ele1 = INT_MIN; int count1 = 0; int ele2 = INT_MIN; int count2 = 0; for(int i = 0;i<nums.size();i++){ if(count1 == 0 && nums[i] != ele2){ ...
ALGO
0.999998
5.581558
{ "github_metadata": { "branch": "main", "commit_count": 2443, "repo_created_at": "2022-12-25T05:30: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": "36db00de3...
738dfaca-fa17-40a8-bb71-d812226a9959
antonio-decaro/sycl-bfs
include/impl/bfs_operators/naive.hpp
#ifndef __NAIVE_HPP__ #define __NAIVE_HPP__ #include <sycl/sycl.hpp> #include <fstream> #include <iostream> #include <vector> #include <string> #include <memory> #include <chrono> #include "host_data.hpp" #include "kernel_sizes.hpp" #include "sycl_data.hpp" #include "impl/simpl_bfs.hpp" namespace s = sycl; class Nai...
ALGO
0.951047
4.119697
{ "github_metadata": { "branch": "master", "commit_count": 81, "repo_created_at": "2023-10-04T13:31: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": "83815c9b1...
873e539d-9c57-49ac-99aa-087569ee115a
vidarrio/AoC-2018
day4/part2/main.cpp
#include <iostream> #include <fstream> #include <sstream> #include <vector> #include <string> #include <algorithm> #include <unordered_map> void initializeGuards(const std::vector<std::string> lines, std::unordered_map<size_t, std::vector<size_t>> &guards){ std::vector<size_t> ids; for (std::string line : line...
ALGO
0.998432
4.742948
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2018-12-16T14:15: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": "7f64720e18...
d68d84f7-7e79-435d-8131-f15c16287bed
thishandp7/Connect-Four
ConnectFour_CSCI440Project_v01/GameCore.cpp
#include "GameCore.h" #include <algorithm> GameCore* GameCore::singleton = nullptr; GameCore::GameCore() { //initGameMechs(); } GameCore* GameCore::getInstance() { if (singleton == nullptr) { singleton = new GameCore(); return singleton; } else { return singleton; } } void GameCore::destroy() { if (sing...
ALGO
0.96458
4.808313
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2017-10-23T04:07: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": "b08d382bb...
0f821c82-dcb9-4dfa-9285-3bb9455aeac4
zjin-lcf/HeCBench
src/epistasis-sycl/main.cpp
#include <math.h> #include <float.h> #include <iostream> #include <chrono> #include <sycl/sycl.hpp> #include "reference.h" using namespace std::chrono; typedef high_resolution_clock myclock; typedef duration<float> myduration; #define MAX_WG_SIZE 256 template <typename T> T* mem_alloc (const int align, const size_t ...
ALGO
0.998662
3.846323
{ "github_metadata": { "branch": "master", "commit_count": 4592, "repo_created_at": "2020-08-06T17:44:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 248, "forks": 89, "issues": 1, "pull_requests": 3 }, "file_meta": { "content_id": "b418...
ea3d85e5-7fb0-4c39-972e-e9f0e96c723c
ishandutta2007/codeforces-o
ormlis/normal/1738/F.cpp
#include "bits/stdc++.h" #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep1(i, n) for (int i = 1; i < (n); ++i) #define rep1n(i, n) for (int i = 1; i <= (n); ++i) #define repr(i, n) for (int i = (n) - 1; i >= 0; --i) #define pb push_back #define eb emplace_back #define all(a) (a).begin(), (a).end() #define r...
ALGO
0.999696
3.598346
{ "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": "deb40e034c44...
748ca499-65f4-408a-bb4f-409bbb815723
taki-d/ProgrammingChallenges
week02/11340.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int news; cin >> news; for (int i = 0; i < news; ++i) { int n; cin >> n; std::map<char,int> price; for (int j = 0; j < n; ++j) { char s; int cent; cin >> s >> cent; ...
ALGO
0.957631
4.266414
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2020-04-27T14:55: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": "c114b8bdcd...
1cd376ad-9b45-497e-90b3-601916b99f55
Keerthan04/DSA-Solved
1669-minimum-cost-to-cut-a-stick/1669-minimum-cost-to-cut-a-stick.cpp
class Solution { public: int solve(int i, int j, vector<int> &cuts, vector<vector<int>> &dp) { if (i > j) return 0; if (dp[i][j] != -1) return dp[i][j]; int mini = INT_MAX; for (int k = i; k <= j; k++) { // all the possible cuts in that block we are seeing how to do ...
ALGO
0.999954
5.510415
{ "github_metadata": { "branch": "main", "commit_count": 933, "repo_created_at": "2024-07-10T09:28: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": "e215330d26...
d23da10e-d4ce-405c-9d3f-e4dabbde862d
IljaSir/CopilotSolverForLeetCode
C++/Medium/WrongAnswer/maximum-sum-of-two-non-overlapping-subarrays_8.cpp
class Solution { public: int maxSumTwoNoOverlap(vector<int>& nums, int firstLen, int secondLen) { int n = nums.size(); int sum[n]; for (int i = 0; i < n; i++) { if (i == 0) { sum[i] = nums[i]; } else { sum[i] = sum[i - 1] + num...
ALGO
0.999934
5.700915
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2023-07-28T08:23: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": "922d0ffd9bb4...
a588ac47-d934-4f13-90a2-d71f0ae4e29e
windystrife/UnrealEngine_NVIDIAGameWorks
Engine/Source/ThirdParty/PhysX/PhysX_3.4/Source/GeomUtils/src/mesh/GuBV4_AABBAABBSweepTest.h
// This code contains NVIDIA Confidential Information and is disclosed to you // under a form of NVIDIA software license agreement provided separately to you. // // Notice // NVIDIA Corporation and its licensors retain all intellectual property and // proprietary rights in and to this software and related documentation...
ALGO
0.981332
6.972656
{ "github_metadata": { "branch": "4.18-GameWorks", "commit_count": 14, "repo_created_at": "2018-03-06T15:44:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 284, "forks": 176, "issues": 4, "pull_requests": 2 }, "file_meta": { "content_id"...
f2ac7667-4f4a-4b93-a534-6c414e9a045d
becastal/maratona
utl/Data Structures/dsu/14. Bipartite Graph.cpp
#include <bits/stdc++.h> #define f first #define s second #define _ ios_base::sync_with_stdio(0);cin.tie(0); #define endl '\n' #define dbg(x) cout << #x << " = " << x << endl typedef long long ll; const int INF = 0x3f3f3f3f; const ll LINF = 0x3f3f3f3f3f3f3f3fll; using namespace std; struct UF { vector<int> id, sz, b...
ALGO
0.999992
4.094809
{ "github_metadata": { "branch": "main", "commit_count": 69, "repo_created_at": "2024-04-07T16:10: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": "bb35c1df722...
424e4911-4452-44e2-acfe-1447b2043d73
djeada/Algorithms-And-Data-Structures
src/brain_teasers/cpp/design_browser_history/src/design_browser_history.cpp
/* You have a browser of one tab where you start on the homepage and you can visit another url, get back in the history number of steps or move forward in the history number of steps. Implement the BrowserHistory class: BrowserHistory(string homepage) Initializes the object with the homepage of the browser. void vis...
ALGO
0.997794
5.996516
{ "github_metadata": { "branch": "master", "commit_count": 511, "repo_created_at": "2020-05-16T14:25:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 375, "forks": 59, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6a152...
aced9802-5a02-4cb0-96b5-ccc6147ed803
pieper/Slicer4
Libs/vtkTeem/vtkDiffusionTensorMathematicsSimple.cxx
/*========================================================================= Program: Visualization Toolkit Module: $RCSfile: vtkDiffusionTensorMathematicsSimple.cxx,v $ Copyright (c) <NAME>, <NAME>, <NAME> All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. ...
ALGO
0.974064
5.350265
{ "github_metadata": { "branch": "master", "commit_count": 42, "repo_created_at": "2010-03-23T23:08:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6c6630760...
33f551e6-34c2-44ed-a3cd-d100d0f55727
psiionik/AoC2021
day4/main.cpp
#include <iostream> #include <fstream> #include <string> #include <limits> #include <vector> int BOARD_WIDTH = 5; int BOARD_HEIGHT = 5; class Board { public: bool completed; std::vector<std::vector<int>> bingo_board; Board(std::vector<int> &board_numbers) { completed = false; ...
ALGO
0.999814
5.368124
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2021-12-04T20:57: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": "1ebc04dfe9...
1914d71e-0b1c-4228-b118-99abd3a2089c
squishyjs/daily-python
C++/NearestCourt.cpp
#include <algorithm> #include <cstdlib> #include <iostream> // #include <bits/stdc++.h> void solve(int &x, int &y) { /* *Chef and Chefina are at positions X and Y on a number line It is known that badminton courts are located at every integer point They want to find a court such that the maximum di...
ALGO
0.999869
5.13736
{ "github_metadata": { "branch": "main", "commit_count": 215, "repo_created_at": "2024-11-18T10:34:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9e347c15f0...
1c8ebb38-ccac-444a-b8ff-bb2a818cd4a6
youssef7ussien/problemsolving-space
problems/Codeforces/EDU/ITMO Academy - pilot course/Binary Search/Step 3/C - Cows in Stalls/CF_EDU2_6_3C.cpp
/** * Title: "Binary Search", Codeforces problem. * Date: Wednesday, 06 July 2022 * */ #include <bits/stdc++.h> using namespace std; #define LEN(v) ((int)((v).size())) #define FAST_IO ios_base::sync_with_stdio(false), cin.tie(NULL) typedef vector<int> VI; bool check...
ALGO
0.999996
5.006238
{ "github_metadata": { "branch": "master", "commit_count": 56, "repo_created_at": "2020-07-01T10:45: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": "4a9a9a3ca...
5e3897c9-c29d-46c5-9f16-f83d28a54cec
elixered/leetcode
1483-kth-ancestor-of-a-tree-node/1483-kth-ancestor-of-a-tree-node.cpp
class TreeAncestor { public: vector<vector<int> > P; // P[i][node] :::: [node] 's [2^i]th parent TreeAncestor(int n, vector<int>& parent) { P.resize(20, vector<int>(parent.size(), -1)); // 2^0 for(int i = 0; i < parent.size(); i++){ P[0][i] = parent[i]; } ...
ALGO
0.999902
5.531268
{ "github_metadata": { "branch": "main", "commit_count": 4235, "repo_created_at": "2021-12-24T07:34:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 36, "forks": 10, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4f12738...
0b9709d1-d919-4060-b26c-7c34b2c7d065
pc165/LP_Project
Comunitat.h
#pragma once #include "Heap.h" #include "MatriuSparse.h" #include <list> #include <map> enum class tipusVei { comu, nomes_i, nomes_j }; class Comunitat { public: Comunitat(MatriuSparse *pMAdj); ~Comunitat(); void calculaM2() { m2_ = pMAdj_->getNValues(); } void calculaK() { pMAdj_->calcula...
ALGO
0.979833
4.096716
{ "github_metadata": { "branch": "master", "commit_count": 85, "repo_created_at": "2019-09-27T21:08: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": "3f8c34918...
bf06d987-699a-4dea-8aa6-c75ae61f15f2
AtelierMizumi/C---Exercise
2 Introduction to C++/2.8.cpp
// a program that prompts the user for an integer and computes the number of years, months and days corresponding to that number of days., assuming that all month is 30 days and all year is 365 days #include <iostream> using namespace std; int main(){ int days, years, months, day; cout << "Input the number of...
TOOL
0.970303
3.593471
{ "github_metadata": { "branch": "main", "commit_count": 49, "repo_created_at": "2023-09-13T14:54:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3be5a6b4c95...
2ff68b92-cc21-4c47-99de-5ee39d8ce346
rupesh-dharme/LeetCode
Form a palindrome - GFG/form-a-palindrome.cpp
// { Driver Code Starts //Initial template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function template for C++ class Solution{ public: int countMin(string a){ int n = a.size(); string b(a); reverse(b.begin(), b.end()); int dp[n+1][n+1]; ...
ALGO
0.999956
5.705155
{ "github_metadata": { "branch": "main", "commit_count": 2131, "repo_created_at": "2022-02-12T18:02: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": "20e8e9416...
80384d28-3096-4271-9c51-6a6368a12f5f
azcy-qwq/JZOI_
2024-Nov.-RubbishProblems/11-20/D.cpp
#include<bits/stdc++.h> using namespace std; namespace azcy{ using namespace std; bool debug_switch=1; void auto_init(){ ios::sync_with_stdio(0); cin.tie(0);cout.tie(0); } void qfopen(string INPUT_FILE_NAME,string OUTPUT_FILE_NAME){ freopen(INPUT_FILE_NAME.data(),"r",stdin); ...
ALGO
0.999934
3.442549
{ "github_metadata": { "branch": "a", "commit_count": 54, "repo_created_at": "2024-09-18T10:37:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "995c3364f0d9cf...
ce306903-85b5-48ff-9cf3-818857162e94
ershehzan/Cpp_Codes
Circular LL.cpp
#include <iostream> using namespace std; // Definition of the node class for the circular linked list class node { public: int data; // Data stored in the node node *next; // Pointer to the next node // Constructor to initialize the node with a value node(int val) { data = val; ...
ALGO
0.999779
6.03906
{ "github_metadata": { "branch": "main", "commit_count": 640, "repo_created_at": "2024-10-05T10:47: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": "a2d6b5eeaa...
e4dd59fa-28d9-4a67-a1ed-d38ac1f0d66b
Zhou-London/COMP0005-Notes
week3/sort.cpp
#include <iostream> #include <vector> using namespace std; class MS { private: vector<int> v1; void mergeSort(int low, int high) { if (high - low <= 1) { return; } int mid = low + (high - low) / 2; mergeSort(low, mid); mergeSort(mid, high); merge(...
ALGO
0.999972
5.670381
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2025-01-14T13:17:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e6b0b24ce55e...
16d2fd9f-426f-4ca5-be56-eecd6f081ea7
zhouyuhaoat/PAT
2.test/A1112-A1115/A1114-1.cpp
/* * author: zhouyuhao * created: 2023-04-02 14:59:06 * modified: 2023-04-04 09:06:37 * item: Programming Ability Test * site: Yuting */ /* @pintia psid=994805342720868352 pid=994805356599820288 compiler=GXX ProblemSet: PAT (Advanced Level) Practice Title: 1114 Family Property https://pintia.c...
ALGO
0.999668
5.140965
{ "github_metadata": { "branch": "main", "commit_count": 64, "repo_created_at": "2025-05-20T01:36: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": "9fc1236546e...
0f11ed0b-a613-48fe-8884-0bb3d2c5339e
chin0/everydayalgo
baekjoon/bruteforce/backtracking/14889.cpp
#include <cstdio> #include <vector> #include <algorithm> using namespace std; int score[20][20]; inline int abs(int a) { return (a < 0) ? -a : a; } int main(void) { int n; scanf("%d", &n); for(int i = 0; i < n; i++) { for(int j = 0; j < n; j++) scanf("%d", &score[i][j]); } ...
ALGO
0.999953
3.52128
{ "github_metadata": { "branch": "master", "commit_count": 92, "repo_created_at": "2017-07-03T19:38: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": "53175ef31...
b0baf8e3-a40e-410d-96ec-955f7212bec0
tynnp/CP-Practice
UPCODER/Operator01.cpp
#include <iostream> #include <algorithm> using namespace std; struct PhanSo { int tu; int mau; void rutGon() { int ucln = __gcd(tu, mau); tu /= ucln; mau /= ucln; if (mau < 0) tu = -tu, mau = -mau; } }; istream& operator >> (istream &in, PhanSo...
ALGO
0.999982
4.292253
{ "github_metadata": { "branch": "main", "commit_count": 5981, "repo_created_at": "2024-02-01T10:12: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": "2c9880546...
b78415ec-b397-4aca-a0f7-3f5039808d9c
elisatentori/elisatentori_LSN
Lecture02/Esercizio1/MC_Integrals/Integral.cpp
#include <iostream> #include <fstream> #include <ostream> #include <cmath> #include <stdlib.h> #include <iomanip> #include "Integral.h" using namespace std; int main() { SetSeed(); for(int iblk=1; iblk <= nblk; ++iblk) { Reset(iblk); for(int istep=1; istep <= nstep; ++istep) { ...
ALGO
0.996564
3.753939
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2020-09-02T21:28:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "acafa5546...
6fa55d62-6b69-4ff9-8153-296dd2e5f40b
Pokloskaya/Coding-Exercices
Aprendiendo Conceptos/twoNumbersSum.cpp
//PROBLEM: Find the two numbers in an array that add up to a given target #include <iostream> #include <unordered_map> #include <utility> using namespace std; struct Pair { int first; int second; }; Pair twoNumbersSum(int arr[], int size, int target) { unordered_map<int, int> hashTable; for (int i = ...
ALGO
0.999963
5.785836
{ "github_metadata": { "branch": "main", "commit_count": 83, "repo_created_at": "2022-09-23T03:08: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": "8a06b466e55...
3e3cbce5-daf8-43d9-bf4e-3ed35ce3233f
t3chw/coding
find-all-anagrams-in-a-string/find-all-anagrams-in-a-string.cpp
class Solution { public: int helper(int array[26]){ for(int i =0; i<26; i++){ if(array[i] != 0){ return 0; } } return 1; } vector<int> findAnagrams(string s, string p) { int length2 = p.length(); int ...
ALGO
0.999923
5.919759
{ "github_metadata": { "branch": "main", "commit_count": 198, "repo_created_at": "2021-07-15T13:30: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": "ffba0d7962...
cac45e3b-ecb4-4fde-ba65-a7165a7bd723
PunkLi/AutoCar
src/slover/angle_slover.cpp
/******************************************************************************************************************* Copyright 2017 Dajiang Innovations Technology Co., Ltd (DJI) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Softwa...
TOOL
0.99164
5.313624
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2018-07-02T15:11:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 25, "forks": 17, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7f51065...
08a1f45c-87e9-4d03-a236-83821069f68f
anishgupta675/FINAL450
Array/Chocolate_Distribution_problem/Smallest_Subarray_with_sum_greater_than_a_given_value/main.cpp
#include<bits/stdc++.h> using namespace std; int *arr = nullptr; int getSub(int *arr, int n, int x) { int i = 0, j = 0, sum = 0, min_val = INT_MAX; while(i <= j && j < n) { while(sum <= x && j < n) sum+= arr[j++]; while(sum > x && i < j) { min_val = min(min_val, j - i); ...
ALGO
0.99996
4.451417
{ "github_metadata": { "branch": "master", "commit_count": 510, "repo_created_at": "2022-03-07T11:58: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": "d776c53c...
4c5a0539-288e-4340-959a-41171f620f07
z-learner/LeetCode
搜索/回溯/LeetCode_39_CombinationSum.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: vector<vector<int>> res; vector<vector<int>> combinationSum(vector<int>& candidates, int target) { vector<int> temp; dfs(candidates,target,0,temp, 0); return res; } void dfs(vector<int>& can...
ALGO
0.999987
5.930048
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2021-12-10T12:09:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5bbf558351...
d3cbb2d1-3dc9-4ced-b6b8-04c8ac18455b
IljaSir/CopilotSolverForLeetCode
C++/Easy/CompileError/delete-greatest-value-in-each-row_6.cpp
class Solution { public: int deleteGreatestValue(vector<vector<int>>& grid) { int m = grid.size(); int n = grid[0].size(); int res = 0; while (n > 0) { int max = 0; int index = 0; for (int i = 0; i < m; i++) { for (int j = ...
ALGO
0.99998
5.614007
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2023-07-28T08:23: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": "fd2013ec6249...
ddaca457-b9c9-4ae8-86e8-aa1840b4d171
ranchoy/hdu
bfs/hdu-1254-推箱子-双bfs一个是判断人能不能到一个是判断箱子最小耗费.cpp
#include<iostream> #include<cstdio> #include<cstring> #include<queue> #include<algorithm> #define MAX 10 using namespace std; int m,n; int map[MAX][MAX],vis[MAX][MAX][4]; int dir[4][2] = {{-1,0}, {1,0}, {0,-1}, {0,1}}; struct node { int x,y,step; int arr[MAX][MAX]; bool check() { if(x>=0 && x<m && y>=0 && y<n) ...
ALGO
0.999825
3.64476
{ "github_metadata": { "branch": "master", "commit_count": 383, "repo_created_at": "2018-05-04T15:18:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5d9e4cf8...
e62ede3f-0b81-4acf-ba92-a3bc568d15a3
mwy3055/Algorithm-codes
baekjoon/cpp/c++/1072.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; const int MAX = 2000000000; double winratio(int game, int win) { return (ll)win * 100 / game; } bool ratio_increases(int n, int m, ll game) { int z = winratio(n, m), newz = winratio(n + game, m + game); return z < newz; } int solve(int n, ...
ALGO
0.99996
3.388289
{ "github_metadata": { "branch": "main", "commit_count": 1073, "repo_created_at": "2022-01-08T11:18: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": "3b2370100...
35de2c76-0bb6-4647-a05e-f8c9d596a158
GageM/ComponentFramework
ComponentFramework/KDTree.h
#pragma once #include <Vector.h> #include <vector> #include <memory> // Like many things in this project KD trees are not ready to be used for production code // Use at you own risk namespace KDTree { class Node { public: Node(std::vector<float> point_, int index_) : point(point_), index(index_), left(nullptr)...
ALGO
0.998856
5.614788
{ "github_metadata": { "branch": "Main", "commit_count": 81, "repo_created_at": "2023-11-01T19:35: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": "d2e404df1a7...
14761d90-2405-42af-9530-3aef1c150bdd
Shikhar-S/Analysis-of-Competitive-Codebase
Data/Contest1245/all/29564844_64031679.cpp
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #define D(a) cerr << #a << " = " << a << endl #else #define D(a) #define cerr false && cerr #endif #define fastio ios_base::sync_with_stdio(0); cin.tie(0) #define dforsn(i,s,n) for(int i=int(n-1);i>=int(s);i--) #define forsn(i,s,n) for(int i=int(s);i<int(n)...
ALGO
0.999906
4.125931
{ "github_metadata": { "branch": "master", "commit_count": 74, "repo_created_at": "2019-11-22T14:40: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": "2476ca84e...
e48a972a-9754-4376-83a2-2c97c02f592b
google/sawbuck
sawbuck/viewer/provider_configuration.cc
// Copyright 2009 Google Inc. // // 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 ...
TOOL
0.908853
7.212265
{ "github_metadata": { "branch": "master", "commit_count": 2160, "repo_created_at": "2015-11-10T18:49:35.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 111, "forks": 39, "issues": 65, "pull_requests": 0 }, "file_meta": { "content_id": "c6aa...
3596805c-203b-4d5f-9490-b325e1feb964
AMReX-Microelectronics/artemis
Source/Particles/Sorting/SortingUtils.H
/* Copyright 2019-2020 <NAME>, <NAME>, <NAME> * <NAME> * * This file is part of WarpX. * * License: BSD-3-Clause-LBNL */ #ifndef WARPX_PARTICLES_SORTING_SORTINGUTILS_H_ #define WARPX_PARTICLES_SORTING_SORTINGUTILS_H_ #include "Particles/WarpXParticleContainer.H" #include <AMReX_Gpu.H> #include <AMReX_Partition....
ALGO
0.996937
7.095621
{ "github_metadata": { "branch": "development", "commit_count": 8653, "repo_created_at": "2021-03-22T20:57:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 20, "forks": 16, "issues": 9, "pull_requests": 4 }, "file_meta": { "content_id": "d...
cda4ef33-e72d-417b-9281-a2d241906f8b
yoon1/quiz.algorithm-solve
cpp/BACKJOON/graph/1956_운동.cpp
#include <iostream> #include <algorithm> #define INF 2e8 //#include <vector> using namespace std; int V, E; int map[401][401] = { 0 }; // map void printf() { printf("==========\n"); for (int i = 1; i <= V; i++) { for (int j = 1; j <= V; j++) { printf("%3d ", map[i][j]); } printf("\n"); } } void find_min...
ALGO
0.999945
4.106356
{ "github_metadata": { "branch": "master", "commit_count": 178, "repo_created_at": "2019-09-18T02:14: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": "9ebd0b70...
fbe13b73-366b-4247-87eb-1c07a92e22da
AnimeshSinha1309/algorithms-tutorial
code_graphs/prims.cpp
#include <bits/stdc++.h> using namespace std; void prims(vector<vector<pair<int, int>>> &graph, int n){ int v = 1, w = 0, sum = 0, cnt = 0; priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq; int visited[n + 1] = {0}; pq.push({w, v}); while(!pq.empty()){ p...
ALGO
0.999986
4.153888
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2021-02-28T15:27:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "251584e86c9...
08391405-e780-4a1f-bdcf-709bcb84c9f7
sc21samg/GraphicAlgorithms_2D_Rendering
code/vmlib/mat22.hpp
#ifndef MAT22_HPP_1F974C02_D0D1_4FBD_B5EE_A69C88112088 #define MAT22_HPP_1F974C02_D0D1_4FBD_B5EE_A69C88112088 #include <cmath> #include "vec2.hpp" /** Mat22f : 2x2 matrix with floats * * See comments for Vec2f for some discussion. * * The matrix is stored in row-major order. * * Example: * Mat22f identity{ ...
ALGO
0.91302
7.302011
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-08-08T19:05:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3fd872a4301f...
d5663719-a175-40a8-85f8-34386d195085
Jinmin-Goh/Codeforces
#665_Div_2/C.cpp
// Contest No.: 665 // Problem No.: C // Solver: <NAME> // Date: 20200821 #include <cstring> #include <iostream> #include <cstdlib> #include <list> #include <array> #include <atomic> #include <algorithm> #include <deque> #include <iterator> #include <map> #include <numeric> #include <queue> #include <set> ...
ALGO
0.999713
3.950426
{ "github_metadata": { "branch": "master", "commit_count": 143, "repo_created_at": "2020-04-04T08:17:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4d532f9a...
bcddcd54-7b1c-4a7b-bc8b-be915d653da6
mimsiii/C-Plus-Plus
Academy homeworks/homeworkMariya.cpp
#include<iostream> using namespace std; int main() { cout << "Task 1: Area of rectangle" << endl; int side1; int side2; int res; cout << "\nPlease, enter the vertical side of the rectangle: "; cin >> side1; cout << "Please, enter the horizontal side of the rectangle: "; cin >> side2; res = side1 * side2; ...
TOOL
0.993293
4.303571
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-06-12T18:51:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "788b7351dc3c...
e1771148-b1e5-48d3-a771-ecb2e61caccb
aamahi/algo-book
universilty/oldCodebook/SCC.cpp
#include <bits/stdc++.h> using namespace std; int node=0, edge=0; vector< int > g_input[100001],rev[100001]; int col[100001],flag=1,com[100001]; stack < int > st; /// Watch for Forest void take_input( void ) { cin >> node >> edge; int node_1,node_2,i; for( int i=0 ;i <=100001 ; i++ ) { g_inp...
ALGO
0.99994
4.67355
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2021-12-13T05:40:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b15fd41a11...
796a36dc-034d-414c-8ad4-54c54236910a
pelinakan/UBD
DegreeDistribution_v1.h
class DegreeDistribution{ friend class Network; unsigned long long int *EDDistribution; // EDDistribution: EDDistribution[E]: How many pairs is with an edit distance E unsigned long long int *EditDist; // EditDist[index] : The index of this array code for the pair and its value is the edit distance. unsigned int *d...
ALGO
0.998733
3.662639
{ "github_metadata": { "branch": "master", "commit_count": 60, "repo_created_at": "2012-05-15T13:35:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 16, "forks": 6, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "546c803d...
69245a3c-2869-480c-bbf9-55f01384a5aa
AndreyKotelnikov/UniversityEducation
Lab_PP/Lab5/other.cpp
#include "other.h" //#include <cstring> #include <string.h> /////////////////////////////////////////////////// double Sum(double a, double b) { return a + b; } double Sub(double a, double b) { return a - b; } double Mul(double a, double b) { return a * b; } double Div(double a, double b) { return a / b; } double Cal...
ALGO
0.994985
3.60379
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-12-19T14:27: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": "4f7de361eb...
61e1fe53-a864-481d-8718-5a56e54a9240
esd-univr/hif-core
src/semantics/rangeGetSum.cpp
/// @file rangeGetSum.cpp /// @brief /// @copyright (c) 2024-2025 Electronic Systems Design (ESD) Lab @ UniVR This /// file is distributed under the BSD 2-Clause License. See LICENSE.md for /// details. #include "hif/semantics/rangeGetSum.hpp" #include "hif/hif_utils/hif_utils.hpp" #include "hif/manipulation/manipula...
TOOL
0.998632
6.486466
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2025-02-06T16:51:49.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "44e2a8456faed...
83cd249e-b9d2-49f4-8f7d-e3f52ad744c7
harsh-haria/c-plus-plus
arrays/ar_merge_until_palindrome.cpp
/* Find minimum number of merge operations to make an array palindrome Given an array of positive integers. We need to make the given array a ‘Palindrome’. The only allowed operation is”merging” (of two adjacent elements). Merging two adjacent elements means replacing them with their sum. The ta...
ALGO
0.999992
4.286536
{ "github_metadata": { "branch": "master", "commit_count": 110, "repo_created_at": "2022-02-15T11:00: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": "0e38d404...
4df25a5f-6559-43f6-b8fb-503c36a43491
cdigruttola/adventCode
2020/day01/expenses.cpp
// 2 cicli for #include <iostream> #include <fstream> #include <string> #include <vector> int main() { // Read input std::ifstream file("day1.txt"); std::vector<int> expense_lines{}; for (std::string v; std::getline(file, v);) { expense_lines.push_back(std::stoi(v)); } file.close(...
ALGO
0.999892
5.140326
{ "github_metadata": { "branch": "master", "commit_count": 31, "repo_created_at": "2020-12-08T19:54: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": "bc2c6d5ce...
f1e99134-6311-4aac-b779-d1599ae11295
ADVRHumanoids/DrivingFramework
controllers/higher_level/src/steering_v8.cpp
#include "mgnss/higher_level/steering_v8.h" mgnss::higher_level::Steering8::Steering8( mwoibn::robot_class::Robot& robot, mwoibn::hierarchical_control::tasks::ContactPoint& plane, const mwoibn::VectorN& contact_vel, double K_icm, double K_sp, double K_v, double dt, double margin...
ALGO
0.99752
5.812382
{ "github_metadata": { "branch": "master", "commit_count": 374, "repo_created_at": "2017-10-04T10:48:01.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a5b2eff23...
52646942-c331-4580-bd7e-820ba7eb22fc
mckenzev/cpp-deque
deque-emulator/algo.h
#pragma once #include <deque> template<class T, class Comp> std::deque<T> Merge(const std::deque<T>& half1, const std::deque<T>& half2, const Comp& comparator) { std::deque<T> result; auto it_1 = half1.begin(); auto it_2 = half2.begin(); while (it_1 != half1.end() && it_2 != half2.end()) { if...
ALGO
0.999873
6.677804
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2025-04-10T14:32: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": "1cbe9ca8a5...
916e9717-1806-4701-9a8b-3c9b0feaded4
proisscs/chlight
ch-light.h
#ifndef FILE_CHL_SEEN #define FILE_CHL_SEEN #include <iostream> #include <vector> #include <random> #include "c.h" #include "Timer.h" #include "CHParser.h" #include <fstream> #include <limits> using namespace std; struct PQElementCH { Rank rank; Distance distance; Level min_rank; bool forward; b...
CONFIG
0.976732
4.423714
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-05-12T07:59: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": "fc2c6ad0c394...
eb6e2e21-3a87-4e15-b61f-6952fc9d09ed
tr0j4n034/SPOJ
RTREE.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <numeric> #include <algorithm> #include <functional> #include <vector> #include <queue> #include <set> #include <map> //#include <unordered_map> #include <utility> #include <cassert> #include <iomanip> #include <ctime>...
ALGO
0.999242
3.706999
{ "github_metadata": { "branch": "master", "commit_count": 442, "repo_created_at": "2017-03-20T11:02:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 96, "forks": 67, "issues": 0, "pull_requests": 6 }, "file_meta": { "content_id": "ad1062...
0a62f24f-f147-4a47-9e9e-93eaf19372d5
vedantpatil25/Leetcode-Questions-Solutions
Another Coin Change Problem - GFG/another-coin-change-problem.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; class Array { public: template <class T> static void input(vector<T> &A, int n) { for (int i = 0; i < n; i++) { scanf("%d ", &A[i]); } } template <class T> static void print(vector<T> &A) { f...
ALGO
0.999302
5.353972
{ "github_metadata": { "branch": "main", "commit_count": 474, "repo_created_at": "2023-01-21T14:13:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e22da893f9...
986feacb-eddc-4fbe-9f7e-70d1ac8f00a9
mindigoo/TIL
SAFFY/D3/D3_71_6019.cpp
// 5549 #include<bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(0); cin.tie(0); int T; cin >> T; for(int tc = 1; tc <= T; tc++){ double D, A, B, F; cin >> D >> A >> B >> F; double s1 = D / (B + F); // 파리가 B 기차와 만나는 시간 D = F * s1 - A * s1;...
ALGO
0.999626
4.579545
{ "github_metadata": { "branch": "main", "commit_count": 80, "repo_created_at": "2023-03-13T14:44: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": "d0421f7a939...
f70df419-a62e-4454-b4ae-7b1c1d6db107
draplater/empty-parser
libs/xEisner/common/parser/graph_dp/emptyeisner2ndf/emptyeisner2ndf_combdepparser.cpp
#include <cmath> #include <stack> #include <algorithm> #include <unordered_set> #include "emptyeisner2ndf_combdepparser.h" namespace emptyeisner2ndf { WordPOSTag CombDepParser::empty_taggedword = WordPOSTag(); WordPOSTag CombDepParser::start_taggedword = WordPOSTag(); WordPOSTag CombDepParser::end_taggedword = Wo...
ALGO
0.984482
4.756442
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-05-12T10:06:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "441e54c305...
15ab7acb-c5de-49f4-8d99-6275471e589b
nellyVoskanyan03/BitSet
src/main.cpp
#include <iostream> #include <vector> #include "../include/bitset.h" template <std::size_t N> std::vector<bitSet<N>> getCombination(const std::vector<bitSet<N>>& numbers, int num) { std::vector<bitSet<N>> combination; bitSet<N> mask(num); for (int i = 0; i < N; ++i) { if (mask[i]) { co...
ALGO
0.999598
5.790928
{ "github_metadata": { "branch": "develop", "commit_count": 10, "repo_created_at": "2024-08-17T18:14: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": "ed28ddd9...
d5b52a1a-bbca-40f1-8d2f-d8cdd4b439f4
Prakul-Agrawal/CSES
Introductory Problems/Digit Queries.cpp
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 typedef long long ll; typedef long double ldb; //#define int ll typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<vi> vvi; typedef vector<pii> vii; typedef vector<vii> vvii; #define ff first #define ss second ...
ALGO
0.999623
3.926368
{ "github_metadata": { "branch": "main", "commit_count": 58, "repo_created_at": "2023-01-12T06:21: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": "2db0e8c9323...
081b21f5-3cf3-4003-8c73-84a439ed2841
bitoku/atcoder
abc034/c.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mod = 1000000007; vector<long long> fact, fact_inv, inv; template< typename T > void init_combi(size_t size, const T mod) { size += 1; fact.resize(size); fact_inv.resize(size); inv.resize(size); fact[0] = fact[1] = 1; ...
ALGO
0.999973
4.642005
{ "github_metadata": { "branch": "main", "commit_count": 787, "repo_created_at": "2021-01-22T02:13: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": "e6583f93a7...
2b9d2d6a-e46f-4aa6-b834-ec59cf6eb7ea
k10tetry/data-structure-algorithm
leetcode/array/1833_maximum_ice_cream_bars.cpp
#include <bits/stdc++.h> using namespace std; /* It is a sweltering summer day, and a boy wants to buy some ice cream bars. At the store, there are n ice cream bars. You are given an array costs of length n, where costs[i] is the price of the ith ice cream bar in coins. The boy initially has coins coins to spend, a...
ALGO
0.994752
5.517058
{ "github_metadata": { "branch": "master", "commit_count": 89, "repo_created_at": "2021-09-16T17:39:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "eb2d2c16d...
e4bd20f9-efdd-455c-a560-b08f2c61b969
SakshamSahgal/Competitive-Programming
Codeforces + Codechef/B. Running for Gold.cpp
#include<iostream> #include<algorithm> #include<vector> #include<map> #include<unordered_map> #define usi unsigned short int #define ui unsigned int #define ulli unsigned long long int #define lli long long int using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int ...
ALGO
0.999947
3.510439
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2021-12-26T10:02: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": "d1e306f1b3e...
20779f0a-47db-4e18-93a6-a5bb9ee3b636
NTMyDung/Demo
122/main.cpp
#include <iostream> using namespace std; bool sodang2k( int n){ while(n%2==0&& n!=0){ // ta phan tich thua so nguyen to bang cach chia cho 2 khi con co the n=n/2; } if(n==1) return true; //neu n co dang 2^k thi khi phan tich den cuoi cung n=1 vi 2^k=2.2.2.2...2 ...
ALGO
0.999992
3.522175
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2023-01-04T09:14: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": "4432e55de6b...
97f3b2fb-52c1-4771-86f6-60bc0eb88081
Enting-Chen/Parallel-and-Distributed-Computing
final-project/src/tsp_serial2.cpp
#include <limits.h> #include <sys/time.h> #include <algorithm> #include <fstream> #include <iostream> #include <stack> #include <vector> #define GET_TIME( now ) \ { \ struct timeval t; \ gettimeofday( &t, NULL ...
ALGO
0.999747
4.044328
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2022-10-01T09:05:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b7e04a11adaa...